Commit 3a95e37d authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Don't create pixmaps for logmode icons

Summary: The icons are specified by name and deal with QIcon all the way. No need to create pixmaps.

Test Plan: Logmode selection in config UI still has icons

Reviewers: #plasma, vmatyushin, rthomsen, davidedmundson

Reviewed By: #plasma, davidedmundson

Maniphest Tasks: T11637

Differential Revision: https://phabricator.kde.org/D26345
parent 94f3c229
...@@ -62,7 +62,7 @@ GeneralConfigurationWidget::GeneralConfigurationWidget() ...@@ -62,7 +62,7 @@ GeneralConfigurationWidget::GeneralConfigurationWidget()
if (logMode->id() == QLatin1String("openLogMode")) if (logMode->id() == QLatin1String("openLogMode"))
continue; continue;
startupLogMode->addItem(QIcon(logMode->icon()), logMode->name(), QVariant(logMode->id())); startupLogMode->addItem(logMode->icon(), logMode->name(), QVariant(logMode->id()));
} }
connect(startupLogMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &GeneralConfigurationWidget::configurationChanged); connect(startupLogMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &GeneralConfigurationWidget::configurationChanged);
......
...@@ -34,7 +34,7 @@ LogMode::LogMode(const QString &id, const QString &name, const QString &iconName ...@@ -34,7 +34,7 @@ LogMode::LogMode(const QString &id, const QString &name, const QString &iconName
{ {
d->id = id; d->id = id;
d->name = name; d->name = name;
d->icon = QIcon::fromTheme(iconName).pixmap(KIconLoader::SizeSmall);; d->icon = QIcon::fromTheme(iconName);
d->logFilesExist = true; d->logFilesExist = true;
} }
...@@ -57,7 +57,7 @@ QString LogMode::name() const ...@@ -57,7 +57,7 @@ QString LogMode::name() const
return d->name; return d->name;
} }
QPixmap LogMode::icon() const QIcon LogMode::icon() const
{ {
return d->icon; return d->icon;
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define LOG_MODE_H #define LOG_MODE_H
#include <QObject> #include <QObject>
#include <QPixmap> #include <QIcon>
#include <QString> #include <QString>
#include <QList> #include <QList>
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
QString iconName; QString iconName;
QPixmap icon; QIcon icon;
QAction *action; QAction *action;
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
QString name() const; QString name() const;
QPixmap icon() const; QIcon icon() const;
QAction *action() const; QAction *action() const;
......
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