From 45b0f1be686cfba8dcecb9be5c875cae59c69276 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 5 Jun 2020 09:24:37 +0200 Subject: Remove winrt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø --- src/corelib/io/qsettings.cpp | 63 +++----------------------------------------- 1 file changed, 4 insertions(+), 59 deletions(-) (limited to 'src/corelib/io/qsettings.cpp') diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index a15dbb772f..5d84713a67 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -78,19 +78,7 @@ #ifdef Q_OS_WIN // for homedirpath reading from registry # include -# ifndef Q_OS_WINRT -# include -# endif -#endif - -#ifdef Q_OS_WINRT -#include -#include -#include -using namespace Microsoft::WRL; -using namespace Microsoft::WRL::Wrappers; -using namespace ABI::Windows::Foundation; -using namespace ABI::Windows::Storage; +# include #endif #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) @@ -286,7 +274,7 @@ after_loop: return result; } -// see also qsettings_win.cpp, qsettings_winrt.cpp and qsettings_mac.cpp +// see also qsettings_win.cpp and qsettings_mac.cpp #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_WASM) QSettingsPrivate *QSettingsPrivate::create(QSettings::Format format, QSettings::Scope scope, @@ -945,7 +933,7 @@ void QConfFileSettingsPrivate::initAccess() sync(); // loads the files the first time } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) static QString windowsConfigPath(const KNOWNFOLDERID &type) { QString result; @@ -966,44 +954,7 @@ static QString windowsConfigPath(const KNOWNFOLDERID &type) return result; } -#elif defined(Q_OS_WINRT) // Q_OS_WIN && !Q_OS_WINRT - -enum ConfigPathType { - ConfigPath_CommonAppData, - ConfigPath_UserAppData -}; - -static QString windowsConfigPath(ConfigPathType type) -{ - static QString result; - while (result.isEmpty()) { - ComPtr applicationDataStatics; - if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Storage_ApplicationData).Get(), &applicationDataStatics))) - return result; - ComPtr applicationData; - if (FAILED(applicationDataStatics->get_Current(&applicationData))) - return result; - ComPtr localFolder; - if (FAILED(applicationData->get_LocalFolder(&localFolder))) - return result; - ComPtr localFolderItem; - if (FAILED(localFolder.As(&localFolderItem))) - return result; - HString path; - if (FAILED(localFolderItem->get_Path(path.GetAddressOf()))) - return result; - result = QString::fromWCharArray(path.GetRawBuffer(nullptr)); - } - - switch (type) { - case ConfigPath_CommonAppData: - return result + QLatin1String("\\qt-common"); - case ConfigPath_UserAppData: - return result + QLatin1String("\\qt-user"); - } - return result; -} -#endif // Q_OS_WINRT +#endif // Q_OS_WIN static inline int pathHashKey(QSettings::Format format, QSettings::Scope scope) { @@ -1056,14 +1007,8 @@ static std::unique_lock initDefaultPaths(std::unique_lockinsert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), Path(roamingAppDataFolder + QDir::separator(), false)); pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope), -- cgit v1.2.3