Commit 111a2306 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Theme: Remove unused ThemeSettings



Change-Id: I5f3ee8f5afa2ef8618d9a43a10e37a30f771d0af
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 64c552f5
......@@ -120,7 +120,7 @@ void CorePlugin::parseArguments(const QStringList &arguments)
i++;
}
}
const QList<ThemeEntry> availableThemes = ThemeSettings::availableThemes();
const QList<ThemeEntry> 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;
}
......
......@@ -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<ThemeEntry> *themes)
{
static const QLatin1String extension("*.creatortheme");
......@@ -117,7 +83,7 @@ static void addThemesFromPath(const QString &path, QList<ThemeEntry> *themes)
}
}
QList<ThemeEntry> ThemeSettings::availableThemes()
QList<ThemeEntry> ThemeEntry::availableThemes()
{
QList<ThemeEntry> themes;
......
......@@ -49,6 +49,7 @@ public:
Id id() const;
QString displayName() const;
QString filePath() const;
static QList<ThemeEntry> 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<ThemeEntry> availableThemes();
private:
ThemeSettingsWidget *m_widget = 0;
};
} // namespace Internal
} // namespace Core
......
......@@ -143,7 +143,7 @@ ThemeSettingsWidget::~ThemeSettingsWidget()
void ThemeSettingsWidget::refreshThemeList()
{
const QList<ThemeEntry> themes = ThemeSettings::availableThemes();
const QList<ThemeEntry> themes = ThemeEntry::availableThemes();
const int selected = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id,
Id::fromString(creatorTheme()->id())));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment