summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-01-08 18:58:34 +0100
committerhjk <hjk@qt.io>2018-01-11 13:51:50 +0000
commit7d039de7a8da94c59ada808ecc7fd8f86cea3437 (patch)
tree984383dda70f22e9b7c7577ffaa5ae1064b0f713 /src/plugins/pythoneditor
parente75dd28d0c80e7b451241fd749744ccfdab434a7 (diff)
downloadqt-creator-7d039de7a8da94c59ada808ecc7fd8f86cea3437.tar.gz
PythonEditor: Fix run configuration
This amends commit 53a151074ad37d12e730fbd85ec0e0675d00f6d0. Change-Id: Icf171667b6d03802e0be615c8c7b9491b8d6fd54 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/pythoneditor')
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index e760c25031..e99f83205a 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -189,9 +189,16 @@ QVariantMap PythonRunConfiguration::toMap() const
bool PythonRunConfiguration::fromMap(const QVariantMap &map)
{
+ if (!RunConfiguration::fromMap(map))
+ return false;
m_mainScript = map.value(MainScriptKey).toString();
m_interpreter = map.value(InterpreterKey).toString();
- return RunConfiguration::fromMap(map);
+ // FIXME: The following three lines can be removed once there is no id mangling anymore.
+ if (m_mainScript.isEmpty()) {
+ m_mainScript = ProjectExplorer::idFromMap(map).suffixAfter(id());
+ setDefaultDisplayName(defaultDisplayName());
+ }
+ return true;
}
QString PythonRunConfiguration::defaultDisplayName() const
@@ -270,7 +277,6 @@ public:
return Utils::transform(parent->project()->files(Project::AllFiles), [](const FileName &fn) {
BuildTargetInfo bti;
bti.targetName = fn.toString();
- bti.displayName = fn.toString();
return bti;
});
}