CppTools: Use fallback project part if project is closed

...instead of sticking to the old one.

If a project is closed, the editor should reflect that. It also simplifies the code.

Change-Id: I9b8a94513d3b06a238cfc4ee60c11c0d0da3d93f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-01-19 11:08:13 +01:00
parent ec3dcfd6ad
commit 07f32ef57a
7 changed files with 44 additions and 47 deletions

View File

@@ -47,7 +47,6 @@ public:
static Ptr get(const QString &filePath);
struct Configuration {
bool stickToPreviousProjectPart = true;
bool usePrecompiledHeaders = false;
QByteArray editorDefines;
ProjectPart::Ptr manuallySetProjectPart;
@@ -95,10 +94,9 @@ protected:
State state() const;
void setState(const State &state);
static ProjectPartInfo determineProjectPart(
const QString &filePath,
static ProjectPartInfo determineProjectPart(const QString &filePath,
const Configuration &config,
const State &state,
const ProjectPartInfo &currentProjectPartInfo,
const ProjectExplorer::Project *activeProject,
Language languagePreference,
bool hasActiveProjectChanged);