Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/concatenatetasksproxymodel.cpp
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Line(s) | 211 | { | |||
---|---|---|---|---|---|
218 | 218 | | |||
219 | if (m) { | 219 | if (m) { | ||
220 | // NOTE: KConcatenateRowsProxyModel offers no way to get a non-const pointer | 220 | // NOTE: KConcatenateRowsProxyModel offers no way to get a non-const pointer | ||
221 | // to one of the source models, so we have to go through a mapped index. | 221 | // to one of the source models, so we have to go through a mapped index. | ||
222 | const_cast<AbstractTasksModelIface *>(m)->requestVirtualDesktop(sourceIndex, desktop); | 222 | const_cast<AbstractTasksModelIface *>(m)->requestVirtualDesktop(sourceIndex, desktop); | ||
223 | } | 223 | } | ||
224 | } | 224 | } | ||
225 | 225 | | |||
226 | void ConcatenateTasksProxyModel::requestActivities(const QModelIndex &index, const QStringList &activities) | ||||
227 | { | ||||
228 | if (!index.isValid() || index.model() != this) { | ||||
229 | return; | ||||
230 | } | ||||
231 | | ||||
232 | const QModelIndex &sourceIndex = mapToSource(index); | ||||
233 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||||
234 | | ||||
235 | if (m) { | ||||
236 | // NOTE: KConcatenateRowsProxyModel offers no way to get a non-const pointer | ||||
237 | // to one of the source models, so we have to go through a mapped index. | ||||
238 | const_cast<AbstractTasksModelIface *>(m)->requestActivities(sourceIndex, activities); | ||||
239 | } | ||||
240 | } | ||||
241 | | ||||
242 | | ||||
226 | void ConcatenateTasksProxyModel::requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate) | 243 | void ConcatenateTasksProxyModel::requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate) | ||
227 | { | 244 | { | ||
228 | if (!index.isValid() || index.model() != this) { | 245 | if (!index.isValid() || index.model() != this) { | ||
229 | return; | 246 | return; | ||
230 | } | 247 | } | ||
231 | 248 | | |||
232 | const QModelIndex &sourceIndex = mapToSource(index); | 249 | const QModelIndex &sourceIndex = mapToSource(index); | ||
233 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | 250 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||
Show All 9 Lines |