From 1582bb57ed81af5962dd644406eb9fa34ebd55d5 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 1 Nov 2022 20:34:23 +0100 Subject: [PATCH 01/10] Merge pull request #365 from Scrumplex/fix-logo --- program_info/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index f064e0984..b0507816b 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -21,12 +21,12 @@ set(Launcher_Domain "prismlauncher.org" PARENT_SCOPE) set(Launcher_UserAgent "${Launcher_CommonName}/${Launcher_VERSION_NAME}" PARENT_SCOPE) set(Launcher_ConfigFile "prismlauncher.cfg" PARENT_SCOPE) set(Launcher_Git "https://github.com/PrismLauncher/PrismLauncher" PARENT_SCOPE) -set(Launcher_DesktopFileName "org.prismlauncher.PrismLauncher.desktop") -set(Launcher_SVGFileName "org.prismlauncher.PrismLauncher.svg") +set(Launcher_DesktopFileName "org.prismlauncher.PrismLauncher.desktop" PARENT_SCOPE) +set(Launcher_SVGFileName "org.prismlauncher.PrismLauncher.svg" PARENT_SCOPE) -set(Launcher_Desktop "program_info/${Launcher_DesktopFileName}" PARENT_SCOPE) +set(Launcher_Desktop "program_info/org.prismlauncher.PrismLauncher.desktop" PARENT_SCOPE) set(Launcher_MetaInfo "program_info/org.prismlauncher.PrismLauncher.metainfo.xml" PARENT_SCOPE) -set(Launcher_SVG "program_info/${Launcher_SVGFileName}" PARENT_SCOPE) +set(Launcher_SVG "program_info/org.prismlauncher.PrismLauncher.svg" PARENT_SCOPE) set(Launcher_Branding_ICNS "program_info/prismlauncher.icns" PARENT_SCOPE) set(Launcher_Branding_ICO "program_info/prismlauncher.ico") set(Launcher_Branding_ICO "${Launcher_Branding_ICO}" PARENT_SCOPE) From 0b98a0884ed4c37bf260cf0d60b7ca6191f5af2b Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 1 Nov 2022 21:56:26 +0100 Subject: [PATCH 02/10] Merge pull request #368 from PrismLauncher/credits --- launcher/ui/dialogs/AboutDialog.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/launcher/ui/dialogs/AboutDialog.cpp b/launcher/ui/dialogs/AboutDialog.cpp index 52d6baef4..a36e4a3dd 100644 --- a/launcher/ui/dialogs/AboutDialog.cpp +++ b/launcher/ui/dialogs/AboutDialog.cpp @@ -73,17 +73,12 @@ QString getCreditsHtml() stream << "

" << QObject::tr("%1 Developers", "About Credits").arg(BuildConfig.LAUNCHER_DISPLAYNAME) << "

\n"; stream << QString("

Sefa Eyeoglu (Scrumplex) %1

\n") .arg(getWebsite("https://scrumplex.net")); stream << QString("

dada513 %1

\n") .arg(getGitHub("dada513")); - stream << QString("

txtsd %1

\n") .arg(getGitHub("txtsd")); + stream << QString("

txtsd %1

\n") .arg(getWebsite("https://ihavea.quest")); stream << QString("

timoreo %1

\n") .arg(getGitHub("timoreo22")); stream << QString("

Ezekiel Smith (ZekeSmith) %1

\n") .arg(getGitHub("ZekeSmith")); stream << QString("

cozyGalvinism %1

\n") .arg(getGitHub("cozyGalvinism")); - stream << "
\n"; - - //: %1 is the name of the launcher, determined at build time, e.g. "Prism Launcher Contributors" - stream << "

" << QObject::tr("%1 Contributors", "About Credits").arg(BuildConfig.LAUNCHER_DISPLAYNAME) << "

\n"; stream << QString("

DioEgizio %1

\n") .arg(getGitHub("DioEgizio")); stream << QString("

flowln %1

\n") .arg(getGitHub("flowln")); - stream << QString("

swirl %1

\n") .arg(getWebsite("https://swurl.xyz/")); stream << "
\n"; // TODO: possibly retrieve from git history at build time? From a1fbf2b13731be169c6e8372bd6c6e96ec53eb71 Mon Sep 17 00:00:00 2001 From: txtsd Date: Wed, 2 Nov 2022 10:38:26 +0530 Subject: [PATCH 03/10] Merge pull request #346 from ryanccn/more-user-friendly-java-warning-text-ahaha --- launcher/minecraft/launch/VerifyJavaInstall.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/launcher/minecraft/launch/VerifyJavaInstall.cpp b/launcher/minecraft/launch/VerifyJavaInstall.cpp index 99809f828..6ae666b47 100644 --- a/launcher/minecraft/launch/VerifyJavaInstall.cpp +++ b/launcher/minecraft/launch/VerifyJavaInstall.cpp @@ -71,5 +71,7 @@ void VerifyJavaInstall::executeTask() { { emit logLine(tr("Java version %1").arg(major), MessageLevel::Error); } + emit logLine(tr("Go to instance Java settings to change your Java version or disable the Java compatibility check if you know what you're doing."), MessageLevel::Error); + emitFailed(QString("Incompatible Java major version")); } From 3aee1d60d8b558b69ba315274dc641e49bce3853 Mon Sep 17 00:00:00 2001 From: txtsd Date: Thu, 3 Nov 2022 10:52:36 +0530 Subject: [PATCH 04/10] Merge pull request #379 from TheLastRar/win-stacksize --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index abdbb20c0..d977640f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,11 @@ set(CMAKE_C_STANDARD 11) include(GenerateExportHeader) set(CMAKE_CXX_FLAGS "-Wall -pedantic -fstack-protector-strong --param=ssp-buffer-size=4 ${CMAKE_CXX_FLAGS}") +# ATL's packlist needs more than the default 1 Mib stack on windows +if(WIN32) + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--stack,8388608 ${CMAKE_EXE_LINKER_FLAGS}") +endif() + # Fix build with Qt 5.13 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y") From 6e58635bfb02be978975cb1d2f8530f197506567 Mon Sep 17 00:00:00 2001 From: txtsd Date: Fri, 4 Nov 2022 15:39:41 +0530 Subject: [PATCH 05/10] Merge pull request #374 from flowln/fix_lto --- launcher/BaseInstaller.h | 5 +-- launcher/BaseVersion.h | 5 ++- launcher/BaseVersionList.cpp | 10 +++--- launcher/BaseVersionList.h | 8 ++--- launcher/java/JavaInstallList.cpp | 10 +++--- launcher/java/JavaInstallList.h | 6 ++-- launcher/meta/Index.cpp | 16 +++++----- launcher/meta/Index.h | 17 +++++----- launcher/meta/JsonFormat.cpp | 18 +++++------ launcher/meta/Version.cpp | 4 +-- launcher/meta/Version.h | 11 ++++--- launcher/meta/VersionList.cpp | 30 ++++++++--------- launcher/meta/VersionList.h | 32 ++++++++++--------- .../minecraft/VanillaInstanceCreationTask.cpp | 2 +- .../minecraft/VanillaInstanceCreationTask.h | 8 ++--- .../atlauncher/ATLPackInstallTask.cpp | 4 +-- .../atlauncher/ATLPackInstallTask.h | 6 ++-- launcher/ui/dialogs/VersionSelectDialog.cpp | 2 +- launcher/ui/dialogs/VersionSelectDialog.h | 2 +- launcher/ui/pages/modplatform/VanillaPage.cpp | 8 ++--- launcher/ui/pages/modplatform/VanillaPage.h | 12 +++---- .../AtlUserInteractionSupportImpl.cpp | 2 +- .../AtlUserInteractionSupportImpl.h | 2 +- launcher/ui/widgets/JavaSettingsWidget.cpp | 2 +- launcher/ui/widgets/JavaSettingsWidget.h | 2 +- launcher/ui/widgets/ModFilterWidget.h | 4 +-- launcher/ui/widgets/VersionSelectWidget.cpp | 6 ++-- launcher/ui/widgets/VersionSelectWidget.h | 4 +-- 28 files changed, 120 insertions(+), 118 deletions(-) diff --git a/launcher/BaseInstaller.h b/launcher/BaseInstaller.h index b2e6a14d6..a1b80e93f 100644 --- a/launcher/BaseInstaller.h +++ b/launcher/BaseInstaller.h @@ -17,13 +17,14 @@ #include +#include "BaseVersion.h" + class MinecraftInstance; class QDir; class QString; class QObject; class Task; class BaseVersion; -typedef std::shared_ptr BaseVersionPtr; class BaseInstaller { @@ -35,7 +36,7 @@ class BaseInstaller virtual bool add(MinecraftInstance *to); virtual bool remove(MinecraftInstance *from); - virtual Task *createInstallTask(MinecraftInstance *instance, BaseVersionPtr version, QObject *parent) = 0; + virtual Task *createInstallTask(MinecraftInstance *instance, BaseVersion::Ptr version, QObject *parent) = 0; protected: virtual QString id() const = 0; diff --git a/launcher/BaseVersion.h b/launcher/BaseVersion.h index b88105fb6..ca0e45027 100644 --- a/launcher/BaseVersion.h +++ b/launcher/BaseVersion.h @@ -25,6 +25,7 @@ class BaseVersion { public: + using Ptr = std::shared_ptr; virtual ~BaseVersion() {} /*! * A string used to identify this version in config files. @@ -54,6 +55,4 @@ class BaseVersion }; }; -typedef std::shared_ptr BaseVersionPtr; - -Q_DECLARE_METATYPE(BaseVersionPtr) +Q_DECLARE_METATYPE(BaseVersion::Ptr) diff --git a/launcher/BaseVersionList.cpp b/launcher/BaseVersionList.cpp index b4a7d6dda..4ed826123 100644 --- a/launcher/BaseVersionList.cpp +++ b/launcher/BaseVersionList.cpp @@ -40,20 +40,20 @@ BaseVersionList::BaseVersionList(QObject *parent) : QAbstractListModel(parent) { } -BaseVersionPtr BaseVersionList::findVersion(const QString &descriptor) +BaseVersion::Ptr BaseVersionList::findVersion(const QString &descriptor) { for (int i = 0; i < count(); i++) { if (at(i)->descriptor() == descriptor) return at(i); } - return BaseVersionPtr(); + return nullptr; } -BaseVersionPtr BaseVersionList::getRecommended() const +BaseVersion::Ptr BaseVersionList::getRecommended() const { if (count() <= 0) - return BaseVersionPtr(); + return nullptr; else return at(0); } @@ -66,7 +66,7 @@ QVariant BaseVersionList::data(const QModelIndex &index, int role) const if (index.row() > count()) return QVariant(); - BaseVersionPtr version = at(index.row()); + BaseVersion::Ptr version = at(index.row()); switch (role) { diff --git a/launcher/BaseVersionList.h b/launcher/BaseVersionList.h index 80a91e8f5..31f29022a 100644 --- a/launcher/BaseVersionList.h +++ b/launcher/BaseVersionList.h @@ -70,7 +70,7 @@ class BaseVersionList : public QAbstractListModel virtual bool isLoaded() = 0; //! Gets the version at the given index. - virtual const BaseVersionPtr at(int i) const = 0; + virtual const BaseVersion::Ptr at(int i) const = 0; //! Returns the number of versions in the list. virtual int count() const = 0; @@ -90,13 +90,13 @@ class BaseVersionList : public QAbstractListModel * \return A const pointer to the version with the given descriptor. NULL if * one doesn't exist. */ - virtual BaseVersionPtr findVersion(const QString &descriptor); + virtual BaseVersion::Ptr findVersion(const QString &descriptor); /*! * \brief Gets the recommended version from this list * If the list doesn't support recommended versions, this works exactly as getLatestStable */ - virtual BaseVersionPtr getRecommended() const; + virtual BaseVersion::Ptr getRecommended() const; /*! * Sorts the version list. @@ -117,5 +117,5 @@ protected * then copies the versions and sets their parents correctly. * \param versions List of versions whose parents should be set. */ - virtual void updateListData(QList versions) = 0; + virtual void updateListData(QList versions) = 0; }; diff --git a/launcher/java/JavaInstallList.cpp b/launcher/java/JavaInstallList.cpp index 0249bd22e..155c956a2 100644 --- a/launcher/java/JavaInstallList.cpp +++ b/launcher/java/JavaInstallList.cpp @@ -73,7 +73,7 @@ void JavaInstallList::load() } } -const BaseVersionPtr JavaInstallList::at(int i) const +const BaseVersion::Ptr JavaInstallList::at(int i) const { return m_vlist.at(i); } @@ -122,7 +122,7 @@ BaseVersionList::RoleList JavaInstallList::providesRoles() const } -void JavaInstallList::updateListData(QList versions) +void JavaInstallList::updateListData(QList versions) { beginResetModel(); m_vlist = versions; @@ -137,7 +137,7 @@ void JavaInstallList::updateListData(QList versions) m_loadTask.reset(); } -bool sortJavas(BaseVersionPtr left, BaseVersionPtr right) +bool sortJavas(BaseVersion::Ptr left, BaseVersion::Ptr right) { auto rleft = std::dynamic_pointer_cast(right); auto rright = std::dynamic_pointer_cast(left); @@ -210,11 +210,11 @@ void JavaListLoadTask::javaCheckerFinished() } } - QList javas_bvp; + QList javas_bvp; for (auto java : candidates) { //qDebug() << java->id << java->arch << " at " << java->path; - BaseVersionPtr bp_java = std::dynamic_pointer_cast(java); + BaseVersion::Ptr bp_java = std::dynamic_pointer_cast(java); if (bp_java) { diff --git a/launcher/java/JavaInstallList.h b/launcher/java/JavaInstallList.h index 3c237edf1..733dc7e1c 100644 --- a/launcher/java/JavaInstallList.h +++ b/launcher/java/JavaInstallList.h @@ -42,7 +42,7 @@ class JavaInstallList : public BaseVersionList Task::Ptr getLoadTask() override; bool isLoaded() override; - const BaseVersionPtr at(int i) const override; + const BaseVersion::Ptr at(int i) const override; int count() const override; void sortVersions() override; @@ -50,7 +50,7 @@ class JavaInstallList : public BaseVersionList RoleList providesRoles() const override; public slots: - void updateListData(QList versions) override; + void updateListData(QList versions) override; protected: void load(); @@ -59,7 +59,7 @@ public slots: protected: Status m_status = Status::NotDone; shared_qobject_ptr m_loadTask; - QList m_vlist; + QList m_vlist; }; class JavaListLoadTask : public Task diff --git a/launcher/meta/Index.cpp b/launcher/meta/Index.cpp index 6802470d9..eec1b329b 100644 --- a/launcher/meta/Index.cpp +++ b/launcher/meta/Index.cpp @@ -24,7 +24,7 @@ Index::Index(QObject *parent) : QAbstractListModel(parent) { } -Index::Index(const QVector &lists, QObject *parent) +Index::Index(const QVector &lists, QObject *parent) : QAbstractListModel(parent), m_lists(lists) { for (int i = 0; i < m_lists.size(); ++i) @@ -41,7 +41,7 @@ QVariant Index::data(const QModelIndex &index, int role) const return QVariant(); } - VersionListPtr list = m_lists.at(index.row()); + VersionList::Ptr list = m_lists.at(index.row()); switch (role) { case Qt::DisplayRole: @@ -81,9 +81,9 @@ bool Index::hasUid(const QString &uid) const return m_uids.contains(uid); } -VersionListPtr Index::get(const QString &uid) +VersionList::Ptr Index::get(const QString &uid) { - VersionListPtr out = m_uids.value(uid, nullptr); + VersionList::Ptr out = m_uids.value(uid, nullptr); if(!out) { out = std::make_shared(uid); @@ -92,7 +92,7 @@ VersionListPtr Index::get(const QString &uid) return out; } -VersionPtr Index::get(const QString &uid, const QString &version) +Version::Ptr Index::get(const QString &uid, const QString &version) { auto list = get(uid); return list->getVersion(version); @@ -105,7 +105,7 @@ void Index::parse(const QJsonObject& obj) void Index::merge(const std::shared_ptr &other) { - const QVector lists = std::dynamic_pointer_cast(other)->m_lists; + const QVector lists = std::dynamic_pointer_cast(other)->m_lists; // initial load, no need to merge if (m_lists.isEmpty()) { @@ -120,7 +120,7 @@ void Index::merge(const std::shared_ptr &other) } else { - for (const VersionListPtr &list : lists) + for (const VersionList::Ptr &list : lists) { if (m_uids.contains(list->uid())) { @@ -138,7 +138,7 @@ void Index::merge(const std::shared_ptr &other) } } -void Index::connectVersionList(const int row, const VersionListPtr &list) +void Index::connectVersionList(const int row, const VersionList::Ptr &list) { connect(list.get(), &VersionList::nameChanged, this, [this, row]() { diff --git a/launcher/meta/Index.h b/launcher/meta/Index.h index d33ab0c89..06ea09dcf 100644 --- a/launcher/meta/Index.h +++ b/launcher/meta/Index.h @@ -19,20 +19,19 @@ #include #include "BaseEntity.h" +#include "meta/VersionList.h" class Task; namespace Meta { -using VersionListPtr = std::shared_ptr; -using VersionPtr = std::shared_ptr; class Index : public QAbstractListModel, public BaseEntity { Q_OBJECT public: explicit Index(QObject *parent = nullptr); - explicit Index(const QVector &lists, QObject *parent = nullptr); + explicit Index(const QVector &lists, QObject *parent = nullptr); enum { @@ -49,21 +48,21 @@ class Index : public QAbstractListModel, public BaseEntity QString localFilename() const override { return "index.json"; } // queries - VersionListPtr get(const QString &uid); - VersionPtr get(const QString &uid, const QString &version); + VersionList::Ptr get(const QString &uid); + Version::Ptr get(const QString &uid, const QString &version); bool hasUid(const QString &uid) const; - QVector lists() const { return m_lists; } + QVector lists() const { return m_lists; } public: // for usage by parsers only void merge(const std::shared_ptr &other); void parse(const QJsonObject &obj) override; private: - QVector m_lists; - QHash m_uids; + QVector m_lists; + QHash m_uids; - void connectVersionList(const int row, const VersionListPtr &list); + void connectVersionList(const int row, const VersionList::Ptr &list); }; } diff --git a/launcher/meta/JsonFormat.cpp b/launcher/meta/JsonFormat.cpp index 796da4bb6..473f37d66 100644 --- a/launcher/meta/JsonFormat.cpp +++ b/launcher/meta/JsonFormat.cpp @@ -37,11 +37,11 @@ MetadataVersion currentFormatVersion() static std::shared_ptr parseIndexInternal(const QJsonObject &obj) { const QVector objects = requireIsArrayOf(obj, "packages"); - QVector lists; + QVector lists; lists.reserve(objects.size()); std::transform(objects.begin(), objects.end(), std::back_inserter(lists), [](const QJsonObject &obj) { - VersionListPtr list = std::make_shared(requireString(obj, "uid")); + VersionList::Ptr list = std::make_shared(requireString(obj, "uid")); list->setName(ensureString(obj, "name", QString())); return list; }); @@ -49,9 +49,9 @@ static std::shared_ptr parseIndexInternal(const QJsonObject &obj) } // Version -static VersionPtr parseCommonVersion(const QString &uid, const QJsonObject &obj) +static Version::Ptr parseCommonVersion(const QString &uid, const QJsonObject &obj) { - VersionPtr version = std::make_shared(uid, requireString(obj, "version")); + Version::Ptr version = std::make_shared(uid, requireString(obj, "version")); version->setTime(QDateTime::fromString(requireString(obj, "releaseTime"), Qt::ISODate).toMSecsSinceEpoch() / 1000); version->setType(ensureString(obj, "type", QString())); version->setRecommended(ensureBoolean(obj, QString("recommended"), false)); @@ -63,9 +63,9 @@ static VersionPtr parseCommonVersion(const QString &uid, const QJsonObject &obj) return version; } -static std::shared_ptr parseVersionInternal(const QJsonObject &obj) +static Version::Ptr parseVersionInternal(const QJsonObject &obj) { - VersionPtr version = parseCommonVersion(requireString(obj, "uid"), obj); + Version::Ptr version = parseCommonVersion(requireString(obj, "uid"), obj); version->setData(OneSixVersionFormat::versionFileFromJson(QJsonDocument(obj), QString("%1/%2.json").arg(version->uid(), version->version()), @@ -74,12 +74,12 @@ static std::shared_ptr parseVersionInternal(const QJsonObject &obj) } // Version list / package -static std::shared_ptr parseVersionListInternal(const QJsonObject &obj) +static VersionList::Ptr parseVersionListInternal(const QJsonObject &obj) { const QString uid = requireString(obj, "uid"); const QVector versionsRaw = requireIsArrayOf(obj, "versions"); - QVector versions; + QVector versions; versions.reserve(versionsRaw.size()); std::transform(versionsRaw.begin(), versionsRaw.end(), std::back_inserter(versions), [uid](const QJsonObject &vObj) { @@ -88,7 +88,7 @@ static std::shared_ptr parseVersionListInternal(const QJsonObject & return version; }); - VersionListPtr list = std::make_shared(uid); + VersionList::Ptr list = std::make_shared(uid); list->setName(ensureString(obj, "name", QString())); list->setVersions(versions); return list; diff --git a/launcher/meta/Version.cpp b/launcher/meta/Version.cpp index a8dc3169d..68cfa55c8 100644 --- a/launcher/meta/Version.cpp +++ b/launcher/meta/Version.cpp @@ -54,7 +54,7 @@ void Meta::Version::parse(const QJsonObject& obj) parseVersion(obj, this); } -void Meta::Version::mergeFromList(const Meta::VersionPtr& other) +void Meta::Version::mergeFromList(const Meta::Version::Ptr& other) { if(other->m_providesRecommendations) { @@ -85,7 +85,7 @@ void Meta::Version::mergeFromList(const Meta::VersionPtr& other) } } -void Meta::Version::merge(const VersionPtr &other) +void Meta::Version::merge(const Version::Ptr &other) { mergeFromList(other); if(other->m_data) diff --git a/launcher/meta/Version.h b/launcher/meta/Version.h index dea8dc8a3..7228fa366 100644 --- a/launcher/meta/Version.h +++ b/launcher/meta/Version.h @@ -30,13 +30,14 @@ namespace Meta { -using VersionPtr = std::shared_ptr; class Version : public QObject, public BaseVersion, public BaseEntity { Q_OBJECT -public: /* con/des */ +public: + using Ptr = std::shared_ptr; + explicit Version(const QString &uid, const QString &version); virtual ~Version(); @@ -78,8 +79,8 @@ class Version : public QObject, public BaseVersion, public BaseEntity return m_data != nullptr; } - void merge(const VersionPtr &other); - void mergeFromList(const VersionPtr &other); + void merge(const Version::Ptr &other); + void mergeFromList(const Version::Ptr &other); void parse(const QJsonObject &obj) override; QString localFilename() const override; @@ -113,4 +114,4 @@ class Version : public QObject, public BaseVersion, public BaseEntity }; } -Q_DECLARE_METATYPE(Meta::VersionPtr) +Q_DECLARE_METATYPE(Meta::Version::Ptr) diff --git a/launcher/meta/VersionList.cpp b/launcher/meta/VersionList.cpp index f609e94c3..7f001dfc2 100644 --- a/launcher/meta/VersionList.cpp +++ b/launcher/meta/VersionList.cpp @@ -40,7 +40,7 @@ bool VersionList::isLoaded() return BaseEntity::isLoaded(); } -const BaseVersionPtr VersionList::at(int i) const +const BaseVersion::Ptr VersionList::at(int i) const { return m_versions.at(i); } @@ -52,7 +52,7 @@ int VersionList::count() const void VersionList::sortVersions() { beginResetModel(); - std::sort(m_versions.begin(), m_versions.end(), [](const VersionPtr &a, const VersionPtr &b) + std::sort(m_versions.begin(), m_versions.end(), [](const Version::Ptr &a, const Version::Ptr &b) { return *a.get() < *b.get(); }); @@ -66,7 +66,7 @@ QVariant VersionList::data(const QModelIndex &index, int role) const return QVariant(); } - VersionPtr version = m_versions.at(index.row()); + Version::Ptr version = m_versions.at(index.row()); switch (role) { @@ -129,9 +129,9 @@ QString VersionList::humanReadable() const return m_name.isEmpty() ? m_uid : m_name; } -VersionPtr VersionList::getVersion(const QString &version) +Version::Ptr VersionList::getVersion(const QString &version) { - VersionPtr out = m_lookup.value(version, nullptr); + Version::Ptr out = m_lookup.value(version, nullptr); if(!out) { out = std::make_shared(m_uid, version); @@ -143,7 +143,7 @@ VersionPtr VersionList::getVersion(const QString &version) bool VersionList::hasVersion(QString version) const { auto ver = std::find_if(m_versions.constBegin(), m_versions.constEnd(), - [&](Meta::VersionPtr const& a){ return a->version() == version; }); + [&](Meta::Version::Ptr const& a){ return a->version() == version; }); return (ver != m_versions.constEnd()); } @@ -153,11 +153,11 @@ void VersionList::setName(const QString &name) emit nameChanged(name); } -void VersionList::setVersions(const QVector &versions) +void VersionList::setVersions(const QVector &versions) { beginResetModel(); m_versions = versions; - std::sort(m_versions.begin(), m_versions.end(), [](const VersionPtr &a, const VersionPtr &b) + std::sort(m_versions.begin(), m_versions.end(), [](const Version::Ptr &a, const Version::Ptr &b) { return a->rawTime() > b->rawTime(); }); @@ -168,7 +168,7 @@ void VersionList::setVersions(const QVector &versions) } // FIXME: this is dumb, we have 'recommended' as part of the metadata already... - auto recommendedIt = std::find_if(m_versions.constBegin(), m_versions.constEnd(), [](const VersionPtr &ptr) { return ptr->type() == "release"; }); + auto recommendedIt = std::find_if(m_versions.constBegin(), m_versions.constEnd(), [](const Version::Ptr &ptr) { return ptr->type() == "release"; }); m_recommended = recommendedIt == m_versions.constEnd() ? nullptr : *recommendedIt; endResetModel(); } @@ -179,7 +179,7 @@ void VersionList::parse(const QJsonObject& obj) } // FIXME: this is dumb, we have 'recommended' as part of the metadata already... -static const Meta::VersionPtr &getBetterVersion(const Meta::VersionPtr &a, const Meta::VersionPtr &b) +static const Meta::Version::Ptr &getBetterVersion(const Meta::Version::Ptr &a, const Meta::Version::Ptr &b) { if(!a) return b; @@ -194,7 +194,7 @@ static const Meta::VersionPtr &getBetterVersion(const Meta::VersionPtr &a, const return (a->type() == "release" ? a : b); } -void VersionList::mergeFromIndex(const VersionListPtr &other) +void VersionList::mergeFromIndex(const VersionList::Ptr &other) { if (m_name != other->m_name) { @@ -202,7 +202,7 @@ void VersionList::mergeFromIndex(const VersionListPtr &other) } } -void VersionList::merge(const VersionListPtr &other) +void VersionList::merge(const VersionList::Ptr &other) { if (m_name != other->m_name) { @@ -216,7 +216,7 @@ void VersionList::merge(const VersionListPtr &other) { qWarning() << "Empty list loaded ..."; } - for (const VersionPtr &version : other->m_versions) + for (const Version::Ptr &version : other->m_versions) { // we already have the version. merge the contents if (m_lookup.contains(version->version())) @@ -235,7 +235,7 @@ void VersionList::merge(const VersionListPtr &other) endResetModel(); } -void VersionList::setupAddedVersion(const int row, const VersionPtr &version) +void VersionList::setupAddedVersion(const int row, const Version::Ptr &version) { // FIXME: do not disconnect from everythin, disconnect only the lambdas here version->disconnect(); @@ -244,7 +244,7 @@ void VersionList::setupAddedVersion(const int row, const VersionPtr &version) connect(version.get(), &Version::typeChanged, this, [this, row]() { emit dataChanged(index(row), index(row), QVector() << TypeRole); }); } -BaseVersionPtr VersionList::getRecommended() const +BaseVersion::Ptr VersionList::getRecommended() const { return m_recommended; } diff --git a/launcher/meta/VersionList.h b/launcher/meta/VersionList.h index a6db2fd73..a4d5603d9 100644 --- a/launcher/meta/VersionList.h +++ b/launcher/meta/VersionList.h @@ -20,10 +20,10 @@ #include #include +#include "meta/Version.h" + namespace Meta { -using VersionPtr = std::shared_ptr; -using VersionListPtr = std::shared_ptr; class VersionList : public BaseVersionList, public BaseEntity { @@ -33,6 +33,8 @@ class VersionList : public BaseVersionList, public BaseEntity public: explicit VersionList(const QString &uid, QObject *parent = nullptr); + using Ptr = std::shared_ptr; + enum Roles { UidRole = Qt::UserRole + 100, @@ -43,11 +45,11 @@ class VersionList : public BaseVersionList, public BaseEntity Task::Ptr getLoadTask() override; bool isLoaded() override; - const BaseVersionPtr at(int i) const override; + const BaseVersion::Ptr at(int i) const override; int count() const override; void sortVersions() override; - BaseVersionPtr getRecommended() const override; + BaseVersion::Ptr getRecommended() const override; QVariant data(const QModelIndex &index, int role) const override; RoleList providesRoles() const override; @@ -65,38 +67,38 @@ class VersionList : public BaseVersionList, public BaseEntity } QString humanReadable() const; - VersionPtr getVersion(const QString &version); + Version::Ptr getVersion(const QString &version); bool hasVersion(QString version) const; - QVector versions() const + QVector versions() const { return m_versions; } public: // for usage only by parsers void setName(const QString &name); - void setVersions(const QVector &versions); - void merge(const VersionListPtr &other); - void mergeFromIndex(const VersionListPtr &other); + void setVersions(const QVector &versions); + void merge(const VersionList::Ptr &other); + void mergeFromIndex(const VersionList::Ptr &other); void parse(const QJsonObject &obj) override; signals: void nameChanged(const QString &name); protected slots: - void updateListData(QList) override + void updateListData(QList) override { } private: - QVector m_versions; - QHash m_lookup; + QVector m_versions; + QHash m_lookup; QString m_uid; QString m_name; - VersionPtr m_recommended; + Version::Ptr m_recommended; - void setupAddedVersion(const int row, const VersionPtr &version); + void setupAddedVersion(const int row, const Version::Ptr &version); }; } -Q_DECLARE_METATYPE(Meta::VersionListPtr) +Q_DECLARE_METATYPE(Meta::VersionList::Ptr) diff --git a/launcher/minecraft/VanillaInstanceCreationTask.cpp b/launcher/minecraft/VanillaInstanceCreationTask.cpp index c45daa9a8..0bb92e876 100644 --- a/launcher/minecraft/VanillaInstanceCreationTask.cpp +++ b/launcher/minecraft/VanillaInstanceCreationTask.cpp @@ -7,7 +7,7 @@ #include "minecraft/PackProfile.h" #include "settings/INISettingsObject.h" -VanillaCreationTask::VanillaCreationTask(BaseVersionPtr version, QString loader, BaseVersionPtr loader_version) +VanillaCreationTask::VanillaCreationTask(BaseVersion::Ptr version, QString loader, BaseVersion::Ptr loader_version) : InstanceCreationTask(), m_version(std::move(version)), m_using_loader(true), m_loader(std::move(loader)), m_loader_version(std::move(loader_version)) {} diff --git a/launcher/minecraft/VanillaInstanceCreationTask.h b/launcher/minecraft/VanillaInstanceCreationTask.h index 7a37bbd6a..d1b816824 100644 --- a/launcher/minecraft/VanillaInstanceCreationTask.h +++ b/launcher/minecraft/VanillaInstanceCreationTask.h @@ -7,16 +7,16 @@ class VanillaCreationTask final : public InstanceCreationTask { Q_OBJECT public: - VanillaCreationTask(BaseVersionPtr version) : InstanceCreationTask(), m_version(std::move(version)) {} - VanillaCreationTask(BaseVersionPtr version, QString loader, BaseVersionPtr loader_version); + VanillaCreationTask(BaseVersion::Ptr version) : InstanceCreationTask(), m_version(std::move(version)) {} + VanillaCreationTask(BaseVersion::Ptr version, QString loader, BaseVersion::Ptr loader_version); bool createInstance() override; private: // Version to update to / create of the instance. - BaseVersionPtr m_version; + BaseVersion::Ptr m_version; bool m_using_loader = false; QString m_loader; - BaseVersionPtr m_loader_version; + BaseVersion::Ptr m_loader_version; }; diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp index 68d759436..291ad9161 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.cpp @@ -58,7 +58,7 @@ namespace ATLauncher { -static Meta::VersionPtr getComponentVersion(const QString& uid, const QString& version); +static Meta::Version::Ptr getComponentVersion(const QString& uid, const QString& version); PackInstallTask::PackInstallTask(UserInteractionSupport *support, QString packName, QString version, InstallMode installMode) { @@ -1037,7 +1037,7 @@ void PackInstallTask::install() emitSucceeded(); } -static Meta::VersionPtr getComponentVersion(const QString& uid, const QString& version) +static Meta::Version::Ptr getComponentVersion(const QString& uid, const QString& version) { auto vlist = APPLICATION->metadataIndex()->get(uid); if (!vlist) diff --git a/launcher/modplatform/atlauncher/ATLPackInstallTask.h b/launcher/modplatform/atlauncher/ATLPackInstallTask.h index 78cd87fb1..90e25ae2e 100644 --- a/launcher/modplatform/atlauncher/ATLPackInstallTask.h +++ b/launcher/modplatform/atlauncher/ATLPackInstallTask.h @@ -68,7 +68,7 @@ class UserInteractionSupport { * Requests a user interaction to select a component version from a given version list * and constrained to a given Minecraft version. */ - virtual QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) = 0; + virtual QString chooseVersion(Meta::VersionList::Ptr vlist, QString minecraftVersion) = 0; /** * Requests a user interaction to display a message. @@ -137,8 +137,8 @@ private slots: QString archivePath; QStringList jarmods; - Meta::VersionPtr minecraftVersion; - QMap componentsToInstall; + Meta::Version::Ptr minecraftVersion; + QMap componentsToInstall; QFuture> m_extractFuture; QFutureWatcher> m_extractFutureWatcher; diff --git a/launcher/ui/dialogs/VersionSelectDialog.cpp b/launcher/ui/dialogs/VersionSelectDialog.cpp index 70ef72d6c..d7880334f 100644 --- a/launcher/ui/dialogs/VersionSelectDialog.cpp +++ b/launcher/ui/dialogs/VersionSelectDialog.cpp @@ -120,7 +120,7 @@ void VersionSelectDialog::selectRecommended() m_versionWidget->selectRecommended(); } -BaseVersionPtr VersionSelectDialog::selectedVersion() const +BaseVersion::Ptr VersionSelectDialog::selectedVersion() const { return m_versionWidget->selectedVersion(); } diff --git a/launcher/ui/dialogs/VersionSelectDialog.h b/launcher/ui/dialogs/VersionSelectDialog.h index ed30d3f3c..18a50cdb0 100644 --- a/launcher/ui/dialogs/VersionSelectDialog.h +++ b/launcher/ui/dialogs/VersionSelectDialog.h @@ -44,7 +44,7 @@ class VersionSelectDialog : public QDialog int exec() override; - BaseVersionPtr selectedVersion() const; + BaseVersion::Ptr selectedVersion() const; void setCurrentVersion(const QString & version); void setFuzzyFilter(BaseVersionList::ModelRoles role, QString filter); diff --git a/launcher/ui/pages/modplatform/VanillaPage.cpp b/launcher/ui/pages/modplatform/VanillaPage.cpp index 99190f31e..29fecb854 100644 --- a/launcher/ui/pages/modplatform/VanillaPage.cpp +++ b/launcher/ui/pages/modplatform/VanillaPage.cpp @@ -187,12 +187,12 @@ void VanillaPage::retranslate() ui->retranslateUi(this); } -BaseVersionPtr VanillaPage::selectedVersion() const +BaseVersion::Ptr VanillaPage::selectedVersion() const { return m_selectedVersion; } -BaseVersionPtr VanillaPage::selectedLoaderVersion() const +BaseVersion::Ptr VanillaPage::selectedLoaderVersion() const { return m_selectedLoaderVersion; } @@ -227,14 +227,14 @@ void VanillaPage::suggestCurrent() dialog->setSuggestedIcon("default"); } -void VanillaPage::setSelectedVersion(BaseVersionPtr version) +void VanillaPage::setSelectedVersion(BaseVersion::Ptr version) { m_selectedVersion = version; suggestCurrent(); loaderFilterChanged(); } -void VanillaPage::setSelectedLoaderVersion(BaseVersionPtr version) +void VanillaPage::setSelectedLoaderVersion(BaseVersion::Ptr version) { m_selectedLoaderVersion = version; suggestCurrent(); diff --git a/launcher/ui/pages/modplatform/VanillaPage.h b/launcher/ui/pages/modplatform/VanillaPage.h index 7193597dd..39aba760b 100644 --- a/launcher/ui/pages/modplatform/VanillaPage.h +++ b/launcher/ui/pages/modplatform/VanillaPage.h @@ -76,13 +76,13 @@ class VanillaPage : public QWidget, public BasePage void openedImpl() override; - BaseVersionPtr selectedVersion() const; - BaseVersionPtr selectedLoaderVersion() const; + BaseVersion::Ptr selectedVersion() const; + BaseVersion::Ptr selectedLoaderVersion() const; QString selectedLoader() const; public slots: - void setSelectedVersion(BaseVersionPtr version); - void setSelectedLoaderVersion(BaseVersionPtr version); + void setSelectedVersion(BaseVersion::Ptr version); + void setSelectedLoaderVersion(BaseVersion::Ptr version); private slots: void filterChanged(); @@ -98,7 +98,7 @@ private slots: NewInstanceDialog *dialog = nullptr; Ui::VanillaPage *ui = nullptr; bool m_versionSetByUser = false; - BaseVersionPtr m_selectedVersion; - BaseVersionPtr m_selectedLoaderVersion; + BaseVersion::Ptr m_selectedVersion; + BaseVersion::Ptr m_selectedLoaderVersion; QString m_selectedLoader; }; diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp index c68e40bad..f5f50caee 100644 --- a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp +++ b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp @@ -53,7 +53,7 @@ std::optional> AtlUserInteractionSupportImpl::chooseOptionalMod return optionalModDialog.getResult(); } -QString AtlUserInteractionSupportImpl::chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) +QString AtlUserInteractionSupportImpl::chooseVersion(Meta::VersionList::Ptr vlist, QString minecraftVersion) { VersionSelectDialog vselect(vlist.get(), "Choose Version", m_parent, false); if (minecraftVersion != nullptr) { diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h index 3b37c9bed..37010b3ff 100644 --- a/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h +++ b/launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.h @@ -46,7 +46,7 @@ class AtlUserInteractionSupportImpl : public QObject, public ATLauncher::UserInt AtlUserInteractionSupportImpl(QWidget* parent); private: - QString chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) override; + QString chooseVersion(Meta::VersionList::Ptr vlist, QString minecraftVersion) override; std::optional> chooseOptionalMods(ATLauncher::PackVersion version, QVector mods) override; void displayMessage(QString message) override; diff --git a/launcher/ui/widgets/JavaSettingsWidget.cpp b/launcher/ui/widgets/JavaSettingsWidget.cpp index 314a126e4..c7c4dbbd9 100644 --- a/launcher/ui/widgets/JavaSettingsWidget.cpp +++ b/launcher/ui/widgets/JavaSettingsWidget.cpp @@ -245,7 +245,7 @@ void JavaSettingsWidget::memoryValueChanged(int) } } -void JavaSettingsWidget::javaVersionSelected(BaseVersionPtr version) +void JavaSettingsWidget::javaVersionSelected(BaseVersion::Ptr version) { auto java = std::dynamic_pointer_cast(version); if(!java) diff --git a/launcher/ui/widgets/JavaSettingsWidget.h b/launcher/ui/widgets/JavaSettingsWidget.h index 0d280daf3..5344e2cd1 100644 --- a/launcher/ui/widgets/JavaSettingsWidget.h +++ b/launcher/ui/widgets/JavaSettingsWidget.h @@ -60,7 +60,7 @@ class JavaSettingsWidget : public QWidget protected slots: void memoryValueChanged(int); void javaPathEdited(const QString &path); - void javaVersionSelected(BaseVersionPtr version); + void javaVersionSelected(BaseVersion::Ptr version); void on_javaBrowseBtn_clicked(); void on_javaStatusBtn_clicked(); void checkFinished(JavaCheckResult result); diff --git a/launcher/ui/widgets/ModFilterWidget.h b/launcher/ui/widgets/ModFilterWidget.h index 958a1e2b0..706ffd21a 100644 --- a/launcher/ui/widgets/ModFilterWidget.h +++ b/launcher/ui/widgets/ModFilterWidget.h @@ -49,7 +49,7 @@ class ModFilterWidget : public QTabWidget auto getFilter() -> std::shared_ptr; auto changed() const -> bool { return m_last_version_id != m_version_id; } - Meta::VersionListPtr versionList() { return m_version_list; } + Meta::VersionList::Ptr versionList() { return m_version_list; } private: ModFilterWidget(Version def, QWidget* parent = nullptr); @@ -73,7 +73,7 @@ public: signals: /* Version stuff */ QButtonGroup m_mcVersion_buttons; - Meta::VersionListPtr m_version_list; + Meta::VersionList::Ptr m_version_list; /* Used to tell if the filter was changed since the last getFilter() call */ VersionButtonID m_last_version_id = VersionButtonID::Strict; diff --git a/launcher/ui/widgets/VersionSelectWidget.cpp b/launcher/ui/widgets/VersionSelectWidget.cpp index cc4fc6a2f..404860d90 100644 --- a/launcher/ui/widgets/VersionSelectWidget.cpp +++ b/launcher/ui/widgets/VersionSelectWidget.cpp @@ -142,7 +142,7 @@ void VersionSelectWidget::changeProgress(qint64 current, qint64 total) void VersionSelectWidget::currentRowChanged(const QModelIndex& current, const QModelIndex&) { auto variant = m_proxyModel->data(current, BaseVersionList::VersionPointerRole); - emit selectedVersionChanged(variant.value()); + emit selectedVersionChanged(variant.value()); } void VersionSelectWidget::preselect() @@ -186,11 +186,11 @@ bool VersionSelectWidget::hasVersions() const return m_proxyModel->rowCount(QModelIndex()) != 0; } -BaseVersionPtr VersionSelectWidget::selectedVersion() const +BaseVersion::Ptr VersionSelectWidget::selectedVersion() const { auto currentIndex = listView->selectionModel()->currentIndex(); auto variant = m_proxyModel->data(currentIndex, BaseVersionList::VersionPointerRole); - return variant.value(); + return variant.value(); } void VersionSelectWidget::setExactFilter(BaseVersionList::ModelRoles role, QString filter) diff --git a/launcher/ui/widgets/VersionSelectWidget.h b/launcher/ui/widgets/VersionSelectWidget.h index f56daa8aa..e75efc6f6 100644 --- a/launcher/ui/widgets/VersionSelectWidget.h +++ b/launcher/ui/widgets/VersionSelectWidget.h @@ -40,7 +40,7 @@ class VersionSelectWidget: public QWidget void loadList(); bool hasVersions() const; - BaseVersionPtr selectedVersion() const; + BaseVersion::Ptr selectedVersion() const; void selectRecommended(); void selectCurrent(); @@ -54,7 +54,7 @@ class VersionSelectWidget: public QWidget void setResizeOn(int column); signals: - void selectedVersionChanged(BaseVersionPtr version); + void selectedVersionChanged(BaseVersion::Ptr version); protected: virtual void closeEvent ( QCloseEvent* ); From 79617d0c5063d7baab711133acddcd1c21823b25 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Wed, 9 Nov 2022 18:27:40 +0100 Subject: [PATCH 06/10] Merge pull request #415 from TayouVR/fix-main-warning --- launcher/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/launcher/main.cpp b/launcher/main.cpp index c6a7614c4..9d73383c7 100644 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -90,5 +90,7 @@ int main(int argc, char *argv[]) return 1; case Application::Succeeded: return 0; + default: + return -1; } } From 0120d170b78c3088c07e2777e449f38629bce5f4 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 10 Nov 2022 14:34:15 +0100 Subject: [PATCH 07/10] Merge pull request #397 from flowln/windows_mod_updater_fixes_maybe Fixes https://github.com/PrismLauncher/PrismLauncher/issues/226 --- launcher/CMakeLists.txt | 4 +- launcher/FileSystem.cpp | 26 +++--------- launcher/JavaCommon.cpp | 2 +- launcher/MMCStrings.h | 8 ---- launcher/{MMCStrings.cpp => StringUtils.cpp} | 42 +++++++++---------- launcher/StringUtils.h | 32 ++++++++++++++ launcher/java/JavaInstall.cpp | 7 ++-- launcher/java/JavaInstallList.cpp | 1 - launcher/java/JavaVersion.cpp | 7 ++-- launcher/launch/LaunchTask.cpp | 1 - launcher/minecraft/MinecraftInstance.cpp | 1 - .../mod/tasks/LocalModUpdateTask.cpp | 2 +- launcher/modplatform/helpers/HashUtils.cpp | 3 +- launcher/modplatform/packwiz/Packwiz.cpp | 26 +++++++----- launcher/modplatform/packwiz/Packwiz.h | 4 -- launcher/ui/dialogs/ExportInstanceDialog.cpp | 9 ++-- .../modplatform/atlauncher/AtlFilterModel.cpp | 5 ++- .../ui/pages/modplatform/flame/FlameModel.cpp | 1 - .../pages/modplatform/ftb/FtbFilterModel.cpp | 5 ++- .../modplatform/legacy_ftb/ListModel.cpp | 4 +- libraries/tomlplusplus | 2 +- 21 files changed, 102 insertions(+), 90 deletions(-) delete mode 100644 launcher/MMCStrings.h rename launcher/{MMCStrings.cpp => StringUtils.cpp} (69%) create mode 100644 launcher/StringUtils.h diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 79ac49c76..61eae64fc 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -24,8 +24,8 @@ set(CORE_SOURCES NullInstance.h MMCZip.h MMCZip.cpp - MMCStrings.h - MMCStrings.cpp + StringUtils.h + StringUtils.cpp RuntimeContext.h # Basic instance manipulation tasks (derived from InstanceTask) diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 4026d6c16..1cbb538c6 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -44,7 +44,9 @@ #include #include #include + #include "DesktopServices.h" +#include "StringUtils.h" #if defined Q_OS_WIN32 #include @@ -79,22 +81,6 @@ namespace fs = std::filesystem; namespace fs = ghc::filesystem; #endif -#if defined Q_OS_WIN32 - -std::wstring toStdString(QString s) -{ - return s.toStdWString(); -} - -#else - -std::string toStdString(QString s) -{ - return s.toStdString(); -} - -#endif - namespace FS { void ensureExists(const QDir& dir) @@ -191,7 +177,7 @@ bool copy::operator()(const QString& offset) auto dst_path = PathCombine(dst, relative_dst_path); ensureFilePathExists(dst_path); - fs::copy(toStdString(src_path), toStdString(dst_path), opt, err); + fs::copy(StringUtils::toStdString(src_path), StringUtils::toStdString(dst_path), opt, err); if (err) { qWarning() << "Failed to copy files:" << QString::fromStdString(err.message()); qDebug() << "Source file:" << src_path; @@ -213,7 +199,7 @@ bool copy::operator()(const QString& offset) } // If the root src is not a directory, the previous iterator won't run. - if (!fs::is_directory(toStdString(src))) + if (!fs::is_directory(StringUtils::toStdString(src))) copy_file(src, ""); return err.value() == 0; @@ -223,7 +209,7 @@ bool deletePath(QString path) { std::error_code err; - fs::remove_all(toStdString(path), err); + fs::remove_all(StringUtils::toStdString(path), err); if (err) { qWarning() << "Failed to remove files:" << QString::fromStdString(err.message()); @@ -414,7 +400,7 @@ bool overrideFolder(QString overwritten_path, QString override_path) fs::copy_options opt = copy_opts::recursive | copy_opts::overwrite_existing; // FIXME: hello traveller! Apparently std::copy does NOT overwrite existing files on GNU libstdc++ on Windows? - fs::copy(toStdString(override_path), toStdString(overwritten_path), opt, err); + fs::copy(StringUtils::toStdString(override_path), StringUtils::toStdString(overwritten_path), opt, err); if (err) { qCritical() << QString("Failed to apply override from %1 to %2").arg(override_path, overwritten_path); diff --git a/launcher/JavaCommon.cpp b/launcher/JavaCommon.cpp index aa4d11233..52cc868a7 100644 --- a/launcher/JavaCommon.cpp +++ b/launcher/JavaCommon.cpp @@ -36,7 +36,7 @@ #include "JavaCommon.h" #include "java/JavaUtils.h" #include "ui/dialogs/CustomMessageBox.h" -#include + #include bool JavaCommon::checkJVMArgs(QString jvmargs, QWidget *parent) diff --git a/launcher/MMCStrings.h b/launcher/MMCStrings.h deleted file mode 100644 index 48052a00e..000000000 --- a/launcher/MMCStrings.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -namespace Strings -{ - int naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs); -} diff --git a/launcher/MMCStrings.cpp b/launcher/StringUtils.cpp similarity index 69% rename from launcher/MMCStrings.cpp rename to launcher/StringUtils.cpp index dc91c8d6a..0f3c3669f 100644 --- a/launcher/MMCStrings.cpp +++ b/launcher/StringUtils.cpp @@ -1,26 +1,28 @@ -#include "MMCStrings.h" +#include "StringUtils.h" + +/// If you're wondering where these came from exactly, then know you're not the only one =D /// TAKEN FROM Qt, because it doesn't expose it intelligently -static inline QChar getNextChar(const QString &s, int location) +static inline QChar getNextChar(const QString& s, int location) { return (location < s.length()) ? s.at(location) : QChar(); } /// TAKEN FROM Qt, because it doesn't expose it intelligently -int Strings::naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensitivity cs) +int StringUtils::naturalCompare(const QString& s1, const QString& s2, Qt::CaseSensitivity cs) { - for (int l1 = 0, l2 = 0; l1 <= s1.count() && l2 <= s2.count(); ++l1, ++l2) - { + int l1 = 0, l2 = 0; + while (l1 <= s1.count() && l2 <= s2.count()) { // skip spaces, tabs and 0's QChar c1 = getNextChar(s1, l1); while (c1.isSpace()) c1 = getNextChar(s1, ++l1); + QChar c2 = getNextChar(s2, l2); while (c2.isSpace()) c2 = getNextChar(s2, ++l2); - if (c1.isDigit() && c2.isDigit()) - { + if (c1.isDigit() && c2.isDigit()) { while (c1.digitValue() == 0) c1 = getNextChar(s1, ++l1); while (c2.digitValue() == 0) @@ -30,11 +32,8 @@ int Strings::naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensit int lookAheadLocation2 = l2; int currentReturnValue = 0; // find the last digit, setting currentReturnValue as we go if it isn't equal - for (QChar lookAhead1 = c1, lookAhead2 = c2; - (lookAheadLocation1 <= s1.length() && lookAheadLocation2 <= s2.length()); - lookAhead1 = getNextChar(s1, ++lookAheadLocation1), - lookAhead2 = getNextChar(s2, ++lookAheadLocation2)) - { + for (QChar lookAhead1 = c1, lookAhead2 = c2; (lookAheadLocation1 <= s1.length() && lookAheadLocation2 <= s2.length()); + lookAhead1 = getNextChar(s1, ++lookAheadLocation1), lookAhead2 = getNextChar(s2, ++lookAheadLocation2)) { bool is1ADigit = !lookAhead1.isNull() && lookAhead1.isDigit(); bool is2ADigit = !lookAhead2.isNull() && lookAhead2.isDigit(); if (!is1ADigit && !is2ADigit) @@ -43,14 +42,10 @@ int Strings::naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensit return -1; if (!is2ADigit) return 1; - if (currentReturnValue == 0) - { - if (lookAhead1 < lookAhead2) - { + if (currentReturnValue == 0) { + if (lookAhead1 < lookAhead2) { currentReturnValue = -1; - } - else if (lookAhead1 > lookAhead2) - { + } else if (lookAhead1 > lookAhead2) { currentReturnValue = 1; } } @@ -58,19 +53,24 @@ int Strings::naturalCompare(const QString &s1, const QString &s2, Qt::CaseSensit if (currentReturnValue != 0) return currentReturnValue; } - if (cs == Qt::CaseInsensitive) - { + + if (cs == Qt::CaseInsensitive) { if (!c1.isLower()) c1 = c1.toLower(); if (!c2.isLower()) c2 = c2.toLower(); } + int r = QString::localeAwareCompare(c1, c2); if (r < 0) return -1; if (r > 0) return 1; + + l1 += 1; + l2 += 1; } + // The two strings are the same (02 == 2) so fall back to the normal sort return QString::compare(s1, s2, cs); } diff --git a/launcher/StringUtils.h b/launcher/StringUtils.h new file mode 100644 index 000000000..1799605b3 --- /dev/null +++ b/launcher/StringUtils.h @@ -0,0 +1,32 @@ +#pragma once + +#include + +namespace StringUtils { + +#if defined Q_OS_WIN32 +using string = std::wstring; + +inline string toStdString(QString s) +{ + return s.toStdWString(); +} +inline QString fromStdString(string s) +{ + return QString::fromStdWString(s); +} +#else +using string = std::string; + +inline string toStdString(QString s) +{ + return s.toStdString(); +} +inline QString fromStdString(string s) +{ + return QString::fromStdString(s); +} +#endif + +int naturalCompare(const QString& s1, const QString& s2, Qt::CaseSensitivity cs); +} // namespace StringUtils diff --git a/launcher/java/JavaInstall.cpp b/launcher/java/JavaInstall.cpp index 5bcf7bcbf..d5932bcb9 100644 --- a/launcher/java/JavaInstall.cpp +++ b/launcher/java/JavaInstall.cpp @@ -1,9 +1,10 @@ #include "JavaInstall.h" -#include + +#include "StringUtils.h" bool JavaInstall::operator<(const JavaInstall &rhs) { - auto archCompare = Strings::naturalCompare(arch, rhs.arch, Qt::CaseInsensitive); + auto archCompare = StringUtils::naturalCompare(arch, rhs.arch, Qt::CaseInsensitive); if(archCompare != 0) return archCompare < 0; if(id < rhs.id) @@ -14,7 +15,7 @@ bool JavaInstall::operator<(const JavaInstall &rhs) { return false; } - return Strings::naturalCompare(path, rhs.path, Qt::CaseInsensitive) < 0; + return StringUtils::naturalCompare(path, rhs.path, Qt::CaseInsensitive) < 0; } bool JavaInstall::operator==(const JavaInstall &rhs) diff --git a/launcher/java/JavaInstallList.cpp b/launcher/java/JavaInstallList.cpp index 155c956a2..e2f0aa002 100644 --- a/launcher/java/JavaInstallList.cpp +++ b/launcher/java/JavaInstallList.cpp @@ -41,7 +41,6 @@ #include "java/JavaInstallList.h" #include "java/JavaCheckerJob.h" #include "java/JavaUtils.h" -#include "MMCStrings.h" #include "minecraft/VersionFilterData.h" JavaInstallList::JavaInstallList(QObject *parent) : BaseVersionList(parent) diff --git a/launcher/java/JavaVersion.cpp b/launcher/java/JavaVersion.cpp index 179ccd8d9..0e4fc1d3c 100644 --- a/launcher/java/JavaVersion.cpp +++ b/launcher/java/JavaVersion.cpp @@ -1,5 +1,6 @@ #include "JavaVersion.h" -#include + +#include "StringUtils.h" #include #include @@ -98,12 +99,12 @@ bool JavaVersion::operator<(const JavaVersion &rhs) else if(thisPre && rhsPre) { // both are prereleases - use natural compare... - return Strings::naturalCompare(m_prerelease, rhs.m_prerelease, Qt::CaseSensitive) < 0; + return StringUtils::naturalCompare(m_prerelease, rhs.m_prerelease, Qt::CaseSensitive) < 0; } // neither is prerelease, so they are the same -> this cannot be less than rhs return false; } - else return Strings::naturalCompare(m_string, rhs.m_string, Qt::CaseSensitive) < 0; + else return StringUtils::naturalCompare(m_string, rhs.m_string, Qt::CaseSensitive) < 0; } bool JavaVersion::operator==(const JavaVersion &rhs) diff --git a/launcher/launch/LaunchTask.cpp b/launcher/launch/LaunchTask.cpp index 28fcc4f42..9e1794b34 100644 --- a/launcher/launch/LaunchTask.cpp +++ b/launcher/launch/LaunchTask.cpp @@ -37,7 +37,6 @@ #include "launch/LaunchTask.h" #include "MessageLevel.h" -#include "MMCStrings.h" #include "java/JavaChecker.h" #include "tasks/Task.h" #include diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index 3a820951b..de22b365b 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -43,7 +43,6 @@ #include "settings/SettingsObject.h" #include "Application.h" -#include "MMCStrings.h" #include "pathmatcher/RegexpMatcher.h" #include "pathmatcher/MultiMatcher.h" #include "FileSystem.h" diff --git a/launcher/minecraft/mod/tasks/LocalModUpdateTask.cpp b/launcher/minecraft/mod/tasks/LocalModUpdateTask.cpp index 4b8789189..cc4e252c1 100644 --- a/launcher/minecraft/mod/tasks/LocalModUpdateTask.cpp +++ b/launcher/minecraft/mod/tasks/LocalModUpdateTask.cpp @@ -36,7 +36,7 @@ LocalModUpdateTask::LocalModUpdateTask(QDir index_dir, ModPlatform::IndexedPack& } #ifdef Q_OS_WIN32 - SetFileAttributesA(index_dir.path().toStdString().c_str(), FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); + SetFileAttributesW(index_dir.path().toStdWString().c_str(), FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); #endif } diff --git a/launcher/modplatform/helpers/HashUtils.cpp b/launcher/modplatform/helpers/HashUtils.cpp index a7bbaba50..b18c87af9 100644 --- a/launcher/modplatform/helpers/HashUtils.cpp +++ b/launcher/modplatform/helpers/HashUtils.cpp @@ -4,6 +4,7 @@ #include #include "FileSystem.h" +#include "StringUtils.h" #include @@ -66,7 +67,7 @@ void FlameHasher::executeTask() // CF-specific auto should_filter_out = [](char c) { return (c == 9 || c == 10 || c == 13 || c == 32); }; - std::ifstream file_stream(m_path.toStdString(), std::ifstream::binary); + std::ifstream file_stream(StringUtils::toStdString(m_path), std::ifstream::binary); // TODO: This is very heavy work, but apparently QtConcurrent can't use move semantics, so we can't boop this to another thread. // How do we make this non-blocking then? m_hash = QString::number(MurmurHash2(std::move(file_stream), 4 * MiB, should_filter_out)); diff --git a/launcher/modplatform/packwiz/Packwiz.cpp b/launcher/modplatform/packwiz/Packwiz.cpp index b1fe963e2..0ed29311b 100644 --- a/launcher/modplatform/packwiz/Packwiz.cpp +++ b/launcher/modplatform/packwiz/Packwiz.cpp @@ -22,10 +22,14 @@ #include #include -#include +#include "FileSystem.h" +#include "StringUtils.h" + #include "minecraft/mod/Mod.h" #include "modplatform/ModIndex.h" +#include + namespace Packwiz { auto getRealIndexName(QDir& index_dir, QString normalized_fname, bool should_find_match) -> QString @@ -63,22 +67,22 @@ static inline auto indexFileName(QString const& mod_slug) -> QString static ModPlatform::ProviderCapabilities ProviderCaps; // Helper functions for extracting data from the TOML file -auto stringEntry(toml::table table, const std::string entry_name) -> QString +auto stringEntry(toml::table table, QString entry_name) -> QString { - auto node = table[entry_name]; + auto node = table[StringUtils::toStdString(entry_name)]; if (!node) { - qCritical() << QString::fromStdString("Failed to read str property '" + entry_name + "' in mod metadata."); + qCritical() << "Failed to read str property '" + entry_name + "' in mod metadata."; return {}; } - return QString::fromStdString(node.value_or("")); + return node.value_or(""); } -auto intEntry(toml::table table, const std::string entry_name) -> int +auto intEntry(toml::table table, QString entry_name) -> int { - auto node = table[entry_name]; + auto node = table[StringUtils::toStdString(entry_name)]; if (!node) { - qCritical() << QString::fromStdString("Failed to read int property '" + entry_name + "' in mod metadata."); + qCritical() << "Failed to read int property '" + entry_name + "' in mod metadata."; return {}; } @@ -145,6 +149,8 @@ void V1::updateModIndex(QDir& index_dir, Mod& mod) // they want to do! if (index_file.exists()) { index_file.remove(); + } else { + FS::ensureFilePathExists(index_file.fileName()); } if (!index_file.open(QIODevice::ReadWrite)) { @@ -228,14 +234,14 @@ auto V1::getIndexForMod(QDir& index_dir, QString slug) -> Mod toml::table table; #if TOML_EXCEPTIONS try { - table = toml::parse_file(index_dir.absoluteFilePath(real_fname).toStdString()); + table = toml::parse_file(StringUtils::toStdString(index_dir.absoluteFilePath(real_fname))); } catch (const toml::parse_error& err) { qWarning() << QString("Could not open file %1!").arg(normalized_fname); qWarning() << "Reason: " << QString(err.what()); return {}; } #else - table = toml::parse_file(index_dir.absoluteFilePath(real_fname).toStdString()); + table = toml::parse_file(StringUtils::toStdString(index_dir.absoluteFilePath(real_fname))); if (!table) { qWarning() << QString("Could not open file %1!").arg(normalized_fname); qWarning() << "Reason: " << QString(table.error().what()); diff --git a/launcher/modplatform/packwiz/Packwiz.h b/launcher/modplatform/packwiz/Packwiz.h index 3ec803771..9754e5c43 100644 --- a/launcher/modplatform/packwiz/Packwiz.h +++ b/launcher/modplatform/packwiz/Packwiz.h @@ -24,7 +24,6 @@ #include #include -struct toml_table_t; class QDir; // Mod from launcher/minecraft/mod/Mod.h @@ -34,9 +33,6 @@ namespace Packwiz { auto getRealIndexName(QDir& index_dir, QString normalized_index_name, bool should_match = false) -> QString; -auto stringEntry(toml_table_t* parent, const char* entry_name) -> QString; -auto intEntry(toml_table_t* parent, const char* entry_name) -> int; - class V1 { public: struct Mod { diff --git a/launcher/ui/dialogs/ExportInstanceDialog.cpp b/launcher/ui/dialogs/ExportInstanceDialog.cpp index 9f32dd8e4..88552b239 100644 --- a/launcher/ui/dialogs/ExportInstanceDialog.cpp +++ b/launcher/ui/dialogs/ExportInstanceDialog.cpp @@ -39,13 +39,12 @@ #include #include #include -#include +#include #include #include -#include #include -#include "MMCStrings.h" +#include "StringUtils.h" #include "SeparatorPrefixTree.h" #include "Application.h" #include @@ -85,7 +84,7 @@ class PackIgnoreProxy : public QSortFilterProxyModel // sort and proxy model breaks the original model... if (sortColumn() == 0) { - return Strings::naturalCompare(leftFileInfo.fileName(), rightFileInfo.fileName(), + return StringUtils::naturalCompare(leftFileInfo.fileName(), rightFileInfo.fileName(), Qt::CaseInsensitive) < 0; } if (sortColumn() == 1) @@ -94,7 +93,7 @@ class PackIgnoreProxy : public QSortFilterProxyModel auto rightSize = rightFileInfo.size(); if ((leftSize == rightSize) || (leftFileInfo.isDir() && rightFileInfo.isDir())) { - return Strings::naturalCompare(leftFileInfo.fileName(), + return StringUtils::naturalCompare(leftFileInfo.fileName(), rightFileInfo.fileName(), Qt::CaseInsensitive) < 0 ? asc diff --git a/launcher/ui/pages/modplatform/atlauncher/AtlFilterModel.cpp b/launcher/ui/pages/modplatform/atlauncher/AtlFilterModel.cpp index c1ab166bc..0887ebeef 100644 --- a/launcher/ui/pages/modplatform/atlauncher/AtlFilterModel.cpp +++ b/launcher/ui/pages/modplatform/atlauncher/AtlFilterModel.cpp @@ -20,7 +20,8 @@ #include #include -#include + +#include "StringUtils.h" namespace Atl { @@ -86,7 +87,7 @@ bool FilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) co return lv < rv; } else if (currentSorting == ByName) { - return Strings::naturalCompare(leftPack.name, rightPack.name, Qt::CaseSensitive) >= 0; + return StringUtils::naturalCompare(leftPack.name, rightPack.name, Qt::CaseSensitive) >= 0; } // Invalid sorting set, somehow... diff --git a/launcher/ui/pages/modplatform/flame/FlameModel.cpp b/launcher/ui/pages/modplatform/flame/FlameModel.cpp index b98046813..a9f4c4c08 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModel.cpp +++ b/launcher/ui/pages/modplatform/flame/FlameModel.cpp @@ -2,7 +2,6 @@ #include #include "Application.h" -#include #include #include diff --git a/launcher/ui/pages/modplatform/ftb/FtbFilterModel.cpp b/launcher/ui/pages/modplatform/ftb/FtbFilterModel.cpp index cbf347fcb..e2b548f2d 100644 --- a/launcher/ui/pages/modplatform/ftb/FtbFilterModel.cpp +++ b/launcher/ui/pages/modplatform/ftb/FtbFilterModel.cpp @@ -19,7 +19,8 @@ #include #include "modplatform/modpacksch/FTBPackManifest.h" -#include + +#include "StringUtils.h" namespace Ftb { @@ -81,7 +82,7 @@ bool FilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) co return leftPack.installs < rightPack.installs; } else if (currentSorting == ByName) { - return Strings::naturalCompare(leftPack.name, rightPack.name, Qt::CaseSensitive) >= 0; + return StringUtils::naturalCompare(leftPack.name, rightPack.name, Qt::CaseSensitive) >= 0; } // Invalid sorting set, somehow... diff --git a/launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp b/launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp index 2d135e597..6f11cc955 100644 --- a/launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp +++ b/launcher/ui/pages/modplatform/legacy_ftb/ListModel.cpp @@ -36,7 +36,7 @@ #include "ListModel.h" #include "Application.h" -#include +#include "StringUtils.h" #include #include @@ -66,7 +66,7 @@ bool FilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) co return lv < rv; } else if(currentSorting == Sorting::ByName) { - return Strings::naturalCompare(leftPack.name, rightPack.name, Qt::CaseSensitive) >= 0; + return StringUtils::naturalCompare(leftPack.name, rightPack.name, Qt::CaseSensitive) >= 0; } //UHM, some inavlid value set?! diff --git a/libraries/tomlplusplus b/libraries/tomlplusplus index 4b166b69f..cc741c9f5 160000 --- a/libraries/tomlplusplus +++ b/libraries/tomlplusplus @@ -1 +1 @@ -Subproject commit 4b166b69f28e70a416a1a04a98f365d2aeb90de8 +Subproject commit cc741c9f5f2a62856a2a2e9e275f61eb0591c09c From 4b2c7a8a64aeac43b1b836ebcaef49016d1a40c7 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 10 Nov 2022 07:50:14 -0800 Subject: [PATCH 08/10] Merge pull request #406 from Scrumplex/fix-clear-metadata --- launcher/ui/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 6fd50d339..1d97e9cee 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1880,6 +1880,7 @@ void MainWindow::on_actionReportBug_triggered() void MainWindow::on_actionClearMetadata_triggered() { APPLICATION->metacache()->evictAll(); + APPLICATION->metacache()->SaveNow(); } void MainWindow::on_actionOpenWiki_triggered() From 4c9859b16e7bdb6e23ebdcff0f580db5d209e806 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 13 Nov 2022 17:18:06 +0100 Subject: [PATCH 09/10] Merge pull request #445 from flowln/optimize_edit_instance --- launcher/ui/pages/instance/ExternalResourcesPage.ui | 6 +----- launcher/ui/pages/instance/VersionPage.ui | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/launcher/ui/pages/instance/ExternalResourcesPage.ui b/launcher/ui/pages/instance/ExternalResourcesPage.ui index 76f8ec183..33a033366 100644 --- a/launcher/ui/pages/instance/ExternalResourcesPage.ui +++ b/launcher/ui/pages/instance/ExternalResourcesPage.ui @@ -27,11 +27,7 @@ - - - true - - + diff --git a/launcher/ui/pages/instance/VersionPage.ui b/launcher/ui/pages/instance/VersionPage.ui index fcba5598d..14b7cd9f9 100644 --- a/launcher/ui/pages/instance/VersionPage.ui +++ b/launcher/ui/pages/instance/VersionPage.ui @@ -48,11 +48,7 @@ - - - true - - + From 10ac6cb266100ed39ce2da6ad32fb1494f3010ea Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Tue, 15 Nov 2022 16:51:56 +0100 Subject: [PATCH 10/10] chore: bump version Signed-off-by: Sefa Eyeoglu --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d977640f2..29cebae01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,7 @@ set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRIN ######## Set version numbers ######## set(Launcher_VERSION_MAJOR 5) -set(Launcher_VERSION_MINOR 1) +set(Launcher_VERSION_MINOR 2) set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}") set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.0.0")