gnome-scan r741 - in trunk: . modules/gsane



Author: bersace
Date: Tue Dec 23 22:33:42 2008
New Revision: 741
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=741&view=rev

Log:
Move gsane_string_in_array to common code.

Modified:
   trunk/ChangeLog
   trunk/modules/gsane/gsane-common.c
   trunk/modules/gsane/gsane-common.h
   trunk/modules/gsane/gsane-option-source.c

Modified: trunk/modules/gsane/gsane-common.c
==============================================================================
--- trunk/modules/gsane/gsane-common.c	(original)
+++ trunk/modules/gsane/gsane-common.c	Tue Dec 23 22:33:42 2008
@@ -69,17 +69,15 @@
 	}
 
 	g_propagate_error(dest, gsane_error_new_from_status(status));
-	g_prefix_error(dest, prefix);
+	g_prefix_error(dest, "%s", prefix);
 }
 
 
 gboolean
-gsane_str_matches_strv (const gchar *name, const gchar **names)
+gsane_string_in_array(const gchar* str, const gchar** array)
 {
-	gint i;
-	for (i = 0; names[i] ; i++) {
-		if (g_ascii_strcasecmp (name, names[i]) == 0)
+	for(; *array; array++)
+		if (g_str_equal(str, *array))
 			return TRUE;
-	}
 	return FALSE;
 }

Modified: trunk/modules/gsane/gsane-common.h
==============================================================================
--- trunk/modules/gsane/gsane-common.h	(original)
+++ trunk/modules/gsane/gsane-common.h	Tue Dec 23 22:33:42 2008
@@ -66,7 +66,7 @@
 GError* gsane_error_new_from_status(SANE_Status status);
 void gsane_propagate_status(GError **dest, SANE_Status status);
 void gsane_propagate_prefixed_status(GError **dest, SANE_Status status, const gchar* format, ...);
-gboolean gsane_str_matches_strv (const gchar *name, const gchar **names);
+gboolean gsane_string_in_array(const gchar* str, const gchar** array);
 
 G_END_DECLS
 

Modified: trunk/modules/gsane/gsane-option-source.c
==============================================================================
--- trunk/modules/gsane/gsane-option-source.c	(original)
+++ trunk/modules/gsane/gsane-option-source.c	Tue Dec 23 22:33:42 2008
@@ -99,15 +99,6 @@
 	NULL
 };
 
-static gboolean
-gsane_string_in_array(const gchar* str, const gchar** array)
-{
-	for(; *array; array++)
-		if (g_str_equal(str, *array))
-			return TRUE;
-	return FALSE;
-}
-
 static void
 gsane_option_source_option_changed(GSaneOptionSource* self, GObject* option)
 {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]