mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-06 23:32:11 +00:00
linux: use $HOME to determine actual user path
As it could be different in confined environments.
This commit is contained in:
parent
0de9c62675
commit
e88c575d4a
@ -293,6 +293,11 @@ void psActivateProcess(uint64 pid) {
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
QString getHomeDir() {
|
QString getHomeDir() {
|
||||||
|
auto home = QDir::homePath();
|
||||||
|
|
||||||
|
if (home != QDir::rootPath())
|
||||||
|
return home + '/';
|
||||||
|
|
||||||
struct passwd *pw = getpwuid(getuid());
|
struct passwd *pw = getpwuid(getuid());
|
||||||
return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (QFile::decodeName(pw->pw_dir) + '/') : QString();
|
return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (QFile::decodeName(pw->pw_dir) + '/') : QString();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user