From 9a9195c8060d904dfad4ad9f51b5575d434a6037 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 30 Jan 2017 14:55:50 +0100 Subject: Make QLocalePrivate::codeTo*() take QStringViews ... and remove now-superfluous overloads. Adapt the sole user of the (QChar*, int) overload to construct a QStringView first, which removes the ugly cast at the call site. Change-Id: Ie5249d4b1b82d471896548e8a7d83c130ae28130 Reviewed-by: Edward Welbourne --- src/corelib/tools/qtimezoneprivate_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qtimezoneprivate_win.cpp') diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp index 16dfaefb74..c6d59be3d8 100644 --- a/src/corelib/tools/qtimezoneprivate_win.cpp +++ b/src/corelib/tools/qtimezoneprivate_win.cpp @@ -386,7 +386,7 @@ static QLocale::Country userCountry() const GEOID id = GetUserGeoID(GEOCLASS_NATION); wchar_t code[3]; const int size = GetGeoInfo(id, GEO_ISO2, code, 3, 0); - return (size == 3) ? QLocalePrivate::codeToCountry(reinterpret_cast(code), size) + return (size == 3) ? QLocalePrivate::codeToCountry(QStringView(code, size)) : QLocale::AnyCountry; } -- cgit v1.2.3