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