summaryrefslogtreecommitdiffstats
path: root/archivecontroller.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2015-03-21 09:15:16 +0100
committerArno <am@disconnect.de>2015-03-21 09:15:16 +0100
commit9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb (patch)
treebf6af4d83c91f5a2594a3777fb31f620e6a852d2 /archivecontroller.cpp
parente6b7e5e0fccef756398982bd51137bb433df7f4a (diff)
downloadSheMov-9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb.tar.gz
SheMov-9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb.tar.bz2
SheMov-9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb.zip
Delete emtpy series
Enable the delete option in ArchiveTree, but only allow delete when it has no children.
Diffstat (limited to 'archivecontroller.cpp')
-rw-r--r--archivecontroller.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/archivecontroller.cpp b/archivecontroller.cpp
index 338a698..0c29373 100644
--- a/archivecontroller.cpp
+++ b/archivecontroller.cpp
@@ -319,7 +319,9 @@ void ArchiveController::treeSelectionChanged(const QItemSelection &selected, con
int nodeType = sel.first().data(ArchiveModel::TypeRole).toInt();
foreach(QAction *a, mActionsForTree){
- a->setEnabled(a->data().toInt() & nodeType);
+ int aData = a->data().toInt();
+ bool enabled = (aData >> nodeType) & 1;
+ a->setEnabled(enabled);
}
}