| 356 | } |
| 357 | |
| 358 | void loadVersionControlPlugin(KConfigGroup& projectGroup) |
| 359 | { |
| 360 | // helper method for open() |
| 361 | IPluginController* pluginManager = Core::self()->pluginController(); |
| 362 | if( projectGroup.hasKey( "VersionControlSupport" ) ) |
| 363 | { |
| 364 | QString vcsPluginName = projectGroup.readEntry("VersionControlSupport", ""); |
| 365 | if( !vcsPluginName.isEmpty() ) |
| 366 | { |
| 367 | vcsPlugin = pluginManager->pluginForExtension( QStringLiteral( "org.kdevelop.IBasicVersionControl" ), vcsPluginName ); |
| 368 | } |
| 369 | } else |
| 370 | { |
| 371 | const QList<IPlugin*> plugins = pluginManager->allPluginsForExtension( QStringLiteral( "org.kdevelop.IBasicVersionControl" ) ); |
| 372 | for (IPlugin* p : plugins) { |
| 373 | auto* iface = p->extension<KDevelop::IBasicVersionControl>(); |
| 374 | if (!iface) { |
| 375 | continue; |
| 376 | } |
| 377 | |
| 378 | const auto url = topItem->path().toUrl(); |
| 379 | qCDebug(SHELL) << "Checking whether" << url << "is version controlled by" << iface->name(); |
| 380 | if(iface->isVersionControlled(url)) |
| 381 | { |
| 382 | qCDebug(SHELL) << "Detected that" << url << "is a" << iface->name() << "project"; |
| 383 | |
| 384 | vcsPlugin = p; |
| 385 | projectGroup.writeEntry("VersionControlSupport", pluginManager->pluginInfo(p).pluginId()); |
| 386 | projectGroup.sync(); |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | } |
| 392 | |
| 393 | bool importTopItem(IProjectFileManager* fileManager) |
| 394 | { |
no test coverage detected