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

Generate actions from plugins

parent fd464b6c
Pipeline #76361 passed with stage
in 23 minutes and 27 seconds
......@@ -35,6 +35,7 @@ void KMailPluginCheckBeforeDeletingManagerInterface::initializePlugins()
auto interface = static_cast<MessageViewer::MessageViewerCheckBeforeDeletingInterface *>(plugin->createInterface(this));
interface->setParentWidget(mParentWidget);
interface->createActions(mActionCollection);
mActions.append(interface->actions());
mListPluginInterface.append(interface);
}
}
......@@ -51,6 +52,11 @@ void KMailPluginCheckBeforeDeletingManagerInterface::setActionCollection(KAction
mActionCollection = ac;
}
const QList<QAction *> KMailPluginCheckBeforeDeletingManagerInterface::actions() const
{
return mActions;
}
void KMailPluginCheckBeforeDeletingManagerInterface::setParentWidget(QWidget *newParentWidget)
{
mParentWidget = newParentWidget;
......
......@@ -13,6 +13,7 @@ namespace MessageViewer
{
class MessageViewerCheckBeforeDeletingInterface;
}
class QAction;
class KActionCollection;
class KMailPluginCheckBeforeDeletingManagerInterface : public QObject
{
......@@ -29,7 +30,10 @@ public:
void setActionCollection(KActionCollection *ac);
const QList<QAction *> actions() const;
private:
QList<QAction *> mActions;
QVector<MessageViewer::MessageViewerCheckBeforeDeletingInterface *> mListPluginInterface;
QWidget *mParentWidget = nullptr;
KActionCollection *mActionCollection = nullptr;
......
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