mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Fix encoding problem for detected XDG Download folder (closes #53)
Only affects Linux.
This commit is contained in:
parent
d62554aaba
commit
c7c627015d
@ -445,6 +445,9 @@ QString fsutils::QDesktopServicesDownloadLocation() {
|
|||||||
QString user_dirs_file = config_path + "/user-dirs.dirs";
|
QString user_dirs_file = config_path + "/user-dirs.dirs";
|
||||||
if (QFile::exists(user_dirs_file)) {
|
if (QFile::exists(user_dirs_file)) {
|
||||||
QSettings settings(user_dirs_file, QSettings::IniFormat);
|
QSettings settings(user_dirs_file, QSettings::IniFormat);
|
||||||
|
// We need to force UTF-8 encoding here since this is not
|
||||||
|
// the default for Ini files.
|
||||||
|
settings.setIniCodec("UTF-8");
|
||||||
QString xdg_download_dir = settings.value("XDG_DOWNLOAD_DIR").toString();
|
QString xdg_download_dir = settings.value("XDG_DOWNLOAD_DIR").toString();
|
||||||
if (!xdg_download_dir.isEmpty()) {
|
if (!xdg_download_dir.isEmpty()) {
|
||||||
// Resolve $HOME environment variables
|
// Resolve $HOME environment variables
|
||||||
|
Loading…
Reference in New Issue
Block a user