gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sun Jul 23 19:04:51 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/b60057db (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64675b64 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b264a060 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/258a5fb9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f31516a0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1002576c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3e723507 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/583935cc (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2c23f78d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64a4e6b1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fbd9a364 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/39232d9e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0d4bf857 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/69e927a3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e7d35b83 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8ab3aadf (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8fa2b0a6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64b934f2 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ae5512e6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bbd29b69 (commit)
	from  https://github.com/Gnucash/gnucash/commit/e41410ef (commit)



commit b60057dbeb04479bcc6400556ccbcb09cbc6709c
Merge: e41410e 64675b6
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jul 23 16:04:19 2017 -0700

    Merge Bob Fewell's 'gtk3-update3' branch.


commit 64675b64ebd200161bc3abf77cb4a23842730f82
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:41:15 2017 +0100

    These files have the QofLogModule defined but never used
    
    In two minds on this, comment the line out or add macro to stop it
    showing up as defined but never used, chose the latter.

diff --git a/src/app-utils/guile-util.c b/src/app-utils/guile-util.c
index 043f5c7..1f17ef3 100644
--- a/src/app-utils/guile-util.c
+++ b/src/app-utils/guile-util.c
@@ -57,9 +57,10 @@
 #include "guile-util.h"
 #include "guile-mappings.h"
 
-/* This static indicates the debugging module this .o belongs to.  */
-static QofLogModule log_module = GNC_MOD_GUILE;
+#define UNUSED_VAR     __attribute__ ((unused))
 
+/* This static indicates the debugging module this .o belongs to.  */
+static QofLogModule UNUSED_VAR log_module = GNC_MOD_GUILE;
 
 struct _setters
 {
diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c
index 8af5b38..6f59118 100644
--- a/src/business/business-gnome/dialog-invoice.c
+++ b/src/business/business-gnome/dialog-invoice.c
@@ -126,7 +126,9 @@ struct _invoice_select_window
     GncOwner	owner_def;
 };
 
-static QofLogModule log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS;
+#define UNUSED_VAR     __attribute__ ((unused))
+
+static QofLogModule UNUSED_VAR log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS;
 
 /** This data structure does double duty.  It is used to maintain
  *  information for the "New Invoice" dialog, and it is also used to
diff --git a/src/import-export/csv-imp/gnc-csv-account-map.c b/src/import-export/csv-imp/gnc-csv-account-map.c
index 29d7c6b..88bd260 100644
--- a/src/import-export/csv-imp/gnc-csv-account-map.c
+++ b/src/import-export/csv-imp/gnc-csv-account-map.c
@@ -39,8 +39,10 @@
 #define IMPORT_FULL_PATH     "FullPath"
 #define IMPORT_ACCOUNT       "Account"
 
+#define UNUSED_VAR     __attribute__ ((unused))
+
 /* This static indicates the debugging module that this .o belongs to.  */
-static QofLogModule log_module = G_LOG_DOMAIN;
+static QofLogModule UNUSED_VAR log_module = G_LOG_DOMAIN;
 
 /**************************************************
  * account_imap_destroy
diff --git a/src/plugins/bi_import/dialog-bi-import-gui.c b/src/plugins/bi_import/dialog-bi-import-gui.c
index e3ac075..ca073da 100644
--- a/src/plugins/bi_import/dialog-bi-import-gui.c
+++ b/src/plugins/bi_import/dialog-bi-import-gui.c
@@ -75,7 +75,10 @@ void gnc_import_gui_type_cb (GtkWidget *widget, gpointer data);
 // utils
 static gchar *gnc_input_dialog (GtkWidget *parent, const gchar *title, const gchar *msg, const gchar *default_input);
 static void gnc_info2_dialog (GtkWidget *parent, const gchar *title, const gchar *msg);
-static QofLogModule log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS;
+
+#define UNUSED_VAR     __attribute__ ((unused))
+
+static QofLogModule UNUSED_VAR log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS;
 
 BillImportGui *
 gnc_plugin_bi_import_showGUI(void)
diff --git a/src/register/register-gnome/table-gnome.c b/src/register/register-gnome/table-gnome.c
index 3dbf7a9..8f9650e 100644
--- a/src/register/register-gnome/table-gnome.c
+++ b/src/register/register-gnome/table-gnome.c
@@ -59,8 +59,10 @@
 
 /** Static Globals *****************************************************/
 
+#define UNUSED_VAR     __attribute__ ((unused))
+
 /* This static indicates the debugging module that this .o belongs to. */
-static QofLogModule log_module = GNC_MOD_REGISTER;
+static QofLogModule UNUSED_VAR log_module = GNC_MOD_REGISTER;
 
 
 /** Implementation *****************************************************/

commit b264a060bfcb9f1d2c33316831e62cd802587007
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:40:01 2017 +0100

    Comment out some unused variables while register is still in flux

diff --git a/src/register/register-gnome/gnucash-register.c b/src/register/register-gnome/gnucash-register.c
index edc8c3b..e1b4b11 100644
--- a/src/register/register-gnome/gnucash-register.c
+++ b/src/register/register-gnome/gnucash-register.c
@@ -556,11 +556,11 @@ GtkWidget *
 gnucash_register_new (Table *table, gchar *state_section)
 {
     GnucashRegister *reg;
-    GtkWidget *header;
+//    GtkWidget *header;
     GtkWidget *widget;
-    GtkWidget *sheet;
-    GtkWidget *scrollbar;
-    GtkWidget *box;
+//    GtkWidget *sheet;
+//    GtkWidget *scrollbar;
+//    GtkWidget *box;
 
     widget = gnucash_register_create_widget(table);
     reg = GNUCASH_REGISTER(widget);
diff --git a/src/register/register-gnome/gnucash-sheet.c b/src/register/register-gnome/gnucash-sheet.c
index 4b4152b..10f8e04 100644
--- a/src/register/register-gnome/gnucash-sheet.c
+++ b/src/register/register-gnome/gnucash-sheet.c
@@ -403,7 +403,7 @@ gnucash_sheet_compute_visible_range (GnucashSheet *sheet)
     gint height;
     gint cy;
     gint top_block;
-    gint old_visible_blocks, old_visible_rows;
+//    gint old_visible_blocks, old_visible_rows;
 
     g_return_if_fail (sheet != NULL);
     g_return_if_fail (GNUCASH_IS_SHEET (sheet));
@@ -416,8 +416,8 @@ gnucash_sheet_compute_visible_range (GnucashSheet *sheet)
 
     top_block = gnucash_sheet_y_pixel_to_block (sheet, cy);
 
-    old_visible_blocks = sheet->num_visible_blocks;
-    old_visible_rows = sheet->num_visible_phys_rows;
+//    old_visible_blocks = sheet->num_visible_blocks;
+//    old_visible_rows = sheet->num_visible_phys_rows;
     sheet->num_visible_blocks = 0;
     sheet->num_visible_phys_rows = 0;
 
@@ -1054,10 +1054,11 @@ gnucash_sheet_draw_cb (GtkWidget *widget, cairo_t *cr, G_GNUC_UNUSED gpointer da
     GnucashSheet *sheet = GNUCASH_SHEET (widget);
     GtkStyleContext *context = gtk_widget_get_style_context (widget);
     GtkAllocation alloc;
-    gboolean result;
+    gboolean result; //FIXME
 
     gtk_widget_get_allocation(widget, &alloc);
     gtk_render_background (context, cr, alloc.x, alloc.y, alloc.width, alloc.height);
+//FIXME what should be done with result being TRUE or FALSE
     result = gnucash_sheet_draw_internal (sheet, cr, &alloc);
     gnucash_sheet_draw_cursor (sheet->cursor, cr);
 
@@ -1309,7 +1310,7 @@ gnucash_button_press_event (GtkWidget *widget, GdkEventButton *event)
 {
     GnucashSheet *sheet;
     VirtualCell *vcell;
-    gboolean changed_cells;
+    gboolean changed_cells; //FIXME
 
     VirtualLocation cur_virt_loc;
     VirtualLocation new_virt_loc;
@@ -1399,7 +1400,7 @@ gnucash_button_press_event (GtkWidget *widget, GdkEventButton *event)
 
     if (abort_move)
         return TRUE;
-
+//FIXME does something need to be done if changed_cells is true or false ?
     changed_cells = gnucash_sheet_cursor_move (sheet, new_virt_loc);
 
     if (button_1)
@@ -1434,10 +1435,8 @@ gnucash_sheet_clipboard_event (GnucashSheet *sheet, GdkEventKey *event)
 {
     GncItemEdit *item_edit;
     gboolean handled = FALSE;
-    guint32 time;
 
     item_edit = GNC_ITEM_EDIT(sheet->item_editor);
-    time = event->time;
 
     switch (event->keyval)
     {
@@ -1488,7 +1487,7 @@ gnucash_sheet_direct_event(GnucashSheet *sheet, GdkEvent *event)
     GtkEditable *editable;
     Table *table = sheet->table;
     VirtualLocation virt_loc;
-    gboolean changed;
+//    gboolean changed;
     gboolean result;
 
     char *new_text = NULL;
@@ -1519,7 +1518,7 @@ gnucash_sheet_direct_event(GnucashSheet *sheet, GdkEvent *event)
                                       &new_start, &new_end,
                                       event);
 
-    changed = FALSE;
+//    changed = FALSE;
 
     if (new_text != NULL)
     {
@@ -1535,19 +1534,19 @@ gnucash_sheet_direct_event(GnucashSheet *sheet, GdkEvent *event)
         g_signal_handler_unblock (G_OBJECT (sheet->entry),
                                   sheet->insert_signal);
 
-        changed = TRUE;
+//        changed = TRUE;
     }
 
     if (new_position != cursor_position)
     {
         gtk_editable_set_position (editable, new_position);
-        changed = TRUE;
+//        changed = TRUE;
     }
 
     if ((new_start != start_sel) || (new_end != end_sel))
     {
         gtk_editable_select_region(editable, new_start, new_end);
-        changed = TRUE;
+//        changed = TRUE;
     }
 
     return result;
@@ -2147,14 +2146,14 @@ void
 gnucash_sheet_set_scroll_region (GnucashSheet *sheet)
 {
     guint new_h, new_w;
-    GtkWidget *widget;
+//    GtkWidget *widget;
     GtkAllocation alloc;
     guint old_h, old_w;
 
     if (!sheet)
         return;
 
-    widget = GTK_WIDGET(sheet);
+//    widget = GTK_WIDGET(sheet);
 
     if (!sheet->header_item || !GNC_HEADER(sheet->header_item)->style)
         return;

commit 258a5fb9cadd6ccc70651329b7a71c91433b7b6c
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:37:33 2017 +0100

    Add some additional REGISTER2_ENABLED code blocks
    
    Stop some additional functions showing up when checking for defined but
    not used when register2 not enabled.

diff --git a/src/gnome/gnc-plugin-page-sx-list.c b/src/gnome/gnc-plugin-page-sx-list.c
index 221d27e..080558c 100644
--- a/src/gnome/gnc-plugin-page-sx-list.c
+++ b/src/gnome/gnc-plugin-page-sx-list.c
@@ -120,10 +120,12 @@ static void gppsl_row_activated_cb(GtkTreeView *tree_view, GtkTreePath *path, Gt
 
 static void gnc_plugin_page_sx_list_cmd_new(GtkAction *action, GncPluginPageSxList *page);
 static void gnc_plugin_page_sx_list_cmd_edit(GtkAction *action, GncPluginPageSxList *page);
+#ifdef REGISTER2_ENABLED
 /*################## Added for Reg2 #################*/
 static void gnc_plugin_page_sx_list_cmd_new2(GtkAction *action, GncPluginPageSxList *page);
 static void gnc_plugin_page_sx_list_cmd_edit2(GtkAction *action, GncPluginPageSxList *page);
 /*################## Added for Reg2 #################*/
+#endif
 static void gnc_plugin_page_sx_list_cmd_delete(GtkAction *action, GncPluginPageSxList *page);
 
 /* Command callbacks */
@@ -607,6 +609,7 @@ gnc_plugin_page_sx_list_cmd_new(GtkAction *action, GncPluginPageSxList *page)
     gnc_ui_scheduled_xaction_editor_dialog_create(new_sx, new_sx_flag);
 }
 
+#ifdef REGISTER2_ENABLED
 /*################## Added for Reg2 #################*/
 static void
 gnc_plugin_page_sx_list_cmd_new2 (GtkAction *action, GncPluginPageSxList *page)
@@ -630,6 +633,7 @@ gnc_plugin_page_sx_list_cmd_new2 (GtkAction *action, GncPluginPageSxList *page)
     gnc_ui_scheduled_xaction_editor_dialog_create2 (new_sx, new_sx_flag);
 }
 /*################## Added for Reg2 #################*/
+#endif
 
 static void
 _edit_sx(gpointer data, gpointer user_data)
@@ -637,6 +641,7 @@ _edit_sx(gpointer data, gpointer user_data)
     gnc_ui_scheduled_xaction_editor_dialog_create((SchedXaction*)data, FALSE);
 }
 
+#ifdef REGISTER2_ENABLED
 /*################## Added for Reg2 #################*/
 static void
 _edit_sx2 (gpointer data, gpointer user_data)
@@ -644,6 +649,7 @@ _edit_sx2 (gpointer data, gpointer user_data)
     gnc_ui_scheduled_xaction_editor_dialog_create2 ((SchedXaction*)data, FALSE);
 }
 /*################## Added for Reg2 #################*/
+#endif
 
 static SchedXaction*
 _argument_reorder_fn(GtkTreePath* list_path_data, GncTreeViewSxList* user_tree_view)
@@ -677,6 +683,7 @@ gnc_plugin_page_sx_list_cmd_edit(GtkAction *action, GncPluginPageSxList *page)
     g_list_free(selected_paths);
 }
 
+#ifdef REGISTER2_ENABLED
 /*################## Added for Reg2 #################*/
 static void
 gnc_plugin_page_sx_list_cmd_edit2 (GtkAction *action, GncPluginPageSxList *page)
@@ -703,7 +710,7 @@ gnc_plugin_page_sx_list_cmd_edit2 (GtkAction *action, GncPluginPageSxList *page)
     g_list_free (selected_paths);
 }
 /*################## Added for Reg2 #################*/
-
+#endif
 
 static void
 gppsl_row_activated_cb(GtkTreeView *tree_view,

commit f31516a0f2f281691787baf96ecc9296f281f2e7
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:34:37 2017 +0100

    Code clean up, comment out some additional static defines
    
    These functions are commented out in the code and so not used so stop
    them showing up for defined but not used.

diff --git a/src/gnome/gnc-budget-view.c b/src/gnome/gnc-budget-view.c
index a85e6d9..0bb83bb 100644
--- a/src/gnome/gnc-budget-view.c
+++ b/src/gnome/gnc-budget-view.c
@@ -109,11 +109,14 @@ static void gnc_budget_view_init(GncBudgetView *budget_view);
 static void gnc_budget_view_finalize(GObject *object);
 
 static void gbv_create_widget(GncBudgetView *view);
-
+#if 0
 static gboolean gbv_button_press_cb(
     GtkWidget *widget, GdkEventButton *event, GncBudgetView *view);
+#endif
+#if 0
 static gboolean gbv_key_press_cb(
     GtkWidget *treeview, GdkEventKey *event, gpointer userdata);
+#endif
 static void gbv_row_activated_cb(
     GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col,
     GncBudgetView *view);
@@ -569,7 +572,7 @@ gbv_button_press_cb(GtkWidget *widget, GdkEventButton *event,
 }
 #endif
 
-
+#if 0
 /** \brief Key press action for gnc budget view.
 */
 static gboolean
@@ -601,7 +604,7 @@ gbv_key_press_cb(GtkWidget *treeview, GdkEventKey *event, gpointer userdata)
         gtk_tree_view_set_cursor(tv, path, col, TRUE);
     return TRUE;
 }
-
+#endif
 
 /** \brief gnc budget view actions for resize of treeview.
 */
diff --git a/src/gnome/gnc-plugin-page-budget.c b/src/gnome/gnc-plugin-page-budget.c
index e9f350a..0b126d8 100644
--- a/src/gnome/gnc-plugin-page-budget.c
+++ b/src/gnome/gnc-plugin-page-budget.c
@@ -163,12 +163,14 @@ static GtkActionEntry gnc_plugin_page_budget_actions [] =
 static guint gnc_plugin_page_budget_n_actions =
     G_N_ELEMENTS (gnc_plugin_page_budget_actions);
 
+#if 0 
 static const gchar *actions_requiring_account[] =
 {
     "OpenAccountAction",
     "OpenSubaccountsAction",
     NULL
 };
+#endif
 
 /** Short labels for use on the toolbar buttons. */
 static action_toolbar_labels toolbar_labels[] =
diff --git a/src/register/ledger-core/split-register-model.c b/src/register/ledger-core/split-register-model.c
index a6ce1ea..0073898 100644
--- a/src/register/ledger-core/split-register-model.c
+++ b/src/register/ledger-core/split-register-model.c
@@ -800,6 +800,8 @@ gnc_split_register_get_associate_entry (VirtualLocation virt_loc,
     return s;
 }
 
+#if 0
+// this code is not used yet
 static char
 gnc_split_register_get_associate_value (SplitRegister *reg,
                                    VirtualLocation virt_loc)
@@ -812,6 +814,7 @@ gnc_split_register_get_associate_value (SplitRegister *reg,
 
     return gnc_recn_cell_get_flag (cell);
 }
+#endif
 
 static const char *
 gnc_split_register_get_type_entry (VirtualLocation virt_loc,

commit 1002576cef1019706a3cbb4c14428a262879ef2f
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:28:18 2017 +0100

    Code clean up on register2 files
    
    Remove unused, unused set variables and also comment out some additional
     code

diff --git a/src/gnome-utils/gnc-tree-control-split-reg.c b/src/gnome-utils/gnc-tree-control-split-reg.c
index 2cd0c92..728f8ca 100644
--- a/src/gnome-utils/gnc-tree-control-split-reg.c
+++ b/src/gnome-utils/gnc-tree-control-split-reg.c
@@ -833,7 +833,6 @@ void
 gnc_tree_control_split_reg_reinit (GncTreeViewSplitReg *view, gpointer data)
 {
     Transaction *trans;
-    Split *split;
     GtkWidget *dialog, *window;
     gint response;
     const gchar *warning;
@@ -1082,7 +1081,6 @@ gnc_tree_control_split_reg_reverse_current (GncTreeViewSplitReg *view)
     GtkWidget *window;
     Transaction *trans = NULL, *new_trans = NULL;
     GList *snode = NULL;
-    gboolean changed = FALSE;
 
     ENTER(" ");
 
@@ -1174,7 +1172,6 @@ gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
     Transaction *trans;
     Split *blank_split;
     Split *split, *trans_split;
-    gboolean changed = FALSE;
     gboolean use_split_action_for_num_field = FALSE;
 
     ENTER("");
@@ -1313,7 +1310,6 @@ gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
     {
         Transaction *new_trans;
         int trans_split_index;
-        int split_index;
         const char *in_num = NULL;
         const char *in_tnum = NULL;
         char *out_num;
@@ -1649,16 +1645,11 @@ gboolean gnc_tree_control_split_reg_is_current_movable_updown (GncTreeViewSplitR
 gboolean
 gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing)
 {
-    GncTreeModelSplitReg *model;
-    RowDepth depth;
     Transaction *dirty_trans;
     Transaction *blank_trans;
     Transaction *trans;
-    Account *account;
-    Split *blank_split;
-    const char *memo;
-    const char *desc;
-    Split *split, *current_trans_split;
+//    Split *split;
+//    Split *current_trans_split;
 
     ENTER("view=%p, reg_closing=%s", view, reg_closing ? "TRUE" : "FALSE");
 
@@ -1674,17 +1665,14 @@ gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing
     if (reg_closing)
         view->reg_closing = TRUE;
 
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
-    blank_split = gnc_tree_control_split_reg_get_blank_split (view);
     dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
     blank_trans = gnc_tree_control_split_reg_get_blank_trans (view);
 
     /* get the handle to the current split and transaction */
-    split = gnc_tree_view_split_reg_get_current_split (view);
+//    split = gnc_tree_view_split_reg_get_current_split (view);
     trans = gnc_tree_view_split_reg_get_current_trans (view);
 
-    current_trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
+//    current_trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
 
     if (trans == NULL)
     {
@@ -1961,7 +1949,6 @@ gnc_tree_control_split_reg_get_account_by_name (GncTreeViewSplitReg *view, const
     const char *placeholder = _("The account %s does not allow transactions.");
     const char *missing = _("The account %s does not exist. "
                             "Would you like to create it?");
-    char *account_name;
     Account *account;
 
     if (!name || (strlen(name) == 0))
@@ -2069,7 +2056,7 @@ gnc_tree_control_split_reg_copy_trans (GncTreeViewSplitReg *view)
 {
     GncTreeModelSplitReg *model;
     Transaction *from_trans;
-    Account *from_acc, *anchor;
+    Account *anchor;
 
     g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
 
@@ -2146,7 +2133,7 @@ void
 gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans,  const gchar *new_text)
 {
     GncTreeModelSplitReg *model;
-    Transaction          *btrans, *dirty_trans;
+    Transaction          *btrans;
     GtkListStore         *desc_list;
     GtkTreeIter           iter;
     gboolean              valid;
diff --git a/src/gnome-utils/gnc-tree-model-split-reg.c b/src/gnome-utils/gnc-tree-model-split-reg.c
index ce90463..c2995c6 100644
--- a/src/gnome-utils/gnc-tree-model-split-reg.c
+++ b/src/gnome-utils/gnc-tree-model-split-reg.c
@@ -366,8 +366,6 @@ gnc_tree_model_split_reg_prefs_changed (gpointer prefs, gchar *pref, gpointer us
 static void
 gnc_tree_model_split_reg_init (GncTreeModelSplitReg *model)
 {
-    GncTreeModelSplitRegPrivate *priv;
-
     ENTER("model %p", model);
     while (model->stamp == 0)
     {
@@ -391,14 +389,10 @@ gnc_tree_model_split_reg_init (GncTreeModelSplitReg *model)
 static void
 gnc_tree_model_split_reg_finalize (GObject *object)
 {
-    GncTreeModelSplitReg *model;
-
     ENTER("model split reg %p", object);
     g_return_if_fail (object != NULL);
     g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (object));
 
-    model = GNC_TREE_MODEL_SPLIT_REG (object);
-
     if (G_OBJECT_CLASS (parent_class)->finalize)
         G_OBJECT_CLASS (parent_class)->finalize (object);
     LEAVE(" ");
@@ -616,8 +610,6 @@ void
 gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Account *default_account)
 {
     GncTreeModelSplitRegPrivate *priv;
-    GList *node;
-    gint rows = 0;
 
     ENTER("#### Load ModelSplitReg = %p and slist length is %d ####", model, g_list_length (slist));
 
@@ -1521,7 +1513,6 @@ gnc_tree_model_split_reg_get_value (GtkTreeModel *tree_model,
     GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
     const GncGUID *guid;
     GList *tnode;
-    gint depth, *indices;
 
     g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model));
 
@@ -2116,7 +2107,6 @@ GtkTreePath *
 gnc_tree_model_split_reg_get_path_to_split_and_trans (GncTreeModelSplitReg *model, Split *split, Transaction *trans)
 {
     GtkTreePath *path;
-    GList *slist;
     gint tpos, spos, number;
 
     ENTER("transaction is %p, split is %p", trans, split);
@@ -2160,7 +2150,6 @@ gnc_tree_model_split_reg_get_path_to_split_and_trans (GncTreeModelSplitReg *mode
 
     if (split != NULL)
     {
-        slist = xaccTransGetSplitList (trans);
         /* Level 3 */
         spos = xaccTransGetSplitIndex (trans, split);
         if (spos == -1)
@@ -3022,7 +3011,6 @@ gnc_tree_model_split_reg_update_account_list (GncTreeModelSplitReg *model)
     Account *acc;
     GtkTreeIter iter;
     GList *accts, *accts_cpy, *ptr;
-    gboolean valid;
     const gchar *name;
     gchar *fname;
     gint i;
diff --git a/src/gnome-utils/gnc-tree-util-split-reg.c b/src/gnome-utils/gnc-tree-util-split-reg.c
index 74cd3d2..0cc763e 100644
--- a/src/gnome-utils/gnc-tree-util-split-reg.c
+++ b/src/gnome-utils/gnc-tree-util-split-reg.c
@@ -425,7 +425,6 @@ gchar *
 gnc_tree_util_split_reg_get_date_help (GDate *date)
 {
     char string[1024];
-    struct tm tm;
 
     if (g_date_valid (date))
     {
@@ -824,20 +823,19 @@ gnc_tree_util_split_reg_get_debcred_entry (GncTreeViewSplitReg *view,
 void
 gnc_tree_util_split_reg_set_value_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input, gboolean force)
 {
-    GncTreeModelSplitReg *model;
+//    GncTreeModelSplitReg *model;
     GtkWidget *window;
-    Account *anchor;
-    Account *acct = xaccSplitGetAccount (split);
-    gnc_commodity *currency;
-    gnc_numeric value, amount, rate;
+//    Account *anchor;
+//    Account *acct = xaccSplitGetAccount (split);
+//    gnc_commodity *currency;
 
     ENTER("set_value_for trans %p and split %p input %s force %d", trans, split, gnc_numeric_to_string (input), force);
 
-    currency = xaccTransGetCurrency (trans);
+//    currency = xaccTransGetCurrency (trans);
 
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
+//    model = gnc_tree_view_split_reg_get_model_from_view (view);
 
-    anchor = gnc_tree_model_split_reg_get_anchor (model);
+//    anchor = gnc_tree_model_split_reg_get_anchor (model);
 
     if (gnc_numeric_zero_p (input))
     {
diff --git a/src/gnome-utils/gnc-tree-view-split-reg.c b/src/gnome-utils/gnc-tree-view-split-reg.c
index bf309d4..432970c 100644
--- a/src/gnome-utils/gnc-tree-view-split-reg.c
+++ b/src/gnome-utils/gnc-tree-view-split-reg.c
@@ -98,8 +98,8 @@ static void gtv_sr_edited_normal_cb (GtkCellRendererText *cell, const gchar *pat
 static void gtv_sr_edited_template_cb (GtkCellRendererText *cell, const gchar *path_string,
                                 const gchar *new_text, gpointer user_data);
 
-static void start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
-				const gchar *path, gpointer user_data); //FIXME This may not be needed
+//static void start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
+//				const gchar *path, gpointer user_data); //FIXME This may not be needed
 
 static void gtv_sr_begin_edit (GncTreeViewSplitReg *view, Transaction *trans);
 
@@ -110,11 +110,11 @@ static void gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditab
 
 static void gtv_sr_editing_canceled_cb (GtkCellRenderer *cr, gpointer user_data);
 
-static void gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
-                        GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
+//static void gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
+//                        GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
 
-static void gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
-                        GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
+//static void gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
+//                        GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
 
 static void gtv_sr_selection_move_delete_cb (GncTreeModelSplitReg *model, gpointer item, gpointer user_data);
 
@@ -548,15 +548,11 @@ gnc_tree_view_split_reg_dispose (GObject *object)
 static void
 gnc_tree_view_split_reg_finalize (GObject *object)
 {
-    GncTreeViewSplitReg *view;
-
     gnc_leave_return_if_fail(object != NULL);
     gnc_leave_return_if_fail(GNC_IS_TREE_VIEW_SPLIT_REG (object));
 
     ENTER("split reg view %p", object);
 
-    view = GNC_TREE_VIEW_SPLIT_REG (object);
-
     if (G_OBJECT_CLASS(parent_class)->finalize)
         (* G_OBJECT_CLASS(parent_class)->finalize) (object);
 
@@ -1823,8 +1819,6 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
         {
             GNCPrintAmountInfo print_info;
 
-            gnc_commodity *split_com = xaccAccountGetCommodity (xaccSplitGetAccount (split));
-
             print_info = gnc_default_price_print_info();
             print_info.min_decimal_places = 2;
 
@@ -2207,13 +2201,12 @@ gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
     gboolean is_split, is_blank, is_trow1, is_trow2;
     gboolean editable = FALSE, expanded = FALSE;
     gboolean read_only = FALSE;
-    gboolean open_edited = FALSE;
-    gnc_numeric num;
+//    gboolean open_edited = FALSE;
     const gchar *s = "";
     const gchar *row_color;
-    RowDepth depth;
+//    RowDepth depth;
     gint *indices;
-    Account *anchor = view->priv->anchor;
+//    Account *anchor = view->priv->anchor;
     char type;
 
     ENTER("");
@@ -2231,7 +2224,7 @@ gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
 
     spath = gtk_tree_model_get_path (GTK_TREE_MODEL (s_model), s_iter);
 
-    depth = gtk_tree_path_get_depth (spath);
+//    depth = gtk_tree_path_get_depth (spath);
 
     indices = gtk_tree_path_get_indices (spath);
 
@@ -2259,7 +2252,7 @@ gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
     if (xaccTransIsOpen (trans) && (view->priv->dirty_trans != trans))
     {
         read_only = TRUE;
-        open_edited = TRUE;
+//        open_edited = TRUE;
     }
 
     /* Test for a transaction type of invoice, always read only */
@@ -2490,17 +2483,18 @@ gtv_sr_transaction_changed_confirm (GncTreeViewSplitReg *view,
 /*###########################################################################
              vvvvv    edit function call backs      vvvvvv
 #############################################################################*/
+#ifdef skip
 static void
 start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
            const gchar *path_string, gpointer user_data)
 {
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
-    GncTreeModelSplitReg *model;
+//    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
+//    GncTreeModelSplitReg *model;
     GtkTreePath         *path;
 //g_print("\n\nstart_edit\n");
 /*FIXME Not sure if this is required, leave for now ? */
 
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
+//    model = gnc_tree_view_split_reg_get_model_from_view (view);
 
     gtv_sr_editable_start_editing_cb (cr, editable, path_string, user_data);
 /*    g_signal_connect(G_OBJECT(editable), "editing-done", (GCallback) editing_done_cb, view); */
@@ -2514,7 +2508,7 @@ start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
 
     return;
 }
-
+#endif
 
 /* Open Transaction for editing */
 static void
@@ -2692,7 +2686,8 @@ gtv_sr_finish_edit (GncTreeViewSplitReg *view)
     }
 }
 
-
+#ifdef skip
+//FIXME Not used yet
 /* This is used in g_idle_add to finish an edit */
 static gboolean
 gtv_sr_idle_finish_edit (GncTreeViewSplitReg *view)
@@ -2716,6 +2711,7 @@ gtv_sr_idle_cancel_edit (GtkCellRenderer *cr)
 
    return FALSE;
 }
+#endif
 
 /* This is used in g_idle_add to repopulate the transfer cell */
 static gboolean
@@ -2765,7 +2761,6 @@ gtv_sr_titles (GncTreeViewSplitReg *view, RowDepth depth)
     GList *columns;
     GList  *column;
     gint i;
-    RowDepth temp_depth;
     gboolean is_template;
 
     model = gnc_tree_view_split_reg_get_model_from_view (view);
@@ -3570,7 +3565,6 @@ gtv_sr_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
     GncTreeModelSplitReg *model;
     GtkTreePath *mpath, *spath;
     GtkTreeViewColumn    *col;
-    ViewCol viewcol;
     GtkTreeIter m_iter;
     Split *split = NULL;
     Split *rotate_split = NULL;
@@ -3840,11 +3834,9 @@ gtv_sr_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
     gboolean trans_changed = FALSE;
     gint *start_indices;
     gint *next_indices;
-    gboolean keyup = FALSE;
     Transaction *btrans, *ctrans, *hetrans;
     gboolean goto_blank = FALSE;
     gboolean next_trans = TRUE;
-    gint depth;
 
     // spath is where we are, before key press...
     gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &spath, &col);
@@ -4134,7 +4126,6 @@ gtv_sr_motion_cb (GtkTreeSelection *sel, gpointer user_data)
 {
     GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
     GncTreeModelSplitReg *model;
-    GtkTreeModel *s_model;
     GtkTreePath *mpath, *spath;
     Split *split = NULL;
     Transaction *trans = NULL;
@@ -4148,8 +4139,6 @@ gtv_sr_motion_cb (GtkTreeSelection *sel, gpointer user_data)
 
     ENTER("View is %p and Model is %p", view, model);
 
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
     DEBUG("Current trans %p, Split %p, Depth %d and Dirty Trans %p", view->priv->current_trans, view->priv->current_split,
                                                                      view->priv->current_depth, view->priv->dirty_trans);
 
@@ -4669,7 +4658,6 @@ gtv_sr_edited_template_cb (GtkCellRendererText *cell, const gchar *path_string,
     Transaction          *trans;
     gboolean              is_trow1, is_trow2, is_split, is_blank;
     ViewCol               viewcol;
-    char                 *error_loc = NULL;
     Account              *anchor = view->priv->anchor;
 
     editable = g_object_get_data (G_OBJECT (cell), "cell-editable");
@@ -5325,7 +5313,7 @@ gtv_sr_ed_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_dat
     GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
     GncTreeModelSplitReg *model;
     GtkTreeViewColumn *col;
-    GtkTreePath *spath, *start_spath;
+    GtkTreePath *spath;
     gboolean goto_blank = FALSE;
     gboolean next_trans = TRUE;
     Transaction *btrans, *ctrans;
@@ -5527,8 +5515,7 @@ gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable
 {
     GncTreeViewSplitReg  *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
     GncTreeModelSplitReg *model;
-    GtkTreeModel         *s_model;
-    GtkTreePath          *spath, *mpath, *fpath;
+    GtkTreePath          *spath;
     GtkEntry             *entry = NULL;
     ViewCol               viewcol;
     RowDepth              depth;
@@ -5545,8 +5532,6 @@ gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable
 
     model = gnc_tree_view_split_reg_get_model_from_view (view);
 
-    s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
     /* Description / Notes / Memo / Accounts Completion Lists */
     description_list = gnc_tree_model_split_reg_get_description_list (model);
     notes_list = gnc_tree_model_split_reg_get_notes_list (model);
@@ -5814,34 +5799,34 @@ gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable
     LEAVE(" ");
 }
 
-
+#ifdef skip
 // Handle the "match-selected" signal
 static void
 gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
                         GtkTreeIter *iter, gpointer user_data)
 {
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
+//    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
 
 //FIXME g_print("gtv_sr_match_selected_cb\n\n");
 
 /* Not sure what I am going to put in here yet if anything */
-
 }
+#endif
 
-
+#ifdef skip
 // Handle the "changed" signal
 static void
 gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
                         GtkTreeIter *iter, gpointer user_data)
 {
-    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
+//    GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
 
 //FIXME g_print("gtv_sr_changed_cb path string is '%s'\n\n", path_string);
 
 /* Not sure what I am going to put in here yet if anything */
 
 }
-
+#endif
 
 // Handle the "editing-canceled" signal
 static void
@@ -5976,10 +5961,6 @@ gnc_tree_view_split_reg_get_dirty_trans (GncTreeViewSplitReg *view)
 void
 gnc_tree_view_split_reg_set_dirty_trans (GncTreeViewSplitReg *view, Transaction *trans)
 {
-    GncTreeModelSplitReg *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
     if (trans == NULL)
     {
         g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
@@ -6114,10 +6095,6 @@ gnc_tree_view_split_reg_delete_current_trans (GncTreeViewSplitReg *view)
 gboolean
 gnc_tree_view_split_reg_enter (GncTreeViewSplitReg *view)
 {
-    GncTreeModelSplitReg  *model;
-
-    model = gnc_tree_view_split_reg_get_model_from_view (view);
-
     /* Make sure we have stopped editing */
     gnc_tree_view_split_reg_finish_edit (view);
 
@@ -6341,11 +6318,12 @@ gnc_tree_view_split_reg_expand_trans (GncTreeViewSplitReg *view, Transaction *tr
 
     if (gtk_tree_view_get_visible_range (GTK_TREE_VIEW (view), &start_path, &end_path))
     {
-        gint *indices_start, *indices_end;
+//        gint *indices_start;
+        gint *indices_end;
         gint lines = 0;
 
         /* The first and last visible path */
-        indices_start = gtk_tree_path_get_indices (start_path);
+//        indices_start = gtk_tree_path_get_indices (start_path);
         indices_end = gtk_tree_path_get_indices (end_path);
 
         if (model->use_double_line)
diff --git a/src/gnome/gnc-plugin-page-register2.c b/src/gnome/gnc-plugin-page-register2.c
index 20380d5..cfb2dfa 100644
--- a/src/gnome/gnc-plugin-page-register2.c
+++ b/src/gnome/gnc-plugin-page-register2.c
@@ -600,9 +600,6 @@ gnc_plugin_page_register2_new_common (GNCLedgerDisplay2 *ledger)
     GncPluginPageRegister2Private *priv;
     GncPluginPage *plugin_page;
 
-    GncTreeModelSplitReg *model; 
-    GtkTreeView *tv; 
-
     GNCSplitReg2 *gsr;
 
     const GList *item;
@@ -610,7 +607,6 @@ gnc_plugin_page_register2_new_common (GNCLedgerDisplay2 *ledger)
     gchar *label;
     gchar *label_color;
     QofQuery *q;
-    Account *account;
 
     /* Is there an existing page? */
     gsr = gnc_ledger_display2_get_user_data (ledger);
@@ -789,13 +785,11 @@ static void
 gnc_plugin_page_register2_finalize (GObject *object)
 {
     GncPluginPageRegister2 *page;
-    GncPluginPageRegister2Private *priv;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (object));
 
     ENTER("object %p", object);
     page = GNC_PLUGIN_PAGE_REGISTER2 (object);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
+
+    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
 
     G_OBJECT_CLASS (parent_class)->finalize (object);
     LEAVE(" ");
@@ -1079,7 +1073,6 @@ gnc_plugin_page_register2_create_widget (GncPluginPage *plugin_page)
     GncTreeModelSplitReg *model;
     Account *acct;
     gchar **filter;
-    gchar *order;
     int filter_changed = 0;
 
     ENTER("page %p", plugin_page);
@@ -1434,7 +1427,6 @@ gnc_plugin_page_register2_restore_edit_menu (GncPluginPage *page,
         GKeyFile *key_file,
         const gchar *group_name)
 {
-    GncPluginPageRegister2Private *priv;
     GtkAction *action;
     GError *error = NULL;
     gchar *style_name;
@@ -1443,7 +1435,6 @@ gnc_plugin_page_register2_restore_edit_menu (GncPluginPage *page,
     gboolean show_extra_dates;
 
     ENTER(" ");
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
 
     /* Convert the style name to an index */
     style_name = g_key_file_get_string (key_file, group_name,
@@ -1749,14 +1740,12 @@ void
 gnc_plugin_page_register2_set_filter (GncPluginPage *plugin_page, const gchar *filter )
 {
     GncPluginPageRegister2Private *priv;
-    GNCLedgerDisplay2Type ledger_type;
     GNCLedgerDisplay2 *ld;
     Account *leader;
     gchar *default_filter;
 
     priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
     ld = priv->ledger;
-    ledger_type = gnc_ledger_display2_type (ld);
     leader = gnc_ledger_display2_leader (ld);
 
     if (leader != NULL)
@@ -1968,10 +1957,9 @@ gnc_plugin_page_register2_filter_time2dmy (time64 raw_time)
 {
     struct tm * timeinfo;
     gchar date_string[11];
-    gint i;
 
     timeinfo = gnc_localtime (&raw_time);
-    i = strftime (date_string, 11, "%d-%m-%Y", timeinfo);
+    strftime (date_string, 11, "%d-%m-%Y", timeinfo);
     PINFO("Date string is %s", date_string);
 
     gnc_tm_free (timeinfo);
@@ -2093,7 +2081,6 @@ static void
 get_filter_times (GncPluginPageRegister2 *page)
 {
     GncPluginPageRegister2Private *priv;
-    GtkWidget *button, *today, *gde;
     time64 time_val;
 
     priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
@@ -2642,7 +2629,7 @@ gnc_plugin_page_register2_cmd_print_check (GtkAction *action,
     }
     else if (ledger_type == LD2_GL && model->type == SEARCH_LEDGER2)
     {
-        Account *common_acct = NULL, *account;
+        Account *common_acct = NULL;
         splits = qof_query_run (gnc_ledger_display2_get_query (priv->ledger));
         /* Make sure each split is from the same account */
         for (item = splits; item; item = g_list_next (item))
@@ -2700,15 +2687,11 @@ static void
 gnc_plugin_page_register2_cmd_cut (GtkAction *action,
                                   GncPluginPageRegister2 *page) //this works
 {
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
     GtkWidget *window, *widget;
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
 
     ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
 
     window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
     widget = gtk_window_get_focus (GTK_WINDOW (window));
@@ -2725,15 +2708,11 @@ static void
 gnc_plugin_page_register2_cmd_copy (GtkAction *action,
                                    GncPluginPageRegister2 *page) //this works
 {
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
     GtkWidget *window, *widget;
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
 
     ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
 
     window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
     widget = gtk_window_get_focus (GTK_WINDOW (window));
@@ -2750,15 +2729,11 @@ static void
 gnc_plugin_page_register2_cmd_paste (GtkAction *action,
                                     GncPluginPageRegister2 *page) //this works
 {
-    GncPluginPageRegister2Private *priv;
-    GncTreeViewSplitReg *view;
     GtkWidget *window, *widget;
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
 
     ENTER("(action %p, page %p)", action, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
-    view = gnc_ledger_display2_get_split_view_register (priv->ledger);
 
     window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
     widget = gtk_window_get_focus (GTK_WINDOW (window));
@@ -3009,12 +2984,11 @@ gnc_plugin_page_register2_cmd_view_filter_by (GtkAction *action,
 {
     GncPluginPageRegister2Private *priv;
     GNCLedgerDisplay2Type ledger_type;
-    GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table, *hbox;
+    GtkWidget *dialog, *toggle, *button, *table, *hbox;
     time64 start_time, end_time, time_val;
     GtkBuilder *builder;
     gboolean sensitive, value;
     Query *query;
-    GList *split_list;
     gchar *title;
     int i;
 
@@ -3257,7 +3231,6 @@ gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action,
         GncPluginPageRegister2 *plugin_page) // this works
 {
     GncPluginPageRegister2Private *priv;
-    GncTreeModelSplitReg *model;
     GncTreeViewSplitReg *view;
     gboolean show_extra_dates;
 
@@ -3267,7 +3240,6 @@ gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action,
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
 
     priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
-    model = gnc_ledger_display2_get_split_model_register (priv->ledger);
 
     view = gnc_ledger_display2_get_split_view_register (priv->ledger);
 
@@ -3532,7 +3504,6 @@ gnc_plugin_page_register2_cmd_jump (GtkAction *action,
 {
     GncPluginPageRegister2Private *priv;
     GncPluginPage *new_page;
-    GncPluginPageRegister2 *new_reg_page;
     GtkWidget *window;
     GNCLedgerDisplay2 *ld;
     GncTreeViewSplitReg *view, *new_view;
diff --git a/src/gnome/gnc-plugin-register2.c b/src/gnome/gnc-plugin-register2.c
index 53f5b63..7bc7ed5 100644
--- a/src/gnome/gnc-plugin-register2.c
+++ b/src/gnome/gnc-plugin-register2.c
@@ -189,12 +189,9 @@ static void
 gnc_plugin_register2_finalize (GObject *object)
 {
     GncPluginRegister2 *plugin;
-    GncPluginRegister2Private *priv;
-
-    g_return_if_fail (GNC_IS_PLUGIN_REGISTER2 (object));
 
     plugin = GNC_PLUGIN_REGISTER2 (object);
-    priv = GNC_PLUGIN_REGISTER2_GET_PRIVATE(plugin);
+    g_return_if_fail (GNC_IS_PLUGIN_REGISTER2 (plugin));
 
     G_OBJECT_CLASS (parent_class)->finalize (object);
 }
diff --git a/src/gnome/gnc-split-reg2.c b/src/gnome/gnc-split-reg2.c
index f217979..3e63338 100644
--- a/src/gnome/gnc-split-reg2.c
+++ b/src/gnome/gnc-split-reg2.c
@@ -216,11 +216,12 @@ static
 void
 gsr2_setup_table (GNCSplitReg2 *gsr)
 {
-    GncTreeModelSplitReg *model;
+//    GncTreeModelSplitReg *model;
 
     ENTER("gsr=%p", gsr);
 
-    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
+// This dose not do any thing
+//    model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
 
     LEAVE(" ");
 }
@@ -229,7 +230,6 @@ static
 void
 gsr2_create_table (GNCSplitReg2 *gsr)
 {
-    GtkWidget *register_widget;
     GncTreeViewSplitReg *view;
     GncTreeModelSplitReg *model;
     GtkTreeModel *s_model;
@@ -243,7 +243,6 @@ gsr2_create_table (GNCSplitReg2 *gsr)
     GKeyFile *state_file = gnc_state_get_current();
     const GncGUID * guid;
     Account * account;
-    const gchar *sort_string;
 
     account = gnc_ledger_display2_leader (gsr->ledger);
     guid = xaccAccountGetGUID (account);
@@ -565,9 +564,6 @@ gsr2_redraw_all_cb (GncTreeViewSplitReg *view, gpointer user_data)
         GNCPriceDB *pricedb = gnc_pricedb_get_db (book);
         gnc_commodity *commodity = xaccAccountGetCommodity (leader);
         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);
@@ -663,7 +659,6 @@ gsr2_create_balancing_transaction (QofBook *book, Account *account,
 static void
 gnc_split_reg2_sort_changed_cb (GtkTreeSortable *sortable, gpointer user_data)
 {
-    Query *query;
     GNCSplitReg2 *gsr = user_data;
     GncTreeViewSplitReg *view;
     GncTreeModelSplitReg *model;
@@ -679,8 +674,6 @@ gnc_split_reg2_sort_changed_cb (GtkTreeSortable *sortable, gpointer user_data)
     view = gnc_ledger_display2_get_split_view_register (gsr->ledger);
     model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
 
-    query = gnc_ledger_display2_get_query (gsr->ledger);
-
     sort_depth = gnc_tree_view_reg_get_selected_row_depth (view);
     if (sort_depth != 0)
         model->sort_depth = sort_depth;
@@ -966,7 +959,6 @@ void
 gnc_split_reg2_determine_read_only (GNCSplitReg2 *gsr) //this works
 {
     dialog_args *args = g_malloc (sizeof (dialog_args));
-    GncTreeViewSplitReg *view;
 
     if (qof_book_is_readonly (gnc_get_current_book()))
     {
diff --git a/src/gnome/window-reconcile2.c b/src/gnome/window-reconcile2.c
index 9d05340..3d49bba 100644
--- a/src/gnome/window-reconcile2.c
+++ b/src/gnome/window-reconcile2.c
@@ -948,12 +948,9 @@ gnc_reconcile_window_button_press_cb (GtkWidget *widget,
                                       RecnWindow2 *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)
     {
 
diff --git a/src/register/ledger-core/gnc-ledger-display2.c b/src/register/ledger-core/gnc-ledger-display2.c
index d7bf928..7718bec 100644
--- a/src/register/ledger-core/gnc-ledger-display2.c
+++ b/src/register/ledger-core/gnc-ledger-display2.c
@@ -519,6 +519,8 @@ gnc_ledger_display2_parent (void *user_data)
     return gnc_ledger_display2_get_parent( ld );
 }
 
+#ifdef skip
+//FIXME Not used ?
 static void
 gnc_ledger_display2_set_watches (GNCLedgerDisplay2 *ld, GList *splits)
 {
@@ -541,6 +543,7 @@ gnc_ledger_display2_set_watches (GNCLedgerDisplay2 *ld, GList *splits)
                                         QOF_EVENT_MODIFY);
     }
 }
+#endif
 
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
@@ -702,7 +705,7 @@ gnc_ledger_display2_internal (Account *lead_account, Query *q,
     GNCLedgerDisplay2 *ld;
     gint limit;
     const char *klass;
-    GList *splits;
+//    GList *splits;
     gboolean display_subaccounts = FALSE;
     gboolean is_gl = FALSE;
 

commit 3e7235070f3c5dbfca11c55705c3cedf67c65356
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:26:29 2017 +0100

    Code clean up, remove unused variable

diff --git a/src/gnome-utils/gnc-tree-model-price.c b/src/gnome-utils/gnc-tree-model-price.c
index dd7db92..c93d4a1 100644
--- a/src/gnome-utils/gnc-tree-model-price.c
+++ b/src/gnome-utils/gnc-tree-model-price.c
@@ -508,7 +508,7 @@ gnc_tree_model_price_get_iter (GtkTreeModel *tree_model,
     gnc_commodity_namespace *name_space;
     gnc_commodity *commodity = NULL;
     GNCPrice *price;
-    GList *ns_list, *cm_list, *price_list;
+    GList *ns_list, *cm_list;
     guint i, depth;
 
     g_return_val_if_fail (GNC_IS_TREE_MODEL_PRICE (tree_model), FALSE);

commit 583935cc2b9bb2809ef75283be9929b77a43f87d
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:23:32 2017 +0100

    Add a gtk version check for gnc-cell-renderer-popup
    
    The event variable is only used when it is Gtk3.22 or higher

diff --git a/src/gnome-utils/gnc-cell-renderer-popup.c b/src/gnome-utils/gnc-cell-renderer-popup.c
index 1c28af6..880c1ea 100644
--- a/src/gnome-utils/gnc-cell-renderer-popup.c
+++ b/src/gnome-utils/gnc-cell-renderer-popup.c
@@ -223,7 +223,9 @@ gcrp_grab_on_window (GdkWindow *window,
 #endif
     GdkDevice *device;
 
-GdkEvent *event = gtk_get_current_event ();
+#if GTK_CHECK_VERSION(3,22,0)
+    GdkEvent *event = gtk_get_current_event ();
+#endif
 
 #if GTK_CHECK_VERSION(3,20,0)
     seat = gdk_display_get_default_seat (display);

commit 2c23f78d8c8f626587368369946315c3073c33fc
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:22:46 2017 +0100

    Code clean up, remove some variables that were set but never used

diff --git a/src/engine/Scrub.c b/src/engine/Scrub.c
index 1247d4a..edf2fbb 100644
--- a/src/engine/Scrub.c
+++ b/src/engine/Scrub.c
@@ -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);
@@ -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);
@@ -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)
@@ -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);
diff --git a/src/gnome-utils/dialog-options.c b/src/gnome-utils/dialog-options.c
index 7eaf17e..7952bd6 100644
--- a/src/gnome-utils/dialog-options.c
+++ b/src/gnome-utils/dialog-options.c
@@ -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);
 
@@ -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);
 
diff --git a/src/gnome-utils/gnc-dense-cal.c b/src/gnome-utils/gnc-dense-cal.c
index 17a9153..8d2bc32 100644
--- a/src/gnome-utils/gnc-dense-cal.c
+++ b/src/gnome-utils/gnc-dense-cal.c
@@ -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,
diff --git a/src/gnome-utils/gnc-tree-view.c b/src/gnome-utils/gnc-tree-view.c
index 7c74846..3028c99 100644
--- a/src/gnome-utils/gnc-tree-view.c
+++ b/src/gnome-utils/gnc-tree-view.c
@@ -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");
@@ -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 */
@@ -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;
@@ -906,7 +900,6 @@ gnc_tree_view_set_column_order (GncTreeView *view,
                                 gchar **column_names,
                                 gsize length)
 {
-    GncTreeViewPrivate *priv;
     GtkTreeViewColumn *column, *prev;
     const GSList *tmp;
     GSList *columns;
@@ -914,7 +907,6 @@ gnc_tree_view_set_column_order (GncTreeView *view,
 
     /* First, convert from names to pointers */
     ENTER(" ");
-    priv = GNC_TREE_VIEW_GET_PRIVATE(view);
     columns = NULL;
     for (idx = 0; idx < length; idx++)
     {
@@ -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;
diff --git a/src/gnome/dialog-find-account.c b/src/gnome/dialog-find-account.c
index 5d00d48..b82e6b4 100644
--- a/src/gnome/dialog-find-account.c
+++ b/src/gnome/dialog-find-account.c
@@ -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));
diff --git a/src/gnome/dialog-sx-editor.c b/src/gnome/dialog-sx-editor.c
index d4cafbd..76b6948 100644
--- a/src/gnome/dialog-sx-editor.c
+++ b/src/gnome/dialog-sx-editor.c
@@ -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 ();
diff --git a/src/gnome/gnc-plugin-page-sx-list.c b/src/gnome/gnc-plugin-page-sx-list.c
index dfeffd2..221d27e 100644
--- a/src/gnome/gnc-plugin-page-sx-list.c
+++ b/src/gnome/gnc-plugin-page-sx-list.c
@@ -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);
diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c
index 084c60d..45602ff 100644
--- a/src/gnome/gnc-split-reg.c
+++ b/src/gnome/gnc-split-reg.c
@@ -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);
diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c
index 7a4bc8f..2adcb39 100644
--- a/src/gnome/window-reconcile.c
+++ b/src/gnome/window-reconcile.c
@@ -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)
     {
 
diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c
index 9d4034a..3837e32 100644
--- a/src/import-export/import-account-matcher.c
+++ b/src/import-export/import-account-matcher.c
@@ -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;
 
@@ -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");
 
diff --git a/src/import-export/qif-imp/dialog-account-picker.c b/src/import-export/qif-imp/dialog-account-picker.c
index 21ec0a1..b78f306 100644
--- a/src/import-export/qif-imp/dialog-account-picker.c
+++ b/src/import-export/qif-imp/dialog-account-picker.c
@@ -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);
 
@@ -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);
diff --git a/src/register/ledger-core/split-register-model-save.c b/src/register/ledger-core/split-register-model-save.c
index cd8b607..723ce2e 100644
--- a/src/register/ledger-core/split-register-model-save.c
+++ b/src/register/ledger-core/split-register-model-save.c
@@ -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));
@@ -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));
diff --git a/src/report/report-gnome/dialog-custom-report.c b/src/report/report-gnome/dialog-custom-report.c
index 0b26d23..4b0d761 100644
--- a/src/report/report-gnome/dialog-custom-report.c
+++ b/src/report/report-gnome/dialog-custom-report.c
@@ -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",
@@ -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);

commit 64a4e6b1bca90269e3912f4c2b4829c043531604
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:16:42 2017 +0100

    Code clean up, remove some static defines and redundant code

diff --git a/src/engine/gnc-lot.c b/src/engine/gnc-lot.c
index 6745ff5..77b3bec 100644
--- a/src/engine/gnc-lot.c
+++ b/src/engine/gnc-lot.c
@@ -101,11 +101,6 @@ typedef struct LotPrivate
 
 /* ============================================================= */
 
-static void gnc_lot_set_invoice (GNCLot* lot, GncGUID *guid);
-static GncGUID *gnc_lot_get_invoice (GNCLot* lot);
-
-/* ============================================================= */
-
 /* GObject Initialization */
 G_DEFINE_TYPE(GNCLot, gnc_lot, QOF_TYPE_INSTANCE)
 
diff --git a/src/engine/gnc-pricedb.c b/src/engine/gnc-pricedb.c
index 9e7fc2d..87ef307 100644
--- a/src/engine/gnc-pricedb.c
+++ b/src/engine/gnc-pricedb.c
@@ -1555,20 +1555,6 @@ gnc_pricedb_lookup_latest(GNCPriceDB *db,
     return result;
 }
 
-
-static void
-lookup_latest(gpointer key, gpointer val, gpointer user_data)
-{
-    //gnc_commodity *currency = (gnc_commodity *)key;
-    GList *price_list = (GList *)val;
-    GList **return_list = (GList **)user_data;
-
-    if (!price_list) return;
-
-    /* the latest price is the first in list */
-    gnc_price_list_insert(return_list, price_list->data, FALSE);
-}
-
 typedef struct
 {
     GList **list;
diff --git a/src/gnome-utils/dialog-preferences.c b/src/gnome-utils/dialog-preferences.c
index cf51f1b..e7665df 100644
--- a/src/gnome-utils/dialog-preferences.c
+++ b/src/gnome-utils/dialog-preferences.c
@@ -878,10 +878,6 @@ gnc_prefs_connect_radio_button (GtkRadioButton *button)
 
     gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(button)), &group, &pref);
 
-//    active = gnc_prefs_get_bool (group, pref);
-//    DEBUG(" Checkbox %s/%s initially %sactive", group, pref, active ? "" : "in");
-//    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), active);
-
     gnc_prefs_bind (group, pref, G_OBJECT (button), "active");
 
     g_free (group);
@@ -906,10 +902,6 @@ gnc_prefs_connect_check_button (GtkCheckButton *button)
 
     gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(button)), &group, &pref);
 
-//    active = gnc_prefs_get_bool (group, pref);
-//    DEBUG(" Checkbox %s/%s initially %sactive", group, pref, active ? "" : "in");
-//    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), active);
-
     gnc_prefs_bind (group, pref, G_OBJECT (button), "active");
 
     g_free (group);
@@ -934,10 +926,6 @@ gnc_prefs_connect_spin_button (GtkSpinButton *spin)
 
     gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(spin)), &group, &pref);
 
-//    value = gnc_prefs_get_float (group, pref);
-//    gtk_spin_button_set_value(spin, value);
-//    DEBUG(" Spin button %s/%s has initial value %f", group, pref, value);
-
     gnc_prefs_bind (group, pref, G_OBJECT (spin), "value");
 
     g_free (group);
@@ -961,10 +949,6 @@ gnc_prefs_connect_combo_box (GtkComboBox *box)
 
     gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(box)), &group, &pref);
 
-//    active = gnc_prefs_get_int(group, pref);
-//    gtk_combo_box_set_active(GTK_COMBO_BOX(box), active);
-//    DEBUG(" Combo box %s/%s set to item %d", group, pref, active);
-
     gnc_prefs_bind (group, pref, G_OBJECT (box), "active");
 
     g_free (group);
@@ -1013,11 +997,6 @@ gnc_prefs_connect_entry (GtkEntry *entry)
 
     gnc_prefs_split_widget_name (gtk_buildable_get_name(GTK_BUILDABLE(entry)), &group, &pref);
 
-//    text = gnc_prefs_get_string(group, pref);
-//    gtk_entry_set_text(GTK_ENTRY(entry), text ? text : "");
-//    DEBUG(" Entry %s/%s set to '%s'", group, pref, text ? text : "(null)");
-//    g_free(text);
-
     gnc_prefs_bind (group, pref, G_OBJECT (entry), "text");
 
     g_free (group);
diff --git a/src/gnome/dialog-sx-editor2.c b/src/gnome/dialog-sx-editor2.c
index 5fd24d2..74c704c 100644
--- a/src/gnome/dialog-sx-editor2.c
+++ b/src/gnome/dialog-sx-editor2.c
@@ -155,7 +155,6 @@ static void gnc_sxed_freq_changed (GncFrequency *gf, gpointer ud);
 static void sxed_excal_update_adapt_cb (GtkWidget *o, gpointer ud);
 static void gnc_sxed_update_cal (GncSxEditorDialog2 *sxed);
 static void on_sx_check_toggled_cb (GtkWidget *togglebutton, gpointer user_data);
-//void on_sx_check_toggled_cb (GtkWidget *togglebutton, gpointer user_data);
 static void gnc_sxed_reg_check_close (GncSxEditorDialog2 *sxed);
 static gboolean sxed_delete_event (GtkWidget *widget, GdkEvent *event, gpointer ud);
 static gboolean sxed_confirmed_cancel (GncSxEditorDialog2 *sxed);
diff --git a/src/gnome/gnc-plugin-account-tree.c b/src/gnome/gnc-plugin-account-tree.c
index 47915f4..077522d 100644
--- a/src/gnome/gnc-plugin-account-tree.c
+++ b/src/gnome/gnc-plugin-account-tree.c
@@ -47,7 +47,6 @@ static void gnc_plugin_account_tree_finalize (GObject *object);
 
 /* Command callbacks */
 static void gnc_plugin_account_tree_cmd_new_account_tree (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_account_tree_cmd_find_account (GtkAction *action, GncMainWindowActionData *data);
 
 #define PLUGIN_ACTIONS_NAME "gnc-plugin-account-tree-actions"
 #define PLUGIN_UI_FILENAME  "gnc-plugin-account-tree-ui.xml"
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index b95d905..42ca6fb 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -1591,6 +1591,7 @@ gnc_plugin_page_report_save_cb( GtkAction *action, GncPluginPageReport *report )
          */
         save_func = scm_c_eval_string("gnc:report-to-template-update");
         rpt_id = scm_call_1(save_func, priv->cur_report);
+        (void)rpt_id;
     }
     else
     {
@@ -1659,12 +1660,6 @@ gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report
 }
 
 static void
-error_handler(const char *str)
-{
-    PWARN("Report Error: %s", str);
-}
-
-static void
 gnc_plugin_page_report_options_cb( GtkAction *action, GncPluginPageReport *report )
 {
     GncPluginPageReportPrivate *priv;

commit fbd9a36415400aef5a37c8c0ddbe2afc465e9fb1
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:07:38 2017 +0100

    Code clean up, remove unused variables

diff --git a/src/import-export/csv-exp/gnc-plugin-csv-export.c b/src/import-export/csv-exp/gnc-plugin-csv-export.c
index f9dbfe6..a0aa892 100644
--- a/src/import-export/csv-exp/gnc-plugin-csv-export.c
+++ b/src/import-export/csv-exp/gnc-plugin-csv-export.c
@@ -173,7 +173,6 @@ gnc_plugin_csv_export_register_cmd (GtkAction *action,
                                  GncMainWindowActionData *data)
 {
     Query   *query;
-    GList   *splits;
     Account *acc;
 
     GncPluginPage *page = gnc_main_window_get_current_page (data->window);
diff --git a/src/import-export/csv-imp/gnc-csv-gnumeric-popup.c b/src/import-export/csv-imp/gnc-csv-gnumeric-popup.c
index cbc38df..b2a5cc7 100644
--- a/src/import-export/csv-imp/gnc-csv-gnumeric-popup.c
+++ b/src/import-export/csv-imp/gnc-csv-gnumeric-popup.c
@@ -93,7 +93,7 @@ gnumeric_create_popup_menu_list (GSList *elements,
                                  GdkEventButton *event)
 {
     GtkWidget *menu = gtk_menu_new ();
-    GtkWidget *item, *label;
+    GtkWidget *item;
 
     for (; elements != NULL ; elements = elements->next)
     {
diff --git a/src/import-export/import-main-matcher.c b/src/import-export/import-main-matcher.c
index 977d736..15472db 100644
--- a/src/import-export/import-main-matcher.c
+++ b/src/import-export/import-main-matcher.c
@@ -875,7 +875,6 @@ void gnc_gen_trans_list_add_trans_with_ref_id(GNCImportMainMatcher *gui, Transac
     GtkTreeModel *model;
     GtkTreeIter iter;
     GNCImportMatchInfo *selected_match;
-    GncGUID *pending_match_guid;
     gboolean match_selected_manually;
     g_assert (gui);
     g_assert (trans);
diff --git a/src/import-export/import-match-picker.c b/src/import-export/import-match-picker.c
index 235ec03..6559f58 100644
--- a/src/import-export/import-match-picker.c
+++ b/src/import-export/import-match-picker.c
@@ -452,7 +452,6 @@ static void
 init_match_picker_gui(GNCImportMatchPicker * matcher)
 {
     GtkBuilder *builder;
-    gboolean show_reconciled;
 
     /* DEBUG("Begin..."); */
 
diff --git a/src/import-export/ofx/gnc-ofx-kvp.c b/src/import-export/ofx/gnc-ofx-kvp.c
index 8b6f670..223297f 100644
--- a/src/import-export/ofx/gnc-ofx-kvp.c
+++ b/src/import-export/ofx/gnc-ofx-kvp.c
@@ -31,7 +31,6 @@ static const char *KEY_ASSOC_INCOME_ACCOUNT = "ofx/associated-income-account";
 
 Account *gnc_ofx_kvp_get_assoc_account(const Account* investment_account)
 {
-    Account *result = NULL;
     GncGUID *income_guid= NULL;
     g_assert(investment_account);
     qof_instance_get (QOF_INSTANCE (investment_account),
diff --git a/src/plugins/bi_import/dialog-bi-import.c b/src/plugins/bi_import/dialog-bi-import.c
index e7832ee..dce91a2 100644
--- a/src/plugins/bi_import/dialog-bi-import.c
+++ b/src/plugins/bi_import/dialog-bi-import.c
@@ -528,7 +528,6 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
     gchar *new_id = NULL;
     gint64 denom = 0;
     gnc_commodity *currency;
-    Transaction * txn;
 
     // these arguments are needed
     g_return_if_fail (store && book);
diff --git a/src/register/ledger-core/split-register-model-save.c b/src/register/ledger-core/split-register-model-save.c
index 824c9cd..cd8b607 100644
--- a/src/register/ledger-core/split-register-model-save.c
+++ b/src/register/ledger-core/split-register-model-save.c
@@ -727,10 +727,6 @@ gnc_template_register_save_debcred_cell (BasicCell * cell,
 {
     SRSaveData *sd = save_data;
     SplitRegister *reg = user_data;
-    const char *formula;
-    char *error_loc;
-    gnc_numeric amount;
-    gboolean parse_result;
     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) ||
diff --git a/src/register/ledger-core/split-register-model.c b/src/register/ledger-core/split-register-model.c
index db3d5d6..a6ce1ea 100644
--- a/src/register/ledger-core/split-register-model.c
+++ b/src/register/ledger-core/split-register-model.c
@@ -603,7 +603,6 @@ gnc_split_register_get_fg_color_internal (VirtualLocation virt_loc,
     const guint32 red_color = color_table[COLOR_NEGATIVE];
     guint32 fg_color;
     const char * cell_name;
-    gboolean is_current;
     gnc_numeric value;
     Split *split;
 
diff --git a/src/register/register-gnome/gnucash-register.c b/src/register/register-gnome/gnucash-register.c
index a3c9d6e..edc8c3b 100644
--- a/src/register/register-gnome/gnucash-register.c
+++ b/src/register/register-gnome/gnucash-register.c
@@ -407,7 +407,6 @@ static void
 gnucash_register_configure (GnucashSheet *sheet, gchar * state_section)
 {
     GNCHeaderWidths widths;
-    GnucashRegister *greg;
     Table *table;
     GList *node;
     gchar *key;
diff --git a/src/report/report-gnome/dialog-custom-report.c b/src/report/report-gnome/dialog-custom-report.c
index 3db3d9a..0b26d23 100644
--- a/src/report/report-gnome/dialog-custom-report.c
+++ b/src/report/report-gnome/dialog-custom-report.c
@@ -198,7 +198,6 @@ set_reports_view_and_model(CustomReportDialog *crd)
 {
     GtkCellRenderer *renderer;
     GtkTreeModel *model;
-    GtkTreeViewColumn * col;
     gint colnum;
 
     crd->namerenderer = gtk_cell_renderer_text_new();
diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c
index f530cfe..b95d905 100644
--- a/src/report/report-gnome/gnc-plugin-page-report.c
+++ b/src/report/report-gnome/gnc-plugin-page-report.c
@@ -658,7 +658,6 @@ gnc_plugin_page_report_option_change_cb(gpointer data)
     SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
     const gchar *old_name;
     gchar *new_name;
-    gchar *new_name_escaped;
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_REPORT(data));
     report = GNC_PLUGIN_PAGE_REPORT(data);
diff --git a/src/report/report-system/gnc-report.c b/src/report/report-system/gnc-report.c
index b491140..763afad 100644
--- a/src/report/report-system/gnc-report.c
+++ b/src/report/report-system/gnc-report.c
@@ -153,7 +153,6 @@ error_handler(const char *str)
 gboolean
 gnc_run_report (gint report_id, char ** data)
 {
-    gchar *free_data;
     SCM scm_text;
     gchar *str;
 

commit 39232d9ef91947c87b303db6e7e330ec275a743f
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 12:03:11 2017 +0100

    Code clean up, remove unused variables

diff --git a/src/gnome/dialog-imap-editor.c b/src/gnome/dialog-imap-editor.c
index 8897ad3..c984349 100644
--- a/src/gnome/dialog-imap-editor.c
+++ b/src/gnome/dialog-imap-editor.c
@@ -591,7 +591,6 @@ get_account_info (ImapDialog *imap_dialog)
     Account      *root;
     GList        *accts;
     GtkTreeModel *model, *filter;
-    GtkTreeIter   iter;
 
     /* Get list of Accounts */
     root = gnc_book_get_root_account (gnc_get_current_book());
diff --git a/src/gnome/dialog-lot-viewer.c b/src/gnome/dialog-lot-viewer.c
index 628801b..8a8eaaa 100644
--- a/src/gnome/dialog-lot-viewer.c
+++ b/src/gnome/dialog-lot-viewer.c
@@ -982,9 +982,7 @@ static void
 lv_create (GNCLotViewer *lv)
 {
     gchar *win_title;
-    gint position;
     GtkBuilder *builder;
-    GtkWidget *widget;
 
     builder = gtk_builder_new();
     gnc_builder_add_from_file (builder, "dialog-lot-viewer.glade", "lot_viewer_dialog");
diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c
index 15d6d11..0c7f0f2 100644
--- a/src/gnome/dialog-print-check.c
+++ b/src/gnome/dialog-print-check.c
@@ -1606,7 +1606,6 @@ gnc_ui_print_check_dialog_create(GtkWidget *parent,
     PrintCheckDialog *pcd;
     GtkBuilder *builder;
     GtkWidget *table;
-    GtkWindow *window;
     gchar *font;
     Transaction *trans = NULL;
 
diff --git a/src/gnome/dialog-sx-editor.c b/src/gnome/dialog-sx-editor.c
index d5d9107..d4cafbd 100644
--- a/src/gnome/dialog-sx-editor.c
+++ b/src/gnome/dialog-sx-editor.c
@@ -808,7 +808,6 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed )
      *   right... ]
      */
 
-    gboolean multi_commodity = FALSE;
     gint ttVarCount = 0, splitCount = 0;
     static const int NUM_ITERS_WITH_VARS = 5;
     static const int NUM_ITERS_NO_VARS = 1;
@@ -1364,7 +1363,6 @@ schedXact_editor_populate( GncSxEditorDialog *sxed )
     char *name;
     time64 tmpDate;
     SplitRegister *splitReg;
-    struct tm *tmpTm;
     const GDate *gd;
     gint daysInAdvance;
     gboolean enabledState, autoCreateState, notifyState;
diff --git a/src/gnome/dialog-sx-editor2.c b/src/gnome/dialog-sx-editor2.c
index 32cabe8..5fd24d2 100644
--- a/src/gnome/dialog-sx-editor2.c
+++ b/src/gnome/dialog-sx-editor2.c
@@ -1325,7 +1325,6 @@ schedXact_editor_populate (GncSxEditorDialog2 *sxed)
     char *name;
     time64 tmpDate;
     GncTreeModelSplitReg *model;
-    struct tm *tmpTm;
     const GDate *gd;
     gint daysInAdvance;
     gboolean enabledState, autoCreateState, notifyState;
diff --git a/src/gnome/dialog-sx-from-trans.c b/src/gnome/dialog-sx-from-trans.c
index 206155d..d9b8df5 100644
--- a/src/gnome/dialog-sx-from-trans.c
+++ b/src/gnome/dialog-sx-from-trans.c
@@ -340,7 +340,6 @@ sxftd_init( SXFromTransInfo *sxfti )
     gint pos;
     GList *schedule = NULL;
     time64 start_tt;
-    struct tm *tmpTm;
     GDate date, nextDate;
 
     if ( ! sxfti->sx )
@@ -579,7 +578,6 @@ sxftd_freq_combo_changed( GtkWidget *w, gpointer user_data )
     SXFromTransInfo *sxfti = (SXFromTransInfo*)user_data;
     GDate date, nextDate;
     time64 tmp_tt;
-    struct tm *tmpTm;
     GList *schedule = NULL;
 
     tmp_tt = xaccTransGetDate( sxfti->trans );
@@ -676,7 +674,6 @@ gnc_sx_trans_window_response_cb (GtkDialog *dialog,
 static void
 sxftd_update_example_cal( SXFromTransInfo *sxfti )
 {
-    struct tm *tmpTm;
     time64 tmp_tt;
     GDate date, startDate, nextDate;
     GList *schedule = NULL;
diff --git a/src/gnome/dialog-tax-info.c b/src/gnome/dialog-tax-info.c
index 68f9cdf..7608fb7 100644
--- a/src/gnome/dialog-tax-info.c
+++ b/src/gnome/dialog-tax-info.c
@@ -472,7 +472,6 @@ load_tax_entity_type_list (TaxInfoDialog *ti_dialog)
     {
         TaxTypeInfo *tax_type_info;
         SCM type_scm;
-        gchar *str = NULL;
         SCM scm;
 
         type_scm  = SCM_CAR (tax_types);
diff --git a/src/gnome/gnc-budget-view.c b/src/gnome/gnc-budget-view.c
index 5d2e72f..a85e6d9 100644
--- a/src/gnome/gnc-budget-view.c
+++ b/src/gnome/gnc-budget-view.c
@@ -171,8 +171,6 @@ gnc_budget_view_new(GncBudget *budget, AccountFilterDialog* fd)
 {
     GncBudgetView *budget_view;
     GncBudgetViewPrivate *priv;
-    gchar* label;
-    const GList *item;
 
     g_return_val_if_fail(GNC_IS_BUDGET(budget), NULL);
     ENTER(" ");
@@ -254,7 +252,6 @@ static void
 gnc_budget_view_finalize(GObject *object)
 {
     GncBudgetView *view;
-    GncBudgetViewPrivate *priv;
 
     ENTER("object %p", object);
     view = GNC_BUDGET_VIEW(object);
@@ -443,7 +440,6 @@ void
 gnc_budget_view_save(GncBudgetView *view, GKeyFile *key_file, const gchar *group_name)
 {
     GncBudgetViewPrivate *priv;
-    char guid_str[GUID_ENCODING_LENGTH+1];
 
     g_return_if_fail(view != NULL);
     g_return_if_fail(key_file != NULL);
@@ -653,8 +649,6 @@ static void
 gbv_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path,
                      GtkTreeViewColumn *col, GncBudgetView *view)
 {
-    GtkWidget *window;
-    GncPluginPage *new_page;
     Account *account;
 
     g_return_if_fail(GNC_IS_BUDGET_VIEW(view));
@@ -910,9 +904,6 @@ totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
     gint period_num;
     gnc_numeric value; // used to assist in adding and subtracting
     gchar amtbuff[100]; //FIXME: overkill, where's the #define?
-    
-    gint width; // FIXME: VARIABLE NOT NEEDED?
-
     gint i;
     gint num_top_accounts;
 
@@ -1099,7 +1090,6 @@ gbv_col_edited_cb(GtkCellRendererText* cell, gchar* path_string, gchar* new_text
 {
     GncBudgetView *view;
     GncBudgetViewPrivate *priv;
-    const EventInfo* ei;
 
     view = GNC_BUDGET_VIEW(user_data);
     priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
diff --git a/src/gnome/gnc-plugin-basic-commands.c b/src/gnome/gnc-plugin-basic-commands.c
index 687f681..07bb013 100644
--- a/src/gnome/gnc-plugin-basic-commands.c
+++ b/src/gnome/gnc-plugin-basic-commands.c
@@ -509,12 +509,6 @@ gnc_main_window_cmd_file_save_as (GtkAction *action, GncMainWindowActionData *da
 static void
 gnc_main_window_cmd_file_revert (GtkAction *action, GncMainWindowActionData *data)
 {
-    GtkWidget *dialog;
-    QofSession *session;
-    QofBook *book;
-    const gchar *filename, *tmp;
-    const gchar *title = _("Reverting will discard all unsaved changes to %s. Are you sure you want to proceed ?");
-
     g_return_if_fail (data != NULL);
 
     if (!gnc_main_window_all_finish_pending())
diff --git a/src/gnome/gnc-plugin-page-budget.c b/src/gnome/gnc-plugin-page-budget.c
index de61cf4..e9f350a 100644
--- a/src/gnome/gnc-plugin-page-budget.c
+++ b/src/gnome/gnc-plugin-page-budget.c
@@ -347,7 +347,6 @@ static void
 gnc_plugin_page_budget_finalize (GObject *object)
 {
     GncPluginPageBudget *page;
-    GncPluginPageBudgetPrivate *priv;
 
     ENTER("object %p", object);
     page = GNC_PLUGIN_PAGE_BUDGET (object);
@@ -410,10 +409,6 @@ gnc_plugin_page_budget_create_widget (GncPluginPage *plugin_page)
 {
     GncPluginPageBudget *page;
     GncPluginPageBudgetPrivate *priv;
-    GtkTreeSelection *selection;
-    GtkTreeView *tree_view;
-    GtkWidget *scrolled_window;
-    const gchar *budget_guid_str;
 
     ENTER("page %p", plugin_page);
     page = GNC_PLUGIN_PAGE_BUDGET (plugin_page);
diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c
index 83d8822..084c60d 100644
--- a/src/gnome/gnc-split-reg.c
+++ b/src/gnome/gnc-split-reg.c
@@ -1090,7 +1090,6 @@ gsr_default_execassociated_handler (GNCSplitReg *gsr, gpointer data)
     SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
     Transaction *trans;
     Split *split = gnc_split_register_get_current_split (reg);
-    GtkWidget *dialog;
     const char *uri;
     const char *run_uri;
     gchar *uri_scheme;
diff --git a/src/gnome/reconcile-view.c b/src/gnome/reconcile-view.c
index 1732893..da320e1 100644
--- a/src/gnome/reconcile-view.c
+++ b/src/gnome/reconcile-view.c
@@ -643,7 +643,6 @@ gnc_reconcile_view_set_list ( GNCReconcileView  *view, gboolean reconcile)
     GNCQueryView      *qview = GNC_QUERY_VIEW(view);
     GtkTreeSelection  *selection;
     GtkTreeModel      *model;
-    GtkTreeIter        iter;
     gpointer           entry;
     gboolean           toggled;
     GList             *node;
@@ -691,7 +690,6 @@ gnc_reconcile_view_set_toggle (GNCReconcileView  *view)
     GNCQueryView      *qview = GNC_QUERY_VIEW(view);
     GtkTreeSelection  *selection;
     GtkTreeModel      *model;
-    GtkTreeIter        iter;
     gboolean           toggled;
     GList             *node;
     GList             *list_of_rows;
@@ -732,11 +730,7 @@ gnc_reconcile_view_key_press_cb (GtkWidget *widget, GdkEventKey *event,
                             gpointer user_data)
 {
     GNCReconcileView  *view = GNC_RECONCILE_VIEW(user_data);
-    GNCQueryView      *qview = GNC_QUERY_VIEW(widget);
-    GtkTreeModel      *model;
-    GtkTreeIter        iter;
-    gpointer           entry, pointer;
-    gboolean           valid, toggle;
+    gboolean           toggle;
 
     switch (event->keyval)
     {
diff --git a/src/gnome/top-level.c b/src/gnome/top-level.c
index 9a145d6..89c7b57 100644
--- a/src/gnome/top-level.c
+++ b/src/gnome/top-level.c
@@ -311,7 +311,6 @@ gnc_save_all_state (gpointer session, gpointer unused)
     QofBook *book;
     gchar guid_string[GUID_ENCODING_LENGTH+1];
     const GncGUID *guid;
-    GError *error = NULL;
     GKeyFile *keyfile = NULL;
 
     keyfile = gnc_state_get_current ();
@@ -322,7 +321,6 @@ gnc_save_all_state (gpointer session, gpointer unused)
          */
         gsize num_groups, curr;
         gchar **groups = g_key_file_get_groups (keyfile, &num_groups);
-        gchar *group = NULL;
         for (curr=0; curr < num_groups; curr++)
         {
             if (g_str_has_prefix (groups[curr], "Window ") ||
diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c
index ce7fe1d..7a4bc8f 100644
--- a/src/gnome/window-reconcile.c
+++ b/src/gnome/window-reconcile.c
@@ -694,7 +694,6 @@ startRecnWindow(GtkWidget *parent, Account *account,
     gboolean auto_interest_xfer_option;
     GNCPrintAmountInfo print_info;
     gnc_numeric ending;
-    gboolean has_uniform_currency;
     char *title;
     int result;
 
@@ -1445,7 +1444,6 @@ gnc_get_reconcile_info (Account *account,
     gboolean always_today;
     GDate date;
     time64 today;
-    struct tm tm;
 
     g_date_clear(&date, 1);
 
diff --git a/src/gnome/window-reconcile2.c b/src/gnome/window-reconcile2.c
index e01eb5d..9d05340 100644
--- a/src/gnome/window-reconcile2.c
+++ b/src/gnome/window-reconcile2.c
@@ -1408,7 +1408,6 @@ gnc_get_reconcile_info (Account *account,
     gboolean always_today;
     GDate date;
     time64 today;
-    struct tm tm;
 
     g_date_clear(&date, 1);
 

commit 0d4bf85718532a3bb08199f8afa3bc68b8f184af
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:57:01 2017 +0100

    Code clean up, remove unused variables

diff --git a/src/gnome-search/dialog-search.c b/src/gnome-search/dialog-search.c
index fcb208e..07851de 100644
--- a/src/gnome-search/dialog-search.c
+++ b/src/gnome-search/dialog-search.c
@@ -147,8 +147,6 @@ gnc_search_callback_button_execute (GNCSearchCallbackButton *cb,
 {
     GNCQueryView     *qview = GNC_QUERY_VIEW(sw->result_view);
     GtkTreeSelection *selection;
-    GtkTreeModel     *model;
-    GtkTreeIter       iter;
 
     // Sanity check
     g_assert(qview);
@@ -188,7 +186,6 @@ gnc_search_dialog_result_clicked (GtkButton *button, GNCSearchWindow *sw)
 static void
 gnc_search_dialog_select_buttons_enable (GNCSearchWindow *sw, gint selected)
 {
-    gint i;
     gboolean enable, read_only;
     GList  *blist;
 
diff --git a/src/gnome-utils/dialog-dup-trans.c b/src/gnome-utils/dialog-dup-trans.c
index 3b4a530..f79481f 100644
--- a/src/gnome-utils/dialog-dup-trans.c
+++ b/src/gnome-utils/dialog-dup-trans.c
@@ -121,7 +121,6 @@ gnc_dup_trans_dialog_create (GtkWidget * parent, DupTransDialog *dt_dialog,
     {
         GtkWidget *date_edit;
         GtkWidget *hbox;
-        GtkWidget *label;
 
         date_edit = gnc_date_edit_new (date, FALSE, FALSE);
         gnc_date_activates_default(GNC_DATE_EDIT(date_edit), TRUE);
diff --git a/src/gnome-utils/dialog-options.c b/src/gnome-utils/dialog-options.c
index 25903e6..7eaf17e 100644
--- a/src/gnome-utils/dialog-options.c
+++ b/src/gnome-utils/dialog-options.c
@@ -2093,7 +2093,6 @@ component_close_handler (gpointer data)
 static void
 refresh_handler (GHashTable *changes, gpointer user_data)
 {
-    GNCOptionWin *retval = user_data;
     gnc_commodity *commodity = NULL;
     GtkTreeIter iter;
 
@@ -3604,7 +3603,6 @@ gnc_option_set_ui_value_currency_accounting (GNCOption *option,
             else
             {
                 GtkWidget *button = NULL;
-                int i;
                 gpointer val;
 
                 switch (index)
diff --git a/src/gnome-utils/dialog-preferences.c b/src/gnome-utils/dialog-preferences.c
index 5776951..cf51f1b 100644
--- a/src/gnome-utils/dialog-preferences.c
+++ b/src/gnome-utils/dialog-preferences.c
@@ -549,7 +549,6 @@ gnc_preferences_build_page (gpointer data,
     GtkNotebook *notebook;
     addition *add_in;
     struct copy_data copydata;
-    gint rows, cols;
     gchar **widgetname;
     gint i;
 
@@ -613,7 +612,6 @@ gnc_preferences_build_page (gpointer data,
     if (!existing_content)
     {
         /* No existing content with this name.  Create a blank page */
-        rows = 0;
         existing_content = gtk_grid_new();
         gtk_container_set_border_width(GTK_CONTAINER(existing_content), 6);
         label = gtk_label_new(add_in->tabname);
@@ -713,7 +711,6 @@ static void
 gnc_prefs_connect_font_button (GtkFontButton *fb)
 {
     gchar *group, *pref;
-    gchar *font;
 
     g_return_if_fail(GTK_IS_FONT_BUTTON(fb));
 
@@ -876,7 +873,6 @@ static void
 gnc_prefs_connect_radio_button (GtkRadioButton *button)
 {
     gchar *group, *pref;
-    gboolean active;
 
     g_return_if_fail(GTK_IS_RADIO_BUTTON(button));
 
@@ -905,7 +901,6 @@ static void
 gnc_prefs_connect_check_button (GtkCheckButton *button)
 {
     gchar *group, *pref;
-    gboolean active;
 
     g_return_if_fail(GTK_IS_CHECK_BUTTON(button));
 
@@ -934,7 +929,6 @@ static void
 gnc_prefs_connect_spin_button (GtkSpinButton *spin)
 {
     gchar *group, *pref;
-    gdouble value;
 
     g_return_if_fail(GTK_IS_SPIN_BUTTON(spin));
 
@@ -962,7 +956,6 @@ static void
 gnc_prefs_connect_combo_box (GtkComboBox *box)
 {
     gchar *group, *pref;
-    gint active;
 
     g_return_if_fail(GTK_IS_COMBO_BOX(box));
 
@@ -989,9 +982,7 @@ gnc_prefs_connect_combo_box (GtkComboBox *box)
 static void
 gnc_prefs_connect_currency_edit (GNCCurrencyEdit *gce, const gchar *boxname )
 {
-    gnc_commodity *currency;
     gchar *group, *pref;
-    gchar *mnemonic;
 
     g_return_if_fail(GNC_IS_CURRENCY_EDIT(gce));
 
@@ -1017,7 +1008,6 @@ static void
 gnc_prefs_connect_entry (GtkEntry *entry)
 {
     gchar *group, *pref;
-    gchar *text;
 
     g_return_if_fail(GTK_IS_ENTRY(entry));
 
@@ -1046,7 +1036,6 @@ static void
 gnc_prefs_connect_period_select (GncPeriodSelect *period, const gchar *boxname )
 {
     gchar *group, *pref;
-    gchar *mnemonic;
 
     g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
 
@@ -1070,7 +1059,6 @@ static void
 gnc_prefs_connect_date_edit (GNCDateEdit *gde , const gchar *boxname )
 {
     gchar *group, *pref;
-    gchar *mnemonic;
 
     g_return_if_fail(GNC_IS_DATE_EDIT(gde));
 
@@ -1244,7 +1232,6 @@ gnc_preferences_dialog_create(void)
     gnc_commodity *locale_currency;
     const gchar *currency_name;
     QofBook *book;
-    gint64 month, day;
     GDate fy_end;
     gboolean date_is_valid = FALSE;
 
diff --git a/src/gnome-utils/dialog-query-view.c b/src/gnome-utils/dialog-query-view.c
index 35cc6a7..6e2d1d4 100644
--- a/src/gnome-utils/dialog-query-view.c
+++ b/src/gnome-utils/dialog-query-view.c
@@ -181,7 +181,7 @@ gnc_dialog_query_view_new (GList *param_list, Query *q)
 {
     GtkBuilder  *builder;
     DialogQueryView *dqv;
-    GtkWidget *result_hbox, *close, *scrollWin, *frame, *but_hbox;
+    GtkWidget *result_hbox, *close, *scrollWin, *frame;
     GList *node;
 
     dqv = g_new0 (DialogQueryView, 1);
diff --git a/src/gnome-utils/dialog-transfer.c b/src/gnome-utils/dialog-transfer.c
index 182add6..59cd549 100644
--- a/src/gnome-utils/dialog-transfer.c
+++ b/src/gnome-utils/dialog-transfer.c
@@ -1065,7 +1065,6 @@ gnc_xfer_to_amount_update_cb(GtkWidget *widget, GdkEventFocus *event,
 {
     XferDialog *xferData = data;
     gnc_numeric price_value;
-    Account *account;
 
     gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (xferData->to_amount_edit));
     price_value = gnc_xfer_dialog_compute_price_value(xferData);
@@ -1799,7 +1798,6 @@ gnc_xfer_dialog_close_cb(GtkDialog *dialog, gpointer data)
 void
 gnc_xfer_dialog_fetch (GtkButton *button, XferDialog *xferData)
 {
-    GNCPrice *prc;
     PriceReq pr;
     SCM quotes_func;
     SCM book_scm;
diff --git a/src/gnome-utils/gnc-cell-renderer-date.c b/src/gnome-utils/gnc-cell-renderer-date.c
index 11ff18d..c37a228 100644
--- a/src/gnome-utils/gnc-cell-renderer-date.c
+++ b/src/gnome-utils/gnc-cell-renderer-date.c
@@ -134,7 +134,6 @@ gcrd_init (GncCellRendererDate *date)
 	GncCellRendererPopup *popup;
 	GtkWidget                *frame;
 	GtkWidget                *vbox;
-	GtkWidget                *bbox;
 	GtkWidget                *button;
 
 	popup = GNC_CELL_RENDERER_POPUP (date);
@@ -312,7 +311,6 @@ gcrd_show (GncCellRendererPopup *cell,
 	gint                     year;
 	gint                     month;
 	gint                     day;
-	gint                     index;
 	const gchar             *text;
 
 	if (parent_class->show_popup) {
@@ -342,7 +340,6 @@ gcrd_show (GncCellRendererPopup *cell,
 
 	gtk_calendar_select_day (GTK_CALENDAR (date->calendar), day);
 	gtk_calendar_mark_day (GTK_CALENDAR (date->calendar), day);
-	
 }
 
 GtkCellRenderer *
diff --git a/src/gnome-utils/gnc-combott.c b/src/gnome-utils/gnc-combott.c
index d10c080..ea5bfd1 100644
--- a/src/gnome-utils/gnc-combott.c
+++ b/src/gnome-utils/gnc-combott.c
@@ -453,13 +453,9 @@ gctt_rebuild_menu (GncCombott *combott, GtkTreeModel *model)
 static void
 gctt_refresh_menu (GncCombott *combott, GtkTreeModel *model)
 {
-    GncCombottPrivate *priv;
-
     g_return_if_fail (GNC_IS_COMBOTT (combott));
     g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
 
-    priv = GNC_COMBOTT_GET_PRIVATE (combott);
-
     gctt_rebuild_menu(combott, model);
 }
 
@@ -565,7 +561,6 @@ which_tooltip_cb (GtkWidget  *widget, gint x, gint y, gboolean keyboard_mode, Gt
         gtk_tree_model_get( priv->model, &priv->active_iter, priv->tip_col, &text, -1 );
         if(g_strcmp0(text, "") && (text != NULL))
         {
-            gchar *label = "";
             gtk_tooltip_set_text (tooltip, text);
             g_free(text);
             return TRUE;
@@ -699,7 +694,6 @@ gnc_combott_set_active (GncCombott *combott, gint index)
     GtkTreeIter iter;
     gboolean valid = TRUE;
     gint active = 1;
-    gint num = 1;
 
     g_return_if_fail (GNC_IS_COMBOTT (combott));
     g_return_if_fail (index >= -1);
diff --git a/src/gnome-utils/gnc-currency-edit.c b/src/gnome-utils/gnc-currency-edit.c
index 2abf9d6..e9380d1 100644
--- a/src/gnome-utils/gnc-currency-edit.c
+++ b/src/gnome-utils/gnc-currency-edit.c
@@ -302,7 +302,6 @@ static void gnc_currency_edit_active_changed (GtkComboBox *gobject,
         gpointer     user_data)
 {
     GNCCurrencyEdit *self = GNC_CURRENCY_EDIT (gobject);
-    GNCCurrencyEditPrivate *priv = GET_PRIVATE (self);
 
     gnc_commodity *currency = gnc_currency_edit_get_currency (self);
     const gchar *mnemonic = gnc_commodity_get_mnemonic (currency);
diff --git a/src/gnome-utils/gnc-date-edit.c b/src/gnome-utils/gnc-date-edit.c
index 47f3a22..1c9dcbe 100644
--- a/src/gnome-utils/gnc-date-edit.c
+++ b/src/gnome-utils/gnc-date-edit.c
@@ -893,7 +893,6 @@ create_children (GNCDateEdit *gde)
     GtkWidget *frame;
     GtkWidget *hbox;
     GtkWidget *arrow;
-    GtkComboBox  *combo;
     GtkTreeStore *store;
     GtkCellRenderer *cell;
 
@@ -1170,7 +1169,6 @@ time64
 gnc_date_edit_get_date (GNCDateEdit *gde)
 {
     struct tm tm;
-    time64 retval;
 
     g_return_val_if_fail (gde != NULL, 0);
     g_return_val_if_fail (GNC_IS_DATE_EDIT (gde), 0);
diff --git a/src/gnome-utils/gnc-file.c b/src/gnome-utils/gnc-file.c
index 3431df2..6682145 100644
--- a/src/gnome-utils/gnc-file.c
+++ b/src/gnome-utils/gnc-file.c
@@ -950,7 +950,6 @@ RESTART:
             QofBook *book = qof_session_get_book (new_session);
             gchar *msg = gnc_features_test_unknown (book);
             Account *template_root = gnc_book_get_template_root (book);
-            GList *child = NULL;
 
             if (msg)
             {
diff --git a/src/gnome-utils/gnc-frequency.c b/src/gnome-utils/gnc-frequency.c
index bea1fee..7f79390 100644
--- a/src/gnome-utils/gnc-frequency.c
+++ b/src/gnome-utils/gnc-frequency.c
@@ -228,7 +228,6 @@ gnc_frequency_init(GncFrequency *gf)
     gf->startDate = GNC_DATE_EDIT(gnc_date_edit_new(time(NULL), FALSE, FALSE));
     /* Add the new widget to the table. */
     {
-        gint dont_expand_or_fill = 0;
         GtkWidget *table = GTK_WIDGET(gtk_builder_get_object (builder, "gncfreq_table"));
         gtk_grid_attach(GTK_GRID(table), GTK_WIDGET(gf->startDate), 4, 0, 1, 1);
         gtk_widget_set_vexpand (GTK_WIDGET(gf->startDate), FALSE);
diff --git a/src/gnome-utils/gnc-icons.c b/src/gnome-utils/gnc-icons.c
index b9d19d5..a4077d1 100644
--- a/src/gnome-utils/gnc-icons.c
+++ b/src/gnome-utils/gnc-icons.c
@@ -64,7 +64,6 @@ void
 gnc_load_app_icons (void)
 {
     GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
-    gchar *file;
     const gchar *default_path;
     gchar* pkgdatadir = gnc_path_get_pkgdatadir ();
     gchar* datadir = gnc_path_get_datadir ();
diff --git a/src/gnome-utils/gnc-main-window.c b/src/gnome-utils/gnc-main-window.c
index fbde441..437bb1f 100644
--- a/src/gnome-utils/gnc-main-window.c
+++ b/src/gnome-utils/gnc-main-window.c
@@ -3844,7 +3844,7 @@ gnc_main_window_switch_page (GtkNotebook *notebook,
     GncMainWindowPrivate *priv;
     GtkWidget *child;
     GncPluginPage *page;
-    gboolean immutable, visible;
+    gboolean visible;
 
     ENTER("Notebook %p, page, %p, index %d, window %p",
           notebook, notebook_page, pos, window);
diff --git a/src/gnome-utils/gnc-query-view.c b/src/gnome-utils/gnc-query-view.c
index 7e8382c..12ac44e 100644
--- a/src/gnome-utils/gnc-query-view.c
+++ b/src/gnome-utils/gnc-query-view.c
@@ -418,11 +418,7 @@ gnc_query_view_init_view (GNCQueryView *qview)
 static void
 gnc_query_view_class_init (GNCQueryViewClass *klass)
 {
-    GtkWidgetClass       *widget_class;
-    GtkTreeViewClass     *view_class;
-
-    widget_class = (GtkWidgetClass*) klass;
-    view_class =   (GtkTreeViewClass*) klass;
+    GtkWidgetClass *widget_class = (GtkWidgetClass*) klass;
 
     parent_class = g_type_class_peek (GTK_TYPE_TREE_VIEW);
 
@@ -474,7 +470,6 @@ gnc_query_view_select_row_cb (GtkTreeSelection *selection, gpointer user_data)
 {
     GNCQueryView   *qview = GNC_QUERY_VIEW (gtk_tree_selection_get_tree_view (selection));
     GtkTreeModel   *model;
-    GtkTreeIter     iter;
     gint            number_of_rows;
     gpointer        entry = NULL;
     GList          *node;
@@ -687,8 +682,6 @@ void
 gnc_query_view_refresh (GNCQueryView *qview)
 {
     GtkTreeModel     *model;
-    GtkTreeIter       iter;
-    GtkTreeSelection *selection;
     GList            *old_entry;
 
     g_return_if_fail (qview != NULL);
diff --git a/src/gnome-utils/gnc-tree-view.c b/src/gnome-utils/gnc-tree-view.c
index 009030a..7c74846 100644
--- a/src/gnome-utils/gnc-tree-view.c
+++ b/src/gnome-utils/gnc-tree-view.c
@@ -678,7 +678,6 @@ gnc_tree_view_update_visibility (GtkTreeViewColumn *column,
                                  GncTreeView *view)
 {
     GncTreeViewPrivate *priv;
-    gchar *name, *key;
     gboolean visible;
 
     g_return_if_fail(GTK_IS_TREE_VIEW_COLUMN(column));
@@ -741,7 +740,7 @@ gnc_tree_view_get_sort_column (GncTreeView *view)
     GtkTreeModel *s_model;
     GtkTreeViewColumn *column;
     GtkSortType order;
-    gint model_column, current;
+    gint current;
     const gchar *name;
 
     s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
@@ -1627,7 +1626,6 @@ gnc_tree_view_column_properties (GncTreeView *view,
     GtkTreeModel *s_model;
     gboolean visible;
     int width = 0;
-    gchar *key;
 
     /* Set data used by other functions */
     if (pref_name)
diff --git a/src/gnome-utils/search-param.c b/src/gnome-utils/search-param.c
index 1dd8eb2..ababab3 100644
--- a/src/gnome-utils/search-param.c
+++ b/src/gnome-utils/search-param.c
@@ -561,7 +561,6 @@ gnc_search_param_prepend_compound (GList *list, char const *title,
                                    GtkJustification justify,
                                    GNCSearchParamKind kind)
 {
-    GList *result;
     GList *p;
     QofIdTypeConst type = NULL;
     GNCSearchParamCompound *param;

commit 69e927a3a97d55b37073d513f8aaed44bde77f89
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:45:55 2017 +0100

    Code clean up, remove unused variables

diff --git a/src/app-utils/gfec.c b/src/app-utils/gfec.c
index 94f6876..b27c911 100644
--- a/src/app-utils/gfec.c
+++ b/src/app-utils/gfec.c
@@ -154,7 +154,6 @@ gfec_eval_string(const char *str, gfec_error_handler error_handler)
 SCM
 gfec_eval_file(const char *file, gfec_error_handler error_handler)
 {
-    char *err_msg = NULL;
     gchar *contents = NULL;
     GError *save_error = NULL;
     SCM result;
diff --git a/src/app-utils/gnc-accounting-period.c b/src/app-utils/gnc-accounting-period.c
index a415643..f947e71 100644
--- a/src/app-utils/gnc-accounting-period.c
+++ b/src/app-utils/gnc-accounting-period.c
@@ -60,11 +60,9 @@ static time64 gnc_accounting_period_end_time64 (GncAccountingPeriod which,
 static time64
 lookup_start_date_option(GDate *fy_end)
 {
-    gchar *choice;
     time64 time;
     int which;
 
-
     if (gnc_prefs_get_bool (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_CHOICE_ABS))
         time = gnc_prefs_get_int64 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE);
     else
diff --git a/src/app-utils/gnc-gsettings.c b/src/app-utils/gnc-gsettings.c
index aa6a5ea..00f2f53 100644
--- a/src/app-utils/gnc-gsettings.c
+++ b/src/app-utils/gnc-gsettings.c
@@ -620,7 +620,6 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
     xmlChar *newURL;
     gchar *tmpdir = g_build_filename (g_get_home_dir (), ".gnc-migration-tmp", NULL);
 
-    int i;
     const char *lastsegment = URL;
     const char *iter = URL;
 
@@ -700,7 +699,7 @@ void gnc_gsettings_migrate_from_gconf (void)
     gchar *pkgdatadir, *stylesheet, *input, *output, *command;
     gchar *gconf_root, *gconf_apps, *gconf_gnucash;
     gchar *base_dir, *iter;
-    SCM migr_script, result;
+    SCM migr_script;
     xsltStylesheetPtr stylesheetptr = NULL;
     xmlDocPtr inputxml, transformedxml;
     FILE *outfile;
diff --git a/src/app-utils/gnc-state.c b/src/app-utils/gnc-state.c
index b5cdfa5..2829439 100644
--- a/src/app-utils/gnc-state.c
+++ b/src/app-utils/gnc-state.c
@@ -70,7 +70,7 @@ static void
 gnc_state_set_base (const QofSession *session)
 {
     gchar *basename, *original = NULL, *filename, *file_guid;
-    gchar *sf_extension = NULL, *newstyle_filename = NULL;
+    gchar *sf_extension = NULL;
     const gchar *uri;
     gchar guid_string[GUID_ENCODING_LENGTH+1];
     QofBook *book;
@@ -200,10 +200,6 @@ gnc_state_set_base (const QofSession *session)
 
 GKeyFile *gnc_state_load (const QofSession *session)
 {
-
-    GKeyFile *keyfile = NULL;
-    GError *error = NULL;
-
     /* Drop possible previous state_file first */
     if (state_file)
     {
@@ -221,7 +217,6 @@ GKeyFile *gnc_state_load (const QofSession *session)
                      TRUE, TRUE, NULL);
 
     return gnc_state_get_current ();
-
 }
 
 void gnc_state_save (const QofSession *session)
diff --git a/src/app-utils/gnc-ui-util.c b/src/app-utils/gnc-ui-util.c
index 1e2eaa4..42597fc 100644
--- a/src/app-utils/gnc-ui-util.c
+++ b/src/app-utils/gnc-ui-util.c
@@ -1584,7 +1584,6 @@ xaccSPrintAmount (char * bufp, gnc_numeric val, GNCPrintAmountInfo info)
     char sign_posn;
 
     gboolean print_sign = TRUE;
-    gboolean is_shares = FALSE;
     gboolean print_absolute = FALSE;
 
     if (!bufp)
diff --git a/src/app-utils/option-util.c b/src/app-utils/option-util.c
index 97ca521..8a45ea7 100644
--- a/src/app-utils/option-util.c
+++ b/src/app-utils/option-util.c
@@ -1726,7 +1726,6 @@ gnc_commit_option(GNCOption *option)
         char *section, *name;
         const gchar *message;
         const gchar *format = _("There is a problem with option %s:%s.\n%s");
-        char * str;
 
         /* Second element is error message */
         oops = SCM_CADR(result);
@@ -2619,8 +2618,6 @@ gnc_option_db_set_string_option(GNCOptionDB *odb,
 char *
 gnc_option_date_option_get_subtype(GNCOption *option)
 {
-    SCM value;
-
     initialize_getters();
 
     return gnc_scm_call_1_symbol_to_string(getters.date_option_subtype, option->guile_option);
@@ -2636,8 +2633,6 @@ gnc_option_date_option_get_subtype(GNCOption *option)
 char *
 gnc_date_option_value_get_type (SCM option_value)
 {
-    SCM value;
-
     initialize_getters();
 
     return gnc_scm_call_1_symbol_to_string (getters.date_option_value_type, option_value);
@@ -2687,8 +2682,6 @@ gnc_date_option_value_get_relative (SCM option_value)
 char *
 gnc_plot_size_option_value_get_type (SCM option_value)
 {
-    SCM value;
-
     initialize_getters();
 
     return gnc_scm_call_1_symbol_to_string (getters.plot_size_option_value_type, option_value);
diff --git a/src/bin/gnucash-bin.c b/src/bin/gnucash-bin.c
index 8d37ec6..21b2389 100644
--- a/src/bin/gnucash-bin.c
+++ b/src/bin/gnucash-bin.c
@@ -613,7 +613,6 @@ inner_main (void *closure, int argc, char **argv)
 {
     SCM main_mod;
     char* fn;
-    GError *error = NULL;
 
     scm_c_eval_string("(debug-set! stack 200000)");
 
diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c
index e9c39c9..8af5b38 100644
--- a/src/business/business-gnome/dialog-invoice.c
+++ b/src/business/business-gnome/dialog-invoice.c
@@ -842,7 +842,6 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
         GNCPrice *convprice;
         gnc_commodity *account_currency = (gnc_commodity*)key;
         gnc_numeric *amount = (gnc_numeric*)value;
-        Timespec pricedate;
         XferDialog *xfer;
         gnc_numeric exch_rate;
 
@@ -2246,7 +2245,6 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
 {
     GncInvoice *invoice;
     GtkBuilder *builder;
-    GtkWidget *id_label;
     GtkWidget *dialog, *hbox;
     GncEntryLedger *entry_ledger = NULL;
     GncOwnerType owner_type;
@@ -2595,7 +2593,6 @@ gnc_invoice_window_new_invoice (InvoiceDialogType dialog_type, QofBook *bookp,
 
     if (dialog_type == DUP_INVOICE)
     {
-        GtkWidget *invoice_radio = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_invoice_type"));
         GtkWidget *cn_radio = GTK_WIDGET (gtk_builder_get_object (builder, "dialog_creditnote_type"));
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(cn_radio), gncInvoiceGetIsCreditNote (invoice));
@@ -3288,7 +3285,6 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance, GncWhichDueTy
     DialogQueryView *dialog;
     gint len;
     Timespec ts;
-    QofQueryCompare comparetype;
     static GList *param_list = NULL;
     static GNCDisplayViewButton vendorbuttons[] =
     {
diff --git a/src/business/business-gnome/dialog-payment.c b/src/business/business-gnome/dialog-payment.c
index 7a6dc44..c05ed3d 100644
--- a/src/business/business-gnome/dialog-payment.c
+++ b/src/business/business-gnome/dialog-payment.c
@@ -192,10 +192,8 @@ static gboolean
 gnc_payment_window_check_payment (PaymentWindow *pw)
 {
     const char *conflict_msg = NULL;
-    Account *post, *acc;
     gnc_numeric amount_deb, amount_cred;
     gboolean enable_xfer_acct = TRUE;
-    GtkTreeSelection *selection;
 
     if (!pw)
         return FALSE;
diff --git a/src/business/business-ledger/gncEntryLedgerModel.c b/src/business/business-ledger/gncEntryLedgerModel.c
index 87b8991..3b08fdd 100644
--- a/src/business/business-ledger/gncEntryLedgerModel.c
+++ b/src/business/business-ledger/gncEntryLedgerModel.c
@@ -923,7 +923,6 @@ gnc_entry_ledger_get_color_internal (VirtualLocation virt_loc,
                                      const guint32 *color_table,
                                      gboolean foreground)
 {
-    const char *cursor_name;
     VirtualCell *vcell;
     gboolean is_current;
     guint32 colorbase = 0; /* By default return background colors */
diff --git a/src/core-utils/gnc-filepath-utils.c b/src/core-utils/gnc-filepath-utils.c
index 3048297..041e940 100644
--- a/src/core-utils/gnc-filepath-utils.c
+++ b/src/core-utils/gnc-filepath-utils.c
@@ -269,7 +269,6 @@ gnc_path_find_localized_html_file (const gchar *file_name)
     gchar *loc_file_name = NULL;
     gchar *full_path = NULL;
     const gchar * const *lang;
-    int i;
 
     if (!file_name || *file_name == '\0')
         return NULL;
diff --git a/src/engine/Account.c b/src/engine/Account.c
index 5ea5db9..b2dd987 100644
--- a/src/engine/Account.c
+++ b/src/engine/Account.c
@@ -305,7 +305,6 @@ gnc_account_get_property (GObject         *object,
     Account *account;
     AccountPrivate *priv;
     const gchar *key;
-    GValue *temp;
 
     g_return_if_fail(GNC_IS_ACCOUNT(object));
 
@@ -5540,7 +5539,6 @@ gnc_account_imap_add_account_bayes (GncImportMatchMap *imap,
     for (current_token = g_list_first(tokens); current_token;
             current_token = current_token->next)
     {
-         GValue value = G_VALUE_INIT;
         /* Jump to next iteration if the pointer is not valid or if the
                  string is empty. In HBCI import we almost always get an empty
                  string, which doesn't work in the kvp loopkup later. So we
diff --git a/src/engine/Scrub.c b/src/engine/Scrub.c
index 325b5e1..1247d4a 100644
--- a/src/engine/Scrub.c
+++ b/src/engine/Scrub.c
@@ -1339,7 +1339,6 @@ void
 xaccAccountScrubKvp (Account *account)
 {
     GValue v = G_VALUE_INIT;
-    const gchar *str;
     gchar *str2;
 
     if (!account) return;
diff --git a/src/engine/ScrubBusiness.c b/src/engine/ScrubBusiness.c
index aa48ea3..3d2acef 100644
--- a/src/engine/ScrubBusiness.c
+++ b/src/engine/ScrubBusiness.c
@@ -51,7 +51,6 @@ static void
 gncScrubInvoiceState (GNCLot *lot)
 {
     SplitList *ls_iter = NULL;
-    Transaction *txn = NULL; // ll_txn = "Lot Link Transaction"
     GncInvoice *invoice = NULL;
     GncInvoice *lot_invoice = gncInvoiceGetInvoiceFromLot (lot);
 
diff --git a/src/engine/Split.c b/src/engine/Split.c
index 8ae7ab6..e47ec5b 100644
--- a/src/engine/Split.c
+++ b/src/engine/Split.c
@@ -1568,9 +1568,6 @@ xaccSplitOrderDateOnly (const Split *sa, const Split *sb)
 static gboolean
 get_corr_account_split(const Split *sa, const Split **retval)
 {
-
-    const Split *current_split;
-
     *retval = NULL;
     g_return_val_if_fail(sa, FALSE);
 
diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c
index 6804f53..4ac15be 100644
--- a/src/engine/Transaction.c
+++ b/src/engine/Transaction.c
@@ -314,7 +314,6 @@ gnc_transaction_get_property(GObject* object,
 {
     Transaction* tx;
     gchar *key;
-    GValue *temp;
 
     g_return_if_fail(GNC_IS_TRANSACTION(object));
 
@@ -2676,7 +2675,7 @@ xaccTransGetVoidTime(const Transaction *tr)
 {
     GValue v = G_VALUE_INIT;
     const char *s = NULL;
-    Timespec void_time = {0, 0}, *ts;
+    Timespec void_time = {0, 0};
 
     g_return_val_if_fail(tr, void_time);
     qof_instance_get_kvp (QOF_INSTANCE (tr), void_time_str, &v);
diff --git a/src/engine/engine-helpers.c b/src/engine/engine-helpers.c
index 9484cc0..f8e6abf 100644
--- a/src/engine/engine-helpers.c
+++ b/src/engine/engine-helpers.c
@@ -658,7 +658,6 @@ gnc_query_scm2path (SCM path_scm)
     while (!scm_is_null (path_scm))
     {
         SCM key_scm = SCM_CAR (path_scm);
-        char *str;
         char *key;
 
         if (!scm_is_string (key_scm))
diff --git a/src/engine/gnc-commodity.c b/src/engine/gnc-commodity.c
index 5b0ce4e..f218f8f 100644
--- a/src/engine/gnc-commodity.c
+++ b/src/engine/gnc-commodity.c
@@ -1080,7 +1080,6 @@ gnc_commodity_get_fraction(const gnc_commodity * cm)
 static gboolean
 gnc_commodity_get_auto_quote_control_flag(const gnc_commodity *cm)
 {
-    const char *str;
     GValue v = G_VALUE_INIT;
 
     if (!cm) return FALSE;
@@ -1144,7 +1143,6 @@ gnc_commodity_get_quote_tz(const gnc_commodity *cm)
 const char*
 gnc_commodity_get_user_symbol(const gnc_commodity *cm)
 {
-    const char *str;
     GValue v = G_VALUE_INIT;
     if (!cm) return NULL;
     qof_instance_get_kvp (QOF_INSTANCE(cm), "user_symbol", &v);
@@ -1159,7 +1157,6 @@ gnc_commodity_get_user_symbol(const gnc_commodity *cm)
 const char*
 gnc_commodity_get_default_symbol(const gnc_commodity *cm)
 {
-    const char *str;
     if (!cm) return NULL;
     return GET_PRIVATE(cm)->default_symbol;
 }
diff --git a/src/engine/gnc-lot.c b/src/engine/gnc-lot.c
index d797a02..6745ff5 100644
--- a/src/engine/gnc-lot.c
+++ b/src/engine/gnc-lot.c
@@ -139,7 +139,6 @@ gnc_lot_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec*
     GNCLot* lot;
     LotPrivate* priv;
     gchar *key;
-    GValue *temp;
 
     g_return_if_fail(GNC_IS_LOT(object));
 
diff --git a/src/engine/gnc-pricedb.c b/src/engine/gnc-pricedb.c
index 6a29aab..9e7fc2d 100644
--- a/src/engine/gnc-pricedb.c
+++ b/src/engine/gnc-pricedb.c
@@ -1539,7 +1539,6 @@ gnc_pricedb_lookup_latest(GNCPriceDB *db,
 {
     GList *price_list;
     GNCPrice *result;
-    GHashTable *currency_hash;
 
     if (!db || !commodity || !currency) return NULL;
     ENTER ("db=%p commodity=%p currency=%p", db, commodity, currency);
@@ -2029,7 +2028,6 @@ gnc_pricedb_lookup_at_time(GNCPriceDB *db,
 {
     GList *price_list;
     GList *item = NULL;
-    GHashTable *currency_hash;
 
     if (!db || !c || !currency) return NULL;
     ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
@@ -2064,7 +2062,6 @@ lookup_nearest_in_time(GNCPriceDB *db,
     GNCPrice *next_price = NULL;
     GNCPrice *result = NULL;
     GList *item = NULL;
-    GHashTable *currency_hash;
 
     if (!db || !c || !currency) return NULL;
     ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
@@ -2185,7 +2182,6 @@ gnc_pricedb_lookup_latest_before (GNCPriceDB *db,
     /*  GNCPrice *next_price = NULL;
         GNCPrice *result = NULL;*/
     GList *item = NULL;
-    GHashTable *currency_hash;
     Timespec price_time;
 
     if (!db || !c || !currency) return NULL;

commit e7d35b8309f6b1d1887ff23412f61994c8215dbc
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:40:58 2017 +0100

    Move static inline CSS to gnucash.css file

diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c
index abd9310..565472c 100644
--- a/src/gnome-utils/dialog-account.c
+++ b/src/gnome-utils/dialog-account.c
@@ -667,20 +667,10 @@ verify_children_compatible (AccountWindow *aw)
     gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
     gtk_label_set_selectable (GTK_LABEL (label), TRUE);
     gnc_label_set_alignment (label, 0.0, 0.0);
-    {
-        GtkCssProvider *provider = gtk_css_provider_new();
-        const gchar *label_css = {
-                                  "label {\n"
-                                  " font-size:large;\n"
-                                  " font-weight: bold;\n"
-                                  "}\n"
-                                 };
-        gtk_css_provider_load_from_data (provider, label_css, strlen(label_css), NULL);
-        gtk_style_context_add_provider (gtk_widget_get_style_context(GTK_WIDGET(label)),
-                                   GTK_STYLE_PROVIDER (provider),
-                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-        g_object_unref (provider);
-    }
+
+    /* make label large */
+    gnc_widget_set_style_context (GTK_WIDGET(label), "primary_label_size");
+
     gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
 
     /* secondary label */
diff --git a/src/gnome-utils/dialog-utils.c b/src/gnome-utils/dialog-utils.c
index 11ae0e1..247b5d3 100644
--- a/src/gnome-utils/dialog-utils.c
+++ b/src/gnome-utils/dialog-utils.c
@@ -50,9 +50,6 @@ static QofLogModule log_module = GNC_MOD_GUI;
 
 #define GNC_PREF_LAST_GEOMETRY "last-geometry"
 
-const gchar *css_default_color = "* { color: currentColor }";
-const gchar *css_red_color     = "* { color: rgb(75%, 0%, 0%) }";
-
 /********************************************************************\
  * gnc_set_label_color                                              *
  *   sets the color of the label given the value                    *
@@ -65,30 +62,16 @@ void
 gnc_set_label_color(GtkWidget *label, gnc_numeric value)
 {
     gboolean deficit;
-    GtkStyleContext *stylecontext;
-    GtkCssProvider *provider;
 
     if (!gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_NEGATIVE_IN_RED))
         return;
 
-    provider = GTK_CSS_PROVIDER(g_object_get_data (G_OBJECT (label), "custom-provider"));
-
-    if (!provider)
-    {
-        provider = gtk_css_provider_new();
-        gtk_css_provider_load_from_data (provider, css_default_color, -1, NULL);
-        stylecontext = gtk_widget_get_style_context (label);
-        gtk_style_context_add_provider (stylecontext, GTK_STYLE_PROVIDER (provider),
-                                        GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-        g_object_set_data (G_OBJECT (label), "custom-provider", provider);
-    }
-
     deficit = gnc_numeric_negative_p (value);
 
     if (deficit)
-        gtk_css_provider_load_from_data (provider, css_red_color, -1, NULL);
+        gnc_widget_set_style_context (GTK_WIDGET(label), "css_red_color");
     else
-        gtk_css_provider_load_from_data (provider, css_default_color, -1, NULL);
+        gnc_widget_set_style_context (GTK_WIDGET(label), "css_default_color");
 }
 
 
diff --git a/src/gnome-utils/gnc-tree-view-split-reg.c b/src/gnome-utils/gnc-tree-view-split-reg.c
index 32e42c3..bf309d4 100644
--- a/src/gnome-utils/gnc-tree-view-split-reg.c
+++ b/src/gnome-utils/gnc-tree-view-split-reg.c
@@ -622,15 +622,6 @@ gnc_tree_view_split_reg_pref_changed (gpointer prefs, gchar *pref, gpointer user
 }
 
 
-/* Set the grid lines to be solid */
-static const gchar *css_string =
-{
-"treeview.view {\n"
-" border-color: black;\n"
-"}\n"
-};
-
-
 /* Define which columns are in which views */
 static ViewCol *
 gnc_tree_view_split_reg_get_colummn_list (GncTreeModelSplitReg *model)
@@ -1018,7 +1009,6 @@ gnc_tree_view_split_reg_new_with_model (GncTreeModelSplitReg *model)
     GtkTreeModel        *s_model;
     GncTreeViewSplitReg *view;
     GtkTreeSelection    *selection;
-    GtkCssProvider* provider = gtk_css_provider_new();
 
     view = g_object_new (gnc_tree_view_split_reg_get_type(), NULL);
     g_object_set (view, "name", "split_reg_tree", NULL);
@@ -1030,12 +1020,8 @@ gnc_tree_view_split_reg_new_with_model (GncTreeModelSplitReg *model)
     g_assert (gnc_commodity_is_currency (view->priv->reg_currency));
     view->help_text = g_strdup ("Help Text");
 
-    // This sets up solid lines for the grid line.
-    gtk_css_provider_load_from_data (provider, css_string, strlen(css_string), NULL);
-    gtk_style_context_add_provider (gtk_widget_get_style_context(GTK_WIDGET(view)),
-                                   GTK_STYLE_PROVIDER (provider),
-                                   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-    g_object_unref (provider);
+    /* Set the grid lines to be solid */
+    gnc_widget_set_style_context (GTK_WIDGET(view), "treeview_grid_lines");
 
     /* TreeView Grid lines */
     if (view->priv->use_horizontal_lines)
diff --git a/src/gnome-utils/ui/gnucash.css b/src/gnome-utils/ui/gnucash.css
index c6d1bad..8abcb59 100644
--- a/src/gnome-utils/ui/gnucash.css
+++ b/src/gnome-utils/ui/gnucash.css
@@ -2,3 +2,36 @@
    directly by name as these are not brought in when loaded, only
    the widget type can be configured unless they are named in code */
 
+/* Import Matcher # import-main-matcher.*/
+.color_back_red {
+  background-color: brown1;
+}
+
+.color_back_yellow {
+  background-color: gold;
+}
+
+.color_back_green {
+  background-color: DarkSeaGreen1;
+}
+
+/* label colors # dialog-utils.c */
+.css_default_color {
+  color: currentColor;
+}
+
+.css_red_color {
+  color: rgb(75%, 0%, 0%);
+}
+
+/* Set the grid lines to be solid # gnc-tree-view-split-reg.c */
+.treeview_grid_lines {
+  border-color: black;
+}
+
+/* Increase label size # dialog-account.c */
+.primary_label_size {
+  font-size: large;
+  font-weight: bold;
+}
+
diff --git a/src/import-export/import-main-matcher.c b/src/import-export/import-main-matcher.c
index 5c4ed61..977d736 100644
--- a/src/import-export/import-main-matcher.c
+++ b/src/import-export/import-main-matcher.c
@@ -59,9 +59,6 @@ struct _main_matcher_info
     GtkWidget *assistant;
     GtkTreeView *view;
     GNCImportSettings *user_settings;
-    GdkRGBA color_back_red;
-    GdkRGBA color_back_green;
-    GdkRGBA color_back_yellow;
     int selected_row;
     GNCTransactionProcessedCB transaction_processed_cb;
     gpointer user_data;
@@ -203,23 +200,6 @@ on_matcher_help_close_clicked (GtkButton *button, gpointer user_data)
     gtk_widget_destroy(help_dialog);
 }
 
-static void
-gnc_override_background_color (GtkWidget *widget,
-                               GdkRGBA   *rgba)
-{
-    GtkCssProvider *provider = gtk_css_provider_new();
-    GtkStyleContext *stylectxt = gtk_widget_get_style_context (widget);
-    gchar *col_str = gdk_rgba_to_string (rgba);
-    gchar *widget_css = g_strconcat ("*{\n  background-color:", col_str, ";\n}\n", NULL);
-
-    gtk_css_provider_load_from_data (provider, widget_css, -1, NULL);
-    gtk_style_context_add_provider (stylectxt, GTK_STYLE_PROVIDER (provider),
-                                    GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-    g_object_unref (provider);
-    g_free (col_str);
-    g_free (widget_css);
-}
-
 void
 on_matcher_help_clicked (GtkButton *button, gpointer user_data)
 {
@@ -235,13 +215,13 @@ on_matcher_help_clicked (GtkButton *button, gpointer user_data)
     gnc_builder_add_from_file (builder, "dialog-import.glade", "matcher_help_dialog");
 
     box = GTK_WIDGET(gtk_builder_get_object (builder, "red"));
-    gnc_override_background_color (box, &info->color_back_red);
+    gnc_widget_set_style_context (GTK_WIDGET(box), "color_back_red");
 
     box = GTK_WIDGET(gtk_builder_get_object (builder, "yellow"));
-    gnc_override_background_color (box, &info->color_back_yellow);
+    gnc_widget_set_style_context (GTK_WIDGET(box), "color_back_yellow");
 
     box = GTK_WIDGET(gtk_builder_get_object (builder, "green"));
-    gnc_override_background_color (box, &info->color_back_green);
+    gnc_widget_set_style_context (GTK_WIDGET(box), "color_back_green");
 
     help_dialog = GTK_WIDGET(gtk_builder_get_object (builder, "matcher_help_dialog"));
     gtk_window_set_transient_for(GTK_WINDOW(help_dialog),
@@ -568,11 +548,6 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
       gtk_window_set_transient_for (GTK_WINDOW (info->dialog),
     			  GTK_WINDOW (parent));*/
 
-    /*Initialise the colors */
-    gdk_rgba_parse(&info->color_back_red,    COLOR_RED);
-    gdk_rgba_parse(&info->color_back_yellow, COLOR_YELLOW);
-    gdk_rgba_parse(&info->color_back_green,  COLOR_GREEN);
-
     if (heading)
         gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
@@ -631,11 +606,6 @@ GNCImportMainMatcher * gnc_gen_trans_assist_new (GtkWidget *parent,
     heading_label = GTK_WIDGET(gtk_builder_get_object (builder, "heading_label"));
     g_assert (heading_label != NULL);
 
-    /*Initialise the colors */
-    gdk_rgba_parse(&info->color_back_red,    COLOR_RED);
-    gdk_rgba_parse(&info->color_back_yellow, COLOR_YELLOW);
-    gdk_rgba_parse(&info->color_back_green,  COLOR_GREEN);
-
     if (heading)
         gtk_label_set_text (GTK_LABEL (heading_label), heading);
 

commit 8ab3aadffaff82229f354c0fefcc297fe67082f9
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:40:08 2017 +0100

    Add an application specific CSS file
    
    Add the ability to load an application specific CSS file called from
    share/gnucash/ui/gnucash.css

diff --git a/src/gnome-utils/gnc-gnome-utils.c b/src/gnome-utils/gnc-gnome-utils.c
index 2cad33e..845f63e 100644
--- a/src/gnome-utils/gnc-gnome-utils.c
+++ b/src/gnome-utils/gnc-gnome-utils.c
@@ -172,26 +172,38 @@ gnc_configure_date_completion (void)
 void
 gnc_add_css_file (void)
 {
-    GtkCssProvider *provider;
+    GtkCssProvider *provider_user, *provider_app;
     GdkDisplay *display;
     GdkScreen *screen;
     const gchar *var;
+    gchar* pkgdatadir = gnc_path_get_pkgdatadir ();
     gchar *str;
     GError *error = 0;
 
-    provider = gtk_css_provider_new ();
+    provider_user = gtk_css_provider_new ();
+    provider_app = gtk_css_provider_new ();
     display = gdk_display_get_default ();
     screen = gdk_display_get_default_screen (display);
-    gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_USER);
+    gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_app), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+    gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_user), GTK_STYLE_PROVIDER_PRIORITY_USER);
+
+    if (pkgdatadir)
+    {
+        str = g_build_filename (pkgdatadir, "ui", "gnucash.css", (char *)NULL);
+        gtk_css_provider_load_from_path (provider_app, str, &error);
+        g_free (str);
+    }
+    g_free (pkgdatadir);
 
     var = g_get_home_dir ();
     if (var)
     {
         str = g_build_filename (var, ".gtk-3.0-gnucash.css", (char *)NULL);
-        gtk_css_provider_load_from_path (provider, str, &error);
+        gtk_css_provider_load_from_path (provider_user, str, &error);
         g_free (str);
     }
-    g_object_unref (provider);
+    g_object_unref (provider_user);
+    g_object_unref (provider_app);
 }
 
 #ifdef MAC_INTEGRATION
diff --git a/src/gnome-utils/ui/CMakeLists.txt b/src/gnome-utils/ui/CMakeLists.txt
index cdf16ef..a014a1a 100644
--- a/src/gnome-utils/ui/CMakeLists.txt
+++ b/src/gnome-utils/ui/CMakeLists.txt
@@ -15,6 +15,7 @@ SET(gnome_utils_ui_DIST_local
         gnc-windows-menu-ui.xml
         Makefile.am
         osx_accel_map
+        gnucash.css
         )
 
 SET_DIST_LIST(gnome_utils_ui_DIST ${gnome_utils_ui_DIST_local})
diff --git a/src/gnome-utils/ui/Makefile.am b/src/gnome-utils/ui/Makefile.am
index 3f82751..7acda83 100644
--- a/src/gnome-utils/ui/Makefile.am
+++ b/src/gnome-utils/ui/Makefile.am
@@ -3,6 +3,7 @@ ui_DATA = \
 	gnc-main-window-ui.xml \
 	gnc-windows-menu-ui.xml \
 	gnc-windows-menu-ui-quartz.xml \
-	osx_accel_map
+	osx_accel_map \
+	gnucash.css
 
 EXTRA_DIST = $(ui_DATA) CMakeLists.txt
diff --git a/src/gnome-utils/ui/gnucash.css b/src/gnome-utils/ui/gnucash.css
new file mode 100644
index 0000000..c6d1bad
--- /dev/null
+++ b/src/gnome-utils/ui/gnucash.css
@@ -0,0 +1,4 @@
+/* Note: Widgets obtained from Glade files will not be addressable
+   directly by name as these are not brought in when loaded, only
+   the widget type can be configured unless they are named in code */
+

commit 8fa2b0a67d00195e277ab143c366e30db32b3121
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:38:56 2017 +0100

    Fix problem with gbv_treeview_resized_cb
    
    If you have a budget page open and then open the preference dialog this
    callback would be actioned and you will get invalid tree column error
    in the trace file, add check to verify we have a tree view column.

diff --git a/src/gnome/gnc-budget-view.c b/src/gnome/gnc-budget-view.c
index 3b1df98..5d2e72f 100644
--- a/src/gnome/gnc-budget-view.c
+++ b/src/gnome/gnc-budget-view.c
@@ -639,7 +639,8 @@ gbv_treeview_resized_cb(GtkWidget* widget, GtkAllocation* allocation, GncBudgetV
         {
             col_width = gtk_tree_view_column_get_width(tree_view_col);
             totals_view_col = gtk_tree_view_get_column(priv->totals_tree_view, j);
-            gtk_tree_view_column_set_fixed_width(totals_view_col, col_width);
+            if(GTK_IS_TREE_VIEW_COLUMN(totals_view_col))
+                gtk_tree_view_column_set_fixed_width(totals_view_col, col_width);
             j++;
         }
     }

commit 64b934f2be48ce7a1532c8a7deb65ca90c9aef38
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:37:42 2017 +0100

    Fix error in use of AccountFilterDialog structure in budgets
    
    The filter_override variable was not being set and causing multiple
    errors in the trace file.

diff --git a/src/gnome/gnc-plugin-page-budget.c b/src/gnome/gnc-plugin-page-budget.c
index 0cc9906..de61cf4 100644
--- a/src/gnome/gnc-plugin-page-budget.c
+++ b/src/gnome/gnc-plugin-page-budget.c
@@ -333,6 +333,7 @@ gnc_plugin_page_budget_init (GncPluginPageBudget *plugin_page)
     priv->fd.visible_types = -1; /* Start with all types */
     priv->fd.show_hidden = FALSE;
     priv->fd.show_zero_total = TRUE;
+    priv->fd.filter_override = g_hash_table_new (g_direct_hash, g_direct_equal);
 
     priv->sigFigs = 1;
     recurrenceSet(&priv->r, 1, PERIOD_MONTH, NULL, WEEKEND_ADJ_NONE);
@@ -471,6 +472,9 @@ gnc_plugin_page_budget_destroy_widget (GncPluginPage *plugin_page)
         priv->budget_view = NULL;
     }
 
+    // Destroy the filter override hash table
+    g_hash_table_destroy(priv->fd.filter_override);
+
     gnc_gui_component_clear_watches (priv->component_id);
 
     if (priv->component_id != NO_COMPONENT)

commit ae5512e66329a566ccf91f5ea8201085d39d2975
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:36:56 2017 +0100

    Fix typo of version, should be 3.10

diff --git a/src/gnome/gtkbuilder/gnc-plugin-page-budget.glade b/src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
index 6d7396c..b05fa0d 100644
--- a/src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
+++ b/src/gnome/gtkbuilder/gnc-plugin-page-budget.glade
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Generated with glade 3.20.0 -->
 <interface>
-  <requires lib="gtk+" version="3.16"/>
+  <requires lib="gtk+" version="3.10"/>
   <object class="GtkAdjustment" id="DigitsToRound_Adj">
     <property name="lower">1</property>
     <property name="upper">12</property>

commit bbd29b69c6cc917c2827939855c27c9653d3be1f
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Jul 23 11:36:05 2017 +0100

    Fix critical error when Gnucash closes with report pages open
    
    Prior to Gtk version 3.20, when using gtk_container_remove the removed
    widget was required to be the direct child of the container.

diff --git a/src/html/gnc-html-webkit2.c b/src/html/gnc-html-webkit2.c
index 70badc6..a5ae409 100644
--- a/src/html/gnc-html-webkit2.c
+++ b/src/html/gnc-html-webkit2.c
@@ -245,8 +245,15 @@ gnc_html_webkit_dispose( GObject* obj )
 
      if ( priv->web_view != NULL )
      {
+         // In Gtk Version 3.20 they relaxed the fact that the widget should be a
+         // direct child of the container otherwise it would be a critical error
+#if GTK_CHECK_VERSION(3,20,0)
           gtk_container_remove( GTK_CONTAINER(priv->base.container),
                                 GTK_WIDGET(priv->web_view) );
+#else
+          GtkWidget *parent = gtk_widget_get_parent(GTK_WIDGET(priv->web_view));
+          gtk_container_remove( GTK_CONTAINER(priv->base.container), parent);
+#endif
           priv->web_view = NULL;
      }
 



Summary of changes:
 src/app-utils/gfec.c                               |   1 -
 src/app-utils/gnc-accounting-period.c              |   2 -
 src/app-utils/gnc-gsettings.c                      |   3 +-
 src/app-utils/gnc-state.c                          |   7 +-
 src/app-utils/gnc-ui-util.c                        |   1 -
 src/app-utils/guile-util.c                         |   5 +-
 src/app-utils/option-util.c                        |   7 --
 src/bin/gnucash-bin.c                              |   1 -
 src/business/business-gnome/dialog-invoice.c       |   8 +-
 src/business/business-gnome/dialog-payment.c       |   2 -
 src/business/business-ledger/gncEntryLedgerModel.c |   1 -
 src/core-utils/gnc-filepath-utils.c                |   1 -
 src/engine/Account.c                               |   2 -
 src/engine/Scrub.c                                 |   7 --
 src/engine/ScrubBusiness.c                         |   1 -
 src/engine/Split.c                                 |   3 -
 src/engine/Transaction.c                           |   3 +-
 src/engine/engine-helpers.c                        |   1 -
 src/engine/gnc-commodity.c                         |   3 -
 src/engine/gnc-lot.c                               |   6 --
 src/engine/gnc-pricedb.c                           |  18 ----
 src/gnome-search/dialog-search.c                   |   3 -
 src/gnome-utils/dialog-account.c                   |  18 +---
 src/gnome-utils/dialog-dup-trans.c                 |   1 -
 src/gnome-utils/dialog-options.c                   |  12 ++-
 src/gnome-utils/dialog-preferences.c               |  34 -------
 src/gnome-utils/dialog-query-view.c                |   2 +-
 src/gnome-utils/dialog-transfer.c                  |   2 -
 src/gnome-utils/dialog-utils.c                     |  21 +----
 src/gnome-utils/gnc-cell-renderer-date.c           |   3 -
 src/gnome-utils/gnc-cell-renderer-popup.c          |   4 +-
 src/gnome-utils/gnc-combott.c                      |   6 --
 src/gnome-utils/gnc-currency-edit.c                |   1 -
 src/gnome-utils/gnc-date-edit.c                    |   2 -
 src/gnome-utils/gnc-dense-cal.c                    |   2 -
 src/gnome-utils/gnc-file.c                         |   1 -
 src/gnome-utils/gnc-frequency.c                    |   1 -
 src/gnome-utils/gnc-gnome-utils.c                  |  22 +++--
 src/gnome-utils/gnc-icons.c                        |   1 -
 src/gnome-utils/gnc-main-window.c                  |   2 +-
 src/gnome-utils/gnc-query-view.c                   |   9 +-
 src/gnome-utils/gnc-tree-control-split-reg.c       |  25 ++----
 src/gnome-utils/gnc-tree-model-price.c             |   2 +-
 src/gnome-utils/gnc-tree-model-split-reg.c         |  12 ---
 src/gnome-utils/gnc-tree-util-split-reg.c          |  16 ++--
 src/gnome-utils/gnc-tree-view-split-reg.c          | 100 +++++++--------------
 src/gnome-utils/gnc-tree-view.c                    |  16 +---
 src/gnome-utils/search-param.c                     |   1 -
 src/gnome-utils/ui/CMakeLists.txt                  |   1 +
 src/gnome-utils/ui/Makefile.am                     |   3 +-
 src/gnome-utils/ui/gnucash.css                     |  37 ++++++++
 src/gnome/dialog-find-account.c                    |   5 +-
 src/gnome/dialog-imap-editor.c                     |   1 -
 src/gnome/dialog-lot-viewer.c                      |   2 -
 src/gnome/dialog-print-check.c                     |   1 -
 src/gnome/dialog-sx-editor.c                       |   5 --
 src/gnome/dialog-sx-editor2.c                      |   2 -
 src/gnome/dialog-sx-from-trans.c                   |   3 -
 src/gnome/dialog-tax-info.c                        |   1 -
 src/gnome/gnc-budget-view.c                        |  22 ++---
 src/gnome/gnc-plugin-account-tree.c                |   1 -
 src/gnome/gnc-plugin-basic-commands.c              |   6 --
 src/gnome/gnc-plugin-page-budget.c                 |  11 +--
 src/gnome/gnc-plugin-page-register2.c              |  39 ++------
 src/gnome/gnc-plugin-page-sx-list.c                |  10 ++-
 src/gnome/gnc-plugin-register2.c                   |   5 +-
 src/gnome/gnc-split-reg.c                          |   4 -
 src/gnome/gnc-split-reg2.c                         |  14 +--
 src/gnome/gtkbuilder/gnc-plugin-page-budget.glade  |   2 +-
 src/gnome/reconcile-view.c                         |   8 +-
 src/gnome/top-level.c                              |   2 -
 src/gnome/window-reconcile.c                       |   5 --
 src/gnome/window-reconcile2.c                      |   4 -
 src/html/gnc-html-webkit2.c                        |   7 ++
 src/import-export/csv-exp/gnc-plugin-csv-export.c  |   1 -
 src/import-export/csv-imp/gnc-csv-account-map.c    |   4 +-
 src/import-export/csv-imp/gnc-csv-gnumeric-popup.c |   2 +-
 src/import-export/import-account-matcher.c         |   3 +-
 src/import-export/import-main-matcher.c            |  37 +-------
 src/import-export/import-match-picker.c            |   1 -
 src/import-export/ofx/gnc-ofx-kvp.c                |   1 -
 src/import-export/qif-imp/dialog-account-picker.c  |   3 -
 src/plugins/bi_import/dialog-bi-import-gui.c       |   5 +-
 src/plugins/bi_import/dialog-bi-import.c           |   1 -
 src/register/ledger-core/gnc-ledger-display2.c     |   5 +-
 .../ledger-core/split-register-model-save.c        |   6 --
 src/register/ledger-core/split-register-model.c    |   4 +-
 src/register/register-gnome/gnucash-register.c     |   9 +-
 src/register/register-gnome/gnucash-sheet.c        |  29 +++---
 src/register/register-gnome/table-gnome.c          |   4 +-
 src/report/report-gnome/dialog-custom-report.c     |   4 +-
 src/report/report-gnome/gnc-plugin-page-report.c   |   8 +-
 src/report/report-system/gnc-report.c              |   1 -
 93 files changed, 213 insertions(+), 518 deletions(-)
 create mode 100644 src/gnome-utils/ui/gnucash.css



More information about the gnucash-changes mailing list