diff --git a/kioslave/applications/CMakeLists.txt b/kioslave/applications/CMakeLists.txt --- a/kioslave/applications/CMakeLists.txt +++ b/kioslave/applications/CMakeLists.txt @@ -2,7 +2,7 @@ add_library(kio_applications MODULE kio_applications.cpp) -target_link_libraries(kio_applications KF5::KIOCore KF5::I18n KF5::KDELibs4Support) +target_link_libraries(kio_applications KF5::KIOCore KF5::I18n) install(TARGETS kio_applications DESTINATION ${KDE_INSTALL_PLUGINDIR} ) install( FILES programs.protocol applications.protocol DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) diff --git a/kioslave/applications/kio_applications.cpp b/kioslave/applications/kio_applications.cpp --- a/kioslave/applications/kio_applications.cpp +++ b/kioslave/applications/kio_applications.cpp @@ -23,8 +23,8 @@ #include #include #include -#include -#include + +#include #include class ApplicationsProtocol : public KIO::SlaveBase @@ -64,7 +64,8 @@ entry.insert(KIO::UDSEntry::UDS_ACCESS, 0500); entry.insert(KIO::UDSEntry::UDS_MIME_TYPE, QStringLiteral("application/x-desktop")); entry.insert(KIO::UDSEntry::UDS_SIZE, 0); - entry.insert(KIO::UDSEntry::UDS_LOCAL_PATH, KStandardDirs::locate("apps", service->entryPath())); + const QString localPath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("%1.desktop").arg(service->desktopEntryName())); + entry.insert(KIO::UDSEntry::UDS_LOCAL_PATH, localPath); entry.insert(KIO::UDSEntry::UDS_MODIFICATION_TIME, time(0)); entry.insert(KIO::UDSEntry::UDS_ICON_NAME, service->icon()); } @@ -99,7 +100,8 @@ { KService::Ptr service = KService::serviceByDesktopName(url.fileName()); if (service && service->isValid()) { - QUrl redirUrl(QUrl::fromLocalFile(KStandardDirs::locate("apps", service->entryPath()))); + const QString localPath = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("%1.desktop").arg(service->desktopEntryName())); + QUrl redirUrl(QUrl::fromLocalFile(localPath)); redirection(redirUrl); finished(); } else {