summaryrefslogtreecommitdiff
path: root/src/modlistviewactions.cpp
diff options
context:
space:
mode:
authorJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-09-21 00:08:58 -0500
committerJeremy Rimpo <jeremy.rimpo@servermonkey.com>2023-09-21 17:35:08 -0500
commit133c072eb7f63e807f2a211804537f59d1f8b0ed (patch)
tree423aa6c4a25f321bc3f4842c25952b1c11b89838 /src/modlistviewactions.cpp
parent639fc787bfbcc9d63765280c1c4e7e80e2bd1b34 (diff)
Rework download category parsing
- Bypasses issue where hidden downloads are not accessible - getCategoryID no longer necessary
Diffstat (limited to 'src/modlistviewactions.cpp')
-rw-r--r--src/modlistviewactions.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp
index fd2f5c68..d82dca87 100644
--- a/src/modlistviewactions.cpp
+++ b/src/modlistviewactions.cpp
@@ -279,12 +279,13 @@ void ModListViewActions::assignCategories() const
}
for (auto mod : m_core.modList()->allMods()) {
ModInfo::Ptr modInfo = ModInfo::getByName(mod);
- QString file = modInfo->installationFile();
int nexusCategory = modInfo->getNexusCategory();
if (!nexusCategory) {
- auto download = m_core.downloadManager()->getDownloadIndex(file);
- if (download >= 0) {
- nexusCategory = m_core.downloadManager()->getCategoryID(download);
+ QSettings downloadMeta(m_core.downloadsPath() + "/" +
+ modInfo->installationFile() + ".meta",
+ QSettings::IniFormat);
+ if (downloadMeta.contains("category")) {
+ nexusCategory = downloadMeta.value("category", 0).toInt();
}
}
int newCategory = CategoryFactory::instance()->resolveNexusID(nexusCategory);
@@ -1127,11 +1128,11 @@ void ModListViewActions::remapCategory(const QModelIndexList& indices) const
int categoryID = modInfo->getNexusCategory();
if (!categoryID) {
- int downloadIndex =
- m_core.downloadManager()->getDownloadIndex(modInfo->installationFile());
- if (downloadIndex >= 0) {
- auto downloadInfo = m_core.downloadManager()->getFileInfo(downloadIndex);
- categoryID = downloadInfo->categoryID;
+ QSettings downloadMeta(m_core.downloadsPath() + "/" +
+ modInfo->installationFile() + ".meta",
+ QSettings::IniFormat);
+ if (downloadMeta.contains("category")) {
+ categoryID = downloadMeta.value("category", 0).toInt();
}
}
unsigned int categoryIndex =