diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-24 00:56:59 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-12-24 00:56:59 +0100 |
commit | f0fbff4c905fd3e21d7aefedd45d98cc9dd54018 (patch) | |
tree | c61f47f858a9ac6183676bd7aee378a6a2b84a19 /src/corelib/tools/qlocale_win.cpp | |
parent | d776937df91e46536f404c6868d64016b6038d7b (diff) | |
parent | 0e1ce36ae67de940b2d499ec7f23e520dce0f112 (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
Diffstat (limited to 'src/corelib/tools/qlocale_win.cpp')
-rw-r--r-- | src/corelib/tools/qlocale_win.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index bbc208e673..885c77c46d 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -102,6 +102,9 @@ static QString winIso3116CtryName(LPWSTR id = LOCALE_NAME_USER_DEFAULT); #ifndef LOCALE_SNATIVECOUNTRYNAME # define LOCALE_SNATIVECOUNTRYNAME 0x00000008 #endif +#ifndef LOCALE_SSHORTTIME +# define LOCALE_SSHORTTIME 0x00000079 +#endif struct QSystemLocalePrivate { @@ -327,7 +330,9 @@ QVariant QSystemLocalePrivate::timeFormat(QLocale::FormatType type) { switch (type) { case QLocale::ShortFormat: - return winToQtFormat(getLocaleInfo(LOCALE_STIMEFORMAT)); //### + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) + return winToQtFormat(getLocaleInfo(LOCALE_SSHORTTIME)); + // fall through case QLocale::LongFormat: return winToQtFormat(getLocaleInfo(LOCALE_STIMEFORMAT)); case QLocale::NarrowFormat: @@ -410,7 +415,7 @@ QVariant QSystemLocalePrivate::toString(const QDate &date, QLocale::FormatType t return QString(); } -QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType) +QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType type) { SYSTEMTIME st; memset(&st, 0, sizeof(SYSTEMTIME)); @@ -420,6 +425,9 @@ QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType) st.wMilliseconds = 0; DWORD flags = 0; + // keep the same conditional as timeFormat() above + if (type == QLocale::ShortFormat && QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) + flags = TIME_NOSECONDS; wchar_t buf[255]; if (getTimeFormat(flags, &st, NULL, buf, 255)) { |