diff --git a/OpenBoard.pro b/OpenBoard.pro index f36bf9fe..be78285b 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -161,6 +161,8 @@ win32 { } macx { + DEFINES += Q_WS_MACX + LIBS += -framework Foundation LIBS += -framework Cocoa LIBS += -framework Carbon @@ -169,11 +171,23 @@ macx { LIBS += -lcrypto LIBS += -L/usr/local/opt/openssl/lib - LIBS += -L/usr/local/opt/quazip/lib -lquazip + + # quazip depends on QT. Current is 5.14, so if you wish to build + # OB using a previous QT version, you have to build your own quazip, + # otherwise it won't link. + equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 14) { + LIBS += "-L../OpenBoard-ThirdParty/quazip/lib/macx" "-lquazip" + } else { + LIBS += -L/usr/local/opt/quazip/lib -lquazip + } LIBS += -L/usr/local/opt/ffmpeg/lib INCLUDEPATH += /usr/local/opt/openssl/include INCLUDEPATH += /usr/local/opt/ffmpeg/include - INCLUDEPATH += /usr/local/opt/quazip/include/quazip + equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 14) { + INCLUDEPATH += ../OpenBoard-ThirdParty/quazip/quazip-0.7.1 + } else { + INCLUDEPATH += /usr/local/opt/quazip/include/quazip + } LIBS += -L/usr/local/opt/poppler/lib -lpoppler INCLUDEPATH += /usr/local/opt/poppler/include diff --git a/src/api/UBLibraryAPI.h b/src/api/UBLibraryAPI.h index 0c0f0d1d..b11c07ef 100644 --- a/src/api/UBLibraryAPI.h +++ b/src/api/UBLibraryAPI.h @@ -31,7 +31,6 @@ #define UBLIBRARYAPI_H_ #include -#include #include class UBLibraryAPI : public QObject diff --git a/src/api/UBW3CWidgetAPI.cpp b/src/api/UBW3CWidgetAPI.cpp index 6228f511..cf858628 100644 --- a/src/api/UBW3CWidgetAPI.cpp +++ b/src/api/UBW3CWidgetAPI.cpp @@ -30,7 +30,6 @@ #include "UBW3CWidgetAPI.h" #include -#include #include "core/UBApplication.h" #include "core/UBApplicationController.h" diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index b3b913a2..9d108bce 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -30,7 +30,6 @@ #include "UBBoardController.h" #include -#include #include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBPlatformUtils.h" diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index 74f07a31..d5a54707 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.h @@ -31,7 +31,6 @@ #define UBBOARDPALETTEMANAGER_H_ #include -#include #include "gui/UBLeftPalette.h" #include "gui/UBRightPalette.h" diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 709aa678..b189c3b8 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -30,7 +30,6 @@ #include "UBApplication.h" #include -#include #include #include #include diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 0f991c13..d7e3e859 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -84,6 +84,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent, UB mTransparentDrawingView->setAttribute(Qt::WA_TranslucentBackground, true); #ifdef Q_OS_OSX mTransparentDrawingView->setAttribute(Qt::WA_MacNoShadow, true); +#endif //Q_OS_OSX + +#if defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) /* https://bugreports.qt.io/browse/QTBUG-81456 */ if (QOperatingSystemVersion::current().minorVersion() > 12) /* > Sierra */ { diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index f07e31ec..27b0bf9f 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -30,7 +30,6 @@ #include "UBGraphicsScene.h" #include -#include #include #include #include @@ -2804,6 +2803,8 @@ void UBGraphicsScene::simplifyCurrentStroke() } + + void UBGraphicsScene::setDocumentUpdated() { if (document()) diff --git a/src/domain/UBGraphicsWidgetItem.h b/src/domain/UBGraphicsWidgetItem.h index 68336a89..34eef785 100644 --- a/src/domain/UBGraphicsWidgetItem.h +++ b/src/domain/UBGraphicsWidgetItem.h @@ -31,7 +31,6 @@ #define UBGRAPHICSWIDGETITEM_H #include -#include #include #include diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index f39fccad..9129f724 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -88,6 +88,7 @@ void UBPlatformUtils::setDesktopMode(bool desktop) { @try { +#if defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) // temporarily disabled due to bug: when switching to desktop mode (and calling this), // openboard switches right back to the board mode. clicking again on desktop mode works. if (desktop) { @@ -95,6 +96,9 @@ void UBPlatformUtils::setDesktopMode(bool desktop) } else [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; +#else // QT_VERSION_CHECK(5, 10, 0) + [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; +#endif // QT_VERSION_CHECK(5, 10, 0) } @catch(NSException * exception) { @@ -526,6 +530,7 @@ QString UBPlatformUtils::urlFromClipboard() void UBPlatformUtils::toggleFinder(const bool on) { +#if defined(Q_OS_OSX) && (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) if (on) { [NSApp setPresentationOptions:NSApplicationPresentationDefault]; @@ -534,6 +539,9 @@ void UBPlatformUtils::toggleFinder(const bool on) { [NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; } +#else // QT_VERSION_CHECK(5, 10, 0) + Q_UNUSED(on); +#endif //QT_VERSION_CHECK(5, 10, 0) } diff --git a/src/gui/UBFeaturesWidget.h b/src/gui/UBFeaturesWidget.h index 473e0113..e2ca1186 100644 --- a/src/gui/UBFeaturesWidget.h +++ b/src/gui/UBFeaturesWidget.h @@ -54,7 +54,6 @@ #include "api/UBWidgetUniboardAPI.h" #include "UBFeaturesActionBar.h" #include "UBRubberBand.h" -#include #include #include diff --git a/src/gui/UBMainWindow.h b/src/gui/UBMainWindow.h index 6cd1fc55..0c69973e 100644 --- a/src/gui/UBMainWindow.h +++ b/src/gui/UBMainWindow.h @@ -32,7 +32,6 @@ #include #include -#include #include #include "UBDownloadWidget.h" diff --git a/src/network/UBCookieJar.cpp b/src/network/UBCookieJar.cpp index d9dc3d62..8fb2f79d 100644 --- a/src/network/UBCookieJar.cpp +++ b/src/network/UBCookieJar.cpp @@ -75,8 +75,7 @@ #include "core/UBSettings.h" #include -#include - +#include #include "core/memcheck.h" static const unsigned int JAR_VERSION = 23; diff --git a/src/pdf/XPDFRenderer.h b/src/pdf/XPDFRenderer.h index 43357b01..73f64a91 100644 --- a/src/pdf/XPDFRenderer.h +++ b/src/pdf/XPDFRenderer.h @@ -76,6 +76,7 @@ class XPDFRenderer : public PDFRenderer void init(); struct PdfZoomCacheData { + PdfZoomCacheData() : splashBitmap(nullptr), cachedPageNumber(-1), splash(nullptr), ratio(1.0) {}; PdfZoomCacheData(double const a_ratio) : splashBitmap(nullptr), cachedPageNumber(-1), splash(nullptr), ratio(a_ratio) {}; ~PdfZoomCacheData() {}; SplashBitmap* splashBitmap; diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index c7fd00f0..f47bac80 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "frameworks/UBPlatformUtils.h" diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h index 0f6f305d..edb8554c 100644 --- a/src/web/UBWebController.h +++ b/src/web/UBWebController.h @@ -31,7 +31,6 @@ #define UBWEBCONTROLLER_H_ #include -#include #include #include "UBOEmbedParser.h" diff --git a/src/web/UBWebKitUtils.h b/src/web/UBWebKitUtils.h index 85c7900b..d6683b13 100644 --- a/src/web/UBWebKitUtils.h +++ b/src/web/UBWebKitUtils.h @@ -30,7 +30,8 @@ #ifndef UBWEBKITUTILS_H_ #define UBWEBKITUTILS_H_ -#include +// Forward declarations. +class QWebFrame; class UBWebKitUtils { diff --git a/src/web/browser/WBBrowserWindow.cpp b/src/web/browser/WBBrowserWindow.cpp index 252ab9da..6b7ca6b9 100644 --- a/src/web/browser/WBBrowserWindow.cpp +++ b/src/web/browser/WBBrowserWindow.cpp @@ -71,7 +71,7 @@ #include "WBBrowserWindow.h" #include -#include +#include #include #include "core/UBSettings.h" diff --git a/src/web/browser/WBBrowserWindow.h b/src/web/browser/WBBrowserWindow.h index 6e60bca9..80926e3b 100644 --- a/src/web/browser/WBBrowserWindow.h +++ b/src/web/browser/WBBrowserWindow.h @@ -72,7 +72,6 @@ #define WBBROWSERMAINWINDOW_H #include -#include class WBChaseWidget; class WBTabWidget; diff --git a/src/web/browser/WBDownloadManager.cpp b/src/web/browser/WBDownloadManager.cpp index 7036325b..869283db 100644 --- a/src/web/browser/WBDownloadManager.cpp +++ b/src/web/browser/WBDownloadManager.cpp @@ -71,8 +71,8 @@ #include "WBDownloadManager.h" #include -#include #include +#include #include "network/UBAutoSaver.h" #include "network/UBNetworkAccessManager.h" diff --git a/src/web/browser/WBHistory.cpp b/src/web/browser/WBHistory.cpp index 7d8cf80f..3412aa36 100644 --- a/src/web/browser/WBHistory.cpp +++ b/src/web/browser/WBHistory.cpp @@ -73,7 +73,7 @@ #include "WBBrowserWindow.h" #include -#include +#include #include "core/UBSettings.h" #include "network/UBAutoSaver.h" diff --git a/src/web/browser/WBHistory.h b/src/web/browser/WBHistory.h index ffa566ee..e6626963 100644 --- a/src/web/browser/WBHistory.h +++ b/src/web/browser/WBHistory.h @@ -74,7 +74,7 @@ #include "WBModelMenu.h" #include -#include +#include class WBHistoryItem { diff --git a/src/web/browser/WBTabWidget.h b/src/web/browser/WBTabWidget.h index 2f7baf57..9738fa35 100644 --- a/src/web/browser/WBTabWidget.h +++ b/src/web/browser/WBTabWidget.h @@ -118,8 +118,6 @@ class WBTabBar : public QTabBar QPoint mDragStartPos; }; -#include - class WBWebView; /*! diff --git a/src/web/browser/WBToolBarSearch.cpp b/src/web/browser/WBToolBarSearch.cpp index 5e0c1061..941f7d95 100644 --- a/src/web/browser/WBToolBarSearch.cpp +++ b/src/web/browser/WBToolBarSearch.cpp @@ -71,7 +71,6 @@ #include "WBToolBarSearch.h" #include -#include #include #include diff --git a/src/web/browser/WBWebTrapWebView.cpp b/src/web/browser/WBWebTrapWebView.cpp index 7f4070c5..8df0d4ca 100644 --- a/src/web/browser/WBWebTrapWebView.cpp +++ b/src/web/browser/WBWebTrapWebView.cpp @@ -30,7 +30,7 @@ #include "WBWebTrapWebView.h" #include -#include +#include #include #include diff --git a/src/web/browser/WBWebTrapWebView.h b/src/web/browser/WBWebTrapWebView.h index 70568309..035f4c8b 100644 --- a/src/web/browser/WBWebTrapWebView.h +++ b/src/web/browser/WBWebTrapWebView.h @@ -31,10 +31,8 @@ #define WBWEBTRAPWEBVIEW_H_ #include -#include #include - class WBWebTrapWebView : public QWebView { Q_OBJECT; diff --git a/src/web/browser/WBWebView.cpp b/src/web/browser/WBWebView.cpp index 79db33dd..e413f7e8 100644 --- a/src/web/browser/WBWebView.cpp +++ b/src/web/browser/WBWebView.cpp @@ -82,7 +82,6 @@ #include "network/UBCookieJar.h" #include -#include #include #include #include diff --git a/src/web/browser/WBWebView.h b/src/web/browser/WBWebView.h index 480bbf8d..cca64fa3 100644 --- a/src/web/browser/WBWebView.h +++ b/src/web/browser/WBWebView.h @@ -72,7 +72,6 @@ #define WBWEBVIEW_H #include -#include #include "WBWebTrapWebView.h" #include "web/UBWebPage.h"