[Xfce4-commits] <postler:master> Optimise fetching for single accounts

Christian Dywan noreply at xfce.org
Tue Dec 21 20:50:02 CET 2010


Updating branch refs/heads/master
         to 98ff70d5ffa8268038148ba0a226612db4a5a5d5 (commit)
       from ad213ee01dbba5ee8cb2981ba14da6a8513446b0 (commit)

commit 98ff70d5ffa8268038148ba0a226612db4a5a5d5
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Dec 20 23:18:29 2010 +0100

    Optimise fetching for single accounts

 postler/postler-bureau.vala  |    4 ++--
 postler/postler-service.vala |   14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 4bccc19..1dece50 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -333,7 +333,7 @@ public class Postler.Bureau : Gtk.Window {
     void action_account_new () {
         AccountSetup.new_account ().done.connect ((setup, info) => {
             accounts.add_info (info);
-            client.fetch ();
+            client.fetch (info.name);
             folders.populate ();
         } );
     }
@@ -656,7 +656,7 @@ public class Postler.Bureau : Gtk.Window {
                 messages.parent.set_no_show_all (false);
                 messages.parent.show_all ();
                 accounts.add_info (info);
-                client.fetch ();
+                client.fetch (info.name);
                 folders.populate ();
             });
         }
diff --git a/postler/postler-service.vala b/postler/postler-service.vala
index c7723c3..58f4502 100644
--- a/postler/postler-service.vala
+++ b/postler/postler-service.vala
@@ -159,24 +159,24 @@ namespace Postler {
                 try {
                     string command = accounts.get_fetch_command (info);
                     string output;
-                    Process.spawn_sync (null, command.split (" "), null, SpawnFlags.SEARCH_PATH, null, out output);
+                    Process.spawn_sync (null, command.split (" "), null,
+                                        SpawnFlags.SEARCH_PATH, null, out output);
                     GLib.debug ("%s -> %s", info.path, output);
                     string[] folders = ((output.split ("INBOX\n"
                                         + "Channel local-remote\n"
                                         + "Opening slave local...\n"
                                         + "local-remote:"))[1]).split ("\n");
                     /* INBOX is always needed */
-                    DirUtils.create (info.path + "/INBOX", 0700);
-                    DirUtils.create (info.path + "/INBOX/new", 0700);
+                    DirUtils.create_with_parents (info.path + "/INBOX/new", 0700);
                     DirUtils.create (info.path + "/INBOX/cur", 0700);
                     DirUtils.create (info.path + "/INBOX/tmp", 0700);
                     foreach (string current_folder in folders) {
                         if (current_folder == "")
                             continue;
-                        DirUtils.create (info.path + "/" + current_folder.replace ("/", "~-"), 0700);
-                        DirUtils.create (info.path + "/" + current_folder.replace ("/", "~-") + "/new", 0700);
-                        DirUtils.create (info.path + "/" + current_folder.replace ("/", "~-") + "/cur", 0700);
-                        DirUtils.create (info.path + "/" + current_folder.replace ("/", "~-") + "/tmp", 0700);
+                        string folder = info.path + "/" + current_folder.replace ("/", "~-");
+                        DirUtils.create_with_parents (folder + "/new", 0700);
+                        DirUtils.create (folder + "/cur", 0700);
+                        DirUtils.create (current_folder + "/tmp", 0700);
                     }
                 } catch (Error error) {
                     return false;



More information about the Xfce4-commits mailing list