[libgda/gtk3] Bug fix in gdaui_new_data_entry() regarding plugins usage
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/gtk3] Bug fix in gdaui_new_data_entry() regarding plugins usage
- Date: Sat, 27 Nov 2010 16:54:12 +0000 (UTC)
commit bbe385049e2cf68124964e82878ca9b29d377fd1
Author: Vivien Malerba <malerba gnome-db org>
Date: Thu Nov 18 20:32:00 2010 +0100
Bug fix in gdaui_new_data_entry() regarding plugins usage
now checks if requested plugin can handle requested type
libgda-ui/gdaui-init.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/libgda-ui/gdaui-init.c b/libgda-ui/gdaui-init.c
index 234509d..695bab1 100644
--- a/libgda-ui/gdaui-init.c
+++ b/libgda-ui/gdaui-init.c
@@ -131,8 +131,20 @@ gdaui_new_data_entry (GType type, const gchar *plugin_name)
}
plugin_struct = g_hash_table_lookup (gdaui_plugins_hash, plugin);
- if (plugin_struct && plugin_struct->entry_create_func)
- entry = (plugin_struct->entry_create_func) (dh, type, options);
+ if (plugin_struct && plugin_struct->entry_create_func) {
+ gboolean allok = TRUE;
+ if (plugin_struct->nb_g_types > 0) {
+ gint i;
+ for (i = 0; i < plugin_struct->nb_g_types; i++) {
+ if (plugin_struct->valid_g_types[i] == type)
+ break;
+ }
+ if (i == plugin_struct->nb_g_types)
+ allok = FALSE;
+ }
+ if (allok)
+ entry = (plugin_struct->entry_create_func) (dh, type, options);
+ }
g_free (plugin);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]