From c421ac92e03f2810aed85f06dd0ed24c89d4e9d8 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 31 Mar 2015 11:03:39 +0200 Subject: Fix logic for activating actions Well, that happens when you just copy and paste, not understanding what you're doing. Kinda embarrassing... --- archivecontroller.cpp | 2 +- shemov.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/archivecontroller.cpp b/archivecontroller.cpp index 0c29373..99c55db 100644 --- a/archivecontroller.cpp +++ b/archivecontroller.cpp @@ -320,7 +320,7 @@ void ArchiveController::treeSelectionChanged(const QItemSelection &selected, con int nodeType = sel.first().data(ArchiveModel::TypeRole).toInt(); foreach(QAction *a, mActionsForTree){ int aData = a->data().toInt(); - bool enabled = (aData >> nodeType) & 1; + bool enabled = aData & nodeType; a->setEnabled(enabled); } } diff --git a/shemov.cpp b/shemov.cpp index 2a47a1e..15b7284 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -674,8 +674,8 @@ void SheMov::createActions(){ //delete from Tree mArchiveViewDeleteA = new QAction(QIcon(":/delete.png"), tr("Delete..."), this); int deleteMask = 0; - deleteMask |= (1 << ArchiveModel::SeriesNode); - deleteMask |= (1 << ArchiveModel::SeriesPartNode); + deleteMask |= ArchiveModel::SeriesNode; + deleteMask |= ArchiveModel::SeriesPartNode; mArchiveViewDeleteA->setData(deleteMask); connect(mArchiveViewDeleteA, SIGNAL(triggered()), c->archiveTree(), SLOT(deleteFromTree())); //add new series part -- cgit v1.2.3-70-g09d2