Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/launchertasksmodel.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | |||||
143 | 143 | | |||
144 | bool LauncherTasksModel::Private::requestAddLauncherToActivities(const QUrl &_url, const QStringList &_activities) | 144 | bool LauncherTasksModel::Private::requestAddLauncherToActivities(const QUrl &_url, const QStringList &_activities) | ||
145 | { | 145 | { | ||
146 | QUrl url(_url); | 146 | QUrl url(_url); | ||
147 | if (!isValidLauncherUrl(url)) { | 147 | if (!isValidLauncherUrl(url)) { | ||
148 | return false; | 148 | return false; | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | const auto activities = ActivitiesSet::fromList(_activities); | 151 | #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) | ||
152 | const QSet<QString> activities = ActivitiesSet::fromList(_activities); | ||||
153 | #else | ||||
154 | const QSet<QString> activities = QSet<QString>(_activities.begin(), _activities.end()); | ||||
155 | #endif | ||||
152 | 156 | | |||
153 | if (url.isLocalFile() && KDesktopFile::isDesktopFile(url.toLocalFile())) { | 157 | if (url.isLocalFile() && KDesktopFile::isDesktopFile(url.toLocalFile())) { | ||
154 | KDesktopFile f(url.toLocalFile()); | 158 | KDesktopFile f(url.toLocalFile()); | ||
155 | 159 | | |||
156 | const KService::Ptr service = KService::serviceByStorageId(f.fileName()); | 160 | const KService::Ptr service = KService::serviceByStorageId(f.fileName()); | ||
157 | 161 | | |||
158 | // Resolve to non-absolute menuId-based URL if possible. | 162 | // Resolve to non-absolute menuId-based URL if possible. | ||
159 | if (service) { | 163 | if (service) { | ||
▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 Line(s) | 397 | { | |||
399 | QHash<QString, QList<QUrl>> launchersForActivitiesCandidates; | 403 | QHash<QString, QList<QUrl>> launchersForActivitiesCandidates; | ||
400 | for (const auto& serializedLauncher: serializedLaunchers) { | 404 | for (const auto& serializedLauncher: serializedLaunchers) { | ||
401 | QStringList _activities; | 405 | QStringList _activities; | ||
402 | QUrl url; | 406 | QUrl url; | ||
403 | 407 | | |||
404 | std::tie(url, _activities) = | 408 | std::tie(url, _activities) = | ||
405 | deserializeLauncher(serializedLauncher); | 409 | deserializeLauncher(serializedLauncher); | ||
406 | 410 | | |||
411 | #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) | ||||
407 | auto activities = ActivitiesSet::fromList(_activities); | 412 | auto activities = ActivitiesSet::fromList(_activities); | ||
413 | #else | ||||
414 | auto activities = ActivitiesSet(_activities.begin(), _activities.end()); | ||||
415 | #endif | ||||
408 | 416 | | |||
409 | // Is url is not valid, ignore it | 417 | // Is url is not valid, ignore it | ||
410 | if (!isValidLauncherUrl(url)) { | 418 | if (!isValidLauncherUrl(url)) { | ||
411 | continue; | 419 | continue; | ||
412 | } | 420 | } | ||
413 | 421 | | |||
414 | // If we have a null uuid, it means we are on all activities | 422 | // If we have a null uuid, it means we are on all activities | ||
415 | // and we should contain only the null uuid | 423 | // and we should contain only the null uuid | ||
▲ Show 20 Lines • Show All 194 Lines • Show Last 20 Lines |