summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/downloadlistwidget.cpp6
-rw-r--r--src/downloadlistwidgetcompact.cpp6
-rw-r--r--src/downloadmanager.cpp42
3 files changed, 36 insertions, 18 deletions
diff --git a/src/downloadlistwidget.cpp b/src/downloadlistwidget.cpp
index 78bdf1aa..9a8ef572 100644
--- a/src/downloadlistwidget.cpp
+++ b/src/downloadlistwidget.cpp
@@ -318,7 +318,7 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
if (hidden) {
menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView()));
} else {
- menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView()));
+ menu.addAction(tr("Hide"), this, SLOT(issueRemoveFromView()));
}
} else if (state == DownloadManager::STATE_DOWNLOADING){
menu.addAction(tr("Cancel"), this, SLOT(issueCancel()));
@@ -334,8 +334,8 @@ bool DownloadListWidgetDelegate::editorEvent(QEvent *event, QAbstractItemModel *
menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll()));
if (!hidden) {
menu.addSeparator();
- menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
- menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll()));
+ menu.addAction(tr("Hide Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
+ menu.addAction(tr("Hide All..."), this, SLOT(issueRemoveFromViewAll()));
}
menu.exec(mouseEvent->globalPos());
diff --git a/src/downloadlistwidgetcompact.cpp b/src/downloadlistwidgetcompact.cpp
index 32a3f10d..f7975150 100644
--- a/src/downloadlistwidgetcompact.cpp
+++ b/src/downloadlistwidgetcompact.cpp
@@ -303,7 +303,7 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
if (hidden) {
menu.addAction(tr("Un-Hide"), this, SLOT(issueRestoreToView()));
} else {
- menu.addAction(tr("Remove from View"), this, SLOT(issueRemoveFromView()));
+ menu.addAction(tr("Hide"), this, SLOT(issueRemoveFromView()));
}
} else if (state == DownloadManager::STATE_DOWNLOADING){
menu.addAction(tr("Cancel"), this, SLOT(issueCancel()));
@@ -319,8 +319,8 @@ bool DownloadListWidgetCompactDelegate::editorEvent(QEvent *event, QAbstractItem
menu.addAction(tr("Delete All..."), this, SLOT(issueDeleteAll()));
if (!hidden) {
menu.addSeparator();
- menu.addAction(tr("Remove Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
- menu.addAction(tr("Remove All..."), this, SLOT(issueRemoveFromViewAll()));
+ menu.addAction(tr("Hide Installed..."), this, SLOT(issueRemoveFromViewCompleted()));
+ menu.addAction(tr("Hide All..."), this, SLOT(issueRemoveFromViewAll()));
}
menu.exec(mouseEvent->globalPos());
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));