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

Method createWorkingCopy

plugins/ghprovider/ghproviderwidget.cpp:80–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80KDevelop::VcsJob * ProviderWidget::createWorkingCopy(const QUrl &dest)
81{
82 QModelIndex pos = m_projects->currentIndex();
83 if (!pos.isValid())
84 return nullptr;
85
86 auto plugin = ICore::self()->pluginController()->pluginForExtension(QStringLiteral("org.kdevelop.IBasicVersionControl"), QStringLiteral("kdevgit"));
87 if (!plugin) {
88 KMessageBox::error(nullptr, i18n("The Git plugin could not be loaded which is required to import a GitHub project."), i18nc("@title:window", "GitHub Provider Error"));
89 return nullptr;
90 }
91
92 QString url = pos.data(ProviderModel::VcsLocationRole).toString();
93 if (m_account->validAccount())
94 url = QLatin1String("https://") + m_account->token() + QLatin1Char('@') + slicedOrEmptyView(url, 8);
95 QUrl real = QUrl(url);
96 VcsLocation loc(real);
97
98 auto vc = plugin->extension<IBasicVersionControl>();
99 Q_ASSERT(vc);
100 return vc->createWorkingCopy(loc, dest);
101}
102
103void ProviderWidget::fillCombo()
104{

Callers

nothing calls this directly

Calls 10

slicedOrEmptyViewFunction · 0.85
pluginControllerMethod · 0.80
validAccountMethod · 0.80
QUrlClass · 0.50
currentIndexMethod · 0.45
isValidMethod · 0.45
pluginForExtensionMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
tokenMethod · 0.45

Tested by

no test coverage detected