aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/haskell/haskellrunconfiguration.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-11-27 14:56:45 +0100
committerEike Ziller <eike.ziller@qt.io>2017-12-11 09:24:42 +0000
commita1fd1a7abb54a3d4fbe88268470dc9fdc13668b0 (patch)
tree4e427f0bfb1c5cbf1f9196138588224d7be0aff9 /plugins/haskell/haskellrunconfiguration.cpp
parent6ee714619f6cdd95098c98e86c840ee56b2f07f4 (diff)
Adapt to upstream build config and Utils::Link changes
Change-Id: Ib3f470b1d3df47b90f054ef1e006927b9ee675ca Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'plugins/haskell/haskellrunconfiguration.cpp')
-rw-r--r--plugins/haskell/haskellrunconfiguration.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/haskell/haskellrunconfiguration.cpp b/plugins/haskell/haskellrunconfiguration.cpp
index 9e7b6ff..7b47ff6 100644
--- a/plugins/haskell/haskellrunconfiguration.cpp
+++ b/plugins/haskell/haskellrunconfiguration.cpp
@@ -60,7 +60,7 @@ QList<QString> HaskellRunConfigurationFactory::availableBuildTargets(
}
HaskellRunConfiguration::HaskellRunConfiguration(Target *parent)
- : RunConfiguration(parent)
+ : RunConfiguration(parent, Constants::C_HASKELL_RUNCONFIG_ID_PREFIX)
{
auto argumentAspect = new ArgumentsAspect(this, "Haskell.RunAspect.Arguments");
auto workingDirAspect = new WorkingDirectoryAspect(this, "Haskell.RunAspect.WorkingDirectory");
@@ -108,11 +108,22 @@ Runnable HaskellRunConfiguration::runnable() const
return r;
}
-void HaskellRunConfiguration::initialize(Core::Id id)
+bool HaskellRunConfiguration::fromMap(const QVariantMap &map)
{
- RunConfiguration::initialize(id);
- m_executable = id.suffixAfter(Constants::C_HASKELL_RUNCONFIG_ID_PREFIX);
+ if (!RunConfiguration::fromMap(map))
+ return false;
+ m_executable = map.value(QString(Constants::C_HASKELL_EXECUTABLE_KEY)).toString();
+ if (m_executable.isEmpty())
+ m_executable = ProjectExplorer::idFromMap(map).suffixAfter(id());
setDefaultDisplayName(m_executable);
+ return true;
+}
+
+QVariantMap HaskellRunConfiguration::toMap() const
+{
+ QVariantMap map = RunConfiguration::toMap();
+ map.insert(QString(Constants::C_HASKELL_EXECUTABLE_KEY), m_executable);
+ return map;
}
} // namespace Internal