summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-03-28 14:04:39 +0200
committerMontel Laurent <[email protected]>2016-03-28 14:04:47 +0200
commit4b18174ac7bad2e08c3d1d61ee73e1470ef254f2 (patch)
treeadb675925d902bf220da4001094a35b632b48511
parent2edfc0b731df55314265b8b7b2387cb97efc7ad6 (diff)
Use new api
-rw-r--r--CMakeLists.txt2
-rw-r--r--plugins/messageviewerplugins/autotests/viewerplugincreateeventtest.cpp2
-rw-r--r--plugins/messageviewerplugins/autotests/viewerplugincreatenotetest.cpp2
-rw-r--r--plugins/messageviewerplugins/autotests/viewerplugincreatetodotest.cpp2
-rw-r--r--plugins/messageviewerplugins/autotests/viewerplugintranslatortest.cpp2
-rw-r--r--plugins/messageviewerplugins/common/expandurlplugin/messageviewer_expandurlplugin.json4
-rw-r--r--plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.cpp14
-rw-r--r--plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.h4
-rw-r--r--plugins/messageviewerplugins/common/translatorplugin/messageviewer_translatorplugin.json4
-rw-r--r--plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.cpp16
-rw-r--r--plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.h4
-rw-r--r--plugins/messageviewerplugins/createeventplugin/messageviewer_createeventplugin.json4
-rw-r--r--plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.cpp18
-rw-r--r--plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.h4
-rw-r--r--plugins/messageviewerplugins/createnoteplugin/messageviewer_createnoteplugin.json4
-rw-r--r--plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.cpp24
-rw-r--r--plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.h4
-rw-r--r--plugins/messageviewerplugins/createtodoplugin/messageviewer_createtodoplugin.json4
-rw-r--r--plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.cpp20
-rw-r--r--plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.h4
20 files changed, 71 insertions, 71 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4316e8f..afe0e47 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,7 +74,7 @@ set(KDEPIMLIBS_LIB_VERSION "5.2.40")
set(GRAVATAR_LIB_VERSION "5.2.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.2.40")
set(KTNEF_LIB_VERSION "5.2.40")
-set(MESSAGELIB_LIB_VERSION "5.2.43")
+set(MESSAGELIB_LIB_VERSION "5.2.45")
find_package(KF5MailCommon ${MAILCOMMN_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5KaddressbookGrantlee ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MessageViewer ${KDEPIM_APPS_LIB_VERSION} CONFIG REQUIRED)
diff --git a/plugins/messageviewerplugins/autotests/viewerplugincreateeventtest.cpp b/plugins/messageviewerplugins/autotests/viewerplugincreateeventtest.cpp
index b57fa76..c3e95fd 100644
--- a/plugins/messageviewerplugins/autotests/viewerplugincreateeventtest.cpp
+++ b/plugins/messageviewerplugins/autotests/viewerplugincreateeventtest.cpp
@@ -48,7 +48,7 @@ void ViewerPluginCreateeventTest::shouldCreateAction()
QWidget *parent = new QWidget(0);
parent->setLayout(new QHBoxLayout);
MessageViewer::ViewerPluginInterface *interface = event->createView(parent, new KActionCollection(this));
- QVERIFY(interface->action());
+ QVERIFY(!interface->actions().isEmpty());
}
QTEST_MAIN(ViewerPluginCreateeventTest)
diff --git a/plugins/messageviewerplugins/autotests/viewerplugincreatenotetest.cpp b/plugins/messageviewerplugins/autotests/viewerplugincreatenotetest.cpp
index fd94293..ad20396 100644
--- a/plugins/messageviewerplugins/autotests/viewerplugincreatenotetest.cpp
+++ b/plugins/messageviewerplugins/autotests/viewerplugincreatenotetest.cpp
@@ -49,7 +49,7 @@ void ViewerPluginCreateNoteTest::shouldCreateAction()
QWidget *parent = new QWidget(0);
parent->setLayout(new QHBoxLayout);
MessageViewer::ViewerPluginInterface *interface = event->createView(parent, new KActionCollection(this));
- QVERIFY(interface->action());
+ QVERIFY(!interface->actions().isEmpty());
}
QTEST_MAIN(ViewerPluginCreateNoteTest)
diff --git a/plugins/messageviewerplugins/autotests/viewerplugincreatetodotest.cpp b/plugins/messageviewerplugins/autotests/viewerplugincreatetodotest.cpp
index be469fc..39ce410 100644
--- a/plugins/messageviewerplugins/autotests/viewerplugincreatetodotest.cpp
+++ b/plugins/messageviewerplugins/autotests/viewerplugincreatetodotest.cpp
@@ -48,7 +48,7 @@ void ViewerPluginCreateTodoTest::shouldCreateAction()
QWidget *parent = new QWidget(0);
parent->setLayout(new QHBoxLayout);
MessageViewer::ViewerPluginInterface *interface = event->createView(parent, new KActionCollection(this));
- QVERIFY(interface->action());
+ QVERIFY(!interface->actions().isEmpty());
}
QTEST_MAIN(ViewerPluginCreateTodoTest)
diff --git a/plugins/messageviewerplugins/autotests/viewerplugintranslatortest.cpp b/plugins/messageviewerplugins/autotests/viewerplugintranslatortest.cpp
index 451f467..c488b89 100644
--- a/plugins/messageviewerplugins/autotests/viewerplugintranslatortest.cpp
+++ b/plugins/messageviewerplugins/autotests/viewerplugintranslatortest.cpp
@@ -52,7 +52,7 @@ void ViewerPluginTranslatorTest::shouldCreateAction()
parent->setLayout(new QHBoxLayout);
MessageViewer::ViewerPluginInterface *interface = translator->createView(parent, new KActionCollection(this));
- QVERIFY(interface->action());
+ QVERIFY(!interface->actions().isEmpty());
}
QTEST_MAIN(ViewerPluginTranslatorTest)
diff --git a/plugins/messageviewerplugins/common/expandurlplugin/messageviewer_expandurlplugin.json b/plugins/messageviewerplugins/common/expandurlplugin/messageviewer_expandurlplugin.json
index b1d7d07..21f354f 100644
--- a/plugins/messageviewerplugins/common/expandurlplugin/messageviewer_expandurlplugin.json
+++ b/plugins/messageviewerplugins/common/expandurlplugin/messageviewer_expandurlplugin.json
@@ -22,6 +22,6 @@
"ServiceTypes": [
"MessageViewer/ViewerCommonPlugin"
],
- "Version": "1.0"
+ "Version": "2.0"
}
-} \ No newline at end of file
+}
diff --git a/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.cpp b/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.cpp
index e154705..3a64317 100644
--- a/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.cpp
+++ b/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.cpp
@@ -31,8 +31,7 @@
using namespace MessageViewer;
ViewerPluginExpandurlInterface::ViewerPluginExpandurlInterface(KActionCollection *ac, QWidget *parent)
- : ViewerPluginInterface(parent),
- mAction(Q_NULLPTR)
+ : ViewerPluginInterface(parent)
{
createAction(ac);
}
@@ -42,7 +41,7 @@ ViewerPluginExpandurlInterface::~ViewerPluginExpandurlInterface()
}
-QAction *ViewerPluginExpandurlInterface::action() const
+QList<QAction *> ViewerPluginExpandurlInterface::actions() const
{
return mAction;
}
@@ -67,10 +66,11 @@ ViewerPluginInterface::SpecificFeatureTypes ViewerPluginExpandurlInterface::feat
void ViewerPluginExpandurlInterface::createAction(KActionCollection *ac)
{
if (ac) {
- mAction = new QAction(i18n("Expand URL"), this);
- ac->addAction(QStringLiteral("expand_short_url"), mAction);
- ac->setShortcutsConfigurable(mAction, false);
- connect(mAction, &QAction::triggered, this, &ViewerPluginExpandurlInterface::slotActivatePlugin);
+ QAction *act = new QAction(i18n("Expand URL"), this);
+ ac->addAction(QStringLiteral("expand_short_url"), act);
+ ac->setShortcutsConfigurable(act, false);
+ connect(act, &QAction::triggered, this, &ViewerPluginExpandurlInterface::slotActivatePlugin);
+ mAction.append(act);
}
}
diff --git a/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.h b/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.h
index 668166f..9a7a7b7 100644
--- a/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.h
+++ b/plugins/messageviewerplugins/common/expandurlplugin/viewerpluginexpandurlinterface.h
@@ -30,7 +30,7 @@ public:
explicit ViewerPluginExpandurlInterface(KActionCollection *ac, QWidget *parent = Q_NULLPTR);
~ViewerPluginExpandurlInterface();
- QAction *action() const Q_DECL_OVERRIDE;
+ QList<QAction *> actions() const Q_DECL_OVERRIDE;
void execute() Q_DECL_OVERRIDE;
ViewerPluginInterface::SpecificFeatureTypes featureTypes() const Q_DECL_OVERRIDE;
@@ -38,7 +38,7 @@ public:
private:
void createAction(KActionCollection *ac);
QUrl mCurrentUrl;
- QAction *mAction;
+ QList<QAction *> mAction;
};
}
#endif // VIEWERPLUGINEXPANDURLINTERFACE_H
diff --git a/plugins/messageviewerplugins/common/translatorplugin/messageviewer_translatorplugin.json b/plugins/messageviewerplugins/common/translatorplugin/messageviewer_translatorplugin.json
index 5094392..cb7ee93 100644
--- a/plugins/messageviewerplugins/common/translatorplugin/messageviewer_translatorplugin.json
+++ b/plugins/messageviewerplugins/common/translatorplugin/messageviewer_translatorplugin.json
@@ -27,6 +27,6 @@
"ServiceTypes": [
"MessageViewer/ViewerCommonPlugin"
],
- "Version": "1.0"
+ "Version": "2.0"
}
-} \ No newline at end of file
+}
diff --git a/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.cpp b/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.cpp
index 3e41d61..0e2ebf3 100644
--- a/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.cpp
+++ b/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.cpp
@@ -28,8 +28,7 @@
using namespace MessageViewer;
ViewerPluginTranslatorInterface::ViewerPluginTranslatorInterface(KActionCollection *ac, QWidget *parent)
- : ViewerPluginInterface(parent),
- mAction(Q_NULLPTR)
+ : ViewerPluginInterface(parent)
{
mTranslatorWidget = new PimCommon::TranslatorWidget(parent);
mTranslatorWidget->setObjectName(QStringLiteral("translatorwidget"));
@@ -47,7 +46,7 @@ void ViewerPluginTranslatorInterface::setText(const QString &text)
mTranslatorWidget->setTextToTranslate(text);
}
-QAction *ViewerPluginTranslatorInterface::action() const
+QList<QAction *> ViewerPluginTranslatorInterface::actions() const
{
return mAction;
}
@@ -65,10 +64,11 @@ ViewerPluginInterface::SpecificFeatureTypes ViewerPluginTranslatorInterface::fea
void ViewerPluginTranslatorInterface::createAction(KActionCollection *ac)
{
if (ac) {
- mAction = new QAction(i18n("Translate..."), this);
- ac->setDefaultShortcut(mAction, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_T));
- mAction->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-locale")));
- ac->addAction(QStringLiteral("translate_text"), mAction);
- connect(mAction, &QAction::triggered, this, &ViewerPluginTranslatorInterface::slotActivatePlugin);
+ QAction *act = new QAction(i18n("Translate..."), this);
+ ac->setDefaultShortcut(act, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_T));
+ act->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-locale")));
+ ac->addAction(QStringLiteral("translate_text"), act);
+ connect(act, &QAction::triggered, this, &ViewerPluginTranslatorInterface::slotActivatePlugin);
+ mAction.append(act);
}
}
diff --git a/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.h b/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.h
index 09ddbdd..4314498 100644
--- a/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.h
+++ b/plugins/messageviewerplugins/common/translatorplugin/viewerplugintranslatorinterface.h
@@ -34,13 +34,13 @@ public:
~ViewerPluginTranslatorInterface();
void setText(const QString &text) Q_DECL_OVERRIDE;
- QAction *action() const Q_DECL_OVERRIDE;
+ QList<QAction *> actions() const Q_DECL_OVERRIDE;
void showWidget() Q_DECL_OVERRIDE;
ViewerPluginInterface::SpecificFeatureTypes featureTypes() const Q_DECL_OVERRIDE;
private:
void createAction(KActionCollection *ac);
- QAction *mAction;
+ QList<QAction *> mAction;
PimCommon::TranslatorWidget *mTranslatorWidget;
};
diff --git a/plugins/messageviewerplugins/createeventplugin/messageviewer_createeventplugin.json b/plugins/messageviewerplugins/createeventplugin/messageviewer_createeventplugin.json
index 34c11ec..2b8ef32 100644
--- a/plugins/messageviewerplugins/createeventplugin/messageviewer_createeventplugin.json
+++ b/plugins/messageviewerplugins/createeventplugin/messageviewer_createeventplugin.json
@@ -27,6 +27,6 @@
"ServiceTypes": [
"MessageViewer/ViewerPlugin"
],
- "Version": "1.0"
+ "Version": "2.0"
}
-} \ No newline at end of file
+}
diff --git a/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.cpp b/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.cpp
index 43bf213..a0140b1 100644
--- a/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.cpp
+++ b/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.cpp
@@ -29,8 +29,7 @@
using namespace MessageViewer;
ViewerPluginCreateEventInterface::ViewerPluginCreateEventInterface(KActionCollection *ac, QWidget *parent)
- : ViewerPluginInterface(parent),
- mAction(Q_NULLPTR)
+ : ViewerPluginInterface(parent)
{
mEventEdit = new EventEdit(parent);
connect(mEventEdit, &EventEdit::createEvent, this, &ViewerPluginCreateEventInterface::slotCreateEvent);
@@ -56,7 +55,7 @@ void ViewerPluginCreateEventInterface::setText(const QString &text)
//Nothing
}
-QAction *ViewerPluginCreateEventInterface::action() const
+QList<QAction *> ViewerPluginCreateEventInterface::actions() const
{
return mAction;
}
@@ -84,12 +83,13 @@ void ViewerPluginCreateEventInterface::setMessageItem(const Akonadi::Item &item)
void ViewerPluginCreateEventInterface::createAction(KActionCollection *ac)
{
if (ac) {
- mAction = new QAction(QIcon::fromTheme(QStringLiteral("appointment-new")), i18n("Create Event..."), this);
- mAction->setIconText(i18n("Create Event"));
- addHelpTextAction(mAction, i18n("Allows you to create a calendar Event"));
- ac->addAction(QStringLiteral("create_event"), mAction);
- ac->setDefaultShortcut(mAction, QKeySequence(Qt::CTRL + Qt::Key_E));
- connect(mAction, &QAction::triggered, this, &ViewerPluginCreateEventInterface::slotActivatePlugin);
+ QAction *act = new QAction(QIcon::fromTheme(QStringLiteral("appointment-new")), i18n("Create Event..."), this);
+ act->setIconText(i18n("Create Event"));
+ addHelpTextAction(act, i18n("Allows you to create a calendar Event"));
+ ac->addAction(QStringLiteral("create_event"), act);
+ ac->setDefaultShortcut(act, QKeySequence(Qt::CTRL + Qt::Key_E));
+ connect(act, &QAction::triggered, this, &ViewerPluginCreateEventInterface::slotActivatePlugin);
+ mAction.append(act);
}
}
diff --git a/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.h b/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.h
index eb0c3a2..441fc5c 100644
--- a/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.h
+++ b/plugins/messageviewerplugins/createeventplugin/viewerplugincreateeventinterface.h
@@ -32,7 +32,7 @@ public:
~ViewerPluginCreateEventInterface();
void setText(const QString &text) Q_DECL_OVERRIDE;
- QAction *action() const Q_DECL_OVERRIDE;
+ QList<QAction *> actions() const Q_DECL_OVERRIDE;
void setMessage(const KMime::Message::Ptr &value) Q_DECL_OVERRIDE;
void closePlugin() Q_DECL_OVERRIDE;
void showWidget() Q_DECL_OVERRIDE;
@@ -46,7 +46,7 @@ private:
void createAction(KActionCollection *ac);
Akonadi::Item mMessageItem;
EventEdit *mEventEdit;
- QAction *mAction;
+ QList<QAction *> mAction;
};
}
diff --git a/plugins/messageviewerplugins/createnoteplugin/messageviewer_createnoteplugin.json b/plugins/messageviewerplugins/createnoteplugin/messageviewer_createnoteplugin.json
index bd4ba67..b9f58c0 100644
--- a/plugins/messageviewerplugins/createnoteplugin/messageviewer_createnoteplugin.json
+++ b/plugins/messageviewerplugins/createnoteplugin/messageviewer_createnoteplugin.json
@@ -27,6 +27,6 @@
"ServiceTypes": [
"MessageViewer/ViewerPlugin"
],
- "Version": "1.0"
+ "Version": "2.0"
}
-} \ No newline at end of file
+}
diff --git a/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.cpp b/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.cpp
index 50e2549..2a346df 100644
--- a/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.cpp
+++ b/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.cpp
@@ -32,8 +32,7 @@
using namespace MessageViewer;
ViewerPluginCreatenoteInterface::ViewerPluginCreatenoteInterface(KActionCollection *ac, QWidget *parent)
- : ViewerPluginInterface(parent),
- mAction(Q_NULLPTR)
+ : ViewerPluginInterface(parent)
{
createAction(ac);
mNoteEdit = new NoteEdit(parent);
@@ -54,7 +53,7 @@ void ViewerPluginCreatenoteInterface::setText(const QString &text)
//Nothing
}
-QAction *ViewerPluginCreatenoteInterface::action() const
+QList<QAction *> ViewerPluginCreatenoteInterface::actions() const
{
return mAction;
}
@@ -132,7 +131,7 @@ ViewerPluginInterface::SpecificFeatureTypes ViewerPluginCreatenoteInterface::fea
void ViewerPluginCreatenoteInterface::updateAction(const Akonadi::Item &item)
{
mMessageItem = item;
- if (mAction) {
+ if (!mAction.isEmpty()) {
QString createNoteText;
if (relatedNoteRelation().isValid()) {
createNoteText = i18nc("edit a note on this message", "Edit Note");
@@ -140,20 +139,21 @@ void ViewerPluginCreatenoteInterface::updateAction(const Akonadi::Item &item)
createNoteText = i18nc("create a new note out of this message", "Create Note");
}
- mAction->setText(createNoteText);
- mAction->setIconText(createNoteText);
+ mAction.at(0)->setText(createNoteText);
+ mAction.at(0)->setIconText(createNoteText);
}
}
void ViewerPluginCreatenoteInterface::createAction(KActionCollection *ac)
{
if (ac) {
- mAction = new QAction(QIcon::fromTheme(QStringLiteral("view-pim-notes")), i18nc("create a new note out of this message", "Create Note"), this);
- mAction->setIconText(i18nc("create a new note out of this message", "Create Note"));
- addHelpTextAction(mAction, i18n("Allows you to create a note from this message"));
- mAction->setWhatsThis(i18n("This option starts an editor to create a note. Then you can edit the note to your liking before saving it."));
- ac->addAction(QStringLiteral("create_note"), mAction);
- connect(mAction, &QAction::triggered, this, &ViewerPluginCreatenoteInterface::slotActivatePlugin);
+ QAction *act = new QAction(QIcon::fromTheme(QStringLiteral("view-pim-notes")), i18nc("create a new note out of this message", "Create Note"), this);
+ act->setIconText(i18nc("create a new note out of this message", "Create Note"));
+ addHelpTextAction(act, i18n("Allows you to create a note from this message"));
+ act->setWhatsThis(i18n("This option starts an editor to create a note. Then you can edit the note to your liking before saving it."));
+ ac->addAction(QStringLiteral("create_note"), act);
+ connect(act, &QAction::triggered, this, &ViewerPluginCreatenoteInterface::slotActivatePlugin);
+ mAction.append(act);
}
}
diff --git a/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.h b/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.h
index 10b4422..48c5679 100644
--- a/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.h
+++ b/plugins/messageviewerplugins/createnoteplugin/viewerplugincreatenoteinterface.h
@@ -32,7 +32,7 @@ public:
~ViewerPluginCreatenoteInterface();
void setText(const QString &text) Q_DECL_OVERRIDE;
- QAction *action() const Q_DECL_OVERRIDE;
+ QList<QAction *> actions() const Q_DECL_OVERRIDE;
void setMessage(const KMime::Message::Ptr &value) Q_DECL_OVERRIDE;
void closePlugin() Q_DECL_OVERRIDE;
void showWidget() Q_DECL_OVERRIDE;
@@ -50,7 +50,7 @@ private:
void createAction(KActionCollection *ac);
Akonadi::Item mMessageItem;
NoteEdit *mNoteEdit;
- QAction *mAction;
+ QList<QAction *> mAction;
};
}
#endif // VIEWERPLUGINCREATENOTEINTERFACE_H
diff --git a/plugins/messageviewerplugins/createtodoplugin/messageviewer_createtodoplugin.json b/plugins/messageviewerplugins/createtodoplugin/messageviewer_createtodoplugin.json
index 4b9e248..42aede2 100644
--- a/plugins/messageviewerplugins/createtodoplugin/messageviewer_createtodoplugin.json
+++ b/plugins/messageviewerplugins/createtodoplugin/messageviewer_createtodoplugin.json
@@ -27,6 +27,6 @@
"ServiceTypes": [
"MessageViewer/ViewerPlugin"
],
- "Version": "1.0"
+ "Version": "2.0"
}
-} \ No newline at end of file
+}
diff --git a/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.cpp b/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.cpp
index 2f3fed2..8536d41 100644
--- a/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.cpp
+++ b/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.cpp
@@ -29,8 +29,7 @@
using namespace MessageViewer;
ViewerPluginCreateTodoInterface::ViewerPluginCreateTodoInterface(KActionCollection *ac, QWidget *parent)
- : ViewerPluginInterface(parent),
- mAction(Q_NULLPTR)
+ : ViewerPluginInterface(parent)
{
mTodoEdit = new TodoEdit(parent);
mTodoEdit->setObjectName(QStringLiteral("todoedit"));
@@ -51,7 +50,7 @@ void ViewerPluginCreateTodoInterface::setText(const QString &text)
//Nothing
}
-QAction *ViewerPluginCreateTodoInterface::action() const
+QList<QAction *> ViewerPluginCreateTodoInterface::actions() const
{
return mAction;
}
@@ -84,13 +83,14 @@ ViewerPluginInterface::SpecificFeatureTypes ViewerPluginCreateTodoInterface::fea
void ViewerPluginCreateTodoInterface::createAction(KActionCollection *ac)
{
if (ac) {
- mAction = new QAction(QIcon::fromTheme(QStringLiteral("task-new")), i18n("Create Todo"), this);
- mAction->setIconText(i18n("Create To-do"));
- addHelpTextAction(mAction, i18n("Allows you to create a calendar to-do or reminder from this message"));
- mAction->setWhatsThis(i18n("This option starts the KOrganizer to-do editor with initial values taken from the currently selected message. Then you can edit the to-do to your liking before saving it to your calendar."));
- ac->addAction(QStringLiteral("create_todo"), mAction);
- ac->setDefaultShortcut(mAction, QKeySequence(Qt::CTRL + Qt::Key_T));
- connect(mAction, &QAction::triggered, this, &ViewerPluginCreateTodoInterface::slotActivatePlugin);
+ QAction *act = new QAction(QIcon::fromTheme(QStringLiteral("task-new")), i18n("Create Todo"), this);
+ act->setIconText(i18n("Create To-do"));
+ addHelpTextAction(act, i18n("Allows you to create a calendar to-do or reminder from this message"));
+ act->setWhatsThis(i18n("This option starts the KOrganizer to-do editor with initial values taken from the currently selected message. Then you can edit the to-do to your liking before saving it to your calendar."));
+ ac->addAction(QStringLiteral("create_todo"), act);
+ ac->setDefaultShortcut(act, QKeySequence(Qt::CTRL + Qt::Key_T));
+ connect(act, &QAction::triggered, this, &ViewerPluginCreateTodoInterface::slotActivatePlugin);
+ mAction.append(act);
}
}
diff --git a/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.h b/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.h
index 3af32e0..e8a0f1e 100644
--- a/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.h
+++ b/plugins/messageviewerplugins/createtodoplugin/viewerplugincreatetodointerface.h
@@ -33,7 +33,7 @@ public:
~ViewerPluginCreateTodoInterface();
void setText(const QString &text) Q_DECL_OVERRIDE;
- QAction *action() const Q_DECL_OVERRIDE;
+ QList<QAction *> actions() const Q_DECL_OVERRIDE;
void setMessage(const KMime::Message::Ptr &value) Q_DECL_OVERRIDE;
void closePlugin() Q_DECL_OVERRIDE;
void showWidget() Q_DECL_OVERRIDE;
@@ -46,7 +46,7 @@ private Q_SLOTS:
private:
void createAction(KActionCollection *ac);
TodoEdit *mTodoEdit;
- QAction *mAction;
+ QList<QAction *> mAction;
Akonadi::Item mMessageItem;
};
}