Changeset View
Changeset View
Standalone View
Standalone View
src/client/plasmawindowmodel.cpp
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Line(s) | 50 | { | |||
---|---|---|---|---|---|
151 | 151 | | |||
152 | QObject::connect(window, &PlasmaWindow::virtualDesktopChangeableChanged, q, | 152 | QObject::connect(window, &PlasmaWindow::virtualDesktopChangeableChanged, q, | ||
153 | [window, this] { this->dataChanged(window, IsVirtualDesktopChangeable); } | 153 | [window, this] { this->dataChanged(window, IsVirtualDesktopChangeable); } | ||
154 | ); | 154 | ); | ||
155 | 155 | | |||
156 | QObject::connect(window, &PlasmaWindow::closeableChanged, q, | 156 | QObject::connect(window, &PlasmaWindow::closeableChanged, q, | ||
157 | [window, this] { this->dataChanged(window, IsCloseable); } | 157 | [window, this] { this->dataChanged(window, IsCloseable); } | ||
158 | ); | 158 | ); | ||
159 | | ||||
160 | QObject::connect(window, &PlasmaWindow::geometryChanged, q, | ||||
161 | [window, this] { this->dataChanged(window, Geometry); } | ||||
162 | ); | ||||
159 | } | 163 | } | ||
160 | 164 | | |||
161 | void PlasmaWindowModel::Private::dataChanged(PlasmaWindow *window, int role) | 165 | void PlasmaWindowModel::Private::dataChanged(PlasmaWindow *window, int role) | ||
162 | { | 166 | { | ||
163 | QModelIndex idx = q->index(windows.indexOf(window)); | 167 | QModelIndex idx = q->index(windows.indexOf(window)); | ||
164 | emit q->dataChanged(idx, idx, QVector<int>() << role); | 168 | emit q->dataChanged(idx, idx, QVector<int>() << role); | ||
165 | } | 169 | } | ||
166 | 170 | | |||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 215 | { | |||
254 | } else if (role == IsMovable) { | 258 | } else if (role == IsMovable) { | ||
255 | return window->isMovable(); | 259 | return window->isMovable(); | ||
256 | } else if (role == IsResizable) { | 260 | } else if (role == IsResizable) { | ||
257 | return window->isResizable(); | 261 | return window->isResizable(); | ||
258 | } else if (role == IsVirtualDesktopChangeable) { | 262 | } else if (role == IsVirtualDesktopChangeable) { | ||
259 | return window->isVirtualDesktopChangeable(); | 263 | return window->isVirtualDesktopChangeable(); | ||
260 | } else if (role == IsCloseable) { | 264 | } else if (role == IsCloseable) { | ||
261 | return window->isCloseable(); | 265 | return window->isCloseable(); | ||
266 | } else if (role == Geometry) { | ||||
267 | return window->geometry(); | ||||
262 | } | 268 | } | ||
263 | 269 | | |||
264 | return QVariant(); | 270 | return QVariant(); | ||
265 | } | 271 | } | ||
266 | 272 | | |||
267 | int PlasmaWindowModel::rowCount(const QModelIndex &parent) const | 273 | int PlasmaWindowModel::rowCount(const QModelIndex &parent) const | ||
268 | { | 274 | { | ||
269 | return parent.isValid() ? 0 : d->windows.count(); | 275 | return parent.isValid() ? 0 : d->windows.count(); | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |