diff --git a/src/standardmailactionmanager.cpp b/src/standardmailactionmanager.cpp index 61c222b9e6f30da38edf240fadceafbd59f14186..8cc755e14151c8e50d306dd220523eec359687f2 100644 --- a/src/standardmailactionmanager.cpp +++ b/src/standardmailactionmanager.cpp @@ -485,14 +485,15 @@ public: void slotMarkAs() { - const QAction *action = qobject_cast(mParent->sender()); - Q_ASSERT(action); - const Akonadi::Item::List items = mGenericManager->selectedItems(); if (items.isEmpty()) { return; } + const QAction *action = qobject_cast(mParent->sender()); + Q_ASSERT(action); + + QByteArray typeStr = action->data().toByteArray(); qCDebug(AKONADIMIME_LOG) << "Mark mail as: " << typeStr; @@ -526,16 +527,17 @@ public: void slotMarkAllAs() { + const Akonadi::Collection::List collections = mGenericManager->selectedCollections(); + if (collections.isEmpty()) { + return; + } + const QAction *action = qobject_cast(mParent->sender()); Q_ASSERT(action); QByteArray typeStr = action->data().toByteArray(); qCDebug(AKONADIMIME_LOG) << "Mark all as: " << typeStr; - const Akonadi::Collection::List collections = mGenericManager->selectedCollections(); - if (collections.isEmpty()) { - return; - } Akonadi::MessageStatus targetStatus; targetStatus.setStatusFromStr(QLatin1String(typeStr));