From 9544f4d790695e707e7e8b9cb44f9cb0fed0dbcb Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 21 Mar 2015 09:15:16 +0100 Subject: Delete emtpy series Enable the delete option in ArchiveTree, but only allow delete when it has no children. --- archivecontroller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'archivecontroller.cpp') 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); } } -- cgit v1.2.3-70-g09d2