Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/waylandtasksmodel.cpp
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Line(s) | |||||
361 | } | 361 | } | ||
362 | 362 | | |||
363 | void WaylandTasksModel::requestNewInstance(const QModelIndex &index) | 363 | void WaylandTasksModel::requestNewInstance(const QModelIndex &index) | ||
364 | { | 364 | { | ||
365 | if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) { | 365 | if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) { | ||
366 | return; | 366 | return; | ||
367 | } | 367 | } | ||
368 | 368 | | |||
369 | KWayland::Client::PlasmaWindow* window = d->windows.at(index.row()); | 369 | runApp(d->appData(d->windows.at(index.row()))); | ||
370 | | ||||
371 | if (d->appDataCache.contains(window)) { | | |||
372 | const AppData &data = d->appData(window); | | |||
373 | | ||||
374 | new KRun(data.url, 0, false); | | |||
375 | | ||||
376 | if (!data.id.isEmpty()) { | | |||
377 | KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + data.id), | | |||
378 | QStringLiteral("org.kde.libtaskmanager")); | | |||
379 | } | | |||
380 | } | | |||
381 | } | 370 | } | ||
382 | 371 | | |||
383 | void WaylandTasksModel::requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) | 372 | void WaylandTasksModel::requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) | ||
384 | { | 373 | { | ||
385 | if (!index.isValid() || index.model() != this || index.row() < 0 | 374 | if (!index.isValid() || index.model() != this || index.row() < 0 | ||
386 | || index.row() >= d->windows.count() | 375 | || index.row() >= d->windows.count() | ||
387 | || urls.isEmpty()) { | 376 | || urls.isEmpty()) { | ||
388 | return; | 377 | return; | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |