Changeset 635
- Timestamp:
- Mar 5, 2010, 12:31:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/tools/qlocale.cpp
r623 r635 372 372 static uint default_number_options = 0; 373 373 374 #ifndef QT_NO_SYSTEMLOCALE375 374 static QByteArray envVarLocale() 376 375 { 377 static QByteArray lang = 0;378 #if def Q_OS_UNIX376 ; 377 #if 379 378 lang = qgetenv("LC_ALL"); 379 380 380 if (lang.isNull()) 381 381 lang = qgetenv("LC_NUMERIC"); 382 382 383 if (lang.isNull()) 383 384 #endif … … 386 387 } 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 388 414 389 415 #if defined(Q_OS_WIN) … … 944 970 ** Wrappers for OS/2 locale system functions 945 971 */ 946 947 Q_CORE_EXPORT QString qt_system_locale_name()948 {949 QString locale = QString::fromLatin1(envVarLocale());950 if (locale.isEmpty()) {951 // get the locale from the system country code952 COUNTRYCODE code = { 0, 0 };953 COUNTRYINFO info;954 ULONG actual;955 APIRET arc = DosQueryCtryInfo(sizeof(info), &code, &info, &actual);956 if (arc == NO_ERROR) {957 UniChar localeName[8];958 if (UniMapCtryToLocale(info.country, localeName,959 sizeof(localeName)) == ULS_SUCCESS)960 locale = QString::fromUtf16(localeName);961 }962 }963 964 return locale;965 }966 972 967 973 /*!
Note:
See TracChangeset
for help on using the changeset viewer.