Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/waylandtasksmodel.cpp
Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Line(s) | 279 | // ); | |||
---|---|---|---|---|---|
307 | 307 | | |||
308 | QObject::connect(window, &KWayland::Client::PlasmaWindow::demandsAttentionChanged, q, | 308 | QObject::connect(window, &KWayland::Client::PlasmaWindow::demandsAttentionChanged, q, | ||
309 | [window, this] { this->dataChanged(window, IsDemandingAttention); } | 309 | [window, this] { this->dataChanged(window, IsDemandingAttention); } | ||
310 | ); | 310 | ); | ||
311 | 311 | | |||
312 | QObject::connect(window, &KWayland::Client::PlasmaWindow::skipTaskbarChanged, q, | 312 | QObject::connect(window, &KWayland::Client::PlasmaWindow::skipTaskbarChanged, q, | ||
313 | [window, this] { this->dataChanged(window, SkipTaskbar); } | 313 | [window, this] { this->dataChanged(window, SkipTaskbar); } | ||
314 | ); | 314 | ); | ||
315 | | ||||
316 | QObject::connect(window, &KWayland::Client::PlasmaWindow::applicationMenuChanged, q, | ||||
317 | [window, this] { | ||||
318 | this->dataChanged(window, QVector<int>{ApplicationMenuServiceName, ApplicationMenuObjectPath}); | ||||
319 | } | ||||
320 | ); | ||||
315 | } | 321 | } | ||
316 | 322 | | |||
317 | AppData WaylandTasksModel::Private::appData(KWayland::Client::PlasmaWindow *window) | 323 | AppData WaylandTasksModel::Private::appData(KWayland::Client::PlasmaWindow *window) | ||
318 | { | 324 | { | ||
319 | const auto &it = appDataCache.constFind(window); | 325 | const auto &it = appDataCache.constFind(window); | ||
320 | 326 | | |||
321 | if (it != appDataCache.constEnd()) { | 327 | if (it != appDataCache.constEnd()) { | ||
322 | return *it; | 328 | return *it; | ||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Line(s) | 388 | { | |||
456 | } else if (role == IsDemandingAttention) { | 462 | } else if (role == IsDemandingAttention) { | ||
457 | return window->isDemandingAttention(); | 463 | return window->isDemandingAttention(); | ||
458 | } else if (role == SkipTaskbar) { | 464 | } else if (role == SkipTaskbar) { | ||
459 | return window->skipTaskbar() || d->appData(window).skipTaskbar; | 465 | return window->skipTaskbar() || d->appData(window).skipTaskbar; | ||
460 | } else if (role == SkipPager) { | 466 | } else if (role == SkipPager) { | ||
461 | // FIXME Implement. | 467 | // FIXME Implement. | ||
462 | } else if (role == AppPid) { | 468 | } else if (role == AppPid) { | ||
463 | return window->pid(); | 469 | return window->pid(); | ||
470 | } else if (role == ApplicationMenuObjectPath) { | ||||
471 | return window->applicationMenuObjectPath(); | ||||
472 | } else if (role == ApplicationMenuServiceName) { | ||||
473 | return window->applicationMenuServiceName(); | ||||
464 | } | 474 | } | ||
465 | 475 | | |||
466 | return QVariant(); | 476 | return QVariant(); | ||
467 | } | 477 | } | ||
468 | 478 | | |||
469 | int WaylandTasksModel::rowCount(const QModelIndex &parent) const | 479 | int WaylandTasksModel::rowCount(const QModelIndex &parent) const | ||
470 | { | 480 | { | ||
471 | return parent.isValid() ? 0 : d->windows.count(); | 481 | return parent.isValid() ? 0 : d->windows.count(); | ||
▲ Show 20 Lines • Show All 297 Lines • Show Last 20 Lines |