From 53fb2c48ef472ee74a2a2a47d3a460a0ee74d38b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 28 Sep 2017 13:15:59 +0200 Subject: [PATCH] Qt Core: Remove code for Windows < 7 Change-Id: I919827c6016156af596fd90fc5563445e0ae4228 Reviewed-by: Jake Petroules Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_win.cpp | 4 +--- src/corelib/tools/qcollator_win.cpp | 8 ++------ src/corelib/tools/qlocale_win.cpp | 12 +++--------- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 2bbc4eddd0b..fbbfac26f6e 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -115,9 +115,7 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) dwOpenMode |= PIPE_ACCESS_INBOUND; dwInputBufferSize = dwPipeBufferSize; } - DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT; - if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) - dwPipeFlags |= PIPE_REJECT_REMOTE_CLIENTS; + DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS; hServer = CreateNamedPipe(pipeName, dwOpenMode, dwPipeFlags, diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp index bce896278e6..5a838c1b500 100644 --- a/src/corelib/tools/qcollator_win.cpp +++ b/src/corelib/tools/qcollator_win.cpp @@ -70,12 +70,8 @@ void QCollatorPrivate::init() if (caseSensitivity == Qt::CaseInsensitive) collator |= NORM_IGNORECASE; - if (numericMode) { - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) - collator |= SORT_DIGITSASNUMBERS; - else - qWarning("Numeric sorting unsupported on Windows versions older than Windows 7."); - } + if (numericMode) + collator |= SORT_DIGITSASNUMBERS; if (ignorePunctuation) collator |= NORM_IGNORESYMBOLS; diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index 1d80320d8ee..30aefb71c1f 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -326,9 +326,7 @@ QVariant QSystemLocalePrivate::timeFormat(QLocale::FormatType type) { switch (type) { case QLocale::ShortFormat: - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) - return winToQtFormat(getLocaleInfo(LOCALE_SSHORTTIME)); - // fall through + return winToQtFormat(getLocaleInfo(LOCALE_SSHORTTIME)); case QLocale::LongFormat: return winToQtFormat(getLocaleInfo(LOCALE_STIMEFORMAT)); case QLocale::NarrowFormat: @@ -367,7 +365,7 @@ QVariant QSystemLocalePrivate::dayName(int day, QLocale::FormatType type) if (type == QLocale::LongFormat) return getLocaleInfo(long_day_map[day]); - else if (type == QLocale::NarrowFormat && QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) + else if (type == QLocale::NarrowFormat) return getLocaleInfo(narrow_day_map[day]); return getLocaleInfo(short_day_map[day]); } @@ -425,7 +423,7 @@ QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType t DWORD flags = 0; // keep the same conditional as timeFormat() above - if (type == QLocale::ShortFormat && QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7) + if (type == QLocale::ShortFormat) flags = TIME_NOSECONDS; wchar_t buf[255]; @@ -656,15 +654,11 @@ QVariant QSystemLocalePrivate::uiLanguages() QVariant QSystemLocalePrivate::nativeLanguageName() { - if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7) - return getLocaleInfo(LOCALE_SNATIVELANGNAME); return getLocaleInfo(LOCALE_SNATIVELANGUAGENAME); } QVariant QSystemLocalePrivate::nativeCountryName() { - if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7) - return getLocaleInfo(LOCALE_SNATIVECTRYNAME); return getLocaleInfo(LOCALE_SNATIVECOUNTRYNAME); }