[rygel/rygel-0-14] ui: Remove autostart file first



commit 09c399d3534a2b586b673ea03a3543e4790315dc
Author: Jens Georg <mail jensge org>
Date:   Sat Apr 28 18:48:37 2012 +0200

    ui: Remove autostart file first
    
    Remove autostart file and disable option before trying to shut down a
    running Rygel instance to prevent a shut-down failure leaving an
    autostart file dangling around.

 src/ui/rygel-writable-user-config.vala |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/ui/rygel-writable-user-config.vala b/src/ui/rygel-writable-user-config.vala
index f0217f2..de6a4dc 100644
--- a/src/ui/rygel-writable-user-config.vala
+++ b/src/ui/rygel-writable-user-config.vala
@@ -192,6 +192,13 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig {
                 this.set_bool ("general", UPNP_ENABLED_KEY, true);
             } else {
                 // Stop service only if already running
+                // Then delete the symlink from user's autostart dir
+                try {
+                    dest.delete (null);
+                } catch (IOError.NOT_FOUND err) {}
+
+                this.set_bool ("general", UPNP_ENABLED_KEY, false);
+
                 if (this.is_upnp_enabled ()) {
                     // Create proxy to Rygel
                     DBusInterface rygel_proxy = Bus.get_proxy_sync
@@ -202,13 +209,6 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig {
 
                     rygel_proxy.shutdown ();
                 }
-
-                // Then delete the symlink from user's autostart dir
-                try {
-                    dest.delete (null);
-                } catch (IOError.NOT_FOUND err) {}
-
-                this.set_bool ("general", UPNP_ENABLED_KEY, false);
             }
         } catch (GLib.Error err) {
             string message;



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