From bef11b6fb4457d1913bf82d06a336fde18b73ac7 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 13 May 2019 16:04:10 +0200 Subject: Adapt to 4.9 Change-Id: I649fd586c31149153a501d011bcd95e3452404e8 Reviewed-by: hjk --- plugins/haskell/haskellbuildconfiguration.cpp | 35 +++++++++++++-------------- plugins/haskell/haskellbuildconfiguration.h | 10 ++++---- plugins/haskell/haskellproject.cpp | 18 ++++++-------- plugins/haskell/haskellrunconfiguration.cpp | 8 +++--- plugins/haskell/stackbuildstep.cpp | 3 ++- 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/plugins/haskell/haskellbuildconfiguration.cpp b/plugins/haskell/haskellbuildconfiguration.cpp index 314a4e8..b09c7b4 100644 --- a/plugins/haskell/haskellbuildconfiguration.cpp +++ b/plugins/haskell/haskellbuildconfiguration.cpp @@ -58,33 +58,32 @@ HaskellBuildConfigurationFactory::HaskellBuildConfigurationFactory() setSupportedProjectMimeTypeName(Constants::C_HASKELL_PROJECT_MIMETYPE); } -static QList createInfos(const HaskellBuildConfigurationFactory *factory, - const Kit *k, - const Utils::FileName &projectFilePath) +static QList createInfos(const HaskellBuildConfigurationFactory *factory, + const Kit *k, + const Utils::FileName &projectFilePath) { - auto info = new BuildInfo(factory); - info->typeName = HaskellBuildConfigurationFactory::tr("Release"); - info->displayName = info->typeName; - info->buildDirectory = projectFilePath.parentDir().appendPath(".stack-work"); - info->kitId = k->id(); - info->buildType = BuildConfiguration::BuildType::Release; + BuildInfo info(factory); + info.typeName = HaskellBuildConfigurationFactory::tr("Release"); + info.displayName = info.typeName; + info.buildDirectory = projectFilePath.parentDir().appendPath(".stack-work"); + info.kitId = k->id(); + info.buildType = BuildConfiguration::BuildType::Release; return {info}; } -QList HaskellBuildConfigurationFactory::availableBuilds(const Target *parent) const +QList HaskellBuildConfigurationFactory::availableBuilds(const Target *parent) const { // Entries that are available in add build configuration dropdown return Utils::transform(createInfos(this, parent->kit(), parent->project()->projectFilePath()), - [](BuildInfo *info) { - info->displayName.clear(); + [](BuildInfo info) { + info.displayName.clear(); return info; }); } -QList HaskellBuildConfigurationFactory::availableSetups( +QList HaskellBuildConfigurationFactory::availableSetups( const Kit *k, const QString &projectPath) const { - QTC_ASSERT(priority(k, projectPath) > -1, return {}); return createInfos(this, k, Utils::FileName::fromString(projectPath)); } @@ -107,12 +106,12 @@ void HaskellBuildConfiguration::setBuildType(BuildConfiguration::BuildType type) m_buildType = type; } -void HaskellBuildConfiguration::initialize(const BuildInfo *info) +void HaskellBuildConfiguration::initialize(const BuildInfo &info) { BuildConfiguration::initialize(info); - setBuildDirectory(info->buildDirectory); - setBuildType(info->buildType); - setDisplayName(info->displayName); + setBuildDirectory(info.buildDirectory); + setBuildType(info.buildType); + setDisplayName(info.displayName); BuildStepList *buildSteps = stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD); auto stackBuildStep = new StackBuildStep(buildSteps); diff --git a/plugins/haskell/haskellbuildconfiguration.h b/plugins/haskell/haskellbuildconfiguration.h index 146294b..c45c35f 100644 --- a/plugins/haskell/haskellbuildconfiguration.h +++ b/plugins/haskell/haskellbuildconfiguration.h @@ -31,17 +31,17 @@ namespace Haskell { namespace Internal { -class HaskellBuildConfigurationFactory : public ProjectExplorer::IBuildConfigurationFactory +class HaskellBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationFactory { Q_OBJECT public: HaskellBuildConfigurationFactory(); - QList availableBuilds( + QList availableBuilds( const ProjectExplorer::Target *parent) const override; - QList availableSetups(const ProjectExplorer::Kit *k, - const QString &projectPath) const override; + QList availableSetups(const ProjectExplorer::Kit *k, + const QString &projectPath) const override; }; class HaskellBuildConfiguration : public ProjectExplorer::BuildConfiguration @@ -54,7 +54,7 @@ public: ProjectExplorer::NamedWidget *createConfigWidget() override; BuildType buildType() const override; void setBuildType(BuildType type); - void initialize(const ProjectExplorer::BuildInfo *info) override; + void initialize(const ProjectExplorer::BuildInfo &info) override; private: BuildType m_buildType = BuildType::Release; diff --git a/plugins/haskell/haskellproject.cpp b/plugins/haskell/haskellproject.cpp index af6b806..bdc3860 100644 --- a/plugins/haskell/haskellproject.cpp +++ b/plugins/haskell/haskellproject.cpp @@ -87,17 +87,13 @@ void HaskellProject::updateFiles() { emitParsingStarted(); FileName projectDir = projectDirectory(); - const QList versionControls = Core::VcsManager::versionControls(); - QFuture> future = Utils::runAsync([this, projectDir, versionControls] { - return FileNode::scanForFilesWithVersionControls( - projectDir, - [this](const FileName &fn) -> FileNode * { - if (fn != FileName::fromString(projectFilePath().toString() + ".user")) - return new FileNode(fn, FileType::Source, false); - else - return nullptr; - }, - versionControls); + QFuture> future = Utils::runAsync([this, projectDir] { + return FileNode::scanForFiles(projectDir, [this](const FileName &fn) -> FileNode * { + if (fn != FileName::fromString(projectFilePath().toString() + ".user")) + return new FileNode(fn, FileType::Source, false); + else + return nullptr; + }); }); Utils::onResultReady(future, this, [this](const QList &nodes) { auto root = new HaskellProjectNode(projectDirectory(), id()); diff --git a/plugins/haskell/haskellrunconfiguration.cpp b/plugins/haskell/haskellrunconfiguration.cpp index d3cdb95..ffdcb6d 100644 --- a/plugins/haskell/haskellrunconfiguration.cpp +++ b/plugins/haskell/haskellrunconfiguration.cpp @@ -77,7 +77,7 @@ HaskellRunConfiguration::HaskellRunConfiguration(Target *target, Core::Id id) void HaskellRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &info) { - extraAspect()->setValue(info.buildKey); + aspect()->setValue(info.buildKey); } Runnable HaskellRunConfiguration::runnable() const @@ -90,13 +90,13 @@ Runnable HaskellRunConfiguration::runnable() const .relativeFilePath( buildConfiguration->buildDirectory().toString()) + "\" "; - const QString executable = extraAspect()->value(); + const QString executable = aspect()->value(); r.commandLineArguments += "exec \"" + executable + "\""; - const QString arguments = extraAspect()->arguments(macroExpander()); + const QString arguments = aspect()->arguments(macroExpander()); if (!arguments.isEmpty()) r.commandLineArguments += " -- " + arguments; r.workingDirectory = projectDirectory; - r.environment = extraAspect()->environment(); + r.environment = aspect()->environment(); r.executable = r.environment.searchInPath(HaskellManager::stackExecutable().toString()).toString(); return r; } diff --git a/plugins/haskell/stackbuildstep.cpp b/plugins/haskell/stackbuildstep.cpp index 1f5a253..7dc7f6a 100644 --- a/plugins/haskell/stackbuildstep.cpp +++ b/plugins/haskell/stackbuildstep.cpp @@ -28,6 +28,7 @@ #include "haskellmanager.h" #include +#include #include #include @@ -68,7 +69,7 @@ StackBuildStep::StackBuildStep(ProjectExplorer::BuildStepList *bsl) BuildStepConfigWidget *StackBuildStep::createConfigWidget() { - return new SimpleBuildStepConfigWidget(this); + return new BuildStepConfigWidget(this); } QString StackBuildStep::trDisplayName() -- cgit v1.2.3