forked from qt-creator/qt-creator
Utils: Streamline QtcSettings interface
Change-Id: Icd9592c0fca5df1e52bdafb570665d92deeb70bb Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -655,8 +655,7 @@ void BaseAspect::writeSettings() const
|
|||||||
if (settingsKey().isEmpty())
|
if (settingsKey().isEmpty())
|
||||||
return;
|
return;
|
||||||
QTC_ASSERT(theSettings, return);
|
QTC_ASSERT(theSettings, return);
|
||||||
QtcSettings::setValueWithDefault(theSettings,
|
theSettings->setValueWithDefault(settingsKey(),
|
||||||
settingsKey(),
|
|
||||||
toSettingsValue(variantValue()),
|
toSettingsValue(variantValue()),
|
||||||
toSettingsValue(defaultVariantValue()));
|
toSettingsValue(defaultVariantValue()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public:
|
|||||||
l.append(column);
|
l.append(column);
|
||||||
l.append(width);
|
l.append(width);
|
||||||
}
|
}
|
||||||
QtcSettings::setValueWithDefault(m_settings, ColumnKey, l);
|
m_settings->setValueWithDefault(ColumnKey, l);
|
||||||
m_settings->endGroup();
|
m_settings->endGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ void InfoBar::writeGloballySuppressedToSettings()
|
|||||||
if (!m_settings)
|
if (!m_settings)
|
||||||
return;
|
return;
|
||||||
const QStringList list = transform<QList>(globallySuppressed, &Id::toString);
|
const QStringList list = transform<QList>(globallySuppressed, &Id::toString);
|
||||||
QtcSettings::setValueWithDefault(m_settings, C_SUPPRESSED_WARNINGS, list);
|
m_settings->setValueWithDefault(C_SUPPRESSED_WARNINGS, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -127,10 +127,7 @@ bool MinimizableInfoBars::showInInfoBar(const Id &id) const
|
|||||||
|
|
||||||
void MinimizableInfoBars::setShowInInfoBar(const Id &id, bool show)
|
void MinimizableInfoBars::setShowInInfoBar(const Id &id, bool show)
|
||||||
{
|
{
|
||||||
QtcSettings::setValueWithDefault(InfoBar::settings(),
|
InfoBar::settings()->setValueWithDefault(settingsKey(id), show, kShowInInfoBarDefault);
|
||||||
settingsKey(id),
|
|
||||||
show,
|
|
||||||
kShowInInfoBarDefault);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ namespace Utils {
|
|||||||
\inheaderfile utils/qtcsettings.h
|
\inheaderfile utils/qtcsettings.h
|
||||||
\inmodule QtCreator
|
\inmodule QtCreator
|
||||||
|
|
||||||
\brief The QtcSettings class is an extension of the QSettings class.
|
\brief The QtcSettings class is an extension of the QSettings class
|
||||||
|
the uses Utils::Key instead of QString for keys.
|
||||||
|
|
||||||
Use Utils::QtcSettings::setValueWithDefault() to write values with a
|
Use Utils::QtcSettings::setValueWithDefault() to write values with a
|
||||||
default.
|
default.
|
||||||
@@ -30,6 +31,16 @@ namespace Utils {
|
|||||||
\sa QSettings::setValue()
|
\sa QSettings::setValue()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void QtcSettings::beginGroup(const Key &prefix)
|
||||||
|
{
|
||||||
|
QSettings::beginGroup(stringFromKey(prefix));
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant QtcSettings::value(const Key &key) const
|
||||||
|
{
|
||||||
|
return QSettings::value(stringFromKey(key));
|
||||||
|
}
|
||||||
|
|
||||||
QVariant QtcSettings::value(const Key &key, const QVariant &def) const
|
QVariant QtcSettings::value(const Key &key, const QVariant &def) const
|
||||||
{
|
{
|
||||||
return QSettings::value(stringFromKey(key), def);
|
return QSettings::value(stringFromKey(key), def);
|
||||||
@@ -40,6 +51,16 @@ void QtcSettings::setValue(const Key &key, const QVariant &value)
|
|||||||
QSettings::setValue(stringFromKey(key), mapEntryFromStoreEntry(value));
|
QSettings::setValue(stringFromKey(key), mapEntryFromStoreEntry(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtcSettings::remove(const Key &key)
|
||||||
|
{
|
||||||
|
QSettings::remove(stringFromKey(key));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QtcSettings::contains(const Key &key) const
|
||||||
|
{
|
||||||
|
return QSettings::contains(stringFromKey(key));
|
||||||
|
}
|
||||||
|
|
||||||
KeyList QtcSettings::childKeys() const
|
KeyList QtcSettings::childKeys() const
|
||||||
{
|
{
|
||||||
return keysFromStrings(QSettings::childKeys());
|
return keysFromStrings(QSettings::childKeys());
|
||||||
|
|||||||
@@ -29,48 +29,32 @@ public:
|
|||||||
using QSettings::status;
|
using QSettings::status;
|
||||||
using QSettings::clear;
|
using QSettings::clear;
|
||||||
|
|
||||||
void beginGroup(const Key &prefix) { QSettings::beginGroup(stringFromKey(prefix)); }
|
void beginGroup(const Key &prefix);
|
||||||
|
|
||||||
QVariant value(const Key &key) const { return QSettings::value(stringFromKey(key)); }
|
QVariant value(const Key &key) const;
|
||||||
QVariant value(const Key &key, const QVariant &def) const;
|
QVariant value(const Key &key, const QVariant &def) const;
|
||||||
void setValue(const Key &key, const QVariant &value);
|
void setValue(const Key &key, const QVariant &value);
|
||||||
void remove(const Key &key) { QSettings::remove(stringFromKey(key)); }
|
void remove(const Key &key);
|
||||||
bool contains(const Key &key) const { return QSettings::contains(stringFromKey(key)); }
|
bool contains(const Key &key) const;
|
||||||
|
|
||||||
KeyList childKeys() const;
|
KeyList childKeys() const;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void setValueWithDefault(const Key &key, const T &val, const T &defaultValue)
|
void setValueWithDefault(const Key &key, const T &val, const T &defaultValue)
|
||||||
{
|
|
||||||
setValueWithDefault(this, key, val, defaultValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
static void setValueWithDefault(QtcSettings *settings,
|
|
||||||
const Key &key,
|
|
||||||
const T &val,
|
|
||||||
const T &defaultValue)
|
|
||||||
{
|
{
|
||||||
if (val == defaultValue)
|
if (val == defaultValue)
|
||||||
settings->QSettings::remove(stringFromKey(key));
|
remove(key);
|
||||||
else
|
else
|
||||||
settings->QSettings::setValue(stringFromKey(key), QVariant::fromValue(val));
|
setValue(key, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void setValueWithDefault(const Key &key, const T &val)
|
void setValueWithDefault(const Key &key, const T &val)
|
||||||
{
|
|
||||||
setValueWithDefault(this, key, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
static void setValueWithDefault(QtcSettings *settings, const Key &key, const T &val)
|
|
||||||
{
|
{
|
||||||
if (val == T())
|
if (val == T())
|
||||||
settings->QSettings::remove(stringFromKey(key));
|
remove(key);
|
||||||
else
|
else
|
||||||
settings->QSettings::setValue(stringFromKey(key), QVariant::fromValue(val));
|
setValue(key, val);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,9 @@ QString UnixUtils::fileBrowser(const QtcSettings *settings)
|
|||||||
|
|
||||||
void UnixUtils::setFileBrowser(QtcSettings *settings, const QString &term)
|
void UnixUtils::setFileBrowser(QtcSettings *settings, const QString &term)
|
||||||
{
|
{
|
||||||
QtcSettings::setValueWithDefault(settings, Key("General/FileBrowser"), term, defaultFileBrowser());
|
settings->setValueWithDefault("General/FileBrowser", term, defaultFileBrowser());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString UnixUtils::fileBrowserHelpText()
|
QString UnixUtils::fileBrowserHelpText()
|
||||||
{
|
{
|
||||||
QString help = Tr::tr("<table border=1 cellspacing=0 cellpadding=3>"
|
QString help = Tr::tr("<table border=1 cellspacing=0 cellpadding=3>"
|
||||||
|
|||||||
@@ -54,27 +54,15 @@ void CppFileSettings::toSettings(QtcSettings *s) const
|
|||||||
{
|
{
|
||||||
const CppFileSettings def;
|
const CppFileSettings def;
|
||||||
s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP);
|
s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP);
|
||||||
QtcSettings::setValueWithDefault(s, headerPrefixesKeyC, headerPrefixes, def.headerPrefixes);
|
s->setValueWithDefault(headerPrefixesKeyC, headerPrefixes, def.headerPrefixes);
|
||||||
QtcSettings::setValueWithDefault(s, sourcePrefixesKeyC, sourcePrefixes, def.sourcePrefixes);
|
s->setValueWithDefault(sourcePrefixesKeyC, sourcePrefixes, def.sourcePrefixes);
|
||||||
QtcSettings::setValueWithDefault(s, headerSuffixKeyC, headerSuffix, def.headerSuffix);
|
s->setValueWithDefault(headerSuffixKeyC, headerSuffix, def.headerSuffix);
|
||||||
QtcSettings::setValueWithDefault(s, sourceSuffixKeyC, sourceSuffix, def.sourceSuffix);
|
s->setValueWithDefault(sourceSuffixKeyC, sourceSuffix, def.sourceSuffix);
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(headerSearchPathsKeyC, headerSearchPaths, def.headerSearchPaths);
|
||||||
headerSearchPathsKeyC,
|
s->setValueWithDefault(sourceSearchPathsKeyC, sourceSearchPaths, def.sourceSearchPaths);
|
||||||
headerSearchPaths,
|
s->setValueWithDefault(Constants::LOWERCASE_CPPFILES_KEY, lowerCaseFiles, def.lowerCaseFiles);
|
||||||
def.headerSearchPaths);
|
s->setValueWithDefault(headerPragmaOnceC, headerPragmaOnce, def.headerPragmaOnce);
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(licenseTemplatePathKeyC, licenseTemplatePath, def.licenseTemplatePath);
|
||||||
sourceSearchPathsKeyC,
|
|
||||||
sourceSearchPaths,
|
|
||||||
def.sourceSearchPaths);
|
|
||||||
QtcSettings::setValueWithDefault(s,
|
|
||||||
Constants::LOWERCASE_CPPFILES_KEY,
|
|
||||||
lowerCaseFiles,
|
|
||||||
def.lowerCaseFiles);
|
|
||||||
QtcSettings::setValueWithDefault(s, headerPragmaOnceC, headerPragmaOnce, def.headerPragmaOnce);
|
|
||||||
QtcSettings::setValueWithDefault(s,
|
|
||||||
licenseTemplatePathKeyC,
|
|
||||||
licenseTemplatePath,
|
|
||||||
def.licenseTemplatePath);
|
|
||||||
s->endGroup();
|
s->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ const bool kSyncDefault = false;
|
|||||||
void CppIncludeHierarchyWidget::saveSettings(QtcSettings *settings, int position)
|
void CppIncludeHierarchyWidget::saveSettings(QtcSettings *settings, int position)
|
||||||
{
|
{
|
||||||
const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position));
|
const Key key = keyFromString(QString("IncludeHierarchy.%1.SyncWithEditor").arg(position));
|
||||||
QtcSettings::setValueWithDefault(settings, key, m_toggleSync->isChecked(), kSyncDefault);
|
settings->setValueWithDefault(key, m_toggleSync->isChecked(), kSyncDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppIncludeHierarchyWidget::restoreSettings(QtcSettings *settings, int position)
|
void CppIncludeHierarchyWidget::restoreSettings(QtcSettings *settings, int position)
|
||||||
|
|||||||
@@ -117,75 +117,58 @@ void CppQuickFixSettings::saveSettingsTo(QtcSettings *s)
|
|||||||
{
|
{
|
||||||
CppQuickFixSettings def;
|
CppQuickFixSettings def;
|
||||||
s->beginGroup(Constants::QUICK_FIX_SETTINGS_ID);
|
s->beginGroup(Constants::QUICK_FIX_SETTINGS_ID);
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_OUTSIDE_CLASS_FROM,
|
||||||
Constants::QUICK_FIX_SETTING_GETTER_OUTSIDE_CLASS_FROM,
|
getterOutsideClassFrom,
|
||||||
getterOutsideClassFrom,
|
def.getterOutsideClassFrom);
|
||||||
def.getterOutsideClassFrom);
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_IN_CPP_FILE_FROM,
|
||||||
QtcSettings::setValueWithDefault(s,
|
getterInCppFileFrom,
|
||||||
Constants::QUICK_FIX_SETTING_GETTER_IN_CPP_FILE_FROM,
|
def.getterInCppFileFrom);
|
||||||
getterInCppFileFrom,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_OUTSIDE_CLASS_FROM,
|
||||||
def.getterInCppFileFrom);
|
setterOutsideClassFrom,
|
||||||
QtcSettings::setValueWithDefault(s,
|
def.setterOutsideClassFrom);
|
||||||
Constants::QUICK_FIX_SETTING_SETTER_OUTSIDE_CLASS_FROM,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_IN_CPP_FILE_FROM,
|
||||||
setterOutsideClassFrom,
|
setterInCppFileFrom,
|
||||||
def.setterOutsideClassFrom);
|
def.setterInCppFileFrom);
|
||||||
QtcSettings::setValueWithDefault(s,
|
|
||||||
Constants::QUICK_FIX_SETTING_SETTER_IN_CPP_FILE_FROM,
|
|
||||||
setterInCppFileFrom,
|
|
||||||
def.setterInCppFileFrom);
|
|
||||||
|
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_ATTRIBUTES,
|
||||||
Constants::QUICK_FIX_SETTING_GETTER_ATTRIBUTES,
|
getterAttributes,
|
||||||
getterAttributes,
|
def.getterAttributes);
|
||||||
def.getterAttributes);
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_GETTER_NAME_TEMPLATE,
|
||||||
QtcSettings::setValueWithDefault(s,
|
getterNameTemplate,
|
||||||
Constants::QUICK_FIX_SETTING_GETTER_NAME_TEMPLATE,
|
def.getterNameTemplate);
|
||||||
getterNameTemplate,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_NAME_TEMPLATE,
|
||||||
def.getterNameTemplate);
|
setterNameTemplate,
|
||||||
QtcSettings::setValueWithDefault(s,
|
def.setterNameTemplate);
|
||||||
Constants::QUICK_FIX_SETTING_SETTER_NAME_TEMPLATE,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_RESET_NAME_TEMPLATE,
|
||||||
setterNameTemplate,
|
resetNameTemplate,
|
||||||
def.setterNameTemplate);
|
def.resetNameTemplate);
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SIGNAL_NAME_TEMPLATE,
|
||||||
Constants::QUICK_FIX_SETTING_RESET_NAME_TEMPLATE,
|
signalNameTemplate,
|
||||||
resetNameTemplate,
|
def.signalNameTemplate);
|
||||||
def.resetNameTemplate);
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SIGNAL_WITH_NEW_VALUE,
|
||||||
QtcSettings::setValueWithDefault(s,
|
signalWithNewValue,
|
||||||
Constants::QUICK_FIX_SETTING_SIGNAL_NAME_TEMPLATE,
|
def.signalWithNewValue);
|
||||||
signalNameTemplate,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_CPP_FILE_NAMESPACE_HANDLING,
|
||||||
def.signalNameTemplate);
|
int(cppFileNamespaceHandling),
|
||||||
QtcSettings::setValueWithDefault(s,
|
int(def.cppFileNamespaceHandling));
|
||||||
Constants::QUICK_FIX_SETTING_SIGNAL_WITH_NEW_VALUE,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_MEMBER_VARIABEL_NAME_TEMPLATE,
|
||||||
signalWithNewValue,
|
memberVariableNameTemplate,
|
||||||
def.signalWithNewValue);
|
def.memberVariableNameTemplate);
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_PARAMETER_NAME,
|
||||||
Constants::QUICK_FIX_SETTING_CPP_FILE_NAMESPACE_HANDLING,
|
setterParameterNameTemplate,
|
||||||
int(cppFileNamespaceHandling),
|
def.setterParameterNameTemplate);
|
||||||
int(def.cppFileNamespaceHandling));
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_SETTER_AS_SLOT,
|
||||||
QtcSettings::setValueWithDefault(s,
|
setterAsSlot,
|
||||||
Constants::QUICK_FIX_SETTING_MEMBER_VARIABEL_NAME_TEMPLATE,
|
def.setterAsSlot);
|
||||||
memberVariableNameTemplate,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_USE_AUTO,
|
||||||
def.memberVariableNameTemplate);
|
useAuto,
|
||||||
QtcSettings::setValueWithDefault(s,
|
def.useAuto);
|
||||||
Constants::QUICK_FIX_SETTING_SETTER_PARAMETER_NAME,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_VALUE_TYPES,
|
||||||
setterParameterNameTemplate,
|
valueTypes,
|
||||||
def.setterParameterNameTemplate);
|
def.valueTypes);
|
||||||
QtcSettings::setValueWithDefault(s,
|
s->setValueWithDefault(Constants::QUICK_FIX_SETTING_RETURN_BY_CONST_REF,
|
||||||
Constants::QUICK_FIX_SETTING_SETTER_AS_SLOT,
|
returnByConstRef,
|
||||||
setterAsSlot,
|
def.returnByConstRef);
|
||||||
def.setterAsSlot);
|
|
||||||
QtcSettings::setValueWithDefault(s,
|
|
||||||
Constants::QUICK_FIX_SETTING_USE_AUTO,
|
|
||||||
useAuto,
|
|
||||||
def.useAuto);
|
|
||||||
QtcSettings::setValueWithDefault(s,
|
|
||||||
Constants::QUICK_FIX_SETTING_VALUE_TYPES,
|
|
||||||
valueTypes,
|
|
||||||
def.valueTypes);
|
|
||||||
QtcSettings::setValueWithDefault(s,
|
|
||||||
Constants::QUICK_FIX_SETTING_RETURN_BY_CONST_REF,
|
|
||||||
returnByConstRef,
|
|
||||||
def.returnByConstRef);
|
|
||||||
if (customTemplates == def.customTemplates) {
|
if (customTemplates == def.customTemplates) {
|
||||||
s->remove(Constants::QUICK_FIX_SETTING_CUSTOM_TEMPLATES);
|
s->remove(Constants::QUICK_FIX_SETTING_CUSTOM_TEMPLATES);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ void QbsSettings::loadSettings()
|
|||||||
void QbsSettings::storeSettings() const
|
void QbsSettings::storeSettings() const
|
||||||
{
|
{
|
||||||
QtcSettings * const s = Core::ICore::settings();
|
QtcSettings * const s = Core::ICore::settings();
|
||||||
QtcSettings::setValueWithDefault(s, QBS_EXE_KEY, m_settings.qbsExecutableFilePath.toString(),
|
s->setValueWithDefault(QBS_EXE_KEY, m_settings.qbsExecutableFilePath.toString(),
|
||||||
defaultQbsExecutableFilePath().toString());
|
defaultQbsExecutableFilePath().toString());
|
||||||
s->setValue(QBS_DEFAULT_INSTALL_DIR_KEY, m_settings.defaultInstallDirTemplate);
|
s->setValue(QBS_DEFAULT_INSTALL_DIR_KEY, m_settings.defaultInstallDirTemplate);
|
||||||
s->setValue(USE_CREATOR_SETTINGS_KEY, m_settings.useCreatorSettings);
|
s->setValue(USE_CREATOR_SETTINGS_KEY, m_settings.useCreatorSettings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,27 +135,16 @@ void QmlJsEditingSettings::toSettings(QtcSettings *settings) const
|
|||||||
settings->setValue(USE_QMLLS, m_qmllsSettings.useQmlls);
|
settings->setValue(USE_QMLLS, m_qmllsSettings.useQmlls);
|
||||||
settings->setValue(USE_LATEST_QMLLS, m_qmllsSettings.useLatestQmlls);
|
settings->setValue(USE_LATEST_QMLLS, m_qmllsSettings.useLatestQmlls);
|
||||||
settings->setValue(DISABLE_BUILTIN_CODEMODEL, m_qmllsSettings.disableBuiltinCodemodel);
|
settings->setValue(DISABLE_BUILTIN_CODEMODEL, m_qmllsSettings.disableBuiltinCodemodel);
|
||||||
Utils::QtcSettings::setValueWithDefault(settings, FORMAT_COMMAND, m_formatCommand, {});
|
settings->setValueWithDefault(FORMAT_COMMAND, m_formatCommand, {});
|
||||||
Utils::QtcSettings::setValueWithDefault(settings,
|
settings->setValueWithDefault(FORMAT_COMMAND_OPTIONS, m_formatCommandOptions, {});
|
||||||
FORMAT_COMMAND_OPTIONS,
|
settings->setValueWithDefault(CUSTOM_COMMAND, m_useCustomFormatCommand, false);
|
||||||
m_formatCommandOptions,
|
settings->setValueWithDefault(CUSTOM_ANALYZER, m_useCustomAnalyzer, false);
|
||||||
{});
|
settings->setValueWithDefault(DISABLED_MESSAGES,
|
||||||
Utils::QtcSettings::setValueWithDefault(settings,
|
intListToStringList(Utils::sorted(Utils::toList(m_disabledMessages))),
|
||||||
CUSTOM_COMMAND,
|
defaultDisabledMessagesAsString());
|
||||||
m_useCustomFormatCommand,
|
settings->setValueWithDefault(DISABLED_MESSAGES_NONQUICKUI,
|
||||||
false);
|
intListToStringList(Utils::sorted(Utils::toList(m_disabledMessagesForNonQuickUi))),
|
||||||
Utils::QtcSettings::setValueWithDefault(settings,
|
defaultDisabledNonQuickUiAsString());
|
||||||
CUSTOM_ANALYZER,
|
|
||||||
m_useCustomAnalyzer,
|
|
||||||
false);
|
|
||||||
Utils::QtcSettings::setValueWithDefault(settings,
|
|
||||||
DISABLED_MESSAGES,
|
|
||||||
intListToStringList(Utils::sorted(Utils::toList(m_disabledMessages))),
|
|
||||||
defaultDisabledMessagesAsString());
|
|
||||||
Utils::QtcSettings::setValueWithDefault(settings,
|
|
||||||
DISABLED_MESSAGES_NONQUICKUI,
|
|
||||||
intListToStringList(Utils::sorted(Utils::toList(m_disabledMessagesForNonQuickUi))),
|
|
||||||
defaultDisabledNonQuickUiAsString());
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
QmllsSettingsManager::instance()->checkForChanges();
|
QmllsSettingsManager::instance()->checkForChanges();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,8 @@ FilePath ExamplesWelcomePage::copyToAlternativeLocation(const FilePath &proFile,
|
|||||||
if (code == Copy) {
|
if (code == Copy) {
|
||||||
const QString exampleDirName = projectDir.fileName();
|
const QString exampleDirName = projectDir.fileName();
|
||||||
const FilePath destBaseDir = chooser->filePath();
|
const FilePath destBaseDir = chooser->filePath();
|
||||||
settings->setValueWithDefault(C_FALLBACK_ROOT, destBaseDir, defaultRootDirectory);
|
settings->setValueWithDefault(C_FALLBACK_ROOT, destBaseDir.toSettings(),
|
||||||
|
defaultRootDirectory.toSettings());
|
||||||
const FilePath targetDir = destBaseDir / exampleDirName;
|
const FilePath targetDir = destBaseDir / exampleDirName;
|
||||||
if (targetDir.exists()) {
|
if (targetDir.exists()) {
|
||||||
QMessageBox::warning(ICore::dialogParent(),
|
QMessageBox::warning(ICore::dialogParent(),
|
||||||
|
|||||||
Reference in New Issue
Block a user