summaryrefslogtreecommitdiff
path: root/src/plugins/beautifier/generalsettings.cpp
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2019-04-18 16:13:32 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2019-04-29 12:32:31 +0000
commit1ae98c35954e45a95ce1b76fdcb5120d9377392b (patch)
tree87c19f116398f46a92653b011e81af24c62c38ef /src/plugins/beautifier/generalsettings.cpp
parentde1eed1e11f35af422d78c278cba686d2b2b1567 (diff)
downloadqt-creator-1ae98c35954e45a95ce1b76fdcb5120d9377392b.tar.gz
ClangFormat: Add the interaction with Beautifier
Do not allow ClangFormat plugin to format on file save when the Beautifier has the same checkbox selected. Change-Id: I655d77a888cc444ccb02c4e72f11a93b3ab9bbd5 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/beautifier/generalsettings.cpp')
-rw-r--r--src/plugins/beautifier/generalsettings.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/beautifier/generalsettings.cpp b/src/plugins/beautifier/generalsettings.cpp
index a3018950d1..9546ec5d25 100644
--- a/src/plugins/beautifier/generalsettings.cpp
+++ b/src/plugins/beautifier/generalsettings.cpp
@@ -29,14 +29,13 @@
#include <coreplugin/icore.h>
#include <utils/algorithm.h>
+#include <utils/genericconstants.h>
#include <utils/mimetypes/mimedatabase.h>
namespace Beautifier {
namespace Internal {
namespace {
-const char GROUP[] = "General";
-const char AUTO_FORMAT_ON_SAVE[] = "autoFormatOnSave";
const char AUTO_FORMAT_TOOL[] = "autoFormatTool";
const char AUTO_FORMAT_MIME[] = "autoFormatMime";
const char AUTO_FORMAT_ONLY_CURRENT_PROJECT[] = "autoFormatOnlyCurrentProject";
@@ -50,9 +49,9 @@ GeneralSettings::GeneralSettings()
void GeneralSettings::read()
{
QSettings *s = Core::ICore::settings();
- s->beginGroup(Constants::SETTINGS_GROUP);
- s->beginGroup(GROUP);
- m_autoFormatOnSave = s->value(AUTO_FORMAT_ON_SAVE, false).toBool();
+ s->beginGroup(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP);
+ s->beginGroup(Utils::Constants::BEAUTIFIER_GENERAL_GROUP);
+ m_autoFormatOnSave = s->value(Utils::Constants::BEAUTIFIER_AUTO_FORMAT_ON_SAVE, false).toBool();
m_autoFormatTool = s->value(AUTO_FORMAT_TOOL, QString()).toString();
setAutoFormatMime(s->value(AUTO_FORMAT_MIME, "text/x-c++src;text/x-c++hdr").toString());
m_autoFormatOnlyCurrentProject = s->value(AUTO_FORMAT_ONLY_CURRENT_PROJECT, true).toBool();
@@ -63,9 +62,9 @@ void GeneralSettings::read()
void GeneralSettings::save()
{
QSettings *s = Core::ICore::settings();
- s->beginGroup(Constants::SETTINGS_GROUP);
- s->beginGroup(GROUP);
- s->setValue(AUTO_FORMAT_ON_SAVE, m_autoFormatOnSave);
+ s->beginGroup(Utils::Constants::BEAUTIFIER_SETTINGS_GROUP);
+ s->beginGroup(Utils::Constants::BEAUTIFIER_GENERAL_GROUP);
+ s->setValue(Utils::Constants::BEAUTIFIER_AUTO_FORMAT_ON_SAVE, m_autoFormatOnSave);
s->setValue(AUTO_FORMAT_TOOL, m_autoFormatTool);
s->setValue(AUTO_FORMAT_MIME, autoFormatMimeAsString());
s->setValue(AUTO_FORMAT_ONLY_CURRENT_PROJECT, m_autoFormatOnlyCurrentProject);