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

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
MIME-Version: 1.0
Message-ID: <20473.45333.154735.732374@vagabond.local>
Date: Sun, 8 Jul 2012 18:11:01 +0200
From: Patrick Bernaud <patrickb AT chez DOT com>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] [PATCH] gtk hid file chooser problems
In-Reply-To: <4FF9B5D9.5050809@cox.net>
References: <4FF8B79E DOT 6000503 AT cox DOT net>
<20120708041830 DOT GD1637 AT malakian DOT lan>
<4FF9B5D9 DOT 5050809 AT cox DOT net>
X-Mailer: VM 8.1.0 under 23.2.1 (i486-pc-linux-gnu)
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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.

Regards,

-- 
Patrick Bernaud

- Raw text -


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