diff options
author | Alessandro Portale <alessandro.portale@theqtcompany.com> | 2016-03-18 11:15:20 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@theqtcompany.com> | 2016-03-18 11:18:17 +0000 |
commit | 3e040d4c3d78b54c484412b69b01d297841a0d52 (patch) | |
tree | d6e96d5274b3ebaa5e02bde0e28fcf0476692001 | |
parent | a0806dedd568903a057189435d6c9c2961c37a92 (diff) | |
download | qt-creator-3e040d4c3d78b54c484412b69b01d297841a0d52.tar.gz |
Core: Use a constant for the default creator theme
Change-Id: I53ba63cf55fb6918d959b0d396175a3188d62bd9
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r-- | src/plugins/coreplugin/coreconstants.h | 1 | ||||
-rw-r--r-- | src/plugins/coreplugin/coreplugin.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/themechooser.cpp | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/coreconstants.h b/src/plugins/coreplugin/coreconstants.h index d54e1f3418..77052130fd 100644 --- a/src/plugins/coreplugin/coreconstants.h +++ b/src/plugins/coreplugin/coreconstants.h @@ -198,6 +198,7 @@ const char SETTINGS_ID_MIMETYPES[] = "E.MimeTypes"; const char SETTINGS_DEFAULTTEXTENCODING[] = "General/DefaultFileEncoding"; const char SETTINGS_THEME[] = "Core/CreatorTheme"; +const char DEFAULT_THEME[] = "default"; const char ALL_FILES_FILTER[] = QT_TRANSLATE_NOOP("Core", "All Files (*)"); diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 383fb197aa..2bd8144939 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -97,7 +97,7 @@ CorePlugin::~CorePlugin() void CorePlugin::parseArguments(const QStringList &arguments) { const Id settingsThemeId = Id::fromSetting(ICore::settings()->value( - QLatin1String(Constants::SETTINGS_THEME), QLatin1String("default"))); + QLatin1String(Constants::SETTINGS_THEME), QLatin1String(Constants::DEFAULT_THEME))); Id themeId = settingsThemeId; QColor overrideColor; bool presentationMode = false; diff --git a/src/plugins/coreplugin/themechooser.cpp b/src/plugins/coreplugin/themechooser.cpp index ffb94438be..82fc65ece4 100644 --- a/src/plugins/coreplugin/themechooser.cpp +++ b/src/plugins/coreplugin/themechooser.cpp @@ -172,7 +172,7 @@ void ThemeChooser::apply() const QString themeId = d->m_themeListModel->themeAt(index).id().toString(); QSettings *settings = ICore::settings(); const QString currentThemeId = settings->value(QLatin1String(Constants::SETTINGS_THEME), - QLatin1String("default")).toString(); + QLatin1String(Constants::DEFAULT_THEME)).toString(); if (currentThemeId != themeId) { QMessageBox::information(ICore::mainWindow(), tr("Restart Required"), tr("The theme change will take effect after a restart of Qt Creator.")); @@ -206,7 +206,7 @@ QList<ThemeEntry> ThemeEntry::availableThemes() qWarning() << "Warning: No themes found in installation: " << QDir::toNativeSeparators(installThemeDir); // move default theme to front - int defaultIndex = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id, Id("default"))); + int defaultIndex = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id, Id(Constants::DEFAULT_THEME))); if (defaultIndex > 0) { // == exists and not at front ThemeEntry defaultEntry = themes.takeAt(defaultIndex); themes.prepend(defaultEntry); |