From bf5f82ff2761aac5334ba561ab26e242c77d6c3a Mon Sep 17 00:00:00 2001 From: varjolintu Date: Fri, 6 Apr 2018 11:33:17 +0300 Subject: [PATCH] Change Unix socket location --- src/browser/NativeMessagingBase.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/browser/NativeMessagingBase.cpp b/src/browser/NativeMessagingBase.cpp index f2bf3bb3b..ef35705aa 100644 --- a/src/browser/NativeMessagingBase.cpp +++ b/src/browser/NativeMessagingBase.cpp @@ -134,11 +134,12 @@ void NativeMessagingBase::sendReply(const QString& reply) QString NativeMessagingBase::getLocalServerPath() const { + const QString serverPath = "/kpxc_server"; #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - // Use XDG_RUNTIME_DIR instead of /tmp/ if it's available - QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) + "/kpxc_server"; - return path.isEmpty() ? "/tmp/kpxc_server" : path; + // Use XDG_RUNTIME_DIR instead of /tmp if it's available + QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); + return path.isEmpty() ? QStandardPaths::writableLocation(QStandardPaths::TempLocation) + serverPath : path + serverPath; #else // Q_OS_MAC, Q_OS_WIN and others - return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/kpxc_server"; + return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + serverPath; #endif }