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@21430 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-10-17 19:07:41 +00:00
parent 4b6b6b90da
commit c8ec0537bc
17 changed files with 200 additions and 193 deletions

View File

@ -318,22 +318,22 @@ gnc_dbi_sqlite3_session_begin( QofBackend *qbe, QofSession *session,
}
dbi_test_result = conn_test_dbi_library( be->conn );
switch( dbi_test_result )
switch ( dbi_test_result )
{
case GNC_DBI_PASS:
break;
case GNC_DBI_PASS:
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"SQLite3: Failed to setup for large number test" );
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"SQLite3: Failed to setup for large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"SQLite3 DBI library fails large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"SQLite3 DBI library fails large number test" );
break;
}
if ( dbi_test_result != GNC_DBI_PASS )
{
@ -791,22 +791,22 @@ gnc_dbi_mysql_session_begin( QofBackend* qbe, QofSession *session,
if ( result == 0 )
{
dbi_test_result = conn_test_dbi_library( be->conn );
switch( dbi_test_result )
switch ( dbi_test_result )
{
case GNC_DBI_PASS:
break;
case GNC_DBI_PASS:
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"DBI library large number test incomplete" );
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"DBI library large number test incomplete" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"DBI library fails large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"DBI library fails large number test" );
break;
}
if ( GNC_DBI_PASS != dbi_test_result )
{
@ -879,22 +879,22 @@ gnc_dbi_mysql_session_begin( QofBackend* qbe, QofSession *session,
goto exit;
}
dbi_test_result = conn_test_dbi_library( be->conn );
switch( dbi_test_result )
switch ( dbi_test_result )
{
case GNC_DBI_PASS:
break;
case GNC_DBI_PASS:
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"MySql: Failed to setup for large number test" );
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"MySql: Failed to setup for large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"MySql DBI library fails large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"MySql DBI library fails large number test" );
break;
}
if ( dbi_test_result != GNC_DBI_PASS )
{
@ -1103,20 +1103,20 @@ gnc_dbi_postgres_session_begin( QofBackend *qbe, QofSession *session,
dbi_test_result = conn_test_dbi_library( be->conn );
switch ( dbi_test_result )
{
case GNC_DBI_PASS:
break;
case GNC_DBI_PASS:
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"Postgresql: Failed to setup for large number test" );
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"Postgresql: Failed to setup for large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"Postgresql DBI library fails large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"Postgresql DBI library fails large number test" );
break;
}
if ( dbi_test_result != GNC_DBI_PASS )
{
@ -1190,22 +1190,22 @@ gnc_dbi_postgres_session_begin( QofBackend *qbe, QofSession *session,
goto exit;
}
dbi_test_result = conn_test_dbi_library( be->conn );
switch( dbi_test_result )
switch ( dbi_test_result )
{
case GNC_DBI_PASS:
break;
case GNC_DBI_PASS:
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"DBI library large number test incomplete" );
break;
case GNC_DBI_FAIL_SETUP:
qof_backend_set_error( qbe, ERR_SQL_DBI_UNTESTABLE );
qof_backend_set_message( qbe,
"DBI library large number test incomplete" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"DBI library fails large number test" );
break;
case GNC_DBI_FAIL_TEST:
qof_backend_set_error( qbe, ERR_SQL_BAD_DBI );
qof_backend_set_message( qbe,
"DBI library fails large number test" );
break;
}
if ( GNC_DBI_PASS != dbi_test_result )
{
@ -3025,7 +3025,7 @@ conn_test_dbi_library( dbi_conn conn )
PWARN("Test_DBI_Library: Failed to retrieve test row into table: %s",
errmsg );
result = dbi_conn_query( conn, "DROP TABLE numtest" );
gnc_pop_locale( LC_NUMERIC );
gnc_pop_locale( LC_NUMERIC );
return GNC_DBI_FAIL_SETUP;
}
while ( dbi_result_next_row( result ))

View File

@ -2714,7 +2714,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
GList *type_list = NULL, *node = NULL;
type_list = gncInvoiceGetTypeListForOwnerType(owner_type);
for (node = type_list; node; node=node->next)
for (node = type_list; node; node = node->next)
{
inv_type_pred = qof_query_int32_predicate(QOF_COMPARE_EQUAL,
GPOINTER_TO_INT(node->data));

View File

@ -731,7 +731,7 @@ xaccSplitCommitEdit(Split *s)
orig_acc = s->orig_acc;
if (GNC_IS_ACCOUNT(s->acc))
acc=s->acc;
acc = s->acc;
/* Remove from lot (but only if it hasn't been moved to
new lot already) */

View File

@ -1158,20 +1158,20 @@ gboolean gncInvoiceAmountPositive (const GncInvoice *invoice)
{
switch (gncInvoiceGetType (invoice))
{
case GNC_INVOICE_CUST_INVOICE:
case GNC_INVOICE_VEND_CREDIT_NOTE:
case GNC_INVOICE_EMPL_CREDIT_NOTE:
return TRUE;
case GNC_INVOICE_CUST_CREDIT_NOTE:
case GNC_INVOICE_VEND_INVOICE:
case GNC_INVOICE_EMPL_INVOICE:
return FALSE;
case GNC_INVOICE_UNDEFINED:
default:
/* Should never be reached.
* If it is, perhaps a new value is added to GncInvoiceType ? */
g_assert_not_reached();
return FALSE;
case GNC_INVOICE_CUST_INVOICE:
case GNC_INVOICE_VEND_CREDIT_NOTE:
case GNC_INVOICE_EMPL_CREDIT_NOTE:
return TRUE;
case GNC_INVOICE_CUST_CREDIT_NOTE:
case GNC_INVOICE_VEND_INVOICE:
case GNC_INVOICE_EMPL_INVOICE:
return FALSE;
case GNC_INVOICE_UNDEFINED:
default:
/* Should never be reached.
* If it is, perhaps a new value is added to GncInvoiceType ? */
g_assert_not_reached();
return FALSE;
}
}

View File

@ -331,7 +331,7 @@ gnc_account_sel_set_account( GNCAccountSel *gas, Account *acct, gboolean set_def
if ( !acct )
{
GtkEntry *entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(gas->combo)));
gtk_editable_delete_text(GTK_EDITABLE(entry),0,-1);
gtk_editable_delete_text(GTK_EDITABLE(entry), 0, -1);
return;
}
}

View File

@ -202,18 +202,18 @@ gnc_frequency_init(GncFrequency *gf)
};
builder = gtk_builder_new();
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "adjustment1");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "adjustment2");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "adjustment3");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "adjustment4");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore1");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore2");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore3");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore4");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore5");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore6");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "liststore7");
gnc_builder_add_from_file (builder ,"gnc-frequency.glade", "gncfreq_vbox");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "adjustment1");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "adjustment2");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "adjustment3");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "adjustment4");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore1");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore2");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore3");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore4");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore5");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore6");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "liststore7");
gnc_builder_add_from_file (builder , "gnc-frequency.glade", "gncfreq_vbox");
gf->builder = builder;
o = GTK_WIDGET(gtk_builder_get_object (builder, "gncfreq_nb"));

View File

@ -3456,7 +3456,7 @@ gnc_quartz_set_menu(GncMainWindow* window)
if (GTK_IS_MENU_ITEM (item))
gtk_widget_hide (GTK_WIDGET (item));
item = gtk_ui_manager_get_widget (window->ui_merge,
item = gtk_ui_manager_get_widget (window->ui_merge,
"/menubar/Edit/EditPreferences");
if (GTK_IS_MENU_ITEM (item))
gtk_osxapplication_insert_app_menu_item (theApp, GTK_WIDGET (item), 0);
@ -3466,8 +3466,8 @@ gnc_quartz_set_menu(GncMainWindow* window)
if (GTK_IS_MENU_ITEM (item))
{
gtk_osxapplication_insert_app_menu_item (theApp,
gtk_separator_menu_item_new (),
0);
gtk_separator_menu_item_new (),
0);
gtk_osxapplication_insert_app_menu_item (theApp, GTK_WIDGET (item), 0);
}

View File

@ -311,18 +311,18 @@ ap_assistant_menu_prepare (GtkAssistant *assistant, gpointer user_data)
/* Display the results */
str = g_strdup_printf (
/* Translators: %s is a date string. %d is the number of books
* that will be created. This is a ngettext(3) message (but
* only for the %d part). */
ngettext("The earliest transaction date found in this book is %s. "
"Based on the selection made above, this book will be split "
"into %d book.",
"The earliest transaction date found in this book is %s. "
"Based on the selection made above, this book will be split "
"into %d books.",
nperiods),
info->earliest_str,
nperiods);
/* Translators: %s is a date string. %d is the number of books
* that will be created. This is a ngettext(3) message (but
* only for the %d part). */
ngettext("The earliest transaction date found in this book is %s. "
"Based on the selection made above, this book will be split "
"into %d book.",
"The earliest transaction date found in this book is %s. "
"Based on the selection made above, this book will be split "
"into %d books.",
nperiods),
info->earliest_str,
nperiods);
gtk_label_set_text (GTK_LABEL(info->period_remarks), str);
g_free (str);
}

View File

@ -186,7 +186,7 @@ lv_show_splits_in_lot (GNCLotViewer *lv)
if (NULL == lot) return;
split_list = gnc_lot_get_split_list (lot);
gnc_split_viewer_fill(lv,lv->split_in_lot_store,split_list);
gnc_split_viewer_fill(lv, lv->split_in_lot_store, split_list);
}
/* ======================================================================== */
@ -217,13 +217,14 @@ lv_show_splits_free (GNCLotViewer *lv)
for (node = split_list; node; node = node->next)
{
Split *split = node->data;
if (NULL == xaccSplitGetLot(split)) {
filtered_list = g_list_append(filtered_list,split);
if (NULL == xaccSplitGetLot(split))
{
filtered_list = g_list_append(filtered_list, split);
}
}
/* display list */
gnc_split_viewer_fill(lv,lv->split_free_store,filtered_list);
gnc_split_viewer_fill(lv, lv->split_free_store, filtered_list);
}
/* ======================================================================== */
@ -374,7 +375,7 @@ gnc_lot_viewer_fill (GNCLotViewer *lv)
type_buff[0] = '\0';
if ( NULL != gncInvoiceGetInvoiceFromLot(lot) )
{
snprintf(type_buff,200,"I");
snprintf(type_buff, 200, "I");
}
gtk_list_store_set(store, &iter, LOT_COL_TYPE, type_buff, -1);
@ -572,15 +573,18 @@ static void
lv_update_split_buttons(GNCLotViewer *lv)
{
Split * split;
gtk_widget_set_sensitive(GTK_WIDGET(lv->add_split_to_lot_button),FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lv->remove_split_from_lot_button),FALSE);
if (NULL != lv->selected_lot) {
if (NULL != lv_get_selected_split(lv,lv->split_free_view) ) {
gtk_widget_set_sensitive(GTK_WIDGET(lv->add_split_to_lot_button),TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(lv->add_split_to_lot_button), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(lv->remove_split_from_lot_button), FALSE);
if (NULL != lv->selected_lot)
{
if (NULL != lv_get_selected_split(lv, lv->split_free_view) )
{
gtk_widget_set_sensitive(GTK_WIDGET(lv->add_split_to_lot_button), TRUE);
}
split = lv_get_selected_split(lv,lv->split_in_lot_view);
if (NULL != split && TRUE == lv_can_remove_split_from_lot(split,lv->selected_lot)) {
gtk_widget_set_sensitive(GTK_WIDGET(lv->remove_split_from_lot_button),TRUE);
split = lv_get_selected_split(lv, lv->split_in_lot_view);
if (NULL != split && TRUE == lv_can_remove_split_from_lot(split, lv->selected_lot))
{
gtk_widget_set_sensitive(GTK_WIDGET(lv->remove_split_from_lot_button), TRUE);
}
}
}
@ -682,7 +686,7 @@ lv_add_split_to_lot_cb (GtkWidget *widget, GNCLotViewer * lv)
Split *split;
if ( NULL == lv->selected_lot ) return;
split = lv_get_selected_split(lv,lv->split_free_view);
split = lv_get_selected_split(lv, lv->split_free_view);
if ( NULL == split ) return;
xaccAccountBeginEdit(lv->account);
@ -700,10 +704,10 @@ lv_remove_split_from_lot_cb (GtkWidget *widget, GNCLotViewer * lv)
Split *split;
if ( NULL == lv->selected_lot ) return;
split = lv_get_selected_split(lv,lv->split_in_lot_view);
split = lv_get_selected_split(lv, lv->split_in_lot_view);
if ( NULL == split ) return;
if ( FALSE == lv_can_remove_split_from_lot(split,lv->selected_lot) )
if ( FALSE == lv_can_remove_split_from_lot(split, lv->selected_lot) )
return;
xaccAccountBeginEdit(lv->account);
@ -827,38 +831,38 @@ lv_init_lot_view (GNCLotViewer *lv)
/* Set up the columns */
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Type"), renderer,
"text", LOT_COL_TYPE, NULL);
gtk_tree_view_column_set_sort_column_id(column,LOT_COL_TYPE);
"text", LOT_COL_TYPE, NULL);
gtk_tree_view_column_set_sort_column_id(column, LOT_COL_TYPE);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Opened"), renderer,
"text", LOT_COL_OPEN, NULL);
gtk_tree_view_column_set_sort_column_id(column,LOT_COL_OPEN);
gtk_tree_view_column_set_sort_column_id(column, LOT_COL_OPEN);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Closed"), renderer,
"text", LOT_COL_CLOSE, NULL);
gtk_tree_view_column_set_sort_column_id(column,LOT_COL_CLOSE);
gtk_tree_view_column_set_sort_column_id(column, LOT_COL_CLOSE);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Title"), renderer,
"text", LOT_COL_TITLE, NULL);
gtk_tree_view_column_set_sort_column_id(column,LOT_COL_TITLE);
gtk_tree_view_column_set_sort_column_id(column, LOT_COL_TITLE);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer,
"text", LOT_COL_BALN, NULL);
gtk_tree_view_column_set_sort_column_id(column,LOT_COL_BALN);
gtk_tree_view_column_set_sort_column_id(column, LOT_COL_BALN);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Gains"), renderer,
"text", LOT_COL_GAINS, NULL);
gtk_tree_view_column_set_sort_column_id(column,LOT_COL_GAINS);
gtk_tree_view_column_set_sort_column_id(column, LOT_COL_GAINS);
gtk_tree_view_append_column(view, column);
/* Set up signals */
@ -880,7 +884,7 @@ lv_init_split_view (GNCLotViewer *lv, GtkTreeView *view)
GtkTreeSelection *selection;
GtkCellRenderer *renderer;
g_return_val_if_fail(GTK_IS_TREE_VIEW(view),NULL);
g_return_val_if_fail(GTK_IS_TREE_VIEW(view), NULL);
store = gtk_list_store_new(NUM_SPLIT_COLS, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
@ -893,49 +897,49 @@ lv_init_split_view (GNCLotViewer *lv, GtkTreeView *view)
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer,
"text", SPLIT_COL_DATE, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_DATE);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_DATE);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Num"), renderer,
"text", SPLIT_COL_NUM, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_NUM);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_NUM);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Description"), renderer,
"text", SPLIT_COL_DESCRIPTION, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_DESCRIPTION);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_DESCRIPTION);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Amount"), renderer,
"text", SPLIT_COL_AMOUNT, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_AMOUNT);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_AMOUNT);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Value"), renderer,
"text", SPLIT_COL_VALUE, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_VALUE);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_VALUE);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Gain/Loss"), renderer,
"text", SPLIT_COL_GAIN_LOSS, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_GAIN_LOSS);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_GAIN_LOSS);
gtk_tree_view_append_column(view, column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer,
"text", SPLIT_COL_BALANCE, NULL);
gtk_tree_view_column_set_sort_column_id(column,SPLIT_COL_BALANCE);
gtk_tree_view_column_set_sort_column_id(column, SPLIT_COL_BALANCE);
gtk_tree_view_append_column(view, column);
/* Set up the selection callbacks */
selection = gtk_tree_view_get_selection(view);
g_signal_connect(selection, "changed",
G_CALLBACK(lv_split_selection_changed_cb), lv);
G_CALLBACK(lv_split_selection_changed_cb), lv);
return store;
}
@ -943,8 +947,8 @@ lv_init_split_view (GNCLotViewer *lv, GtkTreeView *view)
static void
lv_init_split_views (GNCLotViewer *lv)
{
lv->split_free_store = lv_init_split_view (lv,lv->split_free_view);
lv->split_in_lot_store = lv_init_split_view (lv,lv->split_in_lot_view);
lv->split_free_store = lv_init_split_view (lv, lv->split_free_view);
lv->split_in_lot_store = lv_init_split_view (lv, lv->split_in_lot_view);
}
static void

View File

@ -356,10 +356,10 @@ sxftd_init( SXFromTransInfo *sxfti )
/* Setup Widgets */
{
sxfti->ne_but = GTK_TOGGLE_BUTTON(gtk_builder_get_object(sxfti->builder, "never_end_button"));
sxfti->ed_but = GTK_TOGGLE_BUTTON(gtk_builder_get_object(sxfti->builder, "end_on_date_button"));
sxfti->oc_but = GTK_TOGGLE_BUTTON(gtk_builder_get_object(sxfti->builder, "n_occurrences_button"));
sxfti->n_occurences = GTK_ENTRY(gtk_builder_get_object(sxfti->builder, "n_occurrences_entry"));
sxfti->ne_but = GTK_TOGGLE_BUTTON(gtk_builder_get_object(sxfti->builder, "never_end_button"));
sxfti->ed_but = GTK_TOGGLE_BUTTON(gtk_builder_get_object(sxfti->builder, "end_on_date_button"));
sxfti->oc_but = GTK_TOGGLE_BUTTON(gtk_builder_get_object(sxfti->builder, "n_occurrences_button"));
sxfti->n_occurences = GTK_ENTRY(gtk_builder_get_object(sxfti->builder, "n_occurrences_entry"));
}
/* Get the name from the transaction, try that as the initial SX name. */
@ -781,9 +781,9 @@ gnc_sx_create_from_trans( Transaction *trans )
builder = gtk_builder_new();
gnc_builder_add_from_file (builder ,"dialog-sx.glade", "freq_liststore");
gnc_builder_add_from_file (builder , "dialog-sx.glade", "freq_liststore");
gnc_builder_add_from_file (builder ,"dialog-sx.glade", "sx_from_real_trans");
gnc_builder_add_from_file (builder , "dialog-sx.glade", "sx_from_real_trans");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "sx_from_real_trans"));
sxfti->builder = builder;

View File

@ -1981,7 +1981,7 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
{
GncPluginPageRegisterPrivate *priv;
GncPluginPage *plugin_page;
const char* filter;
const char* filter;
g_return_if_fail(GTK_IS_DIALOG(dialog));
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
@ -2001,11 +2001,11 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
}
else
{
if(priv->fd.save_it)
{
filter = g_strdup_printf("0x%04x", priv->fd.cleared_match);
gnc_plugin_page_register_set_filter (plugin_page, filter);
}
if (priv->fd.save_it)
{
filter = g_strdup_printf("0x%04x", priv->fd.cleared_match);
gnc_plugin_page_register_set_filter (plugin_page, filter);
}
}
priv->fd.dialog = NULL;
gtk_widget_destroy(GTK_WIDGET(dialog));
@ -2412,7 +2412,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"));
@ -2620,7 +2620,7 @@ 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;

View File

@ -338,7 +338,7 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
gtk_widget_show (priv->widget);
/* Add vbox and label */
vbox = gtk_vbox_new(FALSE,0);
vbox = gtk_vbox_new(FALSE, 0);
gtk_paned_pack1( GTK_PANED(widget), vbox, TRUE, FALSE);
label = gtk_label_new(NULL);
@ -353,7 +353,7 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
gtk_widget_show (vbox);
/* Create scrolled window for top area */
swin = gtk_scrolled_window_new(NULL,NULL);
swin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
@ -400,7 +400,7 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
}
/* Add vbox and label */
vbox = gtk_vbox_new(FALSE,0);
vbox = gtk_vbox_new(FALSE, 0);
gtk_paned_pack2( GTK_PANED(widget), vbox, TRUE, FALSE);
label = gtk_label_new(NULL);
@ -416,7 +416,7 @@ gnc_plugin_page_sx_list_create_widget (GncPluginPage *plugin_page)
gtk_widget_show (vbox);
/* Create scrolled window for bottom area */
swin = gtk_scrolled_window_new(NULL,NULL);
swin = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);

View File

@ -315,7 +315,10 @@ static void treeview_resized(GtkWidget* widget, GtkAllocation* allocation, GncCs
/* Get the width. */
col_width = gtk_tree_view_column_get_width(gtk_tree_view_get_column(preview->treeview, i));
/* Set the minumum width for a column so that drop down selector can be seen. */
if (col_width < MIN_COL_WIDTH){col_width = MIN_COL_WIDTH;}
if (col_width < MIN_COL_WIDTH)
{
col_width = MIN_COL_WIDTH;
}
pcol = gtk_tree_view_get_column(preview->treeview, i);
gtk_tree_view_column_set_min_width(pcol, col_width);
/* Set ccol's width the same. */
@ -983,7 +986,7 @@ static void gnc_csv_preview_update(GncCsvPreview* preview)
col = gtk_tree_view_column_new_with_attributes("", renderer, "text", i, NULL);
gtk_tree_view_insert_column(preview->treeview, col, -1);
/* Enable resizing of the columns. */
gtk_tree_view_column_set_resizable(col,TRUE);
gtk_tree_view_column_set_resizable(col, TRUE);
/* Use the alternating model and text entries from ctstore in
* preview->ctreeview. */
gtk_tree_view_insert_column_with_attributes(preview->ctreeview,

View File

@ -601,8 +601,8 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
// open new bill / invoice in a tab, if requested
if (g_ascii_strcasecmp(open_mode, "ALL") == 0
|| (g_ascii_strcasecmp(open_mode, "NOT_POSTED") == 0
&& strlen(date_posted) == 0))
|| (g_ascii_strcasecmp(open_mode, "NOT_POSTED") == 0
&& strlen(date_posted) == 0))
{
iw = gnc_ui_invoice_edit (invoice);
new_page = gnc_plugin_page_invoice_new (iw);

View File

@ -188,8 +188,8 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
GtkWidget *dlg;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-report.glade", "template_liststore");
gnc_builder_add_from_file (builder,"dialog-report.glade", "New Style Sheet Dialog");
gnc_builder_add_from_file (builder, "dialog-report.glade", "template_liststore");
gnc_builder_add_from_file (builder, "dialog-report.glade", "New Style Sheet Dialog");
dlg = GTK_WIDGET(gtk_builder_get_object (builder, "New Style Sheet Dialog"));
template_combo = GTK_WIDGET(gtk_builder_get_object (builder, "template_combobox"));
@ -412,7 +412,7 @@ gnc_style_sheet_select_dialog_create(void)
GtkTreeSelection * selection;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder,"dialog-report.glade", "Select Style Sheet Dialog");
gnc_builder_add_from_file (builder, "dialog-report.glade", "Select Style Sheet Dialog");
ss->toplevel = GTK_WIDGET(gtk_builder_get_object (builder, "Select Style Sheet Dialog"));

View File

@ -41,39 +41,39 @@ typedef struct
static void
setup_module_test(Fixture *fixture, gconstpointer pData)
{
/* Do something useful */
/* Do something useful */
}
static void
teardown_module_test(Fixture *fixture, gconstpointer pData)
{
/* Clean up after ourselves */
/* Clean up after ourselves */
}
static void
test_function( void )
{
/* A simple test function */
/* A simple test function */
}
static void
test_function_with_data( gconstpointer data )
{
/* a more complicated function that needs arguments at invocation */
/* a more complicated function that needs arguments at invocation */
}
static void
test_function_with_fixture( Fixture *fixture, gconstpointer pData )
{
/* A really complicated function that needs an external test fixture */
/* A really complicated function that needs an external test fixture */
}
static void
test_performance_function( void )
{
/* A slow function that measures performance of some critical
* routine. Note g_test_timer functions for simple perfomance
* measurements. */
/* A slow function that measures performance of some critical
* routine. Note g_test_timer functions for simple perfomance
* measurements. */
}
/* Assert macros that you can use in your test functions. "cmp" is a
@ -98,16 +98,16 @@ test_suite_module1 ( void )
Datatype data = something();
g_test_add_func( suitename, test_function );
g_test_add_data_func( suitename, (gconstpointer)(&data),
test_function_with_data );
test_function_with_data );
g_test_add( suitename, Fixture,
data,
setup_module_test,
test_function_with_fixture,
teardown_module_test);
/* Other conditionals are g_test_quick(), g_test_slow(), and
* g_test_thorough() */
data,
setup_module_test,
test_function_with_fixture,
teardown_module_test);
/* Other conditionals are g_test_quick(), g_test_slow(), and
* g_test_thorough() */
if ( g_test_perf() )
{
g_test_add_func( suitename, test_performance_func );
g_test_add_func( suitename, test_performance_func );
}
}

View File

@ -30,16 +30,16 @@ main (int argc,
char *argv[])
{
gtk_test_init (&argc, &argv); // initialize test program
/* Add test functions and suites. See
* http://library.gnome.org/devel/glib/stable/glib-Testing.html for
* details. Unfortunately, GLib-Testing doesn't provide the automatic
* registration features of more sophisitcated frameworks. */
/* Add test functions and suites. See
* http://library.gnome.org/devel/glib/stable/glib-Testing.html for
* details. Unfortunately, GLib-Testing doesn't provide the automatic
* registration features of more sophisitcated frameworks. */
g_test_add_func ("/TESTPROG/Test Case Name", test_case_test_func);
ScannerFixture, // fixture structure type
NULL, // unused data argument
scanner_fixture_setup, // fixture setup
test_scanner_symbols, // test function
scanner_fixture_teardown); // fixture teardown
ScannerFixture, // fixture structure type
NULL, // unused data argument
scanner_fixture_setup, // fixture setup
test_scanner_symbols, // test function
scanner_fixture_teardown); // fixture teardown
return g_test_run();
}