diff options
Diffstat (limited to 'kxkb/kxkbtraywindow.cpp')
-rw-r--r-- | kxkb/kxkbtraywindow.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kxkb/kxkbtraywindow.cpp b/kxkb/kxkbtraywindow.cpp index da0c7c0b4..4f0359d79 100644 --- a/kxkb/kxkbtraywindow.cpp +++ b/kxkb/kxkbtraywindow.cpp @@ -22,12 +22,17 @@ #include "kxkbtraywindow.h" #include "pixmap.h" #include "rules.h" -#include "kxkbconfig.h" -KxkbSystemTray::KxkbSystemTray() +KxkbSystemTray::KxkbSystemTray(KxkbConfig *kxkbConfig) : KSystemTray(nullptr), m_prevLayoutCount(0) { + m_icoMgr = new LayoutIconManager(kxkbConfig); +} + +KxkbSystemTray::~KxkbSystemTray() +{ + delete m_icoMgr; } void KxkbSystemTray::setToolTip(const TQString& tip) @@ -45,7 +50,7 @@ void KxkbSystemTray::setPixmap(const TQPixmap& pix) void KxkbSystemTray::setCurrentLayout(const LayoutUnit& layoutUnit) { setToolTip(m_descriptionMap[layoutUnit.toPair()]); - setPixmap(LayoutIcon::getInstance().findPixmap(layoutUnit.layout, PIXMAP_STYLE_INDICATOR, layoutUnit.displayName)); + setPixmap(m_icoMgr->find(layoutUnit.layout, PIXMAP_STYLE_INDICATOR, layoutUnit.displayName)); } void KxkbSystemTray::setError(const TQString& layoutInfo) @@ -57,7 +62,7 @@ void KxkbSystemTray::setError(const TQString& layoutInfo) TQString msg = i18n("Error changing keyboard layout to '%1'").arg(layoutInfo); setToolTip(msg); - setPixmap(LayoutIcon::getInstance().findPixmap("error", PIXMAP_STYLE_NORMAL)); + setPixmap(m_icoMgr->find(ERROR_CODE, PIXMAP_STYLE_NORMAL)); } void KxkbSystemTray::initLayoutList(const TQValueList<LayoutUnit>& layouts, const XkbRules& rules) @@ -78,7 +83,7 @@ void KxkbSystemTray::initLayoutList(const TQValueList<LayoutUnit>& layouts, cons const TQString layoutName = (*it).layout; const TQString variantName = (*it).variant; - const TQPixmap& layoutPixmap = LayoutIcon::getInstance().findPixmap((*it).layout, PIXMAP_STYLE_CONTEXTMENU, (*it).displayName); + const TQPixmap& layoutPixmap = m_icoMgr->find((*it).layout, PIXMAP_STYLE_CONTEXTMENU, (*it).displayName); const TQPixmap pix = iconeffect.apply(layoutPixmap, TDEIcon::Small, TDEIcon::DefaultState); TQString fullName = rules.getLayoutName((*it)); |