From 13519e9eada02bf39d7b6bcb33361fe9f65a4465 Mon Sep 17 00:00:00 2001 From: Andrea Suisani Date: Tue, 24 Jul 2018 18:44:31 +0200 Subject: [PATCH] Fix build on native MacOSX (#1207) * Fix build on native MacOSX In cbc2e5 a bug got introduced while trying to special cases for Qt >= 5.2 * Use c++11 nullptr literal --- src/qt/macdockiconhandler.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qt/macdockiconhandler.mm b/src/qt/macdockiconhandler.mm index 9494a43ab38dc..e39af787593fb 100644 --- a/src/qt/macdockiconhandler.mm +++ b/src/qt/macdockiconhandler.mm @@ -15,7 +15,7 @@ #include #include -static MacDockIconHandler *s_instance = NULL; +static MacDockIconHandler *s_instance = nullptr; bool dockClickHandler(id self,SEL _cmd,...) { Q_UNUSED(self) @@ -31,7 +31,7 @@ void setupDockClickHandler() { Class cls = objc_getClass("NSApplication"); id appInst = objc_msgSend((id)cls, sel_registerName("sharedApplication")); - if (appInst != NULL) { + if (appInst != nullptr) { id delegate = objc_msgSend(appInst, sel_registerName("delegate")); Class delClass = (Class)objc_msgSend(delegate, sel_registerName("class")); SEL shouldHandle = sel_registerName("applicationShouldHandleReopen:hasVisibleWindows:"); @@ -50,8 +50,8 @@ void setupDockClickHandler() { setupDockClickHandler(); this->m_dummyWidget = new QWidget(); this->m_dockMenu = new QMenu(this->m_dummyWidget); - this->setMainWindow(NULL); -#elif QT_VERSION >= 0x050200 + this->setMainWindow(nullptr); +#if QT_VERSION >= 0x050200 this->m_dockMenu->setAsDockMenu(); #endif [pool release]; @@ -64,7 +64,7 @@ void setupDockClickHandler() { MacDockIconHandler::~MacDockIconHandler() { delete this->m_dummyWidget; - this->setMainWindow(NULL); + this->setMainWindow(nullptr); } QMenu *MacDockIconHandler::dockMenu()