Re: [Evolution-hackers] Beware of GtkTreeRowReference
- From: Matthew Barnes <mbarnes redhat com>
- To: Milan Crha <mcrha redhat com>
- Cc: evolution-hackers gnome org
- Subject: Re: [Evolution-hackers] Beware of GtkTreeRowReference
- Date: Wed, 02 Mar 2011 10:30:58 -0500
On Wed, 2011-03-02 at 09:36 -0500, Matthew Barnes wrote:
> > You might use something less "aggressive", like iterator or path, for
> > local indexes.
>
> Won't work in the general case. As soon as you insert or delete a row
> prior to the row you're tracking, GtkTreeIter and GtkTreePath are both
> invalid. That's why GtkTreeRowReference exists.
Actually I might be wrong about iterators for GtkListStore.
GtkListStore uses a GSequence internally, and it stores a GSequenceIter
in the GtkTreeIter.user_data field. GSequenceIter is supposedly stable;
it remains valid even after the GSequence is sorted.
So maybe GtkTreeIters -would- work for the hash table index using
gtk_tree_iter_copy() and gtk_tree_iter_free(). I'll do some further
testing to verify.
Again this would only work for GtkListStore, but that still covers the
majority of cases if I recall correctly.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]