anjuta r4697 - in trunk: . plugins/sourceview
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4697 - in trunk: . plugins/sourceview
- Date: Wed, 4 Feb 2009 19:39:07 +0000 (UTC)
Author: jhs
Date: Wed Feb 4 19:39:07 2009
New Revision: 4697
URL: http://svn.gnome.org/viewvc/anjuta?rev=4697&view=rev
Log:
2009-02-04 Johannes Schmid <jhs gnome org>
* plugins/sourceview/sourceview-prefs.c (get_int_default),
(on_gconf_notify_tab_size),
(on_gconf_notify_right_margin_position):
Fix an unlikely critical when deleting gconf values directly
Modified:
trunk/ChangeLog
trunk/plugins/sourceview/sourceview-prefs.c
Modified: trunk/plugins/sourceview/sourceview-prefs.c
==============================================================================
--- trunk/plugins/sourceview/sourceview-prefs.c (original)
+++ trunk/plugins/sourceview/sourceview-prefs.c Wed Feb 4 19:39:07 2009
@@ -50,10 +50,13 @@
#define DESKTOP_FIXED_FONT "/desktop/gnome/interface/monospace_font_name"
static int
-get_int(GConfEntry* entry)
+get_int_default(GConfEntry* entry, gint default_value)
{
GConfValue* value = gconf_entry_get_value(entry);
- return gconf_value_get_int(value);
+ if (value)
+ return gconf_value_get_int(value);
+ else
+ return default_value;
}
static gboolean
@@ -151,7 +154,7 @@
GConfEntry *entry, gpointer user_data)
{
Sourceview *sv;
- gint tab_size = get_int(entry);
+ gint tab_size = get_int_default(entry, 4);
sv = ANJUTA_SOURCEVIEW(user_data);
@@ -225,10 +228,10 @@
static void
on_gconf_notify_right_margin_position (GConfClient *gclient, guint cnxn_id,
- GConfEntry *entry, gpointer user_data)
+ GConfEntry *entry, gpointer user_data)
{
Sourceview *sv;
- gboolean pos = get_bool(entry);
+ gboolean pos = get_int_default(entry, 80);
sv = ANJUTA_SOURCEVIEW(user_data);
gtk_source_view_set_right_margin_position(GTK_SOURCE_VIEW(sv->priv->view),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]