summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlocale
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-02-12 18:18:34 (GMT)
commit8911ed8bfe7f918b93c758f9b5d93274b37739e6 (patch)
treef6af60e6cc4cc19d3c0aa3454b8a858ee231ba9f /tests/auto/qlocale
parent15825196f5ba37f27c4a2e877e1c782407faece0 (diff)
downloadQt-8911ed8bfe7f918b93c758f9b5d93274b37739e6.zip
Qt-8911ed8bfe7f918b93c758f9b5d93274b37739e6.tar.gz
Qt-8911ed8bfe7f918b93c758f9b5d93274b37739e6.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). Reviewed-by: Thiago Macieira
Diffstat (limited to 'tests/auto/qlocale')
-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 3dc4dad..8dd5fbb 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());