Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/abstracttasksproxymodeliface.cpp
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 183 | { | |||
---|---|---|---|---|---|
188 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | 188 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | ||
189 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | 189 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||
190 | 190 | | |||
191 | if (m) { | 191 | if (m) { | ||
192 | const_cast<AbstractTasksModelIface *>(m)->requestToggleShaded(sourceIndex); | 192 | const_cast<AbstractTasksModelIface *>(m)->requestToggleShaded(sourceIndex); | ||
193 | } | 193 | } | ||
194 | } | 194 | } | ||
195 | 195 | | |||
196 | void AbstractTasksProxyModelIface::requestVirtualDesktop(const QModelIndex &index, qint32 desktop) | 196 | void AbstractTasksProxyModelIface::requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops) | ||
197 | { | 197 | { | ||
198 | if (!index.isValid()) { | 198 | if (!index.isValid()) { | ||
199 | return; | 199 | return; | ||
200 | } | 200 | } | ||
201 | 201 | | |||
202 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | 202 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | ||
203 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | 203 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||
204 | 204 | | |||
205 | if (m) { | 205 | if (m) { | ||
206 | const_cast<AbstractTasksModelIface *>(m)->requestVirtualDesktop(sourceIndex, desktop); | 206 | const_cast<AbstractTasksModelIface *>(m)->requestVirtualDesktops(sourceIndex, desktops); | ||
207 | } | ||||
208 | } | ||||
209 | | ||||
210 | void AbstractTasksProxyModelIface::requestNewVirtualDesktop(const QModelIndex &index) | ||||
211 | { | ||||
212 | if (!index.isValid()) { | ||||
213 | return; | ||||
214 | } | ||||
215 | | ||||
216 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | ||||
anthonyfieroni: mapIfaceToSource and mapToSource returns non-const index i've wonder way it's get as const ref… | |||||
217 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||||
218 | | ||||
219 | if (m) { | ||||
220 | const_cast<AbstractTasksModelIface *>(m)->requestNewVirtualDesktop(sourceIndex); | ||||
207 | } | 221 | } | ||
208 | } | 222 | } | ||
209 | 223 | | |||
210 | void AbstractTasksProxyModelIface::requestActivities(const QModelIndex &index, const QStringList &activities) | 224 | void AbstractTasksProxyModelIface::requestActivities(const QModelIndex &index, const QStringList &activities) | ||
211 | { | 225 | { | ||
212 | if (!index.isValid()) { | 226 | if (!index.isValid()) { | ||
213 | return; | 227 | return; | ||
214 | } | 228 | } | ||
215 | 229 | | |||
216 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | 230 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | ||
217 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | 231 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||
218 | 232 | | |||
219 | if (m) { | 233 | if (m) { | ||
220 | const_cast<AbstractTasksModelIface *>(m)->requestActivities(sourceIndex, activities); | 234 | const_cast<AbstractTasksModelIface *>(m)->requestActivities(sourceIndex, activities); | ||
221 | } | 235 | } | ||
222 | } | 236 | } | ||
223 | 237 | | |||
224 | | ||||
225 | void AbstractTasksProxyModelIface::requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate) | 238 | void AbstractTasksProxyModelIface::requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate) | ||
226 | { | 239 | { | ||
227 | if (!index.isValid()) { | 240 | if (!index.isValid()) { | ||
228 | return; | 241 | return; | ||
229 | } | 242 | } | ||
230 | 243 | | |||
231 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | 244 | const QModelIndex &sourceIndex = mapIfaceToSource(index); | ||
232 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | 245 | const AbstractTasksModelIface *m = dynamic_cast<const AbstractTasksModelIface *>(sourceIndex.model()); | ||
233 | 246 | | |||
234 | if (m) { | 247 | if (m) { | ||
235 | const_cast<AbstractTasksModelIface *>(m)->requestPublishDelegateGeometry(sourceIndex, geometry, delegate); | 248 | const_cast<AbstractTasksModelIface *>(m)->requestPublishDelegateGeometry(sourceIndex, geometry, delegate); | ||
236 | } | 249 | } | ||
237 | } | 250 | } | ||
238 | 251 | | |||
239 | } | 252 | } |
mapIfaceToSource and mapToSource returns non-const index i've wonder way it's get as const ref then performed a const_cast?