Switch to use kiconloader instead of hard-coded path

pull/1/head
Slávek Banko 12 years ago
parent 16361fd6e9
commit 400e114c31

@ -4,7 +4,7 @@ GenericName=Docking utility
Comment=Docks any application into system tray Comment=Docks any application into system tray
Exec=kdocker Exec=kdocker
TryExec=kdocker TryExec=kdocker
Icon=/usr/local/share/kdocker/icons/kdocker.png Icon=kdocker.png
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Application;Utility; Categories=Application;Utility;

@ -29,6 +29,7 @@
#include <qsize.h> #include <qsize.h>
#include <stdlib.h> #include <stdlib.h>
#include <kiconloader.h>
#include <kglobal.h> #include <kglobal.h>
#include <klocale.h> #include <klocale.h>
@ -55,9 +56,7 @@ CustomTrayLabel::CustomTrayLabel(const QStringList& argv, pid_t pid,
*/ */
void CustomTrayLabel::installMenu() void CustomTrayLabel::installMenu()
{ {
QPixmap kdocker_png(QString(ICONS_PATH) + "/kdocker.png"); QPixmap kdocker_png(KGlobal::iconLoader()->loadIcon("kdocker", KIcon::NoGroup, KIcon::SizeSmall));
if (kdocker_png.isNull())
kdocker_png.load(qApp->applicationDirPath() + "/icons/kdocker.png");
setIcon(kdocker_png); setIcon(kdocker_png);
TrayLabelMgr *tlMgr = TrayLabelMgr::instance(); TrayLabelMgr *tlMgr = TrayLabelMgr::instance();

@ -32,6 +32,7 @@
#include "trace.h" #include "trace.h"
#include "qtraylabel.h" #include "qtraylabel.h"
#include <kiconloader.h>
#include <kglobal.h> #include <kglobal.h>
#include <X11/cursorfont.h> #include <X11/cursorfont.h>
@ -620,8 +621,7 @@ void QTrayLabel::handleIconChange(void)
QImage image; QImage image;
if (!window_icon) if (!window_icon)
{ {
if (!image.load(QString(ICONS_PATH) + "/question.png")) image = KGlobal::iconLoader()->loadIcon("question", KIcon::NoGroup, KIcon::SizeMedium);
image.load(qApp->applicationDirPath() + "/icons/question.png");
} }
else image = QPixmap((const char **) window_icon).convertToImage(); else image = QPixmap((const char **) window_icon).convertToImage();
if (window_icon) XpmFree(window_icon); if (window_icon) XpmFree(window_icon);

Loading…
Cancel
Save