Received: from eggs.gnu.org ([2001:4830:134:3::10]:60213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfVbt-0005GX-5N for qemu-devel@nongnu.org; Fri, 25 Sep 2015 12:12:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfVbn-0005VG-At for qemu-devel@nongnu.org; Fri, 25 Sep 2015 12:12:33 -0400 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:36853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfVbn-0005V9-7J for qemu-devel@nongnu.org; Fri, 25 Sep 2015 12:12:27 -0400 Received: by qgx61 with SMTP id 61so73110933qgx.3 for ; Fri, 25 Sep 2015 09:12:26 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: Date: Fri, 25 Sep 2015 12:12:24 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <20569C53-CE90-4023-B46C-D0EFEE88DCA8@gmail.com> References: <95F1C5B4-8236-49CC-8001-DAECD69B1298@gmail.com> Subject: Re: [Qemu-devel] [PATCH v2] ui/cocoa.m: remove open dialog code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel qemu-devel On Sep 25, 2015, at 12:09 PM, Peter Maydell wrote: > On 23 September 2015 at 16:06, Programmingkid = wrote: >> Removes the open dialog code that runs when no arguments >> are supplied with QEMU. Not everyone needs a hard drive >> or cdrom to boot their target. A user might only need to >> use their target's bios to do work. With that said, >> this patch removes the unneeded open dialog code. >>=20 >> Signed-off-by: John Arbuckle >>=20 >> --- >> Add a dialog box that tells the user to start QEMU from >> the commandline instead of the Finder. >>=20 >> ui/cocoa.m | 66 >> ++++++++++++----------------------------------------------- >> 1 files changed, 14 insertions(+), 52 deletions(-) >>=20 >> diff --git a/ui/cocoa.m b/ui/cocoa.m >> index 334e6f6..dc8e0f6 100644 >> --- a/ui/cocoa.m >> +++ b/ui/cocoa.m >> @@ -814,7 +814,6 @@ QemuCocoaView *cocoaView; >> { >> } >> - (void)startEmulationWithArgc:(int)argc argv:(char**)argv; >> -- (void)openPanelDidEnd:(NSOpenPanel *)sheet >> returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; >> - (void)doToggleFullScreen:(id)sender; >> - (void)toggleFullScreen:(id)sender; >> - (void)showQEMUDoc:(id)sender; >> @@ -896,27 +895,20 @@ QemuCocoaView *cocoaView; >> { >> COCOA_DEBUG("QemuCocoaAppController: = applicationDidFinishLaunching\n"); >>=20 >>=20 >>=20 >> - // Display an open dialog box if no arguments were passed or >> - // if qemu was launched from the finder ( the Finder passes = "-psn" ) >> - if( gArgc <=3D 1 || strncmp ((char *)gArgv[1], "-psn", 4) =3D=3D = 0) { >=20 > Here we look at whether we were passed "-psn" as our check for > whether we were launched from the Finder... >=20 >> + // if the user launched QEMU from the Finder >> + if(gArgc =3D=3D 1) { >=20 > ...but here you have changed the condition. Why? I will change it back to checking for -psn. > (Also, isn't a simple test on gArgc going to cause us to put up > the dialog box even if qemu was started from the command line with > no arguments?) I suppose you are right. Will make a new patch to fix this problem.