diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-09-26 04:04:09 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-09-26 04:04:09 +0200 |
commit | cca670013463f0062cec950d9b9bb76f9150ed93 (patch) | |
tree | f3a80479a0184f5f25af6c0ca42714cc7ba4e9c5 /application | |
parent | 0af04dc060cfe94f25d1d3691c8bb87cbab1ecc5 (diff) | |
download | MultiMC-cca670013463f0062cec950d9b9bb76f9150ed93.tar MultiMC-cca670013463f0062cec950d9b9bb76f9150ed93.tar.gz MultiMC-cca670013463f0062cec950d9b9bb76f9150ed93.tar.lz MultiMC-cca670013463f0062cec950d9b9bb76f9150ed93.tar.xz MultiMC-cca670013463f0062cec950d9b9bb76f9150ed93.zip |
NOISSUE fix all clang warnings
Diffstat (limited to 'application')
26 files changed, 50 insertions, 49 deletions
diff --git a/application/ConsoleWindow.cpp b/application/ConsoleWindow.cpp index 9de0ec5d..239f538e 100644 --- a/application/ConsoleWindow.cpp +++ b/application/ConsoleWindow.cpp @@ -250,7 +250,7 @@ void ConsoleWindow::onProgressRequested(Task* task) { ProgressDialog progDialog(this); m_proc->proceed(); - progDialog.exec(task); + progDialog.execWithTask(task); } diff --git a/application/GuiUtil.cpp b/application/GuiUtil.cpp index edfe9951..442922cd 100644 --- a/application/GuiUtil.cpp +++ b/application/GuiUtil.cpp @@ -26,7 +26,7 @@ void GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget) return; } - dialog.exec(paste.get()); + dialog.execWithTask(paste.get()); if (!paste->successful()) { CustomMessageBox::selectable(parentWidget, QObject::tr("Upload failed"), diff --git a/application/LaunchInteraction.cpp b/application/LaunchInteraction.cpp index c7ef942a..497e43ea 100644 --- a/application/LaunchInteraction.cpp +++ b/application/LaunchInteraction.cpp @@ -93,7 +93,7 @@ void LaunchController::login() ProgressDialog progDialog(m_parentWidget); if (m_online) progDialog.setSkipButton(true, tr("Play Offline")); - progDialog.exec(task.get()); + progDialog.execWithTask(task.get()); if (!task->successful()) { auto failReasonNew = task->failReason(); diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index e9f651cb..4ba717d3 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -972,7 +972,7 @@ void MainWindow::downloadUpdates(GoUpdate::Status status) } GoUpdate::DownloadTask updateTask(status, dlPath, &updateDlg); // If the task succeeds, install the updates. - if (updateDlg.exec(&updateTask)) + if (updateDlg.execWithTask(&updateTask)) { MMC->installUpdates(updateTask.updateFilesDir(), updateTask.operations()); } @@ -1065,7 +1065,7 @@ InstancePtr MainWindow::instanceFromZipPack(QString instName, QString instGroup, // FIXME: possibly causes endless loop problems ProgressDialog dlDialog(this); - if (dlDialog.exec(&job) != QDialog::Accepted) + if (dlDialog.execWithTask(&job) != QDialog::Accepted) { return nullptr; } @@ -1199,7 +1199,7 @@ void MainWindow::finalizeInstance(InstancePtr inst) CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning) ->show(); }); - loadDialog.exec(update.get()); + loadDialog.execWithTask(update.get()); } else { @@ -1289,7 +1289,7 @@ void MainWindow::on_actionChangeInstIcon_triggered() return; IconPickerDialog dlg(this); - dlg.exec(m_selectedInstance->iconKey()); + dlg.execWithSelection(m_selectedInstance->iconKey()); if (dlg.result() == QDialog::Accepted) { m_selectedInstance->setIconKey(dlg.selectedIconKey); diff --git a/application/VersionProxyModel.cpp b/application/VersionProxyModel.cpp index 743ffad0..4db5cbd0 100644 --- a/application/VersionProxyModel.cpp +++ b/application/VersionProxyModel.cpp @@ -309,8 +309,9 @@ void VersionProxyModel::sourceDataChanged(const QModelIndex &source_top_left, emit dataChanged(topLeft, bottomRight); } -void VersionProxyModel::setSourceModel(BaseVersionList *replacing) +void VersionProxyModel::setSourceModel(QAbstractItemModel *replacingRaw) { + auto replacing = dynamic_cast<BaseVersionList *>(replacingRaw); beginResetModel(); if(!replacing) diff --git a/application/VersionProxyModel.h b/application/VersionProxyModel.h index 68bb816f..19e89271 100644 --- a/application/VersionProxyModel.h +++ b/application/VersionProxyModel.h @@ -36,7 +36,7 @@ public: virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; virtual QModelIndex parent(const QModelIndex &child) const override; - void setSourceModel(BaseVersionList *sourceModel); + virtual void setSourceModel(QAbstractItemModel *sourceModel) override; const FilterMap &filters() const; void setFilter(const BaseVersionList::ModelRoles column, const QString &filter, const bool exact); diff --git a/application/dialogs/CopyInstanceDialog.cpp b/application/dialogs/CopyInstanceDialog.cpp index 0e94540c..54c42f29 100644 --- a/application/dialogs/CopyInstanceDialog.cpp +++ b/application/dialogs/CopyInstanceDialog.cpp @@ -82,7 +82,7 @@ QString CopyInstanceDialog::instGroup() const void CopyInstanceDialog::on_iconButton_clicked() { IconPickerDialog dlg(this); - dlg.exec(InstIconKey); + dlg.execWithSelection(InstIconKey); if (dlg.result() == QDialog::Accepted) { diff --git a/application/dialogs/IconPickerDialog.cpp b/application/dialogs/IconPickerDialog.cpp index 7bde6fd0..f750cd27 100644 --- a/application/dialogs/IconPickerDialog.cpp +++ b/application/dialogs/IconPickerDialog.cpp @@ -126,7 +126,7 @@ void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection selectedIconKey = key; } -int IconPickerDialog::exec(QString selection) +int IconPickerDialog::execWithSelection(QString selection) { auto list = ENV.icons(); auto contentsWidget = ui->iconView; diff --git a/application/dialogs/IconPickerDialog.h b/application/dialogs/IconPickerDialog.h index 610d9306..e57374a7 100644 --- a/application/dialogs/IconPickerDialog.h +++ b/application/dialogs/IconPickerDialog.h @@ -29,7 +29,7 @@ class IconPickerDialog : public QDialog public: explicit IconPickerDialog(QWidget *parent = 0); ~IconPickerDialog(); - int exec(QString selection); + int execWithSelection(QString selection); QString selectedIconKey; protected: diff --git a/application/dialogs/NewInstanceDialog.cpp b/application/dialogs/NewInstanceDialog.cpp index 0360f5f1..0d54172d 100644 --- a/application/dialogs/NewInstanceDialog.cpp +++ b/application/dialogs/NewInstanceDialog.cpp @@ -122,9 +122,10 @@ void NewInstanceDialog::updateDialogState() { ui->instNameTextBox->setPlaceholderText(suggestedName); } - bool allowOK = !instName().isEmpty() && - (ui->versionBox->isChecked() && m_selectedVersion || - (ui->modpackBox->isChecked() && ui->modpackEdit->hasAcceptableInput())); + bool allowOK = !instName().isEmpty() && ( + (ui->versionBox->isChecked() && m_selectedVersion) || + (ui->modpackBox->isChecked() && ui->modpackEdit->hasAcceptableInput()) + ); ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(allowOK); } @@ -206,7 +207,7 @@ void NewInstanceDialog::on_btnChangeVersion_clicked() void NewInstanceDialog::on_iconButton_clicked() { IconPickerDialog dlg(this); - dlg.exec(InstIconKey); + dlg.execWithSelection(InstIconKey); if (dlg.result() == QDialog::Accepted) { diff --git a/application/dialogs/ProgressDialog.cpp b/application/dialogs/ProgressDialog.cpp index 83f82d33..bca4e168 100644 --- a/application/dialogs/ProgressDialog.cpp +++ b/application/dialogs/ProgressDialog.cpp @@ -52,7 +52,7 @@ void ProgressDialog::updateSize() resize(QSize(480, minimumSizeHint().height())); } -int ProgressDialog::exec(Task *task) +int ProgressDialog::execWithTask(Task *task) { this->task = task; QDialog::DialogCode result; diff --git a/application/dialogs/ProgressDialog.h b/application/dialogs/ProgressDialog.h index 44cbbe88..9ddbceb1 100644 --- a/application/dialogs/ProgressDialog.h +++ b/application/dialogs/ProgressDialog.h @@ -34,7 +34,7 @@ public: void updateSize(); - int exec(Task *task); + int execWithTask(Task *task); void setSkipButton(bool present, QString label = QString()); diff --git a/application/pages/InstanceSettingsPage.h b/application/pages/InstanceSettingsPage.h index f85de678..1fc0bdfe 100644 --- a/application/pages/InstanceSettingsPage.h +++ b/application/pages/InstanceSettingsPage.h @@ -49,12 +49,12 @@ public: { return "settings"; } - virtual bool apply(); + virtual bool apply() override; virtual QString helpPage() const override { return "Instance-settings"; } - virtual bool shouldDisplay() const; + virtual bool shouldDisplay() const override; private slots: void on_javaDetectBtn_clicked(); diff --git a/application/pages/LegacyJarModPage.h b/application/pages/LegacyJarModPage.h index 9ca862ff..698e7ff6 100644 --- a/application/pages/LegacyJarModPage.h +++ b/application/pages/LegacyJarModPage.h @@ -36,15 +36,15 @@ public: explicit LegacyJarModPage(LegacyInstance *inst, QWidget *parent = 0); virtual ~LegacyJarModPage(); - virtual QString displayName() const + virtual QString displayName() const override { return tr("Jar Mods"); } - virtual QIcon icon() const + virtual QIcon icon() const override { return MMC->getThemedIcon("jarmods"); } - virtual QString id() const + virtual QString id() const override { return "jarmods"; } @@ -52,7 +52,7 @@ public: { return "Legacy-jar-mods"; } - virtual bool shouldDisplay() const; + virtual bool shouldDisplay() const override; private slots: diff --git a/application/pages/LegacyUpgradePage.h b/application/pages/LegacyUpgradePage.h index f39bff95..8d1131c8 100644 --- a/application/pages/LegacyUpgradePage.h +++ b/application/pages/LegacyUpgradePage.h @@ -49,7 +49,7 @@ public: { return "Legacy-upgrade"; } - virtual bool shouldDisplay() const; + virtual bool shouldDisplay() const override; private slots: void on_upgradeButton_clicked(); diff --git a/application/pages/LogPage.h b/application/pages/LogPage.h index 169319a3..b34a63af 100644 --- a/application/pages/LogPage.h +++ b/application/pages/LogPage.h @@ -48,13 +48,13 @@ public: { return "console"; } - virtual bool apply(); + virtual bool apply() override; virtual QString helpPage() const override { return "Minecraft-Logs"; } - virtual bool shouldDisplay() const; - virtual void setParentContainer(BasePageContainer *); + virtual bool shouldDisplay() const override; + virtual void setParentContainer(BasePageContainer *) override; private slots: /** diff --git a/application/pages/ModFolderPage.h b/application/pages/ModFolderPage.h index cbd98cb7..0870aa64 100644 --- a/application/pages/ModFolderPage.h +++ b/application/pages/ModFolderPage.h @@ -58,12 +58,12 @@ public: { return m_helpName; } - virtual bool shouldDisplay() const; + virtual bool shouldDisplay() const override; - virtual void opened(); - virtual void closed(); + virtual void opened() override; + virtual void closed() override; protected: - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(QObject *obj, QEvent *ev) override; bool modListFilter(QKeyEvent *ev); protected: diff --git a/application/pages/NotesPage.h b/application/pages/NotesPage.h index e9e5aa48..c259d60e 100644 --- a/application/pages/NotesPage.h +++ b/application/pages/NotesPage.h @@ -48,7 +48,7 @@ public: { return "notes"; } - virtual bool apply(); + virtual bool apply() override; virtual QString helpPage() const override { return "Notes"; diff --git a/application/pages/ScreenshotsPage.cpp b/application/pages/ScreenshotsPage.cpp index 9174b33b..2a8d7a43 100644 --- a/application/pages/ScreenshotsPage.cpp +++ b/application/pages/ScreenshotsPage.cpp @@ -73,7 +73,6 @@ public: small = image.scaledToWidth(512).scaledToWidth(256, Qt::SmoothTransformation); else small = image.scaledToHeight(512).scaledToHeight(256, Qt::SmoothTransformation); - auto smallSize = small.size(); QPoint offset((256 - small.width()) / 2, (256 - small.height()) / 2); QImage square(QSize(256, 256), QImage::Format_ARGB32); square.fill(Qt::transparent); @@ -302,7 +301,7 @@ void ScreenshotsPage::on_uploadBtn_clicked() task.addTask(job.unwrap()); task.addTask(albumTask.unwrap()); ProgressDialog prog(this); - if (prog.exec(&task) != QDialog::Accepted) + if (prog.execWithTask(&task) != QDialog::Accepted) { CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"), tr("Unknown error"), QMessageBox::Warning)->exec(); diff --git a/application/pages/ScreenshotsPage.h b/application/pages/ScreenshotsPage.h index f5700ba8..f19ff35f 100644 --- a/application/pages/ScreenshotsPage.h +++ b/application/pages/ScreenshotsPage.h @@ -46,7 +46,7 @@ public: NothingDone = 0x42 }; - virtual bool eventFilter(QObject *, QEvent *); + virtual bool eventFilter(QObject *, QEvent *) override; virtual QString displayName() const override { return tr("Screenshots"); diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 36091630..e6933da7 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -275,7 +275,7 @@ int VersionPage::doUpdate() } ProgressDialog tDialog(this); connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString))); - int ret = tDialog.exec(updateTask.get()); + int ret = tDialog.execWithTask(updateTask.get()); updateButtons(); return ret; } @@ -290,7 +290,7 @@ void VersionPage::on_forgeBtn_clicked() if (vselect.exec() && vselect.selectedVersion()) { ProgressDialog dialog(this); - dialog.exec( + dialog.execWithTask( ForgeInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); preselect(m_version->rowCount(QModelIndex())-1); } @@ -307,7 +307,7 @@ void VersionPage::on_liteloaderBtn_clicked() if (vselect.exec() && vselect.selectedVersion()) { ProgressDialog dialog(this); - dialog.exec( + dialog.execWithTask( LiteLoaderInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); preselect(m_version->rowCount(QModelIndex())-1); } @@ -447,7 +447,7 @@ void VersionPage::on_revertBtn_clicked() return; } } - if(!m_version->revert(version)) + if(!m_version->revertToBase(version)) { // TODO: some error box here } diff --git a/application/pages/VersionPage.h b/application/pages/VersionPage.h index bd22e140..8f2bf024 100644 --- a/application/pages/VersionPage.h +++ b/application/pages/VersionPage.h @@ -45,9 +45,9 @@ public: { return "Instance-Versions"; } - virtual bool shouldDisplay() const; + virtual bool shouldDisplay() const override; - virtual void setParentContainer(BasePageContainer *); + virtual void setParentContainer(BasePageContainer *) override; private slots: void on_forgeBtn_clicked(); diff --git a/application/pages/WorldListPage.cpp b/application/pages/WorldListPage.cpp index a952d02c..6bea9dbd 100644 --- a/application/pages/WorldListPage.cpp +++ b/application/pages/WorldListPage.cpp @@ -31,7 +31,7 @@ WorldListPage::WorldListPage(BaseInstance *inst, std::shared_ptr<WorldList> worlds, QString id, QString iconName, QString displayName, QString helpPage, QWidget *parent) - : QWidget(parent), ui(new Ui::WorldListPage), m_worlds(worlds), m_inst(inst), m_id(id), m_displayName(displayName), m_iconName(iconName), m_helpName(helpPage) + : QWidget(parent), m_inst(inst), ui(new Ui::WorldListPage), m_worlds(worlds), m_iconName(iconName), m_id(id), m_displayName(displayName), m_helpName(helpPage) { ui->setupUi(this); ui->tabWidget->tabBar()->hide(); diff --git a/application/pages/WorldListPage.h b/application/pages/WorldListPage.h index 5cf0966a..1ef441a6 100644 --- a/application/pages/WorldListPage.h +++ b/application/pages/WorldListPage.h @@ -54,13 +54,13 @@ public: { return m_helpName; } - virtual bool shouldDisplay() const; + virtual bool shouldDisplay() const override; - virtual void opened(); - virtual void closed(); + virtual void opened() override; + virtual void closed() override; protected: - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(QObject *obj, QEvent *ev) override; bool worldListFilter(QKeyEvent *ev); protected: diff --git a/application/pages/global/ExternalToolsPage.h b/application/pages/global/ExternalToolsPage.h index b7db8450..01fe8880 100644 --- a/application/pages/global/ExternalToolsPage.h +++ b/application/pages/global/ExternalToolsPage.h @@ -53,7 +53,7 @@ public: { return "Tools"; } - virtual bool apply(); + virtual bool apply() override; private: void loadSettings(); diff --git a/application/widgets/VersionListView.h b/application/widgets/VersionListView.h index 4fcbd8ee..8f16344e 100644 --- a/application/widgets/VersionListView.h +++ b/application/widgets/VersionListView.h @@ -25,7 +25,7 @@ public: explicit VersionListView(QWidget *parent = 0); virtual void paintEvent(QPaintEvent *event) override; - virtual void setModel ( QAbstractItemModel* model ); + virtual void setModel(QAbstractItemModel* model) override; enum EmptyMode { |