Patchwork [v2,3/4] ui/cocoa.m: Avoid deprecated NSOpenPanel filename method

login
register
mail settings
Submitter Peter Maydell
Date March 25, 2013, 10:31 p.m.
Message ID <1364250694-7939-4-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/231003/
State New
Headers show

Comments

Peter Maydell - March 25, 2013, 10:31 p.m.
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>
---
 ui/cocoa.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/ui/cocoa.m b/ui/cocoa.m
index e768b05..36181d9 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 );