Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/notificationfilterproxymodel.cpp
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | 124 | if (m_whitelistedNotifyRcNames != whitelist) { | |||
---|---|---|---|---|---|
127 | emit whitelistedNotifyRcNamesChanged(); | 127 | emit whitelistedNotifyRcNamesChanged(); | ||
128 | } | 128 | } | ||
129 | } | 129 | } | ||
130 | 130 | | |||
131 | bool NotificationFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const | 131 | bool NotificationFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const | ||
132 | { | 132 | { | ||
133 | const QModelIndex sourceIdx = sourceModel()->index(source_row, 0, source_parent); | 133 | const QModelIndex sourceIdx = sourceModel()->index(source_row, 0, source_parent); | ||
134 | 134 | | |||
135 | if (!m_showExpired && sourceIdx.data(Notifications::ExpiredRole).toBool()) { | 135 | const bool expired = sourceIdx.data(Notifications::ExpiredRole).toBool(); | ||
136 | if (!m_showExpired && expired) { | ||||
137 | return false; | ||||
138 | } | ||||
139 | | ||||
140 | // If the application isn't configurable in any way, it doesn't deserve to be in the history | ||||
141 | // since there's no way for the user to get rid of it there. | ||||
142 | if (expired && !sourceIdx.data(Notifications::ConfigurableRole).toBool() | ||||
143 | // jobs are never configurable so this only applies to notifications | ||||
144 | && sourceIdx.data(Notifications::TypeRole).toInt() == Notifications::NotificationType) { | ||||
136 | return false; | 145 | return false; | ||
137 | } | 146 | } | ||
138 | 147 | | |||
139 | if (!m_showDismissed && sourceIdx.data(Notifications::DismissedRole).toBool()) { | 148 | if (!m_showDismissed && sourceIdx.data(Notifications::DismissedRole).toBool()) { | ||
140 | return false; | 149 | return false; | ||
141 | } | 150 | } | ||
142 | 151 | | |||
143 | // Blacklist takes precedence over whitelist, i.e. when in doubt don't show | 152 | // Blacklist takes precedence over whitelist, i.e. when in doubt don't show | ||
Show All 38 Lines |