Merge pull request #1811 from varjolintu/macos_socket_location

Change socket location in macOS to temporary dir
This commit is contained in:
TheZ3ro 2018-04-04 21:55:19 +02:00 committed by GitHub
commit ea55a2ad29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}