Check actual socket path length rather than InSnap/InFlatpak

This commit is contained in:
Ilya Fedin 2020-10-12 17:17:57 +04:00 committed by John Preston
parent 143b9682a4
commit f58874572d
1 changed files with 7 additions and 2 deletions

View File

@ -799,10 +799,15 @@ QString AppRuntimeDirectory() {
}
QString SingleInstanceLocalServerName(const QString &hash) {
if (InFlatpak() || InSnap()) {
const auto idealSocketPath = AppRuntimeDirectory()
+ hash
+ '-'
+ cGUIDStr();
if (idealSocketPath.size() > 108) {
return AppRuntimeDirectory() + hash;
} else {
return AppRuntimeDirectory() + hash + '-' + cGUIDStr();
return idealSocketPath;
}
}