diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2011-10-06 19:29:04 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:25:33 +0300 |
commit | 81cc6212c4614959ce7fc4d5c49cd5998e8ffc28 (patch) | |
tree | 5e737a741e61640a9b16e839f20a2898752b8ca4 /qt/main.cpp | |
parent | 74ad0f5ac3a26d39b1c9876cf848989ce91d2ad1 (diff) |
measurement system initialization in Qt.
Diffstat (limited to 'qt/main.cpp')
-rw-r--r-- | qt/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/qt/main.cpp b/qt/main.cpp index cac41f46be..a0726c25d4 100644 --- a/qt/main.cpp +++ b/qt/main.cpp @@ -14,6 +14,7 @@ #include "../std/cstdio.hpp" #include <QtGui/QApplication> +#include <QtCore/QLocale> //#ifdef OMIM_OS_WINDOWS // #include <../src/gui/image/qimageiohandler.h> @@ -85,6 +86,21 @@ int main(int argc, char *argv[]) (void)GetPlatform(); + // checking default measurement system. + + Settings::Units u; + + if (!Settings::Get("Units", u)) + { + // set default measurement from system locale + if (QLocale::system().measurementSystem() == QLocale::MetricSystem) + u = Settings::Metric; + else + u = Settings::Foot; + } + + Settings::Set("Units", u); + // display EULA if needed bool eulaAccepted = false; if (!Settings::Get(SETTING_EULA_ACCEPTED, eulaAccepted) || !eulaAccepted) |