summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-03-22 09:33:15 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-24 03:42:49 +0100
commit7b5ad884898c77926aeebac8281dc4d2fd27e637 (patch)
treeef6235632e4d785d4950dba0e98455c03ed0fa4e /src
parent5ad615ae8c08741400d1f9c5d7fa7f5a2324f6b2 (diff)
Guard usage of [NSApp setDockMenu].
setDockMenu is not documented an may disappear. Closest documented replacement seems to be [NSApplicationDelegate applicationDockMenu:]. It can't be used as a direct replacement since it's a "virtual" getter that the application delegate implements. Change-Id: Id161196018057b75cbe7d6f6d2610c0932345c5f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index fde93a38db..a7f4d3b823 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -191,7 +191,10 @@ void QCocoaNativeInterface::setDockMenu(QPlatformMenu *platformMenu)
QCocoaMenu *cocoaPlatformMenu = static_cast<QCocoaMenu *>(platformMenu);
NSMenu *menu = cocoaPlatformMenu->nsMenu();
// setDockMenu seems to be undocumented, but this is what Qt 4 did.
- [NSApp setDockMenu: menu];
+ if ([NSApp respondsToSelector:@selector(setDockMenu:)])
+ [NSApp setDockMenu: menu];
+ else
+ qWarning("Could not set dock menu: [NSApp setDockMenu] is not available.");
}
void *QCocoaNativeInterface::qMenuToNSMenu(QPlatformMenu *platformMenu)