[gnome-shell] autorun-manager: Fix 'destroy' handler of resident source



commit 86818e9c529d80cc610c1923468b9470258b5fad
Author: Florian MÃllner <fmuellner gnome org>
Date:   Wed Jul 13 21:22:35 2011 +0200

    autorun-manager: Fix 'destroy' handler of resident source
    
    If the resident source is destroyed, it should be recreated
    immediately, so that it is available when another volume is
    mounted. However, we only connect to the 'destroy' signal
    on the original source, not on newly created ones. As a result,
    the resident source only works twice, after that it shows up
    without icon and an empty notification.
    
    Fix by always connecting to the source's 'destroy' signal.

 js/ui/autorunManager.js |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js
index 5ba4868..2eb2bdd 100644
--- a/js/ui/autorunManager.js
+++ b/js/ui/autorunManager.js
@@ -164,11 +164,7 @@ AutorunManager.prototype = {
                                               this._onMountRemoved));
 
         this._transDispatcher = new AutorunTransientDispatcher();
-        this._residentSource = new AutorunResidentSource();
-        this._residentSource.connect('destroy', Lang.bind(this,
-            function() {
-                this._residentSource = new AutorunResidentSource();
-            }));
+        this._createResidentSource();
 
         let mounts = this._volumeMonitor.get_mounts();
 
@@ -182,6 +178,13 @@ AutorunManager.prototype = {
         }));
     },
 
+    _createResidentSource: function() {
+        this._residentSource = new AutorunResidentSource();
+        this._residentSource.connect('destroy',
+                                     Lang.bind(this,
+                                               this._createResidentSource));
+    },
+
     _onMountAdded: function(monitor, mount) {
         // don't do anything if our session is not the currently
         // active one



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