[rygel] core: Add Rygel to user's autostart list



commit caf99e1f43331a67fea61977665d656efb0506e8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jun 8 16:35:13 2009 +0300

    core: Add Rygel to user's autostart list
    
    Add Rygel to user's autostart list if "Enable UPnP/DLNA" flag is set.

 src/rygel/rygel-configuration.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-configuration.vala b/src/rygel/rygel-configuration.vala
index cb6e00b..dc4ea0e 100644
--- a/src/rygel/rygel-configuration.vala
+++ b/src/rygel/rygel-configuration.vala
@@ -66,10 +66,24 @@ public class Rygel.Configuration : GLib.Object {
                 try {
                     uint32 res;
 
+                    // Start service first
                     this.dbus_obj.StartServiceByName (RYGEL_SERVICE,
                                                       (uint32) 0,
                                                       out res);
 
+                    // Then copy the desktop file to user's autostart dir
+                    var source_path = Path.build_filename (
+                                                    BuildConfig.DESKTOP_DIR,
+                                                    "rygel.desktop");
+                    var dest_path = Path.build_filename (
+                                        Environment.get_user_config_dir (),
+                                        "autostart",
+                                        "rygel.desktop");
+                    var source = File.new_for_path (source_path);
+                    var dest = File.new_for_path (dest_path);
+
+                    source.copy (dest, FileCopyFlags.OVERWRITE, null, null);
+
                     this.set_bool ("general", ENABLED_KEY, value);
                 } catch (DBus.Error err) {
                     warning ("Failed to start Rygel service: %s\n",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]