| 354 | }; |
| 355 | |
| 356 | PluginController::PluginController(Core *core) |
| 357 | : IPluginController() |
| 358 | , d_ptr(new PluginControllerPrivate(core)) |
| 359 | { |
| 360 | Q_D(PluginController); |
| 361 | |
| 362 | setObjectName(QStringLiteral("PluginController")); |
| 363 | |
| 364 | d->plugins = KPluginMetaData::findPlugins(QStringLiteral("kdevplatform/" QT_STRINGIFY(KDEVELOP_PLUGIN_VERSION))); |
| 365 | |
| 366 | qCDebug(SHELL) << "Found" << d->plugins.size() << "plugins:" << pluginIds(d->plugins); |
| 367 | if (d->plugins.empty()) { |
| 368 | qCWarning(SHELL) << "Did not find any plugins, check your environment."; |
| 369 | qCWarning(SHELL) << " Note: QT_PLUGIN_PATH is set to:" << qgetenv("QT_PLUGIN_PATH"); |
| 370 | } else { |
| 371 | // KDevelop exits with an error if KDevelop plugins cannot be found. So do not |
| 372 | // waste time initializing KTextEditor integration then. Furthermore, finding |
| 373 | // KTextEditor plugins makes allPluginInfos() nonempty, which hinders error detection. |
| 374 | d->initKTextEditorIntegration(); |
| 375 | } |
| 376 | |
| 377 | d->cleanupMode = PluginControllerPrivate::Running; |
| 378 | // Register the KDevelop::IPlugin* metatype so we can properly unload it |
| 379 | qRegisterMetaType<KDevelop::IPlugin*>( "KDevelop::IPlugin*" ); |
| 380 | } |
| 381 | |
| 382 | PluginController::~PluginController() |
| 383 | { |
nothing calls this directly
no test coverage detected