GNOME Bugzilla – Bug 667808
Accept -1 as the position where insert an element in list and tree stores
Last modified: 2012-07-12 12:41:14 UTC
Created attachment 205128 [details] [review] Accept -1 as the position where insert an element in list and tree stores Using position -1 to append to a store is convenient and was already partially supported by the list and tree stores [1], and is already used by some applications (SoundJuicer, Rhythmbox, maybe others). However, the feature wasn't documented and gtk_list_store_insert() didn't support it, in contrast to gtk_list_store_insert_with_values() for example. So, document this and fix gtk_list_store_insert() to accept it too, as does the other insert functions. [1] their underlying data structures, namely GSequence and GNode, did support it
Review of attachment 205128 [details] [review]: Looks fine to me.
The following fixes have been pushed: 0b5f129 Consistently allow -1 to mean 'append' in tree models 3d7a2d7 Ensure that XDG_DATA_HOME is created before using it
Created attachment 218617 [details] [review] Consistently allow -1 to mean 'append' in tree models Both GtkListStore and GtkTreeStore had a few methods that allowed -1 to mean 'append' when specified as a position, but others that demanded positive position arguments. Make this consistent by always allowing -1.
Created attachment 218618 [details] [review] Ensure that XDG_DATA_HOME is created before using it The recently-used.xbel storage for recently used files is located inside the $XDG_DATA_HOME directory; there's no actual guarantee that the directory has been created already, even though it's very highly probable on any modern distribution. We should create it, along with its intermediate parents, before constructing the file monitor that we use to get change notifications. https://bugzilla.gnome.org/show_bug.cgi?id=671817