From 09a5c23585ee0c52d22d13cade5ee91027d9af9d Mon Sep 17 00:00:00 2001 From: Paolo Borelli Date: Sat, 25 Mar 2006 11:47:31 +0000 Subject: [PATCH] use g_str_has_prefix instead of a local copy of the function. 2006-03-25 Paolo Borelli * src/prefs.c: use g_str_has_prefix instead of a local copy of the function. --- ChangeLog | 5 +++++ src/prefs.c | 28 ++++------------------------ 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index cdfbdd4e2..a994ad798 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-25 Paolo Borelli + + * src/prefs.c: use g_str_has_prefix instead of a local copy + of the function. + 2006-03-16 Ray Strode Add patch from Elijah Newren to fix type diff --git a/src/prefs.c b/src/prefs.c index 8e762fb6e..eb2b2d0f4 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -525,26 +525,6 @@ meta_prefs_init (void) } #ifdef HAVE_GCONF -/* from eel */ -static gboolean -str_has_prefix (const char *haystack, const char *needle) -{ - const char *h, *n; - - /* Eat one character at a time. */ - h = haystack == NULL ? "" : haystack; - n = needle == NULL ? "" : needle; - do - { - if (*n == '\0') - return TRUE; - if (*h == '\0') - return FALSE; - } - while (*h++ == *n++); - - return FALSE; -} static void change_notify (GConfClient *client, @@ -706,7 +686,7 @@ change_notify (GConfClient *client, if (update_disable_workarounds (b)) queue_changed (META_PREF_DISABLE_WORKAROUNDS); } - else if (str_has_prefix (key, KEY_WINDOW_BINDINGS_PREFIX)) + else if (g_str_has_prefix (key, KEY_WINDOW_BINDINGS_PREFIX)) { const char *str; @@ -722,7 +702,7 @@ change_notify (GConfClient *client, if (update_window_binding (key, str)) queue_changed (META_PREF_WINDOW_KEYBINDINGS); } - else if (str_has_prefix (key, KEY_SCREEN_BINDINGS_PREFIX)) + else if (g_str_has_prefix (key, KEY_SCREEN_BINDINGS_PREFIX)) { const char *str; @@ -787,7 +767,7 @@ change_notify (GConfClient *client, queue_changed (META_PREF_AUTO_RAISE_DELAY); } - else if (str_has_prefix (key, KEY_COMMAND_PREFIX)) + else if (g_str_has_prefix (key, KEY_COMMAND_PREFIX)) { const char *str; @@ -819,7 +799,7 @@ change_notify (GConfClient *client, if (update_terminal_command (str)) queue_changed (META_PREF_TERMINAL_COMMAND); } - else if (str_has_prefix (key, KEY_WORKSPACE_NAME_PREFIX)) + else if (g_str_has_prefix (key, KEY_WORKSPACE_NAME_PREFIX)) { const char *str;