[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 21/21] ui/cocoa: Fix openFile: deprecation on Big Sur
From: |
Peter Maydell |
Subject: |
[PULL 21/21] ui/cocoa: Fix openFile: deprecation on Big Sur |
Date: |
Tue, 12 Jan 2021 16:57:50 +0000 |
From: Roman Bolshakov <r.bolshakov@yadro.com>
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>
Message-id: 20210102150718.47618-1-r.bolshakov@yadro.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
ui/cocoa.m | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index e913a514455..13fba8103e1 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.20.1
- [PULL 09/21] ui/cocoa: Update path to docs in build tree, (continued)
- [PULL 09/21] ui/cocoa: Update path to docs in build tree, Peter Maydell, 2021/01/12
- [PULL 14/21] hw/net/lan9118: Add symbolic constants for register offsets, Peter Maydell, 2021/01/12
- [PULL 16/21] hw/timer: Refactor NPCM7XX Timer to use CLK clock, Peter Maydell, 2021/01/12
- [PULL 15/21] hw/misc: Add clock converter in NPCM7XX CLK module, Peter Maydell, 2021/01/12
- [PULL 18/21] hw/misc: Add a PWM module for NPCM7XX, Peter Maydell, 2021/01/12
- [PULL 17/21] hw/adc: Add an ADC module for NPCM7XX, Peter Maydell, 2021/01/12
- [PULL 19/21] hw/misc: Add QTest for NPCM7XX PWM Module, Peter Maydell, 2021/01/12
- [PULL 20/21] hw/*: Use type casting for SysBusDevice in NPCM7XX, Peter Maydell, 2021/01/12
- [PULL 21/21] ui/cocoa: Fix openFile: deprecation on Big Sur,
Peter Maydell <=