diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2016-07-22 15:28:25 -0700 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2016-08-01 18:32:42 +0000 |
commit | a9603ef7d42c15090d86d04d1bc6aaf684257862 (patch) | |
tree | d2b352a4b67f0699722cbb57dfd29869af063f06 /src/plugins/platforms/cocoa/qcocoamenu.mm | |
parent | c4b4eba188d2fc0273aaa38533e19dcbd4cfc7be (diff) |
Cocoa QPA Menus: Clean-up QCocoaMenuLoader related code
Now that QCocoaMenuLoader is a singleton, we can access
it the natural way. In all cases, it already needed to
be done in an Objective-C file, so it doesn't change
anything from this point of view.
Furthermore, we decide to remove private accessor APIs
in QCocoaApplication and QCocoaApplicationDelegate which
are now redundant.
Change-Id: I4190ed2e2536b778482c513727e279c9318acb7e
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenu.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoamenu.mm | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 06ec2aa479..32cf9ebc53 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -74,11 +74,6 @@ NSString *qt_mac_removePrivateUnicode(NSString* string) return string; } -static inline QCocoaMenuLoader *getMenuLoader() -{ - return [NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)]; -} - QT_END_NAMESPACE @interface QT_MANGLE_NAMESPACE(QCocoaMenuDelegate) : NSObject <NSMenuDelegate> { @@ -408,7 +403,7 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem) } bool wasMerged = cocoaItem->isMerged(); - NSMenu *oldMenu = wasMerged ? [getMenuLoader() applicationMenu] : m_nativeMenu; + NSMenu *oldMenu = wasMerged ? [[QCocoaMenuLoader sharedMenuLoader] applicationMenu] : m_nativeMenu; NSMenuItem *oldItem = [oldMenu itemWithTag:(NSInteger) cocoaItem]; if (cocoaItem->sync() != oldItem) { |