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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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)
} }