[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 07/10] ui/cocoa: Declare that QemuCocoaAppController

From: Peter Maydell
Subject: [Qemu-devel] [PULL 07/10] ui/cocoa: Declare that QemuCocoaAppController implements NSApplicationDelegate
Date: Tue, 19 May 2015 09:23:52 +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];
note: passing argument to parameter 'delegate' here
@property (assign) id <NSFileManagerDelegate> delegate NS_AVAILABLE(10_5,

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>
Message-id: 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
+                                             <NSApplicationDelegate>
 - (void)startEmulationWithArgc:(int)argc argv:(char**)argv;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]