qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: "Cameron Esfahani" <dirty@apple.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Will Cohen" <wwcohen@gmail.com>,
	"Akihiko Odaki" <akihiko.odaki@gmail.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Roman Bolshakov" <r.bolshakov@yadro.com>,
	"Li Zhang" <lizhang@suse.de>
Subject: Re: [PATCH v4 12/13] ui/cocoa: Remove allowedFileTypes restriction in SavePanel
Date: Sat, 12 Feb 2022 14:25:42 +0100	[thread overview]
Message-ID: <5538947.yAnU0GCVav@silver> (raw)
In-Reply-To: <20220211163434.58423-13-f4bug@amsat.org>

On Freitag, 11. Februar 2022 17:34:33 CET Philippe Mathieu-Daudé via wrote:
> setAllowedFileTypes is deprecated in macOS 12.
> 
> Per Akihiko Odaki [*]:
> 
>   An image file, which is being chosen by the panel, can be a
>   raw file and have a variety of file extensions and many are not
>   covered by the provided list (e.g. "udf"). Other platforms like
>   GTK can provide an option to open a file with an extension not
>   listed, but Cocoa can't. It forces the user to rename the file
>   to give an extension in the list. Moreover, Cocoa does not tell
>   which extensions are in the list so the user needs to read the
>   source code, which is pretty bad.
> 
> Since this code is harming the usability rather than improving it,
> simply remove the [NSSavePanel allowedFileTypes:] call, fixing:
> 
>   [2789/6622] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o
>   ui/cocoa.m:1411:16: error: 'setAllowedFileTypes:' is deprecated: first
> deprecated in macOS 12.0 - Use -allowedContentTypes instead
> [-Werror,-Wdeprecated-declarations] [openPanel setAllowedFileTypes:
> supportedImageFileTypes];
>                  ^
>  
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Framewor
> ks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: property
> 'allowedFileTypes' is declared deprecated here @property (nullable, copy)
> NSArray<NSString *> *allowedFileTypes API_DEPRECATED("Use
> -allowedContentTypes instead", macos(10.3,12.0)); ^
>  
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Framewor
> ks/AppKit.framework/Headers/NSSavePanel.h:215:49: note:
> 'setAllowedFileTypes:' has been explicitly marked deprecated here FAILED:
> libcommon.fa.p/ui_cocoa.m.o
> 
> [*]
> https://lore.kernel.org/qemu-devel/4dde2e66-63cb-4390-9538-c032310db3e3@gma
> il.com/
> 
> Suggested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
> Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
> Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>

>  ui/cocoa.m | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index ac18e14ce0..7a1ddd4075 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -100,7 +100,6 @@ static int gArgc;
>  static char **gArgv;
>  static bool stretch_video;
>  static NSTextField *pauseLabel;
> -static NSArray * supportedImageFileTypes;
> 
>  static QemuSemaphore display_init_sem;
>  static QemuSemaphore app_started_sem;
> @@ -1168,10 +1167,6 @@ QemuCocoaView *cocoaView;
>          [pauseLabel setTextColor: [NSColor blackColor]];
>          [pauseLabel sizeToFit];
> 
> -        // set the supported image file types that can be opened
> -        supportedImageFileTypes = [NSArray arrayWithObjects: @"img",
> @"iso", @"dmg", -                                 @"qcow", @"qcow2",
> @"cloop", @"vmdk", @"cdr", -                                  @"toast",
> nil];
>          [self make_about_window];
>      }
>      return self;
> @@ -1414,7 +1409,6 @@ QemuCocoaView *cocoaView;
>      openPanel = [NSOpenPanel openPanel];
>      [openPanel setCanChooseFiles: YES];
>      [openPanel setAllowsMultipleSelection: NO];
> -    [openPanel setAllowedFileTypes: supportedImageFileTypes];
>      if([openPanel runModal] == NSModalResponseOK) {
>          NSString * file = [[[openPanel URLs] objectAtIndex: 0] path];
>          if(file == nil) {




  reply	other threads:[~2022-02-12 13:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 16:34 [PATCH v4 00/13] host: Support macOS 12 Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 01/13] lcitool: refresh Philippe Mathieu-Daudé via
2022-02-12 15:14   ` Akihiko Odaki
2022-02-14 12:10     ` Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 02/13] configure: Allow passing extra Objective C compiler flags Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 03/13] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 04/13] hvf: Use standard CR0 and CR4 register definitions Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 05/13] hvf: Fix OOB write in RDTSCP instruction decode Philippe Mathieu-Daudé via
2022-02-14 12:49   ` Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 06/13] hvf: Enable RDTSCP support Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 07/13] hvf: Make hvf_get_segments() / hvf_put_segments() local Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 08/13] hvf: Remove deprecated hv_vcpu_flush() calls Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 09/13] block/file-posix: Remove a deprecation warning on macOS 12 Philippe Mathieu-Daudé via
2022-02-12 13:35   ` Christian Schoenebeck
2022-02-14  3:27   ` Cameron Esfahani
2022-02-11 16:34 ` [PATCH v4 10/13] audio/coreaudio: " Philippe Mathieu-Daudé via
2022-02-12 13:15   ` Christian Schoenebeck
2022-02-12 15:23   ` Akihiko Odaki
2022-02-12 17:27     ` Christian Schoenebeck
2022-02-12 17:41       ` Christian Schoenebeck
2022-02-14 12:43     ` Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 11/13] audio/dbus: Fix building with modules on macOS Philippe Mathieu-Daudé via
2022-02-11 16:34 ` [PATCH v4 12/13] ui/cocoa: Remove allowedFileTypes restriction in SavePanel Philippe Mathieu-Daudé via
2022-02-12 13:25   ` Christian Schoenebeck [this message]
2022-02-14  3:26   ` Cameron Esfahani
2022-02-11 16:34 ` [PATCH v4 13/13] gitlab-ci: Support macOS 12 via cirrus-run Philippe Mathieu-Daudé via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5538947.yAnU0GCVav@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=akihiko.odaki@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=dirty@apple.com \
    --cc=f4bug@amsat.org \
    --cc=lizhang@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --cc=wwcohen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).