mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 04:49:47 -07:00
Specify a locale if none is set
Sometimes users had not properly configured their system locale and thus qbt will specify a default locale just in case. Closes #16127. Closes #19609. Closes #19834. PR #20203.
This commit is contained in:
parent
293a2efca7
commit
fc56fdade7
1 changed files with 9 additions and 0 deletions
|
@ -163,6 +163,14 @@ namespace
|
||||||
limit.rlim_cur = limit.rlim_max;
|
limit.rlim_cur = limit.rlim_max;
|
||||||
setrlimit(RLIMIT_NOFILE, &limit);
|
setrlimit(RLIMIT_NOFILE, &limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void adjustLocale()
|
||||||
|
{
|
||||||
|
// specify the default locale just in case if user has not set any other locale
|
||||||
|
// only `C` locale is available universally without installing locale packages
|
||||||
|
if (qEnvironmentVariableIsEmpty("LANG"))
|
||||||
|
qputenv("LANG", "C.UTF-8");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,6 +182,7 @@ int main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
|
adjustLocale();
|
||||||
adjustFileDescriptorLimit();
|
adjustFileDescriptorLimit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue