mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02: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
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue