Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

shell: do not show bogus error about repo urls on DnD of normal files

parent 8c8c7b41
......@@ -253,7 +253,7 @@ void MainWindow::dropEvent( QDropEvent* ev )
bool eventUsed = false;
if (urls.size() == 1) {
eventUsed = Core::self()->projectControllerInternal()->fetchProjectFromUrl(urls.at(0));
eventUsed = Core::self()->projectControllerInternal()->fetchProjectFromUrl(urls.at(0), ProjectController::NoFetchFlags);
}
if (!eventUsed) {
......
......@@ -911,7 +911,7 @@ void ProjectController::openProject( const QUrl &projectFile )
}
}
bool ProjectController::fetchProjectFromUrl(const QUrl& repoUrl)
bool ProjectController::fetchProjectFromUrl(const QUrl& repoUrl, FetchFlags fetchFlags)
{
Q_D(ProjectController);
......@@ -930,8 +930,10 @@ bool ProjectController::fetchProjectFromUrl(const QUrl& repoUrl)
}
}
if (!vcsOrProviderPlugin) {
KMessageBox::error(Core::self()->uiController()->activeMainWindow(),
i18n("No enabled plugin supports this repository URL: %1", repoUrl.toDisplayString()));
if (fetchFlags.testFlag(FetchShowErrorIfNotSupported)) {
KMessageBox::error(Core::self()->uiController()->activeMainWindow(),
i18n("No enabled plugin supports this repository URL: %1", repoUrl.toDisplayString()));
}
return false;
}
......
......@@ -97,11 +97,17 @@ public:
ContextMenuExtension contextMenuExtension(KDevelop::Context* ctx, QWidget* parent);
enum FetchFlag {
NoFetchFlags = 0,
FetchShowErrorIfNotSupported = 1,
};
Q_DECLARE_FLAGS(FetchFlags, FetchFlag)
/**
* @param repoUrl url identifying the repo
* @returns @c true if a plugin was found to handle the repo (also if user cancelled), @c false otherwise
*/
bool fetchProjectFromUrl(const QUrl& repoUrl);
bool fetchProjectFromUrl(const QUrl& repoUrl, FetchFlags fetchFlags = FetchShowErrorIfNotSupported);
public Q_SLOTS:
Q_SCRIPTABLE void openProjectForUrl( const QString &sourceUrl ) { openProjectForUrl(QUrl(sourceUrl)); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment