CppTools: Allow to check whether project code style exists

The calling code can anyways fallback to the global style
without extra help if no project style exists.

It is useful when you want to get the project style if it exists
and understand at the same time that it is not a global one.

Change-Id: I265de3f436f90623385427fc8a1abad09c8c3577
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-11-08 16:21:54 +01:00
parent 1787eef68f
commit 8dc566e902
4 changed files with 19 additions and 11 deletions

View File

@@ -27,6 +27,8 @@
#include "cpptools_global.h"
#include <utils/optional.h>
#include <QVariantMap>
QT_BEGIN_NAMESPACE
@@ -93,7 +95,7 @@ public:
bool operator==(const CppCodeStyleSettings &s) const { return equals(s); }
bool operator!=(const CppCodeStyleSettings &s) const { return !equals(s); }
static CppCodeStyleSettings currentProjectCodeStyle();
static Utils::optional<CppCodeStyleSettings> currentProjectCodeStyle();
static CppCodeStyleSettings currentGlobalCodeStyle();
static TextEditor::TabSettings currentProjectTabSettings();
static TextEditor::TabSettings currentGlobalTabSettings();