forked from qt-creator/qt-creator
PythonEditor: Do not recreate run configuration if already present
Change-Id: Iac52c846d4b5b0a72cf11decc95489620cae239f Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user