Index: pan/gui/gui.cc
===================================================================
RCS file: /cvs/gnome/pan2/pan/gui/gui.cc,v
retrieving revision 1.6
diff -u -r1.6 gui.cc
--- pan/gui/gui.cc	31 Oct 2006 00:36:06 -0000	1.6
+++ pan/gui/gui.cc	9 Nov 2006 16:45:51 -0000
@@ -1357,8 +1359,11 @@
     _data.get_group_counts (group, unread, total);
     if (!total)
       activate_action ("download-headers");
-    else if (_prefs.get_flag("get-new-headers-when-entering-group", true))
+    else if (_prefs.get_flag("get-new-headers-when-entering-group", true)) {
+      if (_prefs.get_flag ("mark-group-read-before-xover", false))
+        _data.mark_group_read (group);
       _queue.add_task (new TaskXOver (_data, group, TaskXOver::NEW), Queue::TOP);
+    }
   }
 }
 void GUI :: do_mark_selected_groups_read ()
@@ -1376,8 +1381,12 @@
 void GUI :: do_xover_selected_groups ()
 {
   const quarks_t group_names (_group_pane->get_full_selection ());
-  foreach_const (quarks_t, group_names, it)
+  const bool mark_read (_prefs.get_flag ("mark-group-read-before-xover", false));
+  foreach_const (quarks_t, group_names, it) {
+    if (mark_read)
+      _data.mark_group_read (*it);
     _queue.add_task (new TaskXOver (_data, *it, TaskXOver::NEW), Queue::TOP);
+  }
 }
 
 void GUI :: do_xover_subscribed_groups ()
@@ -1385,8 +1394,12 @@
   typedef std::vector<Quark> quarks_v;
   quarks_v groups;
   _data.get_subscribed_groups (groups);
-  foreach_const_r (quarks_v, groups, it)
+  const bool mark_read (_prefs.get_flag ("mark-group-read-before-xover", false));
+  foreach_const_r (quarks_v, groups, it) {
+    if (mark_read)
+      _data.mark_group_read (*it);
     _queue.add_task (new TaskXOver (_data, *it, TaskXOver::NEW), Queue::TOP);
+  }
 }
 
 void GUI :: do_download_headers ()
Index: pan/gui/dl-headers-ui.cc
===================================================================
RCS file: /cvs/gnome/pan2/pan/gui/dl-headers-ui.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 dl-headers-ui.cc
--- pan/gui/dl-headers-ui.cc	2 Oct 2006 20:45:39 -0000	1.1.1.1
+++ pan/gui/dl-headers-ui.cc	9 Nov 2006 16:46:10 -0000
@@ -65,6 +65,8 @@
 
     if (response == GTK_RESPONSE_ACCEPT)
     {
+      const bool mark_read (state->prefs.get_flag ("mark-group-read-before-xover", false));
+
       foreach_const (quarks_t, state->groups, it) {
         Task * task;
         if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(state->all_headers_rb)))
@@ -75,6 +77,8 @@
           task = new TaskXOver (state->data, *it, TaskXOver::SAMPLE, n_headers);
         else // n days
           task = new TaskXOver (state->data, *it, TaskXOver::DAYS, n_days);
+        if (mark_read)
+          state->data.mark_group_read (*it);
         state->queue.add_task (task);
       }
     }
