mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[-Wunused-function] - remove
This commit is contained in:
parent
05975aa510
commit
9c6ad222a9
@ -1524,16 +1524,6 @@ opening_equity_cb (GtkWidget *w, gpointer data)
|
|||||||
gtk_widget_set_sensitive (aw->transfer_account_scroll, !use_equity);
|
gtk_widget_set_sensitive (aw->transfer_account_scroll, !use_equity);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_name_entry_realize (GtkWidget *widget, gpointer user_data)
|
|
||||||
{
|
|
||||||
GtkWidget *commodity_box = user_data;
|
|
||||||
GtkAllocation alloc;
|
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &alloc);
|
|
||||||
gtk_widget_set_size_request (commodity_box, -1, alloc.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
* gnc_account_window_create *
|
* gnc_account_window_create *
|
||||||
* creates a window to create a new account. *
|
* creates a window to create a new account. *
|
||||||
|
@ -75,11 +75,6 @@ static void dialog_reset_cb(GtkWidget * w, gpointer data);
|
|||||||
static void dialog_list_select_cb (GtkTreeSelection *selection, gpointer data);
|
static void dialog_list_select_cb (GtkTreeSelection *selection, gpointer data);
|
||||||
static void component_close_handler (gpointer data);
|
static void component_close_handler (gpointer data);
|
||||||
|
|
||||||
static void
|
|
||||||
section_reset_widgets(GncOptionSection* section)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline GtkWidget* const
|
static inline GtkWidget* const
|
||||||
option_get_gtk_widget (const GncOption* option)
|
option_get_gtk_widget (const GncOption* option)
|
||||||
{
|
{
|
||||||
@ -649,12 +644,6 @@ GncOptionsDialog::set_book_help_cb() noexcept
|
|||||||
set_help_cb((GncOptionsDialogCallback)gnc_book_options_help_cb, nullptr);
|
set_help_cb((GncOptionsDialogCallback)gnc_book_options_help_cb, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_global_options_help_cb (GncOptionsDialog *win, gpointer dat)
|
|
||||||
{
|
|
||||||
gnc_gnome_help (GTK_WINDOW(win->get_widget()), DF_MANUAL, DL_GLOBPREFS);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_style_sheet_options_help_cb (GncOptionsDialog *win, gpointer dat)
|
gnc_style_sheet_options_help_cb (GncOptionsDialog *win, gpointer dat)
|
||||||
{
|
{
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
static void gnc_cell_view_init (GncCellView *cv);
|
static void gnc_cell_view_init (GncCellView *cv);
|
||||||
static void gnc_cell_view_class_init (GncCellViewClass *klass);
|
static void gnc_cell_view_class_init (GncCellViewClass *klass);
|
||||||
static void gnc_cell_view_editable_init (GtkCellEditableIface *iface);
|
static void gnc_cell_view_editable_init (GtkCellEditableIface *iface);
|
||||||
static gboolean gcv_key_press_event (GtkWidget *box,
|
|
||||||
GdkEventKey *key_event);
|
|
||||||
|
|
||||||
static void gnc_cell_view_set_property (GObject *object,
|
static void gnc_cell_view_set_property (GObject *object,
|
||||||
guint param_id,
|
guint param_id,
|
||||||
|
@ -1699,34 +1699,6 @@ create_option_widget<GncOptionUIType::DATE_FORMAT> (GncOption& option,
|
|||||||
grid_attach_widget(page_box, enclosing, row);
|
grid_attach_widget(page_box, enclosing, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_plot_size_option_set_select_method(GncOption& option, bool set_buttons)
|
|
||||||
{
|
|
||||||
GList* widget_list;
|
|
||||||
GtkWidget *px_widget, *p_widget;
|
|
||||||
GtkWidget *widget;
|
|
||||||
|
|
||||||
widget = option_get_gtk_widget(&option);
|
|
||||||
|
|
||||||
widget_list = gtk_container_get_children(GTK_CONTAINER(widget));
|
|
||||||
// px_button item 0
|
|
||||||
px_widget = static_cast<decltype(px_widget)>(g_list_nth_data(widget_list, 1));
|
|
||||||
// p_button item 2
|
|
||||||
p_widget = static_cast<decltype(p_widget)>(g_list_nth_data(widget_list, 3));
|
|
||||||
g_list_free(widget_list);
|
|
||||||
|
|
||||||
if (set_buttons)
|
|
||||||
{
|
|
||||||
gtk_widget_set_sensitive(px_widget, TRUE);
|
|
||||||
gtk_widget_set_sensitive(p_widget, FALSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gtk_widget_set_sensitive(p_widget, TRUE);
|
|
||||||
gtk_widget_set_sensitive(px_widget, FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_rd_option_px_set_cb(GtkWidget *widget, GncOption* option)
|
gnc_rd_option_px_set_cb(GtkWidget *widget, GncOption* option)
|
||||||
{
|
{
|
||||||
|
@ -391,24 +391,6 @@ gnc_imap_invalid_maps_dialog (ImapDialog *imap_dialog)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_imap_invalid_maps (ImapDialog *imap_dialog)
|
|
||||||
{
|
|
||||||
gboolean inv_dialog_shown = FALSE;
|
|
||||||
|
|
||||||
if ((imap_dialog->type == BAYES) && (imap_dialog->inv_dialog_shown.inv_dialog_shown_bayes))
|
|
||||||
inv_dialog_shown = TRUE;
|
|
||||||
|
|
||||||
if ((imap_dialog->type == NBAYES) && (imap_dialog->inv_dialog_shown.inv_dialog_shown_nbayes))
|
|
||||||
inv_dialog_shown = TRUE;
|
|
||||||
|
|
||||||
if ((imap_dialog->type == ONLINE) && (imap_dialog->inv_dialog_shown.inv_dialog_shown_online))
|
|
||||||
inv_dialog_shown = TRUE;
|
|
||||||
|
|
||||||
if (!inv_dialog_shown)
|
|
||||||
gnc_imap_invalid_maps_dialog (imap_dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gnc_imap_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
|
gnc_imap_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
|
||||||
{
|
{
|
||||||
|
@ -730,13 +730,6 @@ gnc_payment_dialog_remember_account (PaymentWindow *pw, Account *acc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_payment_set_owner (PaymentWindow *pw, GncOwner *owner)
|
|
||||||
{
|
|
||||||
gnc_owner_set_owner (pw->owner_choice, owner);
|
|
||||||
gnc_payment_dialog_owner_changed(pw);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_payment_update_style_classes (PaymentWindow *pw)
|
gnc_payment_update_style_classes (PaymentWindow *pw)
|
||||||
{
|
{
|
||||||
|
@ -45,8 +45,6 @@ static QofLogModule log_module = GNC_MOD_GUI;
|
|||||||
static void gnc_plugin_budget_class_init (GncPluginBudgetClass *klass);
|
static void gnc_plugin_budget_class_init (GncPluginBudgetClass *klass);
|
||||||
static void gnc_plugin_budget_init (GncPluginBudget *plugin);
|
static void gnc_plugin_budget_init (GncPluginBudget *plugin);
|
||||||
static void gnc_plugin_budget_finalize (GObject *object);
|
static void gnc_plugin_budget_finalize (GObject *object);
|
||||||
static void gnc_plugin_budget_add_to_window (GncPlugin *plugin,
|
|
||||||
GncMainWindow *window, GQuark type);
|
|
||||||
|
|
||||||
/* Command Callbacks */
|
/* Command Callbacks */
|
||||||
static void gnc_plugin_budget_cmd_new_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
|
static void gnc_plugin_budget_cmd_new_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
|
||||||
|
@ -87,7 +87,6 @@ static void gnc_plugin_page_invoice_cmd_pay_invoice (GSimpleAction *simple, GVar
|
|||||||
static void gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_invoice_cmd_link_remove (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
|
||||||
static void gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_invoice_cmd_company_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_invoice_cmd_company_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_invoice_cmd_entryUp (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_invoice_cmd_entryUp (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
@ -1311,34 +1310,6 @@ gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple,
|
|||||||
LEAVE(" ");
|
LEAVE(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_plugin_page_invoice_cmd_link_remove (GSimpleAction *simple,
|
|
||||||
GVariant *paramter,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GncPluginPageInvoice *plugin_page = user_data;
|
|
||||||
GncPluginPageInvoicePrivate *priv;
|
|
||||||
GncInvoice *invoice;
|
|
||||||
GtkWidget *doclink_button;
|
|
||||||
|
|
||||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
|
|
||||||
ENTER("(action %p, plugin_page %p)", simple, plugin_page);
|
|
||||||
priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
|
|
||||||
|
|
||||||
invoice = gnc_invoice_window_get_invoice (priv->iw);
|
|
||||||
gncInvoiceSetDocLink (invoice, "");
|
|
||||||
|
|
||||||
doclink_button = gnc_invoice_window_get_doclink_button (priv->iw);
|
|
||||||
|
|
||||||
if (doclink_button)
|
|
||||||
gtk_widget_hide (GTK_WIDGET(doclink_button));
|
|
||||||
|
|
||||||
// update the menu actions
|
|
||||||
update_doclink_actions (GNC_PLUGIN_PAGE(plugin_page), FALSE);
|
|
||||||
|
|
||||||
LEAVE(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple,
|
gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple,
|
||||||
GVariant *paramter,
|
GVariant *paramter,
|
||||||
|
@ -222,7 +222,6 @@ static void gnc_plugin_page_register_cmd_account_report (GSimpleAction *simple,
|
|||||||
static void gnc_plugin_page_register_cmd_transaction_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_register_cmd_transaction_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_register_cmd_linked_transaction (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_register_cmd_linked_transaction (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_register_cmd_linked_transaction_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_register_cmd_linked_transaction_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
static void gnc_plugin_page_register_cmd_linked_transaction_remove (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
|
||||||
static void gnc_plugin_page_register_cmd_jump_linked_invoice (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
static void gnc_plugin_page_register_cmd_jump_linked_invoice (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
|
||||||
|
|
||||||
static void gnc_plugin_page_help_changed_cb (GNCSplitReg* gsr,
|
static void gnc_plugin_page_help_changed_cb (GNCSplitReg* gsr,
|
||||||
@ -4535,25 +4534,6 @@ gnc_plugin_page_register_cmd_linked_transaction_open (GSimpleAction *simple,
|
|||||||
LEAVE (" ");
|
LEAVE (" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gnc_plugin_page_register_cmd_linked_transaction_remove (GSimpleAction *simple,
|
|
||||||
GVariant *paramter,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GncPluginPageRegister* page = user_data;
|
|
||||||
GncPluginPageRegisterPrivate* priv;
|
|
||||||
|
|
||||||
ENTER ("(action %p, page %p)", simple, page);
|
|
||||||
|
|
||||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
|
|
||||||
|
|
||||||
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
|
|
||||||
gsr_default_doclink_remove_handler (priv->gsr);
|
|
||||||
gnc_plugin_page_register_ui_update (NULL, page);
|
|
||||||
LEAVE (" ");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static GncInvoice* invoice_from_split (Split* split)
|
static GncInvoice* invoice_from_split (Split* split)
|
||||||
{
|
{
|
||||||
GncInvoice* invoice;
|
GncInvoice* invoice;
|
||||||
|
@ -62,28 +62,6 @@ static std::shared_ptr<CsvPriceImpSettings> create_int_no_preset(void)
|
|||||||
return preset;
|
return preset;
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::shared_ptr<CsvPriceImpSettings> create_int_gnc_exp_preset(void)
|
|
||||||
{
|
|
||||||
auto preset = std::make_shared<CsvPriceImpSettings>();
|
|
||||||
preset->m_name = get_gnc_exp();
|
|
||||||
preset->m_skip_start_lines = 1;
|
|
||||||
|
|
||||||
/* FIXME date and currency format should still be aligned with export format!
|
|
||||||
* That's currently hard to do, because the export uses whatever the user
|
|
||||||
* had set as global preference.
|
|
||||||
preset->date_active = 0;
|
|
||||||
preset->currency_active = 0;
|
|
||||||
*/
|
|
||||||
preset->m_column_types_price = {
|
|
||||||
GncPricePropType::DATE,
|
|
||||||
GncPricePropType::AMOUNT,
|
|
||||||
GncPricePropType::FROM_SYMBOL,
|
|
||||||
GncPricePropType::FROM_NAMESPACE,
|
|
||||||
GncPricePropType::TO_CURRENCY
|
|
||||||
};
|
|
||||||
return preset;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************
|
/**************************************************
|
||||||
* find
|
* find
|
||||||
*
|
*
|
||||||
|
@ -57,17 +57,6 @@ typedef struct
|
|||||||
const char* online_id;
|
const char* online_id;
|
||||||
} AccountOnlineMatch;
|
} AccountOnlineMatch;
|
||||||
|
|
||||||
static Account*
|
|
||||||
partial_match_if_valid (AccountOnlineMatch *match)
|
|
||||||
{
|
|
||||||
if (match->partial_match && match->count == 1)
|
|
||||||
return match->partial_match;
|
|
||||||
else
|
|
||||||
PERR("Online ID %s partially matches %d accounts and fully matches none",
|
|
||||||
match->online_id, match->count);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-******************************************************************\
|
/*-******************************************************************\
|
||||||
* Functions needed by gnc_import_select_account
|
* Functions needed by gnc_import_select_account
|
||||||
*
|
*
|
||||||
|
@ -742,26 +742,6 @@ void split_find_match (GNCImportTransInfo * trans_info,
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* append the imported transaction description to the matched transaction description */
|
|
||||||
static void
|
|
||||||
desc_append (Transaction* selected_match_trans, gchar *new_desc)
|
|
||||||
{
|
|
||||||
auto curr_desc = xaccTransGetDescription (selected_match_trans);
|
|
||||||
auto tmp = g_strconcat(curr_desc, "|", new_desc, nullptr);
|
|
||||||
xaccTransSetDescription (selected_match_trans, tmp);
|
|
||||||
g_free (tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* append the imported transaction notes to the matched transaction notes */
|
|
||||||
static void
|
|
||||||
notes_append (Transaction* selected_match_trans, gchar* new_notes)
|
|
||||||
{
|
|
||||||
auto curr_notes = xaccTransGetNotes (selected_match_trans);
|
|
||||||
auto tmp = g_strconcat (curr_notes, "|", new_notes, nullptr);
|
|
||||||
xaccTransSetNotes (selected_match_trans, tmp );
|
|
||||||
g_free (tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
maybe_append_string (const char* match_string, const char* imp_string)
|
maybe_append_string (const char* match_string, const char* imp_string)
|
||||||
{
|
{
|
||||||
@ -1005,44 +985,6 @@ gnc_import_process_trans_item (Account *base_acc,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************\
|
|
||||||
* check_trans_online_id() Callback function used by
|
|
||||||
* gnc_import_exists_online_id. Takes pointers to transaction and split,
|
|
||||||
* returns 0 if their online_ids do NOT match, or if the split
|
|
||||||
* belongs to the transaction
|
|
||||||
\********************************************************************/
|
|
||||||
static gint check_trans_online_id(Transaction *trans1, void *user_data)
|
|
||||||
{
|
|
||||||
gchar *online_id1, *online_id2;
|
|
||||||
gint retval;
|
|
||||||
|
|
||||||
auto split2 = static_cast<Split*>(user_data);
|
|
||||||
auto account = xaccSplitGetAccount(split2);
|
|
||||||
auto split1 = xaccTransFindSplitByAccount(trans1, account);
|
|
||||||
if (split1 == split2)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* hack - we really want to iterate over the _splits_ of the account
|
|
||||||
instead of the transactions */
|
|
||||||
g_assert(split1);
|
|
||||||
|
|
||||||
online_id1 = gnc_import_get_split_online_id (split1);
|
|
||||||
|
|
||||||
if (!online_id1 || !*online_id1)
|
|
||||||
{
|
|
||||||
g_free (online_id1);
|
|
||||||
online_id1 = gnc_import_get_trans_online_id (trans1);
|
|
||||||
}
|
|
||||||
|
|
||||||
online_id2 = gnc_import_get_split_online_id(split2);
|
|
||||||
|
|
||||||
retval = (!online_id1 || !online_id2 || strcmp (online_id1, online_id2)) ? 0 : 1;
|
|
||||||
|
|
||||||
g_free (online_id1);
|
|
||||||
g_free (online_id2);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GHashTable*
|
static GHashTable*
|
||||||
hash_account_online_ids (Account *account)
|
hash_account_online_ids (Account *account)
|
||||||
{
|
{
|
||||||
|
@ -650,33 +650,6 @@ on_matcher_help_clicked (GtkButton *button, gpointer user_data)
|
|||||||
gtk_widget_show (help_dialog);
|
gtk_widget_show (help_dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
run_account_picker_dialog (GNCImportMainMatcher *info,
|
|
||||||
GtkTreeModel *model,
|
|
||||||
GtkTreeIter *iter,
|
|
||||||
GNCImportTransInfo *trans_info)
|
|
||||||
{
|
|
||||||
g_assert (trans_info);
|
|
||||||
|
|
||||||
Account *old_acc = gnc_import_TransInfo_get_destacc (trans_info);
|
|
||||||
|
|
||||||
gboolean ok_pressed;
|
|
||||||
Account *new_acc = gnc_import_select_account (
|
|
||||||
info->main_widget,
|
|
||||||
NULL,
|
|
||||||
true,
|
|
||||||
_("Destination account for the auto-balance split."),
|
|
||||||
xaccTransGetCurrency (gnc_import_TransInfo_get_trans (trans_info)),
|
|
||||||
ACCT_TYPE_NONE,
|
|
||||||
old_acc,
|
|
||||||
&ok_pressed);
|
|
||||||
if (ok_pressed)
|
|
||||||
{
|
|
||||||
gnc_import_TransInfo_set_destacc (trans_info, new_acc, true);
|
|
||||||
defer_bal_computation (info, new_acc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
run_match_dialog (GNCImportMainMatcher *info,
|
run_match_dialog (GNCImportMainMatcher *info,
|
||||||
GNCImportTransInfo *trans_info)
|
GNCImportTransInfo *trans_info)
|
||||||
|
@ -507,15 +507,6 @@ gnc_split_register_get_fcredit_label (VirtualLocation virt_loc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char*
|
|
||||||
gnc_split_register_get_default_tooltip (VirtualLocation virt_loc,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
SplitRegister* reg = user_data;
|
|
||||||
const char* tooltip = gnc_table_get_entry (reg->table, virt_loc);
|
|
||||||
|
|
||||||
return g_strdup (tooltip);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
gnc_split_register_get_recn_tooltip (VirtualLocation virt_loc,
|
gnc_split_register_get_recn_tooltip (VirtualLocation virt_loc,
|
||||||
@ -2706,8 +2697,6 @@ gnc_split_register_model_new (void)
|
|||||||
RBALN_CELL);
|
RBALN_CELL);
|
||||||
|
|
||||||
// tooltip handlers
|
// tooltip handlers
|
||||||
// gnc_table_model_set_default_tooltip_handler(
|
|
||||||
// model, gnc_split_register_get_default_tooltip);
|
|
||||||
|
|
||||||
gnc_table_model_set_tooltip_handler (model,
|
gnc_table_model_set_tooltip_handler (model,
|
||||||
gnc_split_register_get_recn_tooltip,
|
gnc_split_register_get_recn_tooltip,
|
||||||
|
@ -257,30 +257,6 @@ static guint32 inc_intensity_10percent (guint32 argb)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** For a given byte value, multiply the value by a rational number,
|
|
||||||
specified by numerator and denominator. This is some simple integer arithmetics
|
|
||||||
for the case when we don't even need a conversion to floating point and
|
|
||||||
backwards. */
|
|
||||||
static guint8 dec_intensity_byte (guint8 input, int numerator, int denominator)
|
|
||||||
{
|
|
||||||
guint8 result;
|
|
||||||
result = (input * numerator) / denominator;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** For a given RGB value, decrease the color intensity for each of the three
|
|
||||||
colors identically by 10 percent and return this changed RGB value. */
|
|
||||||
static guint32 dec_intensity_10percent (guint32 argb)
|
|
||||||
{
|
|
||||||
// Multiply each single byte by 9/10 i.e. by 0.9 which decreases the
|
|
||||||
// intensity by 10 percent.
|
|
||||||
guint32 result =
|
|
||||||
(dec_intensity_byte ((argb & 0x00FF0000) >> 16, 9, 10) << 16)
|
|
||||||
+ (dec_intensity_byte ((argb & 0x0000FF00) >> 8, 9, 10) << 8)
|
|
||||||
+ (dec_intensity_byte (argb & 0x000000FF, 9, 10));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Actual drawing routines */
|
/* Actual drawing routines */
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -145,19 +145,6 @@ gnucash_sheet_set_position (GnucashSheet* sheet, int pos)
|
|||||||
gnucash_sheet_set_position_and_selection (sheet, pos, pos, pos);
|
gnucash_sheet_set_position_and_selection (sheet, pos, pos, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
gnucash_sheet_get_selection (GnucashSheet *sheet, int *start, int *end)
|
|
||||||
{
|
|
||||||
*start = sheet->pos;
|
|
||||||
*end = sheet->bound;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
gnucash_sheet_clear_selection (GnucashSheet *sheet)
|
|
||||||
{
|
|
||||||
gnucash_sheet_set_selection (sheet, sheet->pos, sheet->pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
gnucash_sheet_set_entry_value (GnucashSheet *sheet, const char* value)
|
gnucash_sheet_set_entry_value (GnucashSheet *sheet, const char* value)
|
||||||
{
|
{
|
||||||
|
@ -35,12 +35,6 @@ gfec_string_from_locale(void *data)
|
|||||||
return scm_from_locale_string(str);
|
return scm_from_locale_string(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SCM
|
|
||||||
gfec_string_outer_handler(void *data, SCM key, SCM args)
|
|
||||||
{
|
|
||||||
return SCM_UNDEFINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SCM
|
static SCM
|
||||||
gfec_string_inner_handler(void *data, SCM key, SCM args)
|
gfec_string_inner_handler(void *data, SCM key, SCM args)
|
||||||
{
|
{
|
||||||
|
@ -40,11 +40,6 @@
|
|||||||
|
|
||||||
G_GNUC_UNUSED static QofLogModule log_module = "test-dbi";
|
G_GNUC_UNUSED static QofLogModule log_module = "test-dbi";
|
||||||
|
|
||||||
/* Placeholder for some old functions that need to be re-written and enabled */
|
|
||||||
static void do_test (G_GNUC_UNUSED gboolean foo, G_GNUC_UNUSED gchar* bar)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
do_compare (QofBook* book_1, QofBook* book_2, const gchar* id,
|
do_compare (QofBook* book_1, QofBook* book_2, const gchar* id,
|
||||||
QofInstanceForeachCB cb, const gchar* msg)
|
QofInstanceForeachCB cb, const gchar* msg)
|
||||||
|
@ -183,18 +183,6 @@ GncSqlSlotsBackend::GncSqlSlotsBackend() :
|
|||||||
|
|
||||||
/* ================================================================= */
|
/* ================================================================= */
|
||||||
|
|
||||||
inline static std::string::size_type
|
|
||||||
get_final_delim(std::string& path)
|
|
||||||
{
|
|
||||||
auto idx = path.rfind('/');
|
|
||||||
while (idx == path.length())
|
|
||||||
{
|
|
||||||
path.erase(idx);
|
|
||||||
idx = path.rfind('/');
|
|
||||||
}
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string
|
static std::string
|
||||||
get_key (slot_info_t* pInfo)
|
get_key (slot_info_t* pInfo)
|
||||||
{
|
{
|
||||||
@ -790,31 +778,6 @@ load_obj_guid (const GncSqlBackend* sql_be, GncSqlRow& row)
|
|||||||
return &guid;
|
return &guid;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
load_slot_for_list_item (GncSqlBackend* sql_be, GncSqlRow& row,
|
|
||||||
QofCollection* coll)
|
|
||||||
{
|
|
||||||
slot_info_t slot_info = { NULL, NULL, TRUE, NULL, KvpValue::Type::INVALID,
|
|
||||||
NULL, FRAME, NULL, "" };
|
|
||||||
const GncGUID* guid;
|
|
||||||
QofInstance* inst;
|
|
||||||
|
|
||||||
g_return_if_fail (sql_be != NULL);
|
|
||||||
g_return_if_fail (coll != NULL);
|
|
||||||
|
|
||||||
guid = load_obj_guid (sql_be, row);
|
|
||||||
g_assert (guid != NULL);
|
|
||||||
inst = qof_collection_lookup_entity (coll, guid);
|
|
||||||
|
|
||||||
slot_info.be = sql_be;
|
|
||||||
slot_info.pKvpFrame = qof_instance_get_slots (inst);
|
|
||||||
slot_info.context = NONE;
|
|
||||||
|
|
||||||
gnc_sql_load_object (sql_be, row, TABLE_NAME, &slot_info, col_table);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
load_slot_for_book_object (GncSqlBackend* sql_be, GncSqlRow& row,
|
load_slot_for_book_object (GncSqlBackend* sql_be, GncSqlRow& row,
|
||||||
BookLookupFn lookup_fn)
|
BookLookupFn lookup_fn)
|
||||||
|
@ -723,168 +723,6 @@ GncSqlTransBackend::load_all (GncSqlBackend* sql_be)
|
|||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
convert_query_comparison_to_sql (QofQueryPredData* pPredData,
|
|
||||||
gboolean isInverted, std::stringstream& sql)
|
|
||||||
{
|
|
||||||
if (pPredData->how == QOF_COMPARE_LT
|
|
||||||
|| (isInverted && pPredData->how == QOF_COMPARE_GTE))
|
|
||||||
sql << "<";
|
|
||||||
else if (pPredData->how == QOF_COMPARE_LTE
|
|
||||||
|| (isInverted && pPredData->how == QOF_COMPARE_GT))
|
|
||||||
sql << "<=";
|
|
||||||
else if (pPredData->how == QOF_COMPARE_EQUAL
|
|
||||||
|| (isInverted && pPredData->how == QOF_COMPARE_NEQ))
|
|
||||||
sql << "=";
|
|
||||||
else if (pPredData->how == QOF_COMPARE_GT
|
|
||||||
|| (isInverted && pPredData->how == QOF_COMPARE_LTE))
|
|
||||||
sql << ">";
|
|
||||||
else if (pPredData->how == QOF_COMPARE_GTE
|
|
||||||
|| (isInverted && pPredData->how == QOF_COMPARE_LT))
|
|
||||||
sql << ">=";
|
|
||||||
else if (pPredData->how == QOF_COMPARE_NEQ
|
|
||||||
|| (isInverted && pPredData->how == QOF_COMPARE_EQUAL))
|
|
||||||
sql << "~=";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PERR ("Unknown comparison type\n");
|
|
||||||
sql << "??";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
convert_query_term_to_sql (const GncSqlBackend* sql_be, const gchar* fieldName,
|
|
||||||
QofQueryTerm* pTerm, std::stringstream& sql)
|
|
||||||
{
|
|
||||||
QofQueryPredData* pPredData;
|
|
||||||
gboolean isInverted;
|
|
||||||
|
|
||||||
g_return_if_fail (pTerm != NULL);
|
|
||||||
|
|
||||||
pPredData = qof_query_term_get_pred_data (pTerm);
|
|
||||||
isInverted = qof_query_term_is_inverted (pTerm);
|
|
||||||
|
|
||||||
if (g_strcmp0 (pPredData->type_name, QOF_TYPE_GUID) == 0)
|
|
||||||
{
|
|
||||||
query_guid_t guid_data = (query_guid_t)pPredData;
|
|
||||||
GList* guid_entry;
|
|
||||||
sql << "(" << fieldName;
|
|
||||||
|
|
||||||
switch (guid_data->options)
|
|
||||||
{
|
|
||||||
case QOF_GUID_MATCH_ANY:
|
|
||||||
sql << (isInverted ? " NOT IN (" : " IN (");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case QOF_GUID_MATCH_NONE:
|
|
||||||
sql << (isInverted ? " IN (" : " NOT IN (");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
PERR ("Unexpected GncGUID match type: %d\n", guid_data->options);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (guid_entry = guid_data->guids; guid_entry != NULL;
|
|
||||||
guid_entry = guid_entry->next)
|
|
||||||
{
|
|
||||||
gchar guid_buf[GUID_ENCODING_LENGTH + 1];
|
|
||||||
|
|
||||||
if (guid_entry != guid_data->guids) sql << ",";
|
|
||||||
(void)guid_to_string_buff (static_cast<GncGUID*> (guid_entry->data),
|
|
||||||
guid_buf);
|
|
||||||
sql << guid_buf;
|
|
||||||
}
|
|
||||||
sql << "))";
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (g_strcmp0 (pPredData->type_name, QOF_TYPE_CHAR) == 0)
|
|
||||||
{
|
|
||||||
query_char_t char_data = (query_char_t)pPredData;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (isInverted) sql << "NOT(";
|
|
||||||
if (char_data->options == QOF_CHAR_MATCH_NONE) sql << "NOT ";
|
|
||||||
sql << "(";
|
|
||||||
for (i = 0; char_data->char_list[i] != '\0'; i++)
|
|
||||||
{
|
|
||||||
if (i != 0) sql << " OR ";
|
|
||||||
sql << fieldName << " = '" << char_data->char_list[i] << "'";
|
|
||||||
}
|
|
||||||
sql << ") ";
|
|
||||||
if (isInverted) sql << ") ";
|
|
||||||
}
|
|
||||||
else if (g_strcmp0 (pPredData->type_name, QOF_TYPE_STRING) == 0)
|
|
||||||
{
|
|
||||||
query_string_t string_data = (query_string_t)pPredData;
|
|
||||||
sqlEscape* escape = sqlEscape_new ();
|
|
||||||
|
|
||||||
if (isInverted || pPredData->how == QOF_COMPARE_NEQ)
|
|
||||||
sql << "NOT(";
|
|
||||||
sql << fieldName;
|
|
||||||
if (string_data->is_regex ||
|
|
||||||
string_data->options == QOF_STRING_MATCH_CASEINSENSITIVE)
|
|
||||||
{
|
|
||||||
PWARN ("String is_regex || option = QOF_STRING_MATCH_INSENSITIVE\n");
|
|
||||||
}
|
|
||||||
// sql << " ~" ;
|
|
||||||
// } else {
|
|
||||||
sql << " =";
|
|
||||||
// }
|
|
||||||
// if( string_data->options == QOF_STRING_MATCH_CASEINSENSITIVE ) {
|
|
||||||
// sql+= "*";
|
|
||||||
// }
|
|
||||||
sql << "'" << sqlEscapeString (escape, string_data->matchstring) << "'";
|
|
||||||
if (pPredData->how == QOF_COMPARE_NEQ) sql << ")";
|
|
||||||
if (isInverted) sql << ")";
|
|
||||||
sqlEscape_destroy (escape);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sql << "(" << fieldName;
|
|
||||||
convert_query_comparison_to_sql (pPredData, isInverted, sql);
|
|
||||||
|
|
||||||
if (strcmp (pPredData->type_name, QOF_TYPE_NUMERIC) == 0)
|
|
||||||
{
|
|
||||||
query_numeric_t pData = (query_numeric_t)pPredData;
|
|
||||||
sql << gnc_numeric_to_double (pData->amount);
|
|
||||||
}
|
|
||||||
else if (g_strcmp0 (pPredData->type_name, QOF_TYPE_DATE) == 0)
|
|
||||||
{
|
|
||||||
query_date_t date_data = (query_date_t)pPredData;
|
|
||||||
|
|
||||||
GncDateTime time(date_data->date);
|
|
||||||
sql << time.format_iso8601();
|
|
||||||
}
|
|
||||||
else if (strcmp (pPredData->type_name, QOF_TYPE_INT32) == 0)
|
|
||||||
{
|
|
||||||
query_int32_t pData = (query_int32_t)pPredData;
|
|
||||||
sql << pData->val;
|
|
||||||
}
|
|
||||||
else if (strcmp (pPredData->type_name, QOF_TYPE_INT64) == 0)
|
|
||||||
{
|
|
||||||
query_int64_t pData = (query_int64_t)pPredData;
|
|
||||||
sql << pData->val;
|
|
||||||
}
|
|
||||||
else if (strcmp (pPredData->type_name, QOF_TYPE_DOUBLE) == 0)
|
|
||||||
{
|
|
||||||
query_double_t pData = (query_double_t)pPredData;
|
|
||||||
sql << pData->val;
|
|
||||||
}
|
|
||||||
else if (strcmp (pPredData->type_name, QOF_TYPE_BOOLEAN) == 0)
|
|
||||||
{
|
|
||||||
query_boolean_t pData = (query_boolean_t)pPredData;
|
|
||||||
sql << pData->val;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PERR ("Unknown query predicate type: %s\n", pPredData->type_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
sql << ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GncSqlStatementPtr stmt;
|
GncSqlStatementPtr stmt;
|
||||||
|
@ -433,16 +433,6 @@ set_tran_time64 (xmlNodePtr node, Transaction * trn,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gboolean
|
|
||||||
set_tran_date (xmlNodePtr node, Transaction* trn,
|
|
||||||
void (*func) (Transaction* trn, const time64 tm))
|
|
||||||
{
|
|
||||||
time64 time = dom_tree_to_time64 (node);
|
|
||||||
if (!dom_tree_valid_time64 (time, node->name)) time = 0;
|
|
||||||
func (trn, time);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
trn_id_handler (xmlNodePtr node, gpointer trans_pdata)
|
trn_id_handler (xmlNodePtr node, gpointer trans_pdata)
|
||||||
{
|
{
|
||||||
|
@ -2060,25 +2060,6 @@ xaccTransSetDateEnteredSecs (Transaction *trans, time64 secs)
|
|||||||
xaccTransSetDateInternal(trans, &trans->date_entered, secs);
|
xaccTransSetDateInternal(trans, &trans->date_entered, secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
qofTransSetDatePosted (Transaction *trans, time64 time)
|
|
||||||
{
|
|
||||||
if (!trans) return;
|
|
||||||
if (!qof_begin_edit(&trans->inst)) return;
|
|
||||||
xaccTransSetDateInternal(trans, &trans->date_posted, time);
|
|
||||||
set_gains_date_dirty(trans);
|
|
||||||
qof_commit_edit(&trans->inst);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
qofTransSetDateEntered (Transaction *trans, time64 time)
|
|
||||||
{
|
|
||||||
if (!trans) return;
|
|
||||||
if (!qof_begin_edit(&trans->inst)) return;
|
|
||||||
xaccTransSetDateInternal(trans, &trans->date_entered, time);
|
|
||||||
qof_commit_edit(&trans->inst);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
xaccTransSetDate (Transaction *trans, int day, int mon, int year)
|
xaccTransSetDate (Transaction *trans, int day, int mon, int year)
|
||||||
{
|
{
|
||||||
|
@ -265,55 +265,6 @@ GncOptionDB::make_internal(const char* section, const char* name)
|
|||||||
db_opt->make_internal();
|
db_opt->make_internal();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_eol(char c)
|
|
||||||
{
|
|
||||||
return c == '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_whitespace(char c)
|
|
||||||
{
|
|
||||||
return c == ' ' || c == '\n' || c == '\t';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_begin_paren(char c)
|
|
||||||
{
|
|
||||||
return c == '(';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_end_paren(char c)
|
|
||||||
{
|
|
||||||
return c == ')';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_double_quote(char c)
|
|
||||||
{
|
|
||||||
return c == '"';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_single_quote(char c)
|
|
||||||
{
|
|
||||||
return c == '\'';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_semicolon(char c)
|
|
||||||
{
|
|
||||||
return c == ';';
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool constexpr
|
|
||||||
is_delim(char c)
|
|
||||||
{
|
|
||||||
return is_begin_paren(c) || is_end_paren(c) || is_whitespace(c) ||
|
|
||||||
is_single_quote(c) || is_double_quote(c) || is_semicolon(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ostream&
|
std::ostream&
|
||||||
GncOptionDB::save_option_key_value(std::ostream& oss,
|
GncOptionDB::save_option_key_value(std::ostream& oss,
|
||||||
const std::string& section,
|
const std::string& section,
|
||||||
|
@ -202,42 +202,5 @@ xaccGetFIFOPolicy (void)
|
|||||||
return pcy;
|
return pcy;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GNCLot *
|
|
||||||
LIFOPolicyGetLot (GNCPolicy *pcy, Split *split)
|
|
||||||
{
|
|
||||||
if (!split) return NULL;
|
|
||||||
return xaccAccountFindLatestOpenLot (split->acc, split->amount,
|
|
||||||
split->parent->common_currency);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Split *
|
|
||||||
LIFOPolicyGetSplit (GNCPolicy *pcy, GNCLot *lot)
|
|
||||||
{
|
|
||||||
return DirectionPolicyGetSplit (pcy, lot, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This routine is actually identical to FIFO... */
|
|
||||||
static void
|
|
||||||
LIFOPolicyGetLotOpening (GNCPolicy *pcy,
|
|
||||||
GNCLot *lot,
|
|
||||||
gnc_numeric *ret_amount, gnc_numeric *ret_value,
|
|
||||||
gnc_commodity **ret_currency)
|
|
||||||
{
|
|
||||||
Split *opening_split;
|
|
||||||
opening_split = gnc_lot_get_earliest_split(lot);
|
|
||||||
|
|
||||||
if (ret_amount) *ret_amount = opening_split->amount;
|
|
||||||
if (ret_value) *ret_value = opening_split->value;
|
|
||||||
if (ret_currency) *ret_currency = opening_split->parent->common_currency;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This routine is actually identical to FIFO... */
|
|
||||||
static gboolean
|
|
||||||
LIFOPolicyIsOpeningSplit (GNCPolicy *pcy, GNCLot *lot, Split *split)
|
|
||||||
{
|
|
||||||
Split *opening_split;
|
|
||||||
opening_split = gnc_lot_get_earliest_split(lot);
|
|
||||||
return (split == opening_split);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* =========================== END OF FILE ======================= */
|
/* =========================== END OF FILE ======================= */
|
||||||
|
@ -272,12 +272,6 @@ const char * qof_object_get_type_label (QofIdTypeConst type_name)
|
|||||||
return (obj->type_label);
|
return (obj->type_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean clear_table (gpointer key, gpointer value, gpointer user_data)
|
|
||||||
{
|
|
||||||
g_hash_table_destroy (static_cast<GHashTable*>(value));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* INITIALIZATION and PRIVATE FUNCTIONS */
|
/* INITIALIZATION and PRIVATE FUNCTIONS */
|
||||||
|
|
||||||
void qof_object_initialize (void)
|
void qof_object_initialize (void)
|
||||||
|
@ -122,20 +122,6 @@ set_max_kvp_frame_elements (gint max_kvp_frame_elements)
|
|||||||
kvp_frame_max_elements = MAX (max_kvp_frame_elements, 1);
|
kvp_frame_max_elements = MAX (max_kvp_frame_elements, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
kvp_exclude_type (KvpValue::Type kvp_type)
|
|
||||||
{
|
|
||||||
gint *key;
|
|
||||||
|
|
||||||
if (!exclude_kvp_types)
|
|
||||||
exclude_kvp_types = g_hash_table_new (g_int_hash, g_int_equal);
|
|
||||||
|
|
||||||
key = g_new (gint, 1);
|
|
||||||
*key = kvp_type;
|
|
||||||
|
|
||||||
g_hash_table_insert (exclude_kvp_types, key, exclude_kvp_types);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
kvp_type_excluded (KvpValue::Type kvp_type)
|
kvp_type_excluded (KvpValue::Type kvp_type)
|
||||||
{
|
{
|
||||||
@ -1565,32 +1551,6 @@ get_random_queryop(void)
|
|||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GSList *
|
|
||||||
get_random_kvp_path (void)
|
|
||||||
{
|
|
||||||
GSList *path;
|
|
||||||
gint len;
|
|
||||||
|
|
||||||
path = NULL;
|
|
||||||
len = get_random_int_in_range (1, kvp_max_depth);
|
|
||||||
|
|
||||||
while (len--)
|
|
||||||
path = g_slist_prepend (path, get_random_string_without ("\n\\"));
|
|
||||||
|
|
||||||
return g_slist_reverse (path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
free_random_kvp_path (GSList *path)
|
|
||||||
{
|
|
||||||
GSList *node;
|
|
||||||
|
|
||||||
for (node = path; node; node = node->next)
|
|
||||||
g_free (node->data);
|
|
||||||
|
|
||||||
g_slist_free (path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static QofIdType
|
static QofIdType
|
||||||
get_random_id_type (void)
|
get_random_id_type (void)
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,6 @@ KvpFrame* get_random_kvp_frame(void);
|
|||||||
gnc_numeric get_random_gnc_numeric(int64_t);
|
gnc_numeric get_random_gnc_numeric(int64_t);
|
||||||
GncGUID* get_random_guid(void);
|
GncGUID* get_random_guid(void);
|
||||||
|
|
||||||
//void kvp_exclude_type (KvpValueType kvp_type);
|
|
||||||
void set_max_kvp_depth (gint max_kvp_depth);
|
void set_max_kvp_depth (gint max_kvp_depth);
|
||||||
void set_max_kvp_frame_elements (gint max_kvp_frame_elements);
|
void set_max_kvp_frame_elements (gint max_kvp_frame_elements);
|
||||||
void set_max_account_tree_depth (gint max_tree_depth);
|
void set_max_account_tree_depth (gint max_tree_depth);
|
||||||
|
@ -61,18 +61,6 @@ typedef struct
|
|||||||
time64 t5;
|
time64 t5;
|
||||||
} FixtureA;
|
} FixtureA;
|
||||||
|
|
||||||
static int
|
|
||||||
offset_secs (TZOffset tz)
|
|
||||||
{
|
|
||||||
return 3600 * tz.hours + 60 * tz.minutes;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char*
|
|
||||||
offset_string (TZOffset tz)
|
|
||||||
{
|
|
||||||
return g_strdup_printf("%+02d%02d", tz.hours, tz.minutes);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setup (FixtureA *f, gconstpointer pData)
|
static void setup (FixtureA *f, gconstpointer pData)
|
||||||
{
|
{
|
||||||
f->t0 = gnc_time(NULL);
|
f->t0 = gnc_time(NULL);
|
||||||
@ -1348,15 +1336,6 @@ test_gnc_date_timestamp (void)
|
|||||||
|
|
||||||
g_free (timestr);
|
g_free (timestr);
|
||||||
}
|
}
|
||||||
/* gnc_iso8601_to_time64_gmt
|
|
||||||
time64
|
|
||||||
gnc_iso8601_to_time64_gmt(const char *str)// C: 6 in 3 Local: 0:0:0
|
|
||||||
*/
|
|
||||||
static gint
|
|
||||||
get_nanoseconds (GDateTime *gdt)
|
|
||||||
{
|
|
||||||
return g_date_time_get_microsecond (gdt) * 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_gnc_iso8601_to_time64_gmt (FixtureA *f, gconstpointer pData)
|
test_gnc_iso8601_to_time64_gmt (FixtureA *f, gconstpointer pData)
|
||||||
@ -1382,18 +1361,6 @@ test_gnc_iso8601_to_time64_gmt (FixtureA *f, gconstpointer pData)
|
|||||||
t = gnc_iso8601_to_time64_gmt ("2061-01-25 23:21:19.0 -05:00");
|
t = gnc_iso8601_to_time64_gmt ("2061-01-25 23:21:19.0 -05:00");
|
||||||
g_assert_cmpint (t, ==, f->t5);
|
g_assert_cmpint (t, ==, f->t5);
|
||||||
}
|
}
|
||||||
/* gnc_time64_to_iso8601_buff
|
|
||||||
char *
|
|
||||||
gnc_time64_to_iso8601_buff (time64 t, char * buff)// C: 18 in 7 Local: 0:0:0
|
|
||||||
*/
|
|
||||||
static time64
|
|
||||||
g_date_time_to_time64 (GDateTime *gdt)
|
|
||||||
{
|
|
||||||
time64 t;
|
|
||||||
t = g_date_time_to_unix (gdt);
|
|
||||||
return t;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ISO8601_SIZE MAX_DATE_LENGTH + 4
|
#define ISO8601_SIZE MAX_DATE_LENGTH + 4
|
||||||
static gchar*
|
static gchar*
|
||||||
format_timestring (time64 t, TZOffset tz)
|
format_timestring (time64 t, TZOffset tz)
|
||||||
@ -1536,22 +1503,6 @@ test_gnc_dmy2time64_end (FixtureB *f, gconstpointer pData)
|
|||||||
g_log_set_default_handler (hdlr, 0);
|
g_log_set_default_handler (hdlr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GDateTime*
|
|
||||||
offset_adjust(GDateTime *gdt)
|
|
||||||
{
|
|
||||||
Testfuncs *tf = gnc_date_load_funcs();
|
|
||||||
GTimeZone *zone = tf->timezone_new_local();
|
|
||||||
int interval = g_time_zone_find_interval(zone, G_TIME_TYPE_STANDARD,
|
|
||||||
g_date_time_to_unix(gdt));
|
|
||||||
int offset = g_time_zone_get_offset(zone, interval) / 60;
|
|
||||||
int off_hr = (offset / 60) + (offset % 60 ? (offset < 0 ? -1 : 1) : 0);
|
|
||||||
int correction = off_hr < -10 ? -10 - off_hr : off_hr > 13 ? 13 - off_hr : 0;
|
|
||||||
GDateTime* new_gdt = g_date_time_add_hours(gdt, correction);
|
|
||||||
g_date_time_unref(gdt);
|
|
||||||
g_slice_free(Testfuncs, tf);
|
|
||||||
return new_gdt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*gnc_dmy2time64_neutral*/
|
/*gnc_dmy2time64_neutral*/
|
||||||
static void
|
static void
|
||||||
test_gnc_dmy2time64_neutral (FixtureB *f, gconstpointer pData)
|
test_gnc_dmy2time64_neutral (FixtureB *f, gconstpointer pData)
|
||||||
|
@ -431,15 +431,6 @@ test_instance_display_name( Fixture *fixture, gconstpointer pData )
|
|||||||
qof_collection_destroy( col );
|
qof_collection_destroy( col );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
mock_backend_begin( QofBackend *be, QofInstance *inst )
|
|
||||||
{
|
|
||||||
g_assert( be );
|
|
||||||
g_assert( inst );
|
|
||||||
g_assert_cmpstr( inst->e_type, == , "test type" );
|
|
||||||
is_called = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_instance_begin_edit( Fixture *fixture, gconstpointer pData )
|
test_instance_begin_edit( Fixture *fixture, gconstpointer pData )
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,6 @@ static QofBook * exported_book {nullptr};
|
|||||||
static bool safe_sync_called {false};
|
static bool safe_sync_called {false};
|
||||||
static bool sync_called {false};
|
static bool sync_called {false};
|
||||||
static bool load_error {true};
|
static bool load_error {true};
|
||||||
static bool hook_called {false};
|
|
||||||
static bool data_loaded {false};
|
static bool data_loaded {false};
|
||||||
|
|
||||||
class QofSessionMockBackend : public QofBackend
|
class QofSessionMockBackend : public QofBackend
|
||||||
@ -52,12 +51,6 @@ public:
|
|||||||
void export_coa(QofBook*);
|
void export_coa(QofBook*);
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
|
||||||
example_hook (QofSession & session)
|
|
||||||
{
|
|
||||||
hook_called = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QofSessionMockBackend::load (QofBook *book, QofBackendLoadType)
|
void QofSessionMockBackend::load (QofBook *book, QofBackendLoadType)
|
||||||
{
|
{
|
||||||
if (load_error)
|
if (load_error)
|
||||||
|
Loading…
Reference in New Issue
Block a user