From 36eb745eccef50533995624ea4dd8df8c4673296 Mon Sep 17 00:00:00 2001 From: Stefan 'psYchotic' Zwanenburg Date: Sun, 16 Oct 2011 18:30:13 +0200 Subject: [PATCH] PlacesManager: fix .gtk-bookmarks monitor scope The GFileMonitor on ~/.gtk-bookmarks was block-scoped in the PlacesManager._init() function, which caused it to be destroyed as soon as the constructor was done. This caused changes in bookmarks to never be notified to possible watchers (such as the places-menu extension). To fix this, the 'monitor' variable has been promoted to an object instance member. https://bugzilla.gnome.org/show_bug.cgi?id=661921 --- js/ui/placeDisplay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index 4864f2c7b..19f823fff 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -195,9 +195,9 @@ PlacesManager.prototype = { this._bookmarksPath = GLib.build_filenamev([GLib.get_home_dir(), '.gtk-bookmarks']); this._bookmarksFile = Gio.file_new_for_path(this._bookmarksPath); - let monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null); + this._monitor = this._bookmarksFile.monitor_file(Gio.FileMonitorFlags.NONE, null); this._bookmarkTimeoutId = 0; - monitor.connect('changed', Lang.bind(this, function () { + this._monitor.connect('changed', Lang.bind(this, function () { if (this._bookmarkTimeoutId > 0) return; /* Defensive event compression */