Change socket location in macOS to temporary dir

This commit is contained in:
varjolintu 2018-04-03 10:37:28 +03:00
parent 72bbf12747
commit c773d85876

View File

@ -131,13 +131,11 @@ void NativeMessagingBase::sendReply(const QString& reply)
QString NativeMessagingBase::getLocalServerPath() const QString NativeMessagingBase::getLocalServerPath() const
{ {
#if defined(Q_OS_WIN) #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/kpxc_server";
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
// Use XDG_RUNTIME_DIR instead of /tmp/ if it's available // Use XDG_RUNTIME_DIR instead of /tmp/ if it's available
QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) + "/kpxc_server"; QString path = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) + "/kpxc_server";
return path.isEmpty() ? "/tmp/kpxc_server" : path; return path.isEmpty() ? "/tmp/kpxc_server" : path;
#else // Q_OS_MAC and others #else // Q_OS_MAC, Q_OS_WIN and others
return "/tmp/kpxc_server"; return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/kpxc_server";
#endif #endif
} }