From a02c00d68d510cf3eabebb4b83c356174d3186ef Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Wed, 4 Feb 2015 18:40:08 +0100 Subject: [PATCH] Check for HAVE_X11 instead of Q_OS_LINUX in bringToFront --- CMakeLists.txt | 9 +++++++-- src/libtomahawk/utils/TomahawkUtilsGui.cpp | 23 ++++++++++------------ src/tomahawk/Config.h.in | 1 + 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39ac4b10c..bfbcc5c2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,9 +159,14 @@ if( NOT BUILD_WITH_QT4 ) find_package(Qt5WebKitWidgets REQUIRED) find_package(Qt5Widgets REQUIRED) find_package(Qt5Xml REQUIRED) - if(UNIX AND NOT APPLE) - find_package(Qt5X11Extras REQUIRED NO_MODULE) + find_package(Qt5X11Extras NO_MODULE) + + if(Qt5X11Extras_FOUND) + set(HAVE_X11 TRUE) + else() + set(HAVE_X11 FALSE) endif() + message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!") if( UNIX AND NOT APPLE ) diff --git a/src/libtomahawk/utils/TomahawkUtilsGui.cpp b/src/libtomahawk/utils/TomahawkUtilsGui.cpp index 5cb2fb64b..36135f953 100644 --- a/src/libtomahawk/utils/TomahawkUtilsGui.cpp +++ b/src/libtomahawk/utils/TomahawkUtilsGui.cpp @@ -41,17 +41,15 @@ #include #if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) -#ifdef Q_OS_LINUX - #include - #include -#endif -#endif - - -//FIXME: Qt5: this doesnt fail because Q_WS_X11 is deprecated -//TODO: change to Q_OS_X11 and fix errors -#ifdef Q_WS_X11 - #include + #ifdef HAVE_X11 + #include + #include + #endif +#else + #ifdef Q_WS_X11 + #include + #include + #endif #endif #ifdef Q_OS_WIN @@ -356,8 +354,7 @@ bringToFront() } } #endif -#endif -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) +#else // Qt5 { qDebug() << Q_FUNC_INFO; diff --git a/src/tomahawk/Config.h.in b/src/tomahawk/Config.h.in index b8cdfdfa0..467354fdb 100644 --- a/src/tomahawk/Config.h.in +++ b/src/tomahawk/Config.h.in @@ -25,5 +25,6 @@ #cmakedefine TOMAHAWK_FINEGRAINED_MESSAGES #cmakedefine COMPLEX_TAGLIB_FILENAME #cmakedefine HAVE_VLC_ALBUMARTIST +#cmakedefine HAVE_X11 #endif // CONFIG_H_IN