diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-04-22 00:47:51 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-04-22 00:47:51 +0300 |
commit | f7931c2ee202025740caf424fa00ffb76743a1d2 (patch) | |
tree | b81ada653cc3ef6354a7dea19700bb20ebcdf289 /launcher/modplatform/ModIndex.h | |
parent | 10aac4fe1721c3e1cf83bacefddc086918ca03da (diff) | |
download | PrismLauncher-f7931c2ee202025740caf424fa00ffb76743a1d2.tar.gz PrismLauncher-f7931c2ee202025740caf424fa00ffb76743a1d2.tar.bz2 PrismLauncher-f7931c2ee202025740caf424fa00ffb76743a1d2.zip |
Better version handling
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/ModIndex.h')
-rw-r--r-- | launcher/modplatform/ModIndex.h | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h index 40f1efc4..de0af78c 100644 --- a/launcher/modplatform/ModIndex.h +++ b/launcher/modplatform/ModIndex.h @@ -1,23 +1,24 @@ // SPDX-License-Identifier: GPL-3.0-only /* -* PolyMC - Minecraft Launcher -* Copyright (c) 2022 flowln <flowlnlnln@gmail.com> -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, version 3. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <https://www.gnu.org/licenses/>. -*/ + * PolyMC - Minecraft Launcher + * Copyright (c) 2022 flowln <flowlnlnln@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ #pragma once +#include <qvariant.h> #include <QList> #include <QMetaType> #include <QString> @@ -95,6 +96,7 @@ struct IndexedPack { bool versionsLoaded = false; QVector<IndexedVersion> versions; + QVariant loadedFileId; // to check for already downloaded mods // Don't load by default, since some modplatform don't have that info bool extraDataLoaded = true; @@ -110,11 +112,12 @@ struct IndexedPack { } [[nodiscard]] bool isAnyVersionSelected() const { + if (loadedFileId.isValid()) + return true; if (!versionsLoaded) return false; - return std::any_of(versions.constBegin(), versions.constEnd(), - [](auto const& v) { return v.is_currently_selected; }); + return std::any_of(versions.constBegin(), versions.constEnd(), [](auto const& v) { return v.is_currently_selected; }); } }; |