From nobody Mon Feb 9 05:13:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1641820215; cv=none; d=zohomail.com; s=zohoarc; b=dctvGg25eKb3tX962d9S+NdKmsIRrtr8UZFmNy+wQ/Bo50X36eV7umv5rptQMrY2SeTJy8reb1Ux+VJp6BdAaklZt6EutawzHw/IIkA4QIJTjFFAMQanEZzFvaJtndCxZ1OYJQRI8t5ZmNDzfH7BE3DMcXUc5dSRKHCCNZW8pbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641820215; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7J38PA7fo5uOi1FDkTH3MlYdSdNJH0Ez5wJ7c5zRjGA=; b=ny0HzyUnv7Fb8UjNiKSelTJzn3gI0frF+WWJpMxsCnAchm2o1G45DUlDahJ7LmKoXefJzvYNCbWy17JTZICa+0ycT8vePmWpkONl95pOZS2fIApet68+68sb92GYErj0l5s3yUEHiWKC+8mj9ysu/OoM7nCa89BIFnJ1LWX8NZI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1641820215167282.5609051478108; Mon, 10 Jan 2022 05:10:15 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id f141-20020a1c1f93000000b003497aec3f86so2986wmf.3 for ; Mon, 10 Jan 2022 05:10:14 -0800 (PST) Return-Path: Return-Path: Received: from nuc.. (83.red-83-50-87.dynamicip.rima-tde.net. [83.50.87.83]) by smtp.gmail.com with ESMTPSA id l4sm6632689wrm.62.2022.01.10.05.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 05:10:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7J38PA7fo5uOi1FDkTH3MlYdSdNJH0Ez5wJ7c5zRjGA=; b=SaZoKm9S3wqSqADbVJ+0ZoWzk4nljHmuLkxbidOglgscrdbGbzC6GvxX1Mu7moH3e7 yYPFx38FpJjrkeFzS5RP0wpa/31ePpf/PPOSQbcqWL6KRivZ0qdGodc7KW0v9RHSJBrQ G/dGDhFVlAh7vJ1hz3p8PuxlaaUGzK3D50TM3YUbgtgp/mfiQunAIYj+C3bBW3oTj6ce egbWERUALBhCWQQe3ApDx0eWaha/F7sl7VDdBvmESnOYRrPRVrgOR4Ik2Qi0zRpyLp6k DQLKOWku5LWqlFWSNPAJa4Y9FBX3bJQsJlP2WZ0Wcm1tnK+yZFfLQpk8iwIDj1VAx+YD GXBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7J38PA7fo5uOi1FDkTH3MlYdSdNJH0Ez5wJ7c5zRjGA=; b=TXUg6zftjcTXpWNsR7UyJsaTwW5pCj/1TRld+EwEhLkGxoUixiEhTbcjMG5IYN96qU W0FJjEKxqMwZj54iknDZI9OfdH/XNr6ies+83MSEmpgnRWeYj+pSRXxJ/zTtuCutjm3b wpsZg0oSZBWe4wSK1tgx3U2QDDNtF5Ns5PEA4zMNuU5XRc21GAshqIpbiGPlM9P3qliu zDNtYK7UxG4AOTmzMYtoLd5d5J158EIzqP3nkwnOaZlcROAON+RFT/sHBMkUB3QftftH oGLurk55KzhOtudU1wr5YjbeqNMrb5a+Ea7k8wAzMut3jjnpv+XOmrSCTeNtX7dkuET3 bjqg== X-Gm-Message-State: AOAM530LfZuUv8ERw0Uv8NGUURLZ0iS8uLlHphidey4W7/+QpAy/J6o3 Gu3yzUJMFTweqVFTC7YAsLY= X-Google-Smtp-Source: ABdhPJxr8MoHgU5OZVvs/hmm5M11/b9B2wOkr5WtXqVonyuNzlu7v3cEPr0dZadAmgnyuOyfxhAx1A== X-Received: by 2002:a1c:545b:: with SMTP id p27mr12228387wmi.178.1641820213499; Mon, 10 Jan 2022 05:10:13 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Alexander Graf , Christian Schoenebeck , Cameron Esfahani , Roman Bolshakov , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Wainer dos Santos Moschetta , Peter Maydell , Akihiko Odaki , Thomas Huth Subject: [RFC PATCH v3 2/7] ui/cocoa: Remove allowedFileTypes restriction in SavePanel Date: Mon, 10 Jan 2022 14:09:56 +0100 Message-Id: <20220110131001.614319-3-f4bug@amsat.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220110131001.614319-1-f4bug@amsat.org> References: <20220110131001.614319-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1641820216670100001 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 de= precated in macOS 12.0 - Use -allowedContentTypes instead [-Werror,-Wdeprec= ated-declarations] [openPanel setAllowedFileTypes: supportedImageFileTypes]; ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Framew= orks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: property 'allowed= FileTypes' is declared deprecated here @property (nullable, copy) NSArray *allowedFileTypes API_DEPR= ECATED("Use -allowedContentTypes instead", macos(10.3,12.0)); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Framew= orks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: 'setAllowedFileTy= pes:' 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= @gmail.com/ Suggested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Roman Bolshakov Tested-by: Roman Bolshakov --- ui/cocoa.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 69745c483b4..dec22968815 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -100,7 +100,6 @@ static void cocoa_switch(DisplayChangeListener *dcl, static char **gArgv; static bool stretch_video; static NSTextField *pauseLabel; -static NSArray * supportedImageFileTypes; =20 static QemuSemaphore display_init_sem; static QemuSemaphore app_started_sem; @@ -1162,10 +1161,6 @@ - (id) init [pauseLabel setTextColor: [NSColor blackColor]]; [pauseLabel sizeToFit]; =20 - // set the supported image file types that can be opened - supportedImageFileTypes =3D [NSArray arrayWithObjects: @"img", @"i= so", @"dmg", - @"qcow", @"qcow2", @"cloop", @"vmdk", @"c= dr", - @"toast", nil]; [self make_about_window]; } return self; @@ -1408,7 +1403,6 @@ - (void)changeDeviceMedia:(id)sender openPanel =3D [NSOpenPanel openPanel]; [openPanel setCanChooseFiles: YES]; [openPanel setAllowsMultipleSelection: NO]; - [openPanel setAllowedFileTypes: supportedImageFileTypes]; if([openPanel runModal] =3D=3D NSModalResponseOK) { NSString * file =3D [[[openPanel URLs] objectAtIndex: 0] path]; if(file =3D=3D nil) { --=20 2.33.1