Changeset View
Changeset View
Standalone View
Standalone View
libnotificationmanager/jobsmodel.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 94 | { | |||
---|---|---|---|---|---|
131 | case Notifications::TimeoutRole: | 131 | case Notifications::TimeoutRole: | ||
132 | return job->state() == Notifications::JobStateStopped && !job->error() ? -1 : 0; | 132 | return job->state() == Notifications::JobStateStopped && !job->error() ? -1 : 0; | ||
133 | case Notifications::ClosableRole: | 133 | case Notifications::ClosableRole: | ||
134 | return job->state() == Notifications::JobStateStopped; | 134 | return job->state() == Notifications::JobStateStopped; | ||
135 | 135 | | |||
136 | case Notifications::ConfigurableRole: return false; | 136 | case Notifications::ConfigurableRole: return false; | ||
137 | case Notifications::ExpiredRole: return job->expired(); | 137 | case Notifications::ExpiredRole: return job->expired(); | ||
138 | case Notifications::DismissedRole: return job->dismissed(); | 138 | case Notifications::DismissedRole: return job->dismissed(); | ||
139 | | ||||
140 | // A job is usually either a long lasting operation you're aware about | ||||
141 | // or a quick job you don't care about. | ||||
142 | // When it's running, it's there, when it failed, it's persistent. | ||||
143 | // There's hardly a reason why it should show up as "unread". | ||||
144 | case Notifications::ReadRole: return true; | ||||
139 | } | 145 | } | ||
140 | 146 | | |||
141 | return QVariant(); | 147 | return QVariant(); | ||
142 | } | 148 | } | ||
143 | 149 | | |||
144 | bool JobsModel::setData(const QModelIndex &index, const QVariant &value, int role) | 150 | bool JobsModel::setData(const QModelIndex &index, const QVariant &value, int role) | ||
145 | { | 151 | { | ||
146 | if (!checkIndex(index)) { | 152 | if (!checkIndex(index)) { | ||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |