GNOME Bugzilla – Bug 624296
undo for "remove from favorites" doesn't work
Last modified: 2010-07-20 12:28:20 UTC
JS ERROR: !!! message = 'this._favorites[appId] is undefined' JS ERROR: !!! lineNumber = '106' JS ERROR: !!! fileName = '/home/zaspire/gnome-shell/source/gnome-shell/js/ui/appFavorites.js' JS ERROR: !!! stack = '("transmission.desktop")@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/appFavorites.js:106 ([object Object],[object Object])@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/appDisplay.js:829 ([object Object],[object Object])@/home/zaspire/gnome-shell/install/share/gjs-1.0/lang.js:110 _emit("activate",[object Object])@/home/zaspire/gnome-shell/install/share/gjs-1.0/signals.js:124 ([object Object],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/popupMenu.js:243 ([object Object],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/install/share/gjs-1.0/lang.js:110 _emit("activate",[object _private_Clutter_Event])@/home/zaspire/gnome-shell/install/share/gjs-1.0/signals.js:124 ([object _private_St_Bin],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/popupMenu.js:35 ([object _private_St_Bin],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/install/share/gjs-1.0/lang.js:110
Created attachment 165839 [details] [review] fix "undo remove from favorites" Problem appear after port to GSettings. In GSettings, a change notification is generated immediately from context of the _set() call. In GConf, The "value_changed" signal is emitted whenever the server notifies your client program that a value has changed in the database (100% NOT from context of the _set() call).
(In reply to comment #1) > Created an attachment (id=165839) [details] [review] > fix "undo remove from favorites" > > Problem appear after port to GSettings. > In GSettings, a change notification is generated immediately from context of > the _set() call. > In GConf, The "value_changed" signal is emitted whenever the server notifies > your client program that a value has changed in the database (100% NOT from > context of the _set() call). I am not sure I understand this but you are saying that the notification gets delivered when set is called and not after the value has actually been updated in the database? This sounds weird or even broken.
(In reply to comment #2) > (In reply to comment #1) > I am not sure I understand this but you are saying that the notification gets > delivered when set is called and not after the value has actually been updated > in the database? > This sounds weird or even broken. http://blogs.gnome.org/desrt/2009/06/09/some-nice-gsettings-facts/
Review of attachment 165839 [details] [review]: Should be fine then; and seems to work fine here.
Review of attachment 165839 [details] [review]: I think this is not fixing the problem. The program was failing because of this error: 'this._favorites[appId] is undefined' which was on this line: Main.overview.infoBar.setMessage(_("%s has been removed from your favorites.").format(this._favorites[appId].get_name()), Lang.bind(this, function () { this._addFavorite(appId); })); this._favorites[appId] is undefined because appId is not in this._favorites There is code in this._removeFavorite that will check if appId is in this._favorites and in case it isn't it won't execute the line of code that just failed. In the patch you are assigning the value of this._favorites[appId] before the check is done. The reason why is failing, is because the conditional is wrong, the code that is supposed to check if appId is in this._favorites is not working.