Changeset View
Changeset View
Standalone View
Standalone View
src/client/plasmawindowmodel.cpp
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 50 | { | |||
---|---|---|---|---|---|
134 | 134 | | |||
135 | QObject::connect(window, &PlasmaWindow::shadeableChanged, | 135 | QObject::connect(window, &PlasmaWindow::shadeableChanged, | ||
136 | [window, this] { this->dataChanged(window, IsShadeable); } | 136 | [window, this] { this->dataChanged(window, IsShadeable); } | ||
137 | ); | 137 | ); | ||
138 | 138 | | |||
139 | QObject::connect(window, &PlasmaWindow::shadedChanged, | 139 | QObject::connect(window, &PlasmaWindow::shadedChanged, | ||
140 | [window, this] { this->dataChanged(window, IsShaded); } | 140 | [window, this] { this->dataChanged(window, IsShaded); } | ||
141 | ); | 141 | ); | ||
142 | | ||||
143 | QObject::connect(window, &PlasmaWindow::movableChanged, | ||||
144 | [window, this] { this->dataChanged(window, IsMovable); } | ||||
145 | ); | ||||
146 | | ||||
147 | QObject::connect(window, &PlasmaWindow::resizableChanged, | ||||
148 | [window, this] { this->dataChanged(window, IsResizable); } | ||||
149 | ); | ||||
142 | } | 150 | } | ||
143 | 151 | | |||
144 | void PlasmaWindowModel::Private::dataChanged(PlasmaWindow *window, int role) | 152 | void PlasmaWindowModel::Private::dataChanged(PlasmaWindow *window, int role) | ||
145 | { | 153 | { | ||
146 | QModelIndex idx = q->index(windows.indexOf(window)); | 154 | QModelIndex idx = q->index(windows.indexOf(window)); | ||
147 | emit q->dataChanged(idx, idx, QVector<int>() << role); | 155 | emit q->dataChanged(idx, idx, QVector<int>() << role); | ||
148 | } | 156 | } | ||
149 | 157 | | |||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 203 | { | |||
230 | } else if (role == IsDemandingAttention) { | 238 | } else if (role == IsDemandingAttention) { | ||
231 | return window->isDemandingAttention(); | 239 | return window->isDemandingAttention(); | ||
232 | } else if (role == SkipTaskbar) { | 240 | } else if (role == SkipTaskbar) { | ||
233 | return window->skipTaskbar(); | 241 | return window->skipTaskbar(); | ||
234 | } else if (role == IsShadeable) { | 242 | } else if (role == IsShadeable) { | ||
235 | return window->isShadeable(); | 243 | return window->isShadeable(); | ||
236 | } else if (role == IsShaded) { | 244 | } else if (role == IsShaded) { | ||
237 | return window->isShaded(); | 245 | return window->isShaded(); | ||
246 | } else if (role == IsMovable) { | ||||
247 | return window->isMovable(); | ||||
248 | } else if (role == IsResizable) { | ||||
249 | return window->isResizable(); | ||||
238 | } | 250 | } | ||
239 | 251 | | |||
240 | return QVariant(); | 252 | return QVariant(); | ||
241 | } | 253 | } | ||
242 | 254 | | |||
243 | int PlasmaWindowModel::rowCount(const QModelIndex &parent) const | 255 | int PlasmaWindowModel::rowCount(const QModelIndex &parent) const | ||
244 | { | 256 | { | ||
245 | return parent.isValid() ? 0 : d->windows.count(); | 257 | return parent.isValid() ? 0 : d->windows.count(); | ||
Show All 13 Lines | |||||
259 | 271 | | |||
260 | Q_INVOKABLE void PlasmaWindowModel::requestClose(int row) | 272 | Q_INVOKABLE void PlasmaWindowModel::requestClose(int row) | ||
261 | { | 273 | { | ||
262 | if (row >= 0 && row < d->windows.count()) { | 274 | if (row >= 0 && row < d->windows.count()) { | ||
263 | d->windows.at(row)->requestClose(); | 275 | d->windows.at(row)->requestClose(); | ||
264 | } | 276 | } | ||
265 | } | 277 | } | ||
266 | 278 | | |||
279 | Q_INVOKABLE void PlasmaWindowModel::requestMove(int row) | ||||
280 | { | ||||
281 | if (row >= 0 && row < d->windows.count()) { | ||||
282 | d->windows.at(row)->requestMove(); | ||||
283 | } | ||||
284 | } | ||||
285 | | ||||
286 | Q_INVOKABLE void PlasmaWindowModel::requestResize(int row) | ||||
287 | { | ||||
288 | if (row >= 0 && row < d->windows.count()) { | ||||
289 | d->windows.at(row)->requestResize(); | ||||
290 | } | ||||
291 | } | ||||
292 | | ||||
267 | Q_INVOKABLE void PlasmaWindowModel::requestVirtualDesktop(int row, quint32 desktop) | 293 | Q_INVOKABLE void PlasmaWindowModel::requestVirtualDesktop(int row, quint32 desktop) | ||
268 | { | 294 | { | ||
269 | if (row >= 0 && row < d->windows.count()) { | 295 | if (row >= 0 && row < d->windows.count()) { | ||
270 | d->windows.at(row)->requestVirtualDesktop(desktop); | 296 | d->windows.at(row)->requestVirtualDesktop(desktop); | ||
271 | } | 297 | } | ||
272 | } | 298 | } | ||
273 | 299 | | |||
274 | Q_INVOKABLE void PlasmaWindowModel::requestToggleMinimized(int row) | 300 | Q_INVOKABLE void PlasmaWindowModel::requestToggleMinimized(int row) | ||
Show All 29 Lines |