[gnome-db] patch for connection selector



I thought the GnomeDbConnectionSelector widget populated itself when you
created it.  I found that wasn't the case when I went to use the widget
today.

Would it be possible to change this behaviour?  Here is an example
patch:

===[ cut here ]===
libgnomedb/gnome-db-connection-selector.c
24d23
< #include <libgda/libgda.h>
113,122d111
<
<       GList *dsn_list = gda_config_get_data_source_list ();
<       GList *l;
<
<       for (l = dsn_list; l != NULL; l = l->next) {
<               GdaDataSourceInfo *info = (GdaDataSourceInfo *) l->data;
<               gnome_db_option_menu_add_item
(GTK_OPTION_MENU(GTK_WIDGET(selector)), info->name);
<       }
<       gda_config_free_data_source_list (dsn_list);
<
===[ cut here ]===

Ideally instead of using a for() loop I'd just be able to call 
g_list_foreach() and just have a callback that inserts the data.

I wasn't able to get that to work however.  When the code reached the
callback there was no data.

Also I noticed that calling gda_config_get_data_source_list() returns a
doubly-linked list.  I looked that gda-config.c code in libgda and I
didn't see need for it.  

Maybe I missed something but if you don't need the doubly link list you
should use a singly linked list (GSList).  You'll reduce your memory
footprint if you do.

-- 
Loren Bandiera, CISSP <lorenb starchamber ca>
Star Chamber Inc.





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