Commit db52c92a authored by Laurent Montel's avatar Laurent Montel 😁

Create dynamically action list

parent ebde55d4
......@@ -34,13 +34,16 @@ public:
QVector<NetworkPluginUrlInterceptorConfigureWidgetSetting> configureInterceptorList(QWidget *parent) const;
void createInterfaces(QWebEngineView *webEngine, KActionCollection *ac);
QVector<MessageViewer::NetworkPluginUrlInterceptorInterface *> mListInterface;
QList<QAction *> mActionList;
NetworkUrlInterceptorManager *q;
};
QList<QAction *> NetworkUrlInterceptorManagerPrivate::actions() const
{
return mActionList;
QList<QAction *> lstActions;
Q_FOREACH(MessageViewer::NetworkPluginUrlInterceptorInterface *interface, mListInterface) {
lstActions.append(interface->actions());
}
return lstActions;
}
QVector<NetworkPluginUrlInterceptorConfigureWidgetSetting> NetworkUrlInterceptorManagerPrivate::configureInterceptorList(QWidget *parent) const
......@@ -59,7 +62,6 @@ void NetworkUrlInterceptorManagerPrivate::createInterfaces(QWebEngineView *webEn
Q_FOREACH (NetworkPluginUrlInterceptor *plugin, NetworkUrlInterceptorPluginManager::self()->pluginsList()) {
MessageViewer::NetworkPluginUrlInterceptorInterface *interface = plugin->createInterface(webEngine, q);
interface->createActions(ac);
mActionList.append(interface->actions());
mListInterface.append(interface);
}
}
......
Markdown is supported
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