Changeset View
Changeset View
Standalone View
Standalone View
src/core/models/statisticsproxymodel.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | 76 | { | |||
---|---|---|---|---|---|
98 | 98 | | |||
99 | QString tipInfo = QStringLiteral( | 99 | QString tipInfo = QStringLiteral( | ||
100 | " <strong>%1</strong>: %2<br>\n" | 100 | " <strong>%1</strong>: %2<br>\n" | ||
101 | " <strong>%3</strong>: %4<br><br>\n" | 101 | " <strong>%3</strong>: %4<br><br>\n" | ||
102 | ).arg(i18n("Total Messages")).arg(collection.statistics().count()) | 102 | ).arg(i18n("Total Messages")).arg(collection.statistics().count()) | ||
103 | .arg(i18n("Unread Messages")).arg(collection.statistics().unreadCount()); | 103 | .arg(i18n("Unread Messages")).arg(collection.statistics().unreadCount()); | ||
104 | 104 | | |||
105 | if (collection.hasAttribute<CollectionQuotaAttribute>()) { | 105 | if (collection.hasAttribute<CollectionQuotaAttribute>()) { | ||
106 | CollectionQuotaAttribute *quota = collection.attribute<CollectionQuotaAttribute>(); | 106 | const CollectionQuotaAttribute *quota = collection.attribute<CollectionQuotaAttribute>(); | ||
107 | if (quota->currentValue() > -1 && quota->maximumValue() > 0) { | 107 | if (quota->currentValue() > -1 && quota->maximumValue() > 0) { | ||
108 | qreal percentage = (100.0 * quota->currentValue()) / quota->maximumValue(); | 108 | qreal percentage = (100.0 * quota->currentValue()) / quota->maximumValue(); | ||
109 | 109 | | |||
110 | if (qAbs(percentage) >= 0.01) { | 110 | if (qAbs(percentage) >= 0.01) { | ||
111 | QString percentStr = QString::number(percentage, 'f', 2); | 111 | QString percentStr = QString::number(percentage, 'f', 2); | ||
112 | tipInfo += QStringLiteral( | 112 | tipInfo += QStringLiteral( | ||
113 | " <strong>%1</strong>: %2%<br>\n" | 113 | " <strong>%1</strong>: %2%<br>\n" | ||
114 | ).arg(i18n("Quota"), percentStr); | 114 | ).arg(i18n("Quota"), percentStr); | ||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |