Commit b100730b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/release/21.12'

parents 9b9e4a49 4426d4a2
Pipeline #98766 canceled with stage
......@@ -177,6 +177,7 @@ void FollowUpReminderInfoWidget::slotCustomContextMenuRequested(const QPoint &po
if (nbElementSelected > 0) {
QMenu menu(this);
QAction *showMessage = nullptr;
QAction *showOriginalMessage = nullptr;
FollowUpReminderInfoItem *mailItem = nullptr;
if ((nbElementSelected == 1)) {
mailItem = static_cast<FollowUpReminderInfoItem *>(listItems.at(0));
......@@ -184,6 +185,8 @@ void FollowUpReminderInfoWidget::slotCustomContextMenuRequested(const QPoint &po
showMessage = menu.addAction(i18n("Show Message"));
menu.addSeparator();
}
showOriginalMessage = menu.addAction(i18n("Show Original Message"));
menu.addSeparator();
}
QAction *deleteItem = menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete"));
QAction *result = menu.exec(QCursor::pos());
......@@ -192,6 +195,8 @@ void FollowUpReminderInfoWidget::slotCustomContextMenuRequested(const QPoint &po
openShowMessage(mailItem->info()->answerMessageItemId());
} else if (result == deleteItem) {
deleteItems(listItems);
} else if (result == showOriginalMessage) {
openShowMessage(mailItem->info()->originalMessageItemId());
}
}
}
......
......@@ -8,3 +8,4 @@ endmacro ()
add_kmail_historyswitchfolder_unittest(collectionswitchertreeviewtest.cpp)
add_kmail_historyswitchfolder_unittest(collectionswitchertreeviewmanagertest.cpp)
/*
This file is part of KMail, the KDE mail client.
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-only
*/
#include "collectionswitchertreeviewmanagertest.h"
#include "historyswitchfolder/collectionswitchertreeviewmanager.h"
#include <QTest>
QTEST_MAIN(CollectionSwitcherTreeViewManagerTest)
CollectionSwitcherTreeViewManagerTest::CollectionSwitcherTreeViewManagerTest(QObject *parent)
: QObject{parent}
{
}
void CollectionSwitcherTreeViewManagerTest::shouldHaveDefaultValues()
{
CollectionSwitcherTreeViewManager m;
QVERIFY(!m.parentWidget());
}
/*
This file is part of KMail, the KDE mail client.
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: GPL-2.0-only
*/
#pragma once
#include <QObject>
class CollectionSwitcherTreeViewManagerTest : public QObject
{
Q_OBJECT
public:
explicit CollectionSwitcherTreeViewManagerTest(QObject *parent = nullptr);
~CollectionSwitcherTreeViewManagerTest() override = default;
private Q_SLOTS:
void shouldHaveDefaultValues();
};
......@@ -27,7 +27,7 @@ public:
}
const Akonadi::Collection mNewCollection;
QString mFullPath;
const QString mFullPath;
};
explicit CollectionSwitcherModel(QObject *parent = nullptr);
......
......@@ -6,13 +6,15 @@ SPDX-License-Identifier: GPL-2.0-only
*/
#pragma once
#include "kmail_private_export.h"
#include <Akonadi/Collection>
#include <QList>
#include <QObject>
class CollectionSwitcherTreeView;
class CollectionSwitcherModel;
class QAction;
class CollectionSwitcherTreeViewManager : public QObject
class KMAILTESTS_TESTS_EXPORT CollectionSwitcherTreeViewManager : public QObject
{
Q_OBJECT
public:
......@@ -28,7 +30,7 @@ public:
void selectBackward();
void updateViewGeometry();
void addHistory(const Akonadi::Collection &currentCol, const QString &fullPath = {});
void addHistory(const Akonadi::Collection &currentCol, const QString &fullPath);
Q_SIGNALS:
void switchToFolder(const Akonadi::Collection &col);
......
Supports Markdown
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