Re: how to test whether a Gtk::TreePath is null



On Fri, 2007-08-31 at 19:28 +0200, Milosz Derezynski wrote:
> Yeah i had discussed this in the IRC channel already once i think; in
> our code we also need  to use gobj() to check if it's really NULL.
> 
> As sidenote one should of course use the return value of path_at_pos()
> but there are other cases where it's not always guaranteed that a path
> is actually valid (i don't remember the case i needed it for now but
> it seemed neccessary)

Could you please check your code and tell us where this was necessary.
I'd like to avoid adding unnecessary API and avoid creating the idea
that the TreePath should be checked for validity excessively.

I also don't like the idea of having both the empty-path idea and the
invalid-path idea. I'd rather avoid crashes by making sure that we
return an empty TreePath wherever we currently return a TreePath with a
null gobj(). Hopefully an empty TreePath has no meaning such as "root
item".


-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com




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