[libgda] GdaBrowser: alphabetically sort tables in objects cloud
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: alphabetically sort tables in objects cloud
- Date: Tue, 7 Sep 2010 19:23:29 +0000 (UTC)
commit bd9c447d607f1790470bfde0371db500252e61bf
Author: Vivien Malerba <malerba gnome-db org>
Date: Tue Sep 7 18:30:58 2010 +0200
GdaBrowser: alphabetically sort tables in objects cloud
tools/browser/common/objects-cloud.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/tools/browser/common/objects-cloud.c b/tools/browser/common/objects-cloud.c
index 2f81ec9..dbedc8a 100644
--- a/tools/browser/common/objects-cloud.c
+++ b/tools/browser/common/objects-cloud.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 The GNOME Foundation
+ * Copyright (C) 2009 - 2010 The GNOME Foundation
*
* AUTHORS:
* Vivien Malerba <malerba gnome-db org>
@@ -134,6 +134,16 @@ objects_cloud_get_type (void)
return type;
}
+static gint
+dbo_sort (GdaMetaDbObject *dbo1, GdaMetaDbObject *dbo2)
+{
+ gint res;
+ res = g_strcmp0 (dbo1->obj_schema, dbo2->obj_schema);
+ if (res)
+ return - res;
+ return - g_strcmp0 (dbo1->obj_name, dbo2->obj_name);
+}
+
typedef struct {
gchar *schema;
GtkTextMark *mark;
@@ -179,6 +189,8 @@ update_display (ObjectsCloud *cloud)
goto out;
}
dbo_list = g_slist_reverse (gda_meta_struct_get_all_db_objects (mstruct));
+ list = g_slist_sort (dbo_list, (GCompareFunc) dbo_sort);
+ dbo_list = list;
for (list = dbo_list; list; list = list->next) {
GdaMetaDbObject *dbo = GDA_META_DB_OBJECT (list->data);
GSList *list;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]