| 246 | } |
| 247 | |
| 248 | QList<Cantor::PanelPlugin*> Notebook::getPlugins() { |
| 249 | DEBUG(Q_FUNC_INFO) |
| 250 | if (!m_pluginsLoaded) { |
| 251 | auto* handler = new Cantor::PanelPluginHandler(this); |
| 252 | handler->loadPlugins(); |
| 253 | |
| 254 | if (m_plugins.isEmpty()) |
| 255 | INFO(Q_FUNC_INFO << ", no plugins yet.") |
| 256 | |
| 257 | auto states = Cantor::PanelPluginHandler::PanelStates(); |
| 258 | if (!m_session) { |
| 259 | WARN(Q_FUNC_INFO << ", WARNING: no session!") |
| 260 | } else |
| 261 | m_plugins = handler->activePluginsForSession(m_session, states); |
| 262 | |
| 263 | for (auto* plugin : m_plugins) { |
| 264 | INFO(Q_FUNC_INFO << ", connecting plugin") |
| 265 | plugin->connectToShell(m_part); |
| 266 | } |
| 267 | |
| 268 | m_pluginsLoaded = true; |
| 269 | } |
| 270 | |
| 271 | DEBUG(Q_FUNC_INFO << ", DONE") |
| 272 | return m_plugins; |
| 273 | } |
| 274 | |
| 275 | KParts::ReadWritePart* Notebook::part() { |
| 276 | return m_part; |