Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/xwindowtasksmodel.cpp
Show First 20 Lines • Show All 1009 Lines • ▼ Show 20 Line(s) | |||||
1010 | } | 1010 | } | ||
1011 | 1011 | | |||
1012 | void XWindowTasksModel::requestNewInstance(const QModelIndex &index) | 1012 | void XWindowTasksModel::requestNewInstance(const QModelIndex &index) | ||
1013 | { | 1013 | { | ||
1014 | if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) { | 1014 | if (!index.isValid() || index.model() != this || index.row() < 0 || index.row() >= d->windows.count()) { | ||
1015 | return; | 1015 | return; | ||
1016 | } | 1016 | } | ||
1017 | 1017 | | |||
1018 | const AppData &data = d->appData(d->windows.at(index.row())); | 1018 | runApp(d->appData(d->windows.at(index.row()))); | ||
1019 | | ||||
1020 | if (data.url.isValid()) { | | |||
1021 | new KRun(data.url, 0, false, KStartupInfo::createNewStartupIdForTimestamp(QX11Info::appUserTime())); | | |||
1022 | | ||||
1023 | if (!data.id.isEmpty()) { | | |||
1024 | KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + data.id), | | |||
1025 | QStringLiteral("org.kde.libtaskmanager")); | | |||
1026 | } | | |||
1027 | } | | |||
1028 | } | 1019 | } | ||
1029 | 1020 | | |||
1030 | void XWindowTasksModel::requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) | 1021 | void XWindowTasksModel::requestOpenUrls(const QModelIndex &index, const QList<QUrl> &urls) | ||
1031 | { | 1022 | { | ||
1032 | if (!index.isValid() || index.model() != this || index.row() < 0 | 1023 | if (!index.isValid() || index.model() != this || index.row() < 0 | ||
1033 | || index.row() >= d->windows.count() | 1024 | || index.row() >= d->windows.count() | ||
1034 | || urls.isEmpty()) { | 1025 | || urls.isEmpty()) { | ||
1035 | return; | 1026 | return; | ||
▲ Show 20 Lines • Show All 366 Lines • Show Last 20 Lines |