mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Windows: Fix compile issues after build system changed to cmake.
Differential Revision: https://phabricator.kde.org/D8079
This commit is contained in:
parent
75bd63ff2d
commit
ebd8dd051e
@ -81,7 +81,28 @@ endif()
|
||||
if (WIN32)
|
||||
add_definitions(-DW7API)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS WinExtras)
|
||||
# TODO set var for LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib ?
|
||||
|
||||
# taken from https://stackoverflow.com/a/40217291
|
||||
macro(get_WIN32_WINNT version)
|
||||
if (CMAKE_SYSTEM_VERSION)
|
||||
set(ver ${CMAKE_SYSTEM_VERSION})
|
||||
string(REGEX MATCH "^([0-9]+).([0-9])" ver ${ver})
|
||||
string(REGEX MATCH "^([0-9]+)" verMajor ${ver})
|
||||
# Check for Windows 10, b/c we'll need to convert to hex 'A'.
|
||||
if ("${verMajor}" MATCHES "10")
|
||||
set(verMajor "A")
|
||||
string(REGEX REPLACE "^([0-9]+)" ${verMajor} ver ${ver})
|
||||
endif ("${verMajor}" MATCHES "10")
|
||||
# Remove all remaining '.' characters.
|
||||
string(REPLACE "." "" ver ${ver})
|
||||
# Prepend each digit with a zero.
|
||||
string(REGEX REPLACE "([0-9A-Z])" "0\\1" ver ${ver})
|
||||
set(${version} "0x${ver}")
|
||||
endif(CMAKE_SYSTEM_VERSION)
|
||||
endmacro(get_WIN32_WINNT)
|
||||
|
||||
get_WIN32_WINNT(ver)
|
||||
add_definitions(-D_WIN32_WINNT=${ver})
|
||||
endif()
|
||||
|
||||
# Optional: GnomeKeyring
|
||||
|
@ -31,6 +31,10 @@ DataPaths::DataPaths()
|
||||
init();
|
||||
}
|
||||
|
||||
DataPaths::~DataPaths()
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
void DataPaths::setCurrentProfilePath(const QString &profilePath)
|
||||
{
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
};
|
||||
|
||||
explicit DataPaths();
|
||||
~DataPaths();
|
||||
|
||||
// Set absolute path of current profile
|
||||
static void setCurrentProfilePath(const QString &profilePath);
|
||||
|
@ -39,6 +39,7 @@
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "Shlwapi.h"
|
||||
#include "shellapi.h"
|
||||
#endif
|
||||
|
||||
//#define DOWNMANAGER_DEBUG
|
||||
|
@ -273,7 +273,7 @@ bool RegisterQAppAssociation::showNativeDefaultAppSettingsUi()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isWin10OrNewer()) {
|
||||
#ifdef _WIN32_WINNT_WIN8
|
||||
IApplicationActivationManager* pActivator;
|
||||
HRESULT hr = CoCreateInstance(CLSID_ApplicationActivationManager,
|
||||
nullptr,
|
||||
@ -304,8 +304,7 @@ bool RegisterQAppAssociation::showNativeDefaultAppSettingsUi()
|
||||
L"&target=SystemSettings_DefaultApps_Browser", AO_NONE, &pid);
|
||||
|
||||
pActivator->Release();
|
||||
}
|
||||
else {
|
||||
#else // Vista or Win7
|
||||
IApplicationAssociationRegistrationUI* pAARUI = NULL;
|
||||
|
||||
HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
|
||||
@ -318,7 +317,7 @@ bool RegisterQAppAssociation::showNativeDefaultAppSettingsUi()
|
||||
|
||||
hr = pAARUI->LaunchAdvancedAssociationUI(reinterpret_cast<LPCWSTR>(_appRegisteredName.utf16()));
|
||||
pAARUI->Release();
|
||||
}
|
||||
#endif // _WIN32_WINNT_WIN8
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user