diff options
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 29f55ad94d..6564f6ffc4 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -312,7 +312,10 @@ public: if (!canHandle(parent)) return false; PythonProject *project = static_cast<PythonProject *>(parent->project()); - return project->files(ProjectExplorer::Project::AllFiles).contains(scriptFromId(id)); + const QString script = scriptFromId(id); + if (script.endsWith(".pyqtc")) + return false; + return project->files(ProjectExplorer::Project::AllFiles).contains(script); } bool canRestore(Target *parent, const QVariantMap &map) const override @@ -560,31 +563,11 @@ Project::RestoreResult PythonProject::fromMap(const QVariantMap &map, QString *e { Project::RestoreResult res = Project::fromMap(map, errorMessage); if (res == RestoreResult::Ok) { + refresh(); + Kit *defaultKit = KitManager::defaultKit(); if (!activeTarget() && defaultKit) addTarget(createTarget(defaultKit)); - - refresh(); - - QList<Target *> targetList = targets(); - foreach (Target *t, targetList) { - const QList<RunConfiguration *> runConfigs = t->runConfigurations(); - foreach (const QString &file, m_files) { - // skip the 'project' file - if (file.endsWith(".pyqtc")) - continue; - const Id id = idFromScript(file); - bool alreadyPresent = false; - foreach (RunConfiguration *runCfg, runConfigs) { - if (runCfg->id() == id) { - alreadyPresent = true; - break; - } - } - if (!alreadyPresent) - t->addRunConfiguration(IRunConfigurationFactory::createHelper<PythonRunConfiguration>(t, id)); - } - } } return res; |