GNOME Bugzilla – Bug 75716
patch for going back to last article
Last modified: 2004-12-22 21:47:04 UTC
Hello, I made a little patch to allow user to go back to the last article he read (useful in case of quick reading ;). Here it is (in case I can't attach it here) : http://colin.net/patches/pan-0.11.2-previous.patch
Created attachment 7283 [details] [review] the patch (apply with -p1).
Created attachment 7309 [details] [review] updated patch to correct a segfault
I like this idea, but would like to see another revision to the patch. :) 1. Holding a pointer to a GtkCTreeNode is probably not the way to go: the node will be freed if someone deletes the article, fetches new articles, or changes the filter. An Article* would be a little safer from filters or "get new" but still fails if the article is deleted. Instead Pan should keep a GString in articlelist.c to hold the prev's message-id: g_string_assign (prev_message_id, article_get_message_id(a)); then articlelist_read_message_id() could be used when `prev article' is hit by the user. 2. prev_message_id needs to be zeroed out whenever my_group changes. I think my_group only changes in clear_group_nolock() and set_group_mainthread_end(). 3. update_menus_idle() needs to be synced up with the two new menu buttons. articlelist should probably get a public function "gboolean articlelist_has_prev(void)" (which just returns prev_message_id->len!=0) to tell update_menus_idle() to sensitize the buttons or not. If this ok to you, please submit another patch. Thanks a lot for taking time to work on Pan!
Created attachment 7326 [details] [review] a cleaner patch with your 1), 2) and 3) advices. apply with -p1
Committed to pan-0-11-fix