[Xfce4-commits] <postler:master> Retain unique filename part when moving messages

Christian Dywan noreply at xfce.org
Sat Nov 20 22:46:01 CET 2010


Updating branch refs/heads/master
         to cf20c8589b3465b339c3f3c66838f0272fd59393 (commit)
       from c3b8cdeab46d69836d5855acc3ad950f0c2bffa3 (commit)

commit cf20c8589b3465b339c3f3c66838f0272fd59393
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Nov 20 21:43:19 2010 +0100

    Retain unique filename part when moving messages
    
    This needs to work the same way as toggling flags.

 postler/postler-messages.vala |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 6d7ca38..42e5a24 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -894,10 +894,16 @@ public class Postler.Messages : Gtk.TreeView {
                                 return;
                             }
                         }
-                        /* FIXME: Provide a way to retain or specify flags */
-                        string filename = destination_path + "/cur/"
-                            + generate_maildir_filename ("S");
-                        var destination_file = File.new_for_path (filename);
+
+                        string bare_filename;
+                        string flags = flags_from_filename (location, out bare_filename);
+                        string filename;
+                        if ("S" in flags)
+                            filename = Path.get_basename (bare_filename) + ":" + flags;
+                        else
+                            filename = toggle_flag (location, 'S');
+                        string new_location = destination_path + "/cur/" + filename;
+                        var destination_file = File.new_for_path (new_location);
                         file.move (destination_file, 0, null, null);
                     }
 



More information about the Xfce4-commits mailing list