From f6ecb93d460b16c10933b35605f7ac1d60eac705 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 18 Jul 2018 16:00:19 +0200 Subject: Set delete Key to recursively clear overwrite with confirmation message. --- src/modlist.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/modlist.cpp') 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 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()) { -- cgit v1.3.1