Re: My build_filename() patch
- From: Murray Cumming <murrayc murrayc com>
- To: Mark Roberts <gtkmm manumark de>
- Cc: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: My build_filename() patch
- Date: Mon, 26 Oct 2009 18:27:18 +0100
On Mon, 2009-10-26 at 11:24 +0100, Mark Roberts wrote:
> Dear Fabrício and list,
>
> Fabrício wrote:
>
> > I submited a patch in #599578[1].
> > Thanks.
> >
> > References:
> > 1- https://bugzilla.gnome.org/show_bug.cgi?id=599578
>
> Your code includes this sort of code a few times:
>
> path = g_build_filename(ustr1.c_str(), ustr2.c_str(), NULLPOINTER);
> Glib::ustring r_path(path);
> g_free(path);
> return r_path;
We have these (inline) utility functions to simplify this:
Glib::convert_const_gchar_ptr_to_ustring()
Glib::convert_return_gchar_ptr_to_ustring()
Glib::convert_const_gchar_ptr_to_stdstring()
Glib::convert_return_gchar_ptr_to_stdstring()
More importantly, filepaths should be std::string, not Glib::ustring,
because they are of unknown encoding.
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]