Discussion:
[Interest] QDir("~").absoluteFilePath(".mozilla")
Alexander Dyagilev
2018-11-17 03:26:49 UTC
Permalink
Hello,

Linux. How?

It gives me incorrect path of the expected one.

I expect this:

/home/user/.mozilla

It returns me this:

/home/user/Desktop/build-test-Desktop_Qt_5_11_2_GCC_64bit-Debug/bin/~/.mozilla

P.S. I'm new to Linux so sorry for the probably stupid question.
Andy
2018-11-17 03:35:38 UTC
Permalink
"~" is a shell variable (bash/sh/etc), so that won't work here.

What you probably want is QStandardPaths::HomeLocation.

https://doc.qt.io/qt-5/qstandardpaths.html

---
Andy Maloney // https://asmaloney.com
Post by Alexander Dyagilev
Hello,
Linux. How?
It gives me incorrect path of the expected one.
/home/user/.mozilla
/home/user/Desktop/build-test-Desktop_Qt_5_11_2_GCC_64bit-Debug/bin/~/.mozilla
P.S. I'm new to Linux so sorry for the probably stupid question.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
Alexander Dyagilev
2018-11-17 03:39:40 UTC
Permalink
Thanks! I've also found QDir::home().
Post by Andy
"~" is a shell variable (bash/sh/etc), so that won't work here.
What you probably want is QStandardPaths::HomeLocation.
https://doc.qt.io/qt-5/qstandardpaths.html
Loading...