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

Create actions

parent f81604b9
Pipeline #76327 passed with stage
in 23 minutes and 10 seconds
......@@ -65,7 +65,7 @@ option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets)
set(LIBGRAVATAR_VERSION "5.18.40")
set(MAILCOMMON_LIB_VERSION "5.18.40")
set(MESSAGELIB_LIB_VERSION "5.18.40")
set(MESSAGELIB_LIB_VERSION "5.18.43")
set(LIBKLEO_LIB_VERSION "5.18.40")
set(PIMCOMMON_LIB_VERSION "5.18.40")
set(LIBKDEPIM_LIB_VERSION "5.18.40")
......
......@@ -240,6 +240,7 @@ KMMainWidget::KMMainWidget(QWidget *parent, KXMLGUIClient *aGUIClient, KActionCo
KMailPluginInterface::self()->setMainWidget(this);
mPluginCheckBeforeDeletingManagerInterface = new KMailPluginCheckBeforeDeletingManagerInterface(this);
mPluginCheckBeforeDeletingManagerInterface->setParentWidget(this);
mPluginCheckBeforeDeletingManagerInterface->setActionCollection(mActionCollection);
mPluginCheckBeforeDeletingManagerInterface->initializePlugins();
theMainWidgetList->append(this);
......
......@@ -34,6 +34,7 @@ void KMailPluginCheckBeforeDeletingManagerInterface::initializePlugins()
if (plugin->isEnabled()) {
auto interface = static_cast<MessageViewer::MessageViewerCheckBeforeDeletingInterface *>(plugin->createInterface(this));
interface->setParentWidget(mParentWidget);
interface->createActions(mActionCollection);
mListPluginInterface.append(interface);
}
}
......@@ -45,6 +46,11 @@ QWidget *KMailPluginCheckBeforeDeletingManagerInterface::parentWidget() const
return mParentWidget;
}
void KMailPluginCheckBeforeDeletingManagerInterface::setActionCollection(KActionCollection *ac)
{
mActionCollection = ac;
}
void KMailPluginCheckBeforeDeletingManagerInterface::setParentWidget(QWidget *newParentWidget)
{
mParentWidget = newParentWidget;
......
......@@ -13,6 +13,7 @@ namespace MessageViewer
{
class MessageViewerCheckBeforeDeletingInterface;
}
class KActionCollection;
class KMailPluginCheckBeforeDeletingManagerInterface : public QObject
{
Q_OBJECT
......@@ -26,8 +27,11 @@ public:
Q_REQUIRED_RESULT Akonadi::Item::List confirmBeforeDeleting(const Akonadi::Item::List &list);
void setActionCollection(KActionCollection *ac);
private:
QVector<MessageViewer::MessageViewerCheckBeforeDeletingInterface *> mListPluginInterface;
QWidget *mParentWidget = nullptr;
KActionCollection *mActionCollection = nullptr;
bool mWasInitialized = false;
};
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