After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 75716 - patch for going back to last article
patch for going back to last article
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
0.11.2
Other All
: Normal normal
: 0.11.3
Assigned To: Charles Kerr
Charles Kerr
Depends on:
Blocks:
 
 
Reported: 2002-03-21 08:13 UTC by Colin Leroy
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch (apply with -p1). (3.88 KB, patch)
2002-03-21 08:14 UTC, Colin Leroy
none Details | Review
updated patch to correct a segfault (3.94 KB, patch)
2002-03-22 14:21 UTC, Colin Leroy
none Details | Review
a cleaner patch with your 1), 2) and 3) advices. apply with -p1 (5.30 KB, patch)
2002-03-23 10:25 UTC, Colin Leroy
none Details | Review

Description Colin Leroy 2002-03-21 08:13:51 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
Comment 1 Colin Leroy 2002-03-21 08:14:56 UTC
Created attachment 7283 [details] [review]
the patch (apply with -p1).
Comment 2 Colin Leroy 2002-03-22 14:21:20 UTC
Created attachment 7309 [details] [review]
updated patch to correct a segfault
Comment 3 Charles Kerr 2002-03-22 18:10:50 UTC
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!
Comment 4 Colin Leroy 2002-03-23 10:25:20 UTC
Created attachment 7326 [details] [review]
a cleaner patch with your 1), 2) and 3) advices. apply with -p1
Comment 5 Charles Kerr 2002-03-25 01:00:57 UTC
Committed to pan-0-11-fix