ayatana-commits team mailing list archive
-
ayatana-commits team
-
Mailing list archive
-
Message #00187
[Branch ~agateau/plasma-indicatordisplay/trunk] Rev 87: Show count
------------------------------------------------------------
revno: 87
committer: Aurelien Gateau <aurelien.gateau@xxxxxxxxxxxxx>
branch nick: plasma-indicatordisplay
timestamp: Tue 2009-09-15 17:45:44 +0200
message:
Show count
modified:
src/delegate.cpp
--
lp:plasma-indicatordisplay
https://code.launchpad.net/~agateau/plasma-indicatordisplay/trunk
Your team ayatana-commits is subscribed to branch lp:plasma-indicatordisplay.
To unsubscribe from this branch go to https://code.launchpad.net/~agateau/plasma-indicatordisplay/trunk/+edit-subscription.
=== modified file 'src/delegate.cpp'
--- src/delegate.cpp 2009-09-11 10:18:06 +0000
+++ src/delegate.cpp 2009-09-15 15:45:44 +0000
@@ -62,19 +62,6 @@
return QString();
}
-inline int countForIndex(const QModelIndex& index)
-{
- if (!index.parent().isValid()) {
- // Server
- int count = index.data(ListenerModel::IndicatorCountRole).toInt();
- if (count > 0 && !index.model()->hasChildren(index)) {
- // This server has hidden children
- return count;
- }
- }
- return 0;
-}
-
void Delegate::paint(QPainter* painter, const QStyleOptionViewItem& _option, const QModelIndex& index) const
{
QStyleOptionViewItem option = _option;
@@ -94,7 +81,7 @@
if (!timeText.isEmpty()) {
paintTime(painter, option, timeText);
} else {
- int count = countForIndex(index);
+ int count = index.data(ListenerModel::IndicatorCountRole).toInt();
if (count > 0) {
paintCount(painter, option, count);
}