All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning
@ 2018-05-29 18:08 John Arbuckle
  2018-05-29 18:11 ` Peter Maydell
  2018-05-29 20:55 ` Eric Blake
  0 siblings, 2 replies; 4+ messages in thread
From: John Arbuckle @ 2018-05-29 18:08 UTC (permalink / raw)
  To: qemu-devel, peter.maydell, patches; +Cc: John Arbuckle

OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and
would rather you use NSModalResponseOK, which was introduced in OS 10.9.
Use the recommended new constant name, with a backward compatibility
define if we're building on an older OSX.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
 ui/cocoa.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index 110b393..c9473f0 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -79,6 +79,13 @@
 #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
 #define NSWindowStyleMaskTitled         NSTitledWindowMask
 #endif
+/* 10.13 deprecates NSFileHandlingPanelOKButton in favor of
+ * NSModalResponseOK, which was introduced in 10.9. Define
+ * it for older versions.
+ */
+#if !defined MAC_OS_X_VERSION_10_9 || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
+#define NSModalResponseOK NSFileHandlingPanelOKButton
+#endif
 
 //#define DEBUG
 
@@ -1218,7 +1225,7 @@ QemuCocoaView *cocoaView;
     [openPanel setCanChooseFiles: YES];
     [openPanel setAllowsMultipleSelection: NO];
     [openPanel setAllowedFileTypes: supportedImageFileTypes];
-    if([openPanel runModal] == NSFileHandlingPanelOKButton) {
+    if([openPanel runModal] == NSModalResponseOK) {
         NSString * file = [[[openPanel URLs] objectAtIndex: 0] path];
         if(file == nil) {
             NSBeep();
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning
  2018-05-29 18:08 [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning John Arbuckle
@ 2018-05-29 18:11 ` Peter Maydell
  2018-05-29 18:12   ` Programmingkid
  2018-05-29 20:55 ` Eric Blake
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2018-05-29 18:11 UTC (permalink / raw)
  To: John Arbuckle; +Cc: QEMU Developers, patches

On 29 May 2018 at 19:08, John Arbuckle <programmingkidx@gmail.com> wrote:
> OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and
> would rather you use NSModalResponseOK, which was introduced in OS 10.9.
> Use the recommended new constant name, with a backward compatibility
> define if we're building on an older OSX.
>
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>  ui/cocoa.m | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index 110b393..c9473f0 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -79,6 +79,13 @@
>  #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
>  #define NSWindowStyleMaskTitled         NSTitledWindowMask
>  #endif
> +/* 10.13 deprecates NSFileHandlingPanelOKButton in favor of
> + * NSModalResponseOK, which was introduced in 10.9. Define
> + * it for older versions.
> + */
> +#if !defined MAC_OS_X_VERSION_10_9 || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
> +#define NSModalResponseOK NSFileHandlingPanelOKButton
> +#endif

We should just define MAC_OS_X_VERSION_10_9 if it's not
defined, the same way we do for the 10_5/10_6/10_10/10_12
constants. I'll respin my patch.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning
  2018-05-29 18:11 ` Peter Maydell
@ 2018-05-29 18:12   ` Programmingkid
  0 siblings, 0 replies; 4+ messages in thread
From: Programmingkid @ 2018-05-29 18:12 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, patches


> On May 29, 2018, at 2:11 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> 
> On 29 May 2018 at 19:08, John Arbuckle <programmingkidx@gmail.com> wrote:
>> OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and
>> would rather you use NSModalResponseOK, which was introduced in OS 10.9.
>> Use the recommended new constant name, with a backward compatibility
>> define if we're building on an older OSX.
>> 
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>> ---
>> ui/cocoa.m | 9 ++++++++-
>> 1 file changed, 8 insertions(+), 1 deletion(-)
>> 
>> diff --git a/ui/cocoa.m b/ui/cocoa.m
>> index 110b393..c9473f0 100644
>> --- a/ui/cocoa.m
>> +++ b/ui/cocoa.m
>> @@ -79,6 +79,13 @@
>> #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
>> #define NSWindowStyleMaskTitled         NSTitledWindowMask
>> #endif
>> +/* 10.13 deprecates NSFileHandlingPanelOKButton in favor of
>> + * NSModalResponseOK, which was introduced in 10.9. Define
>> + * it for older versions.
>> + */
>> +#if !defined MAC_OS_X_VERSION_10_9 || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
>> +#define NSModalResponseOK NSFileHandlingPanelOKButton
>> +#endif
> 
> We should just define MAC_OS_X_VERSION_10_9 if it's not
> defined, the same way we do for the 10_5/10_6/10_10/10_12
> constants. I'll respin my patch.

Sounds like a good idea.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning
  2018-05-29 18:08 [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning John Arbuckle
  2018-05-29 18:11 ` Peter Maydell
@ 2018-05-29 20:55 ` Eric Blake
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2018-05-29 20:55 UTC (permalink / raw)
  To: John Arbuckle, qemu-devel, peter.maydell, patches

On 05/29/2018 01:08 PM, John Arbuckle wrote:

In the subject: s/depreciation/deprecation/

> OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and
> would rather you use NSModalResponseOK, which was introduced in OS 10.9.
> Use the recommended new constant name, with a backward compatibility
> define if we're building on an older OSX.
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>   ui/cocoa.m | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-29 20:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 18:08 [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning John Arbuckle
2018-05-29 18:11 ` Peter Maydell
2018-05-29 18:12   ` Programmingkid
2018-05-29 20:55 ` Eric Blake

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.