From 54b1ed6798d890cb290846ad57767b016ecb2f2f Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 6 Aug 2021 12:16:10 +0200 Subject: qlocale_win: return null QVariant on failed look-ups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Various functions were still returning a null QString wrapped as a QVariant; the caller distinguishes these cases, so should get a null QVariant so it knows the backend failed to answer the query and can attempt whatever fall-back it may have at its disposal. Pick-to: 6.2 Change-Id: I0983b9f3b1026f17c3f13ab92b713bee90be466c Reviewed-by: MÃ¥rten Nordheim --- src/corelib/text/qlocale_win.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/text/qlocale_win.cpp') diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index a73656440f..38f04d686d 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -328,7 +328,7 @@ QVariant QSystemLocalePrivate::timeFormat(QLocale::FormatType type) case QLocale::NarrowFormat: break; } - return QVariant(); + return {}; } QVariant QSystemLocalePrivate::dateTimeFormat(QLocale::FormatType type) @@ -382,7 +382,7 @@ QVariant QSystemLocalePrivate::monthName(int month, QLocale::FormatType type) month -= 1; if (month < 0 || month > 11) - return QString(); + return {}; LCTYPE lctype = (type == QLocale::ShortFormat || type == QLocale::NarrowFormat) ? short_month_map[month] : long_month_map[month]; @@ -404,7 +404,7 @@ QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type) text = substituteDigits(std::move(text)); return text; } - return QString(); + return {}; } QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type) @@ -427,7 +427,7 @@ QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type) text = substituteDigits(std::move(text)); return text; } - return QString(); + return {}; } QVariant QSystemLocalePrivate::toString(const QDateTime &dt, QLocale::FormatType type) -- cgit v1.2.3