[grisbi-cvs] [SCM] grisbi branch, build-rewrite, updated. 2dd3b1ff44bab73c9d1cc20583cec2ad51274512

Rémi Cardona nobody at users.sourceforge.net
Thu Jun 17 22:11:28 CEST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, build-rewrite has been updated
       via  2dd3b1ff44bab73c9d1cc20583cec2ad51274512 (commit)
      from  045ab335993ff317477c742a6e36649b0d6d9893 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2dd3b1ff44bab73c9d1cc20583cec2ad51274512
Author: Rémi Cardona <remi at gentoo.org>
Date:   Sun Jun 13 21:30:42 2010 +0200

    gtk_combofix: split gtk_combofix_set_list()

-----------------------------------------------------------------------

Changes:
diff --git a/src/gtk_combofix.c b/src/gtk_combofix.c
index 6641bec..f2c1ebe 100644
--- a/src/gtk_combofix.c
+++ b/src/gtk_combofix.c
@@ -63,7 +63,7 @@ struct _GtkComboFixPrivate
 /* common */
 static void gtk_combofix_class_init ( GtkComboFixClass *klass );
 static void gtk_combofix_init ( GtkComboFix *combofix );
-static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
+static gboolean gtk_combofix_fill_store ( GtkTreeStore *store,
                         GSList *list,
                         gint list_number );
 static void gtk_combofix_dialog ( gchar *text, gchar *hint );
@@ -401,30 +401,56 @@ void gtk_combofix_set_mixed_sort ( GtkComboFix *combofix, gboolean mixed_sort )
  * */
 gboolean gtk_combofix_set_list ( GtkComboFix *combofix, GSList *list )
 {
-    GtkComboFixPrivate *priv = combofix -> priv;
+    GSList *iter;
+    GtkComboFixPrivate *priv;
+
+    g_return_val_if_fail (combofix, FALSE);
+    g_return_val_if_fail (GTK_IS_COMBOFIX (combofix), FALSE);
+    g_return_val_if_fail (list, FALSE);
+
+    priv = combofix->priv;
+    priv->visible_items = 0;
+    for (iter = list; iter; iter = iter->next)
+    {
+        GtkComboFixPrivate *priv = combofix -> priv;
+        GSList *sub_list = iter->data;
+        priv->visible_items += g_slist_length (sub_list);
+    }
+
+    return gtk_combofix_helper_fill_store_full (priv->store, list);
+}
 
+
+/**
+ * change the list of an existing combofix
+ *
+ * \param combofix
+ * \param list the new list
+ *
+ * \return TRUE if ok, FALSE if problem
+ * */
+gboolean gtk_combofix_helper_fill_store_full (GtkTreeStore *store,
+                                              GSList *list)
+{
     GSList *tmp_list;
     gint list_number = 0;
     gint length;
     GtkTreeIter iter;
 
-    g_return_val_if_fail (combofix, FALSE );
-    g_return_val_if_fail (GTK_IS_COMBOFIX (combofix), FALSE);
-
-    gtk_tree_store_clear ( priv -> store );
+    gtk_tree_store_clear (store);
 
     tmp_list = list;
     length = g_slist_length (list);
 
     while ( tmp_list )
     {
-        gtk_combofix_fill_store ( combofix, tmp_list -> data, list_number );
+        gtk_combofix_fill_store ( store, tmp_list -> data, list_number );
 
         /* set the separator */
         if (list_number < ( length-1 ) )
         {
-            gtk_tree_store_append ( priv -> store, &iter, NULL );
-            gtk_tree_store_set ( priv -> store,
+            gtk_tree_store_append ( store, &iter, NULL );
+            gtk_tree_store_set ( store,
                         &iter,
                         COMBOFIX_COL_LIST_NUMBER, list_number,
                         COMBOFIX_COL_SEPARATOR, TRUE,
@@ -639,7 +665,7 @@ static void gtk_combofix_init ( GtkComboFix *combofix )
 *
 * \return TRUE ok, FALSE pb
 * */
-static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
+static gboolean gtk_combofix_fill_store (GtkTreeStore *store,
                         GSList *list,
                         gint list_number )
 {
@@ -647,7 +673,6 @@ static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
     GtkTreeIter iter_parent;
     GtkTreeIter iter_child;
     gchar *last_parent = NULL;
-    GtkComboFixPrivate *priv = combofix -> priv;
 
     if ( !list )
 	    return FALSE;
@@ -681,8 +706,8 @@ static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
                 /* it's a child */
                 tmpstr = g_strconcat ( last_parent, " : ", string + 1, NULL );
 
-                gtk_tree_store_append ( priv -> store, &iter_child, &iter_parent );
-                gtk_tree_store_set ( priv -> store,
+                gtk_tree_store_append ( store, &iter_child, &iter_parent );
+                gtk_tree_store_set ( store,
                             &iter_child,
                             COMBOFIX_COL_VISIBLE_STRING, string + 1,
                             COMBOFIX_COL_REAL_STRING, tmpstr,
@@ -694,8 +719,8 @@ static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
             else
             {
                 /* it's a parent */
-                gtk_tree_store_append ( priv -> store, &iter_parent, NULL );
-                gtk_tree_store_set ( priv -> store,
+                gtk_tree_store_append ( store, &iter_parent, NULL );
+                gtk_tree_store_set ( store,
                             &iter_parent,
                             COMBOFIX_COL_VISIBLE_STRING, string,
                             COMBOFIX_COL_REAL_STRING, string,
@@ -708,8 +733,6 @@ static gboolean gtk_combofix_fill_store ( GtkComboFix *combofix,
         tmp_list = tmp_list -> next;
     }
 
-    priv -> visible_items += g_slist_length ( list );
-
     return TRUE;
 }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list