From 018d7ec0989547f57a28ac76f9b6839d7570e9bf Mon Sep 17 00:00:00 2001 From: nowrep Date: Mon, 10 Feb 2014 20:49:54 +0100 Subject: [PATCH] [MinGW] Some fixes for MinGW building --- src/lib/3rdparty/ecwin7.h | 2 + src/lib/3rdparty/qtwin.h | 2 + src/lib/lib.pro | 5 +- src/lib/other/registerqappassociation.cpp | 4 ++ src/lib/plugins/qtwebkit/qtwebkit-plugins.pri | 56 +++++++++++++------ 5 files changed, 49 insertions(+), 20 deletions(-) diff --git a/src/lib/3rdparty/ecwin7.h b/src/lib/3rdparty/ecwin7.h index 5d72ce64a..3bd71170e 100644 --- a/src/lib/3rdparty/ecwin7.h +++ b/src/lib/3rdparty/ecwin7.h @@ -27,7 +27,9 @@ // Windows only data definitions #ifdef W7TASKBAR +#ifndef __MINGW32__ #define NOMINMAX +#endif #include #include #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK diff --git a/src/lib/3rdparty/qtwin.h b/src/lib/3rdparty/qtwin.h index 310aa1952..abe4c35a4 100644 --- a/src/lib/3rdparty/qtwin.h +++ b/src/lib/3rdparty/qtwin.h @@ -39,7 +39,9 @@ */ #ifdef Q_OS_WIN // Qt5 compile issue: http://comments.gmane.org/gmane.comp.lib.qt.user/4711 +#ifndef __MINGW32__ #define NOMINMAX +#endif #ifdef W7API #include #include diff --git a/src/lib/lib.pro b/src/lib/lib.pro index 36b200662..3d34611ad 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -12,13 +12,10 @@ DEFINES *= QUPZILLA_SHAREDLIBRARY include(3rdparty/qtsingleapplication.pri) include(../defines.pri) include(../../translations/translations.pri) +include(plugins/qtwebkit/qtwebkit-plugins.pri) CONFIG(debug, debug|release): include(../../tests/modeltest/modeltest.pri) -!mac:contains(DEFINES, USE_QTWEBKIT_2_2) { - include(plugins/qtwebkit/qtwebkit-plugins.pri) -} - unix:!contains(DEFINES, "DISABLE_DBUS") QT += dbus INCLUDEPATH += 3rdparty\ diff --git a/src/lib/other/registerqappassociation.cpp b/src/lib/other/registerqappassociation.cpp index 2f33e194f..48a3c76a7 100644 --- a/src/lib/other/registerqappassociation.cpp +++ b/src/lib/other/registerqappassociation.cpp @@ -149,6 +149,7 @@ bool RegisterQAppAssociation::isVistaOrNewer() void RegisterQAppAssociation::registerAssociation(const QString &assocName, AssociationType type) { if (isVistaOrNewer()) { // Vista and newer +#ifndef __MINGW32__ IApplicationAssociationRegistration* pAAR; HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration, @@ -187,6 +188,7 @@ void RegisterQAppAssociation::registerAssociation(const QString &assocName, Asso pAAR->Release(); } +#endif // #ifndef __MINGW32__ } else { // Older than Vista QSettings regUserRoot(_UserRootKey, QSettings::NativeFormat); @@ -246,9 +248,11 @@ void RegisterQAppAssociation::registerAllAssociation() } if (!isVistaOrNewer()) { +#ifndef __MINGW32__ // On Windows Vista or newer for updating icons 'pAAR->SetAppAsDefault()' // calls 'SHChangeNotify()'. Thus, we just need care about older Windows. SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, 0 , 0); +#endif } } diff --git a/src/lib/plugins/qtwebkit/qtwebkit-plugins.pri b/src/lib/plugins/qtwebkit/qtwebkit-plugins.pri index 19e4c7a39..0c482b99f 100644 --- a/src/lib/plugins/qtwebkit/qtwebkit-plugins.pri +++ b/src/lib/plugins/qtwebkit/qtwebkit-plugins.pri @@ -1,23 +1,47 @@ -HEADERS += $$PWD/qtwebkitplugin.h \ - $$PWD/notifications/notificationpresenter.h \ - $$[QT_INSTALL_HEADERS]/QtWebKit/qwebkitplatformplugin.h \ +# Unix +!mac:unix { + buildNotifications = true - -SOURCES += $$PWD/qtwebkitplugin.cpp \ - $$PWD/notifications/notificationpresenter.cpp \ - -DEFINES *= QT_STATICPLUGIN - - -!mac:unix:contains(DEFINES, USE_QTWEBKIT_2_3):system(pkg-config --exists hunspell) { - buildSpellcheck = true - LIBS += $$system(pkg-config --libs hunspell) + contains(DEFINES, USE_QTWEBKIT_2_3):system(pkg-config --exists hunspell) { + buildSpellcheck = true + LIBS += $$system(pkg-config --libs hunspell) + } } +# Mac OS X +mac { + buildPlugin = false +} + +# Windows win32 { - # QtWebKit 2.3 and Hunspell is now needed to build on Windows - buildSpellcheck = true - LIBS += -llibhunspell + win32-msvc* { + # QtWebKit 2.3 and Hunspell is now needed to build on Windows + buildNotifications = true + buildSpellcheck = true + LIBS += -llibhunspell + } + else { # mingw + buildPlugin = false + } +} + +!equals(buildPlugin, false) { + HEADERS += $$PWD/qtwebkitplugin.h \ + $$[QT_INSTALL_HEADERS]/QtWebKit/qwebkitplatformplugin.h + + SOURCES += $$PWD/qtwebkitplugin.cpp + + DEFINES *= QT_STATICPLUGIN +} +else { + buildNotifications = false + buildSpellcheck = false +} + +equals(buildNotifications, true) { + HEADERS += $$PWD/notifications/notificationpresenter.h + SOURCES += $$PWD/notifications/notificationpresenter.cpp } equals(buildSpellcheck, true) {