[PATCH] bugfix for bonobo-object-directory-oaf.c



Hello everyone, 

If you call od_get_server_list with multiple required ids,
the resulting oaf query will only include the last of the required ids you
give it.  Also, oaf needs an uppercase `AND' in the query.



Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.393
diff -u -r1.393 ChangeLog
--- ChangeLog	2000/05/26 18:35:01	1.393
+++ ChangeLog	2000/05/29 23:14:50
@@ -1,3 +1,10 @@
+2000-05-29  Matt Bissiri  <bissiri@eecs.umich.edu>
+
+	* bonobo/bonobo-object-directory-oaf.c (od_get_server_list):
+	Fix bug where only the last element of the required_ids argument
+	was included in the oaf query.
+	Also changed `and' to `AND' in the query, to avoid an oaf parse error.
+	
 2000-05-26  Mike Kestner  <mkestner@ameritech.net>
 
 	* bonobo/bonobo-ui-handler.h,
Index: bonobo/bonobo-object-directory-oaf.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-object-directory-oaf.c,v
retrieving revision 1.7
diff -u -r1.7 bonobo-object-directory-oaf.c
--- bonobo/bonobo-object-directory-oaf.c	2000/05/02 20:48:55	1.7
+++ bonobo/bonobo-object-directory-oaf.c	2000/05/29 23:14:51
@@ -14,7 +14,8 @@
 {
         GList *retval = NULL;
         gchar *query;
-        const gchar** iter;
+        const gchar** required_ids_iter;
+        const gchar** query_components_iter;
         guint n_required = 0;
         gchar **query_components;
         OAF_ServerInfoList *servers;
@@ -25,26 +26,28 @@
         g_return_val_if_fail (*required_ids != NULL, NULL);
 
         /* We need to build a query up from the required_ids */
-        iter = required_ids;
+        required_ids_iter = required_ids;
 
-        while (*iter) {
+        while (*required_ids_iter) {
                 ++n_required;
-                ++iter;
+                ++required_ids_iter;
         }
 
         query_components = g_new0 (gchar*, n_required + 1);
-        
-        iter = required_ids;
+
+        query_components_iter = (const gchar **) query_components;
+        required_ids_iter = required_ids;
 
-        while (*iter) {
-                *query_components = g_strconcat("repo_ids.has('",
-                                                *iter,
-                                                "')",
-                                                NULL);
-                ++iter;
+        while (*required_ids_iter) {
+                *query_components_iter = g_strconcat ("repo_ids.has('",
+                                                      *required_ids_iter,
+                                                      "')",
+                                                      NULL);
+                ++query_components_iter;
+                ++required_ids_iter;
         }
 
-        query = g_strjoinv(" and ", query_components);
+        query = g_strjoinv (" AND ", query_components);
 
         g_strfreev (query_components);
 


-- 
Matt






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