summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-07-18 16:00:19 +0200
committerAl12rs <gabriel.cortesi@outlook.com>2018-07-18 16:00:19 +0200
commitf6ecb93d460b16c10933b35605f7ac1d60eac705 (patch)
treee8af7ad19d7f5650885d0b57cf4364db9090e7f5 /src
parent4f14598cfc2ea2cf13cbf35fdd9d61338eb1f409 (diff)
Set delete Key to recursively clear overwrite with confirmation message.
Diffstat (limited to 'src')
-rw-r--r--src/modlist.cpp9
-rw-r--r--src/modlist.h5
-rw-r--r--src/organizercore.cpp2
3 files changed, 16 insertions, 0 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index aaa4ba79..87cbbfb2 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -999,6 +999,15 @@ bool ModList::removeRows(int row, int count, const QModelIndex &parent)
bool success = false;
+ if (count == 1) {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(row);
+ std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
+ if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) {
+ emit clearOverwrite();
+ success = true;
+ }
+ }
+
for (int i = 0; i < count; ++i) {
ModInfo::Ptr modInfo = ModInfo::getByIndex(row + i);
if (!modInfo->isRegular()) {
diff --git a/src/modlist.h b/src/modlist.h
index b5f18e98..2db98bd1 100644
--- a/src/modlist.h
+++ b/src/modlist.h
@@ -244,6 +244,11 @@ signals:
*/
void fileMoved(const QString &relativePath, const QString &oldOriginName, const QString &newOriginName);
+ /**
+ * @brief emitted to have the overwrite folder cleared
+ */
+ void clearOverwrite();
+
void aboutToChangeData();
void postDataChanged();
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 142faabe..74ec752e 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -552,6 +552,8 @@ void OrganizerCore::setUserInterface(IUserInterface *userInterface,
SLOT(modRemoved(QString)));
connect(&m_ModList, SIGNAL(removeSelectedMods()), widget,
SLOT(removeMod_clicked()));
+ connect(&m_ModList, SIGNAL(clearOverwrite()), widget,
+ SLOT(clearOverwrite()));
connect(&m_ModList, SIGNAL(requestColumnSelect(QPoint)), widget,
SLOT(displayColumnSelection(QPoint)));
connect(&m_ModList, SIGNAL(fileMoved(QString, QString, QString)), widget,