diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-06 17:55:11 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-06 17:55:11 +0100 |
| commit | bec0974c95284cdf469dc21db614be32bb7b1531 (patch) | |
| tree | 500bd2a72b20edae3a432d0d9037cc8f0f6ea4b4 /src/modlistcontextmenu.cpp | |
| parent | 9703c457412ac3b61adc067ec9a058fc5f4e8a52 (diff) | |
Prevent creating separator or empty mod 'on' backups.
Diffstat (limited to 'src/modlistcontextmenu.cpp')
| -rw-r--r-- | src/modlistcontextmenu.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modlistcontextmenu.cpp b/src/modlistcontextmenu.cpp index c1ee4f74..a4649a9e 100644 --- a/src/modlistcontextmenu.cpp +++ b/src/modlistcontextmenu.cpp @@ -18,8 +18,15 @@ ModListGlobalContextMenu::ModListGlobalContextMenu(OrganizerCore& core, ModListV : QMenu(parent) { addAction(tr("Install Mod..."), [=]() { view->actions().installMod(); }); - addAction(tr("Create empty mod"), [=]() { view->actions().createEmptyMod(index); }); - addAction(tr("Create Separator"), [=]() { view->actions().createSeparator(index); }); + + auto modIndex = index.data(ModList::IndexRole); + if (modIndex.isValid()) { + auto info = ModInfo::getByIndex(modIndex.toInt()); + if (!info->isBackup()) { + addAction(tr("Create empty mod"), [=]() { view->actions().createEmptyMod(index); }); + addAction(tr("Create Separator"), [=]() { view->actions().createSeparator(index); }); + } + } if (view->hasCollapsibleSeparators()) { addSeparator(); |
