GNOME Bugzilla – Bug 162298
[PATCH] GConf cleanup
Last modified: 2004-12-27 18:40:06 UTC
This is a patch to cleanup the use of GConf in Muine (patch is against CVS as of 2004-12-26 but should also work against 0.7.0). This patch should not change how Muine operates. If it does, it is a bug! Overview: 2004-12-26 Tamara Roberson <foxxygirltamara@gmail.com> * src/AddAlbumWindow.cs: * src/AddSongWindow.cs: * src/CoverDatabase.cs: * src/FileSelector.cs: * src/GnomeProxy.cs: * src/InfoWindow.cs: * src/Muine.cs: * src/PlaylistWindow.cs: * src/SongDatabase.cs: Cleaned up GConf code. Number of lines removed: 140 Number of lines added: 41 Stability: This patch is not expected to break anything. Description: public static object Muine.GetGConfValue (string key) Get the value of "key" in GConf (see Muine.GConfClient). public static object Muine.GetGConfValue (string key, object default_val) Same as Muine.GetGConfValue (string key) but returns "default_val" on all exceptions. public static void Muine.SetGConfValue (string key, object val) Sets the value of the GConf key "key" to "val". --- Using Muine.GetGConfValue () allows a net difference of 99 lines to be removed from the code by replacing this common construct: int width; try { width = (int) Muine.GConfClient.Get ("/apps/muine/add_album_window/width"); } catch { width = 350; } with: int width = (int) Muine.GetGConfValue ("/apps/muine/add_album_window/width", 350); The Muine.GetGConfValue () method is not currently used. It simply calls Muine.GConfClient.Get (). The Muine.SetGConfValue () method is simply provided for symmetry with Muine.GetGConfValue (). This patch changes all instances of Muine.GConfClient.Get () and Muine.GConfClient.Set () and replaces them with Muine.GetGConfValue () and Muine.GetGconfValue () respectively.
Created attachment 35212 [details] [review] GConf cleanup patch
Committed, thanks again!