summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/createdesktopentryoperation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer/createdesktopentryoperation.cpp')
-rw-r--r--src/libs/installer/createdesktopentryoperation.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/installer/createdesktopentryoperation.cpp b/src/libs/installer/createdesktopentryoperation.cpp
index 5907e2f21..1a56c193c 100644
--- a/src/libs/installer/createdesktopentryoperation.cpp
+++ b/src/libs/installer/createdesktopentryoperation.cpp
@@ -30,6 +30,8 @@
#include "errors.h"
#include "fileutils.h"
#include "globals.h"
+#include "adminauthorization.h"
+#include "remoteclient.h"
#include <QDir>
#include <QFile>
@@ -60,7 +62,10 @@ QString CreateDesktopEntryOperation::absoluteFileName()
.split(QLatin1Char(':'),
QString::SkipEmptyParts);
- XDG_DATA_HOME.push_back(QDir::home().absoluteFilePath(QLatin1String(".local/share"))); // default path
+ XDG_DATA_HOME.push_back(QDir::home().absoluteFilePath(QLatin1String(".local/share"))); // default user-specific path
+
+ if (AdminAuthorization::hasAdminRights() || RemoteClient::instance().isActive())
+ XDG_DATA_HOME.push_front(QLatin1String("/usr/local/share")); // default system-wide path
const QStringList directories = XDG_DATA_HOME;
QString directory;