[Xfce4-commits] <postler:master> Move new messages to cur when selecting folder

Christian Dywan noreply at xfce.org
Sat Dec 18 20:52:03 CET 2010


Updating branch refs/heads/master
         to 634635446b7a206a41eccf866e4684767208f2e1 (commit)
       from 920c0cea87e3e2c312357fcd54c1c61665d2c57e (commit)

commit 634635446b7a206a41eccf866e4684767208f2e1
Author: Bernd Prünster <bernd.pruenster at gmail.com>
Date:   Sat Dec 18 20:50:48 2010 +0100

    Move new messages to cur when selecting folder
    
    Fixes: https://bugs.launchpad.net/postler/+bug/671538

 postler/postler-folders.vala |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 5fa2036..b7f885f 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -288,10 +288,24 @@ public class Postler.Folders : Gtk.TreeView {
         store.get (iter, Columns.LOCATION, out location,
                          Columns.INFO, out account_info);
         selected_location = location;
-
         if (location != null) {
             messages.populate (location, account_info);
             messages.grab_focus ();
+            try {
+                var folder_dir = File.new_for_path (location + "/new");
+                var enumerator = folder_dir.enumerate_children (
+                    FILE_ATTRIBUTE_STANDARD_NAME, 0);
+                FileInfo file_info;
+                while ((file_info = enumerator.next_file ()) != null) {
+                    var msg = File.new_for_path (
+                        location + "/new/" + file_info.get_name ());
+                    var destination = File.new_for_path (
+                        location + "/cur/" + file_info.get_name ());
+                    msg.move (destination, FileCopyFlags.NONE);
+                }
+            } catch (Error error) {
+                GLib.error (error.message);
+            }
         }
         else
             messages.clear ();



More information about the Xfce4-commits mailing list