aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmljseditor/qmljseditingsettingspage.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-07-18 14:17:25 +0200
committerEike Ziller <eike.ziller@qt.io>2019-07-19 07:21:26 +0000
commite9272d848b31d603e57bed645ebc580e4ff1aebe (patch)
treee8246dd4709bb5236a6ccbc824599abcd0905d1b /src/plugins/qmljseditor/qmljseditingsettingspage.cpp
parentd20c738919640e38362fbc28958028da1e845bd8 (diff)
QmlJsEditor: Avoid unneeded exports of constants
Change-Id: I332ff9a01963fe4d37dce9ecd0586d8f0fa6573c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmljseditor/qmljseditingsettingspage.cpp')
-rw-r--r--src/plugins/qmljseditor/qmljseditingsettingspage.cpp37
1 files changed, 15 insertions, 22 deletions
diff --git a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp
index 37cd32fa636..4958cfcba53 100644
--- a/src/plugins/qmljseditor/qmljseditingsettingspage.cpp
+++ b/src/plugins/qmljseditor/qmljseditingsettingspage.cpp
@@ -33,6 +33,10 @@
#include <QTextStream>
#include <QCheckBox>
+const char AUTO_FORMAT_ON_SAVE[] = "QmlJSEditor.AutoFormatOnSave";
+const char AUTO_FORMAT_ONLY_CURRENT_PROJECT[] = "QmlJSEditor.AutoFormatOnlyCurrentProject";
+const char QML_CONTEXTPANE_KEY[] = "QmlJSEditor.ContextPaneEnabled";
+const char QML_CONTEXTPANEPIN_KEY[] = "QmlJSEditor.ContextPanePinned";
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
@@ -52,33 +56,22 @@ void QmlJsEditingSettings::set()
void QmlJsEditingSettings::fromSettings(QSettings *settings)
{
- settings->beginGroup(QLatin1String(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML));
- m_enableContextPane = settings->value(
- QLatin1String(QmlJSEditor::Constants::QML_CONTEXTPANE_KEY),
- QVariant(false)).toBool();
- m_pinContextPane = settings->value(
- QLatin1String(QmlJSEditor::Constants::QML_CONTEXTPANEPIN_KEY),
- QVariant(false)).toBool();
- m_autoFormatOnSave = settings->value(
- QLatin1String(QmlJSEditor::Constants::AUTO_FORMAT_ON_SAVE),
- QVariant(false)).toBool();
- m_autoFormatOnlyCurrentProject = settings->value(
- QLatin1String(QmlJSEditor::Constants::AUTO_FORMAT_ONLY_CURRENT_PROJECT),
- QVariant(false)).toBool();
+ settings->beginGroup(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML);
+ m_enableContextPane = settings->value(QML_CONTEXTPANE_KEY, QVariant(false)).toBool();
+ m_pinContextPane = settings->value(QML_CONTEXTPANEPIN_KEY, QVariant(false)).toBool();
+ m_autoFormatOnSave = settings->value(AUTO_FORMAT_ON_SAVE, QVariant(false)).toBool();
+ m_autoFormatOnlyCurrentProject
+ = settings->value(AUTO_FORMAT_ONLY_CURRENT_PROJECT, QVariant(false)).toBool();
settings->endGroup();
}
void QmlJsEditingSettings::toSettings(QSettings *settings) const
{
- settings->beginGroup(QLatin1String(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML));
- settings->setValue(QLatin1String(QmlJSEditor::Constants::QML_CONTEXTPANE_KEY),
- m_enableContextPane);
- settings->setValue(QLatin1String(QmlJSEditor::Constants::QML_CONTEXTPANEPIN_KEY),
- m_pinContextPane);
- settings->setValue(QLatin1String(QmlJSEditor::Constants::AUTO_FORMAT_ON_SAVE),
- m_autoFormatOnSave);
- settings->setValue(QLatin1String(QmlJSEditor::Constants::AUTO_FORMAT_ONLY_CURRENT_PROJECT),
- m_autoFormatOnlyCurrentProject);
+ settings->beginGroup(QmlJSEditor::Constants::SETTINGS_CATEGORY_QML);
+ settings->setValue(QML_CONTEXTPANE_KEY, m_enableContextPane);
+ settings->setValue(QML_CONTEXTPANEPIN_KEY, m_pinContextPane);
+ settings->setValue(AUTO_FORMAT_ON_SAVE, m_autoFormatOnSave);
+ settings->setValue(AUTO_FORMAT_ONLY_CURRENT_PROJECT, m_autoFormatOnlyCurrentProject);
settings->endGroup();
}