Utils: Use Key more widely in QtcSettings

And adapt user code.

Change-Id: I6efe4ebe6823de4cc862f304a57e041b02c40eac
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-08-30 07:39:54 +02:00
parent 922da1fbb3
commit c7710acadd
35 changed files with 141 additions and 147 deletions

View File

@@ -490,8 +490,8 @@ void ActionManagerPrivate::readUserSettings(Id id, Command *cmd)
void ActionManagerPrivate::saveSettings(Command *cmd)
{
const QString id = cmd->id().toString();
const QString settingsKey = QLatin1String(kKeyboardSettingsKeyV2) + '/' + id;
const Key id = cmd->id().toKey();
const Key settingsKey = kKeyboardSettingsKeyV2 + '/' + id;
const QList<QKeySequence> keys = cmd->keySequences();
const QList<QKeySequence> defaultKeys = cmd->defaultKeySequences();
if (keys != defaultKeys) {

View File

@@ -327,8 +327,8 @@ void NewDialogWidget::showDialog()
{
QModelIndex idx;
QString lastPlatform = ICore::settings()->value(QLatin1String(LAST_PLATFORM_KEY)).toString();
QString lastCategory = ICore::settings()->value(QLatin1String(LAST_CATEGORY_KEY)).toString();
QString lastPlatform = ICore::settings()->value(LAST_PLATFORM_KEY).toString();
QString lastCategory = ICore::settings()->value(LAST_CATEGORY_KEY).toString();
if (!lastPlatform.isEmpty()) {
int index = m_comboBox->findData(lastPlatform);

View File

@@ -861,7 +861,7 @@ void FolderNavigationWidgetFactory::restoreSettings(QtcSettings *settings, int p
{
auto fnw = qobject_cast<FolderNavigationWidget *>(widget);
QTC_ASSERT(fnw, return);
const QString base = kSettingsBase + QString::number(position);
const Key base = kSettingsBase + Key::number(position);
fnw->setHiddenFilesFilter(settings->value(base + kHiddenFilesKey, kHiddenFilesDefault).toBool());
fnw->setAutoSynchronization(settings->value(base + kSyncKey, kAutoSyncDefault).toBool());
fnw->setShowBreadCrumbs(

View File

@@ -263,7 +263,7 @@ QString GeneralSettingsWidget::language()
void GeneralSettingsWidget::setLanguage(const QString &locale)
{
QtcSettings *settings = ICore::settings();
if (settings->value(QLatin1String("General/OverrideLanguage")).toString() != locale) {
if (settings->value("General/OverrideLanguage").toString() != locale) {
RestartDialog dialog(ICore::dialogParent(),
Tr::tr("The language change will take effect after restart."));
dialog.exec();