[rygel] core: Remove Rygel from user's autostart list



commit ac23d2714102eeae2d319e912b967c5edb45f651
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Jun 8 16:50:38 2009 +0300

    core: Remove Rygel from user's autostart list
    
    Remove Rygel from user's autostart list if "Enable UPnP/DLNA" flag is
    unset.

 src/rygel/rygel-configuration.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-configuration.vala b/src/rygel/rygel-configuration.vala
index 85b349b..f661bf3 100644
--- a/src/rygel/rygel-configuration.vala
+++ b/src/rygel/rygel-configuration.vala
@@ -90,7 +90,18 @@ public class Rygel.Configuration : GLib.Object {
                 }
             } else if (!value && this.upnp_enabled) {
                 try {
+                    // Stop service first
                     this.rygel_obj.Shutdown ();
+
+                    // Then delete the symlink from user's autostart dir
+                    var dest_path = Path.build_filename (
+                                        Environment.get_user_config_dir (),
+                                        "autostart",
+                                        "rygel.desktop");
+                    var dest = File.new_for_path (dest_path);
+
+                    dest.delete (null);
+
                     this.set_bool ("general", ENABLED_KEY, value);
                 } catch (DBus.Error err) {
                     warning ("Failed to shutdown Rygel service: %s\n",



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