From 0c38a27cc0f8646e246eca65fdd6dc6b5c4bb4cc Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Tue, 15 Mar 2022 20:01:55 +0100 Subject: [PATCH] Install servicemenus in new install location Since KIO 5.85, this new file location is preferred over the KServiceTypeTrader results. With this change, single desktop files from the KDE store are installed in the correct location. If however a custom install script is used, developers need to adjust their scripts. Because the "kio/servicemenus" locations is different than the one KAuthorized allows by default, we have to mark the file as executable. Task: https://phabricator.kde.org/T14543 --- .../contextmenu/servicemenuinstaller/servicemenuinstaller.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/settings/contextmenu/servicemenuinstaller/servicemenuinstaller.cpp b/src/settings/contextmenu/servicemenuinstaller/servicemenuinstaller.cpp index 91da3d256e..7f42ee3bd5 100644 --- a/src/settings/contextmenu/servicemenuinstaller/servicemenuinstaller.cpp +++ b/src/settings/contextmenu/servicemenuinstaller/servicemenuinstaller.cpp @@ -50,7 +50,7 @@ Q_NORETURN void fail(const QString &str) QString getServiceMenusDir() { const QString dataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); - return QDir(dataLocation).absoluteFilePath("kservices5/ServiceMenus"); + return QDir(dataLocation).absoluteFilePath("kio/servicemenus"); } #ifdef HAVE_PACKAGEKIT @@ -300,6 +300,8 @@ bool cmdInstall(const QString &archive, QString &errorText) errorText = i18n("Failed to copy .desktop file %1 to %2: %3", archive, dest, source.errorString()); return false; } + QFile destFile(dest); + destFile.setPermissions(destFile.permissions() | QFile::ExeOwner); } else { if (binaryPackages->contains(QMimeDatabase().mimeTypeForFile(archive).name())) { packageKit(PackageOperation::Install, archive);