summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-01-20 13:56:37 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-03-17 20:49:11 (GMT)
commit0d3c62150f2fa2c06f7676336076be4622059cc3 (patch)
tree942db968fe8737631913e15116bb9554f1f22936 /tests/auto
parent41ab4760d0cac439d9dbe26f95cd6327039fbb8e (diff)
downloadQt-0d3c62150f2fa2c06f7676336076be4622059cc3.zip
Qt-0d3c62150f2fa2c06f7676336076be4622059cc3.tar.gz
Qt-0d3c62150f2fa2c06f7676336076be4622059cc3.tar.bz2
Optimized QLocale to access system locale on demand.
Changed the initialization of the system locale to make construction of the QLocale object as lightweight as possible. So now the default contructor just creates a QLocale and QSystemLocale objects, but doesn't try to fill the cache in the latter with data from the system and postpones it until it is actually requested (most applications create QLocale objects on the stack and might not even use the data from the system locale, so we don't need to initialize system locale right away). This is an improved version of an already reverted change 8911ed8bfe7f918b93c758f9b5d93274b37739e6, 8911ed8bfe7f918b93c758f9b5d93274b37739e6 and 8911ed8bfe7f918b93c758f9b5d93274b37739e6. Reviewed-by: Thiago Macieira
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qlocale/tst_qlocale.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qlocale/tst_qlocale.cpp b/tests/auto/qlocale/tst_qlocale.cpp
index 5a87154..9363e4e 100644
--- a/tests/auto/qlocale/tst_qlocale.cpp
+++ b/tests/auto/qlocale/tst_qlocale.cpp
@@ -158,9 +158,15 @@ void tst_QLocale::ctor()
QCoreApplication app(argc, (char**)&argv);
#endif
QLocale default_locale = QLocale::system();
+
+ QVERIFY(!default_locale.monthName(1, QLocale::LongFormat).isEmpty());
+ QVERIFY(!default_locale.monthName(1, QLocale::ShortFormat).isEmpty());
+ QVERIFY(default_locale.language() != 0);
+
QLocale::Language default_lang = default_locale.language();
QLocale::Country default_country = default_locale.country();
+
qDebug("Default: %s/%s", QLocale::languageToString(default_lang).toLatin1().constData(),
QLocale::countryToString(default_country).toLatin1().constData());