[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_1-1-g2cb8421
Pierre Biava
nobody at users.sourceforge.net
Mon Apr 25 10:56:58 CEST 2011
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, master has been updated
via 2cb842132b49e19871867644c12204e4da362baa (commit)
from deee1c7b815015a0293a23a4edc1a2175879285f (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 2cb842132b49e19871867644c12204e4da362baa
Author: pbiava <pierre.biava at nerim.net>
Date: Mon Apr 25 10:56:13 2011 +0200
removal of global variables: category_interface and payee_interface
-----------------------------------------------------------------------
Changes:
diff --git a/src/categories_onglet.c b/src/categories_onglet.c
index 5114f55..2e366b2 100644
--- a/src/categories_onglet.c
+++ b/src/categories_onglet.c
@@ -39,6 +39,7 @@
#include "gsb_file_others.h"
#include "gsb_transactions_list.h"
#include "main.h"
+#include "meta_categories.h"
#include "metatree.h"
#include "mouse.h"
#include "structures.h"
@@ -82,7 +83,6 @@ struct metatree_hold_position *category_hold_position;
/*START_EXTERN*/
-extern MetatreeInterface * category_interface;
extern GdkColor couleur_selection;
/*END_EXTERN*/
@@ -102,6 +102,9 @@ GtkWidget *onglet_categories ( void )
static GtkTargetEntry row_targets[] = {
{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
};
+ MetatreeInterface *category_interface;
+
+ category_interface = category_get_metatree_interface ( );
/* We create the gtktreeview and model early so that they can be referenced. */
arbre_categ = gtk_tree_view_new();
@@ -239,6 +242,7 @@ void remplit_arbre_categ ( void )
{
GSList *category_list;
GtkTreeIter iter_categ, iter_sous_categ;
+ MetatreeInterface *category_interface;
devel_debug (NULL);
@@ -259,6 +263,8 @@ void remplit_arbre_categ ( void )
/* add first the empty category */
category_list = g_slist_prepend ( category_list, gsb_data_category_get_empty_category ());
+ category_interface = category_get_metatree_interface ( );
+
while ( category_list )
{
gint category_number;
@@ -663,6 +669,7 @@ gboolean edit_category ( GtkTreeView * view )
GtkTreeIter iter;
gchar * title;
GtkTreeIter *div_iter;
+ MetatreeInterface *category_interface;
/* fill category_number and sub_category_number */
@@ -810,6 +817,8 @@ gboolean edit_category ( GtkTreeView * view )
gtk_widget_destroy ( dialog );
+ category_interface = category_get_metatree_interface ( );
+
if ( sub_category_number > 0 )
{
div_iter = get_iter_from_div ( model, category_number, sub_category_number );
diff --git a/src/meta_budgetary.c b/src/meta_budgetary.c
index 78cf17f..81c5073 100644
--- a/src/meta_budgetary.c
+++ b/src/meta_budgetary.c
@@ -287,3 +287,8 @@ MetatreeInterface *budgetary_line_get_metatree_interface ( void )
{
return budgetary_interface;
}
+
+
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */
diff --git a/src/meta_categories.c b/src/meta_categories.c
index 3b422dc..132509b 100644
--- a/src/meta_categories.c
+++ b/src/meta_categories.c
@@ -27,8 +27,6 @@
#include "include.h"
#include <glib/gi18n.h>
-#include "metatree.h"
-
/*START_INCLUDE*/
#include "meta_categories.h"
#include "categories_onglet.h"
@@ -107,7 +105,7 @@ static MetatreeInterface _category_interface = {
category_hold_position_set_expand,
};
-MetatreeInterface * category_interface = &_category_interface;
+static MetatreeInterface *category_interface = &_category_interface;
@@ -341,6 +339,20 @@ gboolean category_add_transaction_to_div ( gint transaction_number,
}
+/**
+ *
+ *
+ *
+ */
+MetatreeInterface *category_get_metatree_interface ( void )
+{
+ return category_interface;
+}
+
+
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */
diff --git a/src/meta_categories.h b/src/meta_categories.h
index 6813a19..3235457 100644
--- a/src/meta_categories.h
+++ b/src/meta_categories.h
@@ -4,10 +4,12 @@
#include <glib.h>
/* START_INCLUDE_H */
+#include "metatree.h"
/* END_INCLUDE_H */
/* START_DECLARATION */
+MetatreeInterface *category_get_metatree_interface ( void );
gint category_tree_currency ( );
/* END_DECLARATION */
#endif
diff --git a/src/meta_payee.c b/src/meta_payee.c
index b1a7411..65b4c01 100644
--- a/src/meta_payee.c
+++ b/src/meta_payee.c
@@ -27,8 +27,6 @@
#include "include.h"
#include <glib/gi18n.h>
-#include "metatree.h"
-
/*START_INCLUDE*/
#include "meta_payee.h"
#include "gsb_data_payee.h"
@@ -119,7 +117,7 @@ static MetatreeInterface _payee_interface = {
payee_hold_position_set_expand,
};
-MetatreeInterface * payee_interface = &_payee_interface;
+static MetatreeInterface *payee_interface = &_payee_interface;
/**
@@ -392,3 +390,17 @@ void payee_add_transaction_to_sub_div ( gint transaction_number,
}
+/**
+ *
+ *
+ *
+ */
+MetatreeInterface *payee_get_metatree_interface ( void )
+{
+ return payee_interface;
+}
+
+
+/* Local Variables: */
+/* c-basic-offset: 4 */
+/* End: */
diff --git a/src/meta_payee.h b/src/meta_payee.h
index bd48c13..c7796d4 100644
--- a/src/meta_payee.h
+++ b/src/meta_payee.h
@@ -4,10 +4,12 @@
#include <glib.h>
/* START_INCLUDE_H */
+#include "metatree.h"
/* END_INCLUDE_H */
/* START_DECLARATION */
+MetatreeInterface *payee_get_metatree_interface ( void );
gint payee_tree_currency ( );
/* END_DECLARATION */
#endif
diff --git a/src/tiers_onglet.c b/src/tiers_onglet.c
index 0690ebf..56580cd 100644
--- a/src/tiers_onglet.c
+++ b/src/tiers_onglet.c
@@ -51,6 +51,7 @@
#include "gsb_transactions_list.h"
#include "gtk_combofix.h"
#include "import.h"
+#include "meta_payee.h"
#include "metatree.h"
#include "structures.h"
#include "traitement_variables.h"
@@ -120,7 +121,6 @@ static struct conditional_message *overwrite_payee;
/*START_EXTERN*/
extern GdkColor couleur_selection;
extern GSList *liste_associations_tiers;
-extern MetatreeInterface * payee_interface;
/*END_EXTERN*/
enum payees_assistant_page
@@ -206,7 +206,7 @@ GtkWidget *onglet_tiers ( void )
META_TREE_TEXT_COLUMN, metatree_sort_column,
NULL, NULL );
g_object_set_data ( G_OBJECT ( payee_tree_model), "metatree-interface",
- payee_interface );
+ payee_get_metatree_interface ( ) );
/* Create container + TreeView */
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (payee_tree), TRUE);
@@ -535,7 +535,8 @@ void payee_fill_tree ( void )
gsb_data_payee_get_nb_transactions ( payee_number ) )
{
gtk_tree_store_append (GTK_TREE_STORE (payee_tree_model), &iter_payee, NULL);
- fill_division_row ( GTK_TREE_MODEL(payee_tree_model), payee_interface,
+ fill_division_row ( GTK_TREE_MODEL(payee_tree_model),
+ payee_get_metatree_interface ( ),
&iter_payee, payee_number );
}
payee_list_tmp = payee_list_tmp -> next;
@@ -622,6 +623,7 @@ gboolean edit_payee ( GtkTreeView * view )
gchar * title;
gchar * old_payee;
GtkTreeIter *div_iter;
+ MetatreeInterface *payee_interface;
devel_debug (NULL);
@@ -713,8 +715,8 @@ gboolean edit_payee ( GtkTreeView * view )
{
gsb_data_payee_set_name ( payee_number,
gtk_entry_get_text ( GTK_ENTRY (entry_name)));
- break;
- }
+ break;
+ }
else
{
gchar *message;
@@ -734,6 +736,7 @@ gboolean edit_payee ( GtkTreeView * view )
gtk_widget_destroy ( dialog );
+ payee_interface = payee_get_metatree_interface ( );
div_iter = get_iter_from_div ( model, payee_number, 0 );
fill_division_row ( model, payee_interface,
div_iter, payee_number );
diff --git a/src/utils_operations.c b/src/utils_operations.c
index 1daba41..a00a2be 100644
--- a/src/utils_operations.c
+++ b/src/utils_operations.c
@@ -53,8 +53,6 @@ static void update_transaction_in_payee_tree ( gint transaction_number );
/*START_EXTERN*/
-extern MetatreeInterface * category_interface;
-extern MetatreeInterface * payee_interface;
/*END_EXTERN*/
@@ -100,8 +98,11 @@ void delete_transaction_in_trees ( gint transaction_number )
*/
void update_transaction_in_categ_tree ( gint transaction_number )
{
+ MetatreeInterface *category_interface;
+
+ category_interface = category_get_metatree_interface ( );
/* FIXME: Kludgeish, we should maintain a state. */
- gsb_data_category_update_counters();
+ gsb_data_category_update_counters ( );
update_transaction_in_tree ( category_interface,
GTK_TREE_MODEL ( category_list_get_tree_store ( ) ),
transaction_number );
@@ -133,6 +134,9 @@ void update_transaction_in_budgetary_line_tree ( gint transaction_number )
*/
void update_transaction_in_payee_tree ( gint transaction_number )
{
+ MetatreeInterface *payee_interface;
+
+ payee_interface = payee_get_metatree_interface ( );
/* FIXME: Kludgeish, we should maintain a state. */
gsb_data_payee_update_counters ();
update_transaction_in_tree ( payee_interface,
@@ -146,6 +150,9 @@ void update_transaction_in_payee_tree ( gint transaction_number )
*/
void delete_transaction_in_categ_tree ( gint transaction_number )
{
+ MetatreeInterface *category_interface;
+
+ category_interface = category_get_metatree_interface ( );
gsb_data_category_remove_transaction_from_category (transaction_number);
metatree_remove_transaction ( GTK_TREE_VIEW ( category_list_get_tree_view ),
category_interface,
@@ -179,6 +186,9 @@ void delete_transaction_in_budgetary_line_tree ( gint transaction_number )
*/
void delete_transaction_in_payee_tree ( gint transaction_number )
{
+ MetatreeInterface *payee_interface;
+
+ payee_interface = payee_get_metatree_interface ( );
gsb_data_payee_remove_transaction_from_payee (transaction_number);
metatree_remove_transaction ( GTK_TREE_VIEW ( gsb_payee_get_tree_view ( ) ),
payee_interface,
hooks/post-receive
--
grisbi
More information about the cvs
mailing list