From 111a230659fa3e147b1e500c916b274cdc30910f Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 11 Jan 2016 22:56:00 +0200 Subject: [PATCH] Theme: Remove unused ThemeSettings Change-Id: I5f3ee8f5afa2ef8618d9a43a10e37a30f771d0af Reviewed-by: Eike Ziller --- src/plugins/coreplugin/coreplugin.cpp | 4 +-- src/plugins/coreplugin/themesettings.cpp | 36 +------------------ src/plugins/coreplugin/themesettings.h | 18 +--------- .../coreplugin/themesettingswidget.cpp | 2 +- 4 files changed, 5 insertions(+), 55 deletions(-) diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 849cfa7b7cb..5c6db94e37e 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -120,7 +120,7 @@ void CorePlugin::parseArguments(const QStringList &arguments) i++; } } - const QList availableThemes = ThemeSettings::availableThemes(); + const QList availableThemes = ThemeEntry::availableThemes(); int themeIndex = Utils::indexOf(availableThemes, Utils::equal(&ThemeEntry::id, themeId)); if (themeIndex < 0) { themeIndex = Utils::indexOf(availableThemes, @@ -151,7 +151,7 @@ void CorePlugin::parseArguments(const QStringList &arguments) bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) { - if (ThemeSettings::availableThemes().isEmpty()) { + if (ThemeEntry::availableThemes().isEmpty()) { *errorMessage = tr("No themes found in installation."); return false; } diff --git a/src/plugins/coreplugin/themesettings.cpp b/src/plugins/coreplugin/themesettings.cpp index a42fc5928a6..7678b4f53c9 100644 --- a/src/plugins/coreplugin/themesettings.cpp +++ b/src/plugins/coreplugin/themesettings.cpp @@ -29,7 +29,6 @@ ****************************************************************************/ #include "themesettings.h" -#include "themesettingswidget.h" #include "coreconstants.h" #include "icore.h" @@ -71,39 +70,6 @@ QString ThemeEntry::filePath() const return m_filePath; } -ThemeSettings::ThemeSettings() -{ - setId(Constants::SETTINGS_ID_INTERFACE); - setDisplayName(tr("Theme")); - setCategory(Constants::SETTINGS_CATEGORY_CORE); - setDisplayCategory(QCoreApplication::translate("Core", Constants::SETTINGS_TR_CATEGORY_CORE)); - setCategoryIcon(QLatin1String(Constants::SETTINGS_CATEGORY_CORE_ICON)); -} - -ThemeSettings::~ThemeSettings() -{ - delete m_widget; -} - -QWidget *ThemeSettings::widget() -{ - if (!m_widget) - m_widget = new ThemeSettingsWidget; - return m_widget; -} - -void ThemeSettings::apply() -{ - if (m_widget) - m_widget->apply(); -} - -void ThemeSettings::finish() -{ - delete m_widget; - m_widget = 0; -} - static void addThemesFromPath(const QString &path, QList *themes) { static const QLatin1String extension("*.creatortheme"); @@ -117,7 +83,7 @@ static void addThemesFromPath(const QString &path, QList *themes) } } -QList ThemeSettings::availableThemes() +QList ThemeEntry::availableThemes() { QList themes; diff --git a/src/plugins/coreplugin/themesettings.h b/src/plugins/coreplugin/themesettings.h index 886bd61140c..36dd9266b4d 100644 --- a/src/plugins/coreplugin/themesettings.h +++ b/src/plugins/coreplugin/themesettings.h @@ -49,6 +49,7 @@ public: Id id() const; QString displayName() const; QString filePath() const; + static QList availableThemes(); private: Id m_id; @@ -56,23 +57,6 @@ private: mutable QString m_displayName; }; -class ThemeSettings : public IOptionsPage -{ - Q_OBJECT - -public: - ThemeSettings(); - ~ThemeSettings(); - - QWidget *widget(); - void apply(); - void finish(); - - static QList availableThemes(); -private: - ThemeSettingsWidget *m_widget = 0; -}; - } // namespace Internal } // namespace Core diff --git a/src/plugins/coreplugin/themesettingswidget.cpp b/src/plugins/coreplugin/themesettingswidget.cpp index 5fce4e9af18..7071708241c 100644 --- a/src/plugins/coreplugin/themesettingswidget.cpp +++ b/src/plugins/coreplugin/themesettingswidget.cpp @@ -143,7 +143,7 @@ ThemeSettingsWidget::~ThemeSettingsWidget() void ThemeSettingsWidget::refreshThemeList() { - const QList themes = ThemeSettings::availableThemes(); + const QList themes = ThemeEntry::availableThemes(); const int selected = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id, Id::fromString(creatorTheme()->id())));