clang-format

Signed-off-by: Evan Goode <mail@evangoo.de>
This commit is contained in:
Evan Goode 2024-08-11 22:06:26 -04:00
parent 5345b0b682
commit 5e93cff2d0
66 changed files with 99 additions and 102 deletions

View File

@ -960,8 +960,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
[[fallthrough]]; [[fallthrough]];
default: { default: {
qDebug() << "Exiting because update lockfile is present"; qDebug() << "Exiting because update lockfile is present";
QMetaObject::invokeMethod( QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
this, []() { exit(1); }, Qt::QueuedConnection);
return; return;
} }
} }
@ -993,8 +992,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
[[fallthrough]]; [[fallthrough]];
default: { default: {
qDebug() << "Exiting because update lockfile is present"; qDebug() << "Exiting because update lockfile is present";
QMetaObject::invokeMethod( QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
this, []() { exit(1); }, Qt::QueuedConnection);
return; return;
} }
} }
@ -1707,8 +1705,7 @@ QString Application::getJarPath(QString jarFile)
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME), FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
#endif #endif
FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars"),
FS::PathCombine(applicationDirPath(), "jars"),
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
}; };
for (QString p : potentialPaths) { for (QString p : potentialPaths) {

View File

@ -29,7 +29,7 @@ class BaseVersion;
class BaseInstaller { class BaseInstaller {
public: public:
BaseInstaller(); BaseInstaller();
virtual ~BaseInstaller(){}; virtual ~BaseInstaller() {};
bool isApplied(MinecraftInstance* on); bool isApplied(MinecraftInstance* on);
virtual bool add(MinecraftInstance* to); virtual bool add(MinecraftInstance* to);

View File

@ -31,7 +31,7 @@ class CreateAuthlibInjectorAccount : public NetAction {
} }
MinecraftAccountPtr getAccount(); MinecraftAccountPtr getAccount();
void init() override{}; void init() override {};
protected slots: protected slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override {} void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override {}

View File

@ -22,7 +22,7 @@ class InstancePageProvider : protected QObject, public BasePageProvider {
public: public:
explicit InstancePageProvider(InstancePtr parent) { inst = parent; } explicit InstancePageProvider(InstancePtr parent) { inst = parent; }
virtual ~InstancePageProvider(){}; virtual ~InstancePageProvider() {};
virtual QList<BasePage*> getPages() override virtual QList<BasePage*> getPages() override
{ {
QList<BasePage*> values; QList<BasePage*> values;

View File

@ -24,7 +24,7 @@ class TestCheck : public QObject {
TestCheck(QWidget* parent, QString path, QString args, int minMem, int maxMem, int permGen) TestCheck(QWidget* parent, QString path, QString args, int minMem, int maxMem, int permGen)
: m_parent(parent), m_path(path), m_args(args), m_minMem(minMem), m_maxMem(maxMem), m_permGen(permGen) : m_parent(parent), m_path(path), m_args(args), m_minMem(minMem), m_maxMem(maxMem), m_permGen(permGen)
{} {}
virtual ~TestCheck(){}; virtual ~TestCheck() {};
void run(); void run();

View File

@ -50,7 +50,7 @@ class LaunchController : public Task {
void executeTask() override; void executeTask() override;
LaunchController(QObject* parent = nullptr); LaunchController(QObject* parent = nullptr);
virtual ~LaunchController(){}; virtual ~LaunchController() {};
void setInstance(InstancePtr instance) { m_instance = instance; } void setInstance(InstancePtr instance) { m_instance = instance; }

View File

@ -176,7 +176,7 @@ class ExportToZipTask : public Task {
QString destinationPrefix = "", QString destinationPrefix = "",
bool followSymlinks = false, bool followSymlinks = false,
bool utf8Enabled = false) bool utf8Enabled = false)
: ExportToZipTask(outputPath, QDir(dir), files, destinationPrefix, followSymlinks, utf8Enabled){}; : ExportToZipTask(outputPath, QDir(dir), files, destinationPrefix, followSymlinks, utf8Enabled) {};
virtual ~ExportToZipTask() = default; virtual ~ExportToZipTask() = default;

View File

@ -46,7 +46,7 @@ class NullInstance : public BaseInstance {
{ {
setVersionBroken(true); setVersionBroken(true);
} }
virtual ~NullInstance(){}; virtual ~NullInstance() {};
void saveNow() override {} void saveNow() override {}
void loadSpecificSettings() override { setSpecificSettingsLoaded(true); } void loadSpecificSettings() override { setSpecificSettingsLoaded(true); }
QString getStatusbarDescription() override { return tr("Unknown instance type"); }; QString getStatusbarDescription() override { return tr("Unknown instance type"); };

View File

@ -14,7 +14,7 @@ class VersionProxyModel : public QAbstractProxyModel {
public: public:
VersionProxyModel(QObject* parent = 0); VersionProxyModel(QObject* parent = 0);
virtual ~VersionProxyModel(){}; virtual ~VersionProxyModel() {};
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const override; virtual int columnCount(const QModelIndex& parent = QModelIndex()) const override;
virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override;

View File

@ -52,7 +52,7 @@ class IconList : public QAbstractListModel {
Q_OBJECT Q_OBJECT
public: public:
explicit IconList(const QStringList& builtinPaths, QString path, QObject* parent = 0); explicit IconList(const QStringList& builtinPaths, QString path, QObject* parent = 0);
virtual ~IconList(){}; virtual ~IconList() {};
QIcon getIcon(const QString& key) const; QIcon getIcon(const QString& key) const;
int getIconIndex(const QString& key) const; int getIconIndex(const QString& key) const;

View File

@ -26,8 +26,8 @@ using JavaCheckerJobPtr = shared_qobject_ptr<JavaCheckerJob>;
class JavaCheckerJob : public Task { class JavaCheckerJob : public Task {
Q_OBJECT Q_OBJECT
public: public:
explicit JavaCheckerJob(QString job_name) : Task(), m_job_name(job_name){}; explicit JavaCheckerJob(QString job_name) : Task(), m_job_name(job_name) {};
virtual ~JavaCheckerJob(){}; virtual ~JavaCheckerJob() {};
bool addJavaCheckerAction(JavaCheckerPtr base) bool addJavaCheckerAction(JavaCheckerPtr base)
{ {

View File

@ -79,11 +79,9 @@ QProcessEnvironment CleanEnviroment()
QStringList stripped = { QStringList stripped = {
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
"LD_LIBRARY_PATH", "LD_LIBRARY_PATH", "LD_PRELOAD",
"LD_PRELOAD",
#endif #endif
"QT_PLUGIN_PATH", "QT_PLUGIN_PATH", "QT_FONTPATH"
"QT_FONTPATH"
}; };
for (auto key : rawenv.keys()) { for (auto key : rawenv.keys()) {
auto value = rawenv.value(key); auto value = rawenv.value(key);

View File

@ -25,7 +25,7 @@ class LaunchStep : public Task {
Q_OBJECT Q_OBJECT
public: /* methods */ public: /* methods */
explicit LaunchStep(LaunchTask* parent) : Task(nullptr), m_parent(parent) { bind(parent); }; explicit LaunchStep(LaunchTask* parent) : Task(nullptr), m_parent(parent) { bind(parent); };
virtual ~LaunchStep(){}; virtual ~LaunchStep() {};
private: /* methods */ private: /* methods */
void bind(LaunchTask* parent); void bind(LaunchTask* parent);
@ -37,9 +37,9 @@ class LaunchStep : public Task {
void progressReportingRequest(); void progressReportingRequest();
public slots: public slots:
virtual void proceed(){}; virtual void proceed() {};
// called in the opposite order than the Task launch(), used to clean up or otherwise undo things after the launch ends // called in the opposite order than the Task launch(), used to clean up or otherwise undo things after the launch ends
virtual void finalize(){}; virtual void finalize() {};
protected: /* data */ protected: /* data */
LaunchTask* m_parent; LaunchTask* m_parent;

View File

@ -55,7 +55,7 @@ class LaunchTask : public Task {
public: /* methods */ public: /* methods */
static shared_qobject_ptr<LaunchTask> create(InstancePtr inst); static shared_qobject_ptr<LaunchTask> create(InstancePtr inst);
virtual ~LaunchTask(){}; virtual ~LaunchTask() {};
void appendStep(shared_qobject_ptr<LaunchStep> step); void appendStep(shared_qobject_ptr<LaunchStep> step);
void prependStep(shared_qobject_ptr<LaunchStep> step); void prependStep(shared_qobject_ptr<LaunchStep> step);

View File

@ -22,8 +22,8 @@
class CheckJava : public LaunchStep { class CheckJava : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit CheckJava(LaunchTask* parent) : LaunchStep(parent){}; explicit CheckJava(LaunchTask* parent) : LaunchStep(parent) {};
virtual ~CheckJava(){}; virtual ~CheckJava() {};
virtual void executeTask(); virtual void executeTask();
virtual bool canAbort() const { return false; } virtual bool canAbort() const { return false; }

View File

@ -25,7 +25,7 @@ class LookupServerAddress : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit LookupServerAddress(LaunchTask* parent); explicit LookupServerAddress(LaunchTask* parent);
virtual ~LookupServerAddress(){}; virtual ~LookupServerAddress() {};
virtual void executeTask(); virtual void executeTask();
virtual bool abort(); virtual bool abort();

View File

@ -22,7 +22,7 @@ class PostLaunchCommand : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit PostLaunchCommand(LaunchTask* parent); explicit PostLaunchCommand(LaunchTask* parent);
virtual ~PostLaunchCommand(){}; virtual ~PostLaunchCommand() {};
virtual void executeTask(); virtual void executeTask();
virtual bool abort(); virtual bool abort();

View File

@ -22,7 +22,7 @@ class PreLaunchCommand : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit PreLaunchCommand(LaunchTask* parent); explicit PreLaunchCommand(LaunchTask* parent);
virtual ~PreLaunchCommand(){}; virtual ~PreLaunchCommand() {};
virtual void executeTask(); virtual void executeTask();
virtual bool abort(); virtual bool abort();

View File

@ -23,8 +23,8 @@
class QuitAfterGameStop : public LaunchStep { class QuitAfterGameStop : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit QuitAfterGameStop(LaunchTask* parent) : LaunchStep(parent){}; explicit QuitAfterGameStop(LaunchTask* parent) : LaunchStep(parent) {};
virtual ~QuitAfterGameStop(){}; virtual ~QuitAfterGameStop() {};
virtual void executeTask(); virtual void executeTask();
virtual bool canAbort() const { return false; } virtual bool canAbort() const { return false; }

View File

@ -28,7 +28,7 @@ class TextPrint : public LaunchStep {
public: public:
explicit TextPrint(LaunchTask* parent, const QStringList& lines, MessageLevel::Enum level); explicit TextPrint(LaunchTask* parent, const QStringList& lines, MessageLevel::Enum level);
explicit TextPrint(LaunchTask* parent, const QString& line, MessageLevel::Enum level); explicit TextPrint(LaunchTask* parent, const QString& line, MessageLevel::Enum level);
virtual ~TextPrint(){}; virtual ~TextPrint() {};
virtual void executeTask(); virtual void executeTask();
virtual bool canAbort() const; virtual bool canAbort() const;

View File

@ -25,8 +25,8 @@
class Update : public LaunchStep { class Update : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit Update(LaunchTask* parent, Net::Mode mode) : LaunchStep(parent), m_mode(mode){}; explicit Update(LaunchTask* parent, Net::Mode mode) : LaunchStep(parent), m_mode(mode) {};
virtual ~Update(){}; virtual ~Update() {};
void executeTask() override; void executeTask() override;
bool canAbort() const override; bool canAbort() const override;

View File

@ -25,8 +25,8 @@
class ParsingValidator : public Net::Validator { class ParsingValidator : public Net::Validator {
public: /* con/des */ public: /* con/des */
ParsingValidator(Meta::BaseEntity* entity) : m_entity(entity){}; ParsingValidator(Meta::BaseEntity* entity) : m_entity(entity) {};
virtual ~ParsingValidator(){}; virtual ~ParsingValidator() {};
public: /* methods */ public: /* methods */
bool init(QNetworkRequest&) override { return true; } bool init(QNetworkRequest&) override { return true; }

View File

@ -59,7 +59,7 @@ class MinecraftInstance : public BaseInstance {
Q_OBJECT Q_OBJECT
public: public:
MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString& rootDir); MinecraftInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString& rootDir);
virtual ~MinecraftInstance(){}; virtual ~MinecraftInstance() {};
virtual void saveNow() override; virtual void saveNow() override;
void loadSpecificSettings() override; void loadSpecificSettings() override;

View File

@ -31,7 +31,7 @@ class MinecraftLoadAndCheck : public Task {
Q_OBJECT Q_OBJECT
public: public:
explicit MinecraftLoadAndCheck(MinecraftInstance* inst, QObject* parent = 0); explicit MinecraftLoadAndCheck(MinecraftInstance* inst, QObject* parent = 0);
virtual ~MinecraftLoadAndCheck(){}; virtual ~MinecraftLoadAndCheck() {};
void executeTask() override; void executeTask() override;
private slots: private slots:

View File

@ -33,7 +33,7 @@ class MinecraftUpdate : public Task {
Q_OBJECT Q_OBJECT
public: public:
explicit MinecraftUpdate(MinecraftInstance* inst, QObject* parent = 0); explicit MinecraftUpdate(MinecraftInstance* inst, QObject* parent = 0);
virtual ~MinecraftUpdate(){}; virtual ~MinecraftUpdate() {};
void executeTask() override; void executeTask() override;
bool canAbort() const override; bool canAbort() const override;

View File

@ -65,7 +65,7 @@ class AccountTask : public Task {
Q_OBJECT Q_OBJECT
public: public:
explicit AccountTask(AccountData* data, QObject* parent = 0); explicit AccountTask(AccountData* data, QObject* parent = 0);
virtual ~AccountTask(){}; virtual ~AccountTask() {};
AccountTaskState m_taskState = AccountTaskState::STATE_CREATED; AccountTaskState m_taskState = AccountTaskState::STATE_CREATED;

View File

@ -22,7 +22,7 @@ class ClaimAccount : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit ClaimAccount(LaunchTask* parent, AuthSessionPtr session); explicit ClaimAccount(LaunchTask* parent, AuthSessionPtr session);
virtual ~ClaimAccount(){}; virtual ~ClaimAccount() {};
void executeTask() override; void executeTask() override;
void finalize() override; void finalize() override;

View File

@ -24,7 +24,7 @@ class CreateGameFolders : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit CreateGameFolders(LaunchTask* parent); explicit CreateGameFolders(LaunchTask* parent);
virtual ~CreateGameFolders(){}; virtual ~CreateGameFolders() {};
virtual void executeTask(); virtual void executeTask();
virtual bool canAbort() const { return false; } virtual bool canAbort() const { return false; }

View File

@ -21,8 +21,8 @@
class ExtractNatives : public LaunchStep { class ExtractNatives : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit ExtractNatives(LaunchTask* parent) : LaunchStep(parent){}; explicit ExtractNatives(LaunchTask* parent) : LaunchStep(parent) {};
virtual ~ExtractNatives(){}; virtual ~ExtractNatives() {};
void executeTask() override; void executeTask() override;
bool canAbort() const override { return false; } bool canAbort() const override { return false; }

View File

@ -25,7 +25,7 @@ class LauncherPartLaunch : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit LauncherPartLaunch(LaunchTask* parent); explicit LauncherPartLaunch(LaunchTask* parent);
virtual ~LauncherPartLaunch(){}; virtual ~LauncherPartLaunch() {};
virtual void executeTask(); virtual void executeTask();
virtual bool abort(); virtual bool abort();

View File

@ -21,8 +21,8 @@
class ModMinecraftJar : public LaunchStep { class ModMinecraftJar : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit ModMinecraftJar(LaunchTask* parent) : LaunchStep(parent){}; explicit ModMinecraftJar(LaunchTask* parent) : LaunchStep(parent) {};
virtual ~ModMinecraftJar(){}; virtual ~ModMinecraftJar() {};
virtual void executeTask() override; virtual void executeTask() override;
virtual bool canAbort() const override { return false; } virtual bool canAbort() const override { return false; }

View File

@ -25,8 +25,8 @@ class PrintInstanceInfo : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit PrintInstanceInfo(LaunchTask* parent, AuthSessionPtr session, MinecraftServerTargetPtr serverToJoin) explicit PrintInstanceInfo(LaunchTask* parent, AuthSessionPtr session, MinecraftServerTargetPtr serverToJoin)
: LaunchStep(parent), m_session(session), m_serverToJoin(serverToJoin){}; : LaunchStep(parent), m_session(session), m_serverToJoin(serverToJoin) {};
virtual ~PrintInstanceInfo(){}; virtual ~PrintInstanceInfo() {};
virtual void executeTask(); virtual void executeTask();
virtual bool canAbort() const { return false; } virtual bool canAbort() const { return false; }

View File

@ -21,8 +21,8 @@
class ReconstructAssets : public LaunchStep { class ReconstructAssets : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit ReconstructAssets(LaunchTask* parent) : LaunchStep(parent){}; explicit ReconstructAssets(LaunchTask* parent) : LaunchStep(parent) {};
virtual ~ReconstructAssets(){}; virtual ~ReconstructAssets() {};
void executeTask() override; void executeTask() override;
bool canAbort() const override { return false; } bool canAbort() const override { return false; }

View File

@ -21,8 +21,8 @@
class ScanModFolders : public LaunchStep { class ScanModFolders : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit ScanModFolders(LaunchTask* parent) : LaunchStep(parent){}; explicit ScanModFolders(LaunchTask* parent) : LaunchStep(parent) {};
virtual ~ScanModFolders(){}; virtual ~ScanModFolders() {};
virtual void executeTask() override; virtual void executeTask() override;
virtual bool canAbort() const override { return false; } virtual bool canAbort() const override { return false; }

View File

@ -42,7 +42,7 @@ class VerifyJavaInstall : public LaunchStep {
Q_OBJECT Q_OBJECT
public: public:
explicit VerifyJavaInstall(LaunchTask* parent) : LaunchStep(parent){}; explicit VerifyJavaInstall(LaunchTask* parent) : LaunchStep(parent) {};
~VerifyJavaInstall() override = default; ~VerifyJavaInstall() override = default;
void executeTask() override; void executeTask() override;

View File

@ -281,10 +281,8 @@ void ResourceFolderModel::resolveResource(Resource* res)
connect( connect(
task.get(), &Task::succeeded, this, [=] { onParseSucceeded(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection); task.get(), &Task::succeeded, this, [=] { onParseSucceeded(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection);
connect( connect(task.get(), &Task::failed, this, [=] { onParseFailed(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection);
task.get(), &Task::failed, this, [=] { onParseFailed(ticket, res->internal_id()); }, Qt::ConnectionType::QueuedConnection); connect(task.get(), &Task::finished, this, [=] { m_active_parse_tasks.remove(ticket); }, Qt::ConnectionType::QueuedConnection);
connect(
task.get(), &Task::finished, this, [=] { m_active_parse_tasks.remove(ticket); }, Qt::ConnectionType::QueuedConnection);
m_helper_thread_task.addTask(task); m_helper_thread_task.addTask(task);

View File

@ -9,7 +9,7 @@ class FMLLibrariesTask : public Task {
Q_OBJECT Q_OBJECT
public: public:
FMLLibrariesTask(MinecraftInstance* inst); FMLLibrariesTask(MinecraftInstance* inst);
virtual ~FMLLibrariesTask(){}; virtual ~FMLLibrariesTask() {};
void executeTask() override; void executeTask() override;

View File

@ -7,7 +7,7 @@ class FoldersTask : public Task {
Q_OBJECT Q_OBJECT
public: public:
FoldersTask(MinecraftInstance* inst); FoldersTask(MinecraftInstance* inst);
virtual ~FoldersTask(){}; virtual ~FoldersTask() {};
void executeTask() override; void executeTask() override;

View File

@ -7,7 +7,7 @@ class LibrariesTask : public Task {
Q_OBJECT Q_OBJECT
public: public:
LibrariesTask(MinecraftInstance* inst); LibrariesTask(MinecraftInstance* inst);
virtual ~LibrariesTask(){}; virtual ~LibrariesTask() {};
void executeTask() override; void executeTask() override;

View File

@ -17,7 +17,7 @@ class CheckUpdateTask : public Task {
std::list<Version>& mcVersions, std::list<Version>& mcVersions,
std::optional<ModPlatform::ModLoaderTypes> loaders, std::optional<ModPlatform::ModLoaderTypes> loaders,
std::shared_ptr<ModFolderModel> mods_folder) std::shared_ptr<ModFolderModel> mods_folder)
: Task(nullptr), m_mods(mods), m_game_versions(mcVersions), m_loaders(loaders), m_mods_folder(mods_folder){}; : Task(nullptr), m_mods(mods), m_game_versions(mcVersions), m_loaders(loaders), m_mods_folder(mods_folder) {};
struct UpdatableMod { struct UpdatableMod {
QString name; QString name;

View File

@ -9,7 +9,7 @@ class FileResolvingTask : public Task {
Q_OBJECT Q_OBJECT
public: public:
explicit FileResolvingTask(const shared_qobject_ptr<QNetworkAccessManager>& network, Flame::Manifest& toProcess); explicit FileResolvingTask(const shared_qobject_ptr<QNetworkAccessManager>& network, Flame::Manifest& toProcess);
virtual ~FileResolvingTask(){}; virtual ~FileResolvingTask() {};
bool canAbort() const override { return true; } bool canAbort() const override { return true; }
bool abort() override; bool abort() override;

View File

@ -13,7 +13,7 @@ class PackFetchTask : public QObject {
Q_OBJECT Q_OBJECT
public: public:
PackFetchTask(shared_qobject_ptr<QNetworkAccessManager> network) : QObject(nullptr), m_network(network){}; PackFetchTask(shared_qobject_ptr<QNetworkAccessManager> network) : QObject(nullptr), m_network(network) {};
virtual ~PackFetchTask() = default; virtual ~PackFetchTask() = default;
void fetch(); void fetch();

View File

@ -136,8 +136,9 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArra
pack.versionsLoaded = true; pack.versionsLoaded = true;
} }
auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_type, QString preferred_file_name) auto Modrinth::loadIndexedPackVersion(QJsonObject& obj,
-> ModPlatform::IndexedVersion QString preferred_hash_type,
QString preferred_file_name) -> ModPlatform::IndexedVersion
{ {
ModPlatform::IndexedVersion file; ModPlatform::IndexedVersion file;
@ -251,8 +252,9 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_t
return {}; return {};
} }
auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Dependency& m, QJsonArray& arr, const BaseInstance* inst) auto Modrinth::loadDependencyVersions([[maybe_unused]] const ModPlatform::Dependency& m,
-> ModPlatform::IndexedVersion QJsonArray& arr,
const BaseInstance* inst) -> ModPlatform::IndexedVersion
{ {
auto profile = (dynamic_cast<const MinecraftInstance*>(inst))->getPackProfile(); auto profile = (dynamic_cast<const MinecraftInstance*>(inst))->getPackProfile();
QString mcVersion = profile->getComponentVersion("net.minecraft"); QString mcVersion = profile->getComponentVersion("net.minecraft");

View File

@ -91,8 +91,9 @@ auto intEntry(toml::table table, QString entry_name) -> int
return node.value_or(0); return node.value_or(0);
} }
auto V1::createModFormat([[maybe_unused]] QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version) auto V1::createModFormat([[maybe_unused]] QDir& index_dir,
-> Mod ModPlatform::IndexedPack& mod_pack,
ModPlatform::IndexedVersion& mod_version) -> Mod
{ {
Mod mod; Mod mod;

View File

@ -45,7 +45,7 @@ namespace Net {
*/ */
class ByteArraySink : public Sink { class ByteArraySink : public Sink {
public: public:
ByteArraySink(std::shared_ptr<QByteArray> output) : m_output(output){}; ByteArraySink(std::shared_ptr<QByteArray> output) : m_output(output) {};
virtual ~ByteArraySink() = default; virtual ~ByteArraySink() = default;

View File

@ -44,7 +44,7 @@ namespace Net {
class ChecksumValidator : public Validator { class ChecksumValidator : public Validator {
public: public:
ChecksumValidator(QCryptographicHash::Algorithm algorithm, QByteArray expected = QByteArray()) ChecksumValidator(QCryptographicHash::Algorithm algorithm, QByteArray expected = QByteArray())
: m_checksum(algorithm), m_expected(expected){}; : m_checksum(algorithm), m_expected(expected) {};
virtual ~ChecksumValidator() = default; virtual ~ChecksumValidator() = default;
public: public:

View File

@ -42,7 +42,7 @@
namespace Net { namespace Net {
class FileSink : public Sink { class FileSink : public Sink {
public: public:
FileSink(QString filename) : m_filename(filename){}; FileSink(QString filename) : m_filename(filename) {};
virtual ~FileSink() = default; virtual ~FileSink() = default;
public: public:

View File

@ -25,7 +25,7 @@ namespace Net {
class StaticHeaderProxy : public HeaderProxy { class StaticHeaderProxy : public HeaderProxy {
public: public:
StaticHeaderProxy(QList<HeaderPair> hdrs = {}) : HeaderProxy(), m_hdrs(hdrs){}; StaticHeaderProxy(QList<HeaderPair> hdrs = {}) : HeaderProxy(), m_hdrs(hdrs) {};
virtual ~StaticHeaderProxy() = default; virtual ~StaticHeaderProxy() = default;
public: public:

View File

@ -6,7 +6,7 @@
class FSTreeMatcher : public IPathMatcher { class FSTreeMatcher : public IPathMatcher {
public: public:
virtual ~FSTreeMatcher(){}; virtual ~FSTreeMatcher() {};
FSTreeMatcher(SeparatorPrefixTree<'/'>& tree) : m_fsTree(tree) {} FSTreeMatcher(SeparatorPrefixTree<'/'>& tree) : m_fsTree(tree) {}
bool matches(const QString& string) const override { return m_fsTree.covers(string); } bool matches(const QString& string) const override { return m_fsTree.covers(string); }

View File

@ -4,7 +4,7 @@
class MultiMatcher : public IPathMatcher { class MultiMatcher : public IPathMatcher {
public: public:
virtual ~MultiMatcher(){}; virtual ~MultiMatcher() {};
MultiMatcher() {} MultiMatcher() {}
MultiMatcher& add(Ptr add) MultiMatcher& add(Ptr add)
{ {

View File

@ -7,7 +7,7 @@
class SimplePrefixMatcher : public IPathMatcher { class SimplePrefixMatcher : public IPathMatcher {
public: public:
virtual ~SimplePrefixMatcher(){}; virtual ~SimplePrefixMatcher() {};
SimplePrefixMatcher(const QString& prefix) SimplePrefixMatcher(const QString& prefix)
{ {
m_prefix = prefix; m_prefix = prefix;

View File

@ -49,7 +49,7 @@ class ImgurAlbumCreation : public Net::NetRequest {
class Sink : public Net::Sink { class Sink : public Net::Sink {
public: public:
Sink(std::shared_ptr<Result> res) : m_result(res){}; Sink(std::shared_ptr<Result> res) : m_result(res) {};
virtual ~Sink() = default; virtual ~Sink() = default;
public: public:

View File

@ -43,7 +43,7 @@ class ImgurUpload : public Net::NetRequest {
public: public:
class Sink : public Net::Sink { class Sink : public Net::Sink {
public: public:
Sink(ScreenShot::Ptr shot) : m_shot(shot){}; Sink(ScreenShot::Ptr shot) : m_shot(shot) {};
virtual ~Sink() = default; virtual ~Sink() = default;
public: public:

View File

@ -94,17 +94,15 @@ void ModUpdateDialog::checkCandidates()
if (!m_modrinth_to_update.empty()) { if (!m_modrinth_to_update.empty()) {
m_modrinth_check_task.reset(new ModrinthCheckUpdate(m_modrinth_to_update, versions, loaders, m_mod_model)); m_modrinth_check_task.reset(new ModrinthCheckUpdate(m_modrinth_to_update, versions, loaders, m_mod_model));
connect(m_modrinth_check_task.get(), &CheckUpdateTask::checkFailed, this, [this](Mod* mod, QString reason, QUrl recover_url) { connect(m_modrinth_check_task.get(), &CheckUpdateTask::checkFailed, this,
m_failed_check_update.append({ mod, reason, recover_url }); [this](Mod* mod, QString reason, QUrl recover_url) { m_failed_check_update.append({ mod, reason, recover_url }); });
});
check_task.addTask(m_modrinth_check_task); check_task.addTask(m_modrinth_check_task);
} }
if (!m_flame_to_update.empty()) { if (!m_flame_to_update.empty()) {
m_flame_check_task.reset(new FlameCheckUpdate(m_flame_to_update, versions, loaders, m_mod_model)); m_flame_check_task.reset(new FlameCheckUpdate(m_flame_to_update, versions, loaders, m_mod_model));
connect(m_flame_check_task.get(), &CheckUpdateTask::checkFailed, this, [this](Mod* mod, QString reason, QUrl recover_url) { connect(m_flame_check_task.get(), &CheckUpdateTask::checkFailed, this,
m_failed_check_update.append({ mod, reason, recover_url }); [this](Mod* mod, QString reason, QUrl recover_url) { m_failed_check_update.append({ mod, reason, recover_url }); });
});
check_task.addTask(m_flame_check_task); check_task.addTask(m_flame_check_task);
} }

View File

@ -11,7 +11,7 @@ class SkinUploadDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
explicit SkinUploadDialog(MinecraftAccountPtr acct, QWidget* parent = 0); explicit SkinUploadDialog(MinecraftAccountPtr acct, QWidget* parent = 0);
virtual ~SkinUploadDialog(){}; virtual ~SkinUploadDialog() {};
public slots: public slots:
void on_buttonBox_accepted(); void on_buttonBox_accepted();

View File

@ -37,7 +37,7 @@ class VersionSelectDialog : public QDialog {
public: public:
explicit VersionSelectDialog(BaseVersionList* vlist, QString title, QWidget* parent = 0, bool cancelable = true); explicit VersionSelectDialog(BaseVersionList* vlist, QString title, QWidget* parent = 0, bool cancelable = true);
virtual ~VersionSelectDialog(){}; virtual ~VersionSelectDialog() {};
int exec() override; int exec() override;

View File

@ -4,7 +4,7 @@ class BasePage;
class BasePageContainer { class BasePageContainer {
public: public:
virtual ~BasePageContainer(){}; virtual ~BasePageContainer() {};
virtual bool selectPage(QString pageId) = 0; virtual bool selectPage(QString pageId) = 0;
virtual BasePage* selectedPage() const = 0; virtual BasePage* selectedPage() const = 0;
virtual BasePage* getPage(QString pageId) { return nullptr; }; virtual BasePage* getPage(QString pageId) { return nullptr; };

View File

@ -50,7 +50,7 @@ class ManagedPackPage : public QWidget, public BasePage {
/** Gets the necessary information about the managed pack, such as /** Gets the necessary information about the managed pack, such as
* available versions*/ * available versions*/
virtual void parseManagedPack(){}; virtual void parseManagedPack() {};
/** URL of the managed pack. /** URL of the managed pack.
* Not the version-specific one. * Not the version-specific one.
@ -64,8 +64,8 @@ class ManagedPackPage : public QWidget, public BasePage {
*/ */
virtual void suggestVersion(); virtual void suggestVersion();
virtual void update(){}; virtual void update() {};
virtual void updateFromFile(){}; virtual void updateFromFile() {};
protected slots: protected slots:
/** Does the necessary UI changes for when something failed. /** Does the necessary UI changes for when something failed.

View File

@ -168,7 +168,7 @@ class ServersModel : public QAbstractListModel {
m_saveTimer.setInterval(5000); m_saveTimer.setInterval(5000);
connect(&m_saveTimer, &QTimer::timeout, this, &ServersModel::save_internal); connect(&m_saveTimer, &QTimer::timeout, this, &ServersModel::save_internal);
} }
virtual ~ServersModel(){}; virtual ~ServersModel() {};
void observe() void observe()
{ {

View File

@ -93,8 +93,9 @@ class ModrinthModPage : public ModPage {
[[nodiscard]] inline auto helpPage() const -> QString override { return "Mod-platform"; } [[nodiscard]] inline auto helpPage() const -> QString override { return "Mod-platform"; }
auto validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, std::optional<ModPlatform::ModLoaderTypes> loaders = {}) const auto validateVersion(ModPlatform::IndexedVersion& ver,
-> bool override; QString mineVer,
std::optional<ModPlatform::ModLoaderTypes> loaders = {}) const -> bool override;
}; };
class ModrinthResourcePackPage : public ResourcePackResourcePage { class ModrinthResourcePackPage : public ResourcePackResourcePage {

View File

@ -6,7 +6,7 @@
class BaseWizardPage : public QWizardPage { class BaseWizardPage : public QWizardPage {
public: public:
explicit BaseWizardPage(QWidget* parent = Q_NULLPTR) : QWizardPage(parent) {} explicit BaseWizardPage(QWidget* parent = Q_NULLPTR) : QWizardPage(parent) {}
virtual ~BaseWizardPage(){}; virtual ~BaseWizardPage() {};
virtual bool wantsRefreshButton() { return false; } virtual bool wantsRefreshButton() { return false; }
virtual void refresh() {} virtual void refresh() {}

View File

@ -9,7 +9,7 @@ class JavaWizardPage : public BaseWizardPage {
public: public:
explicit JavaWizardPage(QWidget* parent = Q_NULLPTR); explicit JavaWizardPage(QWidget* parent = Q_NULLPTR);
virtual ~JavaWizardPage(){}; virtual ~JavaWizardPage() {};
bool wantsRefreshButton() override; bool wantsRefreshButton() override;
void refresh() override; void refresh() override;

View File

@ -25,7 +25,7 @@ class JavaSettingsWidget : public QWidget {
public: public:
explicit JavaSettingsWidget(QWidget* parent); explicit JavaSettingsWidget(QWidget* parent);
virtual ~JavaSettingsWidget(){}; virtual ~JavaSettingsWidget() {};
enum class JavaStatus { NotSet, Pending, Good, DoesNotExist, DoesNotStart, ReturnedInvalidData } javaStatus = JavaStatus::NotSet; enum class JavaStatus { NotSet, Pending, Good, DoesNotExist, DoesNotStart, ReturnedInvalidData } javaStatus = JavaStatus::NotSet;

View File

@ -27,7 +27,7 @@ class LanguageSelectionWidget : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit LanguageSelectionWidget(QWidget* parent = 0); explicit LanguageSelectionWidget(QWidget* parent = 0);
virtual ~LanguageSelectionWidget(){}; virtual ~LanguageSelectionWidget() {};
QString getSelectedLanguageKey() const; QString getSelectedLanguageKey() const;
void retranslate(); void retranslate();

View File

@ -474,8 +474,7 @@ PrismUpdaterApp::PrismUpdaterApp(int& argc, char** argv) : QApplication(argc, ar
target_dir = QDir(m_rootPath).absoluteFilePath(".."); target_dir = QDir(m_rootPath).absoluteFilePath("..");
} }
QMetaObject::invokeMethod( QMetaObject::invokeMethod(this, [this, target_dir]() { moveAndFinishUpdate(target_dir); }, Qt::QueuedConnection);
this, [this, target_dir]() { moveAndFinishUpdate(target_dir); }, Qt::QueuedConnection);
} else { } else {
QMetaObject::invokeMethod(this, &PrismUpdaterApp::loadReleaseList, Qt::QueuedConnection); QMetaObject::invokeMethod(this, &PrismUpdaterApp::loadReleaseList, Qt::QueuedConnection);

View File

@ -203,7 +203,10 @@ class ResourceFolderModelTest : public QObject {
QCOMPARE(model.size(), 0); QCOMPARE(model.size(), 0);
{ EXEC_UPDATE_TASK(model.installResource(folder_resource), QVERIFY) } { {
EXEC_UPDATE_TASK(model.installResource(folder_resource), QVERIFY)
}
{
EXEC_UPDATE_TASK(model.installResource(file_mod), QVERIFY) EXEC_UPDATE_TASK(model.installResource(file_mod), QVERIFY)
} }