forked from qt-creator/qt-creator
Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace QmlJSTools {
|
||||
|
||||
QmlJSCodeStyleSettings::QmlJSCodeStyleSettings() = default;
|
||||
|
||||
QVariantMap QmlJSCodeStyleSettings::toMap() const
|
||||
Store QmlJSCodeStyleSettings::toMap() const
|
||||
{
|
||||
return {
|
||||
{lineLengthKey, lineLength}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user