mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
Use QLocale to identify unit system
Identifying unit system ends up being more complex than just checking language for -US. Some users might use US English, but prefer the metric system. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4688ee8db0
commit
fafffbb8df
1 changed files with 4 additions and 1 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <QStringList>
|
||||
#include <QApplication>
|
||||
#include <QLoggingCategory>
|
||||
#include <QLocale>
|
||||
#include <git2.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
@ -39,7 +40,9 @@ int main(int argc, char **argv)
|
|||
}
|
||||
git_libgit2_init();
|
||||
setup_system_prefs();
|
||||
if (uiLanguage(0).contains("-US"))
|
||||
if (QLocale().measurementSystem() == QLocale::MetricSystem)
|
||||
default_prefs.units = SI_units;
|
||||
else
|
||||
default_prefs.units = IMPERIAL_units;
|
||||
copy_prefs(&default_prefs, &prefs);
|
||||
fill_profile_color();
|
||||
|
|
Loading…
Reference in a new issue