ui/cocoa.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
ui/cocoa.m:1188:44: warning: 'openFile:' is deprecated: first deprecated in macOS 11.0 - Use -[NSWorkspace openURL:] instead.
[-Wdeprecated-declarations]
if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) {
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h:350:1: note:
'openFile:' has been explicitly marked deprecated here
- (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0));
^
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
Changes since v1:
- Changed URLWithString: to fileURLWithPath:isDirectory: (Peter)
ui/cocoa.m | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index f32adc3074..ea3b845b53 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1178,6 +1178,7 @@ QemuCocoaView *cocoaView;
/* Where to look for local files */
NSString *path_array[] = {@"../share/doc/qemu/", @"../doc/qemu/", @"../docs/"};
NSString *full_file_path;
+ NSURL *full_file_url;
/* iterate thru the possible paths until the file is found */
int index;
@@ -1186,7 +1187,9 @@ QemuCocoaView *cocoaView;
full_file_path = [full_file_path stringByDeletingLastPathComponent];
full_file_path = [NSString stringWithFormat: @"%@/%@%@", full_file_path,
path_array[index], filename];
- if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) {
+ full_file_url = [NSURL fileURLWithPath: full_file_path
+ isDirectory: false];
+ if ([[NSWorkspace sharedWorkspace] openURL: full_file_url] == YES) {
return;
}
}
--
2.29.2
On Sat, 2 Jan 2021 at 15:14, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
>
> ui/cocoa.m:1188:44: warning: 'openFile:' is deprecated: first deprecated in macOS 11.0 - Use -[NSWorkspace openURL:] instead.
> [-Wdeprecated-declarations]
> if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) {
> ^
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h:350:1: note:
> 'openFile:' has been explicitly marked deprecated here
> - (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0));
> ^
>
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
I'll take this via my target-arm tree, for convenience's sake.
thanks
-- PMM
On Fri, 8 Jan 2021 at 13:50, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sat, 2 Jan 2021 at 15:14, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
> >
> > ui/cocoa.m:1188:44: warning: 'openFile:' is deprecated: first deprecated in macOS 11.0 - Use -[NSWorkspace openURL:] instead.
> > [-Wdeprecated-declarations]
> > if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) {
> > ^
> > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h:350:1: note:
> > 'openFile:' has been explicitly marked deprecated here
> > - (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0));
> > ^
> >
> > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> > ---
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
So I was just trying to test this patch, and I found that at least
for me the osx menu bar has stopped working in QEMU -- keyboard
shortcuts to it still work but none of the menu buttons respond
to the mouse. Does that happen for anybody else?
Also, the "bring up the docs" help option (which is what this
patch is changing) doesn't seem to work when QEMU is run from
the source tree and the docs haven't been installed to the
locations where it expects it might find them. Probably the
code needs updating to work with qemu_find_file() or some
variant on it.
-- PMM
On Fri, 8 Jan 2021 at 15:00, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 8 Jan 2021 at 13:50, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Sat, 2 Jan 2021 at 15:14, Roman Bolshakov <r.bolshakov@yadro.com> wrote:
> > >
> > > ui/cocoa.m:1188:44: warning: 'openFile:' is deprecated: first deprecated in macOS 11.0 - Use -[NSWorkspace openURL:] instead.
> > > [-Wdeprecated-declarations]
> > > if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) {
> > > ^
> > > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h:350:1: note:
> > > 'openFile:' has been explicitly marked deprecated here
> > > - (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0));
> > > ^
> > >
> > > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> > > ---
> >
> > Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>
>
> So I was just trying to test this patch, and I found that at least
> for me the osx menu bar has stopped working in QEMU -- keyboard
> shortcuts to it still work but none of the menu buttons respond
> to the mouse. Does that happen for anybody else?
This menu bar breakage appears to be caused by this patch. I have
no idea why, because the patch looks pretty harmless. Nonetheless,
I'm going to have to drop it from my queue.
thanks
-- PMM
© 2016 - 2025 Red Hat, Inc.