Re: My build_filename() patch



Bug #599578 updated.

2009/10/26 Murray Cumming <murrayc murrayc com>
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




--
Evite spam use o campo Cco
http://emailfalso.blogspot.com/2009/04/voce-sabe-o-que-e-cco.html


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]