Plugins: A bit more Keys and Store

Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-08-24 16:14:26 +02:00
parent e1e1af36d2
commit 8d0aa34bfc
53 changed files with 243 additions and 239 deletions

View File

@@ -69,11 +69,11 @@ void QmlJSCodeStylePreferences::slotCurrentValueChanged(const QVariant &value)
emit currentCodeStyleSettingsChanged(value.value<QmlJSCodeStyleSettings>());
}
QVariantMap QmlJSCodeStylePreferences::toMap() const
Store QmlJSCodeStylePreferences::toMap() const
{
QVariantMap map = ICodeStylePreferences::toMap();
Store map = ICodeStylePreferences::toMap();
if (!currentDelegate()) {
const QVariantMap dataMap = m_data.toMap();
const Store dataMap = m_data.toMap();
for (auto it = dataMap.begin(), end = dataMap.end(); it != end; ++it)
map.insert(it.key(), it.value());
}

View File

@@ -27,7 +27,7 @@ namespace QmlJSTools {
QmlJSCodeStyleSettings::QmlJSCodeStyleSettings() = default;
QVariantMap QmlJSCodeStyleSettings::toMap() const
Store QmlJSCodeStyleSettings::toMap() const
{
return {
{lineLengthKey, lineLength}

View File

@@ -147,15 +147,15 @@ public:
QmlJSCodeStylePreferences *originalPreferences = QmlJSToolsSettings::globalCodeStyle();
if (originalPreferences->codeStyleSettings() != m_preferences.codeStyleSettings()) {
originalPreferences->setCodeStyleSettings(m_preferences.codeStyleSettings());
originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID));
originalPreferences->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
}
if (originalPreferences->tabSettings() != m_preferences.tabSettings()) {
originalPreferences->setTabSettings(m_preferences.tabSettings());
originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID));
originalPreferences->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
}
if (originalPreferences->currentDelegate() != m_preferences.currentDelegate()) {
originalPreferences->setCurrentDelegate(m_preferences.currentDelegate());
originalPreferences->toSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID));
originalPreferences->toSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
}
}

View File

@@ -68,7 +68,7 @@ QmlJSToolsSettings::QmlJSToolsSettings()
pool->loadCustomCodeStyles();
// load global settings (after built-in settings are added to the pool)
m_globalCodeStyle->fromSettings(QLatin1String(QmlJSTools::Constants::QML_JS_SETTINGS_ID));
m_globalCodeStyle->fromSettings(QmlJSTools::Constants::QML_JS_SETTINGS_ID);
// mimetypes to be handled
TextEditorSettings::registerMimeTypeForLanguageId(Constants::QML_MIMETYPE, Constants::QML_JS_SETTINGS_ID);