r22089 - gnucash/trunk/src - Re-indentation of source code.
Christian Stimming
cstim at code.gnucash.org
Fri Mar 16 16:27:10 EDT 2012
Author: cstim
Date: 2012-03-16 16:27:09 -0400 (Fri, 16 Mar 2012)
New Revision: 22089
Trac: http://svn.gnucash.org/trac/changeset/22089
Modified:
gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
gnucash/trunk/src/backend/sql/test/utest-gnc-backend-sql.c
gnucash/trunk/src/backend/xml/gnc-backend-xml.c
gnucash/trunk/src/backend/xml/io-gncxml-v2.c
gnucash/trunk/src/backend/xml/sixtp.c
gnucash/trunk/src/backend/xml/sixtp.h
gnucash/trunk/src/business/business-gnome/dialog-payment.c
gnucash/trunk/src/core-utils/gnc-features.c
gnucash/trunk/src/engine/gncEmployee.c
gnucash/trunk/src/engine/gncEntry.c
gnucash/trunk/src/engine/gncIDSearch.c
gnucash/trunk/src/engine/gncInvoice.c
gnucash/trunk/src/engine/gncVendor.c
gnucash/trunk/src/engine/test/utest-Account.c
gnucash/trunk/src/gnome-utils/assistant-xml-encoding.c
gnucash/trunk/src/gnome/assistant-hierarchy.c
gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
gnucash/trunk/src/html/gnc-html-webkit.c
gnucash/trunk/src/import-export/csv-export/assistant-csv-export.c
gnucash/trunk/src/import-export/csv-export/assistant-csv-export.h
gnucash/trunk/src/import-export/csv-export/csv-transactions-export.c
gnucash/trunk/src/import-export/csv-export/csv-transactions-export.h
gnucash/trunk/src/import-export/csv-export/csv-tree-export.c
gnucash/trunk/src/import-export/csv-export/csv-tree-export.h
gnucash/trunk/src/import-export/csv-export/gnc-plugin-csv-export.c
gnucash/trunk/src/import-export/csv-import/assistant-csv-account-import.c
gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c
gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.h
gnucash/trunk/src/import-export/csv-import/csv-account-import.c
gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c
gnucash/trunk/src/import-export/csv-import/gnc-plugin-csv-import.c
gnucash/trunk/src/import-export/import-account-matcher.c
gnucash/trunk/src/import-export/import-account-matcher.h
gnucash/trunk/src/import-export/import-format-dialog.c
gnucash/trunk/src/import-export/import-main-matcher.c
gnucash/trunk/src/import-export/import-main-matcher.h
gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
gnucash/trunk/src/libqof/qof/qofbook.c
gnucash/trunk/src/libqof/qof/qofsession.c
gnucash/trunk/src/libqof/qof/test/test-qofsession.c
gnucash/trunk/src/plugins/bi_import/dialog-bi-import-gui.c
gnucash/trunk/src/plugins/bi_import/dialog-bi-import.c
gnucash/trunk/src/plugins/customer_import/dialog-customer-import-gui.c
gnucash/trunk/src/plugins/customer_import/dialog-customer-import.c
gnucash/trunk/src/register/register-gnome/gnucash-item-edit.c
gnucash/trunk/src/register/register-gnome/gnucash-item-edit.h
gnucash/trunk/src/register/register-gnome/gnucash-sheet.c
Log:
Re-indentation of source code.
As usual, re-indentation was done using astyle-1.24 using the following options:
astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none
Modified: gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
===================================================================
--- gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1682,8 +1682,8 @@
be->events_pending = NULL;
be->process_events = NULL;
-/* The SQL/DBI backend doesn't need to be synced until it is
- * configured for multiuser access. */
+ /* The SQL/DBI backend doesn't need to be synced until it is
+ * configured for multiuser access. */
be->sync = gnc_dbi_safe_sync_all;
be->safe_sync = gnc_dbi_safe_sync_all;
be->load_config = NULL;
Modified: gnucash/trunk/src/backend/sql/test/utest-gnc-backend-sql.c
===================================================================
--- gnucash/trunk/src/backend/sql/test/utest-gnc-backend-sql.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/backend/sql/test/utest-gnc-backend-sql.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -177,9 +177,9 @@
{
g_assert (data != NULL);
if (dirty)
- ++*(guint*)data;
+ ++*(guint*)data;
else if (*(guint*)data)
- --*(guint*)data;
+ --*(guint*)data;
}
static gboolean
@@ -206,7 +206,7 @@
test_add_error (&check1);
test_add_error (&check2);
hdlr1 = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_list_handler, NULL);
+ (GLogFunc)test_list_handler, NULL);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_list_handler, NULL);
qof_object_initialize ();
@@ -224,31 +224,31 @@
g_assert (qof_instance_get_dirty_flag (inst));
g_assert (qof_book_session_not_saved (be.book));
- g_assert_cmpint (dirty_called, ==, 1);
+ g_assert_cmpint (dirty_called, == , 1);
gnc_sql_commit_edit (&be, inst);
g_assert (!qof_instance_get_dirty_flag (inst));
g_assert (!qof_book_session_not_saved (be.book));
- g_assert_cmpint (dirty_called, ==, 0);
+ g_assert_cmpint (dirty_called, == , 0);
qof_book_mark_session_dirty (be.book);
g_assert (!qof_instance_get_dirty_flag (QOF_INSTANCE (be.book)));
g_assert (qof_book_session_not_saved (be.book));
- g_assert_cmpint (dirty_called, ==, 1);
+ g_assert_cmpint (dirty_called, == , 1);
gnc_sql_commit_edit (&be, QOF_INSTANCE (be.book));
g_assert (!qof_instance_get_dirty_flag (QOF_INSTANCE (be.book)));
g_assert (qof_book_session_not_saved (be.book));
- g_assert_cmpint (dirty_called, ==, 1);
+ g_assert_cmpint (dirty_called, == , 1);
qof_instance_set_dirty_flag (QOF_INSTANCE (be.book), TRUE);
g_assert (qof_instance_get_dirty_flag (QOF_INSTANCE (be.book)));
g_assert (qof_book_session_not_saved (be.book));
- g_assert_cmpint (dirty_called, ==, 1);
+ g_assert_cmpint (dirty_called, == , 1);
gnc_sql_commit_edit (&be, QOF_INSTANCE (be.book));
g_assert (!qof_instance_get_dirty_flag (QOF_INSTANCE (be.book)));
g_assert (!qof_book_session_not_saved (be.book));
- g_assert_cmpint (dirty_called, ==, 0);
+ g_assert_cmpint (dirty_called, == , 0);
g_log_remove_handler (logdomain, hdlr1);
g_object_unref (inst);
Modified: gnucash/trunk/src/backend/xml/gnc-backend-xml.c
===================================================================
--- gnucash/trunk/src/backend/xml/gnc-backend-xml.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/backend/xml/gnc-backend-xml.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -165,11 +165,11 @@
strcpy (pathbuf, be->lockfile);
path = strrchr (pathbuf, '.');
while (snprintf (path, pathbuf_size - (path - pathbuf), ".%lx.%d.LNK", gethostid(), getpid())
- >= pathbuf_size - (path - pathbuf))
- {
+ >= pathbuf_size - (path - pathbuf))
+ {
pathbuf_size += 100;
pathbuf = (char *) realloc (pathbuf, pathbuf_size);
- }
+ }
rc = link (be->lockfile, pathbuf);
if (rc)
@@ -620,8 +620,8 @@
}
xml_type = gnc_is_xml_data_file_v2(filename, NULL);
if ((xml_type == GNC_BOOK_XML2_FILE) ||
- (xml_type == GNC_BOOK_XML1_FILE) ||
- (xml_type == GNC_BOOK_POST_XML2_0_0_FILE))
+ (xml_type == GNC_BOOK_XML1_FILE) ||
+ (xml_type == GNC_BOOK_POST_XML2_0_0_FILE))
{
result = TRUE;
goto det_exit;
Modified: gnucash/trunk/src/backend/xml/io-gncxml-v2.c
===================================================================
--- gnucash/trunk/src/backend/xml/io-gncxml-v2.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/backend/xml/io-gncxml-v2.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -830,7 +830,7 @@
gboolean
qof_session_load_from_xml_file_v2(FileBackend *fbe, QofBook *book,
- QofBookFileType type)
+ QofBookFileType type)
{
return qof_session_load_from_xml_file_v2_full(fbe, book, NULL, NULL, type);
}
Modified: gnucash/trunk/src/backend/xml/sixtp.c
===================================================================
--- gnucash/trunk/src/backend/xml/sixtp.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/backend/xml/sixtp.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -927,7 +927,7 @@
tag_compare2 = g_strdup_printf("<%s\r\n", gnc_v2_xml_version_string);
if ((strncmp(cursor, tag_compare1, strlen(tag_compare1)) == 0)
- || (strncmp(cursor, tag_compare2, strlen(tag_compare2)) == 0))
+ || (strncmp(cursor, tag_compare2, strlen(tag_compare2)) == 0))
{
if (with_encoding)
{
Modified: gnucash/trunk/src/backend/xml/sixtp.h
===================================================================
--- gnucash/trunk/src/backend/xml/sixtp.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/backend/xml/sixtp.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -210,7 +210,7 @@
sixtp *sub_parser);
QofBookFileType gnc_is_our_xml_file(const char *filename,
- gboolean *with_encoding);
+ gboolean *with_encoding);
QofBookFileType gnc_is_our_first_xml_chunk(char *chunk, gboolean *with_encoding);
Modified: gnucash/trunk/src/business/business-gnome/dialog-payment.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-payment.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/business/business-gnome/dialog-payment.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -174,7 +174,7 @@
gnc_payment_dialog_calculate_selected_total (PaymentWindow *pw)
{
GtkTreeSelection *selection;
- GList *list=NULL, *node;
+ GList *list = NULL, *node;
gnc_numeric val = gnc_numeric_zero();
if (!pw->docs_list_tree_view || !GTK_IS_TREE_VIEW(pw->docs_list_tree_view))
@@ -235,7 +235,7 @@
gnc_payment_window_fill_docs_list (PaymentWindow *pw)
{
GtkListStore *store;
- GList *list=NULL, *node;
+ GList *list = NULL, *node;
g_return_if_fail (pw->docs_list_tree_view && GTK_IS_TREE_VIEW(pw->docs_list_tree_view));
Modified: gnucash/trunk/src/core-utils/gnc-features.c
===================================================================
--- gnucash/trunk/src/core-utils/gnc-features.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/core-utils/gnc-features.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -32,16 +32,17 @@
#include "libqof/qof/qof.h"
#include "gnc-features.h"
-typedef struct {
- const gchar *key;
- const gchar *desc;
+typedef struct
+{
+ const gchar *key;
+ const gchar *desc;
} gncFeature;
static GHashTable *features_table = NULL;
static gncFeature known_features[] =
{
- { GNC_FEATURE_CREDIT_NOTES, "Customer and vendor credit notes (requires at least GnuCash 2.5.0)" },
- { NULL },
+ { GNC_FEATURE_CREDIT_NOTES, "Customer and vendor credit notes (requires at least GnuCash 2.5.0)" },
+ { NULL },
};
/* This static indicates the debugging module that this .o belongs to. */
Modified: gnucash/trunk/src/engine/gncEmployee.c
===================================================================
--- gnucash/trunk/src/engine/gncEmployee.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/engine/gncEmployee.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -146,14 +146,14 @@
g_value_set_object(value, emp->addr);
break;
case PROP_WORKDAY:
- g_value_set_boxed(value, &emp->workday);
- break;
+ g_value_set_boxed(value, &emp->workday);
+ break;
case PROP_RATE:
- g_value_set_boxed(value, &emp->rate);
- break;
+ g_value_set_boxed(value, &emp->rate);
+ break;
case PROP_CCARD:
- g_value_set_object(value, emp->ccard_acc);
- break;
+ g_value_set_object(value, emp->ccard_acc);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -195,14 +195,14 @@
qofEmployeeSetAddr(emp, g_value_get_object(value));
break;
case PROP_WORKDAY:
- gncEmployeeSetWorkday(emp, *(gnc_numeric*)g_value_get_boxed(value));
- break;
+ gncEmployeeSetWorkday(emp, *(gnc_numeric*)g_value_get_boxed(value));
+ break;
case PROP_RATE:
- gncEmployeeSetRate(emp, *(gnc_numeric*)g_value_get_boxed(value));
- break;
+ gncEmployeeSetRate(emp, *(gnc_numeric*)g_value_get_boxed(value));
+ break;
case PROP_CCARD:
- gncEmployeeSetCCard(emp, g_value_get_object(value));
- break;
+ gncEmployeeSetCCard(emp, g_value_get_object(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Modified: gnucash/trunk/src/engine/gncEntry.c
===================================================================
--- gnucash/trunk/src/engine/gncEntry.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/engine/gncEntry.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -111,15 +111,15 @@
{
switch (how)
{
- case (GNC_DISC_PRETAX):
- return "PRETAX";
- case (GNC_DISC_SAMETIME):
- return "SAMETIME";
- case (GNC_DISC_POSTTAX):
- return "POSTTAX";
- default:
- g_warning ("asked to translate unknown discount-how %d.\n", how);
- break;
+ case (GNC_DISC_PRETAX):
+ return "PRETAX";
+ case (GNC_DISC_SAMETIME):
+ return "SAMETIME";
+ case (GNC_DISC_POSTTAX):
+ return "POSTTAX";
+ default:
+ g_warning ("asked to translate unknown discount-how %d.\n", how);
+ break;
}
return NULL;
}
@@ -128,17 +128,17 @@
* KEEP THIS FUNCTION IN SYNC with the one above! */
gboolean gncEntryDiscountStringToHow (const char *str, GncDiscountHow *how)
{
- if(g_strcmp0 ("PRETAX", str) == 0)
+ if (g_strcmp0 ("PRETAX", str) == 0)
{
*how = GNC_DISC_PRETAX;
return TRUE;
}
- if(g_strcmp0 ("SAMETIME", str) == 0)
+ if (g_strcmp0 ("SAMETIME", str) == 0)
{
*how = GNC_DISC_SAMETIME;
return TRUE;
}
- if(g_strcmp0 ("POSTTAX", str) == 0)
+ if (g_strcmp0 ("POSTTAX", str) == 0)
{
*how = GNC_DISC_POSTTAX;
return TRUE;
@@ -155,10 +155,10 @@
{
switch (type)
{
- case (GNC_PAYMENT_CASH):
- return "CASH";
- case (GNC_PAYMENT_CARD):
- return "CARD";
+ case (GNC_PAYMENT_CASH):
+ return "CASH";
+ case (GNC_PAYMENT_CARD):
+ return "CARD";
default:
g_warning ("asked to translate unknown payment type %d.\n", type);
break;
@@ -170,12 +170,12 @@
* KEEP THIS FUNCTION IN SYNC with the one above! */
gboolean gncEntryPaymentStringToType (const char *str, GncEntryPaymentType *type)
{
- if(g_strcmp0 ("CASH", str) == 0)
+ if (g_strcmp0 ("CASH", str) == 0)
{
*type = GNC_PAYMENT_CASH;
return TRUE;
}
- if(g_strcmp0 ("CARD", str) == 0)
+ if (g_strcmp0 ("CARD", str) == 0)
{
*type = GNC_PAYMENT_CARD;
return TRUE;
@@ -1425,7 +1425,7 @@
GncAccountValue *acct_val = node->data;
values = gncAccountValueAdd (values, acct_val->account,
(is_cn ? gnc_numeric_neg (acct_val->value)
- : acct_val->value));
+ : acct_val->value));
}
return values;
@@ -1461,7 +1461,7 @@
GncAccountValue *acct_val = node->data;
values = gncAccountValueAdd (values, acct_val->account,
(is_cust_doc ? gnc_numeric_neg (acct_val->value)
- : acct_val->value));
+ : acct_val->value));
}
return values;
Modified: gnucash/trunk/src/engine/gncIDSearch.c
===================================================================
--- gnucash/trunk/src/engine/gncIDSearch.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/engine/gncIDSearch.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -83,7 +83,7 @@
g_return_val_if_fail (type, NULL);
g_return_val_if_fail (id, NULL);
g_return_val_if_fail (book, NULL);
-
+
// Build the query
q = qof_query_create_for (type);
qof_query_set_book (q, book);
@@ -105,8 +105,8 @@
GncVendor *c = NULL;
qof_query_add_term (q, qof_query_build_param_list("VENDOR_ID"), string_pred_data, QOF_QUERY_AND);
}
-
-
+
+
// Run the query
result = qof_query_run (q);
@@ -134,7 +134,7 @@
{
object = c;
break;
- }
+ }
result = g_list_next (result);
}
}
Modified: gnucash/trunk/src/engine/gncInvoice.c
===================================================================
--- gnucash/trunk/src/engine/gncInvoice.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/engine/gncInvoice.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1180,12 +1180,12 @@
}
static gboolean gncInvoicePostAddSplit (QofBook *book,
- Account *acc,
- Transaction *txn,
- gnc_numeric value,
- const gchar *memo,
- const gchar *type,
- GncInvoice *invoice)
+ Account *acc,
+ Transaction *txn,
+ gnc_numeric value,
+ const gchar *memo,
+ const gchar *type,
+ GncInvoice *invoice)
{
Split *split;
@@ -1357,8 +1357,8 @@
if (accumulatesplits)
splitinfo = gncAccountValueAdd (splitinfo, this_acc, value);
else if (!gncInvoicePostAddSplit (book, this_acc, txn, value,
- gncEntryGetDescription (entry),
- type, invoice))
+ gncEntryGetDescription (entry),
+ type, invoice))
{
/*This is an error, which shouldn't even be able to happen.
We can't really do anything sensible about it, and this is
@@ -1437,7 +1437,7 @@
/* To charge amount is stored in document value. We need balance value here
* so convert if necessary. */
gnc_numeric to_charge_bal_amount = (is_cn ? gnc_numeric_neg (invoice->to_charge_amount)
- : invoice->to_charge_amount);
+ : invoice->to_charge_amount);
/* Set memo. action? */
xaccSplitSetMemo (split, _("Extra to Charge Card"));
Modified: gnucash/trunk/src/engine/gncVendor.c
===================================================================
--- gnucash/trunk/src/engine/gncVendor.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/engine/gncVendor.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -165,8 +165,8 @@
g_value_set_int(value, vendor->taxincluded);
break;
case PROP_TAX_INCLUDED_STR:
- g_value_set_string(value, qofVendorGetTaxIncluded(vendor));
- break;
+ g_value_set_string(value, qofVendorGetTaxIncluded(vendor));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -219,7 +219,7 @@
case PROP_TAX_INCLUDED_STR:
qofVendorSetTaxIncluded(vendor, g_value_get_string(value));
break;
- default:
+ default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
}
@@ -369,21 +369,21 @@
(gobject_class,
PROP_TAX_INCLUDED,
g_param_spec_int ("tax-included",
- "Tax included",
- "The tax-included property contains the information about tax calculation this vendor.",
- GNC_TAXINCLUDED_YES, /* min */
- GNC_TAXINCLUDED_USEGLOBAL, /* max */
- GNC_TAXINCLUDED_USEGLOBAL, /* default */
- G_PARAM_READWRITE));
+ "Tax included",
+ "The tax-included property contains the information about tax calculation this vendor.",
+ GNC_TAXINCLUDED_YES, /* min */
+ GNC_TAXINCLUDED_USEGLOBAL, /* max */
+ GNC_TAXINCLUDED_USEGLOBAL, /* default */
+ G_PARAM_READWRITE));
g_object_class_install_property
(gobject_class,
PROP_TAX_INCLUDED_STR,
g_param_spec_string("tax-included-string",
- "Tax included string",
- "The tax-included-string property contains a character version of tax-included.",
- FALSE,
- G_PARAM_READWRITE));
+ "Tax included string",
+ "The tax-included-string property contains a character version of tax-included.",
+ FALSE,
+ G_PARAM_READWRITE));
}
/* Create/Destroy Functions */
Modified: gnucash/trunk/src/engine/test/utest-Account.c
===================================================================
--- gnucash/trunk/src/engine/test/utest-Account.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/engine/test/utest-Account.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -107,35 +107,41 @@
static TxnParms some_txns[] =
{
- {"waldo", -9, {
- {"waldo_baz", "baz", NREC, {-150000, 100}, {0, 1}, 0},
- {"waldo_meh", "meh", NREC, {150000, 100}, {0, 1}, 0}
- }
+ {
+ "waldo", -9, {
+ {"waldo_baz", "baz", NREC, { -150000, 100}, {0, 1}, 0},
+ {"waldo_meh", "meh", NREC, {150000, 100}, {0, 1}, 0}
+ }
},
- {"pepper", -7, {
- {"pepper_baz", "baz", CREC, {-12345, 100}, {0, 1}, 0},
- {"pepper_meh", "meh", CREC, {12345, 100}, {0, 1}, 0}
- }
+ {
+ "pepper", -7, {
+ {"pepper_baz", "baz", CREC, { -12345, 100}, {0, 1}, 0},
+ {"pepper_meh", "meh", CREC, {12345, 100}, {0, 1}, 0}
+ }
},
- {"salt", -2, {
- {"salt_baz", "baz", YREC, {-31415, 100}, {0, 1}, 0},
- {"salt_meh", "meh", YREC, {31415, 100}, {0, 1}, 0}
- }
+ {
+ "salt", -2, {
+ {"salt_baz", "baz", YREC, { -31415, 100}, {0, 1}, 0},
+ {"salt_meh", "meh", YREC, {31415, 100}, {0, 1}, 0}
+ }
},
- {"pork", 3, {
- {"pork_baz", "baz", YREC, {23746, 100}, {0, 1}, 0},
- {"pork_meh", "meh", YREC, {-23746, 100}, {0, 1}, 0}
- }
+ {
+ "pork", 3, {
+ {"pork_baz", "baz", YREC, {23746, 100}, {0, 1}, 0},
+ {"pork_meh", "meh", YREC, { -23746, 100}, {0, 1}, 0}
+ }
},
- {"sausage", 5, {
- {"sausage_baz", "baz", NREC, {-1143, 100}, {0, 1}, 0},
- {"sausage_meh", "meh", NREC, {1143, 100}, {0, 1}, 0}
- }
+ {
+ "sausage", 5, {
+ {"sausage_baz", "baz", NREC, { -1143, 100}, {0, 1}, 0},
+ {"sausage_meh", "meh", NREC, {1143, 100}, {0, 1}, 0}
+ }
}
};
static SetupData some_data = {4, (AccountParms**)(&some_names),
- 5, (TxnParms**)(&some_txns)};
+ 5, (TxnParms**)(&some_txns)
+ };
static AccountParms complex_accts[] =
{
@@ -168,8 +174,8 @@
{ACCT_TYPE_EXPENSE, "medical", "deductible", "3220", "", "", "", NULL},
{ACCT_TYPE_STOCK, "foo", "stocks", "2221", "", "", NULL},
{ACCT_TYPE_STOCK, "bar", "stocks", "2222", "", "", NULL},
-/* Note the repetition of the stock account "baz". The variations are
- * used to test gnc_account_merge_children. */
+ /* Note the repetition of the stock account "baz". The variations are
+ * used to test gnc_account_merge_children. */
{ACCT_TYPE_STOCK, "baz", "stocks", "2223", "baz", "", NULL},
{ACCT_TYPE_STOCK, "baz2", "stocks", "2223", "baz", "", NULL},
{ACCT_TYPE_MUTUAL, "baz", "stocks", "2223", "baz", "", NULL},
@@ -180,63 +186,74 @@
static TxnParms lot_txns[] =
{
- {"funding", -12, {
- {"funding_money", "money", NREC, {1000000, 100}, {0, 1}, 0},
- {"funding_gift", "gift", NREC, {1000000, 100}, {0, 1}, 0}
- }
+ {
+ "funding", -12, {
+ {"funding_money", "money", NREC, {1000000, 100}, {0, 1}, 0},
+ {"funding_gift", "gift", NREC, {1000000, 100}, {0, 1}, 0}
+ }
},
- {"waldo", -9, {
- {"waldo_baz", "baz", NREC, {1500, 1}, {150899, 100}, 1},
- {"waldo_money", "money", NREC, {-150899, 100}, {0, 1}, 0}
- }
+ {
+ "waldo", -9, {
+ {"waldo_baz", "baz", NREC, {1500, 1}, {150899, 100}, 1},
+ {"waldo_money", "money", NREC, { -150899, 100}, {0, 1}, 0}
+ }
},
- {"pepper", -7, {
- {"pepper_baz", "baz", CREC, {-500, 1}, {-69101, 100}, 1},
- {"pepper_money", "money", CREC, {69101, 100}, {0, 1}, 0}
- }
+ {
+ "pepper", -7, {
+ {"pepper_baz", "baz", CREC, { -500, 1}, { -69101, 100}, 1},
+ {"pepper_money", "money", CREC, {69101, 100}, {0, 1}, 0}
+ }
},
- {"salt", -2, {
- {"salt_baz", "baz", YREC, {1000, 1}, {120899, 10}, 2},
- {"salt_money", "money", YREC, {-120899, 100}, {0, 1}, 0}
- }
+ {
+ "salt", -2, {
+ {"salt_baz", "baz", YREC, {1000, 1}, {120899, 10}, 2},
+ {"salt_money", "money", YREC, { -120899, 100}, {0, 1}, 0}
+ }
},
- {"pork", 3, {
- {"pork_baz", "baz", YREC, {-1000, 1}, {-79101, 100}, 1},
- {"pork_money", "money", YREC, {79101, 100}, {0, 1}, 0}
- }
+ {
+ "pork", 3, {
+ {"pork_baz", "baz", YREC, { -1000, 1}, { -79101, 100}, 1},
+ {"pork_money", "money", YREC, {79101, 100}, {0, 1}, 0}
+ }
},
- {"sausage", 5, {
- {"sausage_baz", "baz", NREC, {-500, 1}, {-74101, 100}, 2},
- {"sausage_mmoney", "money", NREC, {74101, 100}, {0, 1}, 0}
- }
+ {
+ "sausage", 5, {
+ {"sausage_baz", "baz", NREC, { -500, 1}, { -74101, 100}, 2},
+ {"sausage_mmoney", "money", NREC, {74101, 100}, {0, 1}, 0}
+ }
},
- {"pork", 3, {
- {"pork_baz2", "baz2", YREC, {-1000, 1}, {-79101, 100}, 1},
- {"pork_money", "money", YREC, {79101, 100}, {0, 1}, 0}
- }
+ {
+ "pork", 3, {
+ {"pork_baz2", "baz2", YREC, { -1000, 1}, { -79101, 100}, 1},
+ {"pork_money", "money", YREC, {79101, 100}, {0, 1}, 0}
+ }
},
- {"sausage", 5, {
- {"sausage_baz2", "baz2", NREC, {-500, 1}, {-74101, 100}, 2},
- {"sausage_mmoney", "money", NREC, {74101, 100}, {0, 1}, 0}
- }
+ {
+ "sausage", 5, {
+ {"sausage_baz2", "baz2", NREC, { -500, 1}, { -74101, 100}, 2},
+ {"sausage_mmoney", "money", NREC, {74101, 100}, {0, 1}, 0}
+ }
},
- {"links", 1, {
- {"links_baz", "baz", NREC, {500, 1}, {60899, 100}, 3},
- {"links_mmoney", "money", NREC, {-60899, 100}, {0, 1}, 0}
- }
+ {
+ "links", 1, {
+ {"links_baz", "baz", NREC, {500, 1}, {60899, 100}, 3},
+ {"links_mmoney", "money", NREC, { -60899, 100}, {0, 1}, 0}
+ }
}
};
static SetupData complex = {G_N_ELEMENTS (complex_accts),
- (AccountParms**)(&complex_accts), 0, NULL};
+ (AccountParms**)(&complex_accts), 0, NULL
+ };
static SetupData complex_data = {G_N_ELEMENTS (complex_accts),
- (AccountParms**)(&complex_accts),
- G_N_ELEMENTS (lot_txns),
- (TxnParms**)(&lot_txns)};
+ (AccountParms**)(&complex_accts),
+ G_N_ELEMENTS (lot_txns),
+ (TxnParms**)(&lot_txns)
+ };
static Split*
-insert_split (Account *parent,Transaction *txn, SplitParms *p)
+insert_split (Account *parent, Transaction *txn, SplitParms *p)
{
QofBook *book = gnc_account_get_book (parent);
Split *split = xaccMallocSplit (book);
@@ -248,20 +265,20 @@
xaccSplitSetMemo (split, p->memo);
xaccSplitSetReconcile (split, (p->reconciled ? p->reconciled : NREC));
g_object_set (split,
- "account", acct,
- "memo", p->memo,
- "amount", &(p->amount),
- "value", &(p->value),
- NULL);
+ "account", acct,
+ "memo", p->memo,
+ "amount", &(p->amount),
+ "value", &(p->value),
+ NULL);
gnc_account_insert_split (acct, split);
if (p->lotnum == 0)
- return split;
+ return split;
if (p->lotnum > g_list_length (lotlist))
- lot = gnc_lot_new (book);
+ lot = gnc_lot_new (book);
else
- lot = GNC_LOT (g_list_nth_data (lotlist, p->lotnum - 1));
+ lot = GNC_LOT (g_list_nth_data (lotlist, p->lotnum - 1));
gnc_lot_add_split (lot, split);
return split;
@@ -292,20 +309,21 @@
{
Account *child = xaccMallocAccount (book);
AccountParms p = p_arr[ind];
- if (p.parent && strlen (p.parent) > 0)
- {
- Account *parent = g_hash_table_lookup (accts, p.parent);
- g_assert (parent != NULL);
- gnc_account_append_child (parent, child);
- }
- else
- gnc_account_append_child (acct, child);
+ if (p.parent && strlen (p.parent) > 0)
+ {
+ Account *parent = g_hash_table_lookup (accts, p.parent);
+ g_assert (parent != NULL);
+ gnc_account_append_child (parent, child);
+ }
+ else
+ gnc_account_append_child (acct, child);
acct = child;
xaccAccountSetType (acct, p.type);
- if (p.name) {
+ if (p.name)
+ {
xaccAccountSetName (acct, p.name);
- g_hash_table_insert (accts, p.name, acct);
- }
+ g_hash_table_insert (accts, p.name, acct);
+ }
if (p.code)
xaccAccountSetCode (acct, p.code);
if (p.desc)
@@ -323,22 +341,22 @@
t_arr = (TxnParms*)parms->txns;
for (ind = 0; ind < parms->num_txns; ind++)
{
- Transaction *txn = xaccMallocTransaction (book);
- TxnParms p = t_arr[ind];
- GDate *date = g_date_new ();
- g_date_set_time_t (date, time (0));
- xaccTransBeginEdit (txn);
- if (p.desc)
- xaccTransSetDescription (txn, p.desc);
- if (p.date_offset < 0)
- g_date_subtract_days (date, (guint)(-p.date_offset));
- else
- g_date_add_days (date, (guint)(p.date_offset));
- xaccTransSetDatePostedGDate (txn, *date);
- insert_split (root, txn, &p.splits[0]);
- insert_split (root, txn, &p.splits[1]);
-/* xaccTransCommitEdit () does a bunch of scrubbing that we don't need */
- qof_commit_edit (QOF_INSTANCE (txn));
+ Transaction *txn = xaccMallocTransaction (book);
+ TxnParms p = t_arr[ind];
+ GDate *date = g_date_new ();
+ g_date_set_time_t (date, time (0));
+ xaccTransBeginEdit (txn);
+ if (p.desc)
+ xaccTransSetDescription (txn, p.desc);
+ if (p.date_offset < 0)
+ g_date_subtract_days (date, (guint)(-p.date_offset));
+ else
+ g_date_add_days (date, (guint)(p.date_offset));
+ xaccTransSetDatePostedGDate (txn, *date);
+ insert_split (root, txn, &p.splits[0]);
+ insert_split (root, txn, &p.splits[1]);
+ /* xaccTransCommitEdit () does a bunch of scrubbing that we don't need */
+ qof_commit_edit (QOF_INSTANCE (txn));
}
fixture->acct = acct;
g_hash_table_destroy (accts);
@@ -412,7 +430,7 @@
else
{
gchar *tmp_list = g_strconcat ( account_list, "\n",
- node->data, NULL);
+ node->data, NULL);
g_free (account_list);
account_list = tmp_list;
}
@@ -426,7 +444,7 @@
"character.\n\nBelow you will find the list of invalid account names:\n"
"%s", separator, account_list);
message = gnc_account_name_violations_errmsg (separator, badnames);
- g_assert_cmpstr ( message, ==, validation_message);
+ g_assert_cmpstr ( message, == , validation_message);
g_free (validation_message);
g_free (message);
}
@@ -450,9 +468,9 @@
g_assert (gnc_account_list_name_violations (NULL, sep) == NULL);
g_log_set_default_handler (oldlogger, NULL);
results = gnc_account_list_name_violations (book, sep);
- g_assert_cmpuint (g_list_length (results), ==, 2);
+ g_assert_cmpuint (g_list_length (results), == , 2);
for (res_iter = results; res_iter; res_iter = g_list_next (res_iter))
- test_free (res_iter->data);
+ test_free (res_iter->data);
g_list_free (results);
}
/* mark_account
@@ -546,10 +564,10 @@
"placeholder", &hold,
NULL);
- g_assert_cmpstr (name, ==, "");
- g_assert_cmpstr (fname, ==, "");
- g_assert_cmpstr (code, ==, "");
- g_assert_cmpstr (desc, ==, "");
+ g_assert_cmpstr (name, == , "");
+ g_assert_cmpstr (fname, == , "");
+ g_assert_cmpstr (code, == , "");
+ g_assert_cmpstr (desc, == , "");
g_assert (!color);
g_assert (!notes);
g_assert (type == ACCT_TYPE_NONE);
@@ -628,32 +646,32 @@
QofBook *book2 = gnc_account_get_book (fixture->acct);
acc1 = gnc_book_get_root_account (NULL);
g_assert (!acc1);
-/* Check that an account is created, and that it isn't the same as the
- * one in fixture.
- */
+ /* Check that an account is created, and that it isn't the same as the
+ * one in fixture.
+ */
acc1 = gnc_book_get_root_account (book1);
g_assert (acc1);
g_assert (acc1 != fixture->acct);
-/* Now try to set the book's root account to the fixture
- * accout. Should throw an error.
- */
+ /* Now try to set the book's root account to the fixture
+ * accout. Should throw an error.
+ */
oldlogger = g_log_set_default_handler ((GLogFunc)test_null_handler, &quiet);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &quiet);
gnc_book_set_root_account (book1, fixture->acct);
g_assert (gnc_book_get_root_account (book1) == acc1);
g_log_set_default_handler (oldlogger, NULL);
-/* Check that if we set the same root, it stays set */
+ /* Check that if we set the same root, it stays set */
gnc_book_set_root_account (book2, fixture->acct);
g_assert (gnc_book_get_root_account (book2) == fixture->acct);
-/* Create a new account in book1 and check that we can set it to root */
+ /* Create a new account in book1 and check that we can set it to root */
acc2 = xaccMallocAccount (book1);
gnc_book_set_root_account (book1, acc2);
g_assert (gnc_book_get_root_account (book1) != acc1);
g_assert (gnc_book_get_root_account (book1) == acc2);
-/* Clean up */
-/* acc1 gets freed by setting the root accout to acc2
- g_object_unref (acc1);
-*/
+ /* Clean up */
+ /* acc1 gets freed by setting the root accout to acc2
+ g_object_unref (acc1);
+ */
g_object_unref (book1);
g_object_unref (acc2);
}
@@ -687,13 +705,13 @@
Account *acc;
gchar *name;
AccountTestFunctions *func = _utest_account_fill_functions ();
-/* Can't use gnc_book_get_root_account, it creates one if it doesn't
- * yet exist */
+ /* Can't use gnc_book_get_root_account, it creates one if it doesn't
+ * yet exist */
g_assert (func->coll_get_root_account (coll) == NULL);
acc = gnc_account_create_root (book);
g_assert (acc);
g_object_get (acc, "name", &name, NULL);
- g_assert_cmpstr (name, ==, "Root Account");
+ g_assert_cmpstr (name, == , "Root Account");
g_assert (gnc_book_get_root_account (book) == acc);
g_object_unref (book);
g_object_unref (acc);
@@ -720,7 +738,7 @@
clone = xaccCloneAccount (fixture->acct, NULL);
g_assert (clone == NULL);
g_log_set_default_handler (oldlogger, NULL);
-/* Now test the real clone */
+ /* Now test the real clone */
clone = xaccCloneAccount (fixture->acct, book);
g_assert (clone);
acct_p = fixture->func->get_private (fixture->acct);
@@ -730,11 +748,11 @@
g_assert (clone_p->accountCode == acct_p->accountCode);
g_assert (clone_p->description == acct_p->description);
g_assert (kvp_frame_compare (clone->inst.kvp_data,
- fixture->acct->inst.kvp_data) == 0);
+ fixture->acct->inst.kvp_data) == 0);
g_assert (gnc_commodity_equal (clone_p->commodity, acct_p->commodity));
g_assert (clone_p->commodity_scu == acct_p->commodity_scu);
g_assert (clone_p->non_standard_scu == acct_p->non_standard_scu);
-/* Clean Up */
+ /* Clean Up */
g_object_unref (clone);
}
@@ -752,11 +770,11 @@
{
Account *root = gnc_account_get_root (fixture->acct);
AccountPrivate *priv = fixture->func->get_private (root);
- g_assert_cmpuint (g_list_length (priv->children), >, 0);
+ g_assert_cmpuint (g_list_length (priv->children), > , 0);
fixture->func->xaccFreeAccountChildren (root);
-/* We'd like to check for the child actually having been freed, but
- * there's not good way to do that. */
- g_assert_cmpuint (g_list_length (priv->children), ==, 0);
+ /* We'd like to check for the child actually having been freed, but
+ * there's not good way to do that. */
+ g_assert_cmpuint (g_list_length (priv->children), == , 0);
qof_book_destroy (gnc_account_get_book (root));
/* No need to unref the root account, qof_book_destroy did that. */
g_free (fixture->func);
@@ -774,17 +792,17 @@
calls xaccFreeACcountChildren
tests qof_book_shutting_down and either deletes the split list for the account (trusting the Transaction code to delete the splits if it is shutting down) or deletes the actual splits while it's clearing the list. (What happens to the references in the transactions then? It's calling xaccSplitDestroy, not g_oject_unref!)
Again checking that the book isn't shutting down:
- run destroy_pending_splits_for_account
+ run destroy_pending_splits_for_account
destroy all of the lots in the lots list (again, destroy, not unref or even dispose)
free the lot list (regardless of whether the book is shuttin down) and NULL the pointer
set the instance dirty
unconditionally calls qof_commit_edit_part2 with acc_free
qof_commit_edit_part2:
- calls the backend's commit if there is one
+ calls the backend's commit if there is one
calls acc_free
calls acc_done (which only fires off a qof_event, so we'll ignore it)
acc_free removes the account from the parent if there is one and calls xaccFreeAccount, then calls xaccFreeAccount
-xaccFreeAccount calls:
+xaccFreeAccount calls:
xaccFreeAccountChildren
destroys the lots (unless commitEdit did so already) and NULLs the pointer
destroys the splits unless commitEdit did so already
@@ -801,7 +819,7 @@
test_xaccFreeAccount (Fixture *fixture, gconstpointer pData)
{
gchar *msg1 = "[xaccFreeAccount()] instead of calling xaccFreeAccount(), please call \n"
- " xaccAccountBeginEdit(); xaccAccountDestroy(); \n";
+ " xaccAccountBeginEdit(); xaccAccountDestroy(); \n";
gchar *msg2 = "xaccTransGetSplitIndex: assertion `trans && split' failed";
guint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
TestErrorStruct check1 = { loglevel, "gnc.account", msg1 };
@@ -817,32 +835,32 @@
test_add_error (&check1);
test_add_error (&check2);
hdlr1 = g_log_set_handler ("gnc.account", loglevel,
- (GLogFunc)test_checked_handler, &check1);
+ (GLogFunc)test_checked_handler, &check1);
hdlr2 = g_log_set_handler ("gnc.engine", loglevel,
- (GLogFunc)test_checked_handler, &check2);
+ (GLogFunc)test_checked_handler, &check2);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_list_handler, NULL);
for (i = 0; i < numItems; i++)
{
- Split *split = xaccMallocSplit (book);
- xaccSplitSetAccount (split, parent);
- gnc_account_insert_split (parent, split);
- xaccAccountInsertLot (parent, gnc_lot_new (book));
+ Split *split = xaccMallocSplit (book);
+ xaccSplitSetAccount (split, parent);
+ gnc_account_insert_split (parent, split);
+ xaccAccountInsertLot (parent, gnc_lot_new (book));
}
xaccAccountSetCommodity (parent, commodity);
-/* Check that we've got children, lots, and splits to remove */
+ /* Check that we've got children, lots, and splits to remove */
g_assert (p_priv->children != NULL);
g_assert (p_priv->lots != NULL);
g_assert (p_priv->splits != NULL);
g_assert (p_priv->parent != NULL);
g_assert (p_priv->commodity != NULL);
-/* Now set the other private parts to something so that they can be set back */
+ /* Now set the other private parts to something so that they can be set back */
p_priv->cleared_balance = gnc_numeric_create ( 5, 12);
p_priv->reconciled_balance = gnc_numeric_create ( 5, 12);
p_priv->balance = gnc_numeric_create ( 5, 12);
p_priv->balance_dirty = TRUE;
p_priv->sort_dirty = TRUE;
fixture->func->xaccFreeAccount (parent);
-/* cleanup what's left */
+ /* cleanup what's left */
g_log_remove_handler ("gnc.account", hdlr1);
g_log_remove_handler ("gnc.engine", hdlr2);
test_clear_error_list ();
@@ -906,7 +924,7 @@
test_xaccAccountCommitEdit (Fixture *fixture, gconstpointer pData)
{
gchar *msg1 = "[xaccFreeAccount()] instead of calling xaccFreeAccount(), please call \n"
- " xaccAccountBeginEdit(); xaccAccountDestroy(); \n";
+ " xaccAccountBeginEdit(); xaccAccountDestroy(); \n";
gchar *msg2 = "xaccTransGetSplitIndex: assertion `trans && split' failed";
guint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
TestErrorStruct check1 = { loglevel, "gnc.account", msg1 };
@@ -922,19 +940,19 @@
test_add_error (&check1);
test_add_error (&check2);
hdlr1 = g_log_set_handler ("gnc.account", loglevel,
- (GLogFunc)test_checked_handler, &check1);
+ (GLogFunc)test_checked_handler, &check1);
hdlr2 = g_log_set_handler ("gnc.engine", loglevel,
- (GLogFunc)test_checked_handler, &check2);
+ (GLogFunc)test_checked_handler, &check2);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_list_handler, NULL);
for (i = 0; i < numItems; i++)
{
- Split *split = xaccMallocSplit (book);
- xaccSplitSetAccount (split, parent);
- gnc_account_insert_split (parent, split);
- xaccAccountInsertLot (parent, gnc_lot_new (book));
+ Split *split = xaccMallocSplit (book);
+ xaccSplitSetAccount (split, parent);
+ gnc_account_insert_split (parent, split);
+ xaccAccountInsertLot (parent, gnc_lot_new (book));
}
xaccAccountSetCommodity (parent, commodity);
-/* Check that we've got children, lots, and splits to remove */
+ /* Check that we've got children, lots, and splits to remove */
g_assert (p_priv->children != NULL);
g_assert (p_priv->lots != NULL);
g_assert (p_priv->splits != NULL);
@@ -943,10 +961,10 @@
sig1 = test_signal_new (&parent->inst, QOF_EVENT_MODIFY, NULL);
sig2 = test_signal_new (&parent->inst, QOF_EVENT_DESTROY, NULL);
-/* Now we're ready to start testing. */
+ /* Now we're ready to start testing. */
xaccAccountBeginEdit (parent);
xaccAccountCommitEdit (parent);
-/* Make sure that the account didn't get destroyed */
+ /* Make sure that the account didn't get destroyed */
test_signal_assert_hits (sig1, 1);
test_signal_assert_hits (sig2, 0);
g_assert (p_priv->children != NULL);
@@ -954,15 +972,15 @@
g_assert (p_priv->splits != NULL);
g_assert (p_priv->parent != NULL);
g_assert (p_priv->commodity != NULL);
-/* xaccAccountDestroy destroys the account by calling
- * qof_instance_set_destroying (), then xaccAccountCommitEdit ();
- */
+ /* xaccAccountDestroy destroys the account by calling
+ * qof_instance_set_destroying (), then xaccAccountCommitEdit ();
+ */
xaccAccountBeginEdit (parent);
xaccAccountDestroy (parent);
-/* So this time we make sure that the account is destroyed */
+ /* So this time we make sure that the account is destroyed */
test_signal_assert_hits (sig1, 2);
test_signal_assert_hits (sig2, 1);
-/* And clean up */
+ /* And clean up */
test_signal_free (sig1);
test_signal_free (sig2);
g_log_remove_handler ("gnc.account", hdlr1);
@@ -1023,20 +1041,20 @@
guint logger;
sig1 = test_signal_new (&fixture->acct->inst, QOF_EVENT_MODIFY, NULL);
sig2 = test_signal_new (&fixture->acct->inst, GNC_EVENT_ITEM_ADDED, split1);
-/* Check that the call fails with invalid account and split (throws) */
+ /* Check that the call fails with invalid account and split (throws) */
test_add_error (&check1);
test_add_error (&check2);
logger = g_log_set_handler ("gnc.engine", loglevel,
- (GLogFunc)test_checked_handler, &check3);
+ (GLogFunc)test_checked_handler, &check3);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_list_handler, NULL);
g_assert (!gnc_account_insert_split (NULL, split1));
- g_assert_cmpuint (g_list_length (priv->splits), ==, 0);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 0);
g_assert (!priv->sort_dirty);
g_assert (!priv->balance_dirty);
test_signal_assert_hits (sig1, 0);
test_signal_assert_hits (sig2, 0);
g_assert (!gnc_account_insert_split (fixture->acct, NULL));
- g_assert_cmpuint (g_list_length (priv->splits), ==, 0);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 0);
g_assert (!priv->sort_dirty);
g_assert (!priv->balance_dirty);
test_signal_assert_hits (sig1, 0);
@@ -1044,62 +1062,62 @@
g_log_remove_handler ("gnc.engine", logger);
test_clear_error_list ();
-/* Check that it works the first time */
+ /* Check that it works the first time */
g_assert (gnc_account_insert_split (fixture->acct, split1));
- g_assert_cmpuint (g_list_length (priv->splits), ==, 1);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 1);
g_assert (!priv->sort_dirty);
g_assert (priv->balance_dirty);
test_signal_assert_hits (sig1, 1);
test_signal_assert_hits (sig2, 1);
-/* Check that it fails if the split has already been added once */
+ /* Check that it fails if the split has already been added once */
g_assert (!gnc_account_insert_split (fixture->acct, split1));
-/* Free up hdlr2 and set up hdlr2 */
+ /* Free up hdlr2 and set up hdlr2 */
test_signal_free (sig2);
sig3 = test_signal_new (&fixture->acct->inst, GNC_EVENT_ITEM_ADDED, split2);
-/* Now add a second split to the account and check that sort_dirty isn't set. We have to bump the editlevel to force this. */
+ /* Now add a second split to the account and check that sort_dirty isn't set. We have to bump the editlevel to force this. */
g_assert (gnc_account_insert_split (fixture->acct, split2));
- g_assert_cmpuint (g_list_length (priv->splits), ==, 2);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 2);
g_assert (!priv->sort_dirty);
g_assert (priv->balance_dirty);
test_signal_assert_hits (sig1, 2);
test_signal_assert_hits (sig3, 1);
-/* One more add, incrementing the editlevel to get sort_dirty set. */
+ /* One more add, incrementing the editlevel to get sort_dirty set. */
test_signal_free (sig3);
sig3 = test_signal_new (&fixture->acct->inst, GNC_EVENT_ITEM_ADDED, split3);
qof_instance_increase_editlevel (fixture->acct);
g_assert (gnc_account_insert_split (fixture->acct, split3));
qof_instance_decrease_editlevel (fixture->acct);
- g_assert_cmpuint (g_list_length (priv->splits), ==, 3);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 3);
g_assert (priv->sort_dirty);
g_assert (priv->balance_dirty);
test_signal_assert_hits (sig1, 3);
test_signal_assert_hits (sig3, 1);
-/* Finally delete a split. It's going to recompute the balance, so
- * balance_dirty will be false. */
+ /* Finally delete a split. It's going to recompute the balance, so
+ * balance_dirty will be false. */
test_signal_free (sig3);
sig3 = test_signal_new (&fixture->acct->inst, GNC_EVENT_ITEM_REMOVED,
- split3);
+ split3);
g_assert (gnc_account_remove_split (fixture->acct, split3));
- g_assert_cmpuint (g_list_length (priv->splits), ==, 2);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 2);
g_assert (priv->sort_dirty);
g_assert (!priv->balance_dirty);
test_signal_assert_hits (sig1, 4);
test_signal_assert_hits (sig3, 1);
-/* And do it again to make sure that it fails when the split has
- * already been removed */
+ /* And do it again to make sure that it fails when the split has
+ * already been removed */
g_assert (!gnc_account_remove_split (fixture->acct, split3));
- g_assert_cmpuint (g_list_length (priv->splits), ==, 2);
+ g_assert_cmpuint (g_list_length (priv->splits), == , 2);
g_assert (priv->sort_dirty);
g_assert (!priv->balance_dirty);
test_signal_assert_hits (sig1, 4);
test_signal_assert_hits (sig3, 1);
-/* Clean up the handlers */
+ /* Clean up the handlers */
test_signal_free (sig3);
test_signal_free (sig1);
}
/* xaccAccountSortSplits
void
-xaccAccountSortSplits (Account *acc, gboolean force)// C: 4 in 2
+xaccAccountSortSplits (Account *acc, gboolean force)// C: 4 in 2
Make static?
Passthrough, no test.
*/
@@ -1137,64 +1155,64 @@
GNCLot *lot = gnc_lot_new (book);
Account *parent = gnc_account_get_parent (fixture->acct);
TestSignal sig1 = test_signal_new (QOF_INSTANCE (lot),
- QOF_EVENT_ADD, NULL);
+ QOF_EVENT_ADD, NULL);
TestSignal sig2 = test_signal_new (&fixture->acct->inst,
- QOF_EVENT_MODIFY,NULL);
+ QOF_EVENT_MODIFY, NULL);
TestSignal sig3 = test_signal_new (QOF_INSTANCE (lot),
- QOF_EVENT_REMOVE, NULL);
+ QOF_EVENT_REMOVE, NULL);
TestSignal sig4 = test_signal_new (&parent->inst, QOF_EVENT_MODIFY, NULL);
AccountPrivate *a_priv = fixture->func->get_private (fixture->acct);
AccountPrivate *p_priv = fixture->func->get_private (parent);
- g_assert_cmpuint (g_list_length (a_priv->lots), ==, 0);
- g_assert_cmpuint (g_list_length (p_priv->lots), ==, 0);
+ g_assert_cmpuint (g_list_length (a_priv->lots), == , 0);
+ g_assert_cmpuint (g_list_length (p_priv->lots), == , 0);
xaccAccountInsertLot (fixture->acct, lot);
g_assert (gnc_lot_get_account (lot) == fixture->acct);
- g_assert_cmpuint (g_list_length (a_priv->lots), ==, 1);
+ g_assert_cmpuint (g_list_length (a_priv->lots), == , 1);
test_signal_assert_hits (sig1, 1);
test_signal_assert_hits (sig2, 1);
-/* Make sure that inserting again doesn't do anything */
+ /* Make sure that inserting again doesn't do anything */
xaccAccountInsertLot (fixture->acct, lot);
g_assert (gnc_lot_get_account (lot) == fixture->acct);
- g_assert_cmpuint (g_list_length (a_priv->lots), ==, 1);
+ g_assert_cmpuint (g_list_length (a_priv->lots), == , 1);
test_signal_assert_hits (sig1, 1);
test_signal_assert_hits (sig2, 1);
-/* Check that inserting the lot into a different account changes the lot */
+ /* Check that inserting the lot into a different account changes the lot */
xaccAccountInsertLot (parent, lot);
g_assert (gnc_lot_get_account (lot) == parent);
- g_assert_cmpuint (g_list_length (a_priv->lots), ==, 0);
- g_assert_cmpuint (g_list_length (p_priv->lots), ==, 1);
+ g_assert_cmpuint (g_list_length (a_priv->lots), == , 0);
+ g_assert_cmpuint (g_list_length (p_priv->lots), == , 1);
test_signal_assert_hits (sig1, 2);
test_signal_assert_hits (sig4, 1);
test_signal_assert_hits (sig2, 1);
-/* Check that removing the lot works */
+ /* Check that removing the lot works */
xaccAccountRemoveLot (parent, lot);
/* The following test should fail, but it doesn't because of an
* error in the routine: When removing a lot from an account, the
* account reference in the lot object should be NULLed. */
g_assert (gnc_lot_get_account (lot) != NULL);
- g_assert_cmpuint (g_list_length (a_priv->lots), ==, 0);
- g_assert_cmpuint (g_list_length (p_priv->lots), ==, 0);
+ g_assert_cmpuint (g_list_length (a_priv->lots), == , 0);
+ g_assert_cmpuint (g_list_length (p_priv->lots), == , 0);
test_signal_assert_hits (sig3, 1);
test_signal_assert_hits (sig4, 2);
test_signal_assert_hits (sig2, 1);
-/* Check that destroying the lot removes its reference */
-/* Because the lot's account pointer doesn't get nulled when the lot
- * is removed, we have to do that for the next test to work: */
+ /* Check that destroying the lot removes its reference */
+ /* Because the lot's account pointer doesn't get nulled when the lot
+ * is removed, we have to do that for the next test to work: */
gnc_lot_set_account (lot, NULL);
xaccAccountInsertLot (parent, lot);
- g_assert_cmpuint (g_list_length (p_priv->lots), ==, 1);
+ g_assert_cmpuint (g_list_length (p_priv->lots), == , 1);
g_assert (gnc_lot_get_account (lot) == parent);
gnc_lot_destroy (lot);
/* Destroying the lot should remove it from the account; Not Happening. */
- g_assert_cmpuint (g_list_length (p_priv->lots), !=, 0);
+ g_assert_cmpuint (g_list_length (p_priv->lots), != , 0);
test_signal_assert_hits (sig1, 3);
-/* We get a modify only on the insert, since there is no remove when
- * the lot is destroyed. */
+ /* We get a modify only on the insert, since there is no remove when
+ * the lot is destroyed. */
test_signal_assert_hits (sig4, 3);
-/* Same thing: There should be a "removed" signal on the lot, but
- * since it isn't removed, no signal. */
+ /* Same thing: There should be a "removed" signal on the lot, but
+ * since it isn't removed, no signal. */
test_signal_assert_hits (sig3, 1);
test_signal_free (sig1);
test_signal_free (sig2);
@@ -1202,7 +1220,7 @@
test_signal_free (sig4);
}
-/*
+/*
static void
xaccPreSplitMove (Split *split, gpointer dummy)// 2
static void
@@ -1226,7 +1244,7 @@
{
AccountPrivate *priv = fixture->func->get_private (fixture->acct);
gnc_numeric bal = gnc_numeric_zero (), rec_bal = gnc_numeric_zero (),
- clr_bal = gnc_numeric_zero ();
+ clr_bal = gnc_numeric_zero ();
SetupData *sdata = (SetupData*)pData;
TxnParms* t_arr;
int ind;
@@ -1234,12 +1252,12 @@
t_arr = (TxnParms*)sdata->txns;
for (ind = 0; ind < sdata->num_txns; ind++)
{
- SplitParms p = t_arr[ind].splits[1];
- bal = gnc_numeric_add_fixed (bal, p.amount);
- if (p.reconciled != NREC)
- clr_bal = gnc_numeric_add_fixed (clr_bal, p.amount);
- if (p.reconciled == YREC || p.reconciled == FREC)
- rec_bal = gnc_numeric_add_fixed (rec_bal, p.amount);
+ SplitParms p = t_arr[ind].splits[1];
+ bal = gnc_numeric_add_fixed (bal, p.amount);
+ if (p.reconciled != NREC)
+ clr_bal = gnc_numeric_add_fixed (clr_bal, p.amount);
+ if (p.reconciled == YREC || p.reconciled == FREC)
+ rec_bal = gnc_numeric_add_fixed (rec_bal, p.amount);
}
g_assert (gnc_numeric_zero_p (priv->starting_balance));
g_assert (gnc_numeric_zero_p (priv->balance));
@@ -1269,47 +1287,47 @@
ab = xaccMallocAccount (book);
g_object_set (G_OBJECT (aa),
- "code", "3333",
- "type", ACCT_TYPE_ASSET,
- "name", "foo",
- NULL);
+ "code", "3333",
+ "type", ACCT_TYPE_ASSET,
+ "name", "foo",
+ NULL);
g_object_set (G_OBJECT (ab),
- "code", "3333",
- "type", ACCT_TYPE_ASSET,
- "name", "foo",
- NULL);
+ "code", "3333",
+ "type", ACCT_TYPE_ASSET,
+ "name", "foo",
+ NULL);
- g_assert_cmpint (xaccAccountOrder (aa, aa), ==, 0);
- g_assert_cmpint (xaccAccountOrder (aa, ab), ==,
- qof_instance_guid_compare (aa, ab));
+ g_assert_cmpint (xaccAccountOrder (aa, aa), == , 0);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), == ,
+ qof_instance_guid_compare (aa, ab));
g_object_set (G_OBJECT (ab), "name", "bar", NULL);
- g_assert_cmpint (xaccAccountOrder (aa, ab), >, 0);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), > , 0);
g_object_set (G_OBJECT (ab), "name", "waldo", NULL);
- g_assert_cmpint (xaccAccountOrder (aa, ab), <, 0);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), < , 0);
g_object_set (G_OBJECT (ab), "type", ACCT_TYPE_BANK, NULL);
g_test_message ("The next test should fail: There's an error in the sort"
- " sequence that causes ACCT_TYPE_BANK to sort last"
- " instead of first\n");
- g_assert_cmpint (xaccAccountOrder (aa, ab), <, 0);
+ " sequence that causes ACCT_TYPE_BANK to sort last"
+ " instead of first\n");
+ g_assert_cmpint (xaccAccountOrder (aa, ab), < , 0);
g_object_set (G_OBJECT (ab), "type", ACCT_TYPE_STOCK, NULL);
- g_assert_cmpint (xaccAccountOrder (aa, ab), >, 0);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), > , 0);
g_object_set (G_OBJECT (ab),
- "type", ACCT_TYPE_INCOME,
- "name", "bar",
- NULL);
- g_assert_cmpint (xaccAccountOrder (aa, ab), <, 0);
+ "type", ACCT_TYPE_INCOME,
+ "name", "bar",
+ NULL);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), < , 0);
g_object_set (G_OBJECT (ab), "code", "2222",
- "name", "waldo",
- NULL);
- g_assert_cmpint (xaccAccountOrder (aa, ab), >, 0);
+ "name", "waldo",
+ NULL);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), > , 0);
g_object_set (G_OBJECT (ab),
- "code", "4444",
- "type", ACCT_TYPE_STOCK,
- "name", "bar",
- NULL);
- g_assert_cmpint (xaccAccountOrder (aa, ab), <, 0);
+ "code", "4444",
+ "type", ACCT_TYPE_STOCK,
+ "name", "bar",
+ NULL);
+ g_assert_cmpint (xaccAccountOrder (aa, ab), < , 0);
xaccAccountBeginEdit (aa);
xaccAccountDestroy (aa);
@@ -1355,10 +1373,10 @@
Account *old_parent = gnc_account_get_parent (fixture->acct);
AccountTestFunctions *func = _utest_account_fill_functions ();
g_assert (root != old_parent);
-/* qofAccountSetParent doesn't check to see if the parent is already
- * set, nor does gnc_account_append_child, which is the passed-through
- * function.
- */
+ /* qofAccountSetParent doesn't check to see if the parent is already
+ * set, nor does gnc_account_append_child, which is the passed-through
+ * function.
+ */
func->qofAccountSetParent (fixture->acct, QOF_INSTANCE (root));
g_assert (root == gnc_account_get_parent (fixture->acct));
g_assert (qof_instance_get_dirty (QOF_INSTANCE (fixture->acct)));
@@ -1387,7 +1405,7 @@
TestSignal sig1, sig2, sig3;
AccountTestFunctions *func = _utest_account_fill_functions ();
AccountPrivate *frpriv = func->get_private (froot),
- *apriv = func->get_private (fixture->acct);
+ *apriv = func->get_private (fixture->acct);
const GncGUID *acct_guid = qof_instance_get_guid (QOF_INSTANCE (account));
sig1 = test_signal_new (QOF_INSTANCE (account), QOF_EVENT_ADD, NULL);
sig2 = test_signal_new (QOF_INSTANCE (account), QOF_EVENT_DESTROY, NULL);
@@ -1402,23 +1420,23 @@
g_assert (qof_instance_get_dirty (QOF_INSTANCE (account)));
g_assert (g_list_find (frpriv->children, account));
g_assert (qof_collection_lookup_entity (
- qof_book_get_collection (fbook, GNC_ID_ACCOUNT),
- acct_guid));
+ qof_book_get_collection (fbook, GNC_ID_ACCOUNT),
+ acct_guid));
log_handler = g_log_set_handler (logdomain, G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, (GLogFunc)test_null_handler, &check_warn);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check_warn);
gnc_account_append_child (fixture->acct, account);
g_log_remove_handler (logdomain, log_handler);
- g_assert_cmpstr (msg1, ==, check_warn.msg);
+ g_assert_cmpstr (msg1, == , check_warn.msg);
g_assert (gnc_account_get_parent (account) == fixture->acct);
test_signal_assert_hits (sig1, 2);
test_signal_assert_hits (sig2, 1);
test_signal_assert_hits (sig3, 1);
g_assert (!qof_collection_lookup_entity (
- qof_book_get_collection (fbook, GNC_ID_ACCOUNT),
- acct_guid));
+ qof_book_get_collection (fbook, GNC_ID_ACCOUNT),
+ acct_guid));
g_assert (qof_collection_lookup_entity (
- qof_book_get_collection (book, GNC_ID_ACCOUNT),
- acct_guid));
+ qof_book_get_collection (book, GNC_ID_ACCOUNT),
+ acct_guid));
g_assert (qof_instance_get_dirty (QOF_INSTANCE (fixture->acct)));
g_assert (g_list_find (frpriv->children, account) == NULL);
g_assert (g_list_find (apriv->children, account));
@@ -1429,7 +1447,7 @@
sig1 = test_signal_new (&account->inst, QOF_EVENT_REMOVE, NULL);
sig2 = test_signal_new (&(fixture->acct)->inst, QOF_EVENT_MODIFY, NULL);
log_handler = g_log_set_handler (logdomain, G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL,
- (GLogFunc)test_null_handler, &check_err);
+ (GLogFunc)test_null_handler, &check_err);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check_err);
gnc_account_remove_child (froot, account);
g_log_remove_handler (logdomain, log_handler);
@@ -1468,8 +1486,8 @@
test_gnc_account_n_descendants (Fixture *fixture, gconstpointer pData)
{
g_assert_cmpint (
- gnc_account_n_descendants (
- gnc_account_get_root (fixture->acct)), ==, 4);
+ gnc_account_n_descendants (
+ gnc_account_get_root (fixture->acct)), == , 4);
}
/* gnc_account_get_current_depth
gint
@@ -1478,7 +1496,7 @@
test_gnc_account_get_current_depth (Fixture *fixture, gconstpointer pData)
{
g_assert_cmpint (
- gnc_account_get_current_depth (fixture->acct), ==, 2);
+ gnc_account_get_current_depth (fixture->acct), == , 2);
}
/* gnc_account_get_tree_depth
gint
@@ -1486,12 +1504,12 @@
static void
test_gnc_account_get_tree_depth (Fixture *fixture, gconstpointer pData)
{
-/* Magic result value based on depth of the "complex" AccountParms array. */
+ /* Magic result value based on depth of the "complex" AccountParms array. */
g_assert_cmpint (
- gnc_account_get_tree_depth (
- gnc_account_get_root (fixture->acct)), ==, 5);
+ gnc_account_get_tree_depth (
+ gnc_account_get_root (fixture->acct)), == , 5);
g_assert_cmpint (
- gnc_account_get_tree_depth (fixture->acct), ==, 1);
+ gnc_account_get_tree_depth (fixture->acct), == , 1);
}
/* gnc_account_get_descendants
GList *
@@ -1504,11 +1522,11 @@
GNCAccountType type;
const gchar *typestr;
g_object_get (account,
- "type", &type,
- "name", &name,
- "code", &code,
- "description", &desc,
- NULL);
+ "type", &type,
+ "name", &name,
+ "code", &code,
+ "description", &desc,
+ NULL);
typestr = xaccAccountGetTypeStr (type);
g_test_message ("%s: %s, %s %s", typestr, code, name, desc);
g_free (code);
@@ -1521,10 +1539,10 @@
{
GList *list = gnc_account_get_descendants (
- gnc_account_get_root (fixture->acct));
+ gnc_account_get_root (fixture->acct));
g_assert (list != NULL);
- g_assert_cmpuint (g_list_length (list), ==, 34);
- g_assert_cmpint (g_list_index (list, fixture->acct), ==, 33);
+ g_assert_cmpuint (g_list_length (list), == , 34);
+ g_assert_cmpint (g_list_index (list, fixture->acct), == , 33);
g_list_free (list);
list = gnc_account_get_descendants (fixture->acct);
g_assert (list == NULL);
@@ -1536,11 +1554,11 @@
test_gnc_account_get_descendants_sorted (Fixture *fixture, gconstpointer pData)
{
GList *list = gnc_account_get_descendants_sorted (
- gnc_account_get_root (fixture->acct));
+ gnc_account_get_root (fixture->acct));
g_assert (list != NULL);
g_list_foreach (list, print_account, NULL);
- g_assert_cmpuint (g_list_length (list), ==, 34);
- g_assert_cmpint (g_list_index (list, fixture->acct), ==, 10);
+ g_assert_cmpuint (g_list_length (list), == , 34);
+ g_assert_cmpint (g_list_index (list, fixture->acct), == , 10);
g_list_free (list);
}
/* gnc_account_lookup_by_name
@@ -1555,17 +1573,17 @@
target = gnc_account_lookup_by_name (root, "income");
g_assert (target != NULL);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "4000");
+ g_assert_cmpstr (code, == , "4000");
target = gnc_account_lookup_by_name (target, "int");
g_assert (target != NULL);
g_free (code);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "4160");
+ g_assert_cmpstr (code, == , "4160");
target = gnc_account_lookup_by_name (root, "bank");
g_assert (target != NULL);
g_free (code);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "2300");
+ g_assert_cmpstr (code, == , "2300");
target = gnc_account_lookup_by_name (target, "int");
g_assert (target == NULL);
g_free (code);
@@ -1583,12 +1601,12 @@
target = gnc_account_lookup_by_code (root, "3100");
g_assert (target != NULL);
g_object_get (target, "name", &name, NULL);
- g_assert_cmpstr (name, ==, "ordinary");
+ g_assert_cmpstr (name, == , "ordinary");
g_free (name);
target = gnc_account_lookup_by_code (target, "3150");
g_assert (target != NULL);
g_object_get (target, "name", &name, NULL);
- g_assert_cmpstr (name, ==, "utilities");
+ g_assert_cmpstr (name, == , "utilities");
target = gnc_account_lookup_by_code (target, "2100");
g_assert (target == NULL);
g_free (name);
@@ -1599,7 +1617,7 @@
*/
static void
test_gnc_account_lookup_by_full_name_helper ( Fixture *fixture,
- gconstpointer pData )
+ gconstpointer pData )
{
Account *root, *target;
gchar *names1[] = {"income", "taxable", "int", NULL};
@@ -1612,12 +1630,12 @@
target = func->gnc_account_lookup_by_full_name_helper (root, names1);
g_assert (target != NULL);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "4160");
+ g_assert_cmpstr (code, == , "4160");
g_free (code);
target = func->gnc_account_lookup_by_full_name_helper (root, names2);
g_assert (target != NULL);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "4210");
+ g_assert_cmpstr (code, == , "4210");
target = func->gnc_account_lookup_by_full_name_helper (root, names3);
g_assert (target == NULL);
g_free (code);
@@ -1639,12 +1657,12 @@
target = gnc_account_lookup_by_full_name (root, names1);
g_assert (target != NULL);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "4160");
+ g_assert_cmpstr (code, == , "4160");
g_free (code);
target = gnc_account_lookup_by_full_name (root, names2);
g_assert (target != NULL);
g_object_get (target, "code", &code, NULL);
- g_assert_cmpstr (code, ==, "4210");
+ g_assert_cmpstr (code, == , "4210");
target = gnc_account_lookup_by_full_name (root, names3);
g_assert (target == NULL);
g_free (code);
@@ -1667,8 +1685,8 @@
g_object_get (G_OBJECT (s), "name", &name, NULL);
if (!g_strcmp0 (name, "int"))
{
- g_free (name);
- return s;
+ g_free (name);
+ return s;
}
g_free (name);
++(*counter);
@@ -1684,7 +1702,7 @@
Account *begin = gnc_account_lookup_by_code (root, "4000");
guint counter = 0;
gnc_account_foreach_child (begin, thunk, &counter);
- g_assert_cmpint (counter, ==, 2);
+ g_assert_cmpint (counter, == , 2);
}
/* gnc_account_foreach_child_until *** Not Used ***
gpointer
@@ -1716,7 +1734,7 @@
Account *begin = gnc_account_lookup_by_code (root, "4000");
guint counter = 0;
gnc_account_foreach_descendant (begin, thunk, &counter);
- g_assert_cmpint (counter, ==, 13);
+ g_assert_cmpint (counter, == , 13);
}
/* gnc_account_foreach_descendant_until
gpointer
@@ -1731,12 +1749,12 @@
Account *result;
guint counter = 0;
result = gnc_account_foreach_descendant_until (first, thunk2, &counter);
- g_assert_cmpint (counter, ==, 11);
+ g_assert_cmpint (counter, == , 11);
g_assert (result == NULL);
counter = 0;
result = gnc_account_foreach_descendant_until (second, thunk2, &counter);
g_assert (result == expected);
- g_assert_cmpint (counter, ==, 6);
+ g_assert_cmpint (counter, == , 6);
}
/* More getter/setters:
* xaccAccountGetType
@@ -1764,15 +1782,15 @@
gchar *result;
result = gnc_account_get_full_name (NULL);
g_assert (result != NULL);
- g_assert_cmpstr (result, ==, "");
+ g_assert_cmpstr (result, == , "");
g_free (result);
result = gnc_account_get_full_name (gnc_account_get_root (fixture->acct));
g_assert (result != NULL);
- g_assert_cmpstr (result, ==, "");
+ g_assert_cmpstr (result, == , "");
g_free (result);
result = gnc_account_get_full_name (fixture->acct);
g_assert (result != NULL);
- g_assert_cmpstr (result, ==, "foo:baz:waldo");
+ g_assert_cmpstr (result, == , "foo:baz:waldo");
g_free (result);
}
@@ -1799,17 +1817,17 @@
t_arr = (TxnParms*)sdata->txns;
for (ind = 0; ind < min_ind; ind++)
{
- SplitParms p = t_arr[ind].splits[1];
- bal = gnc_numeric_add_fixed (bal, p.amount);
+ SplitParms p = t_arr[ind].splits[1];
+ bal = gnc_numeric_add_fixed (bal, p.amount);
}
dbal = gnc_numeric_to_double (bal);
val = xaccAccountGetProjectedMinimumBalance (fixture->acct);
dval = gnc_numeric_to_double (val);
- g_assert_cmpfloat (dval, ==, 0.0);
+ g_assert_cmpfloat (dval, == , 0.0);
xaccAccountRecomputeBalance (fixture->acct);
val = xaccAccountGetProjectedMinimumBalance (fixture->acct);
dval = gnc_numeric_to_double (val);
- g_assert_cmpfloat (dval, ==, dbal);
+ g_assert_cmpfloat (dval, == , dbal);
}
/* xaccAccountGetBalanceAsOfDate
gnc_numeric
@@ -1829,14 +1847,14 @@
t_arr = (TxnParms*)sdata->txns;
for (ind = 0; ind < min_ind; ind++)
{
- SplitParms p = t_arr[ind].splits[1];
- bal = gnc_numeric_add_fixed (bal, p.amount);
+ SplitParms p = t_arr[ind].splits[1];
+ bal = gnc_numeric_add_fixed (bal, p.amount);
}
dbal = gnc_numeric_to_double (bal);
xaccAccountRecomputeBalance (fixture->acct);
val = xaccAccountGetBalanceAsOfDate (fixture->acct, (time (0) - offset));
dval = gnc_numeric_to_double (val);
- g_assert_cmpfloat (dval, ==, dbal);
+ g_assert_cmpfloat (dval, == , dbal);
}
/* xaccAccountGetPresentBalance
gnc_numeric
@@ -1855,16 +1873,16 @@
t_arr = (TxnParms*)sdata->txns;
for (ind = 0; ind < min_ind; ind++)
{
- SplitParms p = t_arr[ind].splits[1];
- bal = gnc_numeric_add_fixed (bal, p.amount);
+ SplitParms p = t_arr[ind].splits[1];
+ bal = gnc_numeric_add_fixed (bal, p.amount);
}
dbal = gnc_numeric_to_double (bal);
xaccAccountRecomputeBalance (fixture->acct);
val = xaccAccountGetPresentBalance (fixture->acct);
dval = gnc_numeric_to_double (val);
- g_assert_cmpfloat (dval, ==, dbal);
+ g_assert_cmpfloat (dval, == , dbal);
}
-/*
+/*
* xaccAccountConvertBalanceToCurrency
* xaccAccountConvertBalanceToCurrencyAsOfDate are wrappers around
* gnc_pricedb_convert_balance_latest_price and
@@ -1930,15 +1948,15 @@
g_assert (g_list_length (lots) == 2);
if (lots) g_list_free (lots);
lots = xaccAccountFindOpenLots (acct, bogus_lot_match_func_true,
- NULL, NULL);
+ NULL, NULL);
g_assert (g_list_length (lots) == 2);
if (lots) g_list_free (lots);
lots = xaccAccountFindOpenLots (acct, bogus_lot_match_func_false,
- NULL, NULL);
+ NULL, NULL);
g_assert (g_list_length (lots) == 0);
if (lots) g_list_free (lots);
lots = xaccAccountFindOpenLots (acct, NULL, NULL, bogus_lot_sort_func);
- g_assert_cmpint (count_sorts, ==, 1);
+ g_assert_cmpint (count_sorts, == , 1);
g_assert (g_list_length (lots) == 2);
if (lots) g_list_free (lots);
count_sorts = 0;
@@ -1964,9 +1982,9 @@
g_assert (acct);
xaccAccountForEachLot (acct, bogus_for_each_lot_func, &count_calls);
- g_assert_cmpint (count_calls, ==, 3);
+ g_assert_cmpint (count_calls, == , 3);
xaccAccountForEachLot (acct, bogus_for_each_lot_func, &count_calls);
- g_assert_cmpint (count_calls, ==, 5);
+ g_assert_cmpint (count_calls, == , 5);
}
/* These getters and setters look in KVP, so I guess their delegators instead:
* xaccAccountGetTaxRelated
@@ -2028,67 +2046,67 @@
for (type = ACCT_TYPE_NONE; type < ACCT_TYPE_LAST; type++)
{
- const gchar *typename = xaccAccountTypeEnumAsString (type);
- const gchar *typestr;
- gchar *typestr_uc;
+ const gchar *typename = xaccAccountTypeEnumAsString (type);
+ const gchar *typestr;
+ gchar *typestr_uc;
- g_assert (typename);
- g_assert_cmpint (xaccAccountStringToEnum (typename), ==, type);
- if (type < 0 || type >= NUM_ACCOUNT_TYPES)
- continue;
+ g_assert (typename);
+ g_assert_cmpint (xaccAccountStringToEnum (typename), == , type);
+ if (type < 0 || type >= NUM_ACCOUNT_TYPES)
+ continue;
- typestr = xaccAccountGetTypeStr (type);
- typestr_uc = g_ascii_strup (typestr, strlen (typestr));
- if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE)
- {
- gchar *cmpstr = g_strconcat ("A/", typename, NULL);
- g_assert_cmpstr (typestr_uc, ==, cmpstr);
- g_free (cmpstr);
- }
- else if (type == ACCT_TYPE_CREDIT)
- {
- gchar *cmpstr = g_strconcat (typename, " CARD", NULL);
- g_assert_cmpstr (typestr_uc, ==, cmpstr);
- g_free (cmpstr);
- }
- else if (type == ACCT_TYPE_MUTUAL)
- {
- gchar *cmpstr = g_strconcat (typename, " FUND", NULL);
- g_assert_cmpstr (typestr_uc, ==, cmpstr);
- g_free (cmpstr);
- }
- else
- g_assert_cmpstr (typestr_uc, ==, typename);
- g_free (typestr_uc);
+ typestr = xaccAccountGetTypeStr (type);
+ typestr_uc = g_ascii_strup (typestr, strlen (typestr));
+ if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE)
+ {
+ gchar *cmpstr = g_strconcat ("A/", typename, NULL);
+ g_assert_cmpstr (typestr_uc, == , cmpstr);
+ g_free (cmpstr);
+ }
+ else if (type == ACCT_TYPE_CREDIT)
+ {
+ gchar *cmpstr = g_strconcat (typename, " CARD", NULL);
+ g_assert_cmpstr (typestr_uc, == , cmpstr);
+ g_free (cmpstr);
+ }
+ else if (type == ACCT_TYPE_MUTUAL)
+ {
+ gchar *cmpstr = g_strconcat (typename, " FUND", NULL);
+ g_assert_cmpstr (typestr_uc, == , cmpstr);
+ g_free (cmpstr);
+ }
+ else
+ g_assert_cmpstr (typestr_uc, == , typename);
+ g_free (typestr_uc);
- g_object_set (acc, "type", type, NULL);
- if (type == ACCT_TYPE_STOCK || type == ACCT_TYPE_MUTUAL ||
- type == ACCT_TYPE_CURRENCY)
- g_assert (xaccAccountIsPriced (acc));
- else
- g_assert (!xaccAccountIsPriced (acc));
+ g_object_set (acc, "type", type, NULL);
+ if (type == ACCT_TYPE_STOCK || type == ACCT_TYPE_MUTUAL ||
+ type == ACCT_TYPE_CURRENCY)
+ g_assert (xaccAccountIsPriced (acc));
+ else
+ g_assert (!xaccAccountIsPriced (acc));
}
g_object_unref (acc);
loghandler = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_null_handler, &check1);
+ (GLogFunc)test_null_handler, &check1);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check1);
g_assert (!xaccAccountTypeEnumAsString (ACCT_TYPE_LAST));
- g_assert_cmpstr (check1.msg, ==, msg1);
+ g_assert_cmpstr (check1.msg, == , msg1);
g_log_remove_handler (logdomain, loghandler);
g_free (msg1);
loghandler = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_null_handler, &check2);
+ (GLogFunc)test_null_handler, &check2);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check2);
g_assert (!xaccAccountStringToType (NULL, &type));
- g_assert_cmpstr (check2.msg, ==, msg2);
+ g_assert_cmpstr (check2.msg, == , msg2);
g_log_remove_handler (logdomain, loghandler);
loghandler = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_null_handler, &check3);
+ (GLogFunc)test_null_handler, &check3);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check3);
g_assert (!xaccAccountStringToType ("LAST", &type));
- g_assert_cmpstr (check3.msg, ==, msg3);
+ g_assert_cmpstr (check3.msg, == , msg3);
g_log_remove_handler (logdomain, loghandler);
@@ -2101,19 +2119,19 @@
test_xaccAccountType_Compatibility (void)
{
guint32 bank_compat = ((1 << ACCT_TYPE_BANK) |
- (1 << ACCT_TYPE_CASH) |
- (1 << ACCT_TYPE_ASSET) |
- (1 << ACCT_TYPE_STOCK) |
- (1 << ACCT_TYPE_MUTUAL) |
- (1 << ACCT_TYPE_CURRENCY) |
- (1 << ACCT_TYPE_CREDIT) |
- (1 << ACCT_TYPE_LIABILITY) |
- (1 << ACCT_TYPE_RECEIVABLE) |
- (1 << ACCT_TYPE_PAYABLE) |
- (1 << ACCT_TYPE_ROOT));
+ (1 << ACCT_TYPE_CASH) |
+ (1 << ACCT_TYPE_ASSET) |
+ (1 << ACCT_TYPE_STOCK) |
+ (1 << ACCT_TYPE_MUTUAL) |
+ (1 << ACCT_TYPE_CURRENCY) |
+ (1 << ACCT_TYPE_CREDIT) |
+ (1 << ACCT_TYPE_LIABILITY) |
+ (1 << ACCT_TYPE_RECEIVABLE) |
+ (1 << ACCT_TYPE_PAYABLE) |
+ (1 << ACCT_TYPE_ROOT));
guint32 expense_compat = ((1 << ACCT_TYPE_INCOME) |
- (1 << ACCT_TYPE_EXPENSE) |
- (1 << ACCT_TYPE_ROOT));
+ (1 << ACCT_TYPE_EXPENSE) |
+ (1 << ACCT_TYPE_ROOT));
guint32 equity_compat = ((1 << ACCT_TYPE_EQUITY) | (1 << ACCT_TYPE_ROOT));
guint32 trading_compat = ((1 << ACCT_TYPE_TRADING) | (1 << ACCT_TYPE_ROOT));
guint32 compat;
@@ -2128,45 +2146,45 @@
for (type = ACCT_TYPE_BANK; type < NUM_ACCOUNT_TYPES; type++)
{
- GNCAccountType child;
- if (type == ACCT_TYPE_ROOT)
- {
- loghandler = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_null_handler, &check1);
- g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler,
- &check1);
- compat = xaccParentAccountTypesCompatibleWith (type);
- g_log_remove_handler (logdomain, loghandler);
- g_assert_cmpint (compat, ==, 0);
- g_assert_cmpstr (check1.msg, ==, msg1);
- g_free (msg1);
- continue;
- }
- compat = xaccParentAccountTypesCompatibleWith (type);
+ GNCAccountType child;
+ if (type == ACCT_TYPE_ROOT)
+ {
+ loghandler = g_log_set_handler (logdomain, loglevel,
+ (GLogFunc)test_null_handler, &check1);
+ g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler,
+ &check1);
+ compat = xaccParentAccountTypesCompatibleWith (type);
+ g_log_remove_handler (logdomain, loghandler);
+ g_assert_cmpint (compat, == , 0);
+ g_assert_cmpstr (check1.msg, == , msg1);
+ g_free (msg1);
+ continue;
+ }
+ compat = xaccParentAccountTypesCompatibleWith (type);
- if (type <= ACCT_TYPE_CURRENCY || type == ACCT_TYPE_PAYABLE
- || type == ACCT_TYPE_RECEIVABLE)
- g_assert_cmpint (compat, ==, bank_compat);
- else if (type == ACCT_TYPE_INCOME || type == ACCT_TYPE_EXPENSE)
- g_assert_cmpint (compat, ==, expense_compat);
- else if (type == ACCT_TYPE_EQUITY)
- g_assert_cmpint (compat, ==, equity_compat);
- else if (type == ACCT_TYPE_TRADING)
- g_assert_cmpint (compat, ==, trading_compat);
- for (child = ACCT_TYPE_NONE; child < ACCT_TYPE_LAST; child++)
- if (1 << child & compat)
- g_assert (xaccAccountTypesCompatible (type, child));
- else
- g_assert (!xaccAccountTypesCompatible (type, child));
+ if (type <= ACCT_TYPE_CURRENCY || type == ACCT_TYPE_PAYABLE
+ || type == ACCT_TYPE_RECEIVABLE)
+ g_assert_cmpint (compat, == , bank_compat);
+ else if (type == ACCT_TYPE_INCOME || type == ACCT_TYPE_EXPENSE)
+ g_assert_cmpint (compat, == , expense_compat);
+ else if (type == ACCT_TYPE_EQUITY)
+ g_assert_cmpint (compat, == , equity_compat);
+ else if (type == ACCT_TYPE_TRADING)
+ g_assert_cmpint (compat, == , trading_compat);
+ for (child = ACCT_TYPE_NONE; child < ACCT_TYPE_LAST; child++)
+ if (1 << child & compat)
+ g_assert (xaccAccountTypesCompatible (type, child));
+ else
+ g_assert (!xaccAccountTypesCompatible (type, child));
}
loghandler = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_null_handler, &check2);
+ (GLogFunc)test_null_handler, &check2);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check2);
compat = xaccParentAccountTypesCompatibleWith (++type);
g_log_remove_handler (logdomain, loghandler);
- g_assert_cmpint (compat, ==, 0);
- g_assert_cmpstr (check2.msg, ==, msg2);
+ g_assert_cmpint (compat, == , 0);
+ g_assert_cmpstr (check2.msg, == , msg2);
g_free (msg2);
}
/* More KVP getters & setters
@@ -2207,7 +2225,7 @@
Split *split = xaccAccountFindSplitByDesc (baz, "pepper");
g_assert (split);
g_object_get (split, "memo", &memo, NULL);
- g_assert_cmpstr (memo, ==, "pepper_baz");
+ g_assert_cmpstr (memo, == , "pepper_baz");
g_free (memo);
}
/* xaccAccountFindTransByDesc
@@ -2222,7 +2240,7 @@
Transaction *txn = xaccAccountFindTransByDesc (baz, "pepper");
g_assert (txn);
g_object_get (txn, "description", &desc, NULL);
- g_assert_cmpstr (desc, ==, "pepper");
+ g_assert_cmpstr (desc, == , "pepper");
g_free (desc);
}
/* gnc_account_join_children
@@ -2239,8 +2257,8 @@
g_test_message ("The following should fail because of account type incompatibility. It doesn't, which is a bug.");
gnc_account_join_children (income, broker);
- g_assert_cmpint (gnc_account_n_descendants (income), ==,
- broker_desc + income_desc);
+ g_assert_cmpint (gnc_account_n_descendants (income), == ,
+ broker_desc + income_desc);
}
@@ -2262,19 +2280,19 @@
gint taxable_desc = gnc_account_n_descendants (taxable);
gint expense_desc = gnc_account_n_descendants (expense);
gfloat stocks_balance = gnc_numeric_to_double (
- xaccAccountGetBalance (stocks));
+ xaccAccountGetBalance (stocks));
gfloat baz_balance = gnc_numeric_to_double (xaccAccountGetBalance (baz));
gfloat baz2_balance = gnc_numeric_to_double (xaccAccountGetBalance (baz2));
TestSignal sig1, sig2, sig3, sig4, sig5;
/* This segment doesn't test because of problems with resetting
* the accounts on the splits. It will have to be rewritten with a
- * mock Split object
+ * mock Split object
gchar *logdomain = "gnc.engine";
gint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
gchar *msg = "[xaccSplitCommitEdit ()] Account grabbed split prematurely.";
TestErrorStruct quiet = { loglevel, logdomain, msg };
guint hdlr = g_log_set_handler (logdomain, loglevel,
- (GLogFunc)test_null_handler, &quiet);
+ (GLogFunc)test_null_handler, &quiet);
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &quiet);
sig1 = test_signal_new (QOF_INSTANCE (baz), QOF_EVENT_MODIFY, NULL);
@@ -2287,9 +2305,9 @@
gnc_account_foreach_descendant (stocks, (AccountCb)print_account, NULL);
g_assert_cmpint (gnc_account_n_descendants (stocks), ==, stocks_desc - 1);
g_assert_cmpfloat (gnc_numeric_to_double (xaccAccountGetBalance (stocks)),
- ==, stocks_balance);
+ ==, stocks_balance);
g_assert_cmpfloat (gnc_numeric_to_double (xaccAccountGetBalance (baz)),
- ==, baz_balance + baz2_balance);
+ ==, baz_balance + baz2_balance);
test_signal_assert_hits (sig1, 0);
test_signal_assert_hits (sig2, 0);
test_signal_assert_hits (sig3, 1);
@@ -2303,13 +2321,13 @@
sig5 = test_signal_new (QOF_INSTANCE (div1), QOF_EVENT_MODIFY, NULL);
g_object_set (div1, "name", "div", NULL);
gnc_account_merge_children (taxable);
- g_assert_cmpint (gnc_account_n_descendants (taxable), ==, taxable_desc - 1);
+ g_assert_cmpint (gnc_account_n_descendants (taxable), == , taxable_desc - 1);
test_signal_assert_hits (sig4, 1);
test_signal_assert_hits (sig5, 4);
test_signal_free (sig4);
test_signal_free (sig5);
gnc_account_merge_children (expense);
- g_assert_cmpint (gnc_account_n_descendants (expense), ==, expense_desc);
+ g_assert_cmpint (gnc_account_n_descendants (expense), == , expense_desc);
}
/* xaccSplitsBeginStagedTransactionTraversals
* xaccAccountBeginStagedTransactionTraversals
@@ -2330,7 +2348,8 @@
* do_one_account
Trivial helper functions
*/
-typedef struct {
+typedef struct
+{
guint count;
gchar *name;
} Thunkdata;
@@ -2342,13 +2361,13 @@
++(td->count);
if (td->name)
{
- gchar *txn_desc;
- gboolean result;
- g_object_get (txn, "description", &txn_desc, NULL);
- result = g_strcmp0 (td->name, txn_desc) == 0;
- g_free (txn_desc);
- if (result)
- return td->count;
+ gchar *txn_desc;
+ gboolean result;
+ g_object_get (txn, "description", &txn_desc, NULL);
+ result = g_strcmp0 (td->name, txn_desc) == 0;
+ g_free (txn_desc);
+ if (result)
+ return td->count;
}
return 0;
}
@@ -2364,13 +2383,13 @@
Account *root = gnc_account_get_root (fixture->acct);
gint result;
result = xaccAccountTreeForEachTransaction (root, thunk3, &td);
- g_assert_cmpint (td.count, ==, 9);
- g_assert_cmpint (result, ==, 0);
+ g_assert_cmpint (td.count, == , 9);
+ g_assert_cmpint (result, == , 0);
td.count = 0;
td.name = "pepper";
result = xaccAccountTreeForEachTransaction (root, thunk3, &td);
- g_assert_cmpint (td.count, ==, result);
- g_assert_cmpint (result, <, 9);
+ g_assert_cmpint (td.count, == , result);
+ g_assert_cmpint (result, < , 9);
}
/* xaccAccountForEachTransaction
gint
@@ -2383,16 +2402,16 @@
Account *money = gnc_account_lookup_by_name (root, "money");
gint result;
result = xaccAccountForEachTransaction (root, thunk3, &td);
- g_assert_cmpint (td.count, ==, 0);
+ g_assert_cmpint (td.count, == , 0);
g_assert (money);
result = xaccAccountForEachTransaction (money, thunk3, &td);
- g_assert_cmpint (td.count, ==, 9);
- g_assert_cmpint (result, ==, 0);
+ g_assert_cmpint (td.count, == , 9);
+ g_assert_cmpint (result, == , 0);
td.count = 0;
td.name = "pepper";
result = xaccAccountForEachTransaction (money, thunk3, &td);
- g_assert_cmpint (td.count, ==, result);
- g_assert_cmpint (result, <, 9);
+ g_assert_cmpint (td.count, == , result);
+ g_assert_cmpint (result, < , 9);
}
@@ -2409,10 +2428,10 @@
GNC_TEST_ADD_FUNC (suitename, "gnc account create root", test_gnc_account_create_root);
GNC_TEST_ADD (suitename, "xaccCloneAccount", Fixture, NULL, setup, test_xaccCloneAccount, teardown );
-/*Destroys the account, so we have to do the tear down in the test function */
+ /*Destroys the account, so we have to do the tear down in the test function */
GNC_TEST_ADD (suitename, "xaccFreeAccountChildren", Fixture, &good_data, setup, test_xaccFreeAccountChildren, NULL);
-/* See comment at the beginning of test_xaccFreeAccount */
- GNC_TEST_ADD (suitename, "xaccFreeAccount", Fixture, &good_data, setup, test_xaccFreeAccount, NULL );
+ /* See comment at the beginning of test_xaccFreeAccount */
+ GNC_TEST_ADD (suitename, "xaccFreeAccount", Fixture, &good_data, setup, test_xaccFreeAccount, NULL );
GNC_TEST_ADD (suitename, "xaccAccountCommitEdit", Fixture, &good_data, setup, test_xaccAccountCommitEdit, NULL );
// GNC_TEST_ADD (suitename, "xaccAcctChildrenEqual", Fixture, NULL, setup, test_xaccAcctChildrenEqual, teardown );
// GNC_TEST_ADD (suitename, "xaccAccountEqual", Fixture, NULL, setup, test_xaccAccountEqual, teardown );
Modified: gnucash/trunk/src/gnome/assistant-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/assistant-hierarchy.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/gnome/assistant-hierarchy.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -506,8 +506,8 @@
g_free(text);
buffer = gtk_text_view_get_buffer(data->category_description);
gtk_text_buffer_set_text(buffer, gea->long_description ?
- gea->long_description :
- _("No description provided."), -1);
+ gea->long_description :
+ _("No description provided."), -1);
tree_view = gnc_tree_view_account_new_with_root (gea->root, FALSE);
/* Override the normal fixed (user settable) sizing */
Modified: gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/gnome/gnc-plugin-basic-commands.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -336,9 +336,9 @@
/* Set the action's sensitivity */
gnc_plugin_update_actions (action_group, readonly_inactive_actions,
"sensitive", is_readwrite);
-/* FileSaveAction needs to be set separately because it has *two* conditions */
+ /* FileSaveAction needs to be set separately because it has *two* conditions */
file_save_action = gtk_action_group_get_action (action_group,
- "FileSaveAction");
+ "FileSaveAction");
gtk_action_set_sensitive (file_save_action, is_readwrite && is_dirty);
}
Modified: gnucash/trunk/src/gnome-utils/assistant-xml-encoding.c
===================================================================
--- gnucash/trunk/src/gnome-utils/assistant-xml-encoding.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/gnome-utils/assistant-xml-encoding.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -229,7 +229,7 @@
void gxi_prepare_cb (GtkAssistant *assistant, GtkWidget *page,
- GncXmlImportData *data)
+ GncXmlImportData *data)
{
gint currentpage = gtk_assistant_get_current_page(assistant);
@@ -260,7 +260,7 @@
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
if (data->n_unassigned || data->n_impossible)
- gtk_assistant_set_page_complete (assistant, page, FALSE);
+ gtk_assistant_set_page_complete (assistant, page, FALSE);
else
gtk_assistant_set_page_complete (assistant, page, TRUE);
}
@@ -313,31 +313,31 @@
/* Enable buttons on all pages. */
gtk_assistant_set_page_complete (GTK_ASSISTANT (data->assistant),
- GTK_WIDGET(gtk_builder_get_object(builder, "start_page")),
- TRUE);
+ GTK_WIDGET(gtk_builder_get_object(builder, "start_page")),
+ TRUE);
gtk_assistant_set_page_complete (GTK_ASSISTANT (data->assistant),
- GTK_WIDGET(gtk_builder_get_object(builder, "conversion_page")),
- TRUE);
+ GTK_WIDGET(gtk_builder_get_object(builder, "conversion_page")),
+ TRUE);
gtk_assistant_set_page_complete (GTK_ASSISTANT (data->assistant),
- GTK_WIDGET(gtk_builder_get_object(builder, "end_page")),
- TRUE);
+ GTK_WIDGET(gtk_builder_get_object(builder, "end_page")),
+ TRUE);
/* start page, explanations */
- gtk_assistant_set_page_title (GTK_ASSISTANT(data->assistant),
- gtk_assistant_get_nth_page (GTK_ASSISTANT(data->assistant),0),
- gettext(encodings_doc_page_title));
+ gtk_assistant_set_page_title (GTK_ASSISTANT(data->assistant),
+ gtk_assistant_get_nth_page (GTK_ASSISTANT(data->assistant), 0),
+ gettext(encodings_doc_page_title));
- widget = GTK_WIDGET(gtk_builder_get_object (builder, "start_page"));
- gtk_label_set_text (GTK_LABEL(widget), gettext (encodings_doc_string));
+ widget = GTK_WIDGET(gtk_builder_get_object (builder, "start_page"));
+ gtk_label_set_text (GTK_LABEL(widget), gettext (encodings_doc_string));
/* conversion page */
- data->default_encoding_hbox = GTK_WIDGET(gtk_builder_get_object (builder, "default_enc_box"));
- data->string_box_container = GTK_WIDGET(gtk_builder_get_object (builder, "string_box_container"));
- data->impossible_label = GTK_WIDGET(gtk_builder_get_object (builder, "impossible_label"));
+ data->default_encoding_hbox = GTK_WIDGET(gtk_builder_get_object (builder, "default_enc_box"));
+ data->string_box_container = GTK_WIDGET(gtk_builder_get_object (builder, "string_box_container"));
+ data->impossible_label = GTK_WIDGET(gtk_builder_get_object (builder, "impossible_label"));
/* finish page */
widget = GTK_WIDGET(gtk_builder_get_object(builder, "end_page"));
- gtk_label_set_text (GTK_LABEL(widget), gettext (finish_convert_string));
+ gtk_label_set_text (GTK_LABEL(widget), gettext (finish_convert_string));
gtk_builder_connect_signals(builder, data);
@@ -351,10 +351,10 @@
/* This won't return until the assistant is finished */
gtk_main();
- if (data->canceled)
- success = FALSE;
- else
- success = gxi_save_file (data);
+ if (data->canceled)
+ success = FALSE;
+ else
+ success = gxi_save_file (data);
}
/* destroy all the data variables */
Modified: gnucash/trunk/src/html/gnc-html-webkit.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-webkit.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/html/gnc-html-webkit.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1155,7 +1155,7 @@
if (!export_dirname && gtk_print_settings_has_key(print_settings, GNC_GTK_PRINT_SETTINGS_EXPORT_DIR))
{
const char* tmp_dirname = gtk_print_settings_get(print_settings,
- GNC_GTK_PRINT_SETTINGS_EXPORT_DIR);
+ GNC_GTK_PRINT_SETTINGS_EXPORT_DIR);
// Only use the directory subsequently if it exists.
if (g_file_test(tmp_dirname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
{
Modified: gnucash/trunk/src/import-export/csv-export/assistant-csv-export.c
===================================================================
--- gnucash/trunk/src/import-export/csv-export/assistant-csv-export.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/assistant-csv-export.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -76,7 +76,7 @@
void csv_export_file_chooser_confirm_cb (GtkWidget *button, CsvExportInfo *info);
static const gchar *finish_tree_string = N_(
- /* Translators: %s is the file name string. */
+ /* Translators: %s is the file name string. */
"The account tree will be exported to the file '%s' when you click 'Apply'.\n\n"
"You can also go back and verify your selections by clicking on 'Back'"
" or 'Cancel' to Abort Export.\n");
@@ -89,9 +89,9 @@
" or 'Cancel' to Abort Export.\n");
static const gchar *start_tree_string = N_(
- "This assistant will help you export the Account Tree to a file.\n\n"
- "Select the settings you require for the file and then click 'Forward' to proceed"
- " or 'Cancel' to Abort Export.\n");
+ "This assistant will help you export the Account Tree to a file.\n\n"
+ "Select the settings you require for the file and then click 'Forward' to proceed"
+ " or 'Cancel' to Abort Export.\n");
static const gchar *start_trans_string = N_(
"This assistant will help you export the Transactions to a file.\n\n"
@@ -119,14 +119,14 @@
if (file_name)
{
- if (g_file_test(file_name, G_FILE_TEST_EXISTS ))
- {
- const char *format = _("The file %s already exists. "
- "Are you sure you want to overwrite it?");
+ if (g_file_test(file_name, G_FILE_TEST_EXISTS ))
+ {
+ const char *format = _("The file %s already exists. "
+ "Are you sure you want to overwrite it?");
- /* if user says cancel, we should break out */
- if (!gnc_verify_dialog (NULL, FALSE, format, file_name))
- return;
+ /* if user says cancel, we should break out */
+ if (!gnc_verify_dialog (NULL, FALSE, format, file_name))
+ return;
}
info->file_name = g_strdup(file_name);
@@ -141,7 +141,7 @@
g_free ( filedir );
g_free ( filepath );
}
- g_free(file_name);
+ g_free(file_name);
DEBUG("file_name selected is %s", info->file_name);
DEBUG("starting directory is %s", info->starting_dir);
@@ -303,16 +303,16 @@
Viewinfo.include_type[type] = (type == ACCT_TYPE_INCOME);
else if (info->csva.account_type == ACCT_TYPE_ASSET)
Viewinfo.include_type[type] = ((type == ACCT_TYPE_BANK) ||
- (type == ACCT_TYPE_CASH) ||
- (type == ACCT_TYPE_ASSET) ||
- (type == ACCT_TYPE_STOCK) ||
- (type == ACCT_TYPE_MUTUAL) ||
- (type == ACCT_TYPE_RECEIVABLE));
+ (type == ACCT_TYPE_CASH) ||
+ (type == ACCT_TYPE_ASSET) ||
+ (type == ACCT_TYPE_STOCK) ||
+ (type == ACCT_TYPE_MUTUAL) ||
+ (type == ACCT_TYPE_RECEIVABLE));
else if (info->csva.account_type == ACCT_TYPE_LIABILITY)
- Viewinfo.include_type[type] = ((type == ACCT_TYPE_CREDIT)||
- (type == ACCT_TYPE_LIABILITY) ||
- (type == ACCT_TYPE_EQUITY) ||
- (type == ACCT_TYPE_PAYABLE));
+ Viewinfo.include_type[type] = ((type == ACCT_TYPE_CREDIT) ||
+ (type == ACCT_TYPE_LIABILITY) ||
+ (type == ACCT_TYPE_EQUITY) ||
+ (type == ACCT_TYPE_PAYABLE));
else
Viewinfo.include_type[type] = FALSE;
}
@@ -388,7 +388,7 @@
*******************************************************/
static void
csv_export_account_changed_cb (GtkTreeSelection *selection,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
GtkAssistant *assistant = GTK_ASSISTANT(info->window);
@@ -402,7 +402,7 @@
info->csva.num_accounts = update_accounts_tree (info);
/* Enable the Forward Assistant Button if we have accounts */
- if(info->csva.num_accounts > 0)
+ if (info->csva.num_accounts > 0)
gtk_assistant_set_page_complete (assistant, page, TRUE);
else
gtk_assistant_set_page_complete (assistant, page, FALSE);
@@ -660,7 +660,7 @@
*******************************************************/
void
csv_export_assistant_start_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -668,9 +668,9 @@
/* Set Start page text */
if (info->export_type == XML_EXPORT_TREE)
- gtk_label_set_text (GTK_LABEL(info->start_label), start_tree_string);
+ gtk_label_set_text (GTK_LABEL(info->start_label), start_tree_string);
else
- gtk_label_set_text (GTK_LABEL(info->start_label), start_trans_string);
+ gtk_label_set_text (GTK_LABEL(info->start_label), start_trans_string);
/* Enable the Assistant Buttons */
gtk_assistant_set_page_complete (assistant, page, TRUE);
@@ -679,7 +679,7 @@
void
csv_export_assistant_account_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -690,7 +690,7 @@
gtk_assistant_set_current_page (assistant, num + 1 );
/* Enable the Forward Assistant Button if we have accounts */
- if(info->csva.num_accounts > 0)
+ if (info->csva.num_accounts > 0)
gtk_assistant_set_page_complete (assistant, page, TRUE);
else
gtk_assistant_set_page_complete (assistant, page, FALSE);
@@ -699,7 +699,7 @@
void
csv_export_assistant_file_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -717,7 +717,7 @@
void
csv_export_assistant_finish_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -740,25 +740,25 @@
void
csv_export_assistant_summary_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
gchar *text, *mtext;
/* Save the Window size, paned position and directory */
gnc_gconf_set_int(GCONF_SECTION, PANED_POSITION,
- gtk_paned_get_position(GTK_PANED(info->csva.paned)), NULL);
+ gtk_paned_get_position(GTK_PANED(info->csva.paned)), NULL);
gnc_set_default_directory(GCONF_SECTION, info->starting_dir);
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->window));
- if(info->failed)
- text = _("There was a problem with the export, this could be due to lack of space, "
- "permissions or unable to access folder. Check the trace file for further logging!\n"
- "You may need to enable debuging.\n");
+ if (info->failed)
+ text = _("There was a problem with the export, this could be due to lack of space, "
+ "permissions or unable to access folder. Check the trace file for further logging!\n"
+ "You may need to enable debuging.\n");
else
- text = _("File exported successfully!\n");
+ text = _("File exported successfully!\n");
- mtext = g_strdup_printf("<span size=\"medium\"><b>%s</b></span>",text);
+ mtext = g_strdup_printf("<span size=\"medium\"><b>%s</b></span>", text);
gtk_label_set_markup(GTK_LABEL(info->summary_label), mtext);
@@ -768,7 +768,7 @@
void
csv_export_assistant_prepare (GtkAssistant *assistant, GtkWidget *page,
- gpointer user_data)
+ gpointer user_data)
{
CsvExportInfo *info = user_data;
gint currentpage = gtk_assistant_get_current_page(assistant);
@@ -830,7 +830,7 @@
CsvExportInfo *info = user_data;
if (info->export_type == XML_EXPORT_TREE)
- csv_tree_export (info);
+ csv_tree_export (info);
else
csv_transactions_export (info);
}
@@ -963,7 +963,7 @@
gtk_widget_show (info->csvd.start_date);
gnc_date_edit_set_time(GNC_DATE_EDIT(info->csvd.start_date), start_time);
g_signal_connect (G_OBJECT (info->csvd.start_date), "date-changed",
- G_CALLBACK (csv_export_date_changed_cb), info);
+ G_CALLBACK (csv_export_date_changed_cb), info);
/* End date info */
info->csvd.end_date = gnc_date_edit_new (time (NULL), FALSE, FALSE);
@@ -972,7 +972,7 @@
gtk_widget_show (info->csvd.end_date);
gnc_date_edit_set_time(GNC_DATE_EDIT(info->csvd.end_date), end_time);
g_signal_connect (G_OBJECT (info->csvd.end_date), "date-changed",
- G_CALLBACK (csv_export_date_changed_cb), info);
+ G_CALLBACK (csv_export_date_changed_cb), info);
/* Load Accounts */
show_acct_type_accounts (info);
@@ -984,7 +984,7 @@
gtk_widget_show (button);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(info->file_chooser), button);
g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (csv_export_file_chooser_confirm_cb), info);
+ G_CALLBACK (csv_export_file_chooser_confirm_cb), info);
box = GTK_WIDGET(gtk_builder_get_object(builder, "file_page"));
gtk_box_pack_start (GTK_BOX (box), info->file_chooser, TRUE, TRUE, 6);
Modified: gnucash/trunk/src/import-export/csv-export/assistant-csv-export.h
===================================================================
--- gnucash/trunk/src/import-export/csv-export/assistant-csv-export.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/assistant-csv-export.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -48,7 +48,7 @@
time_t start_time;
time_t end_time;
-}CsvExportDate;
+} CsvExportDate;
typedef struct
{
@@ -63,7 +63,7 @@
GList *account_list;
int num_accounts;
GNCAccountType account_type;
-}CsvExportAcc;
+} CsvExportAcc;
typedef struct
@@ -91,7 +91,7 @@
} CsvExportInfo;
-/** The gnc_file_csv_export() will let the user export thte
+/** The gnc_file_csv_export() will let the user export thte
* account tree or transactions to a deliminated file.
*/
void gnc_file_csv_export (CsvExportType export_type);
Modified: gnucash/trunk/src/import-export/csv-export/csv-transactions-export.c
===================================================================
--- gnucash/trunk/src/import-export/csv-export/csv-transactions-export.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/csv-transactions-export.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -87,7 +87,7 @@
qof_query_set_book (q, book);
/* Set up separators */
- if(info->use_quotes)
+ if (info->use_quotes)
{
end_sep = "\"";
mid_sep = g_strconcat ( "\"", info->separator_str, "\"", NULL);
@@ -146,7 +146,7 @@
g_free(part1);
/* Notes */
currentSel = xaccTransGetNotes(trans);
- if(currentSel == NULL)
+ if (currentSel == NULL)
part1 = g_strconcat ( part2, mid_sep, NULL);
else
part1 = g_strconcat ( part2, currentSel, mid_sep, NULL);
@@ -207,7 +207,7 @@
/* Write to file */
if (!write_line_to_file(fh, part1))
{
- info->failed = TRUE;
+ info->failed = TRUE;
break;
}
g_free(part1);
@@ -263,7 +263,7 @@
/* From / To with Symbol */
split_amount = xaccPrintAmount(xaccSplitGetAmount(t_split), gnc_split_amount_print_info(t_split, TRUE));
- if(xaccSplitGetAccount(t_split) == acc)
+ if (xaccSplitGetAccount(t_split) == acc)
part2 = g_strconcat ( part1, split_amount, mid_sep, mid_sep, NULL);
else
part2 = g_strconcat ( part1, mid_sep, split_amount, mid_sep, NULL);
@@ -271,7 +271,7 @@
/* From / To Numbers only */
split_amount = xaccPrintAmount(xaccSplitGetAmount(t_split), gnc_split_amount_print_info(t_split, FALSE));
- if(xaccSplitGetAccount(t_split) == acc)
+ if (xaccSplitGetAccount(t_split) == acc)
part1 = g_strconcat ( part2, split_amount, mid_sep, mid_sep, NULL);
else
part1 = g_strconcat ( part2, mid_sep, split_amount, mid_sep, NULL);
@@ -279,14 +279,14 @@
/* From / To - Share Price / Conversion factor */
split_amount = xaccPrintAmount(xaccSplitGetSharePrice(t_split), gnc_split_amount_print_info(t_split, FALSE));
- if(xaccSplitGetAccount(t_split) == acc)
+ if (xaccSplitGetAccount(t_split) == acc)
part2 = g_strconcat ( part1, split_amount, mid_sep, end_sep, "\n", NULL);
else
part2 = g_strconcat ( part1, mid_sep, split_amount, end_sep, "\n", NULL);
g_free(part1);
if (!write_line_to_file(fh, part2))
- info->failed = TRUE;
+ info->failed = TRUE;
g_free(part2);
cnt++;
@@ -326,7 +326,7 @@
int i;
/* Set up separators */
- if(info->use_quotes)
+ if (info->use_quotes)
{
end_sep = "\"";
mid_sep = g_strconcat ( "\"", info->separator_str, "\"", NULL);
@@ -339,18 +339,18 @@
/* Header string */
header = g_strconcat ( end_sep, _("Date"), mid_sep, _("Account Name"), mid_sep,
- _("Number"), mid_sep, _("Description"), mid_sep,
- _("Notes"), mid_sep, _("Memo"), mid_sep, _("Category"), mid_sep,
- _("Type"), mid_sep, _("Action"), mid_sep, _("Reconcile"), mid_sep,
- _("To With Sym"), mid_sep, _("From With Sym"), mid_sep,
- _("To Num."), mid_sep, _("From Num."), mid_sep,
- _("To Factor/Price"), mid_sep, _("From Factor/Price"), end_sep, "\n", NULL);
+ _("Number"), mid_sep, _("Description"), mid_sep,
+ _("Notes"), mid_sep, _("Memo"), mid_sep, _("Category"), mid_sep,
+ _("Type"), mid_sep, _("Action"), mid_sep, _("Reconcile"), mid_sep,
+ _("To With Sym"), mid_sep, _("From With Sym"), mid_sep,
+ _("To Num."), mid_sep, _("From Num."), mid_sep,
+ _("To Factor/Price"), mid_sep, _("From Factor/Price"), end_sep, "\n", NULL);
DEBUG("Header String: %s", header);
/* Write header line */
if (!write_line_to_file(fh, header))
{
- info->failed = TRUE;
+ info->failed = TRUE;
g_free(mid_sep);
g_free(header);
return;
@@ -368,7 +368,7 @@
}
else
info->failed = TRUE;
- if(fh)
+ if (fh)
fclose (fh);
LEAVE("");
}
Modified: gnucash/trunk/src/import-export/csv-export/csv-transactions-export.h
===================================================================
--- gnucash/trunk/src/import-export/csv-export/csv-transactions-export.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/csv-transactions-export.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -30,7 +30,7 @@
#include "assistant-csv-export.h"
-/** The csv_transactions_export() will let the user export the
+/** The csv_transactions_export() will let the user export the
* transactions to a deliminated file.
*/
void csv_transactions_export (CsvExportInfo *info);
Modified: gnucash/trunk/src/import-export/csv-export/csv-tree-export.c
===================================================================
--- gnucash/trunk/src/import-export/csv-export/csv-tree-export.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/csv-tree-export.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -97,7 +97,7 @@
/* Set up separators */
- if(info->use_quotes)
+ if (info->use_quotes)
{
end_sep = "\"";
mid_sep = g_strconcat ( "\"", info->separator_str, "\"", NULL);
@@ -110,16 +110,16 @@
/* Header string */
header = g_strconcat ( end_sep, _("type"), mid_sep, _("fullname"), mid_sep,
- _("name"), mid_sep, _("code"), mid_sep,
- _("description"), mid_sep, _("color"), mid_sep, _("notes"), mid_sep,
- _("commoditym"), mid_sep, _("commodityn"), mid_sep,
- _("hidden"), mid_sep, _("tax"), mid_sep, _("placeholder"), end_sep, "\n", NULL);
+ _("name"), mid_sep, _("code"), mid_sep,
+ _("description"), mid_sep, _("color"), mid_sep, _("notes"), mid_sep,
+ _("commoditym"), mid_sep, _("commodityn"), mid_sep,
+ _("hidden"), mid_sep, _("tax"), mid_sep, _("placeholder"), end_sep, "\n", NULL);
DEBUG("Header String: %s", header);
/* Write header line */
if (!write_line_to_file(fh, header))
{
- info->failed = TRUE;
+ info->failed = TRUE;
g_free(mid_sep);
g_free(header);
return;
@@ -159,7 +159,7 @@
g_free(part1);
/* Notes */
currentSel = xaccAccountGetNotes(acc) ? xaccAccountGetNotes(acc) : "" ;
- if(!g_strcmp0(currentSel, "") == 0)
+ if (!g_strcmp0(currentSel, "") == 0)
{
/* Check for multiple lines */
gchar **parts;
@@ -197,7 +197,7 @@
/* Write to file */
if (!write_line_to_file(fh, part2))
{
- info->failed = TRUE;
+ info->failed = TRUE;
break;
}
g_free(part2);
@@ -206,7 +206,7 @@
}
else
info->failed = TRUE;
- if(fh)
+ if (fh)
fclose (fh);
g_list_free( accts );
Modified: gnucash/trunk/src/import-export/csv-export/csv-tree-export.h
===================================================================
--- gnucash/trunk/src/import-export/csv-export/csv-tree-export.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/csv-tree-export.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -29,7 +29,7 @@
#include "assistant-csv-export.h"
-/** The csv_tree_export() will let the user export the
+/** The csv_tree_export() will let the user export the
* account tree to a deliminated file.
*/
void csv_tree_export (CsvExportInfo *info);
Modified: gnucash/trunk/src/import-export/csv-export/gnc-plugin-csv-export.c
===================================================================
--- gnucash/trunk/src/import-export/csv-export/gnc-plugin-csv-export.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-export/gnc-plugin-csv-export.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -87,8 +87,8 @@
};
gnc_plugin_csv_export_type = g_type_register_static (GNC_TYPE_PLUGIN,
- "GncPluginCsvExport",
- &our_info, 0);
+ "GncPluginCsvExport",
+ &our_info, 0);
}
return gnc_plugin_csv_export_type;
@@ -150,16 +150,16 @@
************************************************************/
static void
gnc_plugin_csv_export_tree_cmd (GtkAction *action,
- GncMainWindowActionData *data)
+ GncMainWindowActionData *data)
{
- gnc_file_csv_export(XML_EXPORT_TREE);
+ gnc_file_csv_export(XML_EXPORT_TREE);
}
static void
gnc_plugin_csv_export_trans_cmd (GtkAction *action,
- GncMainWindowActionData *data)
+ GncMainWindowActionData *data)
{
- gnc_file_csv_export(XML_EXPORT_TRANS);
+ gnc_file_csv_export(XML_EXPORT_TRANS);
}
/************************************************************
Modified: gnucash/trunk/src/import-export/csv-import/assistant-csv-account-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/assistant-csv-account-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-import/assistant-csv-account-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -140,21 +140,21 @@
num_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(info->store), NULL);
/* Modify background color for header rows */
- if(info->header_rows == 0)
+ if (info->header_rows == 0)
{
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(info->store), &iter, NULL, 0 );
- if(valid)
+ if (valid)
gtk_list_store_set (info->store, &iter, ROW_COLOR, NULL, -1);
}
else
{
- if (info->header_rows - 1 < num_rows)
+ if (info->header_rows - 1 < num_rows)
{
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(info->store), &iter, NULL, info->header_rows - 1 );
- if(valid)
+ if (valid)
gtk_list_store_set (info->store, &iter, ROW_COLOR, "pink", -1);
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(info->store), &iter);
- if(valid)
+ if (valid)
gtk_list_store_set (info->store, &iter, ROW_COLOR, NULL, -1);
}
}
@@ -205,7 +205,7 @@
/* Generate preview */
gtk_list_store_clear (info->store);
- if(csv_import_read_file (info->file_name, info->regexp->str, info->store, 11 ) == MATCH_FOUND)
+ if (csv_import_read_file (info->file_name, info->regexp->str, info->store, 11 ) == MATCH_FOUND)
gtk_widget_set_sensitive (info->header_row_spin, TRUE);
else
gtk_widget_set_sensitive (info->header_row_spin, FALSE);
@@ -309,7 +309,7 @@
*******************************************************/
void
csv_import_assistant_start_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -322,7 +322,7 @@
void
csv_import_assistant_file_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -339,7 +339,7 @@
void
csv_import_assistant_account_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -347,7 +347,7 @@
gtk_list_store_clear (info->store);
- if(csv_import_read_file (info->file_name, info->regexp->str, info->store, 11 ) == MATCH_FOUND)
+ if (csv_import_read_file (info->file_name, info->regexp->str, info->store, 11 ) == MATCH_FOUND)
gtk_widget_set_sensitive (info->header_row_spin, TRUE);
else
gtk_widget_set_sensitive (info->header_row_spin, FALSE);
@@ -356,7 +356,7 @@
void
csv_import_assistant_finish_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportInfo *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -379,23 +379,23 @@
void
csv_import_assistant_summary_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportInfo *info = user_data;
gchar *text, *errtext, *mtext;
- if(!g_strcmp0(info->error,"") == 0)
+ if (!g_strcmp0(info->error, "") == 0)
{
- text = g_strdup_printf(gettext ("Import completed but with errors!\n\nThe number of Accounts added was %u and "
- "updated was %u.\n\nSee below for errors..." ), info->num_new, info->num_updates );
+ text = g_strdup_printf(gettext ("Import completed but with errors!\n\nThe number of Accounts added was %u and "
+ "updated was %u.\n\nSee below for errors..." ), info->num_new, info->num_updates );
errtext = g_strdup_printf ( "%s", info->error);
gtk_label_set_text (GTK_LABEL(info->summary_error), errtext);
g_free(errtext);
g_free(info->error);
}
else
- text = g_strdup_printf(gettext ("Import completed successfully!\n\nThe number of Accounts added was %u and "
- "updated was %u.\n" ), info->num_new, info->num_updates );
+ text = g_strdup_printf(gettext ("Import completed successfully!\n\nThe number of Accounts added was %u and "
+ "updated was %u.\n" ), info->num_new, info->num_updates );
mtext = g_strdup_printf("<span size=\"medium\"><b>%s</b></span>", text);
gtk_label_set_markup(GTK_LABEL(info->summary_label), mtext);
@@ -407,7 +407,7 @@
void
csv_import_assistant_prepare (GtkAssistant *assistant, GtkWidget *page,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportInfo *info = user_data;
gint currentpage = gtk_assistant_get_current_page(assistant);
@@ -470,7 +470,7 @@
gtk_list_store_clear (info->store);
csv_import_read_file (info->file_name, info->regexp->str, info->store, 0 );
- csv_account_import (info);
+ csv_account_import (info);
}
static void
@@ -519,7 +519,7 @@
gtk_widget_show (button);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(info->file_chooser), button);
g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (csv_import_file_chooser_confirm_cb), info);
+ G_CALLBACK (csv_import_file_chooser_confirm_cb), info);
box = GTK_WIDGET(gtk_builder_get_object(builder, "file_page"));
gtk_box_pack_start (GTK_BOX (box), info->file_chooser, TRUE, TRUE, 6);
@@ -533,8 +533,8 @@
/* create model and bind to view */
info->store = gtk_list_store_new (N_COLUMNS,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_view_set_model( GTK_TREE_VIEW(info->tree_view), GTK_TREE_MODEL(info->store) );
#define CREATE_COLUMN(description,column_id) \
renderer = gtk_cell_renderer_text_new (); \
Modified: gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -80,7 +80,7 @@
GOCharmapSel *encselector; /**< The widget for selecting the encoding */
GtkCheckButton *sep_buttons[SEP_NUM_OF_TYPES]; /**< Checkbuttons for common separators */
GtkCheckButton *custom_cbutton; /**< The checkbutton for a custom separator */
- GtkEntry *custom_entry; /**< The entry for custom separators */
+ GtkEntry *custom_entry; /**< The entry for custom separators */
GtkComboBox *date_format_combo; /**< The widget for selecting the date format */
GtkComboBox *currency_format_combo; /**< The widget for selecting the currency format */
GtkTreeView *treeview; /**< The treeview containing the data */
@@ -231,43 +231,43 @@
store = GTK_LIST_STORE( gtk_tree_view_get_model(info->treeview));
- for( i = 0; i <= info->start_row; i++)
+ for ( i = 0; i <= info->start_row; i++)
{
/* Modify background color of rows less than start row */
- if(info->start_row == i)
+ if (info->start_row == i)
{
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i );
- if(valid)
+ if (valid)
gtk_list_store_set (store, &iter, 0, NULL, -1);
}
else
{
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i );
- if(valid)
+ if (valid)
gtk_list_store_set (store, &iter, 0, "pink", -1);
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(store), &iter);
- if(valid)
+ if (valid)
gtk_list_store_set (store, &iter, 0, NULL, -1);
}
}
- for( i = info->num_of_rows - 1; i >= info->end_row; i--)
+ for ( i = info->num_of_rows - 1; i >= info->end_row; i--)
{
/* Modify background color of rows more than end row */
- if( i == info->end_row )
+ if ( i == info->end_row )
{
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i );
- if(valid)
+ if (valid)
gtk_list_store_set (store, &iter, 0, NULL, -1);
}
else
{
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i );
- if(valid)
+ if (valid)
gtk_list_store_set (store, &iter, 0, "pink", -1);
valid = gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(store), &iter, NULL, i - 1 );
- if(valid)
+ if (valid)
gtk_list_store_set (store, &iter, 0, NULL, -1);
}
}
@@ -331,14 +331,14 @@
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(cb)))
{
- if(info->previewing_errors == TRUE)
+ if (info->previewing_errors == TRUE)
info->approved = TRUE;
else
info->account_picker->auto_create = TRUE;
}
else
{
- if(info->previewing_errors == TRUE)
+ if (info->previewing_errors == TRUE)
info->approved = FALSE;
else
info->account_picker->auto_create = FALSE;
@@ -945,7 +945,7 @@
}
-/* Test for the required minimum number of coloumns selected and
+/* Test for the required minimum number of coloumns selected and
* a valid date format.
* Returns TRUE if we do or FALSE if we don't.
*
@@ -997,8 +997,8 @@
weight = weight + 1000;
gtk_tree_model_get(datastore, &iter2, i + 1, &prevstr, -1);
- if(parse_date(prevstr, info->parse_data->date_format) == -1)
- valid = FALSE;
+ if (parse_date(prevstr, info->parse_data->date_format) == -1)
+ valid = FALSE;
break;
case GNC_CSV_DESCRIPTION:
@@ -1028,10 +1028,10 @@
g_free(prevstr);
g_free(accstr);
}
- if(weight < 1109 || valid == FALSE)
- return FALSE;
+ if (weight < 1109 || valid == FALSE)
+ return FALSE;
else
- return TRUE;
+ return TRUE;
}
@@ -1273,7 +1273,7 @@
*******************************************************/
void
csv_import_trans_assistant_start_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -1286,7 +1286,7 @@
void
csv_import_trans_assistant_file_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -1307,7 +1307,7 @@
void
csv_import_trans_assistant_preview_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
GtkAdjustment *adj;
@@ -1317,7 +1317,7 @@
g_signal_connect(G_OBJECT(info->treeview), "size-allocate",
G_CALLBACK(treeview_resized), (gpointer)info);
- if(info->previewing_errors == TRUE)
+ if (info->previewing_errors == TRUE)
{
gchar* name;
GtkIconSize size;
@@ -1329,7 +1329,7 @@
gtk_image_get_stock(info->instructions_image, &name, &size);
gtk_image_set_from_stock(info->instructions_image, GTK_STOCK_DIALOG_ERROR, size);
gtk_label_set_text(info->instructions_label,
- _("The rows displayed below had errors which are in the last column. You can attempt to correct them by changing the configuration."));
+ _("The rows displayed below had errors which are in the last column. You can attempt to correct them by changing the configuration."));
gtk_widget_show(GTK_WIDGET(info->instructions_image));
gtk_widget_show(GTK_WIDGET(info->instructions_label));
@@ -1347,7 +1347,7 @@
/* Set the upper limit of spin button to number of rows */
adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(info->end_row_spin));
- if(gtk_adjustment_get_upper(adj) != info->num_of_rows)
+ if (gtk_adjustment_get_upper(adj) != info->num_of_rows)
{
gtk_spin_button_set_value (GTK_SPIN_BUTTON(info->end_row_spin), info->num_of_rows);
gtk_adjustment_set_upper(adj, info->num_of_rows);
@@ -1360,7 +1360,7 @@
void
csv_import_trans_assistant_account_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -1368,11 +1368,11 @@
gchar *text, *mtext;
Account * account = NULL;
- if(!preview_settings_valid(info) && (info->approved == FALSE))
+ if (!preview_settings_valid(info) && (info->approved == FALSE))
{
- text = g_strdup_printf(gettext ("There are problems with the import settings!\nThe date format could be wrong "
- "or there are not enough columns set..."));
- mtext = g_strdup_printf("<span size=\"medium\" color=\"red\"><b>%s</b></span>",text);
+ text = g_strdup_printf(gettext ("There are problems with the import settings!\nThe date format could be wrong "
+ "or there are not enough columns set..."));
+ mtext = g_strdup_printf("<span size=\"medium\" color=\"red\"><b>%s</b></span>", text);
gtk_label_set_markup(GTK_LABEL(info->account_label), mtext);
g_free(mtext);
g_free(text);
@@ -1387,18 +1387,18 @@
g_free(mtext);
g_free(text);
- gtk_widget_set_sensitive (info->account_page, TRUE);
+ gtk_widget_set_sensitive (info->account_page, TRUE);
/* Let the user select an account to put the transactions in. */
account = gnc_import_account_assist_update (info->account_picker);
/* If we have a valid account and auto_create is TRUE, move on to matcher */
- if(!(account == NULL) && (info->account_picker->auto_create == TRUE))
+ if (!(account == NULL) && (info->account_picker->auto_create == TRUE))
gtk_assistant_set_current_page (assistant, num + 1);
}
/* Enable the Forward Assistant Button */
- if(account == NULL)
+ if (account == NULL)
gtk_assistant_set_page_complete (assistant, page, FALSE);
else
gtk_assistant_set_page_complete (assistant, page, TRUE);
@@ -1407,20 +1407,20 @@
void
csv_import_trans_assistant_doc_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
/* Block going back */
gtk_assistant_commit (GTK_ASSISTANT(info->window));
- if( info->match_parse_run == FALSE)
+ if ( info->match_parse_run == FALSE)
{
/* Add the Cancel button for the matcher */
info->cancel_button = gtk_button_new_with_mnemonic (_("_Cancel"));
gtk_assistant_add_action_widget (assistant, info->cancel_button);
g_signal_connect(info->cancel_button, "clicked",
- G_CALLBACK(csv_import_trans_assistant_cancel), info);
+ G_CALLBACK(csv_import_trans_assistant_cancel), info);
gtk_widget_show(GTK_WIDGET(info->cancel_button));
}
}
@@ -1428,7 +1428,7 @@
void
csv_import_trans_assistant_match_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -1440,7 +1440,7 @@
/* Create transactions from the parsed data, first time with FALSE
Subsequent times with TRUE */
- if( info->match_parse_run == FALSE)
+ if ( info->match_parse_run == FALSE)
{
gnc_csv_parse_to_trans(info->parse_data, info->account_picker->retAccount, FALSE);
}
@@ -1449,13 +1449,13 @@
info->match_parse_run = TRUE;
/* if there are errors, we jump back to preview to correct */
- if(!(info->parse_data->error_lines == NULL) && (info->approved == FALSE) )
+ if (!(info->parse_data->error_lines == NULL) && (info->approved == FALSE) )
{
info->previewing_errors = TRUE; /* We're looking at errors. */
gtk_assistant_set_current_page (assistant, 2);
}
- if((info->parse_data->error_lines == NULL) || (info->approved == TRUE) )
+ if ((info->parse_data->error_lines == NULL) || (info->approved == TRUE) )
{
GList* transactions; /* A list of the transactions we create */
@@ -1464,17 +1464,17 @@
gtk_label_set_markup(GTK_LABEL(info->match_label), mtext);
g_free(mtext);
- if(info->gnc_csv_importer_gui == NULL)
+ if (info->gnc_csv_importer_gui == NULL)
{
/* Create the genereic transaction importer GUI. */
info->gnc_csv_importer_gui = gnc_gen_trans_assist_new (info->match_page, NULL, FALSE, 42);
- /* Add the help button for the matcher */
- info->help_button = gtk_button_new_with_mnemonic (_("_Help"));
- gtk_assistant_add_action_widget (assistant, info->help_button);
- g_signal_connect(info->help_button, "clicked",
- G_CALLBACK(on_matcher_help_clicked), info->gnc_csv_importer_gui);
- gtk_widget_show(GTK_WIDGET(info->help_button));
+ /* Add the help button for the matcher */
+ info->help_button = gtk_button_new_with_mnemonic (_("_Help"));
+ gtk_assistant_add_action_widget (assistant, info->help_button);
+ g_signal_connect(info->help_button, "clicked",
+ G_CALLBACK(on_matcher_help_clicked), info->gnc_csv_importer_gui);
+ gtk_widget_show(GTK_WIDGET(info->help_button));
/* Get the list of the transactions that were created. */
transactions = info->parse_data->transactions;
@@ -1495,7 +1495,7 @@
void
csv_import_trans_assistant_summary_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
gchar *text, *mtext;
@@ -1518,7 +1518,7 @@
void
csv_import_trans_assistant_prepare (GtkAssistant *assistant, GtkWidget *page,
- gpointer user_data)
+ gpointer user_data)
{
CsvImportTrans *info = user_data;
gint currentpage = gtk_assistant_get_current_page(assistant);
@@ -1603,13 +1603,13 @@
g_free(info->starting_dir);
/* Free the memory we allocated. */
- if(!(info->parse_data == NULL))
+ if (!(info->parse_data == NULL))
gnc_csv_parse_data_free(info->parse_data);
- if(!(info->account_picker == NULL))
+ if (!(info->account_picker == NULL))
info->account_picker = NULL;
- if(!(info->gnc_csv_importer_gui == NULL))
+ if (!(info->gnc_csv_importer_gui == NULL))
info->gnc_csv_importer_gui = NULL;
gtk_widget_destroy (info->window);
@@ -1673,7 +1673,7 @@
gtk_widget_show (button);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(info->file_chooser), button);
g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (csv_import_trans_file_chooser_confirm_cb), info);
+ G_CALLBACK (csv_import_trans_file_chooser_confirm_cb), info);
box = GTK_WIDGET(gtk_builder_get_object(builder, "file_page"));
gtk_box_pack_start (GTK_BOX (box), info->file_chooser, TRUE, TRUE, 6);
@@ -1681,114 +1681,114 @@
/* Preview Settings Page */
{
- char* sep_button_names[] = {"space_cbutton",
- "tab_cbutton",
- "comma_cbutton",
- "colon_cbutton",
- "semicolon_cbutton",
- "hyphen_cbutton"
- };
- GtkContainer *date_format_container, *currency_format_container;
- int i;
+ char* sep_button_names[] = {"space_cbutton",
+ "tab_cbutton",
+ "comma_cbutton",
+ "colon_cbutton",
+ "semicolon_cbutton",
+ "hyphen_cbutton"
+ };
+ GtkContainer *date_format_container, *currency_format_container;
+ int i;
- /* The table containing info->encselector and the separator configuration widgets */
- GtkTable* enctable;
- PangoContext* context; /* Used to set a monotype font on info->treeview */
+ /* The table containing info->encselector and the separator configuration widgets */
+ GtkTable* enctable;
+ PangoContext* context; /* Used to set a monotype font on info->treeview */
- info->start_row_spin = GTK_WIDGET(gtk_builder_get_object (builder, "start_row"));
- info->end_row_spin = GTK_WIDGET(gtk_builder_get_object (builder, "end_row"));
- info->check_label = GTK_WIDGET(gtk_builder_get_object (builder, "check_label"));
- info->check_butt = GTK_WIDGET(gtk_builder_get_object (builder, "check_butt"));
+ info->start_row_spin = GTK_WIDGET(gtk_builder_get_object (builder, "start_row"));
+ info->end_row_spin = GTK_WIDGET(gtk_builder_get_object (builder, "end_row"));
+ info->check_label = GTK_WIDGET(gtk_builder_get_object (builder, "check_label"));
+ info->check_butt = GTK_WIDGET(gtk_builder_get_object (builder, "check_butt"));
- info->encselector = GO_CHARMAP_SEL(go_charmap_sel_new(GO_CHARMAP_SEL_TO_UTF8));
- /* Connect the selector to the encoding_selected event handler. */
- g_signal_connect(G_OBJECT(info->encselector), "charmap_changed",
- G_CALLBACK(encoding_selected), (gpointer)info);
+ info->encselector = GO_CHARMAP_SEL(go_charmap_sel_new(GO_CHARMAP_SEL_TO_UTF8));
+ /* Connect the selector to the encoding_selected event handler. */
+ g_signal_connect(G_OBJECT(info->encselector), "charmap_changed",
+ G_CALLBACK(encoding_selected), (gpointer)info);
- /* Load the separator buttons from the glade builder file into the
- * info->sep_buttons array. */
- for (i = 0; i < SEP_NUM_OF_TYPES; i++)
- {
- info->sep_buttons[i]
- = (GtkCheckButton*)GTK_WIDGET(gtk_builder_get_object (builder, sep_button_names[i]));
- /* Connect them to the sep_button_clicked event handler. */
- g_signal_connect(G_OBJECT(info->sep_buttons[i]), "toggled",
+ /* Load the separator buttons from the glade builder file into the
+ * info->sep_buttons array. */
+ for (i = 0; i < SEP_NUM_OF_TYPES; i++)
+ {
+ info->sep_buttons[i]
+ = (GtkCheckButton*)GTK_WIDGET(gtk_builder_get_object (builder, sep_button_names[i]));
+ /* Connect them to the sep_button_clicked event handler. */
+ g_signal_connect(G_OBJECT(info->sep_buttons[i]), "toggled",
+ G_CALLBACK(sep_button_clicked), (gpointer)info);
+ }
+
+ /* Load and connect the custom separator checkbutton in the same way
+ * as the other separator buttons. */
+ info->custom_cbutton
+ = (GtkCheckButton*)GTK_WIDGET(gtk_builder_get_object (builder, "custom_cbutton"));
+ g_signal_connect(G_OBJECT(info->custom_cbutton), "clicked",
G_CALLBACK(sep_button_clicked), (gpointer)info);
- }
- /* Load and connect the custom separator checkbutton in the same way
- * as the other separator buttons. */
- info->custom_cbutton
- = (GtkCheckButton*)GTK_WIDGET(gtk_builder_get_object (builder, "custom_cbutton"));
- g_signal_connect(G_OBJECT(info->custom_cbutton), "clicked",
- G_CALLBACK(sep_button_clicked), (gpointer)info);
+ /* Load the entry for the custom separator entry. Connect it to the
+ * sep_button_clicked event handler as well. */
+ info->custom_entry = (GtkEntry*)GTK_WIDGET(gtk_builder_get_object (builder, "custom_entry"));
+ g_signal_connect(G_OBJECT(info->custom_entry), "changed",
+ G_CALLBACK(sep_button_clicked), (gpointer)info);
- /* Load the entry for the custom separator entry. Connect it to the
- * sep_button_clicked event handler as well. */
- info->custom_entry = (GtkEntry*)GTK_WIDGET(gtk_builder_get_object (builder, "custom_entry"));
- g_signal_connect(G_OBJECT(info->custom_entry), "changed",
- G_CALLBACK(sep_button_clicked), (gpointer)info);
+ /* Get the table from the Glade builder file. */
+ enctable = GTK_TABLE(gtk_builder_get_object (builder, "enctable"));
+ /* Put the selector in at the top. */
+ gtk_table_attach_defaults(enctable, GTK_WIDGET(info->encselector), 1, 2, 0, 1);
+ /* Show the table in all its glory. */
+ gtk_widget_show_all(GTK_WIDGET(enctable));
- /* Get the table from the Glade builder file. */
- enctable = GTK_TABLE(gtk_builder_get_object (builder, "enctable"));
- /* Put the selector in at the top. */
- gtk_table_attach_defaults(enctable, GTK_WIDGET(info->encselector), 1, 2, 0, 1);
- /* Show the table in all its glory. */
- gtk_widget_show_all(GTK_WIDGET(enctable));
+ /* The instructions label and image */
+ info->instructions_label = GTK_LABEL(gtk_builder_get_object (builder, "instructions_label"));
+ info->instructions_image = GTK_IMAGE(gtk_builder_get_object (builder, "instructions_image"));
- /* The instructions label and image */
- info->instructions_label = GTK_LABEL(gtk_builder_get_object (builder, "instructions_label"));
- info->instructions_image = GTK_IMAGE(gtk_builder_get_object (builder, "instructions_image"));
+ /* Add in the date format combo box and hook it up to an event handler. */
+ info->date_format_combo = GTK_COMBO_BOX(gtk_combo_box_new_text());
+ for (i = 0; i < num_date_formats; i++)
+ {
+ gtk_combo_box_append_text(info->date_format_combo, _(date_format_user[i]));
+ }
+ gtk_combo_box_set_active(info->date_format_combo, 0);
+ g_signal_connect(G_OBJECT(info->date_format_combo), "changed",
+ G_CALLBACK(date_format_selected), (gpointer)info);
- /* Add in the date format combo box and hook it up to an event handler. */
- info->date_format_combo = GTK_COMBO_BOX(gtk_combo_box_new_text());
- for (i = 0; i < num_date_formats; i++)
- {
- gtk_combo_box_append_text(info->date_format_combo, _(date_format_user[i]));
- }
- gtk_combo_box_set_active(info->date_format_combo, 0);
- g_signal_connect(G_OBJECT(info->date_format_combo), "changed",
- G_CALLBACK(date_format_selected), (gpointer)info);
+ /* Add it to the assistant. */
+ date_format_container = GTK_CONTAINER(gtk_builder_get_object (builder, "date_format_container"));
+ gtk_container_add(date_format_container, GTK_WIDGET(info->date_format_combo));
+ gtk_widget_show_all(GTK_WIDGET(date_format_container));
- /* Add it to the assistant. */
- date_format_container = GTK_CONTAINER(gtk_builder_get_object (builder, "date_format_container"));
- gtk_container_add(date_format_container, GTK_WIDGET(info->date_format_combo));
- gtk_widget_show_all(GTK_WIDGET(date_format_container));
+ /* Add in the currency format combo box and hook it up to an event handler. */
+ info->currency_format_combo = GTK_COMBO_BOX(gtk_combo_box_new_text());
+ for (i = 0; i < num_currency_formats; i++)
+ {
+ gtk_combo_box_append_text(info->currency_format_combo, _(currency_format_user[i]));
+ }
+ /* Default will the locale */
+ gtk_combo_box_set_active(info->currency_format_combo, 0);
+ g_signal_connect(G_OBJECT(info->currency_format_combo), "changed",
+ G_CALLBACK(currency_format_selected), (gpointer)info);
- /* Add in the currency format combo box and hook it up to an event handler. */
- info->currency_format_combo = GTK_COMBO_BOX(gtk_combo_box_new_text());
- for (i = 0; i < num_currency_formats; i++)
- {
- gtk_combo_box_append_text(info->currency_format_combo, _(currency_format_user[i]));
- }
- /* Default will the locale */
- gtk_combo_box_set_active(info->currency_format_combo, 0);
- g_signal_connect(G_OBJECT(info->currency_format_combo), "changed",
- G_CALLBACK(currency_format_selected), (gpointer)info);
+ /* Add it to the assistant. */
+ currency_format_container = GTK_CONTAINER(gtk_builder_get_object (builder, "currency_format_container"));
+ gtk_container_add(currency_format_container, GTK_WIDGET(info->currency_format_combo));
+ gtk_widget_show_all(GTK_WIDGET(currency_format_container));
- /* Add it to the assistant. */
- currency_format_container = GTK_CONTAINER(gtk_builder_get_object (builder, "currency_format_container"));
- gtk_container_add(currency_format_container, GTK_WIDGET(info->currency_format_combo));
- gtk_widget_show_all(GTK_WIDGET(currency_format_container));
+ /* Connect the CSV/Fixed-Width radio button event handler. */
+ csv_button = GTK_WIDGET(gtk_builder_get_object (builder, "csv_button"));
+ g_signal_connect(csv_button, "toggled",
+ G_CALLBACK(separated_or_fixed_selected), (gpointer)info);
- /* Connect the CSV/Fixed-Width radio button event handler. */
- csv_button = GTK_WIDGET(gtk_builder_get_object (builder, "csv_button"));
- g_signal_connect(csv_button, "toggled",
- G_CALLBACK(separated_or_fixed_selected), (gpointer)info);
+ /* Load the data treeview and connect it to its resizing event handler. */
+ info->treeview = (GtkTreeView*)GTK_WIDGET(gtk_builder_get_object (builder, "treeview"));
+ context = gtk_widget_create_pango_context(GTK_WIDGET(info->treeview));
- /* Load the data treeview and connect it to its resizing event handler. */
- info->treeview = (GtkTreeView*)GTK_WIDGET(gtk_builder_get_object (builder, "treeview"));
- context = gtk_widget_create_pango_context(GTK_WIDGET(info->treeview));
+ /* Load the column type treeview. */
+ info->ctreeview = (GtkTreeView*)GTK_WIDGET(gtk_builder_get_object (builder, "ctreeview"));
- /* Load the column type treeview. */
- info->ctreeview = (GtkTreeView*)GTK_WIDGET(gtk_builder_get_object (builder, "ctreeview"));
+ /* This is TRUE only after encoding_selected is called, so we must
+ * set it initially to FALSE. */
+ info->encoding_selected_called = FALSE;
- /* This is TRUE only after encoding_selected is called, so we must
- * set it initially to FALSE. */
- info->encoding_selected_called = FALSE;
-
- /* It is empty at first. */
- info->not_empty = FALSE;
+ /* It is empty at first. */
+ info->not_empty = FALSE;
}
/* Account page */
Modified: gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.h
===================================================================
--- gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -29,7 +29,7 @@
#define GNC_ASSISTANT_CSV_IMPORT_TRANS_H
-/** The gnc_file_csv_trans_import() will let the user import thte
+/** The gnc_file_csv_trans_import() will let the user import thte
* account tree or transactions to a deliminated file.
*/
void gnc_file_csv_trans_import (void);
Modified: gnucash/trunk/src/import-export/csv-import/csv-account-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/csv-account-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-import/csv-account-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -58,7 +58,7 @@
*******************************************************/
csv_import_result
csv_import_read_file (const gchar *filename, const gchar *parser_regexp,
- GtkListStore *store, guint max_rows )
+ GtkListStore *store, guint max_rows )
{
FILE *f;
char *line;
@@ -113,8 +113,8 @@
{
int l;
row++;
- if(row == max_rows)
- break;
+ if (row == max_rows)
+ break;
// read one line
if (!fgets (line, buffer_size, f))
break; // eof
@@ -159,7 +159,7 @@
g_regex_unref (regexpat);
regexpat = 0;
fclose (f);
- if(match_found == TRUE)
+ if (match_found == TRUE)
return MATCH_FOUND;
else
return RESULT_OK;
@@ -198,10 +198,10 @@
/* Walk through the list, reading each row */
gtk_tree_model_get (GTK_TREE_MODEL (info->store), &iter,
TYPE, &type,
- FULL_NAME, &full_name,
- NAME, &name,
- CODE, &code,
- DESCRIPTION, &description,
+ FULL_NAME, &full_name,
+ NAME, &name,
+ CODE, &code,
+ DESCRIPTION, &description,
COLOR, &color,
NOTES, ¬es,
COMMODITYM, &commoditym,
@@ -227,28 +227,28 @@
/* Get full name of parent account, allow for separator */
string_position = strlen(full_name) - strlen(name) - 1;
- if(string_position == -1)
+ if (string_position == -1)
full_parent = g_strdup(full_name);
else
full_parent = g_strndup(full_name, string_position);
parent = gnc_account_lookup_by_full_name(root, full_parent);
g_free (full_parent);
-
+
if (parent == NULL && string_position != -1)
{
- gchar *text = g_strdup_printf( gettext("Row %u, path to account %s not found, added as top level\n"), row +1, name );
+ gchar *text = g_strdup_printf( gettext("Row %u, path to account %s not found, added as top level\n"), row + 1, name );
info->error = g_strconcat(info->error, text, NULL);
g_free(text);
PINFO("Unable to import Row %u for account %s, path not found!", row, name);
}
if (parent == NULL)
- parent = root;
+ parent = root;
/* Do we have a valid commodity */
table = gnc_commodity_table_get_table (book);
- commodity = gnc_commodity_table_lookup( table, commodityn, commoditym);
+ commodity = gnc_commodity_table_lookup( table, commodityn, commoditym);
if (commodity)
{
@@ -256,39 +256,39 @@
info->num_new = info->num_new + 1;
gnc_suspend_gui_refresh ();
acc = xaccMallocAccount (book);
- xaccAccountBeginEdit (acc);
+ xaccAccountBeginEdit (acc);
xaccAccountSetName (acc, name);
xaccAccountSetType(acc, xaccAccountStringToEnum (type));
- if(!g_strcmp0(notes, "") == 0)
- xaccAccountSetNotes (acc, notes);
- if(!g_strcmp0(description, "") == 0)
+ if (!g_strcmp0(notes, "") == 0)
+ xaccAccountSetNotes (acc, notes);
+ if (!g_strcmp0(description, "") == 0)
xaccAccountSetDescription (acc, description);
- if(!g_strcmp0(code, "") == 0)
- xaccAccountSetCode (acc, code);
+ if (!g_strcmp0(code, "") == 0)
+ xaccAccountSetCode (acc, code);
- if(!g_strcmp0(color, "") == 0)
- {
+ if (!g_strcmp0(color, "") == 0)
+ {
if (gdk_color_parse(color, &testcolor))
- xaccAccountSetColor (acc, color);
- }
+ xaccAccountSetColor (acc, color);
+ }
- if(g_strcmp0(hidden, "T") == 0)
+ if (g_strcmp0(hidden, "T") == 0)
xaccAccountSetHidden (acc, TRUE);
- if(g_strcmp0(place_holder, "T") == 0)
+ if (g_strcmp0(place_holder, "T") == 0)
xaccAccountSetPlaceholder (acc, TRUE);
xaccAccountSetCommodity(acc, commodity);
xaccAccountBeginEdit (parent);
gnc_account_append_child (parent, acc);
xaccAccountCommitEdit (parent);
- xaccAccountCommitEdit (acc);
+ xaccAccountCommitEdit (acc);
gnc_resume_gui_refresh ();
}
else
{
- gchar *err_string = g_strdup_printf( gettext("Row %u, commodity %s / %s not found\n"), row +1,
- commoditym, commodityn);
+ gchar *err_string = g_strdup_printf( gettext("Row %u, commodity %s / %s not found\n"), row + 1,
+ commoditym, commodityn);
info->error = g_strconcat(info->error, err_string, NULL);
g_free(err_string);
PINFO("Unable to import Row %u for account %s, commodity!", row, full_name);
@@ -296,7 +296,7 @@
}
else
{
- gchar *err_string = g_strdup_printf( gettext("Row %u, account %s not in %s\n"), row +1, name, full_name);
+ gchar *err_string = g_strdup_printf( gettext("Row %u, account %s not in %s\n"), row + 1, name, full_name);
info->error = g_strconcat(info->error, err_string, NULL);
g_free(err_string);
PINFO("Unable to import Row %u for account %s, name!", row, full_name);
@@ -306,14 +306,14 @@
{
/* Lets try and update the color, notes, description, code entries */
DEBUG("Existing account, will try and update account %s", full_name);
- info->num_updates = info->num_updates +1;
- if(!g_strcmp0(color, "") == 0)
- {
+ info->num_updates = info->num_updates + 1;
+ if (!g_strcmp0(color, "") == 0)
+ {
if (gdk_color_parse(color, &testcolor))
- xaccAccountSetColor (acc, color);
- }
+ xaccAccountSetColor (acc, color);
+ }
- if(!g_strcmp0(notes, "") == 0)
+ if (!g_strcmp0(notes, "") == 0)
{
/* Check for multiple lines */
gchar **parts;
@@ -323,11 +323,11 @@
}
xaccAccountSetNotes (acc, notes);
- if(!g_strcmp0(description, "") == 0)
+ if (!g_strcmp0(description, "") == 0)
xaccAccountSetDescription (acc, description);
- if(!g_strcmp0(code, "") == 0)
- xaccAccountSetCode (acc, code);
- }
+ if (!g_strcmp0(code, "") == 0)
+ xaccAccountSetCode (acc, code);
+ }
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (info->store), &iter);
row++;
Modified: gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -40,9 +40,9 @@
const int num_currency_formats = 3;
const gchar* currency_format_user[] = {N_("Locale"),
- N_("Period: 123,456.78"),
- N_("Comma: 123.456,78")
- };
+ N_("Period: 123,456.78"),
+ N_("Comma: 123.456,78")
+ };
/* This array contains all of the different strings for different column types. */
gchar* gnc_csv_column_type_strs[GNC_CSV_NUM_COL_TYPES] = {N_("None"),
@@ -462,7 +462,7 @@
parse_data->raw_str.end = parse_data->raw_str.begin + g_mapped_file_get_length(parse_data->raw_mapping);
/* Make a guess at the encoding of the data. */
- if(!g_mapped_file_get_length(parse_data->raw_mapping) == 0)
+ if (!g_mapped_file_get_length(parse_data->raw_mapping) == 0)
guess_enc = go_guess_encoding((const char*)(parse_data->raw_str.begin),
(size_t)(parse_data->raw_str.end - parse_data->raw_str.begin),
"UTF-8", NULL);
@@ -524,7 +524,7 @@
g_array_free(parse_data->orig_row_lengths, FALSE);
parse_data->orig_row_lengths =
- g_array_sized_new(FALSE, FALSE, sizeof(int), parse_data->orig_lines->len);
+ g_array_sized_new(FALSE, FALSE, sizeof(int), parse_data->orig_lines->len);
g_array_set_size(parse_data->orig_row_lengths, parse_data->orig_lines->len);
parse_data->orig_max_row = 0;
@@ -691,7 +691,7 @@
{
case 0:
/* Currancy locale */
- if(!(xaccParseAmount(str_dupe, TRUE, &val, &endptr)))
+ if (!(xaccParseAmount(str_dupe, TRUE, &val, &endptr)))
{
g_free(str_dupe);
return FALSE;
@@ -699,7 +699,7 @@
break;
case 1:
/* Currancy decimal period */
- if(!(xaccParseAmountExtended(str_dupe, TRUE, '-', '.', ',', "\003\003", "$+", &val, &endptr)))
+ if (!(xaccParseAmountExtended(str_dupe, TRUE, '-', '.', ',', "\003\003", "$+", &val, &endptr)))
{
g_free(str_dupe);
return FALSE;
@@ -707,7 +707,7 @@
break;
case 2:
/* Currancy decimal comma */
- if(!(xaccParseAmountExtended(str_dupe, TRUE, '-', ',', '.', "\003\003", "$+", &val, &endptr)))
+ if (!(xaccParseAmountExtended(str_dupe, TRUE, '-', ',', '.', "\003\003", "$+", &val, &endptr)))
{
g_free(str_dupe);
return FALSE;
@@ -1047,7 +1047,7 @@
}
/* set parse_data->end_row to number of lines */
- if(parse_data->end_row > parse_data->orig_lines->len)
+ if (parse_data->end_row > parse_data->orig_lines->len)
parse_data->end_row = parse_data->orig_lines->len;
while (i < parse_data->end_row)
Modified: gnucash/trunk/src/import-export/csv-import/gnc-plugin-csv-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/gnc-plugin-csv-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/csv-import/gnc-plugin-csv-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -96,8 +96,8 @@
};
gnc_plugin_csv_import_type = g_type_register_static (GNC_TYPE_PLUGIN,
- "GncPluginCsvImport",
- &our_info, 0);
+ "GncPluginCsvImport",
+ &our_info, 0);
}
return gnc_plugin_csv_import_type;
@@ -159,21 +159,21 @@
************************************************************/
static void
gnc_plugin_csv_import_tree_cmd (GtkAction *action,
- GncMainWindowActionData *data)
+ GncMainWindowActionData *data)
{
- gnc_file_csv_account_import ();
+ gnc_file_csv_account_import ();
}
static void
gnc_plugin_csv_import_trans_cmd (GtkAction *action,
- GncMainWindowActionData *data)
+ GncMainWindowActionData *data)
{
- gnc_file_csv_trans_import ();
+ gnc_file_csv_trans_import ();
}
static void
gnc_plugin_csv_import_transx_cmd (GtkAction *action,
- GncMainWindowActionData *data)
+ GncMainWindowActionData *data)
{
gnc_file_csv_import();
}
Modified: gnucash/trunk/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/import-account-matcher.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1,6 +1,6 @@
/********************************************************************\
* import-account-matcher.c - flexible account picker/matcher *
- * *
+ * *
* Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca> *
* Copyright (C) 2012 Robert Fewell *
* *
@@ -68,7 +68,7 @@
picker->new_account_default_commodity = NULL;
picker->new_account_default_type = 0;
picker->default_account = NULL;
- picker->retAccount =NULL;
+ picker->retAccount = NULL;
return picker;
}
@@ -170,7 +170,7 @@
Account *old_id_acc;
/* See if we have a dialog, if not we are an assistant */
- if(picker->dialog == NULL)
+ if (picker->dialog == NULL)
{
GtkAssistant *assistant = GTK_ASSISTANT(picker->assistant);
gint num = gtk_assistant_get_current_page (assistant);
@@ -187,20 +187,20 @@
if (picker->retAccount && xaccAccountGetPlaceholder (picker->retAccount))
{
gnc_error_dialog (picker->dialog,
- _("The account %s is a placeholder account and does not allow "
- "transactions. Please choose a different account."),
- retval_name);
+ _("The account %s is a placeholder account and does not allow "
+ "transactions. Please choose a different account."),
+ retval_name);
}
else if ( picker->account_online_id_value != NULL)
{
/* find the old account for this on line id value and reset it */
old_id_acc =
gnc_account_foreach_descendant_until(gnc_get_current_root_account (),
- test_acct_online_id_match,
- /* This argument will only be used as a "const char*" */
- (void*)picker->account_online_id_value);
+ test_acct_online_id_match,
+ /* This argument will only be used as a "const char*" */
+ (void*)picker->account_online_id_value);
- if(old_id_acc != NULL)
+ if (old_id_acc != NULL)
gnc_import_set_acc_online_id(old_id_acc, "");
gnc_import_set_acc_online_id(picker->retAccount, picker->account_online_id_value);
@@ -262,8 +262,8 @@
{
/* load the interface */
builder = gtk_builder_new();
- gnc_builder_add_from_file (builder,"dialog-import.glade", "account_picker");
- gnc_builder_add_from_file (builder,"dialog-import.glade", "account_picker_content");
+ gnc_builder_add_from_file (builder, "dialog-import.glade", "account_picker");
+ gnc_builder_add_from_file (builder, "dialog-import.glade", "account_picker_content");
/* connect the signals in the interface */
if (builder == NULL)
{
@@ -277,7 +277,7 @@
/* Pack the content into the dialog vbox */
pbox = GTK_WIDGET(gtk_builder_get_object (builder, "account_picker_vbox"));
box = GTK_WIDGET(gtk_builder_get_object (builder, "account_picker_content"));
- gtk_box_pack_start( GTK_BOX(pbox), box, TRUE, TRUE,0);
+ gtk_box_pack_start( GTK_BOX(pbox), box, TRUE, TRUE, 0);
picker->account_tree_sw = GTK_WIDGET(gtk_builder_get_object (builder, "account_tree_sw"));
online_id_label = GTK_WIDGET(gtk_builder_get_object (builder, "online_id_label"));
@@ -391,7 +391,7 @@
/* load the interface */
builder = gtk_builder_new();
- gnc_builder_add_from_file (builder,"dialog-import.glade", "account_picker_content");
+ gnc_builder_add_from_file (builder, "dialog-import.glade", "account_picker_content");
/* connect the signals in the interface */
if (builder == NULL)
{
@@ -412,12 +412,12 @@
gtk_button_set_use_stock (GTK_BUTTON(button), TRUE);
gtk_widget_show (button);
g_signal_connect(button, "clicked",
- G_CALLBACK(gnc_import_add_account), picker);
+ G_CALLBACK(gnc_import_add_account), picker);
build_acct_tree(picker);
g_signal_connect(picker->account_tree, "row-activated",
- G_CALLBACK(account_tree_row_activated_cb), picker);
+ G_CALLBACK(account_tree_row_activated_cb), picker);
g_object_unref(G_OBJECT(builder));
return picker;
@@ -452,22 +452,22 @@
if (picker->account_human_description != NULL)
{
strncat(account_description_text, picker->account_human_description,
- ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+ ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
strncat(account_description_text, "\n",
- ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+ ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
}
if (picker->account_online_id_value != NULL)
{
strncat(account_description_text, _("(Full account ID: "),
- ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+ ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
strncat(account_description_text, picker->account_online_id_value,
- ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+ ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
strncat(account_description_text, ")",
- ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
+ ACCOUNT_DESCRIPTION_MAX_SIZE - strlen(account_description_text));
}
gtk_label_set_text(GTK_LABEL( picker->account_online_id_label), account_description_text);
-
- if(picker->default_account == NULL)
+
+ if (picker->default_account == NULL)
gnc_tree_view_account_set_selected_account(picker->account_tree, picker->retAccount);
else
gnc_tree_view_account_set_selected_account(picker->account_tree, picker->default_account);
Modified: gnucash/trunk/src/import-export/import-account-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/import-account-matcher.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1,6 +1,6 @@
/********************************************************************\
* import-account-matcher.h - flexible account picker/matcher *
- * *
+ * *
* Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca> *
* Copyright (C) 2012 Robert Fewell *
* *
@@ -49,7 +49,7 @@
GNCAccountType new_account_default_type; /* new account default type, incoming */
Account *default_account; /* default account for selection, incoming */
Account *retAccount; /* Account value returned to caller */
-}AccountPickerDialog;
+} AccountPickerDialog;
/** Must be called with a string containing a unique identifier for the
account. If an account with a matching online_id kvp_frame is
@@ -123,10 +123,10 @@
);
-/** Must be called with the parent widget, ie. a vbox that the
+/** Must be called with the parent widget, ie. a vbox that the
account picker dialog will be packed into. The data structure
AccountPickerDialog is initialised and default values populated.
-
+
@param parent The parent widget. This is the place the account picker dialog will
be packed into.
@@ -136,8 +136,8 @@
/** Must be called with an AccountPickerDialog structure allready setup.
- If an account with a matching online_id kvp_frame is found, which is
- allready present in the dialog structure, the function returns with a
+ If an account with a matching online_id kvp_frame is found, which is
+ allready present in the dialog structure, the function returns with a
pointer to that account or NULL if not found.
@param Account picker Dialog structure, AccountPickerDialog
Modified: gnucash/trunk/src/import-export/import-format-dialog.c
===================================================================
--- gnucash/trunk/src/import-export/import-format-dialog.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/import-format-dialog.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -143,7 +143,7 @@
}
/* Open the Glade Builder file */
builder = gtk_builder_new();
- gnc_builder_add_from_file (builder,"dialog-import.glade", "format_picker");
+ gnc_builder_add_from_file (builder, "dialog-import.glade", "format_picker");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "format_picker"));
widget = GTK_WIDGET(gtk_builder_get_object (builder, "msg_label"));
gtk_label_set_text(GTK_LABEL(widget), msg);
Modified: gnucash/trunk/src/import-export/import-main-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-main-matcher.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/import-main-matcher.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1,6 +1,6 @@
/********************************************************************\
* import-main-matcher.c - Transaction matcher main window *
- * *
+ * *
* Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca> *
* Copyright (C) 2002 Christian Stimming *
* Copyright (c) 2006 David Hampton <hampton at employees.org> *
@@ -134,7 +134,7 @@
}
- if(!(info->dialog == NULL))
+ if (!(info->dialog == NULL))
{
gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(info->dialog));
gnc_import_Settings_delete (info->user_settings);
@@ -566,7 +566,7 @@
/* Pack the content into the dialog vbox */
pbox = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_matcher_vbox"));
box = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_matcher_content"));
- gtk_box_pack_start( GTK_BOX(pbox), box, TRUE, TRUE,0);
+ gtk_box_pack_start( GTK_BOX(pbox), box, TRUE, TRUE, 0);
/* Get the view */
info->view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "downloaded_view"));
@@ -659,7 +659,7 @@
g_object_unref(G_OBJECT(builder));
return info;
-}
+}
void gnc_gen_trans_assist_start (GNCImportMainMatcher *info)
{
Modified: gnucash/trunk/src/import-export/import-main-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-main-matcher.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/import-main-matcher.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1,6 +1,6 @@
/********************************************************************\
* import-main-matcher.h - Transaction matcher main window *
- * *
+ * *
* Copyright (C) 2002 Benoit Grégoire <bock at step.polymtl.ca> *
* Copyright (C) 2002 Christian Stimming *
* Copyright (C) 2012 Robert Fewell *
@@ -72,7 +72,7 @@
/** Add the Transaction matcher to an existing page of an assistant.
- * Must be called with the parent widget, ie. a vbox that the
+ * Must be called with the parent widget, ie. a vbox that the
* transaction matcher will be packed into. The data structure
* GNCImportMainMatcher is returned.
*
Modified: gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -38,7 +38,7 @@
#include "dialog-commodity.h"
#include "dialog-progress.h"
#include "dialog-utils.h"
-#include "dialog-file-access.h"
+#include "dialog-file-access.h"
#include "assistant-qif-import.h"
#include "assistant-utils.h"
#include "gnc-component-manager.h"
@@ -96,7 +96,7 @@
{
GtkWidget * window;
GtkWidget * assistant;
-
+
/* Widgets on the file selection page. */
GtkWidget * filename_entry;
@@ -938,7 +938,7 @@
gtk_table_attach_defaults(GTK_TABLE(table), retval->namespace_combo,
1, 2, 2, 3);
- gtk_container_set_border_width(GTK_CONTAINER(page),12);
+ gtk_container_set_border_width(GTK_CONTAINER(page), 12);
gtk_box_pack_start(GTK_BOX(page), table, FALSE, FALSE, 12);
@@ -1338,7 +1338,7 @@
QIFImportWindow *wind = user_data;
/* If We did not have an account tree, lets save it */
- if(!wind->acct_tree_found)
+ if (!wind->acct_tree_found)
gnc_ui_file_access_for_save_as();
gnc_close_gui_component_by_data( ASSISTANT_QIF_IMPORT_CM_CLASS, wind );
@@ -1486,7 +1486,7 @@
/*****************************************
- * Page 0 - Intro Page Page
+ * Page 0 - Intro Page Page
****************************************/
/********************************************************************
@@ -1531,7 +1531,7 @@
********************************************************************/
static gboolean
gnc_ui_qif_import_load_file_complete (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
const gchar * path_to_load;
@@ -1659,7 +1659,7 @@
********************************************************************/
void
gnc_ui_qif_import_load_progress_pause_cb(GtkButton * button,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
SCM toggle_pause = scm_c_eval_string("qif-import:toggle-pause");
@@ -1699,7 +1699,7 @@
********************************************************************/
void
gnc_ui_qif_import_load_progress_start_cb(GtkButton * button,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
gint num = gtk_assistant_get_current_page (GTK_ASSISTANT(wind->window));
@@ -1938,7 +1938,7 @@
gtk_widget_set_sensitive(wind->load_pause, FALSE);
gtk_widget_set_sensitive(wind->load_start, FALSE);
- if(wind->load_stop == FALSE)
+ if (wind->load_stop == FALSE)
{
/* The file was loaded successfully. */
gnc_progress_dialog_set_sub(wind->load_progress, _("Loading completed"));
@@ -1952,7 +1952,7 @@
wind->busy = FALSE;
/* Auto step to next page */
- gtk_assistant_set_current_page (GTK_ASSISTANT(wind->window), num + 1);
+ gtk_assistant_set_current_page (GTK_ASSISTANT(wind->window), num + 1);
}
}
@@ -2103,7 +2103,7 @@
********************************************************************/
void
gnc_ui_qif_import_acct_valid_cb(GtkWidget * widget,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
@@ -2115,13 +2115,13 @@
if (!acct_name || acct_name[0] == 0)
{
- /* Disable the assistant Buttons */
- gtk_assistant_set_page_complete (assistant, page, FALSE);
+ /* Disable the assistant Buttons */
+ gtk_assistant_set_page_complete (assistant, page, FALSE);
}
else
{
- /* Enable the assistant Buttons */
- gtk_assistant_set_page_complete (assistant, page, TRUE);
+ /* Enable the assistant Buttons */
+ gtk_assistant_set_page_complete (assistant, page, TRUE);
}
}
@@ -2137,7 +2137,7 @@
********************************************************************/
void
gnc_ui_qif_import_loaded_files_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
@@ -2284,7 +2284,7 @@
********************************************************************/
void
gnc_ui_qif_import_account_doc_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2298,11 +2298,11 @@
gtk_assistant_set_page_complete (assistant, page, TRUE);
/* Jump to Summary page if load_stop TRUE */
- if(wind->load_stop)
+ if (wind->load_stop)
gtk_assistant_set_current_page (assistant, total - 1 );
/* Jump over doc page if show_doc_pages FALSE */
- if(!wind->show_doc_pages)
+ if (!wind->show_doc_pages)
gtk_assistant_set_current_page (assistant, num + 1 );
}
@@ -2318,7 +2318,7 @@
********************************************************************/
void
gnc_ui_qif_import_account_match_prepare(GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2367,7 +2367,7 @@
********************************************************************/
void
gnc_ui_qif_import_catagory_doc_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2381,11 +2381,11 @@
gtk_assistant_set_page_complete (assistant, page, TRUE);
/* Jump to Summary page if load_stop TRUE */
- if(wind->load_stop)
+ if (wind->load_stop)
gtk_assistant_set_current_page (assistant, total - 1 );
/* Jump over doc page if show_doc_pages FALSE */
- if(!wind->show_doc_pages)
+ if (!wind->show_doc_pages)
gtk_assistant_set_current_page (assistant, num + 1 );
/* If there are no category mappings, jump the doc page. */
@@ -2406,7 +2406,7 @@
****************************************************************/
void
gnc_ui_qif_import_catagory_match_prepare(GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2452,7 +2452,7 @@
********************************************************************/
void
gnc_ui_qif_import_memo_doc_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2466,11 +2466,11 @@
gtk_assistant_set_page_complete (assistant, page, TRUE);
/* Jump to Summary page if load_stop TRUE */
- if(wind->load_stop)
+ if (wind->load_stop)
gtk_assistant_set_current_page (assistant, total - 1 );
/* Jump over doc page if show_doc_pages FALSE */
- if(!wind->show_doc_pages)
+ if (!wind->show_doc_pages)
gtk_assistant_set_current_page (assistant, num + 1 );
/* If there are no memo mappings, jump the doc page. */
@@ -2491,7 +2491,7 @@
****************************************************************/
void
gnc_ui_qif_import_memo_match_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2540,7 +2540,7 @@
****************************************************************/
void
gnc_ui_qif_import_currency_prepare(GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2602,7 +2602,7 @@
********************************************************************/
void
gnc_ui_qif_import_commodity_doc_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2616,7 +2616,7 @@
gtk_assistant_set_page_complete (assistant, page, TRUE);
/* Jump to Summary page if load_stop TRUE */
- if(wind->load_stop)
+ if (wind->load_stop)
gtk_assistant_set_current_page (assistant, total - 1 );
/* If there are new securities, prepare the security pages. */
@@ -2627,7 +2627,7 @@
gtk_assistant_set_current_page (assistant, num + 1 );
/* Jump over doc page if show_doc_pages FALSE */
- if(!wind->show_doc_pages)
+ if (!wind->show_doc_pages)
gtk_assistant_set_current_page (assistant, num + 1 );
}
@@ -2641,7 +2641,7 @@
*******************************************/
void
gnc_ui_qif_import_commodity_new_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -2671,7 +2671,7 @@
********************************/
static gboolean
gnc_ui_qif_import_comm_valid (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
gint num = gtk_assistant_get_current_page (GTK_ASSISTANT(wind->window));
@@ -2779,7 +2779,7 @@
********************************************************************/
void
gnc_ui_qif_import_convert_progress_pause_cb(GtkButton * button,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
SCM toggle_pause = scm_c_eval_string("qif-import:toggle-pause");
@@ -2819,7 +2819,7 @@
********************************************************************/
void
gnc_ui_qif_import_convert_progress_start_cb(GtkButton * button,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
gint num = gtk_assistant_get_current_page (GTK_ASSISTANT(wind->window));
@@ -2991,11 +2991,11 @@
gtk_widget_set_sensitive(wind->convert_pause, FALSE);
gtk_widget_set_sensitive(wind->convert_start, FALSE);
- if(wind->load_stop == FALSE)
+ if (wind->load_stop == FALSE)
{
/* The conversion completed successfully. */
gnc_progress_dialog_set_sub(wind->convert_progress,
- _("Conversion completed"));
+ _("Conversion completed"));
gnc_progress_dialog_set_value(wind->convert_progress, 1);
gtk_widget_set_sensitive(wind->convert_pause, FALSE);
@@ -3050,7 +3050,7 @@
********************************************************************/
void
gnc_ui_qif_import_duplicates_doc_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -3064,15 +3064,15 @@
gtk_assistant_set_page_complete (assistant, page, TRUE);
/* Jump to Summary page if load_stop TRUE */
- if(wind->load_stop)
+ if (wind->load_stop)
gtk_assistant_set_current_page (assistant, total - 1 );
/* Jump over doc page if show_doc_pages FALSE */
- if(!wind->show_doc_pages)
+ if (!wind->show_doc_pages)
gtk_assistant_set_current_page (assistant, num + 1 );
/* Don't show doc page if there are no duplicates */
- if(scm_is_null(wind->match_transactions))
+ if (scm_is_null(wind->match_transactions))
gtk_assistant_set_current_page (assistant, num + 1 );
}
@@ -3086,7 +3086,7 @@
********************************************************************/
void
gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -3104,7 +3104,7 @@
const gchar *amount_str;
int rownum = 0;
- if(!scm_is_null(wind->match_transactions))
+ if (!scm_is_null(wind->match_transactions))
{
view = GTK_TREE_VIEW(wind->new_transaction_view);
store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
@@ -3129,18 +3129,18 @@
gnc_split = xaccTransGetSplit(gnc_xtn, 0);
amount_str =
xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
- gnc_account_print_info
- (xaccSplitGetAccount(gnc_split), TRUE));
+ gnc_account_print_info
+ (xaccSplitGetAccount(gnc_split), TRUE));
}
gtk_list_store_append(store, &iter);
gtk_list_store_set
- (store, &iter,
- QIF_TRANS_COL_INDEX, rownum++,
- QIF_TRANS_COL_DATE,
- gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
- QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
- QIF_TRANS_COL_AMOUNT, amount_str,
- -1);
+ (store, &iter,
+ QIF_TRANS_COL_INDEX, rownum++,
+ QIF_TRANS_COL_DATE,
+ gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+ QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+ QIF_TRANS_COL_AMOUNT, amount_str,
+ -1);
duplicates = SCM_CDR(duplicates);
}
@@ -3166,7 +3166,7 @@
********************************************************************/
void
gnc_ui_qif_import_end_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -3184,7 +3184,7 @@
********************************************************************/
void
gnc_ui_qif_import_finish_cb (GtkAssistant *gtkassistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
@@ -3243,7 +3243,7 @@
********************************************************************/
void
gnc_ui_qif_import_summary_page_prepare (GtkAssistant *assistant,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow * wind = user_data;
gint num = gtk_assistant_get_current_page (assistant);
@@ -3251,12 +3251,12 @@
gchar *text;
- if(wind->load_stop)
- text = g_strdup_printf(_("There was a problem with the import."));
+ if (wind->load_stop)
+ text = g_strdup_printf(_("There was a problem with the import."));
else
- text = g_strdup_printf(_("QIF Import Completed."));
+ text = g_strdup_printf(_("QIF Import Completed."));
- gtk_label_set_markup(GTK_LABEL(wind->summary_text), g_strdup_printf("<span size=\"large\"><b>%s</b></span>",text));
+ gtk_label_set_markup(GTK_LABEL(wind->summary_text), g_strdup_printf("<span size=\"large\"><b>%s</b></span>", text));
g_free(text);
@@ -3269,7 +3269,7 @@
* Prepare callback for assistant pages.
********************************************************************/
void gnc_ui_qif_import_prepare_cb (GtkAssistant *assistant, GtkWidget *page,
- gpointer user_data)
+ gpointer user_data)
{
QIFImportWindow *wind = user_data;
gint currentpage = gtk_assistant_get_current_page(assistant);
@@ -3282,83 +3282,103 @@
{
/* Current page is Intro page */
gnc_ui_qif_import_intro_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "load_file_page"))
+ }
+ else if (!g_strcmp0 (pagename, "load_file_page"))
{
/* Current page is File Load */
gnc_ui_qif_import_load_file_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "load_progress_page"))
+ }
+ else if (!g_strcmp0 (pagename, "load_progress_page"))
{
/* Current page is Load Progress */
gnc_ui_qif_import_load_progress_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "date_format_page"))
+ }
+ else if (!g_strcmp0 (pagename, "date_format_page"))
{
/* Current page is date page */
gnc_ui_qif_import_date_format_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "account_name_page"))
+ }
+ else if (!g_strcmp0 (pagename, "account_name_page"))
{
/* Current page is account page */
gnc_ui_qif_import_account_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "loaded_files_page"))
+ }
+ else if (!g_strcmp0 (pagename, "loaded_files_page"))
{
/* Current page is loaded files page */
gnc_ui_qif_import_loaded_files_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "account_doc_page"))
+ }
+ else if (!g_strcmp0 (pagename, "account_doc_page"))
{
/* Current page is Account Doc. page */
gnc_ui_qif_import_account_doc_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "account_match_page"))
+ }
+ else if (!g_strcmp0 (pagename, "account_match_page"))
{
/* Current page is Account Match page */
gnc_ui_qif_import_account_match_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "category_doc_page"))
+ }
+ else if (!g_strcmp0 (pagename, "category_doc_page"))
{
/* Current page is Catagory Doc. page */
gnc_ui_qif_import_catagory_doc_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "category_match_page"))
+ }
+ else if (!g_strcmp0 (pagename, "category_match_page"))
{
/* Current page is Catagory Match page */
gnc_ui_qif_import_catagory_match_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "memo_doc_page"))
+ }
+ else if (!g_strcmp0 (pagename, "memo_doc_page"))
{
/* Current page is Memo Doc. page */
gnc_ui_qif_import_memo_doc_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "memo_match_page"))
+ }
+ else if (!g_strcmp0 (pagename, "memo_match_page"))
{
/* Current page is Memo Match page */
gnc_ui_qif_import_memo_match_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "currency_page"))
+ }
+ else if (!g_strcmp0 (pagename, "currency_page"))
{
/* Current page is Currency page */
gnc_ui_qif_import_currency_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "commodity_doc_page"))
+ }
+ else if (!g_strcmp0 (pagename, "commodity_doc_page"))
{
/* Current page is Commodity Doc. page */
gnc_ui_qif_import_commodity_doc_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "commodity_page"))
+ }
+ else if (!g_strcmp0 (pagename, "commodity_page"))
{
/* Current page is Commodity page */
/* gnc_ui_qif_import_commodity_prepare (assistant, user_data); */
- }else if (!g_strcmp0 (pagename, "convert_progress_page"))
+ }
+ else if (!g_strcmp0 (pagename, "convert_progress_page"))
{
/* Current page is Conversion progress page */
gnc_ui_qif_import_convert_progress_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "duplicates_doc_page"))
+ }
+ else if (!g_strcmp0 (pagename, "duplicates_doc_page"))
{
/* Current page is Duplicates Doc page */
gnc_ui_qif_import_duplicates_doc_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "duplicates_match_page"))
+ }
+ else if (!g_strcmp0 (pagename, "duplicates_match_page"))
{
/* Current page is Duplicates Match page */
gnc_ui_qif_import_duplicates_match_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "end_page"))
+ }
+ else if (!g_strcmp0 (pagename, "end_page"))
{
/* Current page is the end page */
gnc_ui_qif_import_end_page_prepare (assistant, user_data);
- }else if (!g_strcmp0 (pagename, "summary_page"))
+ }
+ else if (!g_strcmp0 (pagename, "summary_page"))
{
/* Current page is the summary page */
gnc_ui_qif_import_summary_page_prepare (assistant, user_data);
- }else
+ }
+ else
{
/* Current page is a new commodity page */
gnc_ui_qif_import_commodity_new_prepare (assistant, user_data);
@@ -3383,11 +3403,11 @@
wind->load_start = GTK_WIDGET(gtk_builder_get_object (builder, "load_progress_start"));
wind->load_log = GTK_WIDGET(gtk_builder_get_object (builder, "load_progress_log"));
wind->load_progress = gnc_progress_dialog_custom(
- GTK_LABEL(gtk_builder_get_object (builder, "load_progress_primary")),
- GTK_LABEL(gtk_builder_get_object (builder, "load_progress_secondary")),
- GTK_PROGRESS_BAR(gtk_builder_get_object (builder, "load_progress_bar")),
- GTK_LABEL(gtk_builder_get_object (builder, "load_progress_sub")),
- GTK_TEXT_VIEW(wind->load_log));
+ GTK_LABEL(gtk_builder_get_object (builder, "load_progress_primary")),
+ GTK_LABEL(gtk_builder_get_object (builder, "load_progress_secondary")),
+ GTK_PROGRESS_BAR(gtk_builder_get_object (builder, "load_progress_bar")),
+ GTK_LABEL(gtk_builder_get_object (builder, "load_progress_sub")),
+ GTK_TEXT_VIEW(wind->load_log));
wind->acct_entry = GTK_WIDGET(gtk_builder_get_object (builder, "qif_account_entry"));
wind->date_format_combo = GTK_WIDGET(gtk_builder_get_object (builder, "date_format_combobox"));
wind->selected_file_view = GTK_WIDGET(gtk_builder_get_object (builder, "selected_file_view"));
@@ -3406,11 +3426,11 @@
wind->convert_start = GTK_WIDGET(gtk_builder_get_object (builder, "convert_progress_start"));
wind->convert_log = GTK_WIDGET(gtk_builder_get_object (builder, "convert_progress_log"));
wind->convert_progress = gnc_progress_dialog_custom(
- GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_primary")),
- GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_secondary")),
- GTK_PROGRESS_BAR(gtk_builder_get_object (builder, "convert_progress_bar")),
- GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_sub")),
- GTK_TEXT_VIEW(wind->convert_log));
+ GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_primary")),
+ GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_secondary")),
+ GTK_PROGRESS_BAR(gtk_builder_get_object (builder, "convert_progress_bar")),
+ GTK_LABEL(gtk_builder_get_object (builder, "convert_progress_sub")),
+ GTK_TEXT_VIEW(wind->convert_log));
wind->summary_text = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page"));
wind->new_transaction_view =
@@ -3564,16 +3584,16 @@
*
* Build a new QIF import assistant.
********************************************************************/
-static GtkWidget *
+static GtkWidget *
gnc_ui_qif_import_assistant_make(QIFImportWindow *qif_win)
{
GtkBuilder *builder;
GtkWidget *box;
builder = gtk_builder_new();
- gnc_builder_add_from_file (builder,"assistant-qif-import.glade", "currency_liststore");
- gnc_builder_add_from_file (builder,"assistant-qif-import.glade", "date_format_liststore");
- gnc_builder_add_from_file (builder,"assistant-qif-import.glade", "QIF Import Assistant");
+ gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "currency_liststore");
+ gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "date_format_liststore");
+ gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "QIF Import Assistant");
qif_win->new_namespaces = NULL;
qif_win->selected_transaction = 0;
Modified: gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/import-export/qif-import/gnc-plugin-qif-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -148,7 +148,7 @@
gnc_plugin_qif_import_cmd_new_qif_import (GtkAction *action,
GncMainWindowActionData *data)
{
- gnc_file_qif_import();
+ gnc_file_qif_import();
}
Modified: gnucash/trunk/src/libqof/qof/qofbook.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofbook.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/libqof/qof/qofbook.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -170,8 +170,8 @@
book->dirty_time = 0;
if (book->session_dirty)
{
-/* Set the session clean upfront, because the callback will check. */
- book->session_dirty = FALSE;
+ /* Set the session clean upfront, because the callback will check. */
+ book->session_dirty = FALSE;
if (book->dirty_cb)
book->dirty_cb(book, FALSE, book->dirty_data);
}
@@ -182,8 +182,8 @@
if (!book) return;
if (!book->session_dirty)
{
-/* Set the session dirty upfront, because the callback will check. */
- book->session_dirty = TRUE;
+ /* Set the session dirty upfront, because the callback will check. */
+ book->session_dirty = TRUE;
book->dirty_time = time(NULL);
if (book->dirty_cb)
book->dirty_cb(book, TRUE, book->dirty_data);
Modified: gnucash/trunk/src/libqof/qof/qofsession.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/libqof/qof/qofsession.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -68,22 +68,31 @@
void unregister_all_providers (void );
GHookList*
-get_session_closed_hooks (void) { return session_closed_hooks; }
+get_session_closed_hooks (void)
+{
+ return session_closed_hooks;
+}
GSList*
-get_provider_list (void) { return provider_list; }
+get_provider_list (void)
+{
+ return provider_list;
+}
gboolean
-get_qof_providers_initialized (void) { return qof_providers_initialized; }
+get_qof_providers_initialized (void)
+{
+ return qof_providers_initialized;
+}
void
unregister_all_providers (void)
{
if (provider_list)
{
- g_slist_foreach (provider_list, (GFunc) g_free, NULL);
- g_slist_free (provider_list);
- provider_list = NULL;
+ g_slist_foreach (provider_list, (GFunc) g_free, NULL);
+ g_slist_free (provider_list);
+ provider_list = NULL;
}
}
@@ -388,7 +397,7 @@
ref->ref_guid = g_new (GncGUID, 1);
ref->ent_guid = qof_instance_get_guid (ent);
ref->param = qof_class_get_parameter (ent->e_type,
- qecd->param->param_name);
+ qecd->param->param_name);
cm_guid = qof_entity_get_guid (ref_ent);
guid_to_string_buff (cm_guid, cm_sa);
cm_string = g_strdup (cm_sa);
@@ -467,7 +476,7 @@
registered_type = TRUE;
}
if ((safe_strcmp (cm_param->param_type, QOF_TYPE_NUMERIC) == 0) ||
- (safe_strcmp (cm_param->param_type, QOF_TYPE_DEBCRED) == 0))
+ (safe_strcmp (cm_param->param_type, QOF_TYPE_DEBCRED) == 0))
{
numeric_getter = (gnc_numeric (*)(QofInstance*, QofParam*))cm_param->param_getfcn;
cm_numeric = numeric_getter (importEnt, cm_param);
@@ -784,7 +793,7 @@
qof_book_set_partial (qof_session_get_book (qecd.new_session));
qof_collection_foreach (entity_coll, qof_instance_coll_foreach, &qecd);
qof_class_param_foreach (qof_collection_get_type (entity_coll),
- qof_instance_param_cb, &qecd);
+ qof_instance_param_cb, &qecd);
qof_collection_foreach (entity_coll, qof_instance_coll_copy, &qecd);
if (qecd.param_list != NULL)
{
Modified: gnucash/trunk/src/libqof/qof/test/test-qofsession.c
===================================================================
--- gnucash/trunk/src/libqof/qof/test/test-qofsession.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/libqof/qof/test/test-qofsession.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -86,15 +86,15 @@
g_test_message ("Test session initialization");
session = qof_session_new ();
g_assert (session);
- g_assert_cmpstr (session->entity.e_type, ==, QOF_ID_SESSION);
+ g_assert_cmpstr (session->entity.e_type, == , QOF_ID_SESSION);
g_assert (session->book);
book = (QofBook*) session->book;
g_assert (book);
g_assert (QOF_IS_BOOK (book));
g_assert (!session->book_id);
g_assert (!session->backend);
- g_assert_cmpint (session->lock, ==, 1);
- g_assert_cmpint (qof_session_get_error (session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (session->lock, == , 1);
+ g_assert_cmpint (qof_session_get_error (session), == , ERR_BACKEND_NO_ERR);
g_test_message ("Test session destroy");
qof_session_destroy (session);
@@ -126,7 +126,7 @@
mock_check_data_type (const char* book_id)
{
g_assert (book_id);
- g_assert_cmpstr (book_id, ==, "my book");
+ g_assert_cmpstr (book_id, == , "my book");
load_backend_struct.check_data_type_called = TRUE;
return load_backend_struct.data_compatible;
}
@@ -157,18 +157,18 @@
g_assert (get_provider_list () == NULL);
p_qof_session_load_backend (fixture->session, "file");
g_assert (get_qof_providers_initialized ());
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load 'file' using access_method");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load 'file' using access_method");
p_qof_session_clear_error (fixture->session);
g_test_message ("Test with provider registered but access method not supported");
prov->access_method = "unsupported";
qof_backend_register_provider (prov);
g_assert (get_provider_list ());
- g_assert_cmpint (g_slist_length (get_provider_list ()), ==, 1);
+ g_assert_cmpint (g_slist_length (get_provider_list ()), == , 1);
p_qof_session_load_backend (fixture->session, "file");
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load 'file' using access_method");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load 'file' using access_method");
p_qof_session_clear_error (fixture->session);
g_test_message ("Test with access method supported but type incompatible");
@@ -179,8 +179,8 @@
fixture->session->book_id = g_strdup ("my book");
p_qof_session_load_backend (fixture->session, "file");
g_assert (load_backend_struct.check_data_type_called);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load 'file' using access_method");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load 'file' using access_method");
p_qof_session_clear_error (fixture->session);
g_test_message ("Test with type compatible but backend_new not set");
@@ -189,8 +189,8 @@
load_backend_struct.check_data_type_called = FALSE;
p_qof_session_load_backend (fixture->session, "file");
g_assert (load_backend_struct.check_data_type_called);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load 'file' using access_method");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load 'file' using access_method");
p_qof_session_clear_error (fixture->session);
g_test_message ("Test with type compatible backend_new set");
@@ -210,10 +210,10 @@
g_assert (load_backend_struct.be == fixture->session->backend);
g_assert (prov == fixture->session->backend->provider);
g_assert (qof_book_get_backend (book) == load_backend_struct.be);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
unregister_all_providers ();
- g_assert_cmpint (g_slist_length (get_provider_list ()), ==, 0);
+ g_assert_cmpint (g_slist_length (get_provider_list ()), == , 0);
}
static struct
@@ -233,7 +233,7 @@
g_assert (book != load_session_struct.oldbook);
g_assert (qof_book_get_backend (book) == be);
if (load_session_struct.error)
- qof_backend_set_error (be, ERR_BACKEND_DATA_CORRUPT); /* just any valid error */
+ qof_backend_set_error (be, ERR_BACKEND_DATA_CORRUPT); /* just any valid error */
load_session_struct.load_called = TRUE;
}
@@ -299,14 +299,14 @@
g_assert (session);
g_assert (session == session_begin_struct.session);
g_assert (book_id);
- g_assert_cmpstr (book_id, ==, session_begin_struct.book_id);
+ g_assert_cmpstr (book_id, == , session_begin_struct.book_id);
g_assert (ignore_lock);
g_assert (!create);
g_assert (force);
if (session_begin_struct.produce_error)
{
- qof_backend_set_error (be, ERR_BACKEND_DATA_CORRUPT);
- qof_backend_set_message (be, "push any error");
+ qof_backend_set_error (be, ERR_BACKEND_DATA_CORRUPT);
+ qof_backend_set_message (be, "push any error");
}
session_begin_struct.session_begin_called = TRUE;
}
@@ -338,7 +338,7 @@
be = g_new0 (QofBackend, 1);
g_assert (be);
- g_assert_cmpint (g_slist_length (get_provider_list ()), ==, 0);
+ g_assert_cmpint (g_slist_length (get_provider_list ()), == , 0);
prov = g_new0 (QofBackendProvider, 1);
prov->backend_new = mock_backend_new_for_begin;
@@ -363,15 +363,15 @@
qof_session_begin (fixture->session, "default_should_be_file", ignore_lock, create, force);
g_assert (fixture->session->backend == NULL);
g_assert (fixture->session->book_id == NULL);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load 'file' using access_method");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load 'file' using access_method");
g_test_message ("Test access_method parsing");
qof_session_begin (fixture->session, "postgres://localhost:8080", ignore_lock, create, force);
g_assert (fixture->session->backend == NULL);
g_assert (fixture->session->book_id == NULL);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load 'postgres' using access_method");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load 'postgres' using access_method");
g_test_message ("Test with valid backend returned and session begin set; error is produced");
session_begin_struct.session = fixture->session;
@@ -387,8 +387,8 @@
g_assert (session_begin_struct.backend_new_called == TRUE);
g_assert (session_begin_struct.session_begin_called == TRUE);
g_assert (fixture->session->book_id == NULL);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_DATA_CORRUPT);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "push any error");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_DATA_CORRUPT);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "push any error");
g_test_message ("Test normal session_begin execution");
session_begin_struct.backend_new_called = FALSE;
@@ -400,8 +400,8 @@
g_assert (session_begin_struct.backend_new_called == TRUE);
g_assert (session_begin_struct.session_begin_called == TRUE);
g_assert (fixture->session->book_id);
- g_assert_cmpstr (fixture->session->book_id, ==, "postgres://localhost:8080");
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpstr (fixture->session->book_id, == , "postgres://localhost:8080");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
unregister_all_providers ();
}
@@ -429,14 +429,14 @@
static void
mock_session_begin_for_save (QofBackend *be, QofSession *session, const char *book_id,
- gboolean ignore_lock, gboolean create, gboolean force)
+ gboolean ignore_lock, gboolean create, gboolean force)
{
g_assert (be);
g_assert (be == session_save_struct.be);
g_assert (session);
g_assert (session == session_save_struct.session);
g_assert (book_id);
- g_assert_cmpstr (book_id, ==, session_save_struct.book_id);
+ g_assert_cmpstr (book_id, == , session_save_struct.book_id);
g_assert (ignore_lock);
g_assert (create);
g_assert (force);
@@ -470,18 +470,18 @@
g_assert (book);
qof_book_set_data (book, PARTIAL_QOFBOOK, GINT_TO_POINTER (FALSE));
qof_session_push_error (fixture->session, ERR_BACKEND_DATA_CORRUPT, "push any error");
- g_assert_cmpint (fixture->session->lock, ==, 1);
+ g_assert_cmpint (fixture->session->lock, == , 1);
qof_session_save (fixture->session, NULL);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_HANDLER);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "failed to load backend");
- g_assert_cmpint (fixture->session->lock, ==, 1);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_HANDLER);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "failed to load backend");
+ g_assert_cmpint (fixture->session->lock, == , 1);
g_test_message ("Test when book not partial and backend set; imitate error");
be = g_new0 (QofBackend, 1);
g_assert (be);
be->sync = mock_sync;
fixture->session->backend = be;
- g_assert_cmpint (fixture->session->lock, ==, 1);
+ g_assert_cmpint (fixture->session->lock, == , 1);
session_save_struct.sync_called = FALSE;
session_save_struct.be = be;
session_save_struct.book = book;
@@ -491,19 +491,19 @@
g_assert (qof_book_get_backend (book) == be);
g_assert (be->percentage == percentage_fn);
g_assert (session_save_struct.sync_called);
- g_assert_cmpint (fixture->session->lock, ==, 1);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_DATA_CORRUPT);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "");
+ g_assert_cmpint (fixture->session->lock, == , 1);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_DATA_CORRUPT);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "");
g_test_message ("Test when book not partial and backend set; successful save");
- g_assert_cmpint (fixture->session->lock, ==, 1);
+ g_assert_cmpint (fixture->session->lock, == , 1);
session_save_struct.sync_called = FALSE;
qof_session_save (fixture->session, percentage_fn);
g_assert (qof_book_get_backend (book) == be);
g_assert (be->percentage == percentage_fn);
g_assert (session_save_struct.sync_called);
- g_assert_cmpint (fixture->session->lock, ==, 1);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (fixture->session->lock, == , 1);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
/* change backend testing
* code probably should be moved to separate routine or some existing code can be reused
@@ -513,7 +513,7 @@
prov = g_new0 (QofBackendProvider, 1);
prov->partial_book_supported = TRUE;
fixture->session->backend->provider = prov;
- g_assert_cmpint (fixture->session->lock, ==, 1);
+ g_assert_cmpint (fixture->session->lock, == , 1);
qof_book_set_data (book, PARTIAL_QOFBOOK, GINT_TO_POINTER (TRUE));
session_save_struct.sync_called = FALSE;
qof_session_save (fixture->session, percentage_fn);
@@ -522,17 +522,17 @@
g_assert (qof_book_get_backend (book) == be);
g_assert (be->percentage == percentage_fn);
g_assert (session_save_struct.sync_called);
- g_assert_cmpint (fixture->session->lock, ==, 1);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (fixture->session->lock, == , 1);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
g_test_message ("Test when book is partial and current backend does not support it; backend should be changed");
prov->partial_book_supported = FALSE;
- g_assert_cmpint (fixture->session->lock, ==, 1);
+ g_assert_cmpint (fixture->session->lock, == , 1);
reg_prov = g_new0 (QofBackendProvider, 1);
reg_prov->partial_book_supported = TRUE;
reg_prov->backend_new = mock_backend_new_for_save;
qof_backend_register_provider (reg_prov);
- g_assert_cmpint (g_slist_length (get_provider_list ()), ==, 1);
+ g_assert_cmpint (g_slist_length (get_provider_list ()), == , 1);
session_save_struct.book = book;
session_save_struct.session = fixture->session;
fixture->session->book_id = g_strdup ("my book");
@@ -550,8 +550,8 @@
g_assert (session_save_struct.session_begin_called);
g_assert (qof_book_get_backend (book) == session_save_struct.be);
g_assert (session_save_struct.sync_called);
- g_assert_cmpint (fixture->session->lock, ==, 1);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (fixture->session->lock, == , 1);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
unregister_all_providers ();
g_free (prov);
@@ -625,7 +625,7 @@
session_end_struct.be = be;
qof_session_end (fixture->session);
g_assert (session_end_struct.called);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
g_assert (!fixture->session->book_id);
}
@@ -799,7 +799,7 @@
g_assert (book);
g_assert (be == data_load_struct.be);
g_assert (book == data_load_struct.book);
- g_assert_cmpint (type, ==, LOAD_TYPE_LOAD_ALL);
+ g_assert_cmpint (type, == , LOAD_TYPE_LOAD_ALL);
qof_backend_set_error (be, ERR_BACKEND_DATA_CORRUPT);
data_load_struct.called = TRUE;
}
@@ -820,8 +820,8 @@
data_load_struct.called = FALSE;
qof_session_ensure_all_data_loaded (fixture->session);
g_assert (data_load_struct.called);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_DATA_CORRUPT);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_DATA_CORRUPT);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "");
}
static void
@@ -833,22 +833,22 @@
for (i = 0; i < 4; i++)
{
- QofBackendProvider *prov = g_new0 (QofBackendProvider, 1);
- g_assert (prov);
- prov->access_method = access_methods[ i ];
- qof_backend_register_provider (prov);
- g_assert_cmpint (g_slist_length (get_provider_list ()), ==, (i + 1));
+ QofBackendProvider *prov = g_new0 (QofBackendProvider, 1);
+ g_assert (prov);
+ prov->access_method = access_methods[ i ];
+ qof_backend_register_provider (prov);
+ g_assert_cmpint (g_slist_length (get_provider_list ()), == , (i + 1));
}
- g_assert_cmpint (g_slist_length (get_provider_list ()), ==, 4);
+ g_assert_cmpint (g_slist_length (get_provider_list ()), == , 4);
g_test_message ("Test list of access methods is returned");
list = qof_backend_get_registered_access_method_list ();
g_assert (list);
- g_assert_cmpint (g_list_length (list), ==, 4);
- g_assert_cmpstr (g_list_nth_data (list, 0), ==, "file");
- g_assert_cmpstr (g_list_nth_data (list, 1), ==, "http");
- g_assert_cmpstr (g_list_nth_data (list, 2), ==, "postgres");
- g_assert_cmpstr (g_list_nth_data (list, 3), ==, "sqlite");
+ g_assert_cmpint (g_list_length (list), == , 4);
+ g_assert_cmpstr (g_list_nth_data (list, 0), == , "file");
+ g_assert_cmpstr (g_list_nth_data (list, 1), == , "http");
+ g_assert_cmpstr (g_list_nth_data (list, 2), == , "postgres");
+ g_assert_cmpstr (g_list_nth_data (list, 3), == , "sqlite");
g_list_free (list);
unregister_all_providers ();
@@ -867,7 +867,7 @@
g_assert (fixture->session->book);
book = qof_session_get_book (fixture->session);
g_assert (book);
- g_assert_cmpuint (book->book_open, ==, 'y');
+ g_assert_cmpuint (book->book_open, == , 'y');
g_test_message ("Test when book is closed null returned");
qof_book_mark_closed (book);
@@ -881,23 +881,23 @@
QofBackend *be = NULL;
g_test_message ("Test if session is null");
- g_assert_cmpint (qof_session_get_error (NULL), ==, ERR_BACKEND_NO_BACKEND);
+ g_assert_cmpint (qof_session_get_error (NULL), == , ERR_BACKEND_NO_BACKEND);
g_test_message ("Test when there is a local error");
fixture->session->last_err = ERR_BACKEND_DATA_CORRUPT; /* just any error */
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_DATA_CORRUPT);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_DATA_CORRUPT);
g_test_message ("Test if session backend is null");
g_assert (!fixture->session->backend);
fixture->session->last_err = ERR_BACKEND_NO_ERR;
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
g_test_message ("Test for backend error");
be = g_new0 (QofBackend, 1);
g_assert (be);
qof_backend_set_error (be, ERR_BACKEND_CANT_CONNECT);
fixture->session->backend = be;
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_CANT_CONNECT);
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_CANT_CONNECT);
}
static void
@@ -913,10 +913,10 @@
fixture->session->backend = be;
qof_backend_set_error (be, ERR_BACKEND_CANT_CONNECT);
p_qof_session_clear_error (fixture->session);
- g_assert_cmpint (qof_session_get_error (fixture->session), ==, ERR_BACKEND_NO_ERR);
- g_assert_cmpstr (qof_session_get_error_message (fixture->session), ==, "");
+ g_assert_cmpint (qof_session_get_error (fixture->session), == , ERR_BACKEND_NO_ERR);
+ g_assert_cmpstr (qof_session_get_error_message (fixture->session), == , "");
g_assert (!fixture->session->error_message);
- g_assert_cmpint (qof_backend_get_error (be), ==, ERR_BACKEND_NO_ERR);
+ g_assert_cmpint (qof_backend_get_error (be), == , ERR_BACKEND_NO_ERR);
}
static struct
@@ -938,11 +938,11 @@
session = (QofSession*) data;
g_assert (session == hooks_struct.session);
if (hooks_struct.call_count == 0)
- g_assert (hooks_struct.data1 == user_data);
+ g_assert (hooks_struct.data1 == user_data);
if (hooks_struct.call_count == 1)
- g_assert (hooks_struct.data2 == user_data);
+ g_assert (hooks_struct.data2 == user_data);
if (hooks_struct.call_count == 2)
- g_assert (hooks_struct.data3 == user_data);
+ g_assert (hooks_struct.data3 == user_data);
hooks_struct.call_count++;
}
@@ -968,7 +968,7 @@
hooks_struct.data3 = (gpointer) &data3;
hooks_struct.call_count = 0;
qof_session_call_close_hooks (fixture->session);
- g_assert_cmpuint (hooks_struct.call_count, ==, 3);
+ g_assert_cmpuint (hooks_struct.call_count, == , 3);
/* currently qofsession does not provide a way to clear hooks list
* g_hook_list_clear is used to destroy list and all of it's elements
Modified: gnucash/trunk/src/plugins/bi_import/dialog-bi-import-gui.c
===================================================================
--- gnucash/trunk/src/plugins/bi_import/dialog-bi-import-gui.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/plugins/bi_import/dialog-bi-import-gui.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -105,7 +105,7 @@
gui->open_mode = "ALL";
builder = gtk_builder_new();
- gnc_builder_add_from_file (builder,"dialog-bi-import-gui.glade", "bi-import Dialog");
+ gnc_builder_add_from_file (builder, "dialog-bi-import-gui.glade", "bi-import Dialog");
gui->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "bi-import Dialog"));
gui->tree_view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview1"));
gui->entryFilename = GTK_WIDGET(gtk_builder_get_object (builder, "entryFilename"));
Modified: gnucash/trunk/src/plugins/bi_import/dialog-bi-import.c
===================================================================
--- gnucash/trunk/src/plugins/bi_import/dialog-bi-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/plugins/bi_import/dialog-bi-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -462,10 +462,10 @@
else if (row_fixed)
(*fixed)++;
- if (!row_deleted)
+ if (!row_deleted)
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter);
- row++;
+ row++;
}
// deallocate strings
Modified: gnucash/trunk/src/plugins/customer_import/dialog-customer-import-gui.c
===================================================================
--- gnucash/trunk/src/plugins/customer_import/dialog-customer-import-gui.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/plugins/customer_import/dialog-customer-import-gui.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -84,7 +84,7 @@
GtkTreeIter iter;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
-
+
// if window exists already, activate it
glist = gnc_find_gui_components ("dialog-customer_import_gui", NULL, NULL);
if (glist)
@@ -171,7 +171,7 @@
filename = gnc_file_dialog(_("Import Customers from csv"), filters, NULL, GNC_FILE_DIALOG_IMPORT);
return filename;
-}
+}
void
gnc_customer_import_gui_ok_cb (GtkWidget *widget, gpointer data)
@@ -182,11 +182,11 @@
customer_import_result res;
guint n_fixed, n_deleted, n_customers_created, n_customers_updated;
gchar *cv_type_text;
-
+
// import
if (g_ascii_strcasecmp (gui->type, "CUSTOMER") == 0) cv_type_text = _("customers");
else cv_type_text = _("vendors");
-
+
gtk_list_store_clear (gui->store);
res = gnc_customer_import_read_file (filename, gui->regexp->str, gui->store, 0, &stats);
if (res == CI_RESULT_OK)
@@ -194,13 +194,13 @@
gnc_customer_import_fix_customers (gui->store, &n_fixed, &n_deleted, gui->type);
gnc_customer_import_create_customers (gui->store, gui->book, &n_customers_created, &n_customers_updated, gui->type);
gnc_info_dialog (gui->dialog, _("Import results:\n%i lines were ignored\n%i lines imported:\n %u %s fixed\n %u %s ignored (not fixable)\n\n %u %s created\n %u %s updated (based on id)"), \
- stats.n_ignored, stats.n_imported, n_fixed, cv_type_text, n_deleted, cv_type_text, n_customers_created, cv_type_text, n_customers_updated,cv_type_text);
+ stats.n_ignored, stats.n_imported, n_fixed, cv_type_text, n_deleted, cv_type_text, n_customers_created, cv_type_text, n_customers_updated, cv_type_text);
if (stats.n_ignored > 0)
gnc_info2_dialog (gui->dialog, _("These lines were ignored during import"), stats.ignored_lines->str);
g_string_free (stats.ignored_lines, TRUE);
- gnc_close_gui_component (gui->component_id);
+ gnc_close_gui_component (gui->component_id);
}
else if (res == CI_RESULT_OPEN_FAILED)
{
@@ -272,7 +272,7 @@
gtk_list_store_clear (gui->store);
gnc_customer_import_read_file (filename, gui->regexp->str, gui->store, 10, NULL);
- g_free( filename );
+ g_free( filename );
}
// Semicolon separated.
void gnc_customer_import_gui_option1_cb (GtkWidget *widget, gpointer data)
@@ -340,10 +340,10 @@
if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
return;
name = gtk_buildable_get_name(GTK_BUILDABLE(widget));
- if(name)
+ if (name)
{
- if (g_ascii_strcasecmp(name, "radiobutton_customer") == 0)gui->type = "CUSTOMER";
- else if (g_ascii_strcasecmp(name, "radiobutton_vendor") == 0)gui->type = "VENDOR";
+ if (g_ascii_strcasecmp(name, "radiobutton_customer") == 0)gui->type = "CUSTOMER";
+ else if (g_ascii_strcasecmp(name, "radiobutton_vendor") == 0)gui->type = "VENDOR";
}
//printf ("TYPE set to, %s\n",gui->type); // DEBUG
Modified: gnucash/trunk/src/plugins/customer_import/dialog-customer-import.c
===================================================================
--- gnucash/trunk/src/plugins/customer_import/dialog-customer-import.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/plugins/customer_import/dialog-customer-import.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -349,15 +349,15 @@
{
if (g_ascii_strcasecmp (type, "CUSTOMER") == 0)
{
- customer = gncCustomerCreate( book );
- gncCustomerSetCurrency( customer, gnc_default_currency() );
+ customer = gncCustomerCreate( book );
+ gncCustomerSetCurrency( customer, gnc_default_currency() );
}
- else if(g_ascii_strcasecmp (type, "VENDOR") == 0)
+ else if (g_ascii_strcasecmp (type, "VENDOR") == 0)
{
- vendor = gncVendorCreate( book );
- gncVendorSetCurrency( vendor, gnc_default_currency() );
+ vendor = gncVendorCreate( book );
+ gncVendorSetCurrency( vendor, gnc_default_currency() );
}
-
+
(*n_customers_created)++;
}
else
Modified: gnucash/trunk/src/register/register-gnome/gnucash-item-edit.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/gnucash-item-edit.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/register/register-gnome/gnucash-item-edit.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -836,7 +836,7 @@
return;
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (editable),
- clipboard_atom);
+ clipboard_atom);
g_return_if_fail (clipboard != NULL);
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
clip = gtk_editable_get_chars (editable, start_sel, end_sel);
@@ -875,11 +875,11 @@
gint start_sel, end_sel;
if (text == NULL)
- return;
+ return;
if (gtk_editable_get_selection_bounds (editable, &start_sel, &end_sel))
{
- reselect = TRUE;
- gtk_editable_delete_text (editable, start_sel, end_sel);
+ reselect = TRUE;
+ gtk_editable_delete_text (editable, start_sel, end_sel);
}
tmp_pos = old_pos = gtk_editable_get_position (editable);
@@ -888,23 +888,23 @@
gtk_editable_set_position (editable, tmp_pos);
if (!reselect)
- return;
+ return;
gtk_editable_select_region (editable, old_pos,
- gtk_editable_get_position (editable));
+ gtk_editable_get_position (editable));
}
void
gnc_item_edit_paste_selection (GncItemEdit *item_edit, GdkAtom selection,
- guint32 time)
+ guint32 time)
{
GtkClipboard *clipboard;
g_return_if_fail(item_edit != NULL);
g_return_if_fail(GNC_IS_ITEM_EDIT(item_edit));
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (item_edit->sheet),
- selection);
+ selection);
g_return_if_fail (clipboard != NULL);
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
Modified: gnucash/trunk/src/register/register-gnome/gnucash-item-edit.h
===================================================================
--- gnucash/trunk/src/register/register-gnome/gnucash-item-edit.h 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/register/register-gnome/gnucash-item-edit.h 2012-03-16 20:27:09 UTC (rev 22089)
@@ -146,7 +146,7 @@
void gnc_item_edit_cut_clipboard (GncItemEdit *item_edit, guint32 time);
void gnc_item_edit_copy_clipboard (GncItemEdit *item_edit, guint32 time);
void gnc_item_edit_paste_selection (GncItemEdit *item_edit, GdkAtom selection,
- guint32 time);
+ guint32 time);
void gnc_item_edit_set_has_selection (GncItemEdit *item_edit, gboolean has_selection);
gboolean gnc_item_edit_get_has_selection (GncItemEdit *item_edit);
Modified: gnucash/trunk/src/register/register-gnome/gnucash-sheet.c
===================================================================
--- gnucash/trunk/src/register/register-gnome/gnucash-sheet.c 2012-03-16 20:26:50 UTC (rev 22088)
+++ gnucash/trunk/src/register/register-gnome/gnucash-sheet.c 2012-03-16 20:27:09 UTC (rev 22089)
@@ -1409,8 +1409,8 @@
if (event->type != GDK_BUTTON_PRESS)
return FALSE;
gnc_item_edit_paste_selection (GNC_ITEM_EDIT(sheet->item_editor),
- GDK_SELECTION_PRIMARY,
- event->time);
+ GDK_SELECTION_PRIMARY,
+ event->time);
return TRUE;
case 3:
do_popup = (sheet->popup != NULL);
@@ -1449,7 +1449,7 @@
gtk_grab_add(widget);
sheet->grabbed = TRUE;
gnc_item_edit_set_has_selection (GNC_ITEM_EDIT(sheet->item_editor),
- TRUE);
+ TRUE);
}
if (virt_loc_equal (new_virt_loc, cur_virt_loc) && sheet->editing)
@@ -1553,7 +1553,7 @@
item_edit = GNC_ITEM_EDIT(sheet->item_editor);
gnc_item_edit_paste_selection (item_edit, GDK_SELECTION_CLIPBOARD,
- GDK_CURRENT_TIME);
+ GDK_CURRENT_TIME);
}
static void
@@ -1615,7 +1615,7 @@
if (event->state & GDK_CONTROL_MASK)
{
gnc_item_edit_paste_selection (item_edit, GDK_SELECTION_CLIPBOARD,
- time);
+ time);
handled = TRUE;
}
break;
@@ -1623,7 +1623,7 @@
if (event->state & GDK_SHIFT_MASK)
{
gnc_item_edit_paste_selection (item_edit, GDK_SELECTION_CLIPBOARD,
- time);
+ time);
handled = TRUE;
}
else if (event->state & GDK_CONTROL_MASK)
More information about the gnucash-changes
mailing list