Commit 1dd7f9c7 authored by Laurent Montel's avatar Laurent Montel 😁

Prepare to load action from several type of plugins

parent 3c8a4a66
......@@ -1353,17 +1353,23 @@ void KMComposerWin::slotToggleMenubar(bool dontShowWarning)
void KMComposerWin::initializePluginActions()
{
if (guiFactory()) {
QHash<QString, QList<QAction *>> hashActions;
QHashIterator<MessageComposer::PluginActionType::Type, QList<QAction *> > localActionsType(mPluginEditorManagerInterface->actionsType());
while (localActionsType.hasNext()) {
localActionsType.next();
QList<QAction *> lst = localActionsType.value();
if (!lst.isEmpty()) {
if (!lst.isEmpty()) {
const QString actionlistname = QStringLiteral("kmaileditor") + MessageComposer::PluginActionType::actionXmlExtension(localActionsType.key());
Q_FOREACH (KXMLGUIClient *client, guiFactory()->clients()) {
client->unplugActionList(actionlistname);
client->plugActionList(actionlistname, lst);
}
hashActions.insert(actionlistname, lst);
}
}
QHash<QString, QList<QAction *>>::const_iterator i = hashActions.constBegin();
while (i != hashActions.constEnd()) {
Q_FOREACH (KXMLGUIClient *client, guiFactory()->clients()) {
client->unplugActionList(i.key());
client->plugActionList(i.key(), i.value());
}
++i;
}
}
}
......
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