diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2014-06-16 11:58:29 (GMT) |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2014-09-01 15:49:07 (GMT) |
commit | 997d626173d9aba5b01b35e4d95ad162771ba789 (patch) | |
tree | 774c1b814c9f933d32a58a2c42183a438eca7d15 /src/gui/widgets | |
parent | 93c137ea29f011a267e22fa644a40aba6e3e2d22 (diff) | |
download | Qt-997d626173d9aba5b01b35e4d95ad162771ba789.zip Qt-997d626173d9aba5b01b35e4d95ad162771ba789.tar.gz Qt-997d626173d9aba5b01b35e4d95ad162771ba789.tar.bz2 |
Replace all ocurrences of NSApp with [NSApplication sharedApplication].
The former returns an id and the latter returns an NSApplication*. This
gives us the benefits of static typing and resolves a build error on
OS X 10.10.
Task-number: QTBUG-39644
Change-Id: I62939b168f391beb846f8a1c5ae789e45bceb858
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qcocoamenu_mac.mm | 2 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index c31416a..54bf11c 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -202,7 +202,7 @@ QT_USE_NAMESPACE static SEL selForOFCP = NSSelectorFromString(@"orderFrontCharacterPalette:"); if (index == -1 && selForOFCP == actionSelector) { // Check if the 'orderFrontCharacterPalette' SEL exists for QCocoaMenuLoader object - QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = [NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)]; + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = [[NSApplication sharedApplication] QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)]; return [super indexOfItemWithTarget:loader andAction:actionSelector]; } return index; diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 12ef70d..669f824 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -179,7 +179,7 @@ static void cancelAllMenuTracking() { #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; - NSMenu *mainMenu = [NSApp mainMenu]; + NSMenu *mainMenu = [[NSApplication sharedApplication] mainMenu]; [mainMenu cancelTracking]; for (NSMenuItem *item in [mainMenu itemArray]) { if ([item submenu]) { @@ -633,7 +633,7 @@ static inline void syncMenuBarItemsVisiblity(const QMenuBarPrivate::QMacMenuBarP static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader() { - return [NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)]; + return [[NSApplication sharedApplication] QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)]; } static NSMenuItem *createNSMenuItem(const QString &title) @@ -2033,7 +2033,7 @@ void qt_mac_clear_menubar() QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); NSMenu *menu = [loader menu]; [loader ensureAppMenuInMenu:menu]; - [NSApp setMainMenu:menu]; + [[NSApplication sharedApplication] setMainMenu:menu]; const bool modal = qt_mac_should_disable_menu(0); if (qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) qt_mac_set_modal_state(menu, modal); @@ -2100,7 +2100,7 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly() #else QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); [loader ensureAppMenuInMenu:menu]; - [NSApp setMainMenu:menu]; + [[NSApplication sharedApplication] setMainMenu:menu]; syncMenuBarItemsVisiblity(mb->d_func()->mac_menubar); if (OSMenuRef tmpMerge = QMenuPrivate::mergeMenuHash.value(menu)) { @@ -2140,7 +2140,7 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly() #else QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); [loader ensureAppMenuInMenu:menu]; - [NSApp setMainMenu:menu]; + [[NSApplication sharedApplication] setMainMenu:menu]; syncMenuBarItemsVisiblity(qt_mac_current_menubar.qmenubar->d_func()->mac_menubar); #endif qt_mac_set_modal_state(menu, modal); |