Commit 5bb4f5b3 authored by Christian Stenger's avatar Christian Stenger

PythonEditor: Do not recreate run configuration if already present

Change-Id: Iac52c846d4b5b0a72cf11decc95489620cae239f
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 8cbe009c
......@@ -880,8 +880,19 @@ Project::RestoreResult PythonProject::fromMap(const QVariantMap &map, QString *e
QList<Target *> targetList = targets();
foreach (Target *t, targetList) {
foreach (const QString &file, m_files)
t->addRunConfiguration(new PythonRunConfiguration(t, idFromScript(file)));
const QList<RunConfiguration *> runConfigs = t->runConfigurations();
foreach (const QString &file, m_files) {
const Id id = idFromScript(file);
bool alreadyPresent = false;
foreach (RunConfiguration *runCfg, runConfigs) {
if (runCfg->id() == id) {
alreadyPresent = true;
break;
}
}
if (!alreadyPresent)
t->addRunConfiguration(new PythonRunConfiguration(t, id));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment