aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/ModIndex.h
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-04-22 01:32:33 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-04-22 01:32:33 +0300
commit1d167f8fda8df1b0ded22b8a7dde2cb1a5612542 (patch)
tree6ff7b6aa977c99e6740798e6d8a8c22a69d4e3d6 /launcher/modplatform/ModIndex.h
parent22bbf1bd1fb789d2542b07fc6bb4140ef7226e36 (diff)
parent460e83207f9ae087846fc9ca210799e41f51a326 (diff)
downloadPrismLauncher-1d167f8fda8df1b0ded22b8a7dde2cb1a5612542.tar.gz
PrismLauncher-1d167f8fda8df1b0ded22b8a7dde2cb1a5612542.tar.bz2
PrismLauncher-1d167f8fda8df1b0ded22b8a7dde2cb1a5612542.zip
Merge branch 'Fix_Assert' of github.com:Trial97/PrismLauncher into develop
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/ModIndex.h')
-rw-r--r--launcher/modplatform/ModIndex.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h
index ffa3a3ab..5ff7bbc9 100644
--- a/launcher/modplatform/ModIndex.h
+++ b/launcher/modplatform/ModIndex.h
@@ -1,20 +1,20 @@
// 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
@@ -104,6 +104,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;
@@ -119,11 +120,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; });
}
};