diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-04-17 18:20:41 -0700 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-04-19 22:20:12 +0000 |
commit | 7ee44dcb9c5c4ffaba0043d7d58e0d43ccc06195 (patch) | |
tree | 5a0e04dd7cd7b808f4885ede50339418863f169b /src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | |
parent | 48defe41e1f6fb38800675922289dd7364fad8af (diff) |
Cocoa QPA: Clean up 0 as pointer
We use nil for Objective-C null pointers and nullptr everywhere
else, including CoreFoundation and similar opaque types.
Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 0e127902ae..d7850b1481 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -74,8 +74,8 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate); { self = [super init]; mColorPanel = [NSColorPanel sharedColorPanel]; - mHelper = 0; - mStolenContentView = 0; + mHelper = nullptr; + mStolenContentView = nil; mPanelButtons = nil; mResultCode = NSModalResponseCancel; mDialogIsExecuting = false; @@ -115,9 +115,9 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate); [self restoreOriginalContentView]; } else if (!mStolenContentView) { // steal the color panel's contents view - mStolenContentView = [mColorPanel contentView]; + mStolenContentView = mColorPanel.contentView; [mStolenContentView retain]; - [mColorPanel setContentView:0]; + mColorPanel.contentView = nil; // create a new content view and add the stolen one as a subview mPanelButtons = [[QNSPanelContentsWrapper alloc] initWithPanelDelegate:self]; @@ -309,7 +309,7 @@ public: void cleanup(QCocoaColorDialogHelper *helper) { if (mDelegate->mHelper == helper) - mDelegate->mHelper = 0; + mDelegate->mHelper = nullptr; } bool exec() |