summaryrefslogtreecommitdiffstats
path: root/kxkb/kxkbtraywindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kxkb/kxkbtraywindow.cpp')
-rw-r--r--kxkb/kxkbtraywindow.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/kxkb/kxkbtraywindow.cpp b/kxkb/kxkbtraywindow.cpp
index 0606a4c43..7871f443a 100644
--- a/kxkb/kxkbtraywindow.cpp
+++ b/kxkb/kxkbtraywindow.cpp
@@ -21,12 +21,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)
@@ -44,7 +49,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)
@@ -56,7 +61,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)
@@ -77,7 +82,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));