From a3ffa6455021b69bd1940b65fefb3b6177c96730 Mon Sep 17 00:00:00 2001 From: Trial97 Date: Sun, 16 Jul 2023 01:59:08 +0300 Subject: Upgraded pack changelog Signed-off-by: Trial97 --- launcher/ui/pages/instance/ManagedPackPage.cpp | 16 ++++++++++++++++ launcher/ui/pages/instance/ManagedPackPage.ui | 12 +++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/launcher/ui/pages/instance/ManagedPackPage.cpp b/launcher/ui/pages/instance/ManagedPackPage.cpp index 0fc0c986..0443baf1 100644 --- a/launcher/ui/pages/instance/ManagedPackPage.cpp +++ b/launcher/ui/pages/instance/ManagedPackPage.cpp @@ -3,6 +3,9 @@ // SPDX-License-Identifier: GPL-3.0-only #include "ManagedPackPage.h" +#include +#include +#include #include "ui_ManagedPackPage.h" #include @@ -103,6 +106,19 @@ ManagedPackPage::ManagedPackPage(BaseInstance* inst, InstanceWindow* instance_wi // Pretend we're opening the page again openedImpl(); }); + + connect(ui->changelogTextBrowser, &QTextBrowser::anchorClicked, this, [](const QUrl url) { + if (url.scheme().isEmpty()) { + auto querry = + QUrlQuery(url.query()).queryItemValue("remoteUrl", QUrl::FullyDecoded); // curseforge workaround for linkout?remoteUrl= + auto decoded = QUrl::fromPercentEncoding(querry.toUtf8()); + auto newUrl = QUrl(decoded); + if (newUrl.isValid() && (newUrl.scheme() == "http" || newUrl.scheme() == "https")) + QDesktopServices ::openUrl(newUrl); + return; + } + QDesktopServices::openUrl(url); + }); } ManagedPackPage::~ManagedPackPage() diff --git a/launcher/ui/pages/instance/ManagedPackPage.ui b/launcher/ui/pages/instance/ManagedPackPage.ui index bbe44a94..05e91bbc 100644 --- a/launcher/ui/pages/instance/ManagedPackPage.ui +++ b/launcher/ui/pages/instance/ManagedPackPage.ui @@ -168,10 +168,13 @@ - + No changelog available for this version! + + false + @@ -188,6 +191,13 @@ + + + ProjectDescriptionPage + QTextBrowser +
ui/widgets/ProjectDescriptionPage.h
+
+
-- cgit From 1d468ac35ad88d8c77cc83f25e3704d9bd7df01b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 2 Aug 2023 18:35:35 +0200 Subject: chore: reformat Signed-off-by: Sefa Eyeoglu --- buildconfig/BuildConfig.h | 6 +- flatpak/libdecor.json | 40 +- launcher/Application.cpp | 664 ++- launcher/Application.h | 123 +- launcher/ApplicationMessage.cpp | 8 +- launcher/ApplicationMessage.h | 6 +- launcher/BaseInstaller.cpp | 24 +- launcher/BaseInstaller.h | 19 +- launcher/BaseInstance.cpp | 58 +- launcher/BaseInstance.h | 91 +- launcher/BaseVersionList.cpp | 40 +- launcher/BaseVersionList.h | 27 +- launcher/Commandline.cpp | 28 +- launcher/Commandline.h | 5 +- launcher/DefaultVariable.h | 30 +- launcher/DesktopServices.cpp | 113 +- launcher/DesktopServices.h | 85 +- launcher/Exception.h | 29 +- launcher/ExponentialSeries.h | 17 +- launcher/FileSystem.cpp | 7 +- launcher/FileSystem.h | 39 +- launcher/Filter.cpp | 15 +- launcher/Filter.h | 45 +- launcher/GZip.cpp | 44 +- launcher/GZip.h | 10 +- launcher/InstanceCopyPrefs.cpp | 36 +- launcher/InstanceCopyPrefs.h | 2 +- launcher/InstanceCopyTask.cpp | 5 +- launcher/InstanceCopyTask.h | 9 +- launcher/InstanceImportTask.cpp | 62 +- launcher/InstanceImportTask.h | 35 +- launcher/InstanceList.cpp | 119 +- launcher/InstanceList.h | 114 +- launcher/InstancePageProvider.h | 44 +- launcher/InstanceTask.cpp | 10 +- launcher/JavaCommon.cpp | 55 +- launcher/JavaCommon.h | 81 +- launcher/Json.cpp | 159 +- launcher/Json.h | 200 +- launcher/KonamiCode.cpp | 36 +- launcher/KonamiCode.h | 13 +- launcher/LaunchController.cpp | 239 +- launcher/LaunchController.h | 62 +- launcher/LoggedProcess.cpp | 62 +- launcher/LoggedProcess.h | 31 +- launcher/MMCTime.cpp | 37 +- launcher/MMCTime.h | 6 +- launcher/MTPixmapCache.h | 6 +- launcher/MangoHud.cpp | 4 +- launcher/Markdown.h | 2 +- launcher/MessageLevel.cpp | 5 +- launcher/MessageLevel.h | 30 +- launcher/NullInstance.h | 92 +- launcher/ProblemProvider.h | 41 +- launcher/QVariantUtils.h | 23 +- launcher/RWStorage.h | 31 +- launcher/RecursiveFileSystemWatcher.cpp | 59 +- launcher/RecursiveFileSystemWatcher.h | 59 +- launcher/SeparatorPrefixTree.h | 182 +- launcher/SkinUtils.cpp | 17 +- launcher/SkinUtils.h | 3 +- launcher/StringUtils.h | 5 +- launcher/Usable.h | 48 +- launcher/Version.cpp | 8 +- launcher/Version.h | 32 +- launcher/VersionProxyModel.cpp | 221 +- launcher/VersionProxyModel.h | 67 +- launcher/WatchLock.h | 15 +- launcher/icons/IconList.cpp | 160 +- launcher/icons/IconList.h | 64 +- launcher/icons/IconUtils.cpp | 32 +- launcher/icons/IconUtils.h | 4 +- launcher/icons/MMCIcon.cpp | 47 +- launcher/icons/MMCIcon.h | 24 +- launcher/java/JavaChecker.cpp | 54 +- launcher/java/JavaChecker.h | 25 +- launcher/java/JavaCheckerJob.cpp | 9 +- launcher/java/JavaCheckerJob.h | 23 +- launcher/java/JavaInstallList.cpp | 46 +- launcher/java/JavaInstallList.h | 40 +- launcher/java/JavaUtils.cpp | 197 +- launcher/java/JavaUtils.h | 5 +- launcher/java/JavaVersion.cpp | 65 +- launcher/java/JavaVersion.h | 40 +- launcher/launch/LaunchStep.cpp | 2 +- launcher/launch/LaunchStep.h | 30 +- launcher/launch/LaunchTask.cpp | 106 +- launcher/launch/LaunchTask.h | 68 +- launcher/launch/LogModel.cpp | 56 +- launcher/launch/LogModel.h | 29 +- launcher/launch/steps/CheckJava.cpp | 67 +- launcher/launch/steps/CheckJava.h | 24 +- launcher/launch/steps/LookupServerAddress.cpp | 41 +- launcher/launch/steps/LookupServerAddress.h | 27 +- launcher/launch/steps/PostLaunchCommand.cpp | 30 +- launcher/launch/steps/PostLaunchCommand.h | 22 +- launcher/launch/steps/PreLaunchCommand.cpp | 30 +- launcher/launch/steps/PreLaunchCommand.h | 22 +- launcher/launch/steps/QuitAfterGameStop.h | 14 +- launcher/launch/steps/TextPrint.cpp | 4 +- launcher/launch/steps/TextPrint.h | 13 +- launcher/launch/steps/Update.cpp | 23 +- launcher/launch/steps/Update.h | 19 +- launcher/main.cpp | 59 +- launcher/meta/BaseEntity.cpp | 83 +- launcher/meta/BaseEntity.h | 33 +- launcher/meta/Index.cpp | 97 +- launcher/meta/Index.h | 44 +- launcher/meta/JsonFormat.cpp | 114 +- launcher/meta/JsonFormat.h | 52 +- launcher/meta/Version.cpp | 44 +- launcher/meta/Version.h | 74 +- launcher/meta/VersionList.cpp | 156 +- launcher/meta/VersionList.h | 69 +- launcher/minecraft/Agent.h | 19 +- launcher/minecraft/AssetsUtils.cpp | 121 +- launcher/minecraft/AssetsUtils.h | 17 +- launcher/minecraft/Component.cpp | 192 +- launcher/minecraft/Component.h | 45 +- launcher/minecraft/ComponentUpdateTask.cpp | 406 +- launcher/minecraft/ComponentUpdateTask.h | 27 +- launcher/minecraft/ComponentUpdateTask_p.h | 19 +- launcher/minecraft/GradleSpecifier.h | 108 +- launcher/minecraft/LaunchProfile.cpp | 126 +- launcher/minecraft/LaunchProfile.h | 64 +- launcher/minecraft/Library.cpp | 189 +- launcher/minecraft/Library.h | 130 +- launcher/minecraft/MinecraftInstance.cpp | 331 +- launcher/minecraft/MinecraftInstance.h | 31 +- launcher/minecraft/MinecraftLoadAndCheck.cpp | 15 +- launcher/minecraft/MinecraftLoadAndCheck.h | 20 +- launcher/minecraft/MinecraftUpdate.cpp | 59 +- launcher/minecraft/MinecraftUpdate.h | 24 +- launcher/minecraft/MojangDownloadInfo.h | 36 +- launcher/minecraft/MojangVersionFormat.cpp | 218 +- launcher/minecraft/MojangVersionFormat.h | 23 +- launcher/minecraft/OneSixVersionFormat.cpp | 233 +- launcher/minecraft/OneSixVersionFormat.h | 32 +- launcher/minecraft/PackProfile.cpp | 427 +- launcher/minecraft/PackProfile.h | 66 +- launcher/minecraft/PackProfile_p.h | 12 +- launcher/minecraft/ParseUtils.cpp | 6 +- launcher/minecraft/ParseUtils.h | 2 +- launcher/minecraft/ProfileUtils.cpp | 88 +- launcher/minecraft/ProfileUtils.h | 14 +- launcher/minecraft/Rule.cpp | 14 +- launcher/minecraft/Rule.h | 73 +- launcher/minecraft/VanillaInstanceCreationTask.cpp | 8 +- launcher/minecraft/VersionFile.cpp | 20 +- launcher/minecraft/VersionFile.h | 27 +- launcher/minecraft/VersionFilterData.cpp | 65 +- launcher/minecraft/VersionFilterData.h | 10 +- launcher/minecraft/World.cpp | 280 +- launcher/minecraft/World.h | 97 +- launcher/minecraft/WorldList.cpp | 344 +- launcher/minecraft/WorldList.h | 97 +- launcher/minecraft/auth/AccountData.cpp | 207 +- launcher/minecraft/auth/AccountData.h | 23 +- launcher/minecraft/auth/AccountList.cpp | 428 +- launcher/minecraft/auth/AccountList.h | 54 +- launcher/minecraft/auth/AccountTask.cpp | 52 +- launcher/minecraft/auth/AccountTask.h | 43 +- launcher/minecraft/auth/AuthRequest.cpp | 53 +- launcher/minecraft/auth/AuthRequest.h | 39 +- launcher/minecraft/auth/AuthSession.cpp | 9 +- launcher/minecraft/auth/AuthSession.h | 10 +- launcher/minecraft/auth/AuthStep.cpp | 4 +- launcher/minecraft/auth/AuthStep.h | 20 +- launcher/minecraft/auth/MinecraftAccount.cpp | 144 +- launcher/minecraft/auth/MinecraftAccount.h | 118 +- launcher/minecraft/auth/Parsers.cpp | 192 +- launcher/minecraft/auth/Parsers.h | 27 +- launcher/minecraft/auth/Yggdrasil.cpp | 162 +- launcher/minecraft/auth/Yggdrasil.h | 38 +- launcher/minecraft/auth/flows/AuthFlow.cpp | 44 +- launcher/minecraft/auth/flows/AuthFlow.h | 29 +- launcher/minecraft/auth/flows/MSA.cpp | 19 +- launcher/minecraft/auth/flows/MSA.h | 20 +- launcher/minecraft/auth/flows/Mojang.cpp | 19 +- launcher/minecraft/auth/flows/Mojang.h | 23 +- launcher/minecraft/auth/flows/Offline.cpp | 12 +- launcher/minecraft/auth/flows/Offline.h | 20 +- launcher/minecraft/auth/steps/EntitlementsStep.cpp | 21 +- launcher/minecraft/auth/steps/EntitlementsStep.h | 9 +- launcher/minecraft/auth/steps/GetSkinStep.cpp | 24 +- launcher/minecraft/auth/steps/GetSkinStep.h | 7 +- .../minecraft/auth/steps/LauncherLoginStep.cpp | 44 +- launcher/minecraft/auth/steps/LauncherLoginStep.h | 7 +- launcher/minecraft/auth/steps/MSAStep.cpp | 25 +- launcher/minecraft/auth/steps/MSAStep.h | 18 +- .../auth/steps/MigrationEligibilityStep.cpp | 26 +- .../auth/steps/MigrationEligibilityStep.h | 7 +- .../minecraft/auth/steps/MinecraftProfileStep.cpp | 61 +- .../minecraft/auth/steps/MinecraftProfileStep.h | 7 +- .../auth/steps/MinecraftProfileStepMojang.cpp | 63 +- .../auth/steps/MinecraftProfileStepMojang.h | 7 +- launcher/minecraft/auth/steps/OfflineStep.cpp | 9 +- launcher/minecraft/auth/steps/OfflineStep.h | 4 +- .../minecraft/auth/steps/XboxAuthorizationStep.cpp | 132 +- .../minecraft/auth/steps/XboxAuthorizationStep.h | 19 +- launcher/minecraft/auth/steps/XboxProfileStep.cpp | 54 +- launcher/minecraft/auth/steps/XboxProfileStep.h | 7 +- launcher/minecraft/auth/steps/XboxUserStep.cpp | 41 +- launcher/minecraft/auth/steps/XboxUserStep.h | 7 +- launcher/minecraft/auth/steps/YggdrasilStep.cpp | 25 +- launcher/minecraft/auth/steps/YggdrasilStep.h | 10 +- launcher/minecraft/gameoptions/GameOptions.cpp | 65 +- launcher/minecraft/gameoptions/GameOptions.h | 20 +- launcher/minecraft/launch/ClaimAccount.cpp | 8 +- launcher/minecraft/launch/ClaimAccount.h | 17 +- launcher/minecraft/launch/CreateGameFolders.cpp | 14 +- launcher/minecraft/launch/CreateGameFolders.h | 18 +- launcher/minecraft/launch/ExtractNatives.cpp | 46 +- launcher/minecraft/launch/ExtractNatives.h | 14 +- launcher/minecraft/launch/LauncherPartLaunch.cpp | 104 +- launcher/minecraft/launch/LauncherPartLaunch.h | 36 +- .../minecraft/launch/MinecraftServerTarget.cpp | 31 +- launcher/minecraft/launch/MinecraftServerTarget.h | 2 +- launcher/minecraft/launch/ModMinecraftJar.cpp | 25 +- launcher/minecraft/launch/ModMinecraftJar.h | 15 +- launcher/minecraft/launch/PrintInstanceInfo.cpp | 79 +- launcher/minecraft/launch/PrintInstanceInfo.h | 18 +- launcher/minecraft/launch/ReconstructAssets.cpp | 7 +- launcher/minecraft/launch/ReconstructAssets.h | 12 +- launcher/minecraft/launch/ScanModFolders.cpp | 12 +- launcher/minecraft/launch/ScanModFolders.h | 19 +- launcher/minecraft/launch/VerifyJavaInstall.cpp | 22 +- launcher/minecraft/launch/VerifyJavaInstall.h | 9 +- launcher/minecraft/mod/DataPack.cpp | 8 +- launcher/minecraft/mod/MetadataHandler.h | 55 +- launcher/minecraft/mod/Mod.cpp | 81 +- launcher/minecraft/mod/Mod.h | 96 +- launcher/minecraft/mod/ModDetails.h | 109 +- launcher/minecraft/mod/ModFolderModel.cpp | 251 +- launcher/minecraft/mod/ModFolderModel.h | 107 +- launcher/minecraft/mod/Resource.cpp | 8 +- launcher/minecraft/mod/Resource.h | 21 +- launcher/minecraft/mod/ResourceFolderModel.cpp | 18 +- launcher/minecraft/mod/ResourceFolderModel.h | 15 +- launcher/minecraft/mod/ResourcePack.cpp | 2 +- launcher/minecraft/mod/ResourcePackFolderModel.cpp | 22 +- launcher/minecraft/mod/ResourcePackFolderModel.h | 23 +- launcher/minecraft/mod/ShaderPackFolderModel.h | 6 +- launcher/minecraft/mod/TexturePack.cpp | 2 +- launcher/minecraft/mod/TexturePackFolderModel.cpp | 24 +- launcher/minecraft/mod/TexturePackFolderModel.h | 23 +- launcher/minecraft/mod/tasks/BasicFolderLoadTask.h | 12 +- launcher/minecraft/mod/tasks/LocalModParseTask.cpp | 24 +- launcher/minecraft/mod/tasks/LocalModUpdateTask.h | 30 +- .../mod/tasks/LocalResourcePackParseTask.cpp | 8 +- .../minecraft/mod/tasks/LocalResourceParse.cpp | 29 +- .../mod/tasks/LocalTexturePackParseTask.cpp | 11 +- .../mod/tasks/LocalWorldSaveParseTask.cpp | 8 +- .../minecraft/mod/tasks/LocalWorldSaveParseTask.h | 2 +- launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp | 77 +- launcher/minecraft/mod/tasks/ModFolderLoadTask.h | 82 +- launcher/minecraft/services/CapeChange.cpp | 30 +- launcher/minecraft/services/CapeChange.h | 20 +- launcher/minecraft/services/SkinDelete.cpp | 15 +- launcher/minecraft/services/SkinDelete.h | 13 +- launcher/minecraft/services/SkinUpload.cpp | 19 +- launcher/minecraft/services/SkinUpload.h | 20 +- launcher/minecraft/update/AssetUpdateTask.cpp | 30 +- launcher/minecraft/update/AssetUpdateTask.h | 17 +- launcher/minecraft/update/FMLLibrariesTask.cpp | 53 +- launcher/minecraft/update/FMLLibrariesTask.h | 22 +- launcher/minecraft/update/FoldersTask.cpp | 8 +- launcher/minecraft/update/FoldersTask.h | 15 +- launcher/minecraft/update/LibrariesTask.cpp | 35 +- launcher/minecraft/update/LibrariesTask.h | 19 +- launcher/modplatform/CheckUpdateTask.h | 17 +- launcher/modplatform/EnsureMetadataTask.h | 5 +- launcher/modplatform/ModIndex.cpp | 30 +- launcher/modplatform/atlauncher/ATLPackIndex.cpp | 11 +- launcher/modplatform/atlauncher/ATLPackIndex.h | 15 +- .../modplatform/atlauncher/ATLPackInstallTask.cpp | 349 +- .../modplatform/atlauncher/ATLPackManifest.cpp | 114 +- launcher/modplatform/atlauncher/ATLPackManifest.h | 48 +- launcher/modplatform/atlauncher/ATLShareCode.cpp | 2 +- launcher/modplatform/atlauncher/ATLShareCode.h | 4 +- launcher/modplatform/flame/FlameCheckUpdate.h | 5 +- launcher/modplatform/flame/FlamePackIndex.cpp | 9 +- launcher/modplatform/flame/PackManifest.cpp | 7 +- launcher/modplatform/flame/PackManifest.h | 34 +- launcher/modplatform/legacy_ftb/PackFetchTask.cpp | 2 +- launcher/modplatform/legacy_ftb/PackHelpers.h | 22 +- .../modplatform/legacy_ftb/PrivatePackManager.cpp | 19 +- .../modplatform/legacy_ftb/PrivatePackManager.h | 30 +- .../modplatform/modrinth/ModrinthCheckUpdate.h | 5 +- .../modrinth/ModrinthInstanceCreationTask.cpp | 24 +- .../modrinth/ModrinthInstanceCreationTask.h | 5 +- .../modplatform/modrinth/ModrinthPackManifest.cpp | 25 +- .../modplatform/modrinth/ModrinthPackManifest.h | 9 +- launcher/modplatform/packwiz/Packwiz.h | 54 +- .../technic/SingleZipPackInstallTask.cpp | 39 +- .../modplatform/technic/SingleZipPackInstallTask.h | 16 +- .../modplatform/technic/SolderPackInstallTask.cpp | 36 +- .../modplatform/technic/SolderPackManifest.cpp | 2 +- launcher/modplatform/technic/SolderPackManifest.h | 4 +- .../modplatform/technic/TechnicPackProcessor.cpp | 102 +- .../modplatform/technic/TechnicPackProcessor.h | 29 +- launcher/net/Download.cpp | 5 +- launcher/net/HttpMetaCache.cpp | 5 +- launcher/net/Logging.h | 4 +- launcher/net/MetaCacheSink.cpp | 31 +- launcher/net/NetAction.h | 4 +- launcher/net/NetJob.h | 4 +- launcher/net/NetUtils.h | 37 +- launcher/net/PasteUpload.cpp | 255 +- launcher/net/PasteUpload.h | 28 +- launcher/net/Validator.h | 19 +- launcher/news/NewsChecker.cpp | 5 +- launcher/news/NewsChecker.h | 16 +- launcher/news/NewsEntry.cpp | 16 +- launcher/news/NewsEntry.h | 15 +- launcher/pathmatcher/FSTreeMatcher.h | 20 +- launcher/pathmatcher/IPathMatcher.h | 11 +- launcher/pathmatcher/MultiMatcher.h | 23 +- launcher/pathmatcher/RegexpMatcher.h | 28 +- launcher/screenshots/ImgurAlbumCreation.cpp | 28 +- launcher/screenshots/ImgurAlbumCreation.h | 25 +- launcher/screenshots/ImgurUpload.cpp | 31 +- launcher/screenshots/ImgurUpload.h | 16 +- launcher/screenshots/Screenshot.h | 6 +- launcher/settings/INIFile.h | 9 +- launcher/settings/INISettingsObject.cpp | 50 +- launcher/settings/INISettingsObject.h | 26 +- launcher/settings/OverrideSetting.cpp | 6 +- launcher/settings/OverrideSetting.h | 11 +- launcher/settings/PassthroughSetting.cpp | 15 +- launcher/settings/PassthroughSetting.h | 11 +- launcher/settings/Setting.cpp | 14 +- launcher/settings/Setting.h | 31 +- launcher/settings/SettingsObject.cpp | 67 +- launcher/settings/SettingsObject.h | 77 +- launcher/tasks/ConcurrentTask.cpp | 13 +- launcher/tasks/Task.cpp | 48 +- launcher/tasks/Task.h | 44 +- launcher/tools/BaseExternalTool.cpp | 27 +- launcher/tools/BaseExternalTool.h | 43 +- launcher/tools/BaseProfiler.cpp | 13 +- launcher/tools/BaseProfiler.h | 27 +- launcher/tools/JProfiler.cpp | 53 +- launcher/tools/JProfiler.h | 11 +- launcher/tools/JVisualVM.cpp | 51 +- launcher/tools/JVisualVM.h | 11 +- launcher/tools/MCEditTool.cpp | 26 +- launcher/tools/MCEditTool.h | 12 +- launcher/translations/POTranslator.cpp | 186 +- launcher/translations/POTranslator.h | 14 +- launcher/translations/TranslationsModel.cpp | 395 +- launcher/ui/ColorCache.cpp | 7 +- launcher/ui/ColorCache.h | 49 +- launcher/ui/GuiUtil.cpp | 73 +- launcher/ui/GuiUtil.h | 13 +- launcher/ui/InstanceWindow.cpp | 49 +- launcher/ui/InstanceWindow.h | 30 +- launcher/ui/MainWindow.h | 76 +- launcher/ui/dialogs/AboutDialog.cpp | 61 +- launcher/ui/dialogs/AboutDialog.h | 17 +- launcher/ui/dialogs/BlockedModsDialog.cpp | 2 +- launcher/ui/dialogs/CopyInstanceDialog.cpp | 4 +- launcher/ui/dialogs/CustomMessageBox.cpp | 14 +- launcher/ui/dialogs/CustomMessageBox.h | 7 +- launcher/ui/dialogs/EditAccountDialog.cpp | 11 +- launcher/ui/dialogs/EditAccountDialog.h | 26 +- launcher/ui/dialogs/IconPickerDialog.cpp | 39 +- launcher/ui/dialogs/IconPickerDialog.h | 23 +- launcher/ui/dialogs/ImportResourceDialog.h | 2 +- launcher/ui/dialogs/LoginDialog.cpp | 28 +- launcher/ui/dialogs/LoginDialog.h | 31 +- launcher/ui/dialogs/MSALoginDialog.cpp | 41 +- launcher/ui/dialogs/MSALoginDialog.h | 32 +- launcher/ui/dialogs/ModUpdateDialog.cpp | 14 +- launcher/ui/dialogs/ModUpdateDialog.h | 4 +- launcher/ui/dialogs/NewComponentDialog.cpp | 28 +- launcher/ui/dialogs/NewComponentDialog.h | 16 +- launcher/ui/dialogs/NewInstanceDialog.cpp | 42 +- launcher/ui/dialogs/NewInstanceDialog.h | 40 +- launcher/ui/dialogs/OfflineLoginDialog.cpp | 23 +- launcher/ui/dialogs/OfflineLoginDialog.h | 29 +- launcher/ui/dialogs/ProfileSelectDialog.cpp | 30 +- launcher/ui/dialogs/ProfileSelectDialog.h | 22 +- launcher/ui/dialogs/ProfileSetupDialog.cpp | 95 +- launcher/ui/dialogs/ProfileSetupDialog.h | 56 +- launcher/ui/dialogs/ProgressDialog.cpp | 26 +- launcher/ui/dialogs/ProgressDialog.h | 47 +- launcher/ui/dialogs/ScrollMessageBox.cpp | 9 +- launcher/ui/dialogs/ScrollMessageBox.h | 15 +- launcher/ui/dialogs/SkinUploadDialog.cpp | 82 +- launcher/ui/dialogs/SkinUploadDialog.h | 21 +- launcher/ui/dialogs/VersionSelectDialog.cpp | 13 +- launcher/ui/dialogs/VersionSelectDialog.h | 37 +- .../ui/instanceview/AccessibleInstanceView.cpp | 147 +- launcher/ui/instanceview/AccessibleInstanceView.h | 4 +- .../ui/instanceview/AccessibleInstanceView_p.h | 68 +- launcher/ui/instanceview/InstanceDelegate.cpp | 138 +- launcher/ui/instanceview/InstanceDelegate.h | 23 +- launcher/ui/instanceview/InstanceProxyModel.cpp | 33 +- launcher/ui/instanceview/InstanceProxyModel.h | 19 +- launcher/ui/instanceview/InstanceView.cpp | 448 +- launcher/ui/instanceview/InstanceView.h | 114 +- launcher/ui/instanceview/VisualGroup.h | 55 +- launcher/ui/pagedialog/PageDialog.cpp | 14 +- launcher/ui/pagedialog/PageDialog.h | 16 +- launcher/ui/pages/BasePageContainer.h | 5 +- launcher/ui/pages/BasePageProvider.h | 47 +- launcher/ui/pages/global/APIPage.cpp | 45 +- launcher/ui/pages/global/APIPage.h | 36 +- launcher/ui/pages/global/AccountListPage.cpp | 94 +- launcher/ui/pages/global/AccountListPage.h | 44 +- launcher/ui/pages/global/CustomCommandsPage.cpp | 20 +- launcher/ui/pages/global/CustomCommandsPage.h | 35 +- launcher/ui/pages/global/ExternalToolsPage.cpp | 103 +- launcher/ui/pages/global/ExternalToolsPage.h | 36 +- launcher/ui/pages/global/JavaPage.cpp | 44 +- launcher/ui/pages/global/JavaPage.h | 47 +- launcher/ui/pages/global/LanguagePage.cpp | 11 +- launcher/ui/pages/global/LanguagePage.h | 37 +- launcher/ui/pages/global/LauncherPage.cpp | 97 +- launcher/ui/pages/global/LauncherPage.h | 49 +- launcher/ui/pages/global/MinecraftPage.cpp | 6 +- launcher/ui/pages/global/MinecraftPage.h | 44 +- launcher/ui/pages/global/ProxyPage.cpp | 21 +- launcher/ui/pages/global/ProxyPage.h | 44 +- launcher/ui/pages/instance/ExternalResourcesPage.h | 4 +- launcher/ui/pages/instance/GameOptionsPage.cpp | 11 +- launcher/ui/pages/instance/GameOptionsPage.h | 38 +- .../ui/pages/instance/InstanceSettingsPage.cpp | 127 +- launcher/ui/pages/instance/InstanceSettingsPage.h | 36 +- launcher/ui/pages/instance/LogPage.cpp | 146 +- launcher/ui/pages/instance/LogPage.h | 44 +- launcher/ui/pages/instance/NotesPage.cpp | 5 +- launcher/ui/pages/instance/NotesPage.h | 35 +- launcher/ui/pages/instance/OtherLogsPage.cpp | 140 +- launcher/ui/pages/instance/OtherLogsPage.h | 42 +- launcher/ui/pages/instance/ResourcePackPage.h | 11 +- launcher/ui/pages/instance/ScreenshotsPage.cpp | 244 +- launcher/ui/pages/instance/ScreenshotsPage.h | 58 +- launcher/ui/pages/instance/ServersPage.cpp | 382 +- launcher/ui/pages/instance/ServersPage.h | 59 +- launcher/ui/pages/instance/ShaderPackPage.h | 7 +- launcher/ui/pages/instance/TexturePackPage.h | 12 +- launcher/ui/pages/instance/WorldListPage.cpp | 177 +- launcher/ui/pages/instance/WorldListPage.h | 64 +- launcher/ui/pages/modplatform/CustomPage.cpp | 83 +- launcher/ui/pages/modplatform/CustomPage.h | 44 +- launcher/ui/pages/modplatform/ImportPage.cpp | 66 +- launcher/ui/pages/modplatform/ImportPage.h | 43 +- launcher/ui/pages/modplatform/ResourcePackPage.cpp | 6 +- launcher/ui/pages/modplatform/ResourcePackPage.h | 2 +- launcher/ui/pages/modplatform/TexturePackPage.h | 5 +- .../modplatform/atlauncher/AtlFilterModel.cpp | 16 +- .../pages/modplatform/atlauncher/AtlFilterModel.h | 16 +- .../atlauncher/AtlOptionalModDialog.cpp | 132 +- .../modplatform/atlauncher/AtlOptionalModDialog.h | 37 +- .../ui/pages/modplatform/atlauncher/AtlPage.cpp | 34 +- launcher/ui/pages/modplatform/atlauncher/AtlPage.h | 46 +- .../atlauncher/AtlUserInteractionSupportImpl.cpp | 16 +- launcher/ui/pages/modplatform/flame/FlameModel.cpp | 8 +- launcher/ui/pages/modplatform/flame/FlamePage.cpp | 9 +- launcher/ui/pages/modplatform/flame/FlamePage.h | 46 +- .../pages/modplatform/flame/FlameResourcePages.cpp | 28 +- .../pages/modplatform/flame/FlameResourcePages.h | 29 +- .../ui/pages/modplatform/legacy_ftb/ListModel.h | 49 +- launcher/ui/pages/modplatform/legacy_ftb/Page.cpp | 147 +- launcher/ui/pages/modplatform/legacy_ftb/Page.h | 62 +- .../pages/modplatform/modrinth/ModrinthModel.cpp | 28 +- .../ui/pages/modplatform/modrinth/ModrinthModel.h | 9 +- .../modplatform/modrinth/ModrinthResourcePages.cpp | 30 +- .../modplatform/modrinth/ModrinthResourcePages.h | 30 +- .../ui/pages/modplatform/technic/TechnicData.h | 2 +- .../ui/pages/modplatform/technic/TechnicPage.cpp | 98 +- .../ui/pages/modplatform/technic/TechnicPage.h | 44 +- launcher/ui/setupwizard/BaseWizardPage.h | 30 +- launcher/ui/setupwizard/JavaWizardPage.cpp | 40 +- launcher/ui/setupwizard/JavaWizardPage.h | 18 +- launcher/ui/setupwizard/LanguageWizardPage.cpp | 13 +- launcher/ui/setupwizard/LanguageWizardPage.h | 13 +- launcher/ui/setupwizard/PasteWizardPage.cpp | 11 +- launcher/ui/setupwizard/PasteWizardPage.h | 13 +- launcher/ui/setupwizard/SetupWizard.cpp | 47 +- launcher/ui/setupwizard/SetupWizard.h | 21 +- launcher/ui/themes/BrightTheme.cpp | 23 +- launcher/ui/themes/BrightTheme.h | 6 +- launcher/ui/themes/CustomTheme.cpp | 3 +- launcher/ui/themes/DarkTheme.cpp | 16 +- launcher/ui/themes/DarkTheme.h | 5 +- launcher/ui/themes/FusionTheme.h | 5 +- launcher/ui/themes/ITheme.cpp | 7 +- launcher/ui/themes/SystemTheme.cpp | 2 +- launcher/ui/widgets/CustomCommands.cpp | 13 +- launcher/ui/widgets/CustomCommands.h | 18 +- launcher/ui/widgets/DropLabel.cpp | 17 +- launcher/ui/widgets/DropLabel.h | 19 +- launcher/ui/widgets/ErrorFrame.cpp | 46 +- launcher/ui/widgets/ErrorFrame.h | 22 +- launcher/ui/widgets/FocusLineEdit.cpp | 9 +- launcher/ui/widgets/FocusLineEdit.h | 17 +- launcher/ui/widgets/IconLabel.cpp | 16 +- launcher/ui/widgets/IconLabel.h | 13 +- launcher/ui/widgets/JavaSettingsWidget.cpp | 145 +- launcher/ui/widgets/JavaSettingsWidget.h | 75 +- launcher/ui/widgets/LabeledToolButton.cpp | 46 +- launcher/ui/widgets/LabeledToolButton.h | 16 +- launcher/ui/widgets/LineSeparator.cpp | 14 +- launcher/ui/widgets/LineSeparator.h | 14 +- launcher/ui/widgets/LogView.cpp | 49 +- launcher/ui/widgets/LogView.h | 33 +- launcher/ui/widgets/ModFilterWidget.cpp | 110 +- launcher/ui/widgets/ModFilterWidget.h | 33 +- launcher/ui/widgets/ModListView.cpp | 46 +- launcher/ui/widgets/ModListView.h | 11 +- launcher/ui/widgets/PageContainer.cpp | 101 +- launcher/ui/widgets/PageContainer.h | 54 +- launcher/ui/widgets/PageContainer_p.h | 77 +- launcher/ui/widgets/ProjectItem.cpp | 5 +- launcher/ui/widgets/ProjectItem.h | 7 +- launcher/ui/widgets/SubTaskProgressBar.cpp | 6 +- launcher/ui/widgets/SubTaskProgressBar.h | 10 +- launcher/ui/widgets/ThemeCustomizationWidget.cpp | 18 +- launcher/ui/widgets/VersionListView.cpp | 48 +- launcher/ui/widgets/VersionListView.h | 31 +- launcher/ui/widgets/VersionSelectWidget.cpp | 52 +- launcher/ui/widgets/VersionSelectWidget.h | 49 +- launcher/ui/widgets/WideBar.cpp | 10 +- launcher/updater/ExternalUpdater.h | 9 +- launcher/updater/MacSparkleUpdater.h | 11 +- launcher/updater/MacSparkleUpdater.mm | 107 +- libraries/LocalPeer/include/LocalPeer.h | 44 +- libraries/LocalPeer/src/LocalPeer.cpp | 65 +- libraries/LocalPeer/src/LockedFile.cpp | 6 +- libraries/LocalPeer/src/LockedFile.h | 10 +- libraries/LocalPeer/src/LockedFile_unix.cpp | 6 +- libraries/LocalPeer/src/LockedFile_win.cpp | 40 +- libraries/gamemode/include/gamemode_client.h | 328 +- libraries/javacheck/JavaCheck.java | 8 +- libraries/katabasis/include/katabasis/Bits.h | 16 +- libraries/katabasis/include/katabasis/DeviceFlow.h | 64 +- libraries/katabasis/include/katabasis/Globals.h | 4 +- libraries/katabasis/include/katabasis/PollServer.h | 25 +- libraries/katabasis/include/katabasis/Reply.h | 38 +- .../katabasis/include/katabasis/RequestParameter.h | 8 +- libraries/katabasis/src/DeviceFlow.cpp | 178 +- libraries/katabasis/src/JsonResponse.cpp | 5 +- libraries/katabasis/src/JsonResponse.h | 6 +- libraries/katabasis/src/PollServer.cpp | 37 +- libraries/katabasis/src/Reply.cpp | 31 +- libraries/launcher/net/minecraft/Launcher.java | 8 +- .../launcher/org/prismlauncher/EntryPoint.java | 20 +- .../exception/ParameterNotFoundException.java | 2 - .../prismlauncher/exception/ParseException.java | 2 - .../org/prismlauncher/launcher/Launcher.java | 2 - .../launcher/impl/AbstractLauncher.java | 8 +- .../launcher/impl/StandardLauncher.java | 6 +- .../launcher/impl/legacy/LegacyFrame.java | 12 +- .../launcher/impl/legacy/LegacyLauncher.java | 15 +- .../org/prismlauncher/utils/Parameters.java | 6 +- .../org/prismlauncher/utils/ReflectionUtils.java | 9 +- .../org/prismlauncher/utils/logging/Level.java | 1 - .../org/prismlauncher/utils/logging/Log.java | 4 +- libraries/murmur2/src/MurmurHash2.h | 4 +- libraries/rainbow/include/rainbow.h | 27 +- libraries/rainbow/src/rainbow.cpp | 187 +- libraries/systeminfo/include/distroutils.h | 17 +- libraries/systeminfo/include/sys.h | 32 +- libraries/systeminfo/src/distroutils.cpp | 166 +- libraries/systeminfo/src/sys_apple.cpp | 19 +- libraries/systeminfo/src/sys_test.cpp | 24 +- libraries/systeminfo/src/sys_unix.cpp | 56 +- libraries/systeminfo/src/sys_win32.cpp | 2 +- renovate.json | 20 +- tests/DataPackParse_test.cpp | 8 +- tests/FileSystem_test.cpp | 275 +- tests/GZip_test.cpp | 14 +- tests/GradleSpecifier_test.cpp | 22 +- tests/Index_test.cpp | 22 +- tests/JavaVersion_test.cpp | 69 +- tests/Library_test.cpp | 60 +- tests/MojangVersionFormat_test.cpp | 11 +- tests/Packwiz_test.cpp | 16 +- tests/ParseUtils_test.cpp | 24 +- tests/ResourceFolderModel_test.cpp | 100 +- tests/ResourceModel_test.cpp | 3 +- tests/ResourcePackParse_test.cpp | 14 +- tests/ShaderPackParse_test.cpp | 8 +- tests/Task_test.cpp | 5 +- tests/TexturePackParse_test.cpp | 8 +- tests/Version_test.cpp | 79 +- tests/WorldSaveParse_test.cpp | 18 +- tests/testdata/MojangVersionFormat/1.9-simple.json | 3 +- tests/testdata/MojangVersionFormat/1.9.json | 54 +- tests/testdata/MojangVersionFormat/lib-native.json | 12 +- tests/testdata/PackageManifest/1.8.0_202-x64.json | 4668 +++++++++++++++++++- 594 files changed, 16057 insertions(+), 16553 deletions(-) diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 11773d88..387f494f 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -36,8 +36,8 @@ */ #pragma once -#include #include +#include /** * \brief The Config class holds all the build-time information passed from the build system. @@ -145,7 +145,7 @@ class Config { QString AUTH_BASE = "https://authserver.mojang.com/"; QString IMGUR_BASE_URL = "https://api.imgur.com/3/"; QString FMLLIBS_BASE_URL = "https://files.prismlauncher.org/fmllibs/"; // FIXME: move into CMakeLists - QString TRANSLATIONS_BASE_URL = "https://i18n.prismlauncher.org/"; // FIXME: move into CMakeLists + QString TRANSLATIONS_BASE_URL = "https://i18n.prismlauncher.org/"; // FIXME: move into CMakeLists QString MODPACKSCH_API_BASE_URL = "https://api.modpacks.ch/"; @@ -162,7 +162,7 @@ class Config { QString MODRINTH_STAGING_URL = "https://staging-api.modrinth.com/v2"; QString MODRINTH_PROD_URL = "https://api.modrinth.com/v2"; - QStringList MODRINTH_MRPACK_HOSTS{"cdn.modrinth.com", "github.com", "raw.githubusercontent.com", "gitlab.com"}; + QStringList MODRINTH_MRPACK_HOSTS{ "cdn.modrinth.com", "github.com", "raw.githubusercontent.com", "gitlab.com" }; QString FLAME_BASE_URL = "https://api.curseforge.com/v1"; diff --git a/flatpak/libdecor.json b/flatpak/libdecor.json index 12afad69..589310a3 100644 --- a/flatpak/libdecor.json +++ b/flatpak/libdecor.json @@ -1,22 +1,22 @@ { - "name": "libdecor", - "buildsystem": "meson", - "config-opts": [ - "-Ddemo=false" - ], - "sources": [ - { - "type": "git", - "url": "https://gitlab.freedesktop.org/libdecor/libdecor.git", - "commit": "73260393a97291c887e1074ab7f318e031be0ac6" - }, - { - "type": "patch", - "path": "patches/weird_libdecor.patch" - } - ], - "cleanup": [ - "/include", - "/lib/pkgconfig" - ] + "name": "libdecor", + "buildsystem": "meson", + "config-opts": [ + "-Ddemo=false" + ], + "sources": [ + { + "type": "git", + "url": "https://gitlab.freedesktop.org/libdecor/libdecor.git", + "commit": "73260393a97291c887e1074ab7f318e031be0ac6" + }, + { + "type": "patch", + "path": "patches/weird_libdecor.patch" + } + ], + "cleanup": [ + "/include", + "/lib/pkgconfig" + ] } diff --git a/launcher/Application.cpp b/launcher/Application.cpp index c594a297..14fda9e6 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -49,27 +49,27 @@ #include "pathmatcher/MultiMatcher.h" #include "pathmatcher/SimplePrefixMatcher.h" #include "settings/INIFile.h" -#include "ui/MainWindow.h" #include "ui/InstanceWindow.h" +#include "ui/MainWindow.h" #include "ui/dialogs/ProgressDialog.h" #include "ui/instanceview/AccessibleInstanceView.h" #include "ui/pages/BasePageProvider.h" -#include "ui/pages/global/LauncherPage.h" -#include "ui/pages/global/MinecraftPage.h" +#include "ui/pages/global/APIPage.h" +#include "ui/pages/global/AccountListPage.h" +#include "ui/pages/global/CustomCommandsPage.h" +#include "ui/pages/global/ExternalToolsPage.h" #include "ui/pages/global/JavaPage.h" #include "ui/pages/global/LanguagePage.h" +#include "ui/pages/global/LauncherPage.h" +#include "ui/pages/global/MinecraftPage.h" #include "ui/pages/global/ProxyPage.h" -#include "ui/pages/global/ExternalToolsPage.h" -#include "ui/pages/global/AccountListPage.h" -#include "ui/pages/global/APIPage.h" -#include "ui/pages/global/CustomCommandsPage.h" -#include "ui/setupwizard/SetupWizard.h" -#include "ui/setupwizard/LanguageWizardPage.h" #include "ui/setupwizard/JavaWizardPage.h" +#include "ui/setupwizard/LanguageWizardPage.h" #include "ui/setupwizard/PasteWizardPage.h" +#include "ui/setupwizard/SetupWizard.h" #include "ui/setupwizard/ThemeWizardPage.h" #include "ui/dialogs/CustomMessageBox.h" @@ -83,20 +83,20 @@ #include #include -#include #include #include +#include #include #include -#include -#include +#include +#include #include #include +#include #include -#include #include +#include #include -#include #include "InstanceList.h" #include "MTPixmapCache.h" @@ -116,32 +116,31 @@ #include "settings/INISettingsObject.h" #include "settings/Setting.h" -#include "translations/TranslationsModel.h" #include "meta/Index.h" +#include "translations/TranslationsModel.h" -#include #include +#include #include #include #ifdef Q_OS_LINUX #include -#include "gamemode_client.h" #include "MangoHud.h" +#include "gamemode_client.h" #endif #ifdef Q_OS_MAC #include "updater/MacSparkleUpdater.h" #endif - #if defined Q_OS_WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif -#include #include +#include #endif #define STRINGIFY(x) #x @@ -154,10 +153,10 @@ PixmapCache* PixmapCache::s_instance = nullptr; namespace { /** This is used so that we can output to the log file in addition to the CLI. */ -void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +void appDebugOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg) { static std::mutex loggerMutex; - const std::lock_guard lock(loggerMutex); // synchronized, QFile logFile is not thread-safe + const std::lock_guard lock(loggerMutex); // synchronized, QFile logFile is not thread-safe QString out = qFormatLogMessage(type, context, msg); out += QChar::LineFeed; @@ -168,30 +167,26 @@ void appDebugOutput(QtMsgType type, const QMessageLogContext &context, const QSt fflush(stderr); } -} +} // namespace -Application::Application(int &argc, char **argv) : QApplication(argc, argv) +Application::Application(int& argc, char** argv) : QApplication(argc, argv) { #if defined Q_OS_WIN32 // attach the parent console - if(AttachConsole(ATTACH_PARENT_PROCESS)) - { + if (AttachConsole(ATTACH_PARENT_PROCESS)) { // if attach succeeds, reopen and sync all the i/o - if(freopen("CON", "w", stdout)) - { + if (freopen("CON", "w", stdout)) { std::cout.sync_with_stdio(); } - if(freopen("CON", "w", stderr)) - { + if (freopen("CON", "w", stderr)) { std::cerr.sync_with_stdio(); } - if(freopen("CON", "r", stdin)) - { + if (freopen("CON", "r", stdin)) { std::cin.sync_with_stdio(); } - auto out = GetStdHandle (STD_OUTPUT_HANDLE); + auto out = GetStdHandle(STD_OUTPUT_HANDLE); DWORD written; - const char * endline = "\n"; + const char* endline = "\n"; WriteConsole(out, endline, strlen(endline), &written, NULL); consoleAttached = true; } @@ -211,15 +206,14 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) QCommandLineParser parser; parser.setApplicationDescription(BuildConfig.LAUNCHER_DISPLAYNAME); - parser.addOptions({ - {{"d", "dir"}, "Use a custom path as application root (use '.' for current directory)", "directory"}, - {{"l", "launch"}, "Launch the specified instance (by instance ID)", "instance"}, - {{"s", "server"}, "Join the specified server on launch (only valid in combination with --launch)", "address"}, - {{"a", "profile"}, "Use the account specified by its profile name (only valid in combination with --launch)", "profile"}, - {"alive", "Write a small '" + liveCheckFile + "' file after the launcher starts"}, - {{"I", "import"}, "Import instance from specified zip (local path or URL)", "file"}, - {"show", "Opens the window for the specified instance (by instance ID)", "show"} - }); + parser.addOptions( + { { { "d", "dir" }, "Use a custom path as application root (use '.' for current directory)", "directory" }, + { { "l", "launch" }, "Launch the specified instance (by instance ID)", "instance" }, + { { "s", "server" }, "Join the specified server on launch (only valid in combination with --launch)", "address" }, + { { "a", "profile" }, "Use the account specified by its profile name (only valid in combination with --launch)", "profile" }, + { "alive", "Write a small '" + liveCheckFile + "' file after the launcher starts" }, + { { "I", "import" }, "Import instance from specified zip (local path or URL)", "file" }, + { "show", "Opens the window for the specified instance (by instance ID)", "show" } }); parser.addHelpOption(); parser.addVersionOption(); @@ -232,7 +226,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_instanceIdToShowWindowOf = parser.value("show"); - for (auto zip_path : parser.values("import")){ + for (auto zip_path : parser.values("import")) { m_zipsToImport.append(QUrl::fromLocalFile(QFileInfo(zip_path).absoluteFilePath())); } @@ -241,10 +235,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_zipsToImport.append(QUrl::fromLocalFile(QFileInfo(zip_path).absoluteFilePath())); } - // error if --launch is missing with --server or --profile - if((!m_serverToJoin.isEmpty() || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty()) - { + if ((!m_serverToJoin.isEmpty() || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty()) { std::cerr << "--server and --profile can only be used in combination with --launch!" << std::endl; m_status = Application::Failed; return; @@ -256,7 +248,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) { // Root path is used for updates and portable data #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) - QDir foo(FS::PathCombine(binPath, "..")); // typically portable-root or /usr + QDir foo(FS::PathCombine(binPath, "..")); // typically portable-root or /usr m_rootPath = foo.absolutePath(); #elif defined(Q_OS_WIN32) m_rootPath = binPath; @@ -272,25 +264,19 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) QString dataPath; // change folder QString dirParam = parser.value("dir"); - if (!dirParam.isEmpty()) - { + if (!dirParam.isEmpty()) { // the dir param. it makes multimc data path point to whatever the user specified // on command line adjustedBy = "Command line"; dataPath = dirParam; - } - else - { + } else { QDir foo; - if (DesktopServices::isSnap()) - { + if (DesktopServices::isSnap()) { foo = QDir(getenv("SNAP_USER_COMMON")); - } - else - { + } else { foo = QDir(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); } - + dataPath = foo.absolutePath(); adjustedBy = "Persistent data path"; @@ -303,34 +289,27 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #endif } - if (!FS::ensureFolderPathExists(dataPath)) - { + if (!FS::ensureFolderPathExists(dataPath)) { showFatalErrorMessage( "The launcher data folder could not be created.", - QString( - "The launcher data folder could not be created.\n" - "\n" - "Make sure you have the right permissions to the launcher data folder and any folder needed to access it.\n" - "(%1)\n" - "\n" - "The launcher cannot continue until you fix this problem." - ).arg(dataPath) - ); + QString("The launcher data folder could not be created.\n" + "\n" + "Make sure you have the right permissions to the launcher data folder and any folder needed to access it.\n" + "(%1)\n" + "\n" + "The launcher cannot continue until you fix this problem.") + .arg(dataPath)); return; } - if (!QDir::setCurrent(dataPath)) - { - showFatalErrorMessage( - "The launcher data folder could not be opened.", - QString( - "The launcher data folder could not be opened.\n" - "\n" - "Make sure you have the right permissions to the launcher data folder.\n" - "(%1)\n" - "\n" - "The launcher cannot continue until you fix this problem." - ).arg(dataPath) - ); + if (!QDir::setCurrent(dataPath)) { + showFatalErrorMessage("The launcher data folder could not be opened.", + QString("The launcher data folder could not be opened.\n" + "\n" + "Make sure you have the right permissions to the launcher data folder.\n" + "(%1)\n" + "\n" + "The launcher cannot continue until you fix this problem.") + .arg(dataPath)); return; } @@ -344,17 +323,15 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // FIXME: you can run the same binaries with multiple data dirs and they won't clash. This could cause issues for updates. m_peerInstance = new LocalPeer(this, appID); connect(m_peerInstance, &LocalPeer::messageReceived, this, &Application::messageReceived); - if(m_peerInstance->isClient()) { + if (m_peerInstance->isClient()) { int timeout = 2000; - if(m_instanceIdToLaunch.isEmpty()) - { + if (m_instanceIdToLaunch.isEmpty()) { ApplicationMessage activate; activate.command = "activate"; m_peerInstance->sendMessage(activate.serialize(), timeout); - if(!m_zipsToImport.isEmpty()) - { + if (!m_zipsToImport.isEmpty()) { for (auto zip_url : m_zipsToImport) { ApplicationMessage import; import.command = "import"; @@ -362,19 +339,15 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_peerInstance->sendMessage(import.serialize(), timeout); } } - } - else - { + } else { ApplicationMessage launch; launch.command = "launch"; launch.args["id"] = m_instanceIdToLaunch; - if(!m_serverToJoin.isEmpty()) - { + if (!m_serverToJoin.isEmpty()) { launch.args["server"] = m_serverToJoin; } - if(!m_profileToUse.isEmpty()) - { + if (!m_profileToUse.isEmpty()) { launch.args["profile"] = m_profileToUse; } m_peerInstance->sendMessage(launch.serialize(), timeout); @@ -418,44 +391,51 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) qInstallMessageHandler(appDebugOutput); qSetMessagePattern( - "%{time process}" " " - "%{if-debug}D%{endif}" "%{if-info}I%{endif}" "%{if-warning}W%{endif}" "%{if-critical}C%{endif}" "%{if-fatal}F%{endif}" - " " "|" " " - "%{if-category}[%{category}]: %{endif}" - "%{message}"); - + "%{time process}" + " " + "%{if-debug}D%{endif}" + "%{if-info}I%{endif}" + "%{if-warning}W%{endif}" + "%{if-critical}C%{endif}" + "%{if-fatal}F%{endif}" + " " + "|" + " " + "%{if-category}[%{category}]: %{endif}" + "%{message}"); + bool foundLoggingRules = false; - + auto logRulesFile = QStringLiteral("qtlogging.ini"); auto logRulesPath = FS::PathCombine(dataPath, logRulesFile); - - qDebug() << "Testing" << logRulesPath << "..."; + + qDebug() << "Testing" << logRulesPath << "..."; foundLoggingRules = QFile::exists(logRulesPath); // search the dataPath() // seach app data standard path - if(!foundLoggingRules && !isPortable() && dirParam.isEmpty()) { + if (!foundLoggingRules && !isPortable() && dirParam.isEmpty()) { logRulesPath = QStandardPaths::locate(QStandardPaths::AppDataLocation, FS::PathCombine("..", logRulesFile)); - if(!logRulesPath.isEmpty()) { + if (!logRulesPath.isEmpty()) { qDebug() << "Found" << logRulesPath << "..."; foundLoggingRules = true; } } // seach root path - if(!foundLoggingRules) { + if (!foundLoggingRules) { #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) - logRulesPath = FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME, logRulesFile); + logRulesPath = FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME, logRulesFile); #else - logRulesPath = FS::PathCombine(m_rootPath, logRulesFile); + logRulesPath = FS::PathCombine(m_rootPath, logRulesFile); #endif qDebug() << "Testing" << logRulesPath << "..."; foundLoggingRules = QFile::exists(logRulesPath); } - - if(foundLoggingRules) { + + if (foundLoggingRules) { // load and set logging rules qDebug() << "Loading logging rules from:" << logRulesPath; - QSettings loggingRules(logRulesPath, QSettings::IniFormat); + QSettings loggingRules(logRulesPath, QSettings::IniFormat); loggingRules.beginGroup("Rules"); QStringList rule_names = loggingRules.childKeys(); QStringList rules; @@ -476,49 +456,44 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) bool migrated = false; if (!migrated) - migrated = handleDataMigration(dataPath, FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "../../PolyMC"), "PolyMC", "polymc.cfg"); + migrated = handleDataMigration( + dataPath, FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "../../PolyMC"), "PolyMC", + "polymc.cfg"); if (!migrated) - migrated = handleDataMigration(dataPath, FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "../../multimc"), "MultiMC", "multimc.cfg"); + migrated = handleDataMigration( + dataPath, FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "../../multimc"), "MultiMC", + "multimc.cfg"); } { - qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT; qDebug() << "Version : " << BuildConfig.printableVersionString(); qDebug() << "Platform : " << BuildConfig.BUILD_PLATFORM; qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC; - if (adjustedBy.size()) - { + if (adjustedBy.size()) { qDebug() << "Work dir before adjustment : " << origcwdPath; qDebug() << "Work dir after adjustment : " << QDir::currentPath(); qDebug() << "Adjusted by : " << adjustedBy; - } - else - { + } else { qDebug() << "Work dir : " << QDir::currentPath(); } qDebug() << "Binary path : " << binPath; qDebug() << "Application root path : " << m_rootPath; - if(!m_instanceIdToLaunch.isEmpty()) - { + if (!m_instanceIdToLaunch.isEmpty()) { qDebug() << "ID of instance to launch : " << m_instanceIdToLaunch; } - if(!m_serverToJoin.isEmpty()) - { + if (!m_serverToJoin.isEmpty()) { qDebug() << "Address of server to join :" << m_serverToJoin; } qDebug() << "<> Paths set."; } - if(m_liveCheck) - { + if (m_liveCheck) { QFile check(liveCheckFile); - if(check.open(QIODevice::WriteOnly | QIODevice::Truncate)) - { + if (check.open(QIODevice::WriteOnly | QIODevice::Truncate)) { auto payload = appID.toString().toUtf8(); - if(check.write(payload) == payload.size()) - { + if (check.write(payload) == payload.size()) { check.close(); } else { qWarning() << "Could not write into" << liveCheckFile << "!"; @@ -564,7 +539,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) QString resolvedDefaultMonospace = consoleFontInfo.family(); QFont resolvedFont(resolvedDefaultMonospace); qDebug() << "Detected default console font:" << resolvedDefaultMonospace - << ", substitutions:" << resolvedFont.substitutions().join(','); + << ", substitutions:" << resolvedFont.substitutions().join(','); m_settings->registerSetting("ConsoleFont", resolvedDefaultMonospace); m_settings->registerSetting("ConsoleFontSize", defaultSize); @@ -573,7 +548,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // Folders m_settings->registerSetting("InstanceDir", "instances"); - m_settings->registerSetting({"CentralModsDir", "ModsDir"}, "mods"); + m_settings->registerSetting({ "CentralModsDir", "ModsDir" }, "mods"); m_settings->registerSetting("IconsDir", "icons"); m_settings->registerSetting("DownloadsDir", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)); m_settings->registerSetting("DownloadsDirWatchRecursive", false); @@ -592,20 +567,20 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("LogPrePostOutput", true); // Window Size - m_settings->registerSetting({"LaunchMaximized", "MCWindowMaximize"}, false); - m_settings->registerSetting({"MinecraftWinWidth", "MCWindowWidth"}, 854); - m_settings->registerSetting({"MinecraftWinHeight", "MCWindowHeight"}, 480); + m_settings->registerSetting({ "LaunchMaximized", "MCWindowMaximize" }, false); + m_settings->registerSetting({ "MinecraftWinWidth", "MCWindowWidth" }, 854); + m_settings->registerSetting({ "MinecraftWinHeight", "MCWindowHeight" }, 480); // Proxy Settings m_settings->registerSetting("ProxyType", "None"); - m_settings->registerSetting({"ProxyAddr", "ProxyHostName"}, "127.0.0.1"); + m_settings->registerSetting({ "ProxyAddr", "ProxyHostName" }, "127.0.0.1"); m_settings->registerSetting("ProxyPort", 8080); - m_settings->registerSetting({"ProxyUser", "ProxyUsername"}, ""); - m_settings->registerSetting({"ProxyPass", "ProxyPassword"}, ""); + m_settings->registerSetting({ "ProxyUser", "ProxyUsername" }, ""); + m_settings->registerSetting({ "ProxyPass", "ProxyPassword" }, ""); // Memory - m_settings->registerSetting({"MinMemAlloc", "MinMemoryAlloc"}, 512); - m_settings->registerSetting({"MaxMemAlloc", "MaxMemoryAlloc"}, suitableMaxMem()); + m_settings->registerSetting({ "MinMemAlloc", "MinMemoryAlloc" }, 512); + m_settings->registerSetting({ "MaxMemAlloc", "MaxMemoryAlloc" }, suitableMaxMem()); m_settings->registerSetting("PermGen", 128); // Java Settings @@ -647,8 +622,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("WrapperCommand", ""); // Custom Commands - m_settings->registerSetting({"PreLaunchCommand", "PreLaunchCmd"}, ""); - m_settings->registerSetting({"PostExitCommand", "PostExitCmd"}, ""); + m_settings->registerSetting({ "PreLaunchCommand", "PreLaunchCmd" }, ""); +