Changeset View
Changeset View
Standalone View
Standalone View
src/lib/logLevel.cpp
Show All 23 Lines | |||||
24 | #include <kiconloader.h> | 24 | #include <kiconloader.h> | ||
25 | #include <QIcon> | 25 | #include <QIcon> | ||
26 | class LogLevelPrivate | 26 | class LogLevelPrivate | ||
27 | { | 27 | { | ||
28 | public: | 28 | public: | ||
29 | int id; | 29 | int id; | ||
30 | QString name; | 30 | QString name; | ||
31 | 31 | | |||
32 | QString icon; | | |||
33 | | ||||
34 | QColor color; | 32 | QColor color; | ||
35 | 33 | | |||
36 | QPixmap pixmap; | 34 | QIcon icon; | ||
37 | }; | 35 | }; | ||
38 | 36 | | |||
39 | LogLevel::LogLevel(int id, const QString &nm, const QString &ic, const QColor &col, QObject *parent) | 37 | LogLevel::LogLevel(int id, const QString &nm, const QString &ic, const QColor &col, QObject *parent) | ||
40 | : QObject(parent), d(new LogLevelPrivate()) | 38 | : QObject(parent), d(new LogLevelPrivate()) | ||
41 | { | 39 | { | ||
42 | d->id = id; | 40 | d->id = id; | ||
43 | d->name = nm; | 41 | d->name = nm; | ||
44 | d->icon = ic; | | |||
45 | d->color = col; | 42 | d->color = col; | ||
46 | d->pixmap = QIcon::fromTheme(ic).pixmap(KIconLoader::SizeSmall); | 43 | d->icon = QIcon::fromTheme(ic); | ||
47 | } | 44 | } | ||
48 | 45 | | |||
49 | LogLevel::~LogLevel() | 46 | LogLevel::~LogLevel() | ||
50 | { | 47 | { | ||
51 | delete d; | 48 | delete d; | ||
52 | } | 49 | } | ||
53 | 50 | | |||
54 | int LogLevel::id() const | 51 | int LogLevel::id() const | ||
55 | { | 52 | { | ||
56 | return d->id; | 53 | return d->id; | ||
57 | } | 54 | } | ||
58 | 55 | | |||
59 | QString LogLevel::name() const | 56 | QString LogLevel::name() const | ||
60 | { | 57 | { | ||
61 | return d->name; | 58 | return d->name; | ||
62 | } | 59 | } | ||
63 | 60 | | |||
64 | QString LogLevel::icon() const | | |||
65 | { | | |||
66 | return d->icon; | | |||
67 | } | | |||
68 | | ||||
69 | QColor LogLevel::color() const | 61 | QColor LogLevel::color() const | ||
70 | { | 62 | { | ||
71 | return d->color; | 63 | return d->color; | ||
72 | } | 64 | } | ||
73 | 65 | | |||
74 | QPixmap LogLevel::pixmap() const | 66 | QIcon LogLevel::icon() const | ||
75 | { | 67 | { | ||
76 | return d->pixmap; | 68 | return d->icon; | ||
77 | } | 69 | } |