ClangTools: Move run settings to projects mode

Make the global run settings available per project in project mode and
thus remove the diagnostic config selection from the
selectable-files-dialog:

 * Extract the classes RunSettings and RunSettingsWidget instead of
   duplicating stuff.
 * Ensure to pick up the old settings
 * Add some convenience buttons/links in projects mode allowing to
   restore the global settings, to open the global settings and to
   navigate (back) to the analyzer mode.

Change-Id: I1b91b6f8e58a87a025774e4643c46e176b2a8885
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-09-13 10:49:14 +02:00
parent bdea56794f
commit 4750969c2b
24 changed files with 630 additions and 508 deletions

View File

@@ -25,7 +25,7 @@
#pragma once
#include <QObject>
#include "clangtoolssettings.h"
#include <coreplugin/id.h>
#include <projectexplorer/project.h>
@@ -70,11 +70,11 @@ public:
ClangToolsProjectSettings(ProjectExplorer::Project *project);
~ClangToolsProjectSettings() override;
bool useGlobalSettings() const;
void setUseGlobalSettings(bool useGlobalSettings);
bool useGlobalSettings() const { return m_useGlobalSettings; }
void setUseGlobalSettings(bool useGlobalSettings) { m_useGlobalSettings = useGlobalSettings; }
Core::Id diagnosticConfig() const;
void setDiagnosticConfig(const Core::Id &diagnosticConfig);
RunSettings runSettings() const { return m_runSettings; }
void setRunSettings(const RunSettings &settings) { m_runSettings = settings; }
QSet<Utils::FilePath> selectedDirs() const { return m_selectedDirs; }
void setSelectedDirs(const QSet<Utils::FilePath> &value) { m_selectedDirs = value; }
@@ -95,10 +95,14 @@ private:
void store();
ProjectExplorer::Project *m_project;
bool m_useGlobalSettings = true;
Core::Id m_diagnosticConfig;
RunSettings m_runSettings;
QSet<Utils::FilePath> m_selectedDirs;
QSet<Utils::FilePath> m_selectedFiles;
SuppressedDiagnosticsList m_suppressedDiagnostics;
};