Commit 868d499f authored by Laurent Montel's avatar Laurent Montel 😁

Return when selection is empty

parent 243371bb
Pipeline #34247 passed with stage
in 20 minutes and 39 seconds
...@@ -485,14 +485,15 @@ public: ...@@ -485,14 +485,15 @@ public:
void slotMarkAs() void slotMarkAs()
{ {
const QAction *action = qobject_cast<QAction *>(mParent->sender());
Q_ASSERT(action);
const Akonadi::Item::List items = mGenericManager->selectedItems(); const Akonadi::Item::List items = mGenericManager->selectedItems();
if (items.isEmpty()) { if (items.isEmpty()) {
return; return;
} }
const QAction *action = qobject_cast<QAction *>(mParent->sender());
Q_ASSERT(action);
QByteArray typeStr = action->data().toByteArray(); QByteArray typeStr = action->data().toByteArray();
qCDebug(AKONADIMIME_LOG) << "Mark mail as: " << typeStr; qCDebug(AKONADIMIME_LOG) << "Mark mail as: " << typeStr;
...@@ -526,16 +527,17 @@ public: ...@@ -526,16 +527,17 @@ public:
void slotMarkAllAs() void slotMarkAllAs()
{ {
const Akonadi::Collection::List collections = mGenericManager->selectedCollections();
if (collections.isEmpty()) {
return;
}
const QAction *action = qobject_cast<QAction *>(mParent->sender()); const QAction *action = qobject_cast<QAction *>(mParent->sender());
Q_ASSERT(action); Q_ASSERT(action);
QByteArray typeStr = action->data().toByteArray(); QByteArray typeStr = action->data().toByteArray();
qCDebug(AKONADIMIME_LOG) << "Mark all as: " << typeStr; qCDebug(AKONADIMIME_LOG) << "Mark all as: " << typeStr;
const Akonadi::Collection::List collections = mGenericManager->selectedCollections();
if (collections.isEmpty()) {
return;
}
Akonadi::MessageStatus targetStatus; Akonadi::MessageStatus targetStatus;
targetStatus.setStatusFromStr(QLatin1String(typeStr)); targetStatus.setStatusFromStr(QLatin1String(typeStr));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment