winphone: Obtain QLocale::uiLanguages properly

The methods are supported on Windows Phone since 8.1 so that the
simplified Windows Phone code isn't needed any more.

Task-number: QTBUG-48140
Change-Id: I21c488fe1a1322e85bbe088fb47e81893fd12d40
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
This commit is contained in:
Oliver Wolff 2015-09-21 14:23:10 +02:00
parent c0c49b8df7
commit d53695501a

View File

@ -51,9 +51,7 @@
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
#ifndef Q_OS_WINPHONE
#include <windows.globalization.h>
#endif
#endif // Q_OS_WINRT
QT_BEGIN_NAMESPACE
@ -639,7 +637,6 @@ QVariant QSystemLocalePrivate::uiLanguages()
return QStringList(QString::fromLatin1(winLangCodeToIsoName(GetUserDefaultUILanguage())));
#else // !Q_OS_WINRT
QStringList result;
#ifndef Q_OS_WINPHONE
ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> appLanguagesStatics;
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), &appLanguagesStatics))) {
qWarning("Could not obtain ApplicationLanguagesStatic");
@ -661,9 +658,6 @@ QVariant QSystemLocalePrivate::uiLanguages()
PCWSTR rawString = language.GetRawBuffer(&length);
result << QString::fromWCharArray(rawString, length);
}
#else // !Q_OS_WINPHONE
result << QString::fromWCharArray(lcName);
#endif // Q_OS_WINPHONE
return result;
#endif // Q_OS_WINRT