diff options
| author | AL <26797547+Al12rs@users.noreply.github.com> | 2021-07-12 02:33:05 +0200 |
|---|---|---|
| committer | AL <26797547+Al12rs@users.noreply.github.com> | 2021-07-12 02:33:05 +0200 |
| commit | d413f673e880eb84b4c7dbc2143322e7dd506e6d (patch) | |
| tree | f4440b8fe87a3974b568430a6717422a711bc672 /src/downloadmanager.cpp | |
| parent | 4bdb4aff50a97c8ac8030fcd1dcb2b00ccc1e12d (diff) | |
Added ARCHIVED support for nexus update check and download query.
Use FileStatus enum instead of scattered int literals.
Re-wrote the update check code
Diffstat (limited to 'src/downloadmanager.cpp')
| -rw-r--r-- | src/downloadmanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 4c8e820f..73e6abde 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -1223,6 +1223,7 @@ QString DownloadManager::getFileTypeString(int fileType) case 4: return tr("Old"); case 5: return tr("Miscellaneous"); case 6: return tr("Deleted"); + case 7: return tr("Archived"); default: return tr("Unknown"); } } @@ -1723,7 +1724,8 @@ void DownloadManager::nxmFilesAvailable(QString, int, QVariant userData, QVarian {return lhs.toMap()["uploaded_timestamp"].toInt() > rhs.toMap()["uploaded_timestamp"].toInt();}); for (QVariant file : files) { QVariantMap fileInfo = file.toMap(); - if (fileInfo["category_id"].toInt() != 6) + if (fileInfo["category_id"].toInt() != NexusInterface::FileStatus::REMOVED && + fileInfo["category_id"].toInt() != NexusInterface::FileStatus::ARCHIVED) selection.addChoice(fileInfo["file_name"].toString(), "", file); } if (selection.exec() == QDialog::Accepted) { @@ -1958,7 +1960,8 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use auto results = resultlist[i].toMap(); auto fileDetails = results["file_details"].toMap(); - if (fileDetails["category_id"].toInt() != 6) { //6 = deleted + if (fileDetails["category_id"].toInt() != NexusInterface::FileStatus::REMOVED && + fileDetails["category_id"].toInt() != NexusInterface::FileStatus::ARCHIVED) { if (chosenIdx < 0) { chosenIdx = i; //intentional to not break in order to check other results } else { |
