Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/notificationgroupcollapsingproxymodel.cpp
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Line(s) | |||||
194 | { | 194 | { | ||
195 | if (m_limit > 0 && source_parent.isValid()) { | 195 | if (m_limit > 0 && source_parent.isValid()) { | ||
196 | if (!m_expandedGroups.isEmpty() && m_expandedGroups.contains(source_parent)) { | 196 | if (!m_expandedGroups.isEmpty() && m_expandedGroups.contains(source_parent)) { | ||
197 | return true; | 197 | return true; | ||
198 | } | 198 | } | ||
199 | 199 | | |||
200 | if (m_expandUnread && m_lastRead.isValid()) { | 200 | if (m_expandUnread && m_lastRead.isValid()) { | ||
201 | const QModelIndex sourceIdx = sourceModel()->index(source_row, 0, source_parent); | 201 | const QModelIndex sourceIdx = sourceModel()->index(source_row, 0, source_parent); | ||
202 | | ||||
203 | if (!sourceIdx.data(Notifications::ReadRole).toBool()) { | ||||
202 | QDateTime time = sourceIdx.data(Notifications::UpdatedRole).toDateTime(); | 204 | QDateTime time = sourceIdx.data(Notifications::UpdatedRole).toDateTime(); | ||
203 | if (!time.isValid()) { | 205 | if (!time.isValid()) { | ||
204 | time = sourceIdx.data(Notifications::CreatedRole).toDateTime(); | 206 | time = sourceIdx.data(Notifications::CreatedRole).toDateTime(); | ||
205 | } | 207 | } | ||
206 | 208 | | |||
207 | if (time.isValid() && m_lastRead < time) { | 209 | if (time.isValid() && m_lastRead < time) { | ||
208 | return true; | 210 | return true; | ||
209 | } | 211 | } | ||
210 | } | 212 | } | ||
213 | } | ||||
211 | 214 | | |||
212 | // should we raise the limit when there's just one group? | 215 | // should we raise the limit when there's just one group? | ||
213 | 216 | | |||
214 | // FIXME why is this reversed? | 217 | // FIXME why is this reversed? | ||
215 | // grouping proxy model seems to reverse the order? | 218 | // grouping proxy model seems to reverse the order? | ||
216 | return source_row >= sourceModel()->rowCount(source_parent) - m_limit; | 219 | return source_row >= sourceModel()->rowCount(source_parent) - m_limit; | ||
217 | } | 220 | } | ||
218 | 221 | | |||
219 | return true; | 222 | return true; | ||
220 | } | 223 | } |