From 64a4e6b1bca90269e3912f4c2b4829c043531604 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sun, 23 Jul 2017 12:16:42 +0100 Subject: [PATCH] Code clean up, remove some static defines and redundant code --- src/engine/gnc-lot.c | 5 ----- src/engine/gnc-pricedb.c | 14 ------------- src/gnome-utils/dialog-preferences.c | 21 ------------------- src/gnome/dialog-sx-editor2.c | 1 - src/gnome/gnc-plugin-account-tree.c | 1 - .../report-gnome/gnc-plugin-page-report.c | 7 +------ 6 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/engine/gnc-lot.c b/src/engine/gnc-lot.c index 6745ff5ad2..77b3becadc 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 9e7fc2da29..87ef307766 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 cf51f1bc66..e7665df029 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 5fd24d2798..74c704c8ba 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 47915f4d9b..077522d812 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 b95d905fc6..42ca6fbb6d 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 { @@ -1658,12 +1659,6 @@ gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report return; } -static void -error_handler(const char *str) -{ - PWARN("Report Error: %s", str); -} - static void gnc_plugin_page_report_options_cb( GtkAction *action, GncPluginPageReport *report ) {