From 7d039de7a8da94c59ada808ecc7fd8f86cea3437 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 8 Jan 2018 18:58:34 +0100 Subject: [PATCH] PythonEditor: Fix run configuration This amends commit 53a151074ad37d12e730fbd85ec0e0675d00f6d0. Change-Id: Icf171667b6d03802e0be615c8c7b9491b8d6fd54 Reviewed-by: Orgad Shaneh --- src/plugins/pythoneditor/pythoneditorplugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index e760c250317..e99f83205a5 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; }); }