[Xfce4-commits] <postler:master> Only hide viewer when the folder really changes

Christian Dywan noreply at xfce.org
Wed Nov 17 04:00:01 CET 2010


Updating branch refs/heads/master
         to 3f44aed16f731cbdbabe991e5a9fb1fbd6ed215b (commit)
       from 5297212a5bf4fa38c95a33376a571272c4176149 (commit)

commit 3f44aed16f731cbdbabe991e5a9fb1fbd6ed215b
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Nov 17 03:58:06 2010 +0100

    Only hide viewer when the folder really changes
    
    Fixes: https://bugs.launchpad.net/postler/+bug/671976

 postler/postler-bureau.vala   |    6 +++++-
 postler/postler-messages.vala |   13 ++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 9d1ea1d..22de8dc 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -533,8 +533,12 @@ public class Postler.Bureau : Gtk.Window {
         viewer.show_all ();
         viewer.set_no_show_all (true);
         viewer.hide ();
+        messages.notify["location"].connect ((object, pspec) => {
+            viewer.hide ();
+        });
         messages.notify["selected-location"].connect ((object, pspec) => {
-            viewer.visible = messages.selected_location != null;
+            if (messages.selected_location != null)
+                viewer.show ();
         });
         vpaned.pack2 (viewer, false, true);
         shelf.show_all ();
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index 1c27481..23b0036 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -18,11 +18,12 @@ public class Postler.Messages : Gtk.TreeView {
     public bool hide_read { get; set; }
     public bool rich_rows { get; set; default = true; }
     public bool show_attachments { get; set; default = false; }
-    public string? selected_location { get; set; }
     public bool newest_at_the_bottom { get; set; default = false; }
+    
+    public string? location { get; set; }
+    public string? selected_location { get; set; }
 
     string to_or_from;
-    string last_location;
     string last_filter = "";
     FileMonitor[] folder_monitors = {};
 
@@ -466,7 +467,7 @@ public class Postler.Messages : Gtk.TreeView {
 
     public void search (string filter, string header="subject") {
         last_filter = filter;
-        populate (last_location, filter.down (), header);
+        populate (location, filter.down (), header);
     }
 
     private struct Message {
@@ -691,7 +692,9 @@ public class Postler.Messages : Gtk.TreeView {
                 location, error.message);
         }
 
-        last_location = location;
+        /* Avoid changing 'location' to not cause property notification */
+        if (this.location != location)
+            this.location = location;
         return false;
     }
 
@@ -828,7 +831,7 @@ public class Postler.Messages : Gtk.TreeView {
     }
 
     public void delete_selected () {
-        if (last_location.has_suffix ("/Trash"))
+        if (location.has_suffix ("/Trash"))
             move_selected (null);
         else
             move_selected ("Trash");



More information about the Xfce4-commits mailing list