summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-05-13 16:46:29 +0200
committerEike Ziller <eike.ziller@qt.io>2019-05-13 16:46:29 +0200
commitdd695dcd2cfbc441cb98e01b616af7e1e92aa979 (patch)
treefc842c567a958e3532c3b19c217d505a1702c80e
parent1f0b6252f52d40305c9a1e0cdf72429448fdab2d (diff)
parentbef11b6fb4457d1913bf82d06a336fde18b73ac7 (diff)
Merge remote-tracking branch 'origin/4.9'
-rw-r--r--plugins/haskell/haskellbuildconfiguration.cpp35
-rw-r--r--plugins/haskell/haskellbuildconfiguration.h10
-rw-r--r--plugins/haskell/haskellproject.cpp18
-rw-r--r--plugins/haskell/haskellrunconfiguration.cpp8
-rw-r--r--plugins/haskell/stackbuildstep.cpp3
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<BuildInfo *> createInfos(const HaskellBuildConfigurationFactory *factory,
- const Kit *k,
- const Utils::FileName &projectFilePath)
+static QList<BuildInfo> 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<BuildInfo *> HaskellBuildConfigurationFactory::availableBuilds(const Target *parent) const
+QList<BuildInfo> 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<BuildInfo *> HaskellBuildConfigurationFactory::availableSetups(
+QList<BuildInfo> 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<ProjectExplorer::BuildInfo *> availableBuilds(
+ QList<ProjectExplorer::BuildInfo> availableBuilds(
const ProjectExplorer::Target *parent) const override;
- QList<ProjectExplorer::BuildInfo *> availableSetups(const ProjectExplorer::Kit *k,
- const QString &projectPath) const override;
+ QList<ProjectExplorer::BuildInfo> 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<Core::IVersionControl *> versionControls = Core::VcsManager::versionControls();
- QFuture<QList<FileNode *>> 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<QList<FileNode *>> 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<FileNode *> &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<HaskellExecutableAspect>()->setValue(info.buildKey);
+ aspect<HaskellExecutableAspect>()->setValue(info.buildKey);
}
Runnable HaskellRunConfiguration::runnable() const
@@ -90,13 +90,13 @@ Runnable HaskellRunConfiguration::runnable() const
.relativeFilePath(
buildConfiguration->buildDirectory().toString())
+ "\" ";
- const QString executable = extraAspect<HaskellExecutableAspect>()->value();
+ const QString executable = aspect<HaskellExecutableAspect>()->value();
r.commandLineArguments += "exec \"" + executable + "\"";
- const QString arguments = extraAspect<ArgumentsAspect>()->arguments(macroExpander());
+ const QString arguments = aspect<ArgumentsAspect>()->arguments(macroExpander());
if (!arguments.isEmpty())
r.commandLineArguments += " -- " + arguments;
r.workingDirectory = projectDirectory;
- r.environment = extraAspect<LocalEnvironmentAspect>()->environment();
+ r.environment = aspect<LocalEnvironmentAspect>()->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 <projectexplorer/buildconfiguration.h>
+#include <projectexplorer/processparameters.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -68,7 +69,7 @@ StackBuildStep::StackBuildStep(ProjectExplorer::BuildStepList *bsl)
BuildStepConfigWidget *StackBuildStep::createConfigWidget()
{
- return new SimpleBuildStepConfigWidget(this);
+ return new BuildStepConfigWidget(this);
}
QString StackBuildStep::trDisplayName()