Commit 3cec878b authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau

Merge branch '5.4'

parents 0f21717e d8023d36
...@@ -253,7 +253,7 @@ void MainWindow::dropEvent( QDropEvent* ev ) ...@@ -253,7 +253,7 @@ void MainWindow::dropEvent( QDropEvent* ev )
bool eventUsed = false; bool eventUsed = false;
if (urls.size() == 1) { if (urls.size() == 1) {
eventUsed = Core::self()->projectControllerInternal()->fetchProjectFromUrl(urls.at(0)); eventUsed = Core::self()->projectControllerInternal()->fetchProjectFromUrl(urls.at(0), ProjectController::NoFetchFlags);
} }
if (!eventUsed) { if (!eventUsed) {
......
...@@ -911,7 +911,7 @@ void ProjectController::openProject( const QUrl &projectFile ) ...@@ -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); Q_D(ProjectController);
...@@ -930,8 +930,10 @@ bool ProjectController::fetchProjectFromUrl(const QUrl& repoUrl) ...@@ -930,8 +930,10 @@ bool ProjectController::fetchProjectFromUrl(const QUrl& repoUrl)
} }
} }
if (!vcsOrProviderPlugin) { if (!vcsOrProviderPlugin) {
if (fetchFlags.testFlag(FetchShowErrorIfNotSupported)) {
KMessageBox::error(Core::self()->uiController()->activeMainWindow(), KMessageBox::error(Core::self()->uiController()->activeMainWindow(),
i18n("No enabled plugin supports this repository URL: %1", repoUrl.toDisplayString())); i18n("No enabled plugin supports this repository URL: %1", repoUrl.toDisplayString()));
}
return false; return false;
} }
......
...@@ -97,11 +97,17 @@ public: ...@@ -97,11 +97,17 @@ public:
ContextMenuExtension contextMenuExtension(KDevelop::Context* ctx, QWidget* parent); ContextMenuExtension contextMenuExtension(KDevelop::Context* ctx, QWidget* parent);
enum FetchFlag {
NoFetchFlags = 0,
FetchShowErrorIfNotSupported = 1,
};
Q_DECLARE_FLAGS(FetchFlags, FetchFlag)
/** /**
* @param repoUrl url identifying the repo * @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 * @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: public Q_SLOTS:
Q_SCRIPTABLE void openProjectForUrl( const QString &sourceUrl ) { openProjectForUrl(QUrl(sourceUrl)); } Q_SCRIPTABLE void openProjectForUrl( const QString &sourceUrl ) { openProjectForUrl(QUrl(sourceUrl)); }
......
...@@ -43,6 +43,7 @@ class OktetaPlugin; ...@@ -43,6 +43,7 @@ class OktetaPlugin;
class OktetaDocument : public Sublime::UrlDocument, public IDocument class OktetaDocument : public Sublime::UrlDocument, public IDocument
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(KDevelop::IDocument)
public: public:
OktetaDocument( const QUrl &url, ICore* core ); OktetaDocument( const QUrl &url, ICore* core );
......
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