Change BrowserShared socket path to group container

This commit is contained in:
Sebastian Livoni 2025-01-27 20:47:43 +01:00
parent 046cb9bd70
commit e55a3f694b
No known key found for this signature in database
GPG Key ID: 827A963A22F2E6B4

View File

@ -53,7 +53,18 @@ namespace BrowserShared
#elif defined(Q_OS_WIN)
// Windows uses named pipes
return serverName + "_" + qgetenv("USERNAME");
#else // Q_OS_MACOS and others
#elif defined(Q_OS_MACOS)
// Get the home directory and append the desired subdirectory
QString homePath = QDir::homePath();
QString subPath = homePath + "/Library/Group Containers/org.keepassxc.KeePassXC";
// Make sure the directory exists
QDir().mkpath(subPath);
QString socketPath = subPath + serverName;
return socketPath;
#else // others
return QStandardPaths::writableLocation(QStandardPaths::TempLocation) + serverName;
#endif
}