Skip to content

Commit

Permalink
Fix build on native MacOSX (bitcoin#1207)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sickpig authored and gandrewstone committed Jul 24, 2018
1 parent a5c18a0 commit 13519e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/qt/macdockiconhandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <objc/objc.h>
#include <objc/message.h>

static MacDockIconHandler *s_instance = NULL;
static MacDockIconHandler *s_instance = nullptr;

bool dockClickHandler(id self,SEL _cmd,...) {
Q_UNUSED(self)
Expand All @@ -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:");
Expand All @@ -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];
Expand All @@ -64,7 +64,7 @@ void setupDockClickHandler() {
MacDockIconHandler::~MacDockIconHandler()
{
delete this->m_dummyWidget;
this->setMainWindow(NULL);
this->setMainWindow(nullptr);
}

QMenu *MacDockIconHandler::dockMenu()
Expand Down

0 comments on commit 13519e9

Please sign in to comment.