| 78 | } |
| 79 | |
| 80 | KDevelop::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 | |
| 103 | void ProviderWidget::fillCombo() |
| 104 | { |
nothing calls this directly
no test coverage detected