Skip to content

Commit

Permalink
Code clean up, remove some variables that were set but never used
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob-IT authored and jralls committed Jul 23, 2017
1 parent 64a4e6b commit 2c23f78
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 48 deletions.
6 changes: 0 additions & 6 deletions src/engine/Scrub.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ gnc_transaction_balance_trading (Transaction *trans, Account *root)
gnc_commodity *commodity;
gnc_numeric old_amount, new_amount;
gnc_numeric old_value, new_value, val_imbalance;
Account *account = NULL;
const gnc_commodity *txn_curr = xaccTransGetCurrency (trans);

commodity = gnc_monetary_commodity (*imbal_mon);
Expand All @@ -697,8 +696,6 @@ gnc_transaction_balance_trading (Transaction *trans, Account *root)
return;
}

account = xaccSplitGetAccount(balance_split);

if (! gnc_commodity_equal (txn_curr, commodity))
{
val_imbalance = gnc_transaction_get_commodity_imbalance (trans, commodity);
Expand Down Expand Up @@ -757,7 +754,6 @@ gnc_transaction_balance_trading_more_splits (Transaction *trans, Account *root)
gnc_commodity *commodity;
gnc_numeric old_value, new_value;
Split *balance_split;
Account *account = NULL;

commodity = xaccAccountGetCommodity(xaccSplitGetAccount(split));
if (!commodity)
Expand All @@ -772,8 +768,6 @@ gnc_transaction_balance_trading_more_splits (Transaction *trans, Account *root)
LEAVE("");
return;
}
account = xaccSplitGetAccount(balance_split);

xaccTransBeginEdit (trans);

old_value = xaccSplitGetValue (balance_split);
Expand Down
10 changes: 5 additions & 5 deletions src/gnome-utils/dialog-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -2886,15 +2886,15 @@ static void
gnc_plot_size_option_set_select_method(GNCOption *option, gboolean set_buttons)
{
GList* widget_list;
GtkWidget *px_button, *p_button, *px_widget, *p_widget;
GtkWidget *px_widget, *p_widget;
GtkWidget *widget;

widget = gnc_option_get_gtk_widget (option);

widget_list = gtk_container_get_children(GTK_CONTAINER(widget));
px_button = g_list_nth_data(widget_list, 0);
// px_button item 0
px_widget = g_list_nth_data(widget_list, 1);
p_button = g_list_nth_data(widget_list, 2);
// p_button item 2
p_widget = g_list_nth_data(widget_list, 3);
g_list_free(widget_list);

Expand Down Expand Up @@ -3995,14 +3995,14 @@ static SCM
gnc_option_get_ui_value_plot_size (GNCOption *option, GtkWidget *widget)
{
GList* widget_list;
GtkWidget *px_button, *p_button, *px_widget, *p_widget;
GtkWidget *px_button, *px_widget, *p_widget;
gdouble d_value;
SCM type, val;

widget_list = gtk_container_get_children(GTK_CONTAINER(widget));
px_button = g_list_nth_data(widget_list, 0);
px_widget = g_list_nth_data(widget_list, 1);
p_button = g_list_nth_data(widget_list, 2);
// p_button item 2
p_widget = g_list_nth_data(widget_list, 3);
g_list_free(widget_list);

Expand Down
2 changes: 0 additions & 2 deletions src/gnome-utils/gnc-dense-cal.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,12 @@ static void
gdc_reconfig(GncDenseCal *dcal)
{
GtkWidget *widget;
GdkWindow *window;
GtkAllocation alloc;

if (dcal->surface)
cairo_surface_destroy (dcal->surface);

widget = GTK_WIDGET(dcal->cal_drawing_area);
window = gtk_widget_get_window (widget);
gtk_widget_get_allocation (widget, &alloc);
dcal->surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
alloc.width,
Expand Down
12 changes: 0 additions & 12 deletions src/gnome-utils/gnc-tree-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,14 +677,12 @@ static void
gnc_tree_view_update_visibility (GtkTreeViewColumn *column,
GncTreeView *view)
{
GncTreeViewPrivate *priv;
gboolean visible;

g_return_if_fail(GTK_IS_TREE_VIEW_COLUMN(column));
g_return_if_fail(GNC_IS_TREE_VIEW(view));

ENTER(" ");
priv = GNC_TREE_VIEW_GET_PRIVATE(view);
visible = gnc_tree_view_column_visible(view, column, NULL);
gtk_tree_view_column_set_visible(column, visible);
LEAVE("made %s", visible ? "visible" : "invisible");
Expand All @@ -703,13 +701,11 @@ gnc_tree_view_update_visibility (GtkTreeViewColumn *column,
static gchar *
gnc_tree_view_get_sort_order (GncTreeView *view)
{
GncTreeViewPrivate *priv;
GtkTreeModel *s_model;
GtkSortType order;
gint current;
gchar *order_str = NULL;

priv = GNC_TREE_VIEW_GET_PRIVATE(view);
s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
if (!s_model)
return NULL; /* no model, so sort order doesn't make sense */
Expand Down Expand Up @@ -826,12 +822,10 @@ static void
gnc_tree_view_set_sort_order (GncTreeView *view,
const gchar *name)
{
GncTreeViewPrivate *priv;
GtkTreeModel *s_model;
GtkSortType order = GTK_SORT_ASCENDING;
gint current;

priv = GNC_TREE_VIEW_GET_PRIVATE(view);
s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
if (!s_model)
return;
Expand Down Expand Up @@ -906,15 +900,13 @@ gnc_tree_view_set_column_order (GncTreeView *view,
gchar **column_names,
gsize length)
{
GncTreeViewPrivate *priv;
GtkTreeViewColumn *column, *prev;
const GSList *tmp;
GSList *columns;
gsize idx;

/* First, convert from names to pointers */
ENTER(" ");
priv = GNC_TREE_VIEW_GET_PRIVATE(view);
columns = NULL;
for (idx = 0; idx < length; idx++)
{
Expand Down Expand Up @@ -1311,15 +1303,11 @@ static void
gnc_tree_view_update_column_menu_item (GtkCheckMenuItem *checkmenuitem,
GncTreeView *view)
{
GncTreeViewPrivate *priv;
gchar *key;
gboolean visible;

g_return_if_fail(GTK_IS_CHECK_MENU_ITEM(checkmenuitem));
g_return_if_fail(GNC_IS_TREE_VIEW(view));

priv = GNC_TREE_VIEW_GET_PRIVATE(view);
key = g_object_get_data(G_OBJECT(checkmenuitem), STATE_KEY);
if (g_object_get_data(G_OBJECT(checkmenuitem), ALWAYS_VISIBLE))
{
visible = TRUE;
Expand Down
5 changes: 1 addition & 4 deletions src/gnome/dialog-find-account.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,7 @@ get_account_info (FindAccountDialog *facc_dialog)
static void
filter_button_cb (GtkButton *button, FindAccountDialog *facc_dialog)
{
GtkTreeModel *model;
const gchar *filter_text = gtk_entry_get_text (GTK_ENTRY(facc_dialog->filter_text_entry));

model = gtk_tree_view_get_model (GTK_TREE_VIEW(facc_dialog->view));
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(facc_dialog->view));

// Clear the list store
gtk_list_store_clear (GTK_LIST_STORE(model));
Expand Down
3 changes: 0 additions & 3 deletions src/gnome/dialog-sx-editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,8 @@ check_transaction_splits (Transaction *txn, gpointer data)
for ( ; splitList; splitList = splitList->next )
{
gnc_commodity *base_cmdty = NULL;
txnCreditDebitSums *tcds;
Split *s = (Split*)splitList->data;

tcds = (txnCreditDebitSums*)g_hash_table_lookup (sd->txns,
(gpointer)txn);
if (sd->tcds == NULL)
{
sd->tcds = tcds_new ();
Expand Down
1 change: 0 additions & 1 deletion src/gnome/gnc-plugin-page-sx-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ gnc_plugin_page_sx_list_init (GncPluginPageSxList *plugin_page)
{
GtkActionGroup *action_group;
GncPluginPage *parent;
GncPluginPageSxListClass *klass = GNC_PLUGIN_PAGE_SX_LIST_GET_CLASS (plugin_page);

/* Init parent declared variables */
parent = GNC_PLUGIN_PAGE(plugin_page);
Expand Down
3 changes: 0 additions & 3 deletions src/gnome/gnc-split-reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,6 @@ gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
QofBook *book = gnc_account_get_book (leader);
GNCPriceDB *pricedb = gnc_pricedb_get_db (book);
gnc_commodity *currency = gnc_default_currency ();
gnc_numeric currency_value =
gnc_pricedb_convert_balance_latest_price(pricedb, amount,
commodity, currency);
print_info = gnc_commodity_print_info (currency, TRUE);
xaccSPrintAmount (string, amount, print_info);
gnc_set_label_color (gsr->value_label, amount);
Expand Down
3 changes: 0 additions & 3 deletions src/gnome/window-reconcile.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,12 +984,9 @@ gnc_reconcile_window_button_press_cb (GtkWidget *widget,
RecnWindow *recnData)
{
GNCQueryView *qview = GNC_QUERY_VIEW(widget);
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreePath *path;

model = gtk_tree_view_get_model(GTK_TREE_VIEW(qview));

if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
{

Expand Down
3 changes: 1 addition & 2 deletions src/import-export/import-account-matcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Account * gnc_import_select_account(GtkWidget *parent,
Account * retval = NULL;
const gchar *retval_name = NULL;
GtkBuilder *builder;
GtkWidget * online_id_label, *button, *box, *pbox;
GtkWidget * online_id_label, *box, *pbox;
gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = "";
gboolean ok_pressed_retval = FALSE;

Expand Down Expand Up @@ -312,7 +312,6 @@ Account * gnc_import_select_account(GtkWidget *parent,

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"));
button = GTK_WIDGET(gtk_builder_get_object (builder, "newbutton"));

//printf("gnc_import_select_account(): Fin get widget\n");

Expand Down
3 changes: 0 additions & 3 deletions src/import-export/qif-imp/dialog-account-picker.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
SCM orig_acct = scm_call_1(gnc_name, map_entry);
int response;
GtkBuilder *builder;
GtkWidget *button;

wind = g_new0(QIFAccountPickerDialog, 1);

Expand Down Expand Up @@ -395,8 +394,6 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
wind);

button = GTK_WIDGET(gtk_builder_get_object (builder, "newbutton"));

/* this is to get the checkmarks set up right.. it will get called
* again after the window is mapped. */
build_acct_tree(wind, wind->qif_wind);
Expand Down
2 changes: 0 additions & 2 deletions src/register/ledger-core/split-register-model-save.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ gnc_split_register_save_tnum_cell (BasicCell * cell,
gpointer user_data)
{
SRSaveData *sd = save_data;
SplitRegister *reg = user_data;
const char *value;

g_return_if_fail (gnc_basic_cell_has_name (cell, TNUM_CELL));
Expand Down Expand Up @@ -727,7 +726,6 @@ gnc_template_register_save_debcred_cell (BasicCell * cell,
{
SRSaveData *sd = save_data;
SplitRegister *reg = user_data;
GHashTable *parser_vars = g_hash_table_new(g_str_hash, g_str_equal);

g_return_if_fail (gnc_basic_cell_has_name (cell, FDEBT_CELL) ||
gnc_basic_cell_has_name (cell, FCRED_CELL));
Expand Down
3 changes: 1 addition & 2 deletions src/report/report-gnome/dialog-custom-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ set_reports_view_and_model(CustomReportDialog *crd)
{
GtkCellRenderer *renderer;
GtkTreeModel *model;
gint colnum;

crd->namerenderer = gtk_cell_renderer_text_new();
g_signal_connect (G_OBJECT (crd->namerenderer), "edited",
Expand Down Expand Up @@ -226,7 +225,7 @@ set_reports_view_and_model(CustomReportDialog *crd)

renderer = gtk_cell_renderer_pixbuf_new();
g_object_set (G_OBJECT (renderer), "icon-name", "edit-delete", NULL);
colnum = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (crd->reportview), -1,
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (crd->reportview), -1,
"D", renderer,
NULL);
crd->delcol = gtk_tree_view_get_column (GTK_TREE_VIEW (crd->reportview), VIEW_COL_DELETE);
Expand Down

0 comments on commit 2c23f78

Please sign in to comment.