Commit 4a6bfb8c authored by Laurent Montel's avatar Laurent Montel
Browse files

Adapt to new api (scripted)

parent c9e7a176
Pipeline #248502 passed with stage
in 2 minutes and 48 seconds
......@@ -15,6 +15,7 @@
#include <KLocalizedString>
#include <KMessageBox>
#include <kwidgetsaddons_version.h>
using namespace Akonadi;
......@@ -117,12 +118,21 @@ void MarkAsCommand::slotFetchDone(KJob *job)
void MarkAsCommand::execute()
{
if (d->mRecursive && !d->mFolders.isEmpty()) {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
if (KMessageBox::questionTwoActions(qobject_cast<QWidget *>(parent()),
#else
if (KMessageBox::questionYesNo(qobject_cast<QWidget *>(parent()),
i18n("Are you sure you want to mark all messages in this folder and all its subfolders?"),
i18n("Mark All Recursively"),
KGuiItem(i18nc("@action:button", "Mark All")),
KStandardGuiItem::cancel())
#endif
i18n("Are you sure you want to mark all messages in this folder and all its subfolders?"),
i18n("Mark All Recursively"),
KGuiItem(i18nc("@action:button", "Mark All")),
KStandardGuiItem::cancel())
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
== KMessageBox::ButtonCode::PrimaryAction) {
#else
== KMessageBox::Yes) {
#endif
auto job = new Akonadi::CollectionFetchJob(d->mFolders.constFirst());
connect(job, &Akonadi::CollectionFetchJob::result, this, &MarkAsCommand::slotCollectionFetchDone);
} else {
......
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