Re: [Nautilus-list] [PATCH] Make EelTextCaption behave properly inpreferences
- From: Miguel Rodríguez Pérez <migrax terra es>
- To: Darin Adler <darin bentspoon com>
- Cc: migras atlas uvigo es, Lista de nautilus <nautilus-list lists eazel com>
- Subject: Re: [Nautilus-list] [PATCH] Make EelTextCaption behave properly inpreferences
- Date: 20 May 2001 12:49:36 +0200
El 19 May 2001 17:29:17 -0700, Darin Adler escribió:
> On Saturday, May 19, 2001, at 04:47 PM, Miguel Rodríguez Pérez wrote:
>
> > Please ignore my previous patch, it works fine, but it can be done much
> > simpler...
>
> The concept of this patch is good.
>
> To match Nautilus style guidelines, it needs to do "strcmp (xxx, yyy) == 0"
> rather than "!strcmp(xxx, yyy)". Note both the space after the name of
> the function before the parenthesis, and use of == 0 with strcmp, not !.
> Also, the single statement inside the if needs to be surrounded by braces
> as described in the style guide document (nautilus/doc/style-guide.html).
>
I have made the changes, altough I didn't found anything about strcmp in
the style guide (haven't looked in the Gnome Programming GuideLines).
Anyway, here goes the updated patch...
> If you fix these minor style issues, it would be fine to commit this
> change.
>
> -- Darin
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/eel/ChangeLog,v
retrieving revision 1.95
diff -p -u -r1.95 ChangeLog
--- ChangeLog 2001/05/17 23:00:38 1.95
+++ ChangeLog 2001/05/20 10:36:31
@@ -1,3 +1,10 @@
+2001-05-20 Miguel Rodríguez Pérez <migras atlas uvigo es>
+
+ * eel/eel-preferences-item.c
+ (preferences_item_update_editable_string):
+ (preferences_item_update_editable_integer): Only update
+ text if it changed.
+
2001-05-17 Darin Adler <darin eazel com>
* eel/eel-gtk-extensions.c:
Index: eel/eel-preferences-item.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-preferences-item.c,v
retrieving revision 1.2
diff -p -u -r1.2 eel-preferences-item.c
--- eel/eel-preferences-item.c 2001/05/04 13:00:14 1.2
+++ eel/eel-preferences-item.c 2001/05/20 10:36:34
@@ -563,7 +563,12 @@ preferences_item_update_editable_string
current_value = eel_preferences_get (item->details->preference_name);
g_assert (current_value != NULL);
- eel_text_caption_set_text (EEL_TEXT_CAPTION (item->details->main_child), current_value);
+ if (strcmp (eel_text_caption_get_text (EEL_TEXT_CAPTION (item->details->main_child)),
+ current_value) != 0) {
+ eel_text_caption_set_text (EEL_TEXT_CAPTION (item->details->main_child),
+ current_value);
+ }
+
g_free (current_value);
}
@@ -612,7 +617,13 @@ preferences_item_update_editable_integer
current_value = g_strdup_printf ("%d", eel_preferences_get_integer (item->details->preference_name));
g_assert (current_value != NULL);
- eel_text_caption_set_text (EEL_TEXT_CAPTION (item->details->main_child), current_value);
+
+ if (strcmp (eel_text_caption_get_text (EEL_TEXT_CAPTION (item->details->main_child)),
+ current_value) != 0) {
+ eel_text_caption_set_text (EEL_TEXT_CAPTION (item->details->main_child),
+ current_value);
+ }
+
g_free (current_value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]