diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-11-22 18:48:08 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-11-23 17:05:26 +0300 |
commit | ce52b2e5a4888db9f8b27ad769acc4d679740359 (patch) | |
tree | a25480f1c56f4a60a38dc87f4590925195df3848 /src | |
parent | 2e4bf1d8c640a512996e9236645369c440c12b4b (diff) |
Enable dependency to QtWinExtras
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/gui/guiutility.cpp | 11 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 95ac47a57..0e9b611e2 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -2,9 +2,9 @@ include(ECMAddAppIcon) find_package(Qt5 REQUIRED COMPONENTS Widgets) -#if (WIN32) -# find_package(Qt5 REQUIRED COMPONENTS WinExtras) -#endif() +if (WIN32) + find_package(Qt5 REQUIRED COMPONENTS WinExtras) +endif() add_subdirectory(updater) @@ -173,7 +173,7 @@ elseif( WIN32 ) target_sources(owncloudCore PRIVATE folderwatcher_win.cpp navigationpanehelper.cpp) -# target_link_libraries(owncloudCore PUBLIC Qt5::WinExtras) + target_link_libraries(owncloudCore PUBLIC Qt5::WinExtras) elseif(UNIX AND NOT APPLE ) ## handle DBUS for Fdo notifications find_package(Qt5 COMPONENTS DBus) diff --git a/src/gui/guiutility.cpp b/src/gui/guiutility.cpp index 8414d0c5c..7608d6aaa 100644 --- a/src/gui/guiutility.cpp +++ b/src/gui/guiutility.cpp @@ -25,6 +25,9 @@ #ifdef Q_OS_WIN #include <QMetaMethod> +#include <QtWinExtras/qwinfunctions.h> +#include <qt_windows.h> + #include <chrono> #include <thread> @@ -63,11 +66,9 @@ void startShutdownWatcher() WNDCLASS wc = {}; wc.hInstance = GetModuleHandle(nullptr); wc.lpszClassName = L"ocWindowMessageWatcher"; -#if MIRALL_VERSION_MINOR > 9 -// TODO: for now we won't display a proper icon -#error "Please add the QtWinExtras dependency" - wc.hIcon = QtWin::toHICON(Theme::instance()->applicationIcon().pixmap(64, 64)); -#endif + if (qobject_cast<QGuiApplication *>(qApp)) { + wc.hIcon = QtWin::toHICON(Theme::instance()->applicationIcon().pixmap(64, 64)); + } wc.lpfnWndProc = [](HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -> LRESULT { // qDebug() << MSG { hwnd, msg, wParam, lParam, 0, {} }; if (msg == WM_QUERYENDSESSION) { |