delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2012/07/08/13:33:59

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-CT-Class: Clean
X-CT-Score: 0.00
X-CT-RefID: str=0001.0A020206.4FF9C470.0079,ss=1,re=0.000,fgs=0
X-CT-Spam: 0
X-Authority-Analysis: v=1.1 cv=7DTXskVBSpuAR/MBl5itprnUq89zrLWEwH6mAWzvx2I=
c=1 sm=1 a=8iEie87WbnsA:10 a=TsQ8ydHZuZsA:10 a=G8Uczd0VNMoA:10
a=8nJEP1OIZ-IA:10 a=vIu8Bjv99zA89b1LPaaZoA==:17 a=UqJItOvrz1xnB9LjPQIA:9
a=wPNLvfGTeEIA:10 a=vIu8Bjv99zA89b1LPaaZoA==:117
X-CM-Score: 0.00
Authentication-Results: cox.net; none
Message-ID: <4FF9C470.9030204@cox.net>
Date: Sun, 08 Jul 2012 10:33:36 -0700
From: Eric Brombaugh <ebrombaugh1 AT cox DOT net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] [PATCH] gtk hid file chooser problems
References: <4FF8B79E DOT 6000503 AT cox DOT net> <20120708041830 DOT GD1637 AT malakian DOT lan> <4FF9B5D9 DOT 5050809 AT cox DOT net> <20473 DOT 45333 DOT 154735 DOT 732374 AT vagabond DOT local>
In-Reply-To: <20473.45333.154735.732374@vagabond.local>
Reply-To: geda-user AT delorie DOT com

On 07/08/2012 09:11 AM, Patrick Bernaud wrote:
> Hi,
>
> Eric Brombaugh writes:
>   > [...]
>   > +  {
>   > +	gchar *default_path;
>   > +	gchar *uri;
>   > +	default_path = g_file_new_for_path (g_get_current_dir());
>   > +	uri = g_file_get_uri (default_path);
>   > +	gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), uri);
>   > +	g_free (uri);
>   > +  }
>
> A couple of things:
>
> - g_file_new_for_path() returns a GFile*, not a gchar*.
>
> - the string returned by g_get_current_dir() has to be freed and
>    'default_path' possibly unref-ed.

Thanks for the suggestions - I'll look into cleaning this up and resubmit.

I did try to g_free(default_path) while testing this but it always 
resulted in a core dump.

Eric

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019