MCPcopy Create free account
hub / github.com/KDE/kdevelop / loadVersionControlPlugin

Method loadVersionControlPlugin

kdevplatform/shell/project.cpp:358–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

openMethod · 0.80

Calls 13

pluginControllerMethod · 0.80
readEntryMethod · 0.80
writeEntryMethod · 0.80
pluginIdMethod · 0.80
hasKeyMethod · 0.45
isEmptyMethod · 0.45
pluginForExtensionMethod · 0.45
toUrlMethod · 0.45
pathMethod · 0.45
nameMethod · 0.45
isVersionControlledMethod · 0.45

Tested by

no test coverage detected