qlocale_win: return null QVariant on failed look-ups

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 <marten.nordheim@qt.io>
This commit is contained in:
Edward Welbourne 2021-08-06 12:16:10 +02:00
parent 6f833eff92
commit 54b1ed6798

View File

@ -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)