[Xfce4-commits] <postler:master> Create an autostart file when creating an account

Christian Dywan noreply at xfce.org
Wed Feb 16 02:20:01 CET 2011


Updating branch refs/heads/master
         to 7627b2ede280de34b664f5509e73e16df24432fa (commit)
       from 689d72fff7fbd8a46ecd9e6f0b617be1df9fa27b (commit)

commit 7627b2ede280de34b664f5509e73e16df24432fa
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Feb 16 02:19:02 2011 +0100

    Create an autostart file when creating an account
    
    The file is deleted when the last account is removed just
    like the message indicator file.

 postler/postler-accounts.vala |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/postler/postler-accounts.vala b/postler/postler-accounts.vala
index c6d0464..8abc2b3 100644
--- a/postler/postler-accounts.vala
+++ b/postler/postler-accounts.vala
@@ -215,6 +215,18 @@ public class Postler.Accounts : GLib.Object {
         else if (infos.length () == 0)
             FileUtils.unlink (filename);
 
+        string autostart_path = config_dir + "/autostart";
+        filename = autostart_path + "/postler.desktop";
+        exists = FileUtils.test (filename, FileTest.EXISTS);
+        if (infos.length () != 0 && !exists) {
+            DirUtils.create_with_parents (autostart_path, 0700);
+            FileUtils.set_contents (filename,
+                "[Desktop Entry]\nVersion=1.0\nType=Application\nName=Postler\n"
+              + "Exec=postler -m service\nIcon=internet-mail");
+        }
+        else if (infos.length () == 0)
+            FileUtils.unlink (filename);
+
         update_display_names ();
     }
 



More information about the Xfce4-commits mailing list