From 4ca4a6b4d108a1681e66de8f82e50d1f7a46d926 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Sat, 17 Feb 2018 11:10:22 +0100 Subject: Adapt to Qt Creator changes In hover handler and run configuration factory Change-Id: Ib60db43560e8485ce9b5a8f9ddcb703382a0ef70 Reviewed-by: Eike Ziller --- plugins/haskell/haskellhoverhandler.cpp | 5 ++++- plugins/haskell/haskellhoverhandler.h | 4 +++- plugins/haskell/haskellrunconfiguration.cpp | 8 ++++++-- plugins/haskell/haskellrunconfiguration.h | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/haskell/haskellhoverhandler.cpp b/plugins/haskell/haskellhoverhandler.cpp index ffad6a9..1719297 100644 --- a/plugins/haskell/haskellhoverhandler.cpp +++ b/plugins/haskell/haskellhoverhandler.cpp @@ -70,7 +70,9 @@ QString symbolToHtml(const SymbolInfo &info) return result; } -void HaskellHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) +void HaskellHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget, + int pos, + ReportPriority report) { cancel(); m_name.clear(); @@ -84,6 +86,7 @@ void HaskellHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidg } else { setPriority(-1); } + report(priority()); } static void showError(const QPointer &widget, diff --git a/plugins/haskell/haskellhoverhandler.h b/plugins/haskell/haskellhoverhandler.h index 8cad5c5..ab200a1 100644 --- a/plugins/haskell/haskellhoverhandler.h +++ b/plugins/haskell/haskellhoverhandler.h @@ -37,7 +37,9 @@ namespace Internal { class HaskellHoverHandler : public TextEditor::BaseHoverHandler { private: - void identifyMatch(TextEditor::TextEditorWidget *editorWidget, int pos) override; + void identifyMatch(TextEditor::TextEditorWidget *editorWidget, + int pos, + ReportPriority report) override; void operateTooltip(TextEditor::TextEditorWidget *editorWidget, const QPoint &point) override; void cancel(); diff --git a/plugins/haskell/haskellrunconfiguration.cpp b/plugins/haskell/haskellrunconfiguration.cpp index 87514e3..661fa05 100644 --- a/plugins/haskell/haskellrunconfiguration.cpp +++ b/plugins/haskell/haskellrunconfiguration.cpp @@ -51,12 +51,16 @@ HaskellRunConfigurationFactory::HaskellRunConfigurationFactory() setSupportedTargetDeviceTypes({ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE}); } -QList HaskellRunConfigurationFactory::availableBuildTargets( +QList HaskellRunConfigurationFactory::availableBuildTargets( Target *parent, IRunConfigurationFactory::CreationMode mode) const { Q_UNUSED(mode) const auto project = HaskellProject::toHaskellProject(parent->project()); - return project ? project->availableExecutables() : QList(); + if (!project) + return {}; + return Utils::transform(project->availableExecutables(), [](const QString &name) { + return BuildTargetInfo(name, Utils::FileName(), Utils::FileName()); + }); } HaskellRunConfiguration::HaskellRunConfiguration(Target *parent) diff --git a/plugins/haskell/haskellrunconfiguration.h b/plugins/haskell/haskellrunconfiguration.h index 7423487..9970d65 100644 --- a/plugins/haskell/haskellrunconfiguration.h +++ b/plugins/haskell/haskellrunconfiguration.h @@ -37,8 +37,8 @@ class HaskellRunConfigurationFactory : public ProjectExplorer::IRunConfiguration public: HaskellRunConfigurationFactory(); - QList availableBuildTargets(ProjectExplorer::Target *parent, - CreationMode mode) const override; + QList availableBuildTargets(ProjectExplorer::Target *parent, + CreationMode mode) const override; }; class HaskellRunConfiguration : public ProjectExplorer::RunConfiguration -- cgit v1.2.3