Changeset View
Changeset View
Standalone View
Standalone View
krusader/ActionMan/useractionlistview.cpp
Show All 20 Lines | |||||
21 | #include "useractionlistview.h" | 21 | #include "useractionlistview.h" | ||
22 | 22 | | |||
23 | // QtCore | 23 | // QtCore | ||
24 | #include <QDebug> | 24 | #include <QDebug> | ||
25 | // QtXml | 25 | // QtXml | ||
26 | #include <QDomEntity> | 26 | #include <QDomEntity> | ||
27 | 27 | | |||
28 | #include <KI18n/KLocalizedString> | 28 | #include <KI18n/KLocalizedString> | ||
29 | #include <KIconThemes/KIconLoader> | | |||
30 | 29 | | |||
31 | #include "../krglobal.h" | 30 | #include "../krglobal.h" | ||
31 | #include "../icon.h" | ||||
32 | #include "../UserAction/kraction.h" | 32 | #include "../UserAction/kraction.h" | ||
33 | #include "../UserAction/useraction.h" | 33 | #include "../UserAction/useraction.h" | ||
34 | 34 | | |||
35 | #define COL_TITLE 0 | 35 | #define COL_TITLE 0 | ||
36 | 36 | | |||
37 | // UserActionListView | 37 | // UserActionListView | ||
38 | 38 | | |||
39 | UserActionListView::UserActionListView(QWidget * parent) | 39 | UserActionListView::UserActionListView(QWidget * parent) | ||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | |||||
234 | } | 234 | } | ||
235 | 235 | | |||
236 | void UserActionListViewItem::update() | 236 | void UserActionListViewItem::update() | ||
237 | { | 237 | { | ||
238 | if (! _action) | 238 | if (! _action) | ||
239 | return; | 239 | return; | ||
240 | 240 | | |||
241 | if (! _action->icon().isNull()) | 241 | if (! _action->icon().isNull()) | ||
242 | setIcon(COL_TITLE, KIconLoader::global()->loadIcon(_action->iconName(), KIconLoader::Small)); | 242 | setIcon(COL_TITLE, Icon(_action->iconName())); | ||
243 | setText(COL_TITLE, _action->text()); | 243 | setText(COL_TITLE, _action->text()); | ||
244 | } | 244 | } | ||
245 | 245 | | |||
246 | bool UserActionListViewItem::operator<(const QTreeWidgetItem &other) const | 246 | bool UserActionListViewItem::operator<(const QTreeWidgetItem &other) const | ||
247 | { | 247 | { | ||
248 | // FIXME some how this only produces bullshit :-/ | 248 | // FIXME some how this only produces bullshit :-/ | ||
249 | // if ( i->text( COL_NAME ).isEmpty() ) { // categories only have titles | 249 | // if ( i->text( COL_NAME ).isEmpty() ) { // categories only have titles | ||
250 | // //qDebug() << "this->title: " << text(COL_TITLE) << " |=| i->title: " << i->text(COL_TITLE); | 250 | // //qDebug() << "this->title: " << text(COL_TITLE) << " |=| i->title: " << i->text(COL_TITLE); | ||
251 | // return ( ascending ? -1 : 1 ); // <0 means this is smaller then i | 251 | // return ( ascending ? -1 : 1 ); // <0 means this is smaller then i | ||
252 | // } | 252 | // } | ||
253 | // else | 253 | // else | ||
254 | return QTreeWidgetItem::operator<(other); | 254 | return QTreeWidgetItem::operator<(other); | ||
255 | } | 255 | } |