From c773d85876d7c5ae1ca5fa02adda6fa4da88376a Mon Sep 17 00:00:00 2001 From: varjolintu Date: Tue, 3 Apr 2018 10:37:28 +0300 Subject: [PATCH] Change socket location in macOS to temporary dir --- src/browser/NativeMessagingBase.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/browser/NativeMessagingBase.cpp b/src/browser/NativeMessagingBase.cpp index 64a6df484..4152c1d76 100644 --- a/src/browser/NativeMessagingBase.cpp +++ b/src/browser/NativeMessagingBase.cpp @@ -131,13 +131,11 @@ void NativeMessagingBase::sendReply(const QString& reply) QString NativeMessagingBase::getLocalServerPath() const { -#if defined(Q_OS_WIN) - return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/kpxc_server"; -#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC) +#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; -#else // Q_OS_MAC and others - return "/tmp/kpxc_server"; +#else // Q_OS_MAC, Q_OS_WIN and others + return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/kpxc_server"; #endif }