[PULL,3/4] cocoa: Avoid deprecated NSOpenPanel filename method
diff mbox

Message ID 1369785081-4838-4-git-send-email-andreas.faerber@web.de
State New
Headers show

Commit Message

Andreas Färber May 28, 2013, 11:51 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>

Avoid the NSOpenPanel filename method (deprecated in MacOSX 10.6)
in favour of using the URL method and extracting the path from the
resulting NSUrl object.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 ui/cocoa.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox

diff --git a/ui/cocoa.m b/ui/cocoa.m
index ec09728..bb59511 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -810,7 +810,7 @@  QemuCocoaView *cocoaView;
         exit(0);
     } else if(returnCode == NSOKButton) {
         const char *bin = "qemu";
-        char *img = (char*)[ [ sheet filename ] cStringUsingEncoding:NSASCIIStringEncoding];
+        char *img = (char*)[ [ [ sheet URL ] path ] cStringUsingEncoding:NSASCIIStringEncoding];
 
         char **argv = (char**)malloc( sizeof(char*)*3 );