[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController i
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate |
Date: |
Sun, 10 May 2015 23:19:19 +0100 |
Our class QemuCocoaAppController implements the NSApplicationDelegate
interface, and we pass an object of this class to [NSApp setDelegate].
However, we weren't declaring in the class definition that we implemented
this interface; in OSX 10.10 this provokes the following (slighly
misleading) warning:
ui/cocoa.m:1031:24: warning: sending 'QemuCocoaAppController *' to parameter of
incompatible type 'id<NSFileManagerDelegate>'
[NSApp setDelegate:appController];
^~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSFileManager.h:109:47:
note: passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5,
2_0);
^
Annoyingly, this interface wasn't formally defined until OSX 10.6, so we
have to surround the relevant part of the @interface line with an ifdef.
Signed-off-by: Peter Maydell <address@hidden>
---
ui/cocoa.m | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 563ea47..e7b29e0 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -784,6 +784,9 @@ QemuCocoaView *cocoaView;
------------------------------------------------------
*/
@interface QemuCocoaAppController : NSObject
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
+ <NSApplicationDelegate>
+#endif
{
}
- (void)startEmulationWithArgc:(int)argc argv:(char**)argv;
--
2.2.1
- [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support), Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 3/6] ui/cocoa: openPanelDidEnd returnCode should be NSInteger, not int, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 4/6] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate,
Peter Maydell <=
- [Qemu-devel] [PATCH 5/6] ui/cocoa: Don't use NSWindow useOptimizedDrawing on OSX 10.10 and up, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 6/6] ui/cocoa: Avoid deprecated NSOKButton/NSCancelButton constants, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 2/6] ui/cocoa: Remove compatibility ifdefs for OSX 10.4, Peter Maydell, 2015/05/10
- [Qemu-devel] [PATCH 1/6] ui/cocoa: Drop tests for CGImageCreateWithImageInRect support, Peter Maydell, 2015/05/10
- Re: [Qemu-devel] [PATCH 0/6] ui/cocoa: Fix OSX 10.10 warnings (and drop 10.4 support), Programmingkid, 2015/05/11