summaryrefslogtreecommitdiff
path: root/src/downloadmanager.cpp
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-02-12 17:18:18 +0100
committerAl12rs <gabriel.cortesi@outlook.com>2018-02-12 17:18:18 +0100
commited08faa4a80ad7dc293d247a3c32246cefd52e1a (patch)
treea80c6cb4d3d146b7af0ce8520d3a0dcfd00c2d19 /src/downloadmanager.cpp
parent0c4cdb89ade12cacb7e69b0d913a7c83fe7b344a (diff)
- Changed "Remove Installed" and "Delete Installed" Downloads menu options to not consider the Downloads of Mods that were uninstalled.
- Changed Downloads menu options to say "Hide all..." instead of "Remove all...".
Diffstat (limited to 'src/downloadmanager.cpp')
-rw-r--r--src/downloadmanager.cpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp
index cb954ebe..a4fde093 100644
--- a/src/downloadmanager.cpp
+++ b/src/downloadmanager.cpp
@@ -558,18 +558,36 @@ void DownloadManager::removeDownload(int index, bool deleteFile)
emit aboutToUpdate();
if (index < 0) {
- DownloadState minState = index < -1 ? STATE_INSTALLED : STATE_READY;
- index = 0;
- for (QVector<DownloadInfo*>::iterator iter = m_ActiveDownloads.begin(); iter != m_ActiveDownloads.end();) {
- if ((*iter)->m_State >= minState) {
- removeFile(index, deleteFile);
- delete *iter;
- iter = m_ActiveDownloads.erase(iter);
- } else {
- ++iter;
- ++index;
- }
- }
+ if (index == -1) {
+ DownloadState minState = STATE_READY;
+ index = 0;
+ for (QVector<DownloadInfo*>::iterator iter = m_ActiveDownloads.begin(); iter != m_ActiveDownloads.end();) {
+ if ((*iter)->m_State >= minState) {
+ removeFile(index, deleteFile);
+ delete *iter;
+ iter = m_ActiveDownloads.erase(iter);
+ }
+ else {
+ ++iter;
+ ++index;
+ }
+ }
+ }
+ else {
+ DownloadState minState = STATE_INSTALLED;
+ index = 0;
+ for (QVector<DownloadInfo*>::iterator iter = m_ActiveDownloads.begin(); iter != m_ActiveDownloads.end();) {
+ if ((*iter)->m_State == minState) {
+ removeFile(index, deleteFile);
+ delete *iter;
+ iter = m_ActiveDownloads.erase(iter);
+ }
+ else {
+ ++iter;
+ ++index;
+ }
+ }
+ }
} else {
if (index >= m_ActiveDownloads.size()) {
reportError(tr("remove: invalid download index %1").arg(index));