NOISSUE fix all clang warnings
This commit is contained in:
parent
0af04dc060
commit
cca6700134
@ -250,7 +250,7 @@ void ConsoleWindow::onProgressRequested(Task* task)
|
||||
{
|
||||
ProgressDialog progDialog(this);
|
||||
m_proc->proceed();
|
||||
progDialog.exec(task);
|
||||
progDialog.execWithTask(task);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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"),
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
|
||||
void updateSize();
|
||||
|
||||
int exec(Task *task);
|
||||
int execWithTask(Task *task);
|
||||
|
||||
void setSkipButton(bool present, QString label = QString());
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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:
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
{
|
||||
return "Legacy-upgrade";
|
||||
}
|
||||
virtual bool shouldDisplay() const;
|
||||
virtual bool shouldDisplay() const override;
|
||||
private
|
||||
slots:
|
||||
void on_upgradeButton_clicked();
|
||||
|
@ -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:
|
||||
/**
|
||||
|
@ -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:
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
{
|
||||
return "notes";
|
||||
}
|
||||
virtual bool apply();
|
||||
virtual bool apply() override;
|
||||
virtual QString helpPage() const override
|
||||
{
|
||||
return "Notes";
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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:
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
{
|
||||
return "Tools";
|
||||
}
|
||||
virtual bool apply();
|
||||
virtual bool apply() override;
|
||||
|
||||
private:
|
||||
void loadSettings();
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ class QDir;
|
||||
class QString;
|
||||
class QObject;
|
||||
class Task;
|
||||
struct BaseVersion;
|
||||
class BaseVersion;
|
||||
typedef std::shared_ptr<BaseVersion> BaseVersionPtr;
|
||||
|
||||
class MULTIMC_LOGIC_EXPORT BaseInstaller
|
||||
|
@ -22,8 +22,9 @@
|
||||
/*!
|
||||
* An abstract base class for versions.
|
||||
*/
|
||||
struct BaseVersion
|
||||
class BaseVersion
|
||||
{
|
||||
public:
|
||||
virtual ~BaseVersion() {}
|
||||
/*!
|
||||
* A string used to identify this version in config files.
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
/*!
|
||||
* Sorts the version list.
|
||||
*/
|
||||
virtual void sort() = 0;
|
||||
virtual void sortVersions() = 0;
|
||||
|
||||
protected
|
||||
slots:
|
||||
|
@ -16,11 +16,11 @@ public:
|
||||
virtual void cleanupAfterRun() override
|
||||
{
|
||||
}
|
||||
virtual QString currentVersionId() const
|
||||
virtual QString currentVersionId() const override
|
||||
{
|
||||
return "Null";
|
||||
};
|
||||
virtual QString intendedVersionId() const
|
||||
virtual QString intendedVersionId() const override
|
||||
{
|
||||
return "Null";
|
||||
};
|
||||
@ -35,50 +35,50 @@ public:
|
||||
{
|
||||
return false;
|
||||
};
|
||||
virtual QSet< QString > traits()
|
||||
virtual QSet< QString > traits() override
|
||||
{
|
||||
return {};
|
||||
};
|
||||
virtual QString instanceConfigFolder() const
|
||||
virtual QString instanceConfigFolder() const override
|
||||
{
|
||||
return instanceRoot();
|
||||
};
|
||||
virtual std::shared_ptr<LaunchTask> createLaunchTask(AuthSessionPtr)
|
||||
virtual std::shared_ptr<LaunchTask> createLaunchTask(AuthSessionPtr) override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual std::shared_ptr< Task > createUpdateTask()
|
||||
virtual std::shared_ptr< Task > createUpdateTask() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual std::shared_ptr<Task> createJarModdingTask()
|
||||
virtual std::shared_ptr<Task> createJarModdingTask() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual void setShouldUpdate(bool)
|
||||
virtual void setShouldUpdate(bool) override
|
||||
{
|
||||
};
|
||||
virtual std::shared_ptr< BaseVersionList > versionList() const
|
||||
virtual std::shared_ptr< BaseVersionList > versionList() const override
|
||||
{
|
||||
return nullptr;
|
||||
};
|
||||
virtual QProcessEnvironment createEnvironment()
|
||||
virtual QProcessEnvironment createEnvironment() override
|
||||
{
|
||||
return QProcessEnvironment();
|
||||
}
|
||||
virtual QMap<QString, QString> getVariables() const
|
||||
virtual QMap<QString, QString> getVariables() const override
|
||||
{
|
||||
return QMap<QString, QString>();
|
||||
}
|
||||
virtual IPathMatcher::Ptr getLogFileMatcher()
|
||||
virtual IPathMatcher::Ptr getLogFileMatcher() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual QString getLogFileRoot()
|
||||
virtual QString getLogFileRoot() override
|
||||
{
|
||||
return instanceRoot();
|
||||
}
|
||||
virtual QString typeName() const
|
||||
virtual QString typeName() const override
|
||||
{
|
||||
return "Null";
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "AuthSession.h"
|
||||
|
||||
#include "multimc_logic_export.h"
|
||||
MULTIMC_LOGIC_EXPORT
|
||||
|
||||
class Task;
|
||||
class YggdrasilTask;
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual void executeTask();
|
||||
virtual void executeTask() override;
|
||||
|
||||
/**
|
||||
* Gets the JSON object that will be sent to the authentication server.
|
||||
|
@ -108,7 +108,7 @@ void ForgeVersionList::updateListData(QList<BaseVersionPtr> versions)
|
||||
// sort();
|
||||
}
|
||||
|
||||
void ForgeVersionList::sort()
|
||||
void ForgeVersionList::sortVersions()
|
||||
{
|
||||
// NO-OP for now
|
||||
}
|
||||
|
@ -35,20 +35,20 @@ public:
|
||||
|
||||
explicit ForgeVersionList(QObject *parent = 0);
|
||||
|
||||
virtual Task *getLoadTask();
|
||||
virtual bool isLoaded();
|
||||
virtual const BaseVersionPtr at(int i) const;
|
||||
virtual int count() const;
|
||||
virtual void sort();
|
||||
virtual Task *getLoadTask() override;
|
||||
virtual bool isLoaded() override;
|
||||
virtual const BaseVersionPtr at(int i) const override;
|
||||
virtual int count() const override;
|
||||
virtual void sortVersions() override;
|
||||
|
||||
virtual BaseVersionPtr getLatestStable() const;
|
||||
virtual BaseVersionPtr getLatestStable() const override;
|
||||
|
||||
ForgeVersionPtr findVersionByVersionNr(QString version);
|
||||
|
||||
virtual QVariant data(const QModelIndex &index, int role) const;
|
||||
virtual QVariant data(const QModelIndex &index, int role) const override;
|
||||
virtual QList<ModelRoles> providesRoles() override;
|
||||
|
||||
virtual int columnCount(const QModelIndex &parent) const;
|
||||
virtual int columnCount(const QModelIndex &parent) const override;
|
||||
|
||||
protected:
|
||||
QList<BaseVersionPtr> m_vlist;
|
||||
@ -57,7 +57,7 @@ protected:
|
||||
|
||||
protected
|
||||
slots:
|
||||
virtual void updateListData(QList<BaseVersionPtr> versions);
|
||||
virtual void updateListData(QList<BaseVersionPtr> versions) override;
|
||||
};
|
||||
|
||||
class ForgeListLoadTask : public Task
|
||||
|
@ -13,16 +13,16 @@ public:
|
||||
|
||||
void copy(const QDir &newDir) override;
|
||||
|
||||
virtual void createProfile();
|
||||
virtual void createProfile() override;
|
||||
|
||||
virtual std::shared_ptr<Task> createUpdateTask() override;
|
||||
|
||||
virtual QString id() const;
|
||||
virtual QString id() const override;
|
||||
|
||||
QDir librariesPath() const override;
|
||||
QDir versionsPath() const override;
|
||||
bool providesVersionFile() const override;
|
||||
virtual QString typeName() const;
|
||||
virtual QString typeName() const override;
|
||||
|
||||
private:
|
||||
SettingsObjectPtr m_globalSettings;
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
{
|
||||
return javacheckers.size();
|
||||
}
|
||||
virtual bool isRunning() const
|
||||
virtual bool isRunning() const override
|
||||
{
|
||||
return m_running;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ void JavaVersionList::updateListData(QList<BaseVersionPtr> versions)
|
||||
m_vlist.push_back(std::make_shared<JavaVersion>("1.9.0_1", "32", "/foo/bar/baz"));
|
||||
m_vlist.push_back(std::make_shared<JavaVersion>("1.9.0_1", "64", "/foo/bar/baz"));
|
||||
*/
|
||||
sort();
|
||||
sortVersions();
|
||||
if(m_vlist.size())
|
||||
{
|
||||
auto best = std::dynamic_pointer_cast<JavaVersion>(m_vlist[0]);
|
||||
@ -136,7 +136,7 @@ bool sortJavas(BaseVersionPtr left, BaseVersionPtr right)
|
||||
return labove19 < rabove19;
|
||||
}
|
||||
|
||||
void JavaVersionList::sort()
|
||||
void JavaVersionList::sortVersions()
|
||||
{
|
||||
beginResetModel();
|
||||
std::sort(m_vlist.begin(), m_vlist.end(), sortJavas);
|
||||
|
@ -66,13 +66,13 @@ public:
|
||||
virtual bool isLoaded() override;
|
||||
virtual const BaseVersionPtr at(int i) const override;
|
||||
virtual int count() const override;
|
||||
virtual void sort() override;
|
||||
virtual void sortVersions() override;
|
||||
|
||||
virtual QVariant data(const QModelIndex &index, int role) const override;
|
||||
virtual RoleList providesRoles() override;
|
||||
|
||||
public slots:
|
||||
virtual void updateListData(QList<BaseVersionPtr> versions);
|
||||
virtual void updateListData(QList<BaseVersionPtr> versions) override;
|
||||
|
||||
protected:
|
||||
QList<BaseVersionPtr> m_vlist;
|
||||
|
@ -85,8 +85,8 @@ public:
|
||||
QString censorPrivateInfo(QString in);
|
||||
|
||||
protected: /* methods */
|
||||
virtual void emitFailed(QString reason);
|
||||
virtual void emitSucceeded();
|
||||
virtual void emitFailed(QString reason) override;
|
||||
virtual void emitSucceeded() override;
|
||||
|
||||
signals:
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ static bool cmpVersions(BaseVersionPtr first, BaseVersionPtr second)
|
||||
return left->timestamp > right->timestamp;
|
||||
}
|
||||
|
||||
void LiteLoaderVersionList::sort()
|
||||
void LiteLoaderVersionList::sortVersions()
|
||||
{
|
||||
beginResetModel();
|
||||
std::sort(m_vlist.begin(), m_vlist.end(), cmpVersions);
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
virtual bool isLoaded();
|
||||
virtual const BaseVersionPtr at(int i) const;
|
||||
virtual int count() const;
|
||||
virtual void sort();
|
||||
virtual void sortVersions();
|
||||
virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
|
||||
virtual QList< ModelRoles > providesRoles();
|
||||
|
||||
|
@ -186,7 +186,7 @@ std::shared_ptr<Task> LegacyInstance::createJarModdingTask()
|
||||
class JarModTask : public Task
|
||||
{
|
||||
public:
|
||||
explicit JarModTask(std::shared_ptr<LegacyInstance> inst) : m_inst(inst), Task(nullptr)
|
||||
explicit JarModTask(std::shared_ptr<LegacyInstance> inst) : Task(nullptr), m_inst(inst)
|
||||
{
|
||||
}
|
||||
virtual void executeTask()
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
|
||||
explicit LegacyInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
|
||||
|
||||
virtual void init() {};
|
||||
virtual void init() override {};
|
||||
|
||||
/// Path to the instance's minecraft.jar
|
||||
QString runnableJar() const;
|
||||
@ -105,7 +105,7 @@ public:
|
||||
virtual QString intendedVersionId() const override;
|
||||
virtual bool setIntendedVersionId(QString version) override;
|
||||
|
||||
virtual QSet<QString> traits()
|
||||
virtual QSet<QString> traits() override
|
||||
{
|
||||
return {"legacy-instance", "texturepacks"};
|
||||
};
|
||||
@ -120,7 +120,7 @@ public:
|
||||
|
||||
virtual void cleanupAfterRun() override;
|
||||
|
||||
virtual QString typeName() const;
|
||||
virtual QString typeName() const override;
|
||||
|
||||
protected:
|
||||
mutable std::shared_ptr<ModList> jar_mod_list;
|
||||
|
@ -68,7 +68,7 @@ class MULTIMC_LOGIC_EXPORT LWJGLVersionList : public BaseVersionList
|
||||
public:
|
||||
explicit LWJGLVersionList(QObject *parent = 0);
|
||||
|
||||
bool isLoaded()
|
||||
bool isLoaded() override
|
||||
{
|
||||
return m_vlist.length() > 0;
|
||||
}
|
||||
@ -77,27 +77,27 @@ public:
|
||||
return m_vlist[i];
|
||||
}
|
||||
|
||||
virtual Task* getLoadTask()
|
||||
virtual Task* getLoadTask() override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual void sort() {};
|
||||
virtual void sortVersions() override {};
|
||||
|
||||
virtual void updateListData(QList< BaseVersionPtr > versions) {};
|
||||
virtual void updateListData(QList< BaseVersionPtr > versions) override {};
|
||||
|
||||
int count() const
|
||||
int count() const override
|
||||
{
|
||||
return m_vlist.length();
|
||||
}
|
||||
|
||||
virtual QVariant data(const QModelIndex &index, int role) const;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
virtual int rowCount(const QModelIndex &parent) const
|
||||
virtual QVariant data(const QModelIndex &index, int role) const override;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
virtual int rowCount(const QModelIndex &parent) const override
|
||||
{
|
||||
return count();
|
||||
}
|
||||
virtual int columnCount(const QModelIndex &parent) const;
|
||||
virtual int columnCount(const QModelIndex &parent) const override;
|
||||
|
||||
virtual bool isLoading() const;
|
||||
virtual bool errored() const
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
}
|
||||
|
||||
//FIXME: nuke?
|
||||
virtual std::shared_ptr< BaseVersionList > versionList() const;
|
||||
virtual std::shared_ptr<BaseVersionList> versionList() const override;
|
||||
|
||||
/// get arguments passed to java
|
||||
QStringList javaArguments() const;
|
||||
@ -49,7 +49,7 @@ public:
|
||||
virtual QProcessEnvironment createEnvironment() override;
|
||||
|
||||
/// guess log level from a line of minecraft log
|
||||
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level);
|
||||
virtual MessageLevel::Enum guessLevel(const QString &line, MessageLevel::Enum level) override;
|
||||
|
||||
virtual IPathMatcher::Ptr getLogFileMatcher() override;
|
||||
|
||||
|
@ -150,7 +150,7 @@ bool MinecraftProfile::customize(int index)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MinecraftProfile::revert(int index)
|
||||
bool MinecraftProfile::revertToBase(int index)
|
||||
{
|
||||
auto patch = versionPatch(index);
|
||||
if (!patch->isRevertible())
|
||||
|
@ -45,11 +45,11 @@ public:
|
||||
void setStrategy(ProfileStrategy * strategy);
|
||||
ProfileStrategy *strategy();
|
||||
|
||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
virtual int columnCount(const QModelIndex &parent) const;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
virtual int columnCount(const QModelIndex &parent) const override;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
/// is this version unchanged by the user?
|
||||
bool isVanilla();
|
||||
@ -75,7 +75,7 @@ public:
|
||||
|
||||
bool customize(int index);
|
||||
|
||||
bool revert(int index);
|
||||
bool revertToBase(int index);
|
||||
|
||||
void resetOrder();
|
||||
|
||||
|
@ -335,7 +335,7 @@ void MinecraftVersionList::loadMojangList(QJsonDocument jsonDoc, VersionSource s
|
||||
}
|
||||
}
|
||||
|
||||
void MinecraftVersionList::sort()
|
||||
void MinecraftVersionList::sortVersions()
|
||||
{
|
||||
beginResetModel();
|
||||
sortInternal();
|
||||
|
@ -47,13 +47,13 @@ public:
|
||||
|
||||
std::shared_ptr<Task> createUpdateTask(QString version);
|
||||
|
||||
virtual Task *getLoadTask();
|
||||
virtual bool isLoaded();
|
||||
virtual const BaseVersionPtr at(int i) const;
|
||||
virtual int count() const;
|
||||
virtual void sort();
|
||||
virtual QVariant data(const QModelIndex & index, int role) const;
|
||||
virtual RoleList providesRoles();
|
||||
virtual Task *getLoadTask() override;
|
||||
virtual bool isLoaded() override;
|
||||
virtual const BaseVersionPtr at(int i) const override;
|
||||
virtual int count() const override;
|
||||
virtual void sortVersions() override;
|
||||
virtual QVariant data(const QModelIndex & index, int role) const override;
|
||||
virtual RoleList providesRoles() override;
|
||||
|
||||
virtual BaseVersionPtr getLatestStable() const override;
|
||||
virtual BaseVersionPtr getRecommended() const override;
|
||||
@ -69,5 +69,5 @@ protected:
|
||||
|
||||
protected
|
||||
slots:
|
||||
virtual void updateListData(QList<BaseVersionPtr> versions);
|
||||
virtual void updateListData(QList<BaseVersionPtr> versions) override;
|
||||
};
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
explicit OneSixInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir);
|
||||
virtual ~OneSixInstance(){};
|
||||
|
||||
virtual void init();
|
||||
virtual void init() override;
|
||||
|
||||
////// Mod Lists //////
|
||||
std::shared_ptr<ModList> loaderModList() const;
|
||||
@ -40,7 +40,7 @@ public:
|
||||
virtual QList<Mod> getJarMods() const override;
|
||||
virtual void createProfile();
|
||||
|
||||
virtual QSet<QString> traits();
|
||||
virtual QSet<QString> traits() override;
|
||||
|
||||
////// Directories and files //////
|
||||
QString jarModsDir() const;
|
||||
@ -90,7 +90,7 @@ public:
|
||||
|
||||
std::shared_ptr<OneSixInstance> getSharedPtr();
|
||||
|
||||
virtual QString typeName() const;
|
||||
virtual QString typeName() const override;
|
||||
|
||||
signals:
|
||||
void versionReloaded();
|
||||
|
@ -49,15 +49,15 @@ public:
|
||||
|
||||
bool reload() override;
|
||||
|
||||
void suspendSave();
|
||||
void resumeSave();
|
||||
void suspendSave() override;
|
||||
void resumeSave() override;
|
||||
|
||||
protected slots:
|
||||
virtual void changeSetting(const Setting &setting, QVariant value);
|
||||
virtual void resetSetting(const Setting &setting);
|
||||
virtual void changeSetting(const Setting &setting, QVariant value) override;
|
||||
virtual void resetSetting(const Setting &setting) override;
|
||||
|
||||
protected:
|
||||
virtual QVariant retrieveValue(const Setting &setting);
|
||||
virtual QVariant retrieveValue(const Setting &setting) override;
|
||||
void doSave();
|
||||
|
||||
protected:
|
||||
|
@ -98,11 +98,11 @@ private slots:
|
||||
QCOMPARE(Util::versionIsInInterval(version, interval), result);
|
||||
}
|
||||
|
||||
void test_versionCompareLessThan_data()
|
||||
void test_versionCompare_data()
|
||||
{
|
||||
setupVersions();
|
||||
}
|
||||
void test_versionCompareLessThan()
|
||||
void test_versionCompare()
|
||||
{
|
||||
QFETCH(QString, first);
|
||||
QFETCH(QString, second);
|
||||
@ -113,37 +113,7 @@ private slots:
|
||||
const auto v2 = Util::Version(second);
|
||||
|
||||
QCOMPARE(v1 < v2, lessThan);
|
||||
}
|
||||
void test_versionCompareGreaterThan_data()
|
||||
{
|
||||
setupVersions();
|
||||
}
|
||||
void test_versionCompareGreaterThan()
|
||||
{
|
||||
QFETCH(QString, first);
|
||||
QFETCH(QString, second);
|
||||
QFETCH(bool, lessThan);
|
||||
QFETCH(bool, equal);
|
||||
|
||||
const auto v1 = Util::Version(first);
|
||||
const auto v2 = Util::Version(second);
|
||||
|
||||
QCOMPARE(v1 > v2, !lessThan && !equal);
|
||||
}
|
||||
void test_versionCompareEqual_data()
|
||||
{
|
||||
setupVersions();
|
||||
}
|
||||
void test_versionCompareEqual()
|
||||
{
|
||||
QFETCH(QString, first);
|
||||
QFETCH(QString, second);
|
||||
QFETCH(bool, lessThan);
|
||||
QFETCH(bool, equal);
|
||||
|
||||
const auto v1 = Util::Version(first);
|
||||
const auto v2 = Util::Version(second);
|
||||
|
||||
QCOMPARE(v1 == v2, equal);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user