| 78 | } |
| 79 | |
| 80 | void MainWindowPrivate::addPlugin( IPlugin *plugin ) |
| 81 | { |
| 82 | qCDebug(SHELL) << "add plugin" << plugin << plugin->componentName(); |
| 83 | Q_ASSERT( plugin ); |
| 84 | |
| 85 | //The direct plugin client can only be added to the first mainwindow |
| 86 | if(m_mainWindow == Core::self()->uiControllerInternal()->mainWindows()[0]) |
| 87 | m_mainWindow->guiFactory()->addClient( plugin ); |
| 88 | |
| 89 | Q_ASSERT(!m_pluginCustomClients.contains(plugin)); |
| 90 | |
| 91 | KXMLGUIClient* ownClient = plugin->createGUIForMainWindow(m_mainWindow); |
| 92 | if(ownClient) { |
| 93 | m_pluginCustomClients[plugin] = ownClient; |
| 94 | connect(plugin, &IPlugin::destroyed, this, &MainWindowPrivate::pluginDestroyed); |
| 95 | m_mainWindow->guiFactory()->addClient(ownClient); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | void MainWindowPrivate::pluginDestroyed(QObject* pluginObj) |
| 100 | { |
no test coverage detected