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

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21816 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2012-01-01 20:36:46 +00:00
parent fc268dba92
commit 3fcdf59adf
56 changed files with 333 additions and 329 deletions

View File

@ -1174,7 +1174,7 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
/* rounding? -- can only ROUND if force_fit is also true */
if (value_is_decimal && info->round && info->force_fit)
{
gnc_numeric oldval = val;
gnc_numeric oldval = val;
rounding.num = 5; /* Limit the denom to 10^13 ~= 2^44, leaving max at ~524288 */
rounding.denom = pow(10, max_dp + 1);
val = gnc_numeric_add(val, rounding, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);

View File

@ -69,7 +69,7 @@ run_parser_test (TestNode *node)
result = gnc_numeric_error( -1 );
hdlr = g_log_set_handler ("gnc.gui", loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
g_test_message ("Running test \"%s\" [%s] = ", node->test_name, node->exp);
succeeded = gnc_exp_parser_parse (node->exp, &result, &error_loc);
g_log_remove_handler ("gnc.gui", hdlr);
@ -81,8 +81,8 @@ run_parser_test (TestNode *node)
pass &= gnc_numeric_equal( result, node->expected_result );
}
g_test_message ( "%0.4f [%s]\n",
gnc_numeric_to_double( result ),
(pass ? "PASS" : "FAIL" ) );
gnc_numeric_to_double( result ),
(pass ? "PASS" : "FAIL" ) );
}
if (succeeded != node->should_succeed)

View File

@ -20,11 +20,11 @@ test_num_print_info (gnc_numeric n, GNCPrintAmountInfo print_info, int line)
guint loglevel = G_LOG_LEVEL_WARNING, hdlr;
TestErrorStruct check = { loglevel, log_domain, msg };
/* Throws overflows during rounding step in xaccPrintAmount when the "fraction" is high. See bug 665707. */
/* Throws overflows during rounding step in xaccPrintAmount when the "fraction" is high. See bug 665707. */
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
s = xaccPrintAmount (n, print_info);
print_ok = (s && s[0] != '\0');
print_ok = (s && s[0] != '\0');
if (!print_ok)
return;

View File

@ -57,7 +57,7 @@ create_session(void)
guint loglevel = G_LOG_LEVEL_WARNING, hdlr;
TestErrorStruct check = { loglevel, log_domain, msg };
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
session = qof_session_new();
book = qof_session_get_book( session );

View File

@ -220,7 +220,7 @@ test_dbi_business_store_and_reload( const gchar* driver, QofSession* session_1,
qof_session_destroy( session_2 );
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
qof_session_end( session_3 );
g_log_remove_handler (log_domain, hdlr);
qof_session_destroy( session_3 );

View File

@ -180,7 +180,7 @@ test_dbi_store_and_reload( const gchar* driver, QofSession* session_1, const gch
// Save the session data
session_2 = qof_session_new();
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
qof_session_begin( session_2, url, FALSE, TRUE, TRUE );
if (session_2 && qof_session_get_error(session_2) != ERR_BACKEND_NO_ERR)
{
@ -279,7 +279,7 @@ test_dbi_safe_save( const gchar* driver, const gchar* url )
cleanup:
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
if (session_2 != NULL)
{
qof_session_end( session_2 );

View File

@ -83,7 +83,7 @@ test_load_file(const char *filename)
guint loglevel = G_LOG_LEVEL_WARNING;
TestErrorStruct check = { loglevel, logdomain, NULL };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
session = qof_session_new();

View File

@ -319,12 +319,12 @@ test_generation()
{
/* empty some things. */
Account *act;
gchar *msg = "xaccAccountSetCommodity: assertion `GNC_IS_COMMODITY(com)' failed";
gchar *logdomain = "gnc.engine";
guint loglevel = G_LOG_LEVEL_CRITICAL;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
gchar *msg = "xaccAccountSetCommodity: assertion `GNC_IS_COMMODITY(com)' failed";
gchar *logdomain = "gnc.engine";
guint loglevel = G_LOG_LEVEL_CRITICAL;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
act = get_random_account(sixbook);

View File

@ -467,13 +467,13 @@ test_transaction(void)
sixtp *parser;
tran_data data;
gchar *msg = "[xaccAccountScrubCommodity()] Account \"\" does not have a commodity!";
gchar *logdomain = "gnc.engine.scrub";
guint loglevel = G_LOG_LEVEL_CRITICAL;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
data.trn = ran_trn;
gchar *msg = "[xaccAccountScrubCommodity()] Account \"\" does not have a commodity!";
gchar *logdomain = "gnc.engine.scrub";
guint loglevel = G_LOG_LEVEL_CRITICAL;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
data.trn = ran_trn;
data.com = com;
data.value = i;
parser = gnc_transaction_sixtp_parser_create();

View File

@ -647,8 +647,8 @@ gnc_customer_new_window (QofBook *bookp, GncCustomer *cust)
/* Setup signals */
gtk_builder_connect_signals_full( builder,
gnc_builder_connect_full_func,
cw);
gnc_builder_connect_full_func,
cw);
/* Setup initial values */
if (cust != NULL)

View File

@ -235,7 +235,7 @@ iw_ask_unpost (InvoiceWindow *iw)
char *s;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-invoice.glade", "Unpost Message Dialog");
gnc_builder_add_from_file (builder, "dialog-invoice.glade", "Unpost Message Dialog");
dialog = GTK_WIDGET (gtk_builder_get_object (builder, "Unpost Message Dialog"));
toggle = GTK_TOGGLE_BUTTON(gtk_builder_get_object (builder, "yes_tt_reset"));
@ -777,7 +777,7 @@ gnc_invoice_window_postCB (GtkWidget *unused_widget, gpointer data)
account_currency = xaccAccountGetCommodity (this_acc);
if (this_acc &&
!gnc_commodity_equal (gncInvoiceGetCurrency (invoice), account_currency))
!gnc_commodity_equal (gncInvoiceGetCurrency (invoice), account_currency))
{
GNCPrice *convprice;
@ -812,8 +812,8 @@ gnc_invoice_window_postCB (GtkWidget *unused_widget, gpointer data)
/* Obtain the Entry's total value (net + tax) */
gncEntryGetValue (entry, is_cust_doc, &value, NULL, &tax, NULL);
amount = gnc_numeric_add (value, tax,
gnc_commodity_get_fraction (account_currency),
GNC_HOW_RND_ROUND_HALF_UP );
gnc_commodity_get_fraction (account_currency),
GNC_HOW_RND_ROUND_HALF_UP );
/* create the exchange-rate dialog */
xfer = gnc_xfer_dialog (iw_get_window(iw), acc);
@ -833,8 +833,11 @@ gnc_invoice_window_postCB (GtkWidget *unused_widget, gpointer data)
/* Invert the exchange rate as explained above */
if (!gnc_numeric_zero_p (exch_rate))
exch_rate = gnc_numeric_div ((gnc_numeric) {1, 1}, exch_rate,
GNC_DENOM_AUTO, GNC_HOW_RND_ROUND_HALF_UP);
exch_rate = gnc_numeric_div ((gnc_numeric)
{
1, 1
}, exch_rate,
GNC_DENOM_AUTO, GNC_HOW_RND_ROUND_HALF_UP);
convprice = gnc_price_create(iw->book);
gnc_price_begin_edit (convprice);
gnc_price_set_commodity (convprice, account_currency);
@ -1845,16 +1848,16 @@ gnc_invoice_get_title (InvoiceWindow *iw)
{
case NEW_INVOICE:
wintitle = iw->is_credit_note ? _("New Credit Note")
: _("New Invoice");
: _("New Invoice");
break;
case MOD_INVOICE:
case EDIT_INVOICE:
wintitle = iw->is_credit_note ? _("Edit Credit Note")
: _("Edit Invoice");
: _("Edit Invoice");
break;
case VIEW_INVOICE:
wintitle = iw->is_credit_note ? _("View Credit Note")
: _("View Invoice");
: _("View Invoice");
break;
}
break;
@ -1863,16 +1866,16 @@ gnc_invoice_get_title (InvoiceWindow *iw)
{
case NEW_INVOICE:
wintitle = iw->is_credit_note ? _("New Credit Note")
: _("New Bill");
: _("New Bill");
break;
case MOD_INVOICE:
case EDIT_INVOICE:
wintitle = iw->is_credit_note ? _("Edit Credit Note")
: _("Edit Bill");
: _("Edit Bill");
break;
case VIEW_INVOICE:
wintitle = iw->is_credit_note ? _("View Credit Note")
: _("View Bill");
: _("View Bill");
break;
}
break;
@ -1881,16 +1884,16 @@ gnc_invoice_get_title (InvoiceWindow *iw)
{
case NEW_INVOICE:
wintitle = iw->is_credit_note ? _("New Credit Note")
: _("New Expense Voucher");
: _("New Expense Voucher");
break;
case MOD_INVOICE:
case EDIT_INVOICE:
wintitle = iw->is_credit_note ? _("Edit Credit Note")
: _("Edit Expense Voucher");
: _("Edit Expense Voucher");
break;
case VIEW_INVOICE:
wintitle = iw->is_credit_note ? _("View Credit Note")
: _("View Expense Voucher");
: _("View Expense Voucher");
break;
}
break;
@ -2230,15 +2233,15 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
{
case GNC_OWNER_CUSTOMER:
ledger_type = is_credit_note ? GNCENTRY_CUST_CREDIT_NOTE_ENTRY
: GNCENTRY_INVOICE_ENTRY;
: GNCENTRY_INVOICE_ENTRY;
break;
case GNC_OWNER_VENDOR:
ledger_type = is_credit_note ? GNCENTRY_VEND_CREDIT_NOTE_ENTRY
: GNCENTRY_BILL_ENTRY;
: GNCENTRY_BILL_ENTRY;
break;
case GNC_OWNER_EMPLOYEE:
ledger_type = is_credit_note ? GNCENTRY_EMPL_CREDIT_NOTE_ENTRY
: GNCENTRY_EXPVOUCHER_ENTRY;
: GNCENTRY_EXPVOUCHER_ENTRY;
break;
default:
g_warning ("Invalid owner type");
@ -2251,17 +2254,17 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
{
case GNC_OWNER_CUSTOMER:
ledger_type = is_credit_note ? GNCENTRY_CUST_CREDIT_NOTE_VIEWER
: GNCENTRY_INVOICE_VIEWER;
: GNCENTRY_INVOICE_VIEWER;
gconf_section = GCONF_SECTION_INVOICE;
break;
case GNC_OWNER_VENDOR:
ledger_type = is_credit_note ? GNCENTRY_VEND_CREDIT_NOTE_VIEWER
: GNCENTRY_BILL_VIEWER;
: GNCENTRY_BILL_VIEWER;
gconf_section = GCONF_SECTION_BILL;
break;
case GNC_OWNER_EMPLOYEE:
ledger_type = is_credit_note ? GNCENTRY_EMPL_CREDIT_NOTE_VIEWER
: GNCENTRY_EXPVOUCHER_VIEWER;
: GNCENTRY_EXPVOUCHER_VIEWER;
gconf_section = GCONF_SECTION_BILL;
break;
default:
@ -2374,14 +2377,14 @@ gnc_invoice_window_new_invoice (QofBook *bookp, const GncOwner *owner,
start_owner = owner;
switch (gncOwnerGetType (gncOwnerGetEndOwner (owner)))
{
case GNC_OWNER_CUSTOMER:
owner_terms = gncCustomerGetTerms (gncOwnerGetCustomer (gncOwnerGetEndOwner (owner)));
break;
case GNC_OWNER_VENDOR:
owner_terms = gncVendorGetTerms (gncOwnerGetVendor (gncOwnerGetEndOwner (owner)));
break;
default:
break;
case GNC_OWNER_CUSTOMER:
owner_terms = gncCustomerGetTerms (gncOwnerGetCustomer (gncOwnerGetEndOwner (owner)));
break;
case GNC_OWNER_VENDOR:
owner_terms = gncVendorGetTerms (gncOwnerGetVendor (gncOwnerGetEndOwner (owner)));
break;
default:
break;
}
if (owner_terms)
gncInvoiceSetTerms (invoice, owner_terms);
@ -2450,8 +2453,8 @@ gnc_invoice_window_new_invoice (QofBook *bookp, const GncOwner *owner,
/* Setup signals */
gtk_builder_connect_signals_full( builder,
gnc_builder_connect_full_func,
iw);
gnc_builder_connect_full_func,
iw);
/* Setup initial values */
iw->invoice_guid = *gncInvoiceGetGUID (invoice);
@ -3108,12 +3111,12 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
}
message = g_strdup_printf
(/* Translators: %d is the number of bills due. This is a
(/* Translators: %d is the number of bills due. This is a
ngettext(3) message. */
ngettext("The following %d bill is due:",
"The following %d bills are due:",
len),
len);
ngettext("The following %d bill is due:",
"The following %d bills are due:",
len),
len);
dialog = gnc_dialog_query_list_create(param_list, q,
_("Due Bills Reminder"),
message,

View File

@ -331,7 +331,7 @@ gnc_job_new_window (QofBook *bookp, GncOwner *owner, GncJob *job)
/* Load the Glade File */
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-job.glade", "Job Dialog");
gnc_builder_add_from_file (builder, "dialog-job.glade", "Job Dialog");
/* Find the dialog */
jw->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Job Dialog"));

View File

@ -700,7 +700,7 @@ gnc_order_window_new_order (QofBook *bookp, GncOwner *owner)
/* Find the dialog */
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-order.glade", "New Order Dialog");
gnc_builder_add_from_file (builder, "dialog-order.glade", "New Order Dialog");
ow->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "New Order Dialog"));

View File

@ -635,8 +635,8 @@ new_payment_window (GncOwner *owner, QofBook *book, GncInvoice *invoice)
/* Setup signals */
gtk_builder_connect_signals_full( builder,
gnc_builder_connect_full_func,
pw);
gnc_builder_connect_full_func,
pw);
g_signal_connect (G_OBJECT (pw->owner_choice), "changed",
G_CALLBACK (gnc_payment_dialog_owner_changed_cb), pw);

View File

@ -475,8 +475,8 @@ gnc_vendor_new_window (QofBook *bookp, GncVendor *vendor)
/* Setup signals */
gtk_builder_connect_signals_full( builder,
gnc_builder_connect_full_func,
vw);
gnc_builder_connect_full_func,
vw);
/* Setup initial values */
if (vendor != NULL)

View File

@ -488,7 +488,7 @@ static void create_invoice_query (GncEntryLedger *ledger)
/* Term 3 */
if ((ledger->type == GNCENTRY_INVOICE_ENTRY ||
ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY) &&
ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY) &&
gncOwnerGetEndGUID (gncInvoiceGetOwner (ledger->invoice)) != NULL)
{

View File

@ -1007,7 +1007,7 @@ gnc_entry_ledger_check_close (GtkWidget *parent, GncEntryLedger *ledger)
gboolean dontask = FALSE;
if (ledger->type == GNCENTRY_INVOICE_ENTRY ||
ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY)
ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY)
{
gboolean inv_value;
gboolean only_inv_changed = FALSE;

View File

@ -1182,7 +1182,7 @@ static void gnc_entry_ledger_save_cells (gpointer save_data,
}
if (ledger->type == GNCENTRY_INVOICE_ENTRY ||
ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY)
ledger->type == GNCENTRY_CUST_CREDIT_NOTE_ENTRY)
{
gboolean inv_value;

View File

@ -158,14 +158,14 @@ gchar *gnc_path_get_reportdir()
const gchar *builddir = g_getenv ("GNC_BUILDDIR");
if (g_getenv ("GNC_UNINSTALLED") && builddir)
{
result = g_build_filename (builddir, "src", "report", NULL);
result = g_build_filename (builddir, "src", "report", NULL);
}
else
{
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
result = g_build_filename (pkgdatadir, "guile-modules",
"gnucash", "report", (char*)NULL);
g_free (pkgdatadir);
gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
result = g_build_filename (pkgdatadir, "guile-modules",
"gnucash", "report", (char*)NULL);
g_free (pkgdatadir);
}
//printf("Returning stdreportsdir %s\n", result);
return result;
@ -182,12 +182,12 @@ gchar *gnc_path_get_stdreportsdir()
gchar *reportdir = gnc_path_get_reportdir ();
if (g_getenv ("GNC_UNINSTALLED"))
{
result = g_build_filename (reportdir, "standard-reports", "gnucash",
"report", "standard-reports", NULL);
result = g_build_filename (reportdir, "standard-reports", "gnucash",
"report", "standard-reports", NULL);
}
else
{
result = g_build_filename (reportdir, "standard-reports", NULL);
result = g_build_filename (reportdir, "standard-reports", NULL);
}
g_free (reportdir);
//printf("Returning stdreportsdir %s\n", result);

View File

@ -4819,7 +4819,7 @@ _utest_account_fill_functions(void)
func->xaccFreeAccount = xaccFreeAccount;
func->qofAccountSetParent = qofAccountSetParent;
func->gnc_account_lookup_by_full_name_helper =
gnc_account_lookup_by_full_name_helper;
gnc_account_lookup_by_full_name_helper;
return func;
}

View File

@ -144,7 +144,7 @@ typedef struct
void (*xaccFreeAccount) (Account *acc);
void (*qofAccountSetParent) (Account *acc, QofInstance *parent);
Account *(*gnc_account_lookup_by_full_name_helper) (const Account *acc,
gchar **names);
gchar **names);
} AccountTestFunctions;
AccountTestFunctions* _utest_account_fill_functions(void);

View File

@ -1149,7 +1149,7 @@ do_destroy (Transaction *trans)
* they need to be destroyed too unless we're shutting down in
* which case all transactions will be destroyed. */
if (!shutting_down)
destroy_gains (trans);
destroy_gains (trans);
/* Make a log in the journal before destruction. */
if (!shutting_down && !qof_book_is_readonly(qof_instance_get_book(trans)))

View File

@ -700,7 +700,7 @@ gnc_commodity * gnc_commodity_table_find_full(const gnc_commodity_table * t,
/*@ dependent @*/
gnc_commodity * gnc_commodity_find_commodity_by_guid(const GncGUID *guid,
QofBook *book);
QofBook *book);
/** @} */
/* ---------------------------------------------------------- */

View File

@ -72,11 +72,11 @@ gnc_engine_init_part2()
gchar *pkglibdir;
const gchar *builddir = g_getenv ("GNC_BUILDDIR");
gboolean uninstalled = (g_getenv ("GNC_UNINSTALLED") != NULL
&& builddir != NULL);
&& builddir != NULL);
static struct
{
const gchar* subdir;
const gchar* subdir;
const gchar* lib;
gboolean required;
} libs[] =
@ -89,19 +89,19 @@ gnc_engine_init_part2()
}, *lib;
if (uninstalled)
pkglibdir = g_build_path (G_DIR_SEPARATOR_S, builddir,
"src", "backend", NULL);
pkglibdir = g_build_path (G_DIR_SEPARATOR_S, builddir,
"src", "backend", NULL);
else
pkglibdir = gnc_path_get_pkglibdir ();
pkglibdir = gnc_path_get_pkglibdir ();
for (lib = libs; lib->lib ; lib++)
{
gchar *libdir;
if (uninstalled)
libdir = g_build_path (G_DIR_SEPARATOR_S, pkglibdir,
lib->subdir, ".libs", NULL);
else
libdir = pkglibdir;
gchar *libdir;
if (uninstalled)
libdir = g_build_path (G_DIR_SEPARATOR_S, pkglibdir,
lib->subdir, ".libs", NULL);
else
libdir = pkglibdir;
if (qof_load_backend_library(libdir, lib->lib))
{
engine_is_initialized = 1;
@ -115,8 +115,8 @@ gnc_engine_init_part2()
g_critical("required library %s not found.\n", lib->lib);
}
}
if (uninstalled)
g_free (libdir);
if (uninstalled)
g_free (libdir);
}
g_free (pkglibdir);
}

View File

@ -868,19 +868,19 @@ GncInvoiceType gncInvoiceGetType (const GncInvoice *invoice)
{
case GNC_OWNER_CUSTOMER:
return (gncInvoiceGetIsCreditNote(invoice) ?
GNC_INVOICE_CUST_CREDIT_NOTE :
GNC_INVOICE_CUST_INVOICE);
GNC_INVOICE_CUST_CREDIT_NOTE :
GNC_INVOICE_CUST_INVOICE);
case GNC_OWNER_VENDOR:
return (gncInvoiceGetIsCreditNote(invoice) ?
GNC_INVOICE_VEND_CREDIT_NOTE :
GNC_INVOICE_VEND_INVOICE);
GNC_INVOICE_VEND_CREDIT_NOTE :
GNC_INVOICE_VEND_INVOICE);
case GNC_OWNER_EMPLOYEE:
return (gncInvoiceGetIsCreditNote(invoice) ?
GNC_INVOICE_EMPL_CREDIT_NOTE :
GNC_INVOICE_EMPL_INVOICE);
GNC_INVOICE_EMPL_CREDIT_NOTE :
GNC_INVOICE_EMPL_INVOICE);
default:
PWARN ("No invoice types defined for owner %d",
gncInvoiceGetOwnerType (invoice));
gncInvoiceGetOwnerType (invoice));
return GNC_INVOICE_UNDEFINED;
}
}

View File

@ -752,8 +752,8 @@ gncOwnerAssignPaymentTxn(const GncOwner *owner, Transaction *txn,
*/
open_lot_fifo = xaccAccountFindOpenLots (posted_account, gnc_lot_match_invoice_owner,
(gpointer)owner,
(GCompareFunc)gnc_lot_sort_func);
(gpointer)owner,
(GCompareFunc)gnc_lot_sort_func);
/* Check if an invoice was passed in. */
if (invoice)
@ -808,7 +808,7 @@ gncOwnerAssignPaymentTxn(const GncOwner *owner, Transaction *txn,
* If they are of the same sign, we may reserve it as the pre-payment lot for later
*/
if ( (gnc_numeric_negative_p (balance) && gnc_numeric_negative_p (payment_value)) ||
(gnc_numeric_positive_p (balance) && gnc_numeric_positive_p (payment_value)) )
(gnc_numeric_positive_p (balance) && gnc_numeric_positive_p (payment_value)) )
{
if (prepay_lot)
{

View File

@ -134,6 +134,6 @@ int
main (int argc, char **argv)
{
g_setenv ("GNC_UNINSTALLED", "1", TRUE);
// scm_boot_guile (argc, argv, main_helper, NULL);
// scm_boot_guile (argc, argv, main_helper, NULL);
return get_rv();
}

View File

@ -60,7 +60,7 @@ static void test_class (void)
test_add_error (&check1);
test_add_error (&check2);
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_list_handler, NULL);
(GLogFunc)test_list_handler, NULL);
qof_class_register (TEST_MODULE_NAME, (QofSortFunc)test_sort, params);

View File

@ -15,7 +15,7 @@ guile_main(void *closure, int argc, char ** argv)
guint loglevel = G_LOG_LEVEL_WARNING;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
g_test_message(" test-agedver.c: asking for an old but supported interface ...");
gnc_module_system_init();

View File

@ -21,7 +21,7 @@ guile_main(void *closure, int argc, char ** argv)
guint loglevel = G_LOG_LEVEL_WARNING;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
g_test_message(" test-dynload.c: testing dynamic linking of libgnc-module ...");
gmodule = g_module_open("libgnc-module", 0);

View File

@ -19,7 +19,7 @@ guile_main(void *closure, int argc, char ** argv)
test_add_error (&check1);
test_add_error (&check2);
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_list_handler, NULL);
(GLogFunc)test_list_handler, NULL);
g_test_message(" test-incompatdep.c: loading a module with bad deps ...\n");

View File

@ -15,7 +15,7 @@ guile_main(void *closure, int argc, char ** argv)
guint loglevel = G_LOG_LEVEL_WARNING;
TestErrorStruct check = { loglevel, logdomain, msg };
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
g_test_message(" test-load-c.c: testing module load/unload from C ... ");

View File

@ -19,7 +19,7 @@ guile_main(void *closure, int argc, char ** argv)
test_add_error (&check1);
test_add_error (&check2);
g_log_set_handler (logdomain, loglevel,
(GLogFunc)test_list_handler, NULL);
(GLogFunc)test_list_handler, NULL);
g_test_message(" test-modsysver.c: checking for a module we shouldn't find ...\n");

View File

@ -68,7 +68,7 @@ typedef void (*GNCSearchSelectedCB) (gpointer selected_object,
* returns.
*/
typedef void (*GNCSearchMultiSelectedCB) (GList *list_of_selected_objects,
gpointer user_data);
gpointer user_data);
typedef struct
{

View File

@ -78,7 +78,7 @@ typedef struct
GtkWidget *install_text;
GtkWidget *finish_page;
}gconf_data;
} gconf_data;
/********************
@ -220,7 +220,7 @@ assistant_gconf_install_keys (GError **error)
/** This function is called before the Update page is presented to the
* user. It gets the active button from the Method page and uses this
* to either add the path strings or jump to the install page.
* to either add the path strings or jump to the install page.
*/
void
assistant_gconf_update_prep (GtkAssistant *assistant, gpointer user_data)
@ -338,7 +338,7 @@ assistant_gconf_install_prep (GtkAssistant *assistant, gpointer user_data)
********************/
/** This function is called before the finish page is presented to the
* user. It populates the page with text based on previous page options
* user. It populates the page with text based on previous page options
* taken.
*/
void
@ -477,7 +477,7 @@ assistant_gconf_finish (GtkAssistant *assistant, gpointer user_data)
************************************/
void
assistant_gconf_prepare (GtkAssistant *assistant, GtkWidget *page,
gconf_data *data)
gconf_data *data)
{
gint currentpage = gtk_assistant_get_current_page(assistant);
@ -490,11 +490,11 @@ assistant_gconf_prepare (GtkAssistant *assistant, GtkWidget *page,
case 3:
/* Current page is a step page */
assistant_gconf_step_prep(assistant, data);
break;
break;
case 4:
/* Current page is install page */
assistant_gconf_install_prep(assistant, data);
break;
break;
case 5:
/* Current page is finish page */
assistant_gconf_finish_prep(assistant, data);
@ -508,7 +508,7 @@ assistant_gconf_prepare (GtkAssistant *assistant, GtkWidget *page,
*/
void
assistant_gconf_cancel (GtkAssistant *gtkassistant,
gpointer user_data)
gpointer user_data)
{
gconf_data *data = user_data;
gtk_widget_destroy(GTK_WIDGET(data->dialog));

View File

@ -133,17 +133,17 @@ gnc_ui_file_access_response_cb(GtkDialog *dialog, gint response, GtkDialog *unus
return;
}
if ( g_file_test( g_filename_from_uri( url, NULL, NULL ),
G_FILE_TEST_IS_DIR ))
{
gtk_file_chooser_set_current_folder_uri( faw->fileChooser, url );
return;
}
if ( g_file_test( g_filename_from_uri( url, NULL, NULL ),
G_FILE_TEST_IS_DIR ))
{
gtk_file_chooser_set_current_folder_uri( faw->fileChooser, url );
return;
}
if ( faw->type == FILE_ACCESS_OPEN )
{
gboolean open_readonly = faw->readonly_checkbutton
? gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(faw->readonly_checkbutton))
: FALSE;
? gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(faw->readonly_checkbutton))
: FALSE;
gnc_file_open_file( url, open_readonly );
}
else if ( faw->type == FILE_ACCESS_SAVE_AS )
@ -329,7 +329,7 @@ gnc_ui_file_access( int type )
file_chooser = GTK_WIDGET(gtk_builder_get_object (builder, "file_chooser" ));
fileChooser = GTK_FILE_CHOOSER_WIDGET(gtk_file_chooser_widget_new( fileChooserAction ));
faw->fileChooser = GTK_FILE_CHOOSER(fileChooser);
gtk_box_pack_start( GTK_BOX(file_chooser), GTK_WIDGET(fileChooser),TRUE, TRUE, 6 );
gtk_box_pack_start( GTK_BOX(file_chooser), GTK_WIDGET(fileChooser), TRUE, TRUE, 6 );
/* Set the default directory */
if (type == FILE_ACCESS_OPEN || type == FILE_ACCESS_SAVE_AS)

View File

@ -108,9 +108,9 @@ typedef enum
enum page_tree
{
PAGE_INDEX = 0,
PAGE_NAME,
NUM_COLUMNS
PAGE_INDEX = 0,
PAGE_NAME,
NUM_COLUMNS
};
static GNCOptionWinCallback global_help_cb = NULL;
@ -120,7 +120,7 @@ void gnc_options_dialog_response_cb(GtkDialog *dialog, gint response,
GNCOptionWin *window);
static void gnc_options_dialog_reset_cb(GtkWidget * w, gpointer data);
void gnc_options_dialog_list_select_cb (GtkTreeSelection *selection,
gpointer data);
gpointer data);
GtkWidget *
gnc_option_get_gtk_widget (GNCOption *option)
@ -1228,7 +1228,7 @@ gnc_options_dialog_append_page(GNCOptionWin * propertybox,
/* The reset button on each option page */
reset_button = gtk_button_new_with_label (_("Reset defaults"));
gtk_widget_set_tooltip_text(reset_button,
_("Reset all values to their defaults."));
_("Reset all values to their defaults."));
g_signal_connect(G_OBJECT(reset_button), "clicked",
G_CALLBACK(gnc_options_dialog_reset_cb), propertybox);
@ -1262,13 +1262,13 @@ gnc_options_dialog_append_page(GNCOptionWin * propertybox,
gtk_notebook_set_show_border(GTK_NOTEBOOK(propertybox->notebook), FALSE);
}
else
gtk_widget_hide(propertybox->page_list);
gtk_widget_hide(propertybox->page_list);
/* Tweak "advanced" pages for later handling. */
if (advanced)
{
notebook_page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(propertybox->notebook),
page_count);
page_count);
g_object_set_data(G_OBJECT(notebook_page), "listitem", listitem);
g_object_set_data(G_OBJECT(notebook_page), "advanced",
@ -1350,7 +1350,7 @@ gnc_options_dialog_build_contents(GNCOptionWin *propertybox,
GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(propertybox->page_list_view));
GtkTreeIter iter;
GtkTreeModel *model;
model = gtk_tree_view_get_model(GTK_TREE_VIEW(propertybox->page_list_view));
gtk_tree_model_iter_nth_child(model, &iter, NULL, default_page);
gtk_tree_selection_select_iter (selection, &iter);
@ -1433,7 +1433,7 @@ gnc_options_dialog_reset_cb(GtkWidget * w, gpointer data)
void
gnc_options_dialog_list_select_cb (GtkTreeSelection *selection,
gpointer data)
gpointer data)
{
GNCOptionWin * win = data;
GtkTreeModel *list;
@ -1523,7 +1523,7 @@ gnc_options_dialog_new(gchar *title)
"text", PAGE_NAME, NULL);
gtk_tree_view_append_column(view, column);
gtk_tree_view_column_set_alignment(column,0.5);
gtk_tree_view_column_set_alignment(column, 0.5);
selection = gtk_tree_view_get_selection(view);
gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
@ -1800,7 +1800,7 @@ gnc_option_set_ui_widget_commodity (GNCOption *option, GtkBox *page_box,
if (documentation != NULL)
gtk_widget_set_tooltip_text(GNC_GENERAL_SELECT(value)->entry,
documentation);
documentation);
g_signal_connect(G_OBJECT(GNC_GENERAL_SELECT(value)->entry), "changed",
G_CALLBACK(gnc_option_changed_widget_cb), option);

View File

@ -38,7 +38,7 @@
done by providing the name of a glade file and the content to
load from that file along with a widget in that file. If a
partial page is added, the widget name provided must be that of
a GtkTable containing four columns. If a full page is added,
a GtkTable containing four columns. If a full page is added,
the widget name provided to this code can be any kind of
widget, but for consistence it should probably be the same.
@ -332,7 +332,7 @@ gnc_prefs_build_widget_table (GtkBuilder *builder,
GtkWidget *dialog)
{
GHashTable *table;
GSList *interesting, *runner;
GSList *interesting, *runner;
const gchar *name;
const gchar *wname;
GtkWidget *widget;
@ -340,7 +340,7 @@ gnc_prefs_build_widget_table (GtkBuilder *builder,
table = g_object_get_data(G_OBJECT(dialog), WIDGET_HASH);
interesting = gtk_builder_get_objects(builder);
for (runner = interesting; runner; runner = g_slist_next(runner))
{
widget = runner->data;
@ -349,7 +349,7 @@ gnc_prefs_build_widget_table (GtkBuilder *builder,
wname = gtk_widget_get_name(widget);
name = gtk_buildable_get_name(GTK_BUILDABLE(widget));
DEBUG("Widget type is %s and buildable get name is %s", wname, name);
if(g_str_has_prefix (name,"gconf"))
if (g_str_has_prefix (name, "gconf"))
g_hash_table_insert(table, (gchar *)name, widget);
}
}
@ -482,12 +482,12 @@ gnc_preferences_build_page (gpointer data,
builder = gtk_builder_new();
/* Adjustments etc... must come before dialog information */
widgetname = g_strsplit(add_in->widgetname,",",-1);
widgetname = g_strsplit(add_in->widgetname, ",", -1);
for(i=0; widgetname[i]; i++)
for (i = 0; widgetname[i]; i++)
{
DEBUG("Opening %s to get content %s", add_in->filename, widgetname[i]);
gnc_builder_add_from_file (builder, add_in->filename, widgetname[i]);
DEBUG("Opening %s to get content %s", add_in->filename, widgetname[i]);
gnc_builder_add_from_file (builder, add_in->filename, widgetname[i]);
}
DEBUG("Widget Content is %s", widgetname[i - 1]);
@ -1513,7 +1513,7 @@ gnc_prefs_connect_one (const gchar *name,
/** Create the preferences dialog. This function first reads the
* dialog-preferences.glade file to obtain the content and then
* dialog-preferences.glade file to obtain the content and then
* the dialog is created with a set of common preferences. It then
* runs the list of add-ins, calling a helper function to add each full/partial
* page to this dialog, Finally it builds the "interesting widgets"
@ -1539,14 +1539,14 @@ gnc_preferences_dialog_create(void)
DEBUG("Opening dialog-preferences.glade:");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "auto_decimal_places_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "autosave_interval_minutes_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "date_backmonth_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "max_transactions_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "new_search_limit_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "retain_days_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "tab_width_adj");
gnc_builder_add_from_file (builder,"dialog-preferences.glade", "GnuCash Preferences");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "auto_decimal_places_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "autosave_interval_minutes_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_backmonth_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "max_transactions_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "new_search_limit_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "retain_days_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "tab_width_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "GnuCash Preferences");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "GnuCash Preferences"));
DEBUG("autoconnect");
@ -1800,7 +1800,7 @@ gnc_preferences_gconf_changed (GConfClient *client,
{
DEBUG("widget %p - period_select", widget_child);
gnc_prefs_period_select_gconf_cb(GNC_PERIOD_SELECT(widget_child),
gconf_value_get_int(entry->value));
gconf_value_get_int(entry->value));
}
else if (GNC_IS_DATE_EDIT(widget_child))
{

View File

@ -217,8 +217,8 @@ gnc_dialog_query_list_new (GList *param_list, Query *q)
/* register ourselves */
dql->component_id = gnc_register_gui_component ("GNC Dialog Query List",
gnc_dialog_query_list_refresh_handler,
close_handler, dql);
gnc_dialog_query_list_refresh_handler,
close_handler, dql);
/* Build the book list */
dql_build_booklist (dql, q);

View File

@ -51,21 +51,21 @@ typedef struct
GtkWidget *buttonbox;
GtkWidget *nolabel;
GtkWidget *applybutton;
}RWDialog;
} RWDialog;
void gnc_reset_warnings_select_all_cb (GtkButton *button, gpointer user_data);
void gnc_reset_warnings_unselect_all_cb (GtkButton *button, gpointer user_data);
void gnc_reset_warnings_response_cb (GtkDialog *dialog, gint response, gpointer user_data);
static GSList *gnc_reset_warnings_add_section (RWDialog *rw_dialog,
const gchar *section, GtkWidget *box);
static GSList *gnc_reset_warnings_add_section (RWDialog *rw_dialog,
const gchar *section, GtkWidget *box);
static void gnc_reset_warnings_release_entries (GSList *entries);
static void gnc_reset_warnings_update_widgets (RWDialog *rw_dialog);
static void gnc_reset_warnings_gconf_changed (GConfClient *client, guint cnxn_id,
GConfEntry *entry, gpointer user_data);
GConfEntry *entry, gpointer user_data);
/****************************************************
* Update the Dialog Widgets
* Update the Dialog Widgets
* @internal
* @param rw_dialog structure.
****************************************************/
@ -396,7 +396,7 @@ gnc_reset_warnings_gconf_changed (GConfClient *client,
GConfEntry *entry,
gpointer user_data)
{
RWDialog *rw_dialog = g_object_get_data(G_OBJECT(user_data),"dialog-structure");
RWDialog *rw_dialog = g_object_get_data(G_OBJECT(user_data), "dialog-structure");
GtkWidget *box;
GList *list;
@ -545,7 +545,7 @@ gnc_reset_warnings_dialog (GtkWindow *parent)
gnc_reset_warnings_update_widgets(rw_dialog);
/* Record the pointer to the rw data structure and claen up after */
g_object_set_data_full(G_OBJECT(rw_dialog->dialog),"dialog-structure",rw_dialog, g_free);
g_object_set_data_full(G_OBJECT(rw_dialog->dialog), "dialog-structure", rw_dialog, g_free);
gnc_gconf_add_notification(G_OBJECT(rw_dialog->dialog), GCONF_WARNINGS,
gnc_reset_warnings_gconf_changed,

View File

@ -59,7 +59,7 @@ typedef struct
GtkWidget *dialog;
GtkTextView *textview;
GtkWidget *showcheck_button;
}TotdDialog;
} TotdDialog;
/***********************************************************************
@ -68,7 +68,7 @@ typedef struct
* the number in the GConf database, and updating the dialog window
* with the text of the newly selected tip.
*
* @param Tip of the day structure. This points to the dialog and
* @param Tip of the day structure. This points to the dialog and
* the GtkTextView widget that holds the text of the tip.
*
* @param offset Which tip to show. If the value is zero then the
@ -127,8 +127,8 @@ gnc_new_tip_number (TotdDialog *totd_dialog, gint offset)
/* Dialog Callbacks */
/***************************/
void gnc_totd_dialog_response_cb (GtkDialog *dialog,
gint response,
gpointer user_data)
gint response,
gpointer user_data)
{
TotdDialog *totd_dialog = user_data;
@ -158,7 +158,7 @@ void gnc_totd_dialog_response_cb (GtkDialog *dialog,
void
gnc_totd_dialog_startup_toggled_cb (GtkToggleButton *button,
gpointer user_data)
gpointer user_data)
{
gboolean active;
@ -329,7 +329,7 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup)
}
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-totd.glade", "totd_dialog");
gnc_builder_add_from_file (builder, "dialog-totd.glade", "totd_dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "totd_dialog"));
gtk_window_set_transient_for(GTK_WINDOW (dialog), parent);

View File

@ -477,7 +477,7 @@ gnc_xfer_dialog_to_tree_selection_changed_cb (GtkTreeSelection *selection, gpoin
gboolean
gnc_xfer_dialog_inc_exp_filter_func (Account *account,
gpointer data)
gpointer data)
{
AccountTreeFilterInfo* info;
GNCAccountType type;

View File

@ -611,18 +611,18 @@ gnc_file_query_save (gboolean can_cancel)
static void features_test(const gchar *key, KvpValue *value, gpointer data)
{
GList** unknown_features = (GList**) data;
char* feature_desc;
GList** unknown_features = (GList**) data;
char* feature_desc;
g_assert(data);
g_assert(data);
/* XXX: test if 'key' is an unknown feature. */
/* XXX: test if 'key' is an unknown feature. */
/* Yes, it is unknown, so add the description to the list: */
feature_desc = kvp_value_get_string(value);
g_assert(feature_desc);
/* Yes, it is unknown, so add the description to the list: */
feature_desc = kvp_value_get_string(value);
g_assert(feature_desc);
*unknown_features = g_list_prepend(*unknown_features, feature_desc);
*unknown_features = g_list_prepend(*unknown_features, feature_desc);
}
/*
@ -644,34 +644,34 @@ static gboolean test_unknown_features(QofSession* new_session)
if (value)
{
GList* features_list = NULL;
frame = kvp_value_get_frame(value);
g_assert(frame);
frame = kvp_value_get_frame(value);
g_assert(frame);
/* Iterate over the members of this frame for unknown features */
kvp_frame_for_each_slot(frame, &features_test, &features_list);
if (features_list)
{
/* Iterate over the members of this frame for unknown features */
kvp_frame_for_each_slot(frame, &features_test, &features_list);
if (features_list)
{
GList *i;
char* msg = g_strdup(
_("This Dataset contains features not supported by this "
"version of GnuCash. You must use a newer version of "
"GnuCash in order to support the following features:"
));
_("This Dataset contains features not supported by this "
"version of GnuCash. You must use a newer version of "
"GnuCash in order to support the following features:"
));
for (i = features_list; i; i=i->next)
for (i = features_list; i; i = i->next)
{
char *tmp = g_strconcat(msg, "\n* ", _(i->data), NULL);
g_free (msg);
msg = tmp;
}
// XXX: should pull out the file name here */
gnc_error_dialog(gnc_ui_get_toplevel(), msg, "");
g_free(msg);
g_list_free(features_list);
// XXX: should pull out the file name here */
gnc_error_dialog(gnc_ui_get_toplevel(), msg, "");
g_free(msg);
g_list_free(features_list);
return TRUE;
}
}
}
return FALSE;
@ -773,20 +773,20 @@ RESTART:
if (ERR_BACKEND_BAD_URL == io_err)
{
gchar *directory;
show_session_error (io_err, newfile, GNC_FILE_DIALOG_OPEN);
io_err = ERR_BACKEND_NO_ERR;
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
directory = g_strdup (filename);
else
directory = gnc_get_default_directory (GCONF_DIR_OPEN_SAVE);
gchar *directory;
show_session_error (io_err, newfile, GNC_FILE_DIALOG_OPEN);
io_err = ERR_BACKEND_NO_ERR;
if (g_file_test (filename, G_FILE_TEST_IS_DIR))
directory = g_strdup (filename);
else
directory = gnc_get_default_directory (GCONF_DIR_OPEN_SAVE);
filename = gnc_file_dialog (NULL, NULL, directory,
GNC_FILE_DIALOG_OPEN);
qof_session_destroy (new_session);
new_session = NULL;
g_free (directory);
goto RESTART;
filename = gnc_file_dialog (NULL, NULL, directory,
GNC_FILE_DIALOG_OPEN);
qof_session_destroy (new_session);
new_session = NULL;
g_free (directory);
goto RESTART;
}
/* if file appears to be locked, ask the user ... */
else if (ERR_BACKEND_LOCKED == io_err || ERR_BACKEND_READONLY == io_err)
@ -973,9 +973,9 @@ RESTART:
GNC_FILE_DIALOG_OPEN);
}
/* test for unknown features. */
if (!uh_oh)
{
/* test for unknown features. */
if (!uh_oh)
{
uh_oh = test_unknown_features(new_session);
}
}
@ -1291,9 +1291,9 @@ gnc_file_save (void)
if (qof_book_is_readonly(qof_session_get_book(session)))
{
gint response = gnc_ok_cancel_dialog(gnc_ui_get_toplevel(),
GTK_RESPONSE_CANCEL,
_("The database was opened read-only. "
"Do you want to save it to a different place?"));
GTK_RESPONSE_CANCEL,
_("The database was opened read-only. "
"Do you want to save it to a different place?"));
if (response == GTK_RESPONSE_OK)
{
gnc_file_save_as ();

View File

@ -50,13 +50,13 @@ struct _GNCQueryListPriv
struct _OriginalGtkCListPointers
{
void (*original_select_row) (GtkCList *clist,
gint row,
gint column,
GdkEvent *event);
gint row,
gint column,
GdkEvent *event);
void (*original_unselect_row) (GtkCList *clist,
gint row,
gint column,
GdkEvent *event);
gint row,
gint column,
GdkEvent *event);
};
#define GNC_QUERY_LIST_GET_PRIVATE(o) \

View File

@ -201,7 +201,7 @@ gnc_commodity * gnc_tree_view_commodity_get_cursor_commodity (GncTreeViewCommodi
*
* @return The selected commodity, or NULL if no commodity was selected.
*/
gnc_commodity * gnc_tree_view_commodity_get_selected_commodity (GncTreeViewCommodity *view);
gnc_commodity * gnc_tree_view_commodity_get_selected_commodity (GncTreeViewCommodity *view);
/** This function selects all sub-commodities of an commodity in the
* commodity tree view. All other commodities will be unselected.

View File

@ -1678,7 +1678,7 @@ sxed_excal_update_adapt_cb(GtkObject *o, gpointer ud)
void
on_sx_check_toggled_cb (GtkWidget *togglebutton,
gpointer user_data)
gpointer user_data)
{
GtkWidget *widget_create, *widget_notify;
gboolean active; // , notify;
@ -1693,7 +1693,7 @@ on_sx_check_toggled_cb (GtkWidget *togglebutton,
widget_notify = g_hash_table_lookup(table, "gconf/dialogs/scheduled_trans/transaction_editor/notify");
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget_create));
if(active)
if (active)
gtk_widget_set_sensitive(widget_notify, TRUE);
else
gtk_widget_set_sensitive(widget_notify, FALSE);

View File

@ -1268,7 +1268,7 @@ tax_related_toggled_cb (GtkToggleButton *togglebutton,
gtk_widget_set_sensitive (hbox, on);
if(on == FALSE)
if (on == FALSE)
gtk_widget_hide (ti_dialog->txf_help_text); /* textview doesn't go insensitive!? */
else
gtk_widget_show (ti_dialog->txf_help_text);
@ -1305,8 +1305,8 @@ gnc_tax_info_dialog_create (GtkWidget * parent, TaxInfoDialog *ti_dialog)
GtkWidget *label;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-tax-info.glade", "copy_spin_adj");
gnc_builder_add_from_file (builder,"dialog-tax-info.glade", "Tax Information Dialog");
gnc_builder_add_from_file (builder, "dialog-tax-info.glade", "copy_spin_adj");
gnc_builder_add_from_file (builder, "dialog-tax-info.glade", "Tax Information Dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Tax Information Dialog"));
ti_dialog->dialog = dialog;

View File

@ -925,53 +925,53 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
/* Set the sort order for the split register and status of save order button */
priv->sd.save_order = FALSE;
order = gnc_plugin_page_register_get_sort_order(plugin_page);
PINFO("Loaded Sort order is %s", order);
gnc_split_reg_set_sort_type(priv->gsr, SortTypefromString(order));
if (order && (g_strcmp0 (order, DEFAULT_SORT_ORDER) != 0))
priv->sd.save_order = TRUE;
priv->sd.original_save_order = priv->sd.save_order;
g_free(order);
/* Set the filter for the split register and status of save filter button */
priv->fd.save_filter = FALSE;
filter = g_strsplit(gnc_plugin_page_register_get_filter(plugin_page),",",-1);
filter = g_strsplit(gnc_plugin_page_register_get_filter(plugin_page), ",", -1);
PINFO("Loaded Filter Status is %s", filter[0]);
priv->fd.cleared_match = (gint)g_ascii_strtoll( filter[0], NULL, 16 );
if (filter[0] && (g_strcmp0 (filter[0], DEFAULT_FILTER) != 0))
filter_changed = filter_changed + 1;
if (filter[1] && (g_strcmp0 (filter[1],"0") != 0 ))
if (filter[1] && (g_strcmp0 (filter[1], "0") != 0 ))
{
PINFO("Loaded Filter Start Date is %s", filter[1]);
priv->fd.start_time = gnc_plugin_page_register_filter_dmy2time( filter[1] );
priv->fd.start_time = gnc_timet_get_day_start(priv->fd.start_time);
filter_changed = filter_changed + 1;
if (filter[2] && (g_strcmp0 (filter[2],"0") != 0 ))
if (filter[2] && (g_strcmp0 (filter[2], "0") != 0 ))
{
PINFO("Loaded Filter End Date is %s", filter[2]);
priv->fd.end_time = gnc_plugin_page_register_filter_dmy2time( filter[2] );
priv->fd.end_time = gnc_timet_get_day_end(priv->fd.end_time);
filter_changed = filter_changed + 1;
}
}
if(filter_changed != 0)
if (filter_changed != 0)
priv->fd.save_filter = TRUE;
priv->fd.original_save_filter = priv->fd.save_filter;
g_strfreev(filter);
/* Update Query with Filter Status and Dates */
gnc_ppr_update_status_query (page);
gnc_ppr_update_date_query(page);
@ -1504,12 +1504,12 @@ gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *fi
if (leader != NULL)
{
default_filter = g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
if (!filter || (g_strcmp0 (filter, default_filter) == 0))
xaccAccountSetFilter (leader, NULL);
else
xaccAccountSetFilter (leader, filter);
g_free (default_filter);
}
@ -1555,7 +1555,7 @@ gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar
reg = gnc_ledger_display_get_split_register (ld);
ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
if (leader != NULL)
{
if (!sort_order || (g_strcmp0 (sort_order, DEFAULT_SORT_ORDER) == 0))
@ -1670,18 +1670,18 @@ gnc_plugin_page_register_sort_response_cb (GtkDialog *dialog,
{
/* Restore the original sort order */
gnc_split_reg_set_sort_type(priv->gsr, priv->sd.original_sort_type);
priv->sd.save_order = priv->sd.original_save_order;
priv->sd.save_order = priv->sd.original_save_order;
}
else
{
priv->sd.original_save_order = priv->sd.save_order;
if(priv->sd.save_order)
{
if (priv->sd.save_order)
{
type = gnc_split_reg_get_sort_type(priv->gsr);
order = SortTypeasString(type);
gnc_plugin_page_register_set_sort_order (plugin_page, order);
}
}
}
priv->sd.dialog = NULL;
gtk_widget_destroy(GTK_WIDGET(dialog));
@ -1861,7 +1861,7 @@ gnc_plugin_page_register_filter_time2dmy ( time_t raw_time)
gint i;
timeinfo = localtime ( &raw_time );
i= strftime(date_string,11,"%d-%m-%Y", timeinfo );
i = strftime(date_string, 11, "%d-%m-%Y", timeinfo );
PINFO("Date string is %s", date_string);
return g_strdup(date_string);
@ -1873,7 +1873,7 @@ static time_t
gnc_plugin_page_register_filter_dmy2time ( char *date_string)
{
struct tm *when;
gint yy=0, mm=0, dd=0;
gint yy = 0, mm = 0, dd = 0;
time_t raw_time;
@ -1885,7 +1885,7 @@ gnc_plugin_page_register_filter_dmy2time ( char *date_string)
when = localtime ( &raw_time );
when->tm_year = yy - 1900;
when->tm_mon = mm -1 ;
when->tm_mon = mm - 1 ;
when->tm_mday = dd;
return mktime(when);
@ -2256,15 +2256,15 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
gnc_ppr_update_status_query(page);
priv->fd.start_time = priv->fd.original_start_time;
priv->fd.end_time = priv->fd.original_end_time;
priv->fd.save_filter = priv->fd.original_save_filter;
priv->fd.save_filter = priv->fd.original_save_filter;
gnc_ppr_update_date_query(page);
}
else
{
priv->fd.original_save_filter = priv->fd.save_filter;
if(priv->fd.save_filter)
{
if (priv->fd.save_filter)
{
gchar* filter;
filter = g_strdup_printf("0x%04x", priv->fd.cleared_match);
@ -2286,11 +2286,11 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
else
filter = g_strconcat ( filter, ",0", NULL);
PINFO("The filter to save is %s",filter);
PINFO("The filter to save is %s", filter);
gnc_plugin_page_register_set_filter (plugin_page, filter);
g_free (filter);
}
}
}
priv->fd.dialog = NULL;
gtk_widget_destroy(GTK_WIDGET(dialog));
@ -2697,7 +2697,7 @@ gnc_plugin_page_register_cmd_void_transaction (GtkAction *action,
return;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder ,"gnc-plugin-page-register.glade", "Void Transaction");
gnc_builder_add_from_file (builder , "gnc-plugin-page-register.glade", "Void Transaction");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Void Transaction"));
entry = GTK_WIDGET(gtk_builder_get_object (builder, "reason"));
@ -2854,7 +2854,7 @@ gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
priv->sd.original_sort_type = sort;
button = GTK_WIDGET(gtk_builder_get_object (builder, "sort_save"));
if(priv->sd.save_order == TRUE)
if (priv->sd.save_order == TRUE)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
/* Wire it up */
@ -2909,13 +2909,13 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
{
toggle = GTK_WIDGET(gtk_builder_get_object (builder, status_actions[i].action_name));
value = priv->fd.cleared_match & status_actions[i].value;
status_actions[i].widget = toggle;
status_actions[i].widget = toggle;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), value);
}
priv->fd.original_cleared_match = priv->fd.cleared_match;
button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_save"));
if(priv->fd.save_filter == TRUE)
if (priv->fd.save_filter == TRUE)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);

View File

@ -413,9 +413,9 @@ gnc_html_graph_gog_create_linechart( GncHtmlLineChartInfo* info )
style->fill.type = GO_STYLE_FILL_PATTERN;
if ( gdk_color_parse( info->col_colors[i], &color ) )
{
style->line.width = info->line_width;
style->line.auto_color = FALSE;
style->line.color = GO_COLOR_FROM_GDK(color);
style->line.width = info->line_width;
style->line.auto_color = FALSE;
style->line.color = GO_COLOR_FROM_GDK(color);
}
else
{
@ -437,7 +437,7 @@ gnc_html_graph_gog_create_linechart( GncHtmlLineChartInfo* info )
GogObject *object;
object = gog_object_get_child_by_role( chart,
gog_object_find_role_by_name( chart, "Y-Axis" ) );
gog_object_find_role_by_name( chart, "Y-Axis" ) );
if ( info->major_grid )
{
gog_object_add_by_name( GOG_OBJECT(object), "MajorGrid", NULL );

View File

@ -412,16 +412,16 @@ qof_session_begin (QofSession *session, const char * book_id,
}
scheme = g_uri_parse_scheme (book_id);
if (g_strcmp0 (scheme, "file") == 0)
filename = g_filename_from_uri (book_id, NULL, NULL);
filename = g_filename_from_uri (book_id, NULL, NULL);
else if (!scheme)
filename = g_strdup (book_id);
filename = g_strdup (book_id);
if (filename && g_file_test (filename, G_FILE_TEST_IS_DIR))
{
if (ERR_BACKEND_NO_ERR == qof_session_get_error(session))
qof_session_push_error (session, ERR_BACKEND_BAD_URL, NULL);
g_free (filename);
g_free (scheme);
g_free (filename);
g_free (scheme);
LEAVE("Can't open a directory");
return;
}

View File

@ -562,7 +562,7 @@ test_book_foreach_collection( Fixture *fixture, gconstpointer pData )
test_add_error (&check1);
test_add_error (&check2);
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_list_handler, NULL);
(GLogFunc)test_list_handler, NULL);
g_test_message( "Testing when book is null" );
m_col = qof_book_get_collection( fixture->book, my_type );

View File

@ -157,7 +157,7 @@ test_instance_new_destroy( void )
/* set fatal handler */
g_test_log_set_fatal_handler ( ( GTestLogFatalFunc )fatal_handler, NULL );
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
g_assert( qof_instance_get_collection( inst ) == NULL );
g_assert( g_strrstr( error_message, "assertion `QOF_IS_INSTANCE(ptr)' failed" ) != NULL );
g_free( error_message );
@ -517,7 +517,7 @@ test_instance_commit_edit( Fixture *fixture, gconstpointer pData )
g_test_message( "Test when instance's editlevel < 0" );
g_test_log_set_fatal_handler ( ( GTestLogFatalFunc )fatal_handler, NULL );
hdlr = g_log_set_handler (log_domain, loglevel,
(GLogFunc)test_checked_handler, &check);
(GLogFunc)test_checked_handler, &check);
qof_instance_decrease_editlevel( fixture->inst );
g_assert_cmpint( qof_instance_get_editlevel( fixture->inst ), == , -1 );
result = qof_commit_edit( fixture->inst );

View File

@ -1609,7 +1609,7 @@ static GncInvoice *lookup_invoice(GncPluginPageReportPrivate *priv)
{
g_assert(priv);
return gnc_option_db_lookup_invoice_option(priv->cur_odb, "General",
"Invoice Number", NULL);
"Invoice Number", NULL);
}
#define GCONF_GENERAL_REPORT_PDFEXPORT GCONF_GENERAL_REPORT "/pdf_export"
@ -1629,7 +1629,7 @@ static gchar *report_create_jobname(GncPluginPageReportPrivate *priv)
QofDateFormat date_format_here;
QofDateFormat date_format_old = qof_date_format_get();
char *format_code = gnc_gconf_get_string(GCONF_GENERAL_REPORT_PDFEXPORT,
"filename_date_format", NULL);
"filename_date_format", NULL);
if (format_code == NULL)
{
@ -1829,7 +1829,7 @@ gnc_plugin_page_report_exportpdf_cb( GtkAction *action, GncPluginPageReport *rep
if (print_settings && gtk_print_settings_has_key(print_settings, GNC_GTK_PRINT_SETTINGS_EXPORT_DIR))
{
const char* dirname = gtk_print_settings_get(print_settings,
GNC_GTK_PRINT_SETTINGS_EXPORT_DIR);
GNC_GTK_PRINT_SETTINGS_EXPORT_DIR);
// Only store the directory if it exists.
if (g_file_test(dirname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
{

View File

@ -221,7 +221,7 @@ gnc_get_default_report_font_family(void)
g_list_free(top_list);
top_widget_style = gtk_rc_get_style(top_widget);
default_font_family =
pango_font_description_get_family(top_widget_style->font_desc);
pango_font_description_get_family(top_widget_style->font_desc);
if (default_font_family == NULL)
return g_strdup("Arial");

View File

@ -360,7 +360,7 @@ get_random_string_in_array(const char* str_list[])
gboolean
test_null_handler (const char *log_domain, GLogLevelFlags log_level,
const gchar *msg, gpointer user_data )
const gchar *msg, gpointer user_data )
{
//Silent, remember?
return FALSE;
@ -370,24 +370,25 @@ static gchar*
test_log_level (GLogLevelFlags flags)
{
const gchar *message[] = {"RECURSIVE", "FATAL", "ERROR", "CRITICAL",
"WARNING","MESSAGE", "INFO", "DEBUG"};
"WARNING", "MESSAGE", "INFO", "DEBUG"
};
guint i = 0, last = 0, max_bit = 7;
gchar *msg = NULL;
for (i; i <= max_bit; i++)
if (flags & 1 << i)
{
gchar *tmp_msg = msg;
gchar *sep = (last < 2 ? " " : "|");
last = i;
msg = (tmp_msg ? g_strjoin (sep, tmp_msg, message[i], NULL)
: g_strdup (message[i]));
if (tmp_msg)
g_free (tmp_msg);
}
if (flags & 1 << i)
{
gchar *tmp_msg = msg;
gchar *sep = (last < 2 ? " " : "|");
last = i;
msg = (tmp_msg ? g_strjoin (sep, tmp_msg, message[i], NULL)
: g_strdup (message[i]));
if (tmp_msg)
g_free (tmp_msg);
}
if (msg == NULL)
msg = g_strdup ("");
msg = g_strdup ("");
return msg;
}
@ -408,41 +409,41 @@ test_clear_error_list (void)
gboolean
test_list_handler (const char *log_domain, GLogLevelFlags log_level,
const gchar *msg, gpointer user_data )
const gchar *msg, gpointer user_data )
{
GList *list = g_list_first (message_queue);
const guint fatal = G_LOG_FLAG_FATAL;
while (list)
{
TestErrorStruct *error = (TestErrorStruct*)list->data;
if (!g_strcmp0 (log_domain, error->log_domain)
&& ((log_level | fatal) == (error->log_level | fatal))
&& !g_strcmp0 (msg, error->msg))
return FALSE;
list = g_list_next (list);
TestErrorStruct *error = (TestErrorStruct*)list->data;
if (!g_strcmp0 (log_domain, error->log_domain)
&& ((log_level | fatal) == (error->log_level | fatal))
&& !g_strcmp0 (msg, error->msg))
return FALSE;
list = g_list_next (list);
}
/* No list or no matches, fall through */
/* No list or no matches, fall through */
return test_checked_handler (log_domain, log_level, msg, user_data);
}
gboolean
test_checked_handler (const char *log_domain, GLogLevelFlags log_level,
const gchar *msg, gpointer user_data )
const gchar *msg, gpointer user_data )
{
TestErrorStruct *tdata = (TestErrorStruct*)user_data;
if ((tdata == NULL)
|| (tdata->log_domain != NULL
&& g_strcmp0 (tdata->log_domain, log_domain))
|| (tdata->log_level && tdata->log_level != log_level)
|| (tdata->msg && g_strcmp0 (tdata->msg, msg)))
|| (tdata->log_domain != NULL
&& g_strcmp0 (tdata->log_domain, log_domain))
|| (tdata->log_level && tdata->log_level != log_level)
|| (tdata->msg && g_strcmp0 (tdata->msg, msg)))
{
gchar *level = test_log_level (log_level);
g_printf ( "<%s> (%s) %s\n", level, log_domain, msg);
g_free (level);
g_assert (log_level ^ G_LOG_FLAG_FATAL);
gchar *level = test_log_level (log_level);
g_printf ( "<%s> (%s) %s\n", level, log_domain, msg);
g_free (level);
g_assert (log_level ^ G_LOG_FLAG_FATAL);
return FALSE;
}
return FALSE;
@ -496,21 +497,21 @@ typedef struct
static void
mock_signal_handler (QofInstance *entity, QofEventId event_type,
gpointer handler_data, gpointer event_data)
gpointer handler_data, gpointer event_data)
{
_TestSignal *signal = (_TestSignal*)handler_data;
if ((signal->entity == entity || signal->entity == NULL)
&& signal->event_type == event_type)
&& signal->event_type == event_type)
{
if (signal->event_data)
g_assert (signal->event_data == event_data);
signal->hits += 1;
if (signal->event_data)
g_assert (signal->event_data == event_data);
signal->hits += 1;
}
}
TestSignal
test_signal_new (QofInstance *entity, QofEventId event_type,
gpointer event_data)
gpointer event_data)
{
_TestSignal *sig = g_slice_new (_TestSignal);
sig->entity = entity;
@ -533,5 +534,5 @@ void
test_signal_assert_hits (TestSignal sigp, guint hits)
{
_TestSignal *sig = (_TestSignal *)sigp;
g_assert_cmpint (sig->hits, ==, hits);
g_assert_cmpint (sig->hits, == , hits);
}

View File

@ -81,8 +81,8 @@ Otherwise, only failures are printed out.
/**
* Suppressing Expected Errors
*
* Functions for suppressing expected errors during tests. Pass
*
* Functions for suppressing expected errors during tests. Pass
*
* Note that you need to call both g_log_set_handler *and*
* g_test_log_set_fatal_handler to both avoid the assertion and
* suppress the error message. The callbacks work in either role, just
@ -111,13 +111,13 @@ typedef struct
* member matches anything.
*/
gboolean test_checked_handler (const char *log_domain, GLogLevelFlags log_level,
const gchar *msg, gpointer user_data);
const gchar *msg, gpointer user_data);
/**
* Just returns FALSE or suppresses the message regardless of what the
* error is. Use this only as a last resort.
*/
gboolean test_null_handler (const char *log_domain, GLogLevelFlags log_level,
const gchar *msg, gpointer user_data );
const gchar *msg, gpointer user_data );
/**
* Maintains an internal list of TestErrorStructs which are each
* checked by the list handler. If an error matches any entry on the
@ -138,8 +138,8 @@ void test_clear_error_list (void);
* you want test_checked_handler to immediately print the error).
*/
gboolean test_list_handler (const char *log_domain,
GLogLevelFlags log_level,
const gchar *msg, gpointer user_data );
GLogLevelFlags log_level,
const gchar *msg, gpointer user_data );
/**
* Call this from a mock object to indicate that the mock has in fact
* been called
@ -258,7 +258,7 @@ const char* get_random_string_in_array(const char* str_list[]);
*/
typedef gpointer TestSignal;
TestSignal test_signal_new (QofInstance *entity, QofEventId eventType,
gpointer event_data);
gpointer event_data);
/* test_signal_assert_hits calls g_assert_cmpuint with an ==
* operator. Use it in a test program to see if a TestSignal has been
* emitted the number of times you expect.