gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Thu Sep 6 20:11:10 EDT 2018
Updated via https://github.com/Gnucash/gnucash/commit/61551526 (commit)
via https://github.com/Gnucash/gnucash/commit/148f2413 (commit)
via https://github.com/Gnucash/gnucash/commit/75ccd57d (commit)
via https://github.com/Gnucash/gnucash/commit/f6d873dc (commit)
via https://github.com/Gnucash/gnucash/commit/e47b460a (commit)
via https://github.com/Gnucash/gnucash/commit/705e8664 (commit)
via https://github.com/Gnucash/gnucash/commit/d07f759c (commit)
via https://github.com/Gnucash/gnucash/commit/4c87dd05 (commit)
via https://github.com/Gnucash/gnucash/commit/bf00330e (commit)
via https://github.com/Gnucash/gnucash/commit/131df821 (commit)
via https://github.com/Gnucash/gnucash/commit/caaf9edc (commit)
via https://github.com/Gnucash/gnucash/commit/baf933ac (commit)
via https://github.com/Gnucash/gnucash/commit/1239876b (commit)
via https://github.com/Gnucash/gnucash/commit/5ffb7fa2 (commit)
via https://github.com/Gnucash/gnucash/commit/fc368b91 (commit)
via https://github.com/Gnucash/gnucash/commit/6dfbf3d5 (commit)
via https://github.com/Gnucash/gnucash/commit/c977c235 (commit)
via https://github.com/Gnucash/gnucash/commit/28691b46 (commit)
via https://github.com/Gnucash/gnucash/commit/b1ee7c6e (commit)
via https://github.com/Gnucash/gnucash/commit/704afc6e (commit)
via https://github.com/Gnucash/gnucash/commit/fe73f52b (commit)
via https://github.com/Gnucash/gnucash/commit/4e88b8cb (commit)
via https://github.com/Gnucash/gnucash/commit/a639dd92 (commit)
via https://github.com/Gnucash/gnucash/commit/e2801fd9 (commit)
via https://github.com/Gnucash/gnucash/commit/2dcb3162 (commit)
via https://github.com/Gnucash/gnucash/commit/fd750a22 (commit)
via https://github.com/Gnucash/gnucash/commit/8ad6e045 (commit)
via https://github.com/Gnucash/gnucash/commit/93f3a8ea (commit)
via https://github.com/Gnucash/gnucash/commit/3456596a (commit)
via https://github.com/Gnucash/gnucash/commit/67ee1d99 (commit)
via https://github.com/Gnucash/gnucash/commit/aabae1ca (commit)
via https://github.com/Gnucash/gnucash/commit/dd49756f (commit)
via https://github.com/Gnucash/gnucash/commit/4a3c6f8f (commit)
via https://github.com/Gnucash/gnucash/commit/995e6b0f (commit)
via https://github.com/Gnucash/gnucash/commit/39b24325 (commit)
via https://github.com/Gnucash/gnucash/commit/54a5097c (commit)
via https://github.com/Gnucash/gnucash/commit/34cb4925 (commit)
via https://github.com/Gnucash/gnucash/commit/6ba47846 (commit)
via https://github.com/Gnucash/gnucash/commit/a650693d (commit)
via https://github.com/Gnucash/gnucash/commit/9423e091 (commit)
via https://github.com/Gnucash/gnucash/commit/c6001d85 (commit)
via https://github.com/Gnucash/gnucash/commit/ed05b895 (commit)
via https://github.com/Gnucash/gnucash/commit/13c5b539 (commit)
via https://github.com/Gnucash/gnucash/commit/72a29a83 (commit)
via https://github.com/Gnucash/gnucash/commit/8a0ee0e3 (commit)
via https://github.com/Gnucash/gnucash/commit/e281b50b (commit)
via https://github.com/Gnucash/gnucash/commit/97a566ae (commit)
via https://github.com/Gnucash/gnucash/commit/6eac7e1e (commit)
via https://github.com/Gnucash/gnucash/commit/632c7c72 (commit)
via https://github.com/Gnucash/gnucash/commit/d74ec9aa (commit)
via https://github.com/Gnucash/gnucash/commit/3f9a8977 (commit)
via https://github.com/Gnucash/gnucash/commit/b50c8a57 (commit)
via https://github.com/Gnucash/gnucash/commit/b4db066d (commit)
via https://github.com/Gnucash/gnucash/commit/c3724431 (commit)
via https://github.com/Gnucash/gnucash/commit/44644694 (commit)
via https://github.com/Gnucash/gnucash/commit/88597d0b (commit)
via https://github.com/Gnucash/gnucash/commit/c08dee67 (commit)
via https://github.com/Gnucash/gnucash/commit/e9098d08 (commit)
via https://github.com/Gnucash/gnucash/commit/35fabe26 (commit)
via https://github.com/Gnucash/gnucash/commit/20f6e4e6 (commit)
via https://github.com/Gnucash/gnucash/commit/755773ac (commit)
via https://github.com/Gnucash/gnucash/commit/b32a8a93 (commit)
via https://github.com/Gnucash/gnucash/commit/62b17ca5 (commit)
via https://github.com/Gnucash/gnucash/commit/358cd979 (commit)
via https://github.com/Gnucash/gnucash/commit/fee589b2 (commit)
via https://github.com/Gnucash/gnucash/commit/92a8cf33 (commit)
via https://github.com/Gnucash/gnucash/commit/44c3dc83 (commit)
via https://github.com/Gnucash/gnucash/commit/c8b372e3 (commit)
via https://github.com/Gnucash/gnucash/commit/b60aef9d (commit)
via https://github.com/Gnucash/gnucash/commit/6f89bd62 (commit)
via https://github.com/Gnucash/gnucash/commit/e7961203 (commit)
via https://github.com/Gnucash/gnucash/commit/dd873240 (commit)
via https://github.com/Gnucash/gnucash/commit/6846a686 (commit)
via https://github.com/Gnucash/gnucash/commit/e3dce951 (commit)
via https://github.com/Gnucash/gnucash/commit/14335b78 (commit)
via https://github.com/Gnucash/gnucash/commit/b3f1104d (commit)
via https://github.com/Gnucash/gnucash/commit/19d6eb90 (commit)
via https://github.com/Gnucash/gnucash/commit/22dd716b (commit)
via https://github.com/Gnucash/gnucash/commit/2f861bc2 (commit)
via https://github.com/Gnucash/gnucash/commit/9768a215 (commit)
via https://github.com/Gnucash/gnucash/commit/5ff8d8da (commit)
via https://github.com/Gnucash/gnucash/commit/847766fc (commit)
via https://github.com/Gnucash/gnucash/commit/1e87d069 (commit)
via https://github.com/Gnucash/gnucash/commit/de2a1e9e (commit)
via https://github.com/Gnucash/gnucash/commit/d69d1f6a (commit)
via https://github.com/Gnucash/gnucash/commit/239ee679 (commit)
via https://github.com/Gnucash/gnucash/commit/e330a781 (commit)
via https://github.com/Gnucash/gnucash/commit/2b0b3d4f (commit)
via https://github.com/Gnucash/gnucash/commit/97c191cd (commit)
via https://github.com/Gnucash/gnucash/commit/641925f2 (commit)
via https://github.com/Gnucash/gnucash/commit/3b74574c (commit)
via https://github.com/Gnucash/gnucash/commit/47ad60c7 (commit)
via https://github.com/Gnucash/gnucash/commit/58ae3f2a (commit)
via https://github.com/Gnucash/gnucash/commit/cabb598c (commit)
via https://github.com/Gnucash/gnucash/commit/8273f3eb (commit)
via https://github.com/Gnucash/gnucash/commit/8cbd4d62 (commit)
via https://github.com/Gnucash/gnucash/commit/47ba21b8 (commit)
via https://github.com/Gnucash/gnucash/commit/78ab26cc (commit)
via https://github.com/Gnucash/gnucash/commit/d87fa3a5 (commit)
via https://github.com/Gnucash/gnucash/commit/4c8b07c0 (commit)
via https://github.com/Gnucash/gnucash/commit/69fef827 (commit)
via https://github.com/Gnucash/gnucash/commit/fe371534 (commit)
via https://github.com/Gnucash/gnucash/commit/2203118d (commit)
via https://github.com/Gnucash/gnucash/commit/cd7a55a9 (commit)
via https://github.com/Gnucash/gnucash/commit/e851f249 (commit)
via https://github.com/Gnucash/gnucash/commit/099b659b (commit)
via https://github.com/Gnucash/gnucash/commit/8c1adaa2 (commit)
via https://github.com/Gnucash/gnucash/commit/68874495 (commit)
via https://github.com/Gnucash/gnucash/commit/ec0d081d (commit)
via https://github.com/Gnucash/gnucash/commit/dd59ba67 (commit)
via https://github.com/Gnucash/gnucash/commit/0a0d4755 (commit)
via https://github.com/Gnucash/gnucash/commit/2c6fbfba (commit)
via https://github.com/Gnucash/gnucash/commit/accd154e (commit)
via https://github.com/Gnucash/gnucash/commit/f9700ba9 (commit)
via https://github.com/Gnucash/gnucash/commit/d6b24577 (commit)
via https://github.com/Gnucash/gnucash/commit/216528c1 (commit)
via https://github.com/Gnucash/gnucash/commit/9cb00f8f (commit)
via https://github.com/Gnucash/gnucash/commit/9993e0ce (commit)
via https://github.com/Gnucash/gnucash/commit/1131aa6f (commit)
via https://github.com/Gnucash/gnucash/commit/40680369 (commit)
via https://github.com/Gnucash/gnucash/commit/827c43d9 (commit)
via https://github.com/Gnucash/gnucash/commit/6d605762 (commit)
via https://github.com/Gnucash/gnucash/commit/773b0703 (commit)
via https://github.com/Gnucash/gnucash/commit/64778fca (commit)
via https://github.com/Gnucash/gnucash/commit/5c90f677 (commit)
via https://github.com/Gnucash/gnucash/commit/5ad584ca (commit)
via https://github.com/Gnucash/gnucash/commit/8edf4478 (commit)
via https://github.com/Gnucash/gnucash/commit/d3439341 (commit)
via https://github.com/Gnucash/gnucash/commit/1ea4310f (commit)
via https://github.com/Gnucash/gnucash/commit/85bb7786 (commit)
via https://github.com/Gnucash/gnucash/commit/193176cc (commit)
via https://github.com/Gnucash/gnucash/commit/93030c61 (commit)
via https://github.com/Gnucash/gnucash/commit/697d2a16 (commit)
via https://github.com/Gnucash/gnucash/commit/fa1b4c68 (commit)
via https://github.com/Gnucash/gnucash/commit/6f1c63db (commit)
via https://github.com/Gnucash/gnucash/commit/c444729d (commit)
via https://github.com/Gnucash/gnucash/commit/294e113f (commit)
via https://github.com/Gnucash/gnucash/commit/414ab99a (commit)
via https://github.com/Gnucash/gnucash/commit/b8ce2b54 (commit)
via https://github.com/Gnucash/gnucash/commit/aa4da810 (commit)
via https://github.com/Gnucash/gnucash/commit/dfe1f345 (commit)
via https://github.com/Gnucash/gnucash/commit/694d0f06 (commit)
via https://github.com/Gnucash/gnucash/commit/57c6f175 (commit)
via https://github.com/Gnucash/gnucash/commit/e2907844 (commit)
via https://github.com/Gnucash/gnucash/commit/ff91056a (commit)
via https://github.com/Gnucash/gnucash/commit/a51be515 (commit)
via https://github.com/Gnucash/gnucash/commit/1fffbaf8 (commit)
via https://github.com/Gnucash/gnucash/commit/374477c3 (commit)
via https://github.com/Gnucash/gnucash/commit/8c4a5adb (commit)
via https://github.com/Gnucash/gnucash/commit/b95981e6 (commit)
via https://github.com/Gnucash/gnucash/commit/aa77b21d (commit)
via https://github.com/Gnucash/gnucash/commit/c513d788 (commit)
via https://github.com/Gnucash/gnucash/commit/0199fef5 (commit)
via https://github.com/Gnucash/gnucash/commit/a75eb4c8 (commit)
via https://github.com/Gnucash/gnucash/commit/3b093131 (commit)
via https://github.com/Gnucash/gnucash/commit/3e37b879 (commit)
via https://github.com/Gnucash/gnucash/commit/36dc2acd (commit)
via https://github.com/Gnucash/gnucash/commit/0e4898fe (commit)
via https://github.com/Gnucash/gnucash/commit/43af50bd (commit)
via https://github.com/Gnucash/gnucash/commit/4c8f822c (commit)
via https://github.com/Gnucash/gnucash/commit/de927d53 (commit)
via https://github.com/Gnucash/gnucash/commit/c2972c75 (commit)
via https://github.com/Gnucash/gnucash/commit/9db7d894 (commit)
via https://github.com/Gnucash/gnucash/commit/983c7ce0 (commit)
via https://github.com/Gnucash/gnucash/commit/756f444a (commit)
via https://github.com/Gnucash/gnucash/commit/e6ea84ba (commit)
via https://github.com/Gnucash/gnucash/commit/38748f20 (commit)
via https://github.com/Gnucash/gnucash/commit/4d013e09 (commit)
via https://github.com/Gnucash/gnucash/commit/ad7c14a5 (commit)
via https://github.com/Gnucash/gnucash/commit/582265d0 (commit)
via https://github.com/Gnucash/gnucash/commit/0594beb0 (commit)
via https://github.com/Gnucash/gnucash/commit/5c8af379 (commit)
via https://github.com/Gnucash/gnucash/commit/d12ee9a4 (commit)
via https://github.com/Gnucash/gnucash/commit/eb0256e3 (commit)
via https://github.com/Gnucash/gnucash/commit/9d5712ef (commit)
via https://github.com/Gnucash/gnucash/commit/87578184 (commit)
via https://github.com/Gnucash/gnucash/commit/f067e832 (commit)
via https://github.com/Gnucash/gnucash/commit/49bd9c41 (commit)
via https://github.com/Gnucash/gnucash/commit/9ab06bc9 (commit)
via https://github.com/Gnucash/gnucash/commit/240c4bd2 (commit)
via https://github.com/Gnucash/gnucash/commit/04424b62 (commit)
via https://github.com/Gnucash/gnucash/commit/00ef7f3a (commit)
via https://github.com/Gnucash/gnucash/commit/463b551d (commit)
via https://github.com/Gnucash/gnucash/commit/3d4201f1 (commit)
via https://github.com/Gnucash/gnucash/commit/b79c9d15 (commit)
via https://github.com/Gnucash/gnucash/commit/d865b149 (commit)
via https://github.com/Gnucash/gnucash/commit/f7ed46a3 (commit)
via https://github.com/Gnucash/gnucash/commit/4e04f6e5 (commit)
via https://github.com/Gnucash/gnucash/commit/8de1625d (commit)
via https://github.com/Gnucash/gnucash/commit/60117491 (commit)
via https://github.com/Gnucash/gnucash/commit/246257de (commit)
via https://github.com/Gnucash/gnucash/commit/5f46553f (commit)
from https://github.com/Gnucash/gnucash/commit/280ed47d (commit)
commit 61551526a860acc44c4cc545f699424d7347d41b
Merge: 280ed47 148f241
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Sep 6 16:26:29 2018 -0700
Merge branch 'maint'
commit 148f24135b18b7b9b777aa21db6593a19b68f37f
Merge: 75ccd57 cd7a55a
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Sep 6 15:21:36 2018 -0700
Merge Bob Fewell's 'fixes9' into maint.
diff --cc gnucash/gnome-search/search-date.c
index 364c7ec,af85414..7a746c2
--- a/gnucash/gnome-search/search-date.c
+++ b/gnucash/gnome-search/search-date.c
@@@ -37,16 -37,17 +37,17 @@@
#define d(x)
+ static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static void editable_enters (GNCSearchCoreType *fe);
static void grab_focus (GNCSearchCoreType *fe);
-static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
+static GNCSearchCoreType *gncs_clone (GNCSearchCoreType *fe);
static gboolean gncs_validate (GNCSearchCoreType *fe);
-static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
+static GtkWidget *gncs_get_widget (GNCSearchCoreType *fe);
static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);
-static void gnc_search_date_class_init (GNCSearchDateClass *klass);
-static void gnc_search_date_init (GNCSearchDate *gspaper);
-static void gnc_search_date_finalize (GObject *obj);
+static void gnc_search_date_class_init (GNCSearchDateClass *klass);
+static void gnc_search_date_init (GNCSearchDate *gspaper);
+static void gnc_search_date_finalize (GObject *obj);
typedef struct _GNCSearchDatePrivate GNCSearchDatePrivate;
commit 75ccd57dbf8d26eb0d393a81f48b2337324fb7f3
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Sep 4 11:08:25 2018 -0700
Bug 796734 - Auto-complete entry not highlighting to allow...
for incremental entry.
Because the Quartz Input Method module (imquartz.c) messes with the
selected text, so we cache it in the gnucash_sheet object and restore it
after the input module is done with the keypress.
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index d3f68ac..7e22642 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -1040,6 +1040,9 @@ gnucash_sheet_insert_cb (GtkWidget *widget,
if (start_sel != end_sel)
gtk_editable_select_region(editable, start_sel, end_sel);
+ /* Save the selected region in case the input module eats it. */
+ sheet->start_sel = start_sel;
+ sheet->end_sel = end_sel;
g_string_free (new_text_gs, TRUE);
g_string_free (change_text_gs, TRUE);
@@ -1810,10 +1813,17 @@ gnucash_sheet_key_press_event_internal (GtkWidget *widget, GdkEventKey *event)
if (pass_on)
{
gboolean result = FALSE;
- // If sheet is readonly, entry is not realized
- if (gtk_widget_get_realized (GTK_WIDGET(sheet->entry)))
- result = gtk_widget_event (sheet->entry, (GdkEvent *) event);
+ GtkEditable *editable = GTK_EDITABLE(sheet->entry);
+ // If sheet is readonly, entry is not realized
+ if (gtk_widget_get_realized (GTK_WIDGET(editable)))
+ result = gtk_widget_event (GTK_WIDGET(editable), (GdkEvent*)event);
+ /* Restore the stored selection in case it was eaten by the input
+ * module.
+ */
+ if (sheet->start_sel != sheet->end_sel)
+ gtk_editable_select_region(editable, sheet->start_sel,
+ sheet->end_sel);
return result;
}
@@ -1834,13 +1844,15 @@ static gint
gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
{
GnucashSheet *sheet;
+ GtkEditable *editable = NULL;
+ int start_sel = 0, end_sel = 0;
g_return_val_if_fail(widget != NULL, TRUE);
g_return_val_if_fail(GNUCASH_IS_SHEET(widget), TRUE);
g_return_val_if_fail(event != NULL, TRUE);
sheet = GNUCASH_SHEET (widget);
-
+ editable = GTK_EDITABLE(sheet->entry);
/* bug#60582 comment#27 2
save shift state to enable <shift minus> and <shift equal>
bug#618434
@@ -1861,6 +1873,9 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
sheet->shift_state = event->state & GDK_SHIFT_MASK;
sheet->keyval_state = (event->keyval == GDK_KEY_KP_Decimal) ? GDK_KEY_KP_Decimal : 0;
}
+
+ gtk_editable_get_selection_bounds (editable, &start_sel, &end_sel);
+
if (gtk_im_context_filter_keypress (sheet->im_context, event))
{
sheet->need_im_reset = TRUE;
@@ -2590,6 +2605,7 @@ gnucash_sheet_init (GnucashSheet *sheet)
sheet->delete_surrounding_signal = 0;
sheet->shift_state = 0;
sheet->keyval_state = 0;
+ sheet->start_sel = sheet->end_sel = 0;
}
diff --git a/gnucash/register/register-gnome/gnucash-sheetP.h b/gnucash/register/register-gnome/gnucash-sheetP.h
index bd2ec3c..8881068 100644
--- a/gnucash/register/register-gnome/gnucash-sheetP.h
+++ b/gnucash/register/register-gnome/gnucash-sheetP.h
@@ -112,6 +112,7 @@ struct _GnucashSheet
guint shift_state;
guint keyval_state;
+ int start_sel, end_sel;
};
commit f6d873dc2722a339f284bb84ffa2159b9087e781
Author: Geert Janssens <geert at kobaltwit.be>
Date: Tue Sep 4 11:28:16 2018 +0200
Bug 796833 - Excel csv Format misprocessed
Convert all line ending styles to the one expected by the C++ standard
library before starting to parse a csv file.
diff --git a/gnucash/import-export/csv-imp/gnc-tokenizer.cpp b/gnucash/import-export/csv-imp/gnc-tokenizer.cpp
index 0a15fa0..2f54db6 100644
--- a/gnucash/import-export/csv-imp/gnc-tokenizer.cpp
+++ b/gnucash/import-export/csv-imp/gnc-tokenizer.cpp
@@ -12,6 +12,7 @@
#include <memory>
#include <boost/locale.hpp>
+#include <boost/algorithm/string.hpp>
extern "C" {
#include <go-glib-extras.h>
@@ -79,6 +80,11 @@ GncTokenizer::encoding(const std::string& encoding)
{
m_enc_str = encoding;
m_utf8_contents = boost::locale::conv::to_utf<char>(m_raw_contents, m_enc_str);
+
+ // While we are converting here, let's also normalize line-endings to "\n"
+ // That's what STL expects by default
+ boost::replace_all (m_utf8_contents, "\r\n", "\n");
+ boost::replace_all (m_utf8_contents, "\r", "\n");
}
const std::string&
commit e47b460acb8bec2c540f1bfff74c25e0a9560ee9
Author: Geert Janssens <geert at kobaltwit.be>
Date: Mon Sep 3 19:39:16 2018 +0200
Set toolbar buttons to show both icon and text
And make the icon small to recover some vertical screen estate.
The motivation for this is that Gtk has dropped the ability for users
to change a toolbar's appearance. And as our icons are often less
than descriptive many users benefit from having textual descriptions
as well. This is the best compromise we can make until the gui
gets an in-depth redesign.
diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index 605d7dd..617da3e 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -308,6 +308,10 @@ gnc_embedded_window_add_widget (GtkUIManager *merge,
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
+ gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
+ GTK_TOOLBAR_BOTH);
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
+ GTK_ICON_SIZE_SMALL_TOOLBAR);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 03a498a..51fba55 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -3838,6 +3838,10 @@ gnc_main_window_add_widget (GtkUIManager *merge,
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
+ gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
+ GTK_TOOLBAR_BOTH);
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
+ GTK_ICON_SIZE_SMALL_TOOLBAR);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 4446eb1..0553852 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1681,6 +1681,13 @@ recnWindow_add_widget (GtkUIManager *merge,
GtkWidget *widget,
GtkBox *dock)
{
+ if (GTK_IS_TOOLBAR (widget))
+ {
+ gtk_toolbar_set_style (GTK_TOOLBAR(widget),
+ GTK_TOOLBAR_BOTH);
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR(widget),
+ GTK_ICON_SIZE_SMALL_TOOLBAR);
+ }
gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
}
commit 705e86647234dc1416bdfb1c581a02b233ee6f60
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sat Sep 1 16:22:42 2018 +0200
Bug 796054 follow up
Now that a separate wiki section has been written for the side effects of this bug
make the memo field of affected splits point to this wiki section.
diff --git a/libgnucash/engine/ScrubBusiness.c b/libgnucash/engine/ScrubBusiness.c
index 44e0eb4..cf45c41 100644
--- a/libgnucash/engine/ScrubBusiness.c
+++ b/libgnucash/engine/ScrubBusiness.c
@@ -561,7 +561,7 @@ gncScrubBusinessSplit (Split *split)
*/
else if (invoice && (txn != posted_txn))
{
- const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting");
+ const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#I_can.27t_delete_a_transaction_of_type_.22I.22_from_the_AR.2FAP_account");
gchar *txn_date = qof_print_date (xaccTransGetDateEntered (txn));
xaccTransClearReadOnly (txn);
xaccTransSetTxnType (txn, TXN_TYPE_NONE);
commit d07f759ca35ef8095c19c5dc8ae4354ce5367ce5
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sat Sep 1 12:00:38 2018 +0200
Use alignment-safe buffer handling
Casting a char* to a struct containing a uint32_t is not universally safe
due to alignment constraints on reads on some platforms. Copy our possibly
unaligned source data into an aligned area of memory to avoid SIGBUS on
armhf.
Reported by vorlonofportland in PR#403. This commit the John's optimized
version of Vorlon's proposed fix.
diff --git a/libgnucash/engine/gnc-timezone.cpp b/libgnucash/engine/gnc-timezone.cpp
index 876df2a..01325b4 100644
--- a/libgnucash/engine/gnc-timezone.cpp
+++ b/libgnucash/engine/gnc-timezone.cpp
@@ -471,7 +471,9 @@ namespace IANAParser
for(uint32_t index = 0; index < type_count; ++index)
{
fb_index = start_index + index * tzinfo_size;
- TTInfo info = *reinterpret_cast<TTInfo*>(&fileblock[fb_index]);
+ /* Use memcpy instead of static_cast to avoid memory alignment issues with chars */
+ TTInfo info{};
+ memcpy(&info, &fileblock[fb_index], ttinfo_size);
endian_swap(&info.gmtoff);
tzinfo.push_back(
{info, &fileblock[abbrev + info.abbrind],
commit 4c87dd05ec8f1da40292f3e2f0004418a573ab89
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sat Sep 1 11:43:04 2018 +0200
Fix compiler warning issues
- add -Wno-deprecated-declarations to CXX_FLAGS as well. This was
reported by vorlonofportland in PR#401 to become necessary for glib 2.58
as that has deprecated g_type_class_add_private which appears in our
c++ code.
- change -Wno-deprecated-register into -Wregister. The former appeared to
be a clang dialect and alias for the latter (see
https://github.com/Barro/compiler-warnings for an overview of clang
and gcc warnings). It was moved to global CXX_FLAGS as it can only be
added for g++.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b2fcffb..b2ecf7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -572,8 +572,9 @@ set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}") # FIXME: should be -std=
if (UNIX)
set( CMAKE_C_FLAGS "-Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-unused ${CMAKE_C_FLAGS}")
- set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
set( CMAKE_C_FLAGS "-Wno-deprecated-declarations -std=gnu11 -Wno-error=parentheses ${CMAKE_C_FLAGS}")
+ set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
+ set( CMAKE_CXX_FLAGS "-Wno-deprecated-declarations -Wno-register ${CMAKE_CXX_FLAGS}")
set( CMAKE_C_FLAGS_RELEASE "-O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS}")
endif (UNIX)
if (MINGW)
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index dd9c8fb..526f20f 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -235,7 +235,6 @@ add_dependencies (gncmod-engine swig-runtime-h iso-4217-c)
target_link_libraries(gncmod-engine gnc-core-utils gnc-module ${Boost_DATE_TIME_LIBRARIES} ${Boost_REGEX_LIBRARIES} ${REGEX_LDFLAGS} ${GMODULE_LDFLAGS} ${GLIB2_LDFLAGS} ${GOBJECT_LDFLAGS} ${GUILE_LDFLAGS})
target_compile_definitions (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
-target_compile_options (gncmod-engine PRIVATE -Wno-deprecated-register)
target_include_directories (gncmod-engine
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
commit bf00330eedba3543e66417224788dcfc1406b96d
Merge: 131df82 995e6b0
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Aug 31 23:55:01 2018 +0200
Merge branch 'Bug796725' of https://github.com/Bob-IT/gnucash into maint
commit 131df82135e67fa5b5b941b9a5f60b6545071b6d
Merge: caaf9ed 2dcb316
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Aug 31 22:01:45 2018 +0200
Merge branch 'date-bugs' of https://github.com/Bob-IT/gnucash into maint
commit caaf9edc45ad573b0692bb1a2cde3a38901a5abf
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Aug 31 20:57:12 2018 +0200
Use one single function to determine if an invoice is posted to ensure consistent behaviour
While debugging for bug 796054 I found cases where an invoice was unposted, but the toolbar
buttons and menu items were configured for a posted invoice. This should now be solved.
diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index 8c2ece9..c8aa241 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -1747,7 +1747,6 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
GtkTextBuffer* text_buffer;
const char *string;
gchar * tmp_string;
- Account *acct;
time64 time;
gtk_entry_set_text (GTK_ENTRY (iw->id_entry), gncInvoiceGetID (invoice));
@@ -1800,16 +1799,13 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
/*
* Next, figure out if we've been posted, and if so set the appropriate
- * bits of information.. Then work on hiding or showing as
- * necessary. This duplicates the logic in gncInvoiceIsPosted, but we
- * need the accout pointer.
+ * bits of information... Then work on hiding or showing as
+ * necessary.
*/
-
- acct = gncInvoiceGetPostedAcc (invoice);
- if (acct)
+ is_posted = gncInvoiceIsPosted (invoice);
+ if (is_posted)
{
- /* Ok, it's definitely posted. Setup the 'posted-invoice' fields now */
- is_posted = TRUE;
+ Account *acct = gncInvoiceGetPostedAcc (invoice);
/* Can we unpost this invoice?
* XXX: right now we always can, but there
@@ -1851,7 +1847,7 @@ gnc_invoice_update_window (InvoiceWindow *iw, GtkWidget *widget)
{
GtkWidget *hide, *show;
- if (is_posted == TRUE)
+ if (is_posted)
{
hide = GTK_WIDGET (gtk_builder_get_object (iw->builder, "hide3"));
gtk_widget_hide (hide);
commit baf933acf2c088e149bc00c90865f5e8ae08dd3d
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Aug 31 20:24:39 2018 +0200
Bug 796054 - unposting and reposting invoice doubles amounts
Add scrub function to unblock the double post transaction
diff --git a/libgnucash/engine/ScrubBusiness.c b/libgnucash/engine/ScrubBusiness.c
index a2f421e..44e0eb4 100644
--- a/libgnucash/engine/ScrubBusiness.c
+++ b/libgnucash/engine/ScrubBusiness.c
@@ -518,7 +518,6 @@ gncScrubBusinessLot (GNCLot *lot)
gboolean
gncScrubBusinessSplit (Split *split)
{
- const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting");
Transaction *txn;
gboolean deleted_split = FALSE;
@@ -532,6 +531,8 @@ gncScrubBusinessSplit (Split *split)
const gchar *read_only = xaccTransGetReadOnly (txn);
gboolean is_void = xaccTransGetVoidStatus (txn);
GNCLot *lot = xaccSplitGetLot (split);
+ GncInvoice *invoice = gncInvoiceGetInvoiceFromTxn (txn);
+ Transaction *posted_txn = gncInvoiceGetPostedTxn (invoice);
/* Look for transactions as a result of double posting an invoice or bill
* Refer to https://bugs.gnucash.org/show_bug.cgi?id=754209
@@ -544,6 +545,7 @@ gncScrubBusinessSplit (Split *split)
*/
if ((txntype == TXN_TYPE_NONE) && read_only && !is_void && lot)
{
+ const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting");
gchar *txn_date = qof_print_date (xaccTransGetDateEntered (txn));
xaccTransClearReadOnly (txn);
xaccSplitSetMemo (split, memo);
@@ -554,6 +556,28 @@ gncScrubBusinessSplit (Split *split)
txn_date);
g_free (txn_date);
}
+ /* Next check for transactions which claim to be the posted transaction of
+ * an invoice but the invoice disagrees. In that case
+ */
+ else if (invoice && (txn != posted_txn))
+ {
+ const gchar *memo = _("Please delete this transaction. Explanation at https://wiki.gnucash.org/wiki/Business_Features_Issues#Double_posting");
+ gchar *txn_date = qof_print_date (xaccTransGetDateEntered (txn));
+ xaccTransClearReadOnly (txn);
+ xaccTransSetTxnType (txn, TXN_TYPE_NONE);
+ xaccSplitSetMemo (split, memo);
+ if (lot)
+ {
+ gnc_lot_remove_split (lot, split);
+ gncInvoiceDetachFromLot (lot);
+ gncOwnerAttachToLot (gncInvoiceGetOwner(invoice), lot);
+ }
+ PWARN("Cleared double post status of transaction \"%s\", dated %s. "
+ "Please delete transaction and verify balance.",
+ xaccTransGetDescription (txn),
+ txn_date);
+ g_free (txn_date);
+ }
/* Next delete any empty splits that aren't part of an invoice transaction
* Such splits may be the result of scrubbing the business lots, which can
* merge splits together while reducing superfluous lot links
commit 1239876b5b9fd61e0dc2f50acac0a4c5bf21a513
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Aug 31 19:04:40 2018 +0200
Use GnuCash instead of Gnucash in OSX environment file
This is the result of a discussion on
Bug 796837 - GnuCash 3 has changed the capitalisation of the folder in Application Support on macOS
diff --git a/gnucash/CMakeLists.txt b/gnucash/CMakeLists.txt
index 2ae906a..736f8fc 100644
--- a/gnucash/CMakeLists.txt
+++ b/gnucash/CMakeLists.txt
@@ -183,7 +183,7 @@ if (WITH_PYTHON)
endif()
if (MAC_INTEGRATION)
- file(APPEND ${ENV_FILE_OUT} "XDG_CONFIG_HOME={HOME}/Library/Application Support/Gnucash/config\n")
+ file(APPEND ${ENV_FILE_OUT} "XDG_CONFIG_HOME={HOME}/Library/Application Support/${PACKAGE_NAME}/config\n")
file(APPEND ${ENV_FILE_OUT} "GDK_PIXBUF_MODULE_FILE={SYS_LIB}/gdk-pixbuf-2.0/2.10.0/loaders.cache\n")
file(APPEND ${ENV_FILE_OUT} "FONTCONFIG_FILE={GNC_HOME}/etc/fonts/fonts.conf\n")
file(APPEND ${ENV_FILE_OUT} "OFX_DTD_PATH={GNC_HOME}/share/libofx/dtd\n")
commit 5ffb7fa20bb241b96a13768837713be581aa50fe
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Aug 31 14:35:11 2018 +0200
Fix input of invoice post and due dates
In the conversion from a timespec pointer to a time64 in
https://github.com/Gnucash/gnucash/commit/6f89bd62b3cf
we lost the write-back of these two dates to the calling function.
Fixed by making the time64 members pointers again as the timespecs were before.
diff --git a/gnucash/gnome/dialog-date-close.c b/gnucash/gnome/dialog-date-close.c
index 977a637..4f4082c 100644
--- a/gnucash/gnome/dialog-date-close.c
+++ b/gnucash/gnome/dialog-date-close.c
@@ -45,7 +45,7 @@ typedef struct _dialog_date_close_window
GtkWidget *memo_entry;
GtkWidget *question_check;
GncBillTerm *terms;
- time64 t, t2;
+ time64 *t, *t2;
GList * acct_types;
GList * acct_commodities;
QofBook *book;
@@ -87,14 +87,14 @@ gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data)
}
if (ddc->post_date)
- ddc->t2 = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->post_date));
+ *ddc->t2 = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->post_date));
if (ddc->date)
{
if (ddc->terms)
- ddc->t = gncBillTermComputeDueDate (ddc->terms, ddc->t2);
+ *ddc->t = gncBillTermComputeDueDate (ddc->terms, *ddc->t2);
else
- ddc->t = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->date));
+ *ddc->t = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->date));
}
if (ddc->memo_entry && ddc->memo)
@@ -134,7 +134,7 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
return FALSE;
ddc = g_new0 (DialogDateClose, 1);
- ddc->t = *t;
+ ddc->t = t;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "dialog-date-close.glade", "date_close_dialog");
@@ -220,8 +220,8 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
return FALSE;
ddc = g_new0 (DialogDateClose, 1);
- ddc->t = *ddue;
- ddc->t2 = *post;
+ ddc->t = ddue;
+ ddc->t2 = post;
ddc->book = book;
ddc->acct_types = acct_types;
ddc->acct_commodities = acct_commodities;
@@ -343,7 +343,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
return FALSE;
ddc = g_new0 (DialogDateClose, 1);
- ddc->t = *date;
+ ddc->t = date;
ddc->book = book;
ddc->acct_types = acct_types;
ddc->acct = *acct;
commit fc368b91d2b25c7d21df3fe7cb71afdde7ed5e47
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 30 17:03:41 2018 -0700
Restore the timespec_val column name in the slots table.
Renaming it would require a backwards-incompatible schema change,
something that shouldn't happen in the middle of a stable series.
diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp
index cf1fc7b..4d19734 100644
--- a/libgnucash/backend/sql/gnc-slots-sql.cpp
+++ b/libgnucash/backend/sql/gnc-slots-sql.cpp
@@ -140,7 +140,7 @@ static const EntryVec col_table
gnc_sql_make_table_entry<CT_DOUBLE>("double_val", 0, 0,
(QofAccessFunc)get_double_val,
set_double_val),
- gnc_sql_make_table_entry<CT_TIME>("time_val", 0, 0,
+ gnc_sql_make_table_entry<CT_TIME>("timespec_val", 0, 0,
(QofAccessFunc)get_time_val,
(QofSetterFunc)set_time_val),
gnc_sql_make_table_entry<CT_GUID>("guid_val", 0, 0,
commit 6dfbf3d5e7bed8e09c650b994e62ff74715bdfc9
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 30 11:02:16 2018 -0700
gnc:get-commodity-totalavg-prices shouldn't use 0-amount splits.
get-commodity-totalavg-prices seeks to create a share-weighted average of
all prices for a commodity and 0-share splits (normally used to book
trading gains) don't represent a price and so distort (sometimes
dramatically) the resulting average as well as creating extra invalid
entries in the resulting alist.
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 93ceac8..b21e906 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -116,7 +116,8 @@
;; Returns true if the given pricealist element is a non-zero price.
(define (gnc:price-is-not-zero? elem)
- (not (gnc-numeric-zero-p (second elem))))
+ (and (second elem)
+ (not (gnc-numeric-zero-p (second elem)))))
;; Create a list of all prices of 'price-commodity' measured in the currency
;; 'report-currency'. The prices are taken from all splits in
@@ -155,12 +156,16 @@
(transaction-date (xaccTransGetDate
(xaccSplitGetParent a)))
(foreignlist
- (if (gnc-commodity-equiv transaction-comm
- price-commodity)
- (list account-comm
- share-amount value-amount)
- (list transaction-comm
- value-amount share-amount))))
+ (if (and
+ (not (zero? share-amount))
+ (not (zero? value-amount)))
+ (if (gnc-commodity-equiv transaction-comm
+ price-commodity)
+ (list account-comm
+ share-amount value-amount)
+ (list transaction-comm
+ value-amount share-amount))
+ #f)))
;;(warn "gnc:get-commodity-totalavg-prices: value "
;; (gnc-commodity-numeric->string
@@ -170,8 +175,9 @@
;;price-commodity (third foreignlist)))
;; Try EURO exchange if necessary
- (if (not (gnc-commodity-equiv (first foreignlist)
- report-currency))
+ (if (and foreignlist
+ (not (gnc-commodity-equiv (first foreignlist)
+ report-currency)))
(let ((exchanged (gnc:exchange-by-euro-numeric
(first foreignlist) (second foreignlist)
report-currency transaction-date)))
@@ -183,35 +189,37 @@
(list
transaction-date
- (if (not (gnc-commodity-equiv (first foreignlist)
- report-currency))
- (begin
- (warn "gnc:get-commodity-totalavg-prices: "
- "Sorry, currency exchange not yet implemented:"
- (gnc-commodity-numeric->string
- (first foreignlist) (second foreignlist))
- " (buying "
- (gnc-commodity-numeric->string
- price-commodity (third foreignlist))
- ") =? "
- (gnc-commodity-numeric->string
- report-currency (gnc-numeric-zero)))
- (gnc-numeric-zero))
- (begin
- (set! total-foreign (gnc-numeric-add total-foreign
- (third foreignlist)
- GNC-DENOM-AUTO
- GNC-DENOM-LCD))
- (set! total-domestic (gnc-numeric-add total-domestic
- (second foreignlist)
- GNC-DENOM-AUTO
- GNC-DENOM-LCD))
- (if (not (zero? total-foreign))
- (gnc-numeric-div
- total-domestic
- total-foreign
- GNC-DENOM-AUTO
- (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)) 0))))))
+ (if foreignlist
+ (if (not (gnc-commodity-equiv (first foreignlist)
+ report-currency))
+ (begin
+ (warn "gnc:get-commodity-totalavg-prices: "
+ "Sorry, currency exchange not yet implemented:"
+ (gnc-commodity-numeric->string
+ (first foreignlist) (second foreignlist))
+ " (buying "
+ (gnc-commodity-numeric->string
+ price-commodity (third foreignlist))
+ ") =? "
+ (gnc-commodity-numeric->string
+ report-currency (gnc-numeric-zero)))
+ (gnc-numeric-zero))
+ (begin
+ (set! total-foreign (gnc-numeric-add total-foreign
+ (third foreignlist)
+ GNC-DENOM-AUTO
+ GNC-DENOM-LCD))
+ (set! total-domestic (gnc-numeric-add total-domestic
+ (second foreignlist)
+ GNC-DENOM-AUTO
+ GNC-DENOM-LCD))
+ (if (not (zero? total-foreign))
+ (gnc-numeric-div
+ total-domestic
+ total-foreign
+ GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)) 0)))
+ #f))))
;; Get all the interesting splits, and sort them according to the
;; date.
(gnc:get-match-commodity-splits-sorted
@@ -985,6 +993,9 @@
(lambda (foreign domestic date)
(gnc:exchange-by-pricealist-nearest
pricealist foreign domestic date))))
+ ;; actual-transactions isn't used, at least not as a value passed to this
+ ;; function. price-scatter.scm does use it but calls
+ ;; gnc:get-commodity-inst-prices directly.
((actual-transactions) (let ((pricealist
(gnc:get-commoditylist-inst-prices
commodity-list report-currency to-date-tp)))
diff --git a/gnucash/report/report-system/test/test-commodity-utils.scm b/gnucash/report/report-system/test/test-commodity-utils.scm
index 1a03a21..728da7e 100644
--- a/gnucash/report/report-system/test/test-commodity-utils.scm
+++ b/gnucash/report/report-system/test/test-commodity-utils.scm
@@ -537,16 +537,16 @@
;; the comment at the gnc:get-commodity-totalavg-prices definition for more
;; about the prices from this function.
(test-equal "MSFT totalavg 2014-12-05"
- (gnc-numeric-div 5232000/100 1500 GNC-DENOM-AUTO
+ (gnc-numeric-div 6637500/100 2000 GNC-DENOM-AUTO
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
(cadr (assoc (gnc-dmy2time64-neutral 5 12 2014)
report-list)))
(test-equal "MSFT totalavg 2015-04-02"
- (gnc-numeric-div 10876200/100 2800 GNC-DENOM-AUTO
+ (gnc-numeric-div 9860700/100 2800 GNC-DENOM-AUTO
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
(cadr (assoc (gnc-dmy2time64-neutral 2 4 2015) report-list)))
(test-equal "MSFT totalavg 2016-03-11"
- (gnc-numeric-div 12634400/100 2800 GNC-DENOM-AUTO
+ (gnc-numeric-div 14637000/100 3700 GNC-DENOM-AUTO
(logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
(cadr (assoc (gnc-dmy2time64-neutral 11 3 2016)
report-list))))
commit c977c2350a83035fadff61053507104aa9309f26
Merge: 28691b4 a639dd9
Author: Geert Janssens <geert at kobaltwit.be>
Date: Thu Aug 30 12:18:15 2018 +0200
Merge branch 'sort-filter' of https://github.com/Bob-IT/gnucash into maint
commit 28691b46ba5fc198eaddf133d48c5696421915b9
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Aug 18 12:36:22 2018 -0700
Create srfi-64 tests for gnucash/report/report-system/commodity-utils.scm.
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 63002ea..93ceac8 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -118,11 +118,24 @@
(define (gnc:price-is-not-zero? elem)
(not (gnc-numeric-zero-p (second elem))))
-;; Create a list of all prices of 'price-commodity' measured in the
-;; currency 'report-currency'. The prices are taken from all splits in
-;; 'currency-accounts' up until the date 'end-date'. Returns a list
-;; of lists. Each listelement looks like the list (time price), where
-;; 'time' is the time64 when the <gnc:numeric*> 'price' was valid.
+;; Create a list of all prices of 'price-commodity' measured in the currency
+;; 'report-currency'. The prices are taken from all splits in
+;; 'currency-accounts' up until the date 'end-date'. Returns a list of
+;; lists. Each listelement looks like the list (time price), where 'time' is the
+;; time64 when the <gnc:numeric*> 'price' was valid. The results are distorted
+;; by the existence of capital gains splits because the amount of the gain is
+;; added to the total value with no adjustment to the total amount. For example
+;; if on day1 one buys 200 shares of XYZ at 20 and on day2 sells 100 at 25
+;; booking a capital gain of 500, the resulting foreignlist will be:
+;; ((day1 4000 200)
+;; (day2 500 0)
+;; (day2 2500 100))
+;; returning the following price list:
+;; ((day1 20)
+;; (day2 22.50)
+;; (day2 23.33))
+;; The intended second price is 6500/300, or 21.67.
+
(define (gnc:get-commodity-totalavg-prices
currency-accounts end-date price-commodity report-currency)
(let ((total-foreign (gnc-numeric-zero))
diff --git a/gnucash/report/report-system/test/CMakeLists.txt b/gnucash/report/report-system/test/CMakeLists.txt
index 7ecd67a..6d78a26 100644
--- a/gnucash/report/report-system/test/CMakeLists.txt
+++ b/gnucash/report/report-system/test/CMakeLists.txt
@@ -17,6 +17,7 @@ set(scm_test_report_system_SOURCES
)
set (scm_test_report_system_with_srfi64_SOURCES
+ test-commodity-utils.scm
test-html-utilities-srfi64.scm
test-report-system.scm
)
diff --git a/gnucash/report/report-system/test/test-commodity-utils.scm b/gnucash/report/report-system/test/test-commodity-utils.scm
new file mode 100644
index 0000000..1a03a21
--- /dev/null
+++ b/gnucash/report/report-system/test/test-commodity-utils.scm
@@ -0,0 +1,590 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; test-commodity-utilities.scm: Test the commodity functions
+;; Copyright 2018 John Ralls <jralls at ceridwen.us>
+;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2 of
+;; the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, contact:
+;;
+;; Free Software Foundation Voice: +1-617-542-5942
+;; 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
+;; Boston, MA 02110-1301, USA gnu at gnu.org
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+(use-modules (srfi srfi-64))
+(use-modules (ice-9 pretty-print))
+(use-modules (gnucash engine test srfi64-extras))
+(use-modules (gnucash engine test test-extras))
+(use-modules (gnucash app-utils))
+(use-modules (gnucash engine))
+(use-modules (sw_engine))
+(use-modules (sw_app_utils))
+(use-modules (gnucash report report-system))
+
+(setlocale LC_ALL "C")
+
+(define (run-test)
+ (test-runner-factory gnc:test-runner)
+ (test-begin "commodity-utils")
+ ;; Tests go here
+ (test-setup)
+ (test-resolve-unknown-comm)
+ (test-get-exchange-totals)
+ (test-get-exchange-cost-totals)
+ (test-get-exchange-cost-totals-trading)
+ (test-exchange-by-pricedb-latest)
+ (test-exchange-by-pricedb-nearest)
+ (test-get-commodity-totalavg-prices)
+ (test-get-commodity-inst-prices)
+ (test-end "commodity-utils"))
+
+(define test-accounts
+ (list "Root" (list (cons 'type ACCT-TYPE-ROOT))
+ (list "Assets"(list (cons 'type ACCT-TYPE-ASSET))
+ (list "Current"
+ (list "Savings" (list (cons 'type ACCT-TYPE-BANK)))
+ (list "Checking" (list (cons 'type ACCT-TYPE-BANK))))
+ (list "Investment"
+ (list "Broker A"
+ (list "Cash-A" (list (cons 'type ACCT-TYPE-BANK)))
+ (list "Stocks" (list (cons 'type ACCT-TYPE-STOCK))
+ (list "AAPL-A")
+ (list "IBM-A")
+ (list "MSFT-A")
+ (list "TSLA-A")))
+ (list "Broker B"
+ (list "Cash-B" (list (cons 'type ACCT-TYPE-BANK)))
+ (list "Stocks" (list (cons 'type ACCT-TYPE-STOCK))
+ (list "AAPL-B")
+ (list "IBM-B")
+ (list "MSFT-B")
+ (list "TSLA-B")))
+ (list "Broker-GBP"
+ (list "Cash-GBP" (list (cons 'type ACCT-TYPE-BANK)))
+ (list "Stocks" (list (cons 'type ACCT-TYPE-STOCK))
+ (list "RDSA")))))
+ (list "Income" (list (cons 'type ACCT-TYPE-INCOME))
+ (list "Capital Gains"))
+ (list "Expenses" (list (cons 'type ACCT-TYPE-EXPENSE)))
+ (list "Liability" (list (cons 'type ACCT-TYPE-LIABILITY)))
+ (list "Equity" (list (cons 'type ACCT-TYPE-EQUITY))
+ (list "Opening Balances"))))
+
+(define (setup trading)
+ (let* ((env (create-test-env))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (AAPL (gnc-commodity-new book "Apple" "NASDAQ" "AAPL" "" 1))
+ (IBM (gnc-commodity-new book "International Business Machines"
+ "NYSE" "IBM" "" 1))
+ (MSFT (gnc-commodity-new book "Microsoft" "NASDAQ" "MSFT" "" 1))
+ (TSLA (gnc-commodity-new book "Tesla Motors" "NASDAQ" "TSLA" "" 1))
+ (RDSA (gnc-commodity-new book "Royal Dutch Shell A" "LSE" "RDSA" "" 1))
+ ;; Yeah, this is fake, it's for testing DEM->EUR conversions.
+ (DMLR (gnc-commodity-new book "Daimler Motors" "FSE" "DMLR" "" 1))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (account-alist (env-create-account-structure-alist env test-accounts))
+ (checking (cdr (assoc "Checking" account-alist)))
+ (saving (cdr (assoc "Savings" account-alist)))
+ (cash-a (cdr (assoc "Cash-A" account-alist)))
+ (aapl-a (cdr (assoc "AAPL-A" account-alist)))
+ (ibm-a (cdr (assoc "IBM-A" account-alist)))
+ (msft-a (cdr (assoc "MSFT-A" account-alist)))
+ (tsla-a (cdr (assoc "TSLA-A" account-alist)))
+ (cash-b (cdr (assoc "Cash-B" account-alist)))
+ (aapl-b (cdr (assoc "AAPL-B" account-alist)))
+ (ibm-b (cdr (assoc "IBM-B" account-alist)))
+ (msft-b (cdr (assoc "MSFT-B" account-alist)))
+ (tsla-b (cdr (assoc "TSLA-B" account-alist)))
+ (capgain (cdr (assoc "Capital Gains" account-alist)))
+ (openbal (cdr (assoc "Opening Balances" account-alist))))
+ ;; Set account commodities
+ (gnc-commodity-table-insert comm-table AAPL)
+ (gnc-commodity-table-insert comm-table MSFT)
+ (gnc-commodity-table-insert comm-table IBM)
+ (gnc-commodity-table-insert comm-table RDSA)
+ (gnc-commodity-table-insert comm-table TSLA)
+ (xaccAccountSetCommodity aapl-a AAPL)
+ (xaccAccountSetCommodity ibm-a IBM)
+ (xaccAccountSetCommodity msft-a MSFT)
+ (xaccAccountSetCommodity tsla-a TSLA)
+ (xaccAccountSetCommodity aapl-b AAPL)
+ (xaccAccountSetCommodity ibm-b IBM)
+ (xaccAccountSetCommodity msft-b MSFT)
+ (xaccAccountSetCommodity tsla-b TSLA)
+ ;; Create transactions in the accounts
+ (env-transfer env 15 11 2011 openbal saving 1553746/100
+ #:description "Fund Savings")
+ (env-transfer env 15 11 2011 openbal checking 329726/100
+ #:description "Fund Checking")
+ (env-transfer env 15 11 2011 openbal cash-a 11543627/100
+ #:description "Fund Broker A")
+ (env-transfer-foreign env 15 01 2012 cash-a ibm-a 3583200/100 200
+ #:description "Buy IBM 200") ;;200 @ $179.16
+ (env-transfer-foreign env 15 01 2012 cash-a msft-a 4216500/100 1500
+ #:description "Buy MSFT 1500") ;;1500 @ $28.11
+ (env-transfer-foreign env 9 8 2013 cash-a aapl-a 3684000/100 600
+ #:description "Buy AAPL 600") ;;600 @ $61.40
+ (env-transfer-foreign env 5 12 2014 cash-a msft-a -2421000/100 -500
+ #:description "Sell MSFT 500");;-500 @ $48.42
+ (env-transfer-foreign env 5 12 2014 capgain msft-a 1015500/100 0
+ #:description "MSFT 500 G/L")
+ (env-transfer-foreign env 8 8 2014 cash-a ibm-a -3732600/100 -200
+ #:description "Sell IBM 200") ;;-200 @ $186.63
+ (env-transfer-foreign env 8 8 2014 capgain ibm-a 149400/100 0
+ #:description "IBM 200 G/L")
+ (env-transfer env 15 6 2014 cash-a cash-b 4000000/100
+ #:description "Fund Broker B")
+ (env-transfer-foreign env 11 7 2014 cash-b aapl-b 3808800/100 400
+ #:description "Buy AAPL 400") ;;400 @ $95.22
+ (env-transfer-foreign env 2 4 2015 cash-a msft-a 3223200/100 800
+ #:description "Buy MSFT 800") ;;800 @ $40.29
+ (env-transfer-foreign env 23 10 2015 cash-a aapl-a -3572400/100 -300
+ #:description "Sell AAPL 300") ;;-300 @ $119.08
+ (env-transfer-foreign env 23 10 2015 capgain aapl-a 1730400/100 0
+ #:description"AAPL 300 G/L")
+ (env-transfer-foreign env 11 3 2016 cash-a msft-a -4776300/100 -900
+ #:description "Sell MSFT 900") ;;-900 @ $53.07
+ (env-transfer-foreign env 11 3 2016 capgain msft-a 1758200/100 0
+ #:description"MSFT 900 G/L")
+ (gnc-pricedb-create USD MSFT (gnc-dmy2time64 1 1 2013) 2674/100)
+ (gnc-pricedb-create USD IBM (gnc-dmy2time64 1 1 2013) 19399/100)
+ (gnc-pricedb-create USD AAPL (gnc-dmy2time64 1 1 2014) 7728/100)
+ (gnc-pricedb-create USD MSFT (gnc-dmy2time64 1 1 2014) 3691/100)
+ (gnc-pricedb-create USD IBM (gnc-dmy2time64 1 1 2014) 18664/100)
+ (gnc-pricedb-create USD AAPL (gnc-dmy2time64 1 1 2015) 10933/100)
+ (gnc-pricedb-create USD MSFT (gnc-dmy2time64 1 1 2015) 4676/100)
+ (gnc-pricedb-create USD IBM (gnc-dmy2time64 1 1 2015) 16206/100)
+ (gnc-pricedb-create USD AAPL (gnc-dmy2time64 1 1 2016) 10526/100)
+ (gnc-pricedb-create USD MSFT (gnc-dmy2time64 1 1 2016) 5548/100)
+ (gnc-pricedb-create USD IBM (gnc-dmy2time64 1 1 2016) 13163/100)
+ (gnc-pricedb-create USD AAPL (gnc-dmy2time64 1 1 2017) 11582/100)
+ (gnc-pricedb-create USD MSFT (gnc-dmy2time64 1 1 2017) 6214/100)
+ (gnc-pricedb-create USD IBM (gnc-dmy2time64 1 1 2017) 16599/100)
+ account-alist))
+
+
+(define (teardown)
+ (let* ((book (gnc-get-current-book))
+ (pricedb (gnc-pricedb-get-db book)))
+ (gnc-pricedb-destroy pricedb)
+ (gnc-clear-current-session)))
+
+(define (collect collector shares value)
+ ((car collector) 'add shares)
+ ((cdr collector) 'add value))
+
+(define (test-setup)
+ ;; This test ensures that our setup function creates a suitable book
+ (let* ((account-alist (setup #f))
+ (cash-a (cdr (assoc "Cash-A" account-alist)))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (pricedb (gnc-pricedb-get-db book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM")))
+ (test-begin "Test Setup")
+ (test-equal "Broker A Cash account balance 73390.27"
+ 7339027/100 (xaccAccountGetBalance cash-a))
+ (test-assert "Have IBM Prices" (gnc-pricedb-has-prices pricedb IBM USD))
+ (let ((ibm-price (gnc-pricedb-lookup-latest pricedb IBM USD)))
+ (test-equal "IBM Latest Price" 16599/100 (gnc-price-get-value ibm-price))
+ (gnc-price-unref ibm-price))
+ (test-end "Test Setup")
+ (teardown)))
+
+(define (test-resolve-unknown-comm)
+ (test-group-with-cleanup "gnc:resolve-unknown-comm"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR"))
+ (aapl-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (msft-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (ibm-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (rdsa-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (rdsa-gbp-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (dmlr-dem-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (gbp-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (eur-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (gbp-usd-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (gbp-eur-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (gbp-dem-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (dem-gbp-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (eur-gbp-col (cons (gnc:make-value-collector) (gnc:make-value-collector)))
+ (eur-usd-col (cons (gnc:make-value-collector) (gnc:make-value-collector))))
+ (test-begin "basic")
+ ;; Entries in the report currency just fall through and are emitted in the
+ ;; result alist.
+ (collect aapl-col 600 3684000/100)
+ (collect aapl-col -300 -3572400/100)
+ (collect aapl-col 0 1730400/100) ;; cap gain
+ (let* ((sumlist (list (list USD (list (list AAPL aapl-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "AAPL 700 shares" 300 ((caadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "AAPL $18420.00" 1842000/100 ((cdadr (assoc AAPL return-alist)) 'total #f)))
+ (test-end "basic")
+ (test-begin "foreign-no-coll")
+ ;; Now we begin to exercise the function. First up is that it fails to
+ ;; register the security at all if there's no pair of prices that can
+ ;; resolve the transaction commodity to the report currency.
+ (collect rdsa-gbp-col 500 3223400/100)
+ ;; We need a report-currency alist with something in it or
+ ;; resolve-unknown-comm crashes.
+ (let* ((sumlist (list (list USD (list (list AAPL aapl-col)))
+ (list GBP (list (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "RDSA #f" #f ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "RDSA #f" #f ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-no-coll")
+ (test-begin "foreign-no-amount")
+ ;; There's a collector but it doesn't have a price in it so the returned
+ ;; price is 0.
+ (let* ((sumlist (list (list USD (list (list GBP gbp-col)))
+ (list GBP (list (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "RDSA 500 shares" 500 ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "RDSA $0" 0 ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-no-amount")
+ (test-begin "foreign-coll-and-amount")
+ (collect gbp-col 10000/100 15300/100)
+ (let* ((sumlist (list (list USD (list (list GBP gbp-col)))
+ (list GBP (list (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "RDSA 500 shares" 500 ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "RDSA $49,318.02" 4931802/100 ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-coll-and-amount")
+ (test-begin "foreign-inv-coll")
+ ;; Now try with a conversion in the foreign currency instead of the native
+ ;; one.
+ (collect gbp-usd-col 15300/100 10000/100)
+ (let* ((sumlist (list (list USD (list (list AAPL aapl-col)))
+ (list GBP (list (list USD gbp-usd-col)
+ (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "RDSA 500 shares" 500 ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "RDSA $49318.02" 4931802/100 ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-inv-coll")
+ (test-begin "foreign-3way")
+ ;; Three-way conversion, gbp->eur->usd
+ (collect eur-gbp-col 10000/100 121045/1000)
+ (collect eur-col 10000/100 126399/1000)
+ (let* ((sumlist (list (list USD (list (list EUR eur-col)))
+ (list EUR (list (list GBP eur-gbp-col)))
+ (list GBP (list (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "RDSA 500 shares" 500 ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "RDSA $49317.91" 4931791/100 (gnc-numeric-convert ((cdadr (assoc RDSA return-alist)) 'total #f) 100 GNC-HOW-RND-ROUND)))
+ (test-end "foreign-3way")
+ (test-begin "foreign-3way-ambig")
+ ;; Three-way conversion, gbp->eur->usd The equalities are false because
+ ;; there is both a USD price and a GBP price for
+ ;; RDSA. gnc:get-exchange-totals is supposed to resolve this when writing
+ ;; the sumlist, we're testing that gnc:resolve-unknown-comm writes its
+ ;; warning.
+ (collect eur-gbp-col 10000/100 121045/1000)
+ (collect eur-col 10000/100 126399/1000)
+ (collect eur-usd-col 126399/1000 10000/100)
+ (collect rdsa-col 10000/100 1219300/100)
+ (let* ((sumlist (list (list USD (list (list RDSA rdsa-col)
+ (list EUR eur-col)))
+ (list EUR (list (list GBP eur-gbp-col)
+ (list USD eur-usd-col)))
+ (list GBP (list (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-assert "RDSA 600 shares" (not (equal? 600 ((caadr (assoc RDSA return-alist)) 'total #f))))
+ (test-assert "RDSA $61510.91" (not (equal? 6151091/100 (gnc-numeric-convert ((cdadr (assoc RDSA return-alist)) 'total #f) 100 GNC-HOW-RND-ROUND)))))
+ (test-end "foreign-3way-ambig")
+ (test-begin "foreign-DEM>EUR")
+ ;; Old currency->Euro conversion.
+ (collect dmlr-dem-col 500 2668000/100)
+ (let* ((sumlist (list (list EUR (list (list USD eur-usd-col)))
+ (list DEM (list (list DMLR dmlr-dem-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist EUR)))
+ (test-equal "DMLR 500 shares" 500 ((caadr (assoc DMLR return-alist)) 'total #f))
+ (test-equal "DMLR EUR13631.27" 1364127/100 (gnc-numeric-convert ((cdadr (assoc DMLR return-alist)) 'total #f) 100 GNC-HOW-RND-ROUND)))
+ (test-end "foreign-DEM>EUR")
+ (test-begin "foreign-3way-DEM>EUR")
+ ;; Three-way conversion, gbp->dem->eur->usd
+ ;; Too many levels for resolve-unknown-comm to resolve.
+ (collect gbp-dem-col 10000/100 23665543/100000)
+ (let* ((sumlist (list (list USD (list (list EUR eur-col)))
+ (list GBP (list (list DEM gbp-dem-col)
+ (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "Shares fails" #f ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "Value fails" #f ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-3way-GBP>DEM")
+ (test-begin "foreign-3way-DEM>GBP")
+ ;; Three-way conversion, gbp->dem->eur->usd
+ ;; Too many levels for resolve-unknown-comm to resolve.
+ (collect gbp-dem-col 23665543/100000 10000/100)
+ (let* ((sumlist (list (list USD (list (list EUR eur-col)))
+ (list DEM (list (list GBP dem-gbp-col)))
+ (list GBP (list (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist USD)))
+ (test-equal "Shares fails" #f ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "Value fails" #f ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-3way-DEM>GBP")
+ (test-begin "foreign-DEM>EUR")
+ ;; Three-way conversion, gbp->dem->eur
+ ;; Too many levels for resolve-unknown-comm to resolve.
+ (let* ((sumlist (list (list EUR (list (list USD eur-usd-col)))
+ (list GBP (list (list DEM gbp-dem-col)
+ (list RDSA rdsa-gbp-col)))))
+ (return-alist (gnc:resolve-unknown-comm sumlist EUR)))
+ (test-equal "Shares fails" #f ((caadr (assoc RDSA return-alist)) 'total #f))
+ (test-equal "Value fails" #f ((cdadr (assoc RDSA return-alist)) 'total #f)))
+ (test-end "foreign-DEM>EUR"))
+
+ (teardown)))
+
+(define (test-get-exchange-totals)
+ (test-group-with-cleanup "gnc:get-exchange-totals"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "multiple")
+ (let ((return-alist (gnc:get-exchange-totals USD (gnc-dmy2time64-neutral 1 12 2016))))
+ (test-equal "AAPL 1300 shares" 1300 ((caadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "AAPL $110652.00" 11065200/100 ((cdadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "MSFT 3700 shares" 3700 ((caadr (assoc MSFT return-alist)) 'total #f))
+ (test-equal "MSFT $146370.00" 14637000/100 ((cdadr (assoc MSFT return-alist)) 'total #f))
+ (test-equal "IBM 400 shares" 400 ((caadr (assoc IBM return-alist)) 'total #f))
+ (test-equal "IBM $73158" 7315800/100 ((cdadr (assoc IBM return-alist)) 'total #f)))
+ (test-end "multiple"))
+ (teardown)))
+
+(define (test-get-exchange-cost-totals)
+ (test-group-with-cleanup "gnc:get-exchange-cost-totals"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "multiple")
+ (let ((return-alist (gnc:get-exchange-cost-totals USD (gnc-dmy2time64-neutral 1 12 2016))))
+ (test-equal "AAPL 700 shares" 700 ((caadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "AAPL $56512.00" 5650800/100 ((cdadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "MSFT 900 shares" 900 ((caadr (assoc MSFT return-alist)) 'total #f))
+ (test-equal "MSFT $30161.00" 3016100/100 ((cdadr (assoc MSFT return-alist)) 'total #f))
+ (test-equal "IBM 0 shares" 0 ((caadr (assoc IBM return-alist)) 'total #f))
+ (test-equal "IBM $0" 0 ((cdadr (assoc IBM return-alist)) 'total #f)))
+ (test-end "multiple"))
+ (teardown)))
+
+(define (test-get-exchange-cost-totals-trading)
+ (test-group-with-cleanup
+ "gnc:get-exchange-totals-trading"
+ (let* ((account-alist (setup #t))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "multiple")
+ (let ((return-alist (gnc:get-exchange-cost-totals
+ USD (gnc-dmy2time64-neutral 1 12 2016))))
+ (test-equal "AAPL 700 shares"
+ 700 ((caadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "AAPL $56512.00"
+ 5650800/100 ((cdadr (assoc AAPL return-alist)) 'total #f))
+ (test-equal "MSFT 900 shares"
+ 900 ((caadr (assoc MSFT return-alist)) 'total #f))
+ (test-equal "MSFT $30161.00"
+ 3016100/100 ((cdadr (assoc MSFT return-alist)) 'total #f))
+ (test-equal "IBM 0 shares"
+ 0 ((caadr (assoc IBM return-alist)) 'total #f))
+ (test-equal "IBM $0"
+ 0 ((cdadr (assoc IBM return-alist)) 'total #f)))
+ (test-end "multiple"))
+ (teardown)))
+
+(define (test-exchange-by-pricedb-latest)
+ (test-group-with-cleanup
+ "gnc:exchange-by-pricedb-latest"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (pricedb (gnc-pricedb-get-db book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "multiple")
+ (test-equal "AAPL latest" 11582/100 (gnc:gnc-monetary-amount
+ (gnc:exchange-by-pricedb-latest
+ (gnc:make-gnc-monetary AAPL 1) USD)))
+ (test-equal "MSFT latest" 6214/100 (gnc:gnc-monetary-amount
+ (gnc:exchange-by-pricedb-latest
+ (gnc:make-gnc-monetary MSFT 1) USD)))
+ (test-equal "IBM latest" 16599/100 (gnc:gnc-monetary-amount
+ (gnc:exchange-by-pricedb-latest
+ (gnc:make-gnc-monetary IBM 1) USD)))
+ (test-end "multiple"))
+ (teardown)))
+
+(define (test-exchange-by-pricedb-nearest)
+ (test-group-with-cleanup
+ "gnc:exchange-by-pricedb-nearest"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "multiple")
+ (test-equal "AAPL nearest 23 March 2015"
+ 10933/100 (gnc:gnc-monetary-amount
+ (gnc:exchange-by-pricedb-nearest
+ (gnc:make-gnc-monetary AAPL 1) USD
+ (gnc-dmy2time64 23 3 2015))))
+ (test-equal "MSFT nearest 11 September 2016"
+ 6214/100 (gnc:gnc-monetary-amount
+ (gnc:exchange-by-pricedb-nearest
+ (gnc:make-gnc-monetary MSFT 1) USD
+ (gnc-dmy2time64 11 9 2016))))
+ (test-equal "IBM nearest 1 July 2014"
+ 18664/100 (gnc:gnc-monetary-amount
+ (gnc:exchange-by-pricedb-nearest
+ (gnc:make-gnc-monetary IBM 1) USD
+ (gnc-dmy2time64 1 7 2014))))
+ (test-end "multiple"))
+ (teardown)))
+
+(define (test-get-commodity-totalavg-prices)
+ (test-group-with-cleanup
+ "gnc:get-commodity-totalavg-prices"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "Microsoft-USD")
+ (let* ((curraccts (gnc-account-get-descendants-sorted
+ (gnc-get-current-root-account)))
+ (report-list
+ (gnc:get-commodity-totalavg-prices curraccts
+ (gnc-dmy2time64 4 7 2016)
+ MSFT USD)))
+ (test-equal "MSFT totalavg 2012-01-15" (/ 4216500/100 1500)
+ (cadr (assoc (gnc-dmy2time64-neutral 15 01 2012)
+ report-list)))
+;; We have to use gnc-numeric-div with rounding in order to match the results
+;; from the function. Astute observers will notice that the totals include the
+;; capital gain split but not the acutal sell split on the day because the
+;; capital gain price is first in the list so that's the one (assoc) finds. See
+;; the comment at the gnc:get-commodity-totalavg-prices definition for more
+;; about the prices from this function.
+ (test-equal "MSFT totalavg 2014-12-05"
+ (gnc-numeric-div 5232000/100 1500 GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
+ (cadr (assoc (gnc-dmy2time64-neutral 5 12 2014)
+ report-list)))
+ (test-equal "MSFT totalavg 2015-04-02"
+ (gnc-numeric-div 10876200/100 2800 GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
+ (cadr (assoc (gnc-dmy2time64-neutral 2 4 2015) report-list)))
+ (test-equal "MSFT totalavg 2016-03-11"
+ (gnc-numeric-div 12634400/100 2800 GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))
+ (cadr (assoc (gnc-dmy2time64-neutral 11 3 2016)
+ report-list))))
+ (test-end "Microsoft-USD"))
+ (teardown)))
+
+(define (test-get-commodity-inst-prices)
+ (test-group-with-cleanup
+ "gnc:get-commodity-inst-prices"
+ (let* ((account-alist (setup #f))
+ (book (gnc-get-current-book))
+ (comm-table (gnc-commodity-table-get-table book))
+ (USD (gnc-commodity-table-lookup comm-table "CURRENCY" "USD"))
+ (GBP (gnc-commodity-table-lookup comm-table "CURRENCY" "GBP"))
+ (EUR (gnc-commodity-table-lookup comm-table "CURRENCY" "EUR"))
+ (DEM (gnc-commodity-table-lookup comm-table "CURRENCY" "DEM"))
+ (MSFT (gnc-commodity-table-lookup comm-table "NASDAQ" "MSFT"))
+ (IBM (gnc-commodity-table-lookup comm-table "NYSE" "IBM"))
+ (AAPL (gnc-commodity-table-lookup comm-table "NASDAQ" "AAPL"))
+ (RDSA (gnc-commodity-table-lookup comm-table "LSE" "RDSA"))
+ (DMLR (gnc-commodity-table-lookup comm-table "FSE" "DMLR")))
+ (test-begin "Microsoft-USD")
+ (let* ((curraccts (gnc-account-get-descendants-sorted
+ (gnc-get-current-root-account)))
+ (report-list
+ (gnc:get-commodity-inst-prices curraccts
+ (gnc-dmy2time64 4 7 2016)
+ MSFT USD)))
+ (test-equal "MSFT inst 2012-01-15" (/ 4216500/100 1500)
+ (cadr (assoc (gnc-dmy2time64-neutral 15 01 2012)
+ report-list)))
+ (test-equal "MSFT inst 2014-12-05" (/ 2421000/100 500)
+ (cadr (assoc (gnc-dmy2time64-neutral 5 12 2014)
+ report-list)))
+ (test-equal "MSFT inst 2015-04-02" (/ 3223200/100 800)
+ (cadr (assoc (gnc-dmy2time64-neutral 2 4 2015) report-list)))
+ (test-equal "MSFT inst 2016-03-11" (/ 4776300/100 900)
+ (cadr (assoc (gnc-dmy2time64-neutral 11 3 2016)
+ report-list))))
+ (test-end "Microsoft-USD"))
+ (teardown)))
commit b1ee7c6eec8b18647213d955bdd4b229815a438a
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 24 14:25:43 2018 -0700
Clarify and de-duplicate sumlist and report-list descriptions.
Also correct descriptions of gnc:get-exchange-totals and
gnc:get-exchange-cost-totals. Neither calculates prices.
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index f7ce0e6..63002ea 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -388,13 +388,24 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions to get one price at a given time (i.e. not time-variant).
+;; Several of the following functions use two types of alist, a return-list or a
+;; sumlist.
+;;
+;; A return-list is an alist with a GncCommodity pointer as the keys and a pair
+;; of gnc-value-collectors, one for amount and the other for value, as the
+;; value.
+;;
+;; A sumlist is an alist having a GncCommodity pointer as the key and a
+;; return-list as the values. The reason for the outer alist is that there might
+;; be commodity transactions which do not involve the report-commodity, but
+;; which can still be calculated after *all* transactions are processed.
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Go through all toplevel non-'report-commodity' balances in 'sumlist' and add
+;; them to 'report-commodity', if possible. This function takes a sumlist
+;; (described in gnc:get-exchange-totals) and returns a report-list, This
+;; resulting alist can immediately be plugged into gnc:make-exchange-alist.
-;; Go through all toplevel non-'report-commodity' balances in
-;; 'sumlist' and add them to 'report-commodity', if possible. This
-;; function takes a sumlist (described in gnc:get-exchange-totals) and
-;; returns an alist similar to one value of the sumlist's alist,
-;; e.g. (cadr (assoc report-commodity sumlist))). This resulting alist
-;; can immediately be plugged into gnc:make-exchange-alist.
(define (gnc:resolve-unknown-comm sumlist report-commodity)
;; reportlist contains all known transactions with the
;; report-commodity, and now the transactions with unknown
@@ -529,28 +540,17 @@
;; this functions to use some kind of recursiveness.
-;; Calculate the weighted average exchange rate between all
-;; commodities and the 'report-commodity'. Uses all currency
-;; transactions up until the 'end-date'. Returns an alist, see
-;; sumlist.
+;; Sum the absolute value of the amounts and values in the report commodity of
+;; all exchanges, ignoring gain/loss splits (i.e. those with a 0 amount). For
+;; example, if one bought 1000 GBP for 1210 EUR and then 1190 EUR for 1000 GBP,
+;; if the report currency is EUR the result will be an entry for GBP having an
+;; amount total of 2000 GBP and a value of 2400 EUR. Returns a report-list.
+
(define (gnc:get-exchange-totals report-commodity end-date)
(let ((curr-accounts
;;(filter gnc:account-has-shares? ))
;; -- use all accounts, not only share accounts, since gnucash-1.7
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
- ;; sumlist: a multilevel alist. Each element has a commodity
- ;; as key, and another alist as a value. The value-alist's
- ;; elements consist of a commodity as a key, and a pair of two
- ;; value-collectors as value, e.g. with only one (the report-)
- ;; commodity DEM in the outer alist: ( {DEM ( [USD (400 .
- ;; 1000)] [FRF (300 . 100)] ) } ) where DEM,USD,FRF are
- ;; <gnc:commodity> and the numbers are a numeric-collector
- ;; which in turn store a <gnc:numeric>. In the example, USD
- ;; 400 were bought for an amount of DEM 1000, FRF 300 were
- ;; bought for DEM 100. The reason for the outer alist is that
- ;; there might be commodity transactions which do not involve
- ;; the report-commodity, but which can still be calculated
- ;; after *all* transactions are processed.
(sumlist (list (list report-commodity '()))))
(if (not (null? curr-accounts))
@@ -621,27 +621,15 @@
(gnc:resolve-unknown-comm sumlist report-commodity)))
-;; Calculate the volume-weighted average cost of all commodities,
-;; priced in the 'report-commodity'. Uses all transactions up until
-;; the 'end-date'. Returns an alist, see sumlist.
+;; Sum the net amounts and values in the report commodity, including booked
+;; gains and losses, of each commodity across all accounts. Returns a
+;; report-list.
+
(define (gnc:get-exchange-cost-totals report-commodity end-date)
(let ((curr-accounts
;;(filter gnc:account-has-shares? ))
;; -- use all accounts, not only share accounts, since gnucash-1.7
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
- ;; sumlist: a multilevel alist. Each element has a commodity
- ;; as key, and another alist as a value. The value-alist's
- ;; elements consist of a commodity as a key, and a pair of two
- ;; value-collectors as value, e.g. with only one (the report-)
- ;; commodity DEM in the outer alist: ( {DEM ( [USD (400 .
- ;; 1000)] [FRF (300 . 100)] ) } ) where DEM,USD,FRF are
- ;; <gnc:commodity> and the numbers are a numeric-collector
- ;; which in turn store a <gnc:numeric>. In the example, USD
- ;; 400 were bought for an amount of DEM 1000, FRF 300 were
- ;; bought for DEM 100. The reason for the outer alist is that
- ;; there might be commodity transactions which do not involve
- ;; the report-commodity, but which can still be calculated
- ;; after *all* transactions are processed.
(sumlist (list (list report-commodity '()))))
(if (not (null? curr-accounts))
commit 704afc6e02fc78f7d8669f6b4ef3be239c05e543
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 24 14:25:04 2018 -0700
Comment to explain structuring an (env-transfer-foreign).
diff --git a/libgnucash/engine/test/test-extras.scm b/libgnucash/engine/test/test-extras.scm
index 90c3ed5..d671e9e 100644
--- a/libgnucash/engine/test/test-extras.scm
+++ b/libgnucash/engine/test/test-extras.scm
@@ -157,6 +157,17 @@
(gnc-price-commit-edit price)
(gnc-pricedb-add-price pricedb price)))
+;; When creating stock transactions always put the stock account and the number
+;; of shares second, using negative numbers for a sale. e.g., to buy 100 shares
+;; of IBM:
+;; (env-transfer-foreign env 15 01 2012 cash-a ibm-a 3583200/100 200
+;; #:description "Buy IBM 200") ;;200 @ $179.16
+;; and to sell them:
+;; (env-transfer-foreign env 8 8 2014 cash-a ibm-a -3732600/100 -200
+;; #:description "Sell IBM 200") ;;-200 @ $186.63
+;; (env-transfer-foreign env 8 8 2014 capgain ibm-a 149400/100 0
+;; #:description "IBM 200 G/L")
+
(define* (env-transfer-foreign
env
DD MM YY ; day/month/year
@@ -204,7 +215,7 @@
(xaccSplitSetMemo split-1 memo)
(xaccSplitSetMemo split-2 memo)))
(if (> amount2 0)
- (gnc-pricedb-create (xaccAccountGetCommodity debit)
+ (gnc-pricedb-create (xaccAccountGetCommodity debit)
(xaccAccountGetCommodity credit)
(gnc-dmy2time64 DD MM YY)
(/ amount1 amount2)))
commit fe73f52bdbdecfe73797aacc327d50f67f29d68d
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Aug 27 18:00:55 2018 -0700
Guard against divide-by-zero errors.
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 987f527..f7ce0e6 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -193,11 +193,12 @@
(second foreignlist)
GNC-DENOM-AUTO
GNC-DENOM-LCD))
- (gnc-numeric-div
- total-domestic
- total-foreign
- GNC-DENOM-AUTO
- (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))))))
+ (if (not (zero? total-foreign))
+ (gnc-numeric-div
+ total-domestic
+ total-foreign
+ GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)) 0))))))
;; Get all the interesting splits, and sort them according to the
;; date.
(gnc:get-match-commodity-splits-sorted
@@ -295,11 +296,12 @@
(gnc-commodity-numeric->string
report-currency (gnc-numeric-zero)))
(gnc-numeric-zero))
- (gnc-numeric-div
- (second foreignlist)
- (third foreignlist)
- GNC-DENOM-AUTO
- (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))))))
+ (if (not (zero? (third foreignlist)))
+ (gnc-numeric-div
+ (second foreignlist)
+ (third foreignlist)
+ GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)) 0)))))
;; Get all the interesting splits, sorted by date.
(gnc:get-match-commodity-splits-sorted
currency-accounts
diff --git a/libgnucash/engine/test/test-extras.scm b/libgnucash/engine/test/test-extras.scm
index a040132..90c3ed5 100644
--- a/libgnucash/engine/test/test-extras.scm
+++ b/libgnucash/engine/test/test-extras.scm
@@ -203,10 +203,11 @@
(begin
(xaccSplitSetMemo split-1 memo)
(xaccSplitSetMemo split-2 memo)))
+ (if (> amount2 0)
(gnc-pricedb-create (xaccAccountGetCommodity debit)
(xaccAccountGetCommodity credit)
(gnc-dmy2time64 DD MM YY)
- (/ amount1 amount2))
+ (/ amount1 amount2)))
(xaccTransCommitEdit txn)
txn))
commit 4e88b8cb6c2c2715522a9fe0d5e636c0286530a5
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Aug 18 16:19:43 2018 -0700
Remove the number-collector.
It is redundant and incorrect since gnc-numeric was replaced with Scheme
rationals in the report code.
diff --git a/gnucash/report/business-reports/receipt.scm b/gnucash/report/business-reports/receipt.scm
index 7aea766..780dbf0 100644
--- a/gnucash/report/business-reports/receipt.scm
+++ b/gnucash/report/business-reports/receipt.scm
@@ -46,7 +46,7 @@
(if (or (not taxable) (eq? taxtable '()))
(display " ")
(let* ((amttot (gnc:make-commodity-collector))
- (pctot (gnc:make-number-collector))
+ (pctot (gnc:make-value-collector))
(entries (gncTaxTableGetEntries taxtable))
(amt? #f) ; becomes #t if any entries are amounts
(pc? #f)) ; becomes #t if any entries are percentages
diff --git a/gnucash/report/business-reports/taxinvoice.scm b/gnucash/report/business-reports/taxinvoice.scm
index 326ce4a..685afdb 100644
--- a/gnucash/report/business-reports/taxinvoice.scm
+++ b/gnucash/report/business-reports/taxinvoice.scm
@@ -53,7 +53,7 @@
(if (or (not taxable) (eq? taxtable '()))
(display " ")
(let* ((amttot (gnc:make-commodity-collector))
- (pctot (gnc:make-number-collector))
+ (pctot (gnc:make-value-collector))
(entries (gncTaxTableGetEntries taxtable))
(amt? #f) ; becomes #t if any entries are amounts
(pc? #f)) ; becomes #t if any entries are percentages
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 4238d1a..987f527 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -404,8 +404,8 @@
;; numeric-collectors, where [abc] are numeric-collectors. See the
;; real variable names below.
(define (make-newrate unknown-coll un->known-coll known-pair)
- (let ((a (gnc:make-number-collector))
- (b (gnc:make-number-collector)))
+ (let ((a (gnc:make-value-collector))
+ (b (gnc:make-value-collector)))
(a 'add (unknown-coll 'total #f))
(b 'add
;; round to (at least) 8 significant digits
@@ -448,7 +448,7 @@
;; If this is an Euro currency, create the
;; pair of appropriately exchanged amounts.
(if euro-monetary
- (let ((a (gnc:make-number-collector)))
+ (let ((a (gnc:make-value-collector)))
(a 'add
(gnc:gnc-monetary-amount euro-monetary))
(list report-commodity
@@ -578,8 +578,8 @@
;; entry doesn't exist in comm-list
;; create sub-alist from scratch
(let ((pair (list transaction-comm
- (cons (gnc:make-number-collector)
- (gnc:make-number-collector)))))
+ (cons (gnc:make-value-collector)
+ (gnc:make-value-collector)))))
((caadr pair) 'add value-amount)
((cdadr pair) 'add share-amount)
(set! comm-list (list account-comm (list pair)))
@@ -603,8 +603,8 @@
(begin
(set!
pair (list (car foreignlist)
- (cons (gnc:make-number-collector)
- (gnc:make-number-collector))))
+ (cons (gnc:make-value-collector)
+ (gnc:make-value-collector))))
(set!
comm-list (list (car comm-list)
(cons pair (cadr comm-list))))
@@ -665,8 +665,8 @@
(if (not comm-list)
;; no, create sub-alist from scratch
(let ((pair (list transaction-comm
- (cons (gnc:make-number-collector)
- (gnc:make-number-collector)))))
+ (cons (gnc:make-value-collector)
+ (gnc:make-value-collector)))))
((caadr pair) 'add value-amount)
((cdadr pair) 'add share-amount)
(set! comm-list (list account-comm (list pair)))
@@ -690,8 +690,8 @@
(begin
(set!
pair (list (car foreignlist)
- (cons (gnc:make-number-collector)
- (gnc:make-number-collector))))
+ (cons (gnc:make-value-collector)
+ (gnc:make-value-collector))))
(set!
comm-list (list (car comm-list)
(cons pair (cadr comm-list))))
diff --git a/gnucash/report/report-system/report-utilities.scm b/gnucash/report/report-system/report-utilities.scm
index dbe56c6..3ce1255 100644
--- a/gnucash/report/report-system/report-utilities.scm
+++ b/gnucash/report/report-system/report-utilities.scm
@@ -263,28 +263,6 @@
(define (gnc:value-collector-total collector)
(collector 'total #f))
-
-;; Same as above but with gnc:numeric
-(define (gnc:make-number-collector)
- (let ;;; values
- ((value 0))
- (lambda (action amount) ;;; Dispatch function
- (case action
- ((add) (if (number? amount)
- (set! value (gnc-numeric-add amount value
- GNC-DENOM-AUTO GNC-DENOM-LCD))
- (gnc:warn
- "gnc:Number-collector called with wrong argument: "
- amount)))
- ((total) value)
- (else (gnc:warn "bad gnc:number-collector action: " action))))))
-
-;; Replace all 'action function calls by the normal functions below.
-(define (gnc:number-collector-add collector amount)
- (collector 'add amount))
-(define (gnc:number-collector-total collector)
- (collector 'total #f))
-
;; A commodity collector. This is intended to handle multiple
;; currencies' amounts. The amounts are accumulated via 'add, the
;; result can be fetched via 'format. This used to work with strings
@@ -337,12 +315,12 @@
(gnc-commodity-get-fraction commodity) GNC-RND-ROUND)))
(if (not pair)
(begin
- ;; create a new pair, using the gnc:number-collector
- (set! pair (list commodity (gnc:make-number-collector)))
+ ;; create a new pair, using the gnc:value-collector
+ (set! pair (list commodity (gnc:make-value-collector)))
;; and add it to the alist
(set! commoditylist (cons pair commoditylist))))
;; add the value
- (gnc:number-collector-add (cadr pair) rvalue)))
+ (gnc:value-collector-add (cadr pair) rvalue)))
;; helper function to walk an association list, adding each
;; (commodity -> collector) pair to our list at the appropriate
@@ -351,15 +329,14 @@
(cond ((null? clist) '())
(else (add-commodity-value
(caar clist)
- (gnc:number-collector-total (cadar clist)))
+ (gnc:value-collector-total (cadar clist)))
(add-commodity-clist (cdr clist)))))
(define (minus-commodity-clist clist)
(cond ((null? clist) '())
(else (add-commodity-value
(caar clist)
- (gnc-numeric-neg
- (gnc:number-collector-total (cadar clist))))
+ (- (gnc:value-collector-total (cadar clist))))
(minus-commodity-clist (cdr clist)))))
;; helper function walk the association list doing a callback on
@@ -367,7 +344,7 @@
(define (process-commodity-list fn clist)
(map
(lambda (pair) (fn (car pair)
- (gnc:number-collector-total (cadr pair))))
+ (gnc:value-collector-total (cadr pair))))
clist))
;; helper function which is given a commodity and returns, if
@@ -380,8 +357,8 @@
(gnc-numeric-zero)
(if sign?
(gnc-numeric-neg
- (gnc:number-collector-total (cadr pair)))
- (gnc:number-collector-total (cadr pair))))
+ (gnc:value-collector-total (cadr pair)))
+ (gnc:value-collector-total (cadr pair))))
'()))))
;; helper function which is given a commodity and returns, if
@@ -394,8 +371,8 @@
(gnc-numeric-zero)
(if sign?
(gnc-numeric-neg
- (gnc:number-collector-total (cadr pair)))
- (gnc:number-collector-total (cadr pair)))))))
+ (gnc:value-collector-total (cadr pair)))
+ (gnc:value-collector-total (cadr pair)))))))
;; Dispatch function
(lambda (action commodity amount)
commit a639dd92363438eebbb99a675ca931df91c14696
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Aug 28 18:47:15 2018 +0100
Reduce the number of times the register loads
When a register is created an initial query is run and then the filter
and sort item/reverse order is added and after each item the ledger is
refreshed. By adding a parameter to the three main functions to toggle
the refreshing, with a value of false at register creation, and moving
the gnc_ledger_display_refresh command this can be reduced to 2 from 5.
In the sort/filter dialogue the refresh parameter is TRUE allowing the
changes to be seen immediately.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index cd6d8ca..8ec8752 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -139,8 +139,8 @@ static gchar *gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page);
void gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter);
static void gnc_plugin_page_register_set_filter_tooltip (GncPluginPageRegister *page);
-static void gnc_ppr_update_status_query (GncPluginPageRegister *page);
-static void gnc_ppr_update_date_query (GncPluginPageRegister *page);
+static void gnc_ppr_update_status_query (GncPluginPageRegister *page, gboolean refresh);
+static void gnc_ppr_update_date_query (GncPluginPageRegister *page, gboolean refresh);
/* Command callbacks */
static void gnc_plugin_page_register_cmd_print_check (GtkAction *action, GncPluginPageRegister *plugin_page);
@@ -1155,7 +1155,6 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
reg = gnc_ledger_display_get_split_register(priv->ledger);
gnc_split_register_config(reg, reg->type, reg->style,
reg->use_double_line);
- gnc_ledger_display_refresh(priv->ledger);
gnc_plugin_page_register_ui_initial_state (page);
gnc_plugin_page_register_ui_update (NULL, page);
@@ -1178,7 +1177,7 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
g_free(order);
priv->sd.reverse_order = gnc_plugin_page_register_get_sort_reversed(plugin_page);
- gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.reverse_order);
+ gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.reverse_order, FALSE);
if (priv->sd.reverse_order)
priv->sd.save_order = TRUE;
@@ -1261,8 +1260,11 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
}
/* Update Query with Filter Status and Dates */
- gnc_ppr_update_status_query (page);
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_status_query (page, FALSE);
+ gnc_ppr_update_date_query(page, FALSE);
+
+ /* Now do the refresh */
+ gnc_ledger_display_refresh(priv->ledger);
// Set filter tooltip for summary bar
gnc_plugin_page_register_set_filter_tooltip (page);
@@ -2248,7 +2250,7 @@ gnc_plugin_page_register_sort_response_cb (GtkDialog *dialog,
if (response != GTK_RESPONSE_OK)
{
/* Restore the original sort order */
- gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.original_reverse_order);
+ gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.original_reverse_order, TRUE);
priv->sd.reverse_order = priv->sd.original_reverse_order;
gnc_split_reg_set_sort_type(priv->gsr, priv->sd.original_sort_type);
priv->sd.save_order = priv->sd.original_save_order;
@@ -2363,7 +2365,7 @@ gnc_plugin_page_register_sort_order_reverse_cb (GtkToggleButton *button,
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
priv->sd.reverse_order = gtk_toggle_button_get_active(button);
- gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.reverse_order);
+ gnc_split_reg_set_sort_reversed(priv->gsr, priv->sd.reverse_order, TRUE);
LEAVE(" ");
}
@@ -2384,7 +2386,7 @@ gnc_plugin_page_register_sort_order_reverse_cb (GtkToggleButton *button,
* associated with this filter dialog.
*/
static void
-gnc_ppr_update_status_query (GncPluginPageRegister *page)
+gnc_ppr_update_status_query (GncPluginPageRegister *page, gboolean refresh)
{
GncPluginPageRegisterPrivate *priv;
GSList *param_list;
@@ -2414,7 +2416,8 @@ gnc_ppr_update_status_query (GncPluginPageRegister *page)
// Set filter tooltip for summary bar
gnc_plugin_page_register_set_filter_tooltip (page);
- gnc_ledger_display_refresh (priv->ledger);
+ if (refresh)
+ gnc_ledger_display_refresh (priv->ledger);
LEAVE(" ");
}
@@ -2432,7 +2435,7 @@ gnc_ppr_update_status_query (GncPluginPageRegister *page)
* associated with this filter dialog.
*/
static void
-gnc_ppr_update_date_query (GncPluginPageRegister *page)
+gnc_ppr_update_date_query (GncPluginPageRegister *page, gboolean refresh)
{
GncPluginPageRegisterPrivate *priv;
GSList *param_list;
@@ -2485,7 +2488,8 @@ gnc_ppr_update_date_query (GncPluginPageRegister *page)
// Set filter tooltip for summary bar
gnc_plugin_page_register_set_filter_tooltip (page);
- gnc_ledger_display_refresh (priv->ledger);
+ if (refresh)
+ gnc_ledger_display_refresh (priv->ledger);
LEAVE(" ");
}
@@ -2566,7 +2570,7 @@ gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton *button,
priv->fd.cleared_match |= value;
else
priv->fd.cleared_match &= ~value;
- gnc_ppr_update_status_query(page);
+ gnc_ppr_update_status_query(page, TRUE);
LEAVE(" ");
}
@@ -2605,7 +2609,7 @@ gnc_plugin_page_register_filter_status_all_cb (GtkButton *button,
/* Set the requested status */
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
priv->fd.cleared_match = CLEARED_ALL;
- gnc_ppr_update_status_query(page);
+ gnc_ppr_update_status_query(page, TRUE);
LEAVE(" ");
}
@@ -2713,7 +2717,7 @@ gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
priv->fd.start_time = 0;
priv->fd.end_time = 0;
}
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_date_query(page, TRUE);
LEAVE(" ");
}
@@ -2741,7 +2745,7 @@ gnc_plugin_page_register_filter_days_changed_cb (GtkSpinButton *button,
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
priv->fd.days = gtk_spin_button_get_value(GTK_SPIN_BUTTON(button));
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_date_query(page, TRUE);
LEAVE(" ");
}
@@ -2764,7 +2768,7 @@ gnc_plugin_page_register_filter_gde_changed_cb (GtkWidget *unused,
ENTER("(widget %s(%p), page %p)", gtk_buildable_get_name(GTK_BUILDABLE(unused)), unused, page);
get_filter_times(page);
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_date_query(page, TRUE);
LEAVE(" ");
}
@@ -2811,7 +2815,7 @@ gnc_plugin_page_register_filter_start_cb (GtkWidget *radio,
active = ( g_strcmp0(name, g_strdup("start_date_choose")) == 0 ? 1 : 0 );
gtk_widget_set_sensitive(priv->fd.start_date, active);
get_filter_times(page);
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_date_query(page, TRUE);
LEAVE(" ");
}
@@ -2858,7 +2862,7 @@ gnc_plugin_page_register_filter_end_cb (GtkWidget *radio,
active = ( g_strcmp0(name, g_strdup("end_date_choose")) == 0 ? 1 : 0 );
gtk_widget_set_sensitive(priv->fd.end_date, active);
get_filter_times(page);
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_date_query(page, TRUE);
LEAVE(" ");
}
@@ -2922,12 +2926,12 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
{
/* Remove the old status match */
priv->fd.cleared_match = priv->fd.original_cleared_match;
- gnc_ppr_update_status_query(page);
+ gnc_ppr_update_status_query(page, FALSE);
priv->fd.start_time = priv->fd.original_start_time;
priv->fd.end_time = priv->fd.original_end_time;
priv->fd.days = priv->fd.original_days;
priv->fd.save_filter = priv->fd.original_save_filter;
- gnc_ppr_update_date_query(page);
+ gnc_ppr_update_date_query(page, TRUE);
}
else
{
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index f5ddfb5..a82c603 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -1961,7 +1961,7 @@ gnc_split_reg_sort_notes_cb(GtkWidget *w, gpointer data)
void
-gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev)
+gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev, gboolean refresh)
{
/* Note: sort_reversed is the boolean opposite of sort_increasing
* so when rev == true, we're sorting decreasing
@@ -1971,7 +1971,8 @@ gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev)
Query *query = gnc_ledger_display_get_query( gsr->ledger );
qof_query_set_sort_increasing (query, !rev, !rev, !rev);
gsr->sort_rev = rev;
- gnc_ledger_display_refresh( gsr->ledger );
+ if (refresh)
+ gnc_ledger_display_refresh( gsr->ledger );
}
static void
diff --git a/gnucash/gnome/gnc-split-reg.h b/gnucash/gnome/gnc-split-reg.h
index 16ecae1..09ffc73 100644
--- a/gnucash/gnome/gnc-split-reg.h
+++ b/gnucash/gnome/gnc-split-reg.h
@@ -206,7 +206,7 @@ void gnc_split_reg_set_sort_type_force( GNCSplitReg *gsr, SortType t, gboolean f
/**
* Set/get sort order of register
**/
-void gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev);
+void gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev, gboolean refresh);
/**
commit e2801fd937451a32a3af712aee1bffac25823558
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Aug 19 22:02:47 2018 +0100
Change the default filter for General Ledger
The General Ledger default for the number of days shown is 30 but for
the Register it is 0, meaning show all. So change the default filter
based on ledger type and use this when determining if the setting should
be saved or removed.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index bc7cda6..cd6d8ca 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -90,6 +90,7 @@
static QofLogModule log_module = GNC_MOD_GUI;
#define DEFAULT_LINES_AMOUNT 50
+#define DEFAULT_FILTER_NUM_DAYS_GL "30"
static void gnc_plugin_page_register_class_init (GncPluginPageRegisterClass *klass);
static void gnc_plugin_page_register_init (GncPluginPageRegister *plugin_page);
@@ -1091,6 +1092,15 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister *page)
/* Virtual Functions */
+static const gchar *
+get_filter_default_num_of_days (GNCLedgerDisplayType ledger_type)
+{
+ if (ledger_type == LD_GL)
+ return DEFAULT_FILTER_NUM_DAYS_GL;
+ else
+ return "0";
+}
+
static GtkWidget *
gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
{
@@ -1204,7 +1214,11 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
filter_changed = filter_changed + 1;
}
- if (filter[3] && (g_strcmp0 (filter[3], "0") != 0 ))
+ // set the default for the number of days
+ priv->fd.days = (gint)g_ascii_strtoll (
+ get_filter_default_num_of_days (ledger_type), NULL, 10);
+
+ if (filter[3] && (g_strcmp0 (filter[3], get_filter_default_num_of_days (ledger_type)) != 0 ))
{
PINFO("Loaded Filter Days is %s", filter[3]);
@@ -1225,13 +1239,8 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
if (reg->type == GENERAL_JOURNAL)
{
- if ((priv->fd.days == 0) && (priv->fd.start_time == 0) && (priv->fd.end_time == 0))
- priv->fd.days = 30; // default number of days for gl
- else
- {
- start_time = priv->fd.start_time;
- end_time = priv->fd.end_time;
- }
+ start_time = priv->fd.start_time;
+ end_time = priv->fd.end_time;
}
else // search ledger and the like
{
@@ -1824,7 +1833,9 @@ gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
filter = xaccAccountGetFilter (leader);
}
- return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+
+ return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER,
+ "0", "0", get_filter_default_num_of_days (ledger_type));
}
static void
@@ -1860,13 +1871,16 @@ gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *fi
GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
- gchar *default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+ gchar *default_filter;
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
+ default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER,
+ "0", "0", get_filter_default_num_of_days (ledger_type));
+
// save to gcm file for LD_GL or when feature is set
if (ledger_type == LD_GL ||
gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
commit 2dcb31628094636219a0a3e5466d7d802b117e0d
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Aug 25 11:08:32 2018 +0100
White space removal and change tabs to spaces in qofbook.cpp/h
diff --git a/libgnucash/engine/qofbook.cpp b/libgnucash/engine/qofbook.cpp
index 1ac6223..15f3a7f 100644
--- a/libgnucash/engine/qofbook.cpp
+++ b/libgnucash/engine/qofbook.cpp
@@ -66,30 +66,30 @@ static QofLogModule log_module = QOF_MOD_ENGINE;
enum
{
PROP_0,
-// PROP_ROOT_ACCOUNT, /* Table */
-// PROP_ROOT_TEMPLATE, /* Table */
+// PROP_ROOT_ACCOUNT, /* Table */
+// PROP_ROOT_TEMPLATE, /* Table */
/* keep trading accounts property, while adding book-currency, default gains
policy and default gains account properties, so that files prior to 2.7 can
be read/processed; GUI changed to use all four properties as of 2.7.
Trading accounts, on the one hand, and book-currency plus default-gains-
policy, and optionally, default gains account, on the other, are mutually
exclusive */
- PROP_OPT_TRADING_ACCOUNTS, /* KVP */
+ PROP_OPT_TRADING_ACCOUNTS, /* KVP */
/* Book currency and default gains policy properties only apply if currency
accounting method selected in GUI is 'book-currency'; both required and
both are exclusive with trading accounts */
- PROP_OPT_BOOK_CURRENCY, /* KVP */
- PROP_OPT_DEFAULT_GAINS_POLICY, /* KVP */
+ PROP_OPT_BOOK_CURRENCY, /* KVP */
+ PROP_OPT_DEFAULT_GAINS_POLICY, /* KVP */
/* Default gains account property only applies if currency accounting method
selected in GUI is 'book-currency'; its use is optional but exclusive with
trading accounts */
- PROP_OPT_DEFAULT_GAINS_ACCOUNT_GUID, /* KVP */
- PROP_OPT_AUTO_READONLY_DAYS,/* KVP */
- PROP_OPT_NUM_FIELD_SOURCE, /* KVP */
- PROP_OPT_DEFAULT_BUDGET, /* KVP */
- PROP_OPT_FY_END, /* KVP */
- PROP_AB_TEMPLATES, /* KVP */
- N_PROPERTIES /* Just a counter */
+ PROP_OPT_DEFAULT_GAINS_ACCOUNT_GUID, /* KVP */
+ PROP_OPT_AUTO_READONLY_DAYS, /* KVP */
+ PROP_OPT_NUM_FIELD_SOURCE, /* KVP */
+ PROP_OPT_DEFAULT_BUDGET, /* KVP */
+ PROP_OPT_FY_END, /* KVP */
+ PROP_AB_TEMPLATES, /* KVP */
+ N_PROPERTIES /* Just a counter */
};
static void
@@ -167,9 +167,9 @@ static const std::string str_OPTION_NAME_NUM_FIELD_SOURCE(OPTION_NAME_NUM_FIELD_
static void
qof_book_get_property (GObject* object,
- guint prop_id,
- GValue* value,
- GParamSpec* pspec)
+ guint prop_id,
+ GValue* value,
+ GParamSpec* pspec)
{
QofBook *book;
gchar *key;
@@ -221,9 +221,9 @@ qof_book_get_property (GObject* object,
static void
qof_book_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
QofBook *book;
gchar *key;
@@ -288,9 +288,9 @@ qof_book_class_init (QofBookClass *klass)
PROP_OPT_TRADING_ACCOUNTS,
g_param_spec_string("trading-accts",
"Use Trading Accounts",
- "Scheme true ('t') or NULL. If 't', then the book "
- "uses trading accounts for managing multiple-currency "
- "transactions.",
+ "Scheme true ('t') or NULL. If 't', then the book "
+ "uses trading accounts for managing multiple-currency "
+ "transactions.",
NULL,
G_PARAM_READWRITE));
@@ -299,9 +299,9 @@ qof_book_class_init (QofBookClass *klass)
PROP_OPT_BOOK_CURRENCY,
g_param_spec_string("book-currency",
"Select Book Currency",
- "The reference currency used to manage multiple-currency "
- "transactions when 'book-currency' currency accounting method "
- "selected; requires valid default gains/loss policy.",
+ "The reference currency used to manage multiple-currency "
+ "transactions when 'book-currency' currency accounting method "
+ "selected; requires valid default gains/loss policy.",
NULL,
G_PARAM_READWRITE));
@@ -310,10 +310,10 @@ qof_book_class_init (QofBookClass *klass)
PROP_OPT_DEFAULT_GAINS_POLICY,
g_param_spec_string("default-gains-policy",
"Select Default Gains Policy",
- "The default policy to be used to calculate gains/losses on "
- "dispositions of currencies/commodities other than "
- "'book-currency' when 'book-currency' currency accounting "
- "method selected; requires valid book-currency.",
+ "The default policy to be used to calculate gains/losses on "
+ "dispositions of currencies/commodities other than "
+ "'book-currency' when 'book-currency' currency accounting "
+ "method selected; requires valid book-currency.",
NULL,
G_PARAM_READWRITE));
@@ -322,10 +322,10 @@ qof_book_class_init (QofBookClass *klass)
PROP_OPT_DEFAULT_GAINS_ACCOUNT_GUID,
g_param_spec_boxed("default-gain-loss-account-guid",
"Select Default Gain/Loss Account",
- "The default account to be used for calculated gains/losses on "
- "dispositions of currencies/commodities other than "
- "'book-currency' when 'book-currency' currency accounting "
- "method selected; requires valid book-currency.",
+ "The default account to be used for calculated gains/losses on "
+ "dispositions of currencies/commodities other than "
+ "'book-currency' when 'book-currency' currency accounting "
+ "method selected; requires valid book-currency.",
GNC_TYPE_GUID,
G_PARAM_READWRITE));
@@ -334,8 +334,8 @@ qof_book_class_init (QofBookClass *klass)
PROP_OPT_NUM_FIELD_SOURCE,
g_param_spec_string(PARAM_NAME_NUM_FIELD_SOURCE,
"Use Split-Action in the Num Field",
- "Scheme true ('t') or NULL. If 't', then the book "
- "will put the split action value in the Num field.",
+ "Scheme true ('t') or NULL. If 't', then the book "
+ "will put the split action value in the Num field.",
NULL,
G_PARAM_READWRITE));
@@ -344,11 +344,11 @@ qof_book_class_init (QofBookClass *klass)
PROP_OPT_AUTO_READONLY_DAYS,
g_param_spec_double("autoreadonly-days",
"Transaction Auto-read-only Days",
- "Prevent editing of transactions posted more than "
- "this many days ago.",
- 0,
+ "Prevent editing of transactions posted more than "
+ "this many days ago.",
+ 0,
G_MAXDOUBLE,
- 0,
+ 0,
G_PARAM_READWRITE));
g_object_class_install_property
@@ -365,7 +365,7 @@ qof_book_class_init (QofBookClass *klass)
g_param_spec_boxed("fy-end",
"Book Fiscal Year End",
"A GDate with a bogus year having the last Month and "
- "Day of the Fiscal year for the book.",
+ "Day of the Fiscal year for the book.",
G_TYPE_DATE,
G_PARAM_READWRITE));
g_object_class_install_property
@@ -561,7 +561,7 @@ qof_book_set_data_fin (QofBook *book, const char *key, gpointer data, QofBookFin
if (!cb) return;
g_hash_table_insert (book->data_table_finalizers, (gpointer)key,
- reinterpret_cast<void*>(cb));
+ reinterpret_cast<void*>(cb));
}
gpointer
@@ -979,8 +979,8 @@ qof_book_get_book_currency_name (QofBook *book)
{
const gchar *opt = NULL;
qof_instance_get (QOF_INSTANCE (book),
- "book-currency", &opt,
- NULL);
+ "book-currency", &opt,
+ NULL);
return opt;
}
@@ -994,8 +994,8 @@ qof_book_get_default_gains_policy (QofBook *book)
{
const gchar *opt = NULL;
qof_instance_get (QOF_INSTANCE (book),
- "default-gains-policy", &opt,
- NULL);
+ "default-gains-policy", &opt,
+ NULL);
return opt;
}
@@ -1009,8 +1009,8 @@ qof_book_get_default_gain_loss_acct_guid (QofBook *book)
{
GncGUID *guid = NULL;
qof_instance_get (QOF_INSTANCE (book),
- "default-gain-loss-account-guid", &guid,
- NULL);
+ "default-gain-loss-account-guid", &guid,
+ NULL);
return guid;
}
@@ -1021,8 +1021,8 @@ qof_book_use_trading_accounts (const QofBook *book)
{
const char *opt = NULL;
qof_instance_get (QOF_INSTANCE (book),
- "trading-accts", &opt,
- NULL);
+ "trading-accts", &opt,
+ NULL);
if (opt && opt[0] == 't' && opt[1] == 0)
return TRUE;
return FALSE;
@@ -1225,7 +1225,7 @@ qof_book_load_options (QofBook *book, GNCOptionLoad load_cb, GNCOptionDB *odb)
void
qof_book_save_options (QofBook *book, GNCOptionSave save_cb,
- GNCOptionDB* odb, gboolean clear)
+ GNCOptionDB* odb, gboolean clear)
{
/* Wrap this in begin/commit so that it commits only once instead of doing
* so for every option. Qof_book_set_option will take care of dirtying the
diff --git a/libgnucash/engine/qofbook.h b/libgnucash/engine/qofbook.h
index 266e118..f2b4ae4 100644
--- a/libgnucash/engine/qofbook.h
+++ b/libgnucash/engine/qofbook.h
@@ -148,15 +148,16 @@ struct _QofBook
* from the session. Better solutions welcome ... */
QofBackend *backend;
- /* A cached value of the OPTION_NAME_NUM_FIELD_SOURCE option value because
- * it is queried quite a lot, so we want to avoid a KVP lookup on each query
- */
+ /* A cached value of the OPTION_NAME_NUM_FIELD_SOURCE option value
+ * because it is queried quite a lot, so we want to avoid a KVP
+ * lookup on each query */
gboolean cached_num_field_source;
/* Whether the above cached value is valid. */
gboolean cached_num_field_source_isvalid;
- /* A cahed value of the "autoreadonly-days" option value because it is
- * queried quite a lot, so we want to avoid a KVP lookup on each query */
+ /* A cahed value of the "autoreadonly-days" option value because
+ * it is queried quite a lot, so we want to avoid a KVP lookup on
+ * each query */
gint cached_num_days_autoreadonly;
/* Whether the above cached value is valid. */
gboolean cached_num_days_autoreadonly_isvalid;
@@ -180,7 +181,7 @@ GType qof_book_get_type(void);
* but not somewhere inline in the code. */
#define QOF_BOOK_RETURN_ENTITY(book,guid,e_type,c_type) { \
QofInstance *val = NULL; \
- if ((guid != NULL) && (book != NULL)) { \
+ if ((guid != NULL) && (book != NULL)) { \
const QofCollection *col; \
col = qof_book_get_collection (book, e_type); \
val = qof_collection_lookup_entity (col, guid); \
@@ -191,7 +192,7 @@ GType qof_book_get_type(void);
/** GList of QofBook */
-typedef GList QofBookList;
+typedef GList QofBookList;
typedef void (*QofBookFinalCB) (QofBook *, gpointer key, gpointer user_data);
@@ -204,7 +205,7 @@ QofBook * qof_book_new (void);
/** End any editing sessions associated with book, and free all memory
associated with it. */
-void qof_book_destroy (QofBook *book);
+void qof_book_destroy (QofBook *book);
/** Close a book to editing.
@@ -390,7 +391,7 @@ void qof_book_commit_edit(QofBook *book);
* @param odb: The GNCOptionDB to load.
*/
void qof_book_load_options (QofBook *book, GNCOptionLoad load_cb,
- GNCOptionDB *odb);
+ GNCOptionDB *odb);
/** Save a GNCOptionsDB back to the book's KVP.
* @param book: The book.
* @param save_cb: A callback function that does the saving.
commit fd750a22ebe34fad3ec78a7fb69e51537cd3eaec
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Aug 24 16:57:58 2018 +0100
Cache the number of days read only value
The KVP value for the qof_book_get_num_days_autoreadonly was being
called many times so it makes sense to cache it in the book to avoid
the KVP lookup.
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 77e7539..03a498a 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -4025,7 +4025,8 @@ gnc_book_options_dialog_apply_helper(GNCOptionDB * options)
qof_book_use_split_action_for_num_field (book);
gboolean use_book_currency_before =
gnc_book_use_book_currency (book);
- gint use_read_only_threshold_before = qof_book_get_num_days_autoreadonly (book);
+ gint use_read_only_threshold_before =
+ qof_book_get_num_days_autoreadonly (book);
gboolean use_split_action_for_num_after;
gboolean use_book_currency_after;
gint use_read_only_threshold_after;
@@ -4037,7 +4038,7 @@ gnc_book_options_dialog_apply_helper(GNCOptionDB * options)
results = gnc_option_db_commit (options);
for (iter = results; iter; iter = iter->next)
{
- GtkWidget *dialog = gtk_message_dialog_new(NULL,
+ GtkWidget *dialog = gtk_message_dialog_new(gnc_ui_get_main_window (NULL),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
@@ -4053,7 +4054,11 @@ gnc_book_options_dialog_apply_helper(GNCOptionDB * options)
use_split_action_for_num_after =
qof_book_use_split_action_for_num_field (book);
use_book_currency_after = gnc_book_use_book_currency (book);
+
+ // mark cached value as invalid so we get new value
+ book->cached_num_days_autoreadonly_isvalid = FALSE;
use_read_only_threshold_after = qof_book_get_num_days_autoreadonly (book);
+
if (use_split_action_for_num_before != use_split_action_for_num_after)
{
gnc_book_option_num_field_source_change_cb (
diff --git a/libgnucash/engine/qofbook.cpp b/libgnucash/engine/qofbook.cpp
index bf54dcc..1ac6223 100644
--- a/libgnucash/engine/qofbook.cpp
+++ b/libgnucash/engine/qofbook.cpp
@@ -96,8 +96,14 @@ static void
qof_book_option_num_field_source_changed_cb (GObject *gobject,
GParamSpec *pspec,
gpointer user_data);
+static void
+qof_book_option_num_autoreadonly_changed_cb (GObject *gobject,
+ GParamSpec *pspec,
+ gpointer user_data);
+
// Use a #define for the GParam name to avoid typos
#define PARAM_NAME_NUM_FIELD_SOURCE "split-action-num-field"
+#define PARAM_NAME_NUM_AUTOREAD_ONLY "autoreadonly-days"
QOF_GOBJECT_GET_TYPE(QofBook, qof_book, QOF_TYPE_INSTANCE, {});
QOF_GOBJECT_DISPOSE(qof_book);
@@ -134,6 +140,7 @@ qof_book_init (QofBook *book)
book->session_dirty = FALSE;
book->version = 0;
book->cached_num_field_source_isvalid = FALSE;
+ book->cached_num_days_autoreadonly_isvalid = FALSE;
// Register a callback on this NUM_FIELD_SOURCE property of that object
// because it gets called quite a lot, so that its value must be stored in
@@ -142,6 +149,14 @@ qof_book_init (QofBook *book)
"notify::" PARAM_NAME_NUM_FIELD_SOURCE,
G_CALLBACK (qof_book_option_num_field_source_changed_cb),
book);
+
+ // Register a callback on this NUM_AUTOREAD_ONLY property of that object
+ // because it gets called quite a lot, so that its value must be stored in
+ // a bool member variable instead of a KVP lookup on each getter call.
+ g_signal_connect (G_OBJECT(book),
+ "notify::" PARAM_NAME_NUM_AUTOREAD_ONLY,
+ G_CALLBACK (qof_book_option_num_autoreadonly_changed_cb),
+ book);
}
static const std::string str_KVP_OPTION_PATH(KVP_OPTION_PATH);
@@ -1065,11 +1080,21 @@ gboolean qof_book_uses_autoreadonly (const QofBook *book)
gint qof_book_get_num_days_autoreadonly (const QofBook *book)
{
g_assert(book);
- double tmp;
- qof_instance_get (QOF_INSTANCE (book),
- "autoreadonly-days", &tmp,
- NULL);
- return (gint) tmp;
+
+ if (!book->cached_num_days_autoreadonly_isvalid)
+ {
+ double tmp;
+
+ // No cached value? Then do the expensive KVP lookup
+ qof_instance_get (QOF_INSTANCE (book),
+ PARAM_NAME_NUM_AUTOREAD_ONLY, &tmp,
+ NULL);
+
+ const_cast<QofBook*>(book)->cached_num_days_autoreadonly = tmp;
+ const_cast<QofBook*>(book)->cached_num_days_autoreadonly_isvalid = TRUE;
+ }
+ // Value is cached now. Use the cheap variable returning.
+ return (gint) book->cached_num_days_autoreadonly;
}
GDate* qof_book_get_autoreadonly_gdate (const QofBook *book)
@@ -1087,6 +1112,19 @@ GDate* qof_book_get_autoreadonly_gdate (const QofBook *book)
return result;
}
+// The callback that is called when the KVP option value of
+// "autoreadonly-days" changes, so that we mark the cached value as
+// invalid.
+static void
+qof_book_option_num_autoreadonly_changed_cb (GObject *gobject,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ QofBook *book = reinterpret_cast<QofBook*>(user_data);
+ g_return_if_fail(QOF_IS_BOOK(book));
+ book->cached_num_days_autoreadonly_isvalid = FALSE;
+}
+
/* Note: this will fail if the book slots we're looking for here are flattened at some point !
* When that happens, this function can be removed. */
static Path opt_name_to_path (const char* opt_name)
diff --git a/libgnucash/engine/qofbook.h b/libgnucash/engine/qofbook.h
index c695de3..266e118 100644
--- a/libgnucash/engine/qofbook.h
+++ b/libgnucash/engine/qofbook.h
@@ -154,6 +154,12 @@ struct _QofBook
gboolean cached_num_field_source;
/* Whether the above cached value is valid. */
gboolean cached_num_field_source_isvalid;
+
+ /* A cahed value of the "autoreadonly-days" option value because it is
+ * queried quite a lot, so we want to avoid a KVP lookup on each query */
+ gint cached_num_days_autoreadonly;
+ /* Whether the above cached value is valid. */
+ gboolean cached_num_days_autoreadonly_isvalid;
};
struct _QofBookClass
commit 8ad6e04549e8f971ad76baee29fabfaa9240cb4a
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Aug 24 16:52:17 2018 +0100
Book Options did not raise when already open
If you open File->Properties and the dialogue gets hidden and you go to
open it again the existing dialogue was not being raised to the front.
This was due to a bad cast.
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 240aed1..77e7539 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -4098,10 +4098,15 @@ static gboolean
show_handler (const char *class_name, gint component_id,
gpointer user_data, gpointer iter_data)
{
- GtkWidget *dialog;
+ GNCOptionWin *optwin = user_data;
+ GtkWidget *widget;
- dialog = GTK_WIDGET(user_data);
- gtk_window_present(GTK_WINDOW(dialog));
+ if (!optwin)
+ return(FALSE);
+
+ widget = gnc_options_dialog_widget(optwin);
+
+ gtk_window_present(GTK_WINDOW(widget));
return(TRUE);
}
commit 93f3a8ea8274862f776ed836ac99b50ea118a827
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 23 11:49:49 2018 -0700
Fix build of jenny.c on 32-bit builds, mingw-w64.
diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index fb8254b..d82b10c 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -1019,10 +1019,12 @@ parse( int argc, char *argv[], state *s)
int i, j;
ub4 temp;
char *testfile = (char *)0;
+ /* Finesse differences in size_t between 32 and 64-bit builds. */
+ long feature_length = strlen(feature_name);
/* internal check: we have MAX_FEATURES names for features */
- if (strlen(feature_name) != MAX_FEATURES) {
- printf("feature_name length is wrong, %lu\n", strlen(feature_name));
+ if (feature_length != MAX_FEATURES) {
+ printf("feature_name length is wrong, %lu\n", feature_length);
return FALSE;
}
@@ -1098,7 +1100,7 @@ parse( int argc, char *argv[], state *s)
} /* for (each argument) if '-' */
if (s->n_final > s->ndim) {
- printf("jenny: %hhu-tuples are impossible with only %hu dimensions\n",
+ printf("jenny: %u-tuples are impossible with only %u dimensions\n",
s->n_final, s->ndim);
return FALSE;
}
commit 3456596a1c006b5ec317e4482b9455548ef0a579
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Aug 22 20:40:17 2018 +0100
Bug 796814 - Changing a book's read-only threshold doesn't immediately affect open registers
Add test for change of read-only threshold to helper function for the
gnc_book_options_dialog_apply_cb which will then do a gui refresh.
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index ae4505f..240aed1 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -4025,8 +4025,10 @@ gnc_book_options_dialog_apply_helper(GNCOptionDB * options)
qof_book_use_split_action_for_num_field (book);
gboolean use_book_currency_before =
gnc_book_use_book_currency (book);
+ gint use_read_only_threshold_before = qof_book_get_num_days_autoreadonly (book);
gboolean use_split_action_for_num_after;
gboolean use_book_currency_after;
+ gint use_read_only_threshold_after;
gboolean return_val = FALSE;
GList *results = NULL, *iter;
@@ -4051,6 +4053,7 @@ gnc_book_options_dialog_apply_helper(GNCOptionDB * options)
use_split_action_for_num_after =
qof_book_use_split_action_for_num_field (book);
use_book_currency_after = gnc_book_use_book_currency (book);
+ use_read_only_threshold_after = qof_book_get_num_days_autoreadonly (book);
if (use_split_action_for_num_before != use_split_action_for_num_after)
{
gnc_book_option_num_field_source_change_cb (
@@ -4062,6 +4065,9 @@ gnc_book_options_dialog_apply_helper(GNCOptionDB * options)
gnc_book_option_book_currency_selected_cb (use_book_currency_after);
return_val = TRUE;
}
+ if (use_read_only_threshold_before != use_read_only_threshold_after)
+ return_val = TRUE;
+
qof_book_commit_edit (book);
return return_val;
}
commit 67ee1d99a4e7b226c98ab84a04864ed390ba9f2f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Aug 22 20:38:36 2018 +0100
Bug 796812 - gnc_date_cell_get_date and gnc_date_cell_get_date_gdate have different date validation behaviour - part 2
Change the two register get_help functions to use gnc_date_cell_get_date
with the warn parameter FALSE, this way we only get one warning when the
date is out of range.
Also as no functions use gnc_date_cell_get_date_gdate it can be removed.
diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index 190809d..0a12383 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -564,19 +564,18 @@ static char * get_date_help (VirtualLocation virt_loc, gpointer user_data)
{
GncEntryLedger *ledger = user_data;
BasicCell *cell;
- char string[1024];
- GDate date;
+ const char *date_string;
+ time64 cell_time;
cell = gnc_table_get_cell (ledger->table, virt_loc);
if (!cell || !cell->value || *cell->value == '\0')
return NULL;
- g_date_clear (&date, 1);
- gnc_date_cell_get_date_gdate ((DateCell *) cell, &date);
+ gnc_date_cell_get_date ((DateCell *) cell, &cell_time, FALSE);
- g_date_strftime (string, sizeof (string), _("%A %d %B %Y"), &date);
+ date_string = gnc_print_time64 (cell_time, _("%A %d %B %Y"));
- return g_strdup (string);
+ return g_strdup (date_string);
}
static char * get_desc_help (VirtualLocation virt_loc, gpointer user_data)
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index 0ecf31f..d4c28d5 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -968,19 +968,18 @@ gnc_split_register_get_date_help (VirtualLocation virt_loc,
{
SplitRegister *reg = user_data;
BasicCell *cell;
- char string[1024];
- GDate date;
+ const char *date_string;
+ time64 cell_time;
cell = gnc_table_get_cell (reg->table, virt_loc);
if (!cell || !cell->value || *cell->value == '\0')
return NULL;
- g_date_clear (&date, 1);
- gnc_date_cell_get_date_gdate ((DateCell *) cell, &date);
+ gnc_date_cell_get_date ((DateCell *) cell, &cell_time, FALSE);
- g_date_strftime (string, sizeof (string), _("%A %d %B %Y"), &date);
+ date_string = gnc_print_time64 (cell_time, _("%A %d %B %Y"));
- return g_strdup (string);
+ return g_strdup (date_string);
}
static const char *
diff --git a/gnucash/register/register-core/datecell.h b/gnucash/register/register-core/datecell.h
index 709b7bc..8f96b7a 100644
--- a/gnucash/register/register-core/datecell.h
+++ b/gnucash/register/register-core/datecell.h
@@ -127,11 +127,5 @@ void gnc_date_cell_commit (DateCell *cell);
*/
void gnc_date_cell_get_date (DateCell *cell, time64 *time, gboolean warn);
-/** Set a GDate to the value in the DateCell.
- * @param cell The DateCell
- * @param date A GDate* into which the functino will write the date.
- */
-
-void gnc_date_cell_get_date_gdate (DateCell *cell, GDate *date);
/** @} */
#endif
diff --git a/gnucash/register/register-gnome/datecell-gnome.c b/gnucash/register/register-gnome/datecell-gnome.c
index 3b0399b..8018516 100644
--- a/gnucash/register/register-gnome/datecell-gnome.c
+++ b/gnucash/register/register-gnome/datecell-gnome.c
@@ -715,22 +715,6 @@ gnc_date_cell_leave (BasicCell *bcell)
}
void
-gnc_date_cell_get_date_gdate (DateCell *cell, GDate *date)
-{
- PopBox *box = cell->cell.gui_private;
-
- if (!cell || !date)
- return;
-
- gnc_parse_date (&(box->date), cell->cell.value, FALSE);
-
- g_date_set_dmy(date,
- box->date.tm_mday,
- box->date.tm_mon + 1,
- box->date.tm_year + 1900);
-}
-
-void
gnc_date_cell_get_date (DateCell *cell, time64 *time, gboolean warn)
{
PopBox *box = cell->cell.gui_private;
commit aabae1caf9e0cbf70266ecf8a265c97ffb3326a0
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Aug 22 20:36:51 2018 +0100
Bug 796812 - gnc_date_cell_get_date and gnc_date_cell_get_date_gdate have different date validation behaviour - part 1
Add gboolean parameter to gnc_date_cell_get_date to enable warning for
the date out of range dialogue and update every occurrence accordingly.
diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index 574a480..190809d 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -1012,7 +1012,7 @@ static void gnc_entry_ledger_save_cells (gpointer save_data,
cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DATE_CELL);
- gnc_date_cell_get_date ((DateCell *) cell, &cell_time);
+ gnc_date_cell_get_date ((DateCell *) cell, &cell_time, TRUE);
/* commit any pending changes */
gnc_date_cell_commit ((DateCell *) cell);
diff --git a/gnucash/register/ledger-core/split-register-control.c b/gnucash/register/ledger-core/split-register-control.c
index 5effb4c..0bb8ebe 100644
--- a/gnucash/register/ledger-core/split-register-control.c
+++ b/gnucash/register/ledger-core/split-register-control.c
@@ -1258,7 +1258,7 @@ gnc_split_register_xfer_dialog(SplitRegister *reg, Transaction *txn,
if (cell)
{
time64 time;
- gnc_date_cell_get_date((DateCell*) cell, &time);
+ gnc_date_cell_get_date((DateCell*) cell, &time, TRUE);
gnc_xfer_dialog_set_date(xfer, time);
}
else
diff --git a/gnucash/register/ledger-core/split-register-model-save.c b/gnucash/register/ledger-core/split-register-model-save.c
index f0f2ccf..d4b24db 100644
--- a/gnucash/register/ledger-core/split-register-model-save.c
+++ b/gnucash/register/ledger-core/split-register-model-save.c
@@ -67,7 +67,7 @@ gnc_split_register_save_date_cell (BasicCell * cell,
DEBUG ("DATE: %s", value ? value : "(null)");
- gnc_date_cell_get_date ((DateCell *) cell, &cell_time);
+ gnc_date_cell_get_date ((DateCell *) cell, &cell_time, TRUE);
/* commit any pending changes */
gnc_date_cell_commit ((DateCell *) cell);
@@ -103,7 +103,7 @@ gnc_split_register_save_due_date_cell (BasicCell * cell,
/* commit any pending changes */
gnc_date_cell_commit ((DateCell *) cell);
DEBUG ("DATE: %s", value ? value : "(null)");
- gnc_date_cell_get_date ((DateCell *) cell, &time);
+ gnc_date_cell_get_date ((DateCell *) cell, &time, TRUE);
xaccTransSetDateDue (sd->trans, time);
}
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 5d1eb78..f37dcd8 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -1385,7 +1385,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
BasicCell *cell;
time64 time;
cell = gnc_table_layout_get_cell (reg->table->layout, DATE_CELL);
- gnc_date_cell_get_date ((DateCell *) cell, &time);
+ gnc_date_cell_get_date ((DateCell *) cell, &time, TRUE);
xaccTransSetDatePostedSecsNormalized(trans, time);
}
@@ -2085,7 +2085,7 @@ record_price (SplitRegister *reg, Account *account, gnc_numeric value,
*/
if (gnc_split_reg_has_rate_cell (reg->type))
return;
- gnc_date_cell_get_date ((DateCell*)cell, &time);
+ gnc_date_cell_get_date ((DateCell*)cell, &time, TRUE);
price = gnc_pricedb_lookup_day_t64 (pricedb, comm, curr, time);
if (gnc_commodity_equiv (comm, gnc_price_get_currency (price)))
swap = TRUE;
diff --git a/gnucash/register/register-core/datecell.h b/gnucash/register/register-core/datecell.h
index e3ce703..709b7bc 100644
--- a/gnucash/register/register-core/datecell.h
+++ b/gnucash/register/register-core/datecell.h
@@ -123,8 +123,9 @@ void gnc_date_cell_commit (DateCell *cell);
/** Set a time64 to the value in the DateCell.
* @param cell The DateCell
* @param time A time64* to which the function will write the time.
+ * @param warn Whether to warn of parse errors or silently change to a valid one.
*/
-void gnc_date_cell_get_date (DateCell *cell, time64 *time);
+void gnc_date_cell_get_date (DateCell *cell, time64 *time, gboolean warn);
/** Set a GDate to the value in the DateCell.
* @param cell The DateCell
diff --git a/gnucash/register/register-gnome/datecell-gnome.c b/gnucash/register/register-gnome/datecell-gnome.c
index f38374c..3b0399b 100644
--- a/gnucash/register/register-gnome/datecell-gnome.c
+++ b/gnucash/register/register-gnome/datecell-gnome.c
@@ -710,7 +710,7 @@ gnc_date_cell_leave (BasicCell *bcell)
box->calendar_popped = FALSE;
/* Refresh the date to expand any shortcuts. */
- gnc_date_cell_get_date ((DateCell *)bcell, &time);
+ gnc_date_cell_get_date ((DateCell *)bcell, &time, TRUE);
gnc_date_cell_set_value_secs ((DateCell *)bcell, time);
}
@@ -731,13 +731,13 @@ gnc_date_cell_get_date_gdate (DateCell *cell, GDate *date)
}
void
-gnc_date_cell_get_date (DateCell *cell, time64 *time)
+gnc_date_cell_get_date (DateCell *cell, time64 *time, gboolean warn)
{
PopBox *box = cell->cell.gui_private;
if (!cell || !time)
return;
- gnc_parse_date (&(box->date), cell->cell.value, TRUE);
+ gnc_parse_date (&(box->date), cell->cell.value, warn);
*time = gnc_mktime (&box->date);
}
commit dd49756f4ebdbdb9e9d57f089206dc1a0068e278
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Aug 22 20:35:54 2018 +0100
Bug 796813 - Date validation inconsistent
Change gnc_split_register_save_date_cell function and the equivalent one
in gncEntryLedgerModel to use time64 version of gnc_date_cell_get_date
which includes the warning for dates out of range.
diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index a409b55..574a480 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -1008,15 +1008,17 @@ static void gnc_entry_ledger_save_cells (gpointer save_data,
ENTRY_DATE_CELL, TRUE))
{
BasicCell *cell;
- GDate date;
+ time64 cell_time;
cell = gnc_table_layout_get_cell (ledger->table->layout, ENTRY_DATE_CELL);
+ gnc_date_cell_get_date ((DateCell *) cell, &cell_time);
+
/* commit any pending changes */
gnc_date_cell_commit ((DateCell *) cell);
- gnc_date_cell_get_date_gdate ((DateCell *) cell, &date);
- gncEntrySetDateGDate (entry, &date);
+ /* Note use of time64CanonicalDayTime to set time part to midday */
+ gncEntrySetDate (entry, time64CanonicalDayTime(cell_time));
}
if (gnc_table_layout_get_cell_changed (ledger->table->layout,
diff --git a/gnucash/register/ledger-core/split-register-model-save.c b/gnucash/register/ledger-core/split-register-model-save.c
index e785827..f0f2ccf 100644
--- a/gnucash/register/ledger-core/split-register-model-save.c
+++ b/gnucash/register/ledger-core/split-register-model-save.c
@@ -59,20 +59,20 @@ gnc_split_register_save_date_cell (BasicCell * cell,
{
SRSaveData *sd = save_data;
const char *value;
- GDate gdate;
+ time64 cell_time;
g_return_if_fail (gnc_basic_cell_has_name (cell, DATE_CELL));
value = gnc_basic_cell_get_value (cell);
- /* commit any pending changes */
- gnc_date_cell_commit ((DateCell *) cell);
-
DEBUG ("DATE: %s", value ? value : "(null)");
- gnc_date_cell_get_date_gdate ((DateCell *) cell, &gdate);
+ gnc_date_cell_get_date ((DateCell *) cell, &cell_time);
+
+ /* commit any pending changes */
+ gnc_date_cell_commit ((DateCell *) cell);
- xaccTransSetDatePostedGDate (sd->trans, gdate);
+ xaccTransSetDatePostedSecsNormalized (sd->trans, cell_time);
}
static void
commit 4a3c6f8f8594e1ec12208dfbb6b26d0f415c0a45
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Aug 17 11:11:38 2018 +0100
Change saving to .gcm and Kvp for GNC_FEATURE_REG_SORT_FILTER
For the LD_GL save the filter and sort settings to the .gcm always.
For the rest, keep saving the filter and sort settings to kvp only
when the GNC_FEATURE_REG_SORT_FILTER is not set, if set then save
only to the .gcm file. This will be set on first use in version
4.0 where a conversion will be run to only use the .gcm meta file.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 24a3953..bc7cda6 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -62,6 +62,7 @@
#include "gnc-date-edit.h"
#include "gnc-engine.h"
#include "gnc-event.h"
+#include "gnc-features.h"
#include "gnc-gnome-utils.h"
#include "gnc-gobject-utils.h"
#include "gnc-gui-query.h"
@@ -1771,27 +1772,15 @@ gnc_plugin_page_register_get_tab_color (GncPluginPage *plugin_page)
return g_strdup(color ? color : "Not Set");
}
-static gchar *
-gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
+static const gchar *
+gnc_plugin_page_register_get_filter_gcm (Account *leader)
{
- GncPluginPageRegisterPrivate *priv;
- GNCLedgerDisplayType ledger_type;
- GNCLedgerDisplay *ld;
- Account *leader;
- const char* filter = NULL;
-
GKeyFile *state_file = gnc_state_get_current();
gchar *state_section;
gchar *filter_text;
gchar acct_guid[GUID_ENCODING_LENGTH + 1];
GError *error = NULL;
-
- g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
-
- priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
- ld = priv->ledger;
- ledger_type = gnc_ledger_display_type (ld);
- leader = gnc_ledger_display_leader (ld);
+ const char* filter = NULL;
// get the filter from the .gcm file
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
@@ -1799,44 +1788,52 @@ gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
filter_text = g_key_file_get_string (state_file, state_section, KEY_PAGE_FILTER, &error);
if (error)
- {
- if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
- filter = xaccAccountGetFilter (leader);
g_clear_error (&error);
- }
else
{
filter_text = g_strdelimit (filter_text, ";", ',');
filter = g_strdup (filter_text);
g_free (filter_text);
}
- return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+ g_free (state_section);
+ return filter;
}
-void
-gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter )
+static gchar *
+gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
{
GncPluginPageRegisterPrivate *priv;
+ GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
- gchar *default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+ const char* filter = NULL;
- GKeyFile *state_file = gnc_state_get_current();
- gchar *state_section;
- gchar *filter_text;
- gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
+ ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
- if (leader != NULL)
+ // load from gcm file for LD_GL or when feature is set
+ if (ledger_type == LD_GL ||
+ gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
+ filter = gnc_plugin_page_register_get_filter_gcm (leader);
+ else // load from kvp
{
- if (!filter || (g_strcmp0 (filter, default_filter) == 0))
- xaccAccountSetFilter (leader, NULL);
- else
- xaccAccountSetFilter (leader, filter);
+ if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+ filter = xaccAccountGetFilter (leader);
}
+ return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+}
+
+static void
+gnc_plugin_page_register_set_filter_gcm (Account *leader, const gchar *filter, gchar *default_filter)
+{
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar *filter_text;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
// save the filter to the .gcm file also
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
@@ -1853,31 +1850,50 @@ gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *fi
g_key_file_set_string (state_file, state_section, KEY_PAGE_FILTER, filter_text);
g_free (filter_text);
}
- g_free (default_filter);
- return;
+ g_free (state_section);
}
-static gchar *
-gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page)
+void
+gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter )
{
GncPluginPageRegisterPrivate *priv;
GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
- const char* sort_order = NULL;
+ gchar *default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+
+ priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+ ld = priv->ledger;
+ ledger_type = gnc_ledger_display_type (ld);
+ leader = gnc_ledger_display_leader (ld);
+
+ // save to gcm file for LD_GL or when feature is set
+ if (ledger_type == LD_GL ||
+ gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
+ gnc_plugin_page_register_set_filter_gcm (leader, filter, default_filter);
+ else // save to kvp
+ {
+ if (leader != NULL)
+ {
+ if (!filter || (g_strcmp0 (filter, default_filter) == 0))
+ xaccAccountSetFilter (leader, NULL);
+ else
+ xaccAccountSetFilter (leader, filter);
+ }
+ }
+ g_free (default_filter);
+ return;
+}
+static const gchar *
+gnc_plugin_page_register_get_sort_order_gcm (Account *leader)
+{
GKeyFile *state_file = gnc_state_get_current();
gchar *state_section;
gchar *sort_text;
gchar acct_guid[GUID_ENCODING_LENGTH + 1];
GError *error = NULL;
-
- g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
-
- priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
- ld = priv->ledger;
- ledger_type = gnc_ledger_display_type (ld);
- leader = gnc_ledger_display_leader (ld);
+ const char* sort_order = NULL;
// get the sort_order from the .gcm file
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
@@ -1885,41 +1901,50 @@ gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page)
sort_text = g_key_file_get_string (state_file, state_section, KEY_PAGE_SORT, &error);
if (error)
- {
- if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
- sort_order = xaccAccountGetSortOrder (leader);
g_clear_error (&error);
- }
else
{
sort_order = g_strdup (sort_text);
g_free (sort_text);
}
- return g_strdup(sort_order ? sort_order : DEFAULT_SORT_ORDER);
+ g_free (state_section);
+ return sort_order;
}
-void
-gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar *sort_order )
+static gchar *
+gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page)
{
GncPluginPageRegisterPrivate *priv;
+ GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
+ const char* sort_order = NULL;
- GKeyFile *state_file = gnc_state_get_current();
- gchar *state_section;
- gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
+ ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
- if (leader != NULL)
+ // load from gcm file for LD_GL or when feature is set
+ if (ledger_type == LD_GL ||
+ gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
+ sort_order = gnc_plugin_page_register_get_sort_order_gcm (leader);
+ else // load from kvp
{
- if (!sort_order || (g_strcmp0 (sort_order, DEFAULT_SORT_ORDER) == 0))
- xaccAccountSetSortOrder (leader, NULL);
- else
- xaccAccountSetSortOrder (leader, sort_order);
+ if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+ sort_order = xaccAccountGetSortOrder (leader);
}
+ return g_strdup(sort_order ? sort_order : DEFAULT_SORT_ORDER);
+}
+
+static void
+gnc_plugin_page_register_set_sort_order_gcm (Account *leader, const gchar *sort_order )
+{
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
// save sort_order to the .gcm file also
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
@@ -1932,61 +1957,93 @@ gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar
else
g_key_file_set_string (state_file, state_section, KEY_PAGE_SORT, sort_order);
- return;
+ g_free (state_section);
}
-
-static gboolean
-gnc_plugin_page_register_get_sort_reversed (GncPluginPage *plugin_page)
+void
+gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar *sort_order )
{
GncPluginPageRegisterPrivate *priv;
GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
- gboolean sort_reversed = FALSE;
-
- GKeyFile *state_file = gnc_state_get_current();
- gchar *state_section;
- gchar acct_guid[GUID_ENCODING_LENGTH + 1];
- GError *error = NULL;
-
- g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), FALSE);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
+ // save to gcm file for LD_GL or when feature is set
+ if (ledger_type == LD_GL ||
+ gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
+ gnc_plugin_page_register_set_sort_order_gcm (leader, sort_order);
+ else // save to kvp
+ {
+ if (leader != NULL)
+ {
+ if (!sort_order || (g_strcmp0 (sort_order, DEFAULT_SORT_ORDER) == 0))
+ xaccAccountSetSortOrder (leader, NULL);
+ else
+ xaccAccountSetSortOrder (leader, sort_order);
+ }
+ }
+ return;
+}
+
+static gboolean
+gnc_plugin_page_register_get_sort_reversed_gcm (Account *leader)
+{
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ GError *error = NULL;
+ gboolean sort_reversed = FALSE;
+
// get the sort_reversed from the .gcm file
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
sort_reversed = g_key_file_get_boolean (state_file, state_section, KEY_PAGE_SORT_REV, &error);
if (error)
- {
- if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
- sort_reversed = xaccAccountGetSortReversed (leader);
g_clear_error (&error);
- }
+
+ g_free (state_section);
return sort_reversed;
}
-void
-gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean reverse_order)
+static gboolean
+gnc_plugin_page_register_get_sort_reversed (GncPluginPage *plugin_page)
{
GncPluginPageRegisterPrivate *priv;
+ GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
+ gboolean sort_reversed = FALSE;
- GKeyFile *state_file = gnc_state_get_current();
- gchar *state_section;
- gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), FALSE);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
+ ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
- if (leader != NULL)
- xaccAccountSetSortReversed (leader, reverse_order);
+ // load from gcm file for LD_GL or when feature is set
+ if (ledger_type == LD_GL ||
+ gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
+ sort_reversed = gnc_plugin_page_register_get_sort_reversed_gcm (leader);
+ else // load from kvp
+ {
+ if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+ sort_reversed = xaccAccountGetSortReversed (leader);
+ }
+ return sort_reversed;
+}
+
+static void
+gnc_plugin_page_register_set_sort_reversed_gcm (Account *leader, gboolean reverse_order)
+{
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
// save reverse_order to the .gcm file also
guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
@@ -1999,6 +2056,31 @@ gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean
else
g_key_file_set_boolean (state_file, state_section, KEY_PAGE_SORT_REV, reverse_order);
+ g_free (state_section);
+}
+
+void
+gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean reverse_order)
+{
+ GncPluginPageRegisterPrivate *priv;
+ GNCLedgerDisplayType ledger_type;
+ GNCLedgerDisplay *ld;
+ Account *leader;
+
+ priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
+ ld = priv->ledger;
+ ledger_type = gnc_ledger_display_type (ld);
+ leader = gnc_ledger_display_leader (ld);
+
+ // save to gcm file for LD_GL or when feature is set
+ if (ledger_type == LD_GL ||
+ gnc_features_check_used (gnc_get_current_book (), GNC_FEATURE_REG_SORT_FILTER))
+ gnc_plugin_page_register_set_sort_reversed_gcm (leader, reverse_order);
+ else // save to kvp
+ {
+ if (leader != NULL)
+ xaccAccountSetSortReversed (leader, reverse_order);
+ }
return;
}
commit 995e6b0f956a876a3c4f3b8a60b09dd94a5cf81b
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Aug 16 11:23:30 2018 +0100
White space and tabs changed in search-date.c
diff --git a/gnucash/gnome-search/search-date.c b/gnucash/gnome-search/search-date.c
index 02d9573..364c7ec 100644
--- a/gnucash/gnome-search/search-date.c
+++ b/gnucash/gnome-search/search-date.c
@@ -39,14 +39,14 @@
static void editable_enters (GNCSearchCoreType *fe);
static void grab_focus (GNCSearchCoreType *fe);
-static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
+static GNCSearchCoreType *gncs_clone (GNCSearchCoreType *fe);
static gboolean gncs_validate (GNCSearchCoreType *fe);
-static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
+static GtkWidget *gncs_get_widget (GNCSearchCoreType *fe);
static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);
-static void gnc_search_date_class_init (GNCSearchDateClass *klass);
-static void gnc_search_date_init (GNCSearchDate *gspaper);
-static void gnc_search_date_finalize (GObject *obj);
+static void gnc_search_date_class_init (GNCSearchDateClass *klass);
+static void gnc_search_date_init (GNCSearchDate *gspaper);
+static void gnc_search_date_finalize (GObject *obj);
typedef struct _GNCSearchDatePrivate GNCSearchDatePrivate;
@@ -69,14 +69,14 @@ gnc_search_date_get_type (void)
{
GTypeInfo type_info =
{
- sizeof(GNCSearchDateClass), /* class_size */
- NULL, /* base_init */
- NULL, /* base_finalize */
+ sizeof(GNCSearchDateClass), /* class_size */
+ NULL, /* base_init */
+ NULL, /* base_finalize */
(GClassInitFunc)gnc_search_date_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof(GNCSearchDate), /* */
- 0, /* n_preallocs */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof(GNCSearchDate), /* */
+ 0, /* n_preallocs */
(GInstanceInitFunc)gnc_search_date_init,
};
commit 39b24325d92b080ef69e4f18e7f5d03d398deafe
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Aug 16 11:22:44 2018 +0100
Bug 796725 - 4 of 6 Date Posted options fail to return
matching transactions.
gnc_date_edit_get_date returns the time64 value set to 00:00:00 for the
day entered so for the LTE and GT options gnc_date_edit_get_date_end
needs to be used for 23:59:59. For finding transactions on the date,
the use of QOF_DATE_MATCH_DAY needs to be used.
diff --git a/gnucash/gnome-search/search-date.c b/gnucash/gnome-search/search-date.c
index 9523c3f..02d9573 100644
--- a/gnucash/gnome-search/search-date.c
+++ b/gnucash/gnome-search/search-date.c
@@ -179,9 +179,22 @@ gncs_validate (GNCSearchCoreType *fe)
}
static void
+gnc_search_date_set_date_from_edit (GNCSearchDate *fe, GNCDateEdit *de)
+{
+ /* The gnc_date_edit_get_date function returns a value set to the
+ * start of the day 00:00:00, use gnc_date_edit_get_date_end to get
+ * value for day end 23:59:59 for LessThanEqual and GreaterThan */
+
+ if (fe->how == QOF_COMPARE_LTE || fe->how == QOF_COMPARE_GT)
+ fe->tt = gnc_date_edit_get_date_end (de);
+ else
+ fe->tt = gnc_date_edit_get_date (de);
+}
+
+static void
date_changed (GNCDateEdit *date_edit, GNCSearchDate *fe)
{
- fe->tt = gnc_date_edit_get_date (date_edit);
+ gnc_search_date_set_date_from_edit (fe, date_edit);
}
static GtkWidget *
@@ -272,9 +285,12 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe)
/* Make sure we actually use the currently-entered date */
priv = _PRIVATE(fi);
if (priv->entry)
- fi->tt = gnc_date_edit_get_date (GNC_DATE_EDIT (priv->entry));
+ gnc_search_date_set_date_from_edit (fi, GNC_DATE_EDIT (priv->entry));
- return qof_query_date_predicate (fi->how, QOF_DATE_MATCH_NORMAL, fi->tt);
+ if (fi->how == QOF_COMPARE_EQUAL || fi->how == QOF_COMPARE_NEQ)
+ return qof_query_date_predicate (fi->how, QOF_DATE_MATCH_DAY, fi->tt);
+ else
+ return qof_query_date_predicate (fi->how, QOF_DATE_MATCH_NORMAL, fi->tt);
}
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
commit 54a5097c60496d005f497b2315f063734d8bcd9f
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sat Aug 11 18:35:33 2018 +0200
Bug 796777 - CVE-2008-1391: Integer overflow in included strfmon function
We only used strfmon in one source file to generate three fixed format
strings. Instead of updating to a newer strfmon in borrowed I have
chosen to reimplement the string formatters for these strings in C++.
Note this is *not* a full c++ conversion of the full functionality
of assistant-loan. Only the string parsing has been redone.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42a23b6..b2fcffb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -732,7 +732,6 @@ set (HAVE_PTHREAD_PRIO_INHERIT 1)
set (HAVE_SCANF_LLD 1)
set (HAVE_SETENV 1)
set (HAVE_STPCPY 1)
-set (HAVE_STRFMON 1)
set (HAVE_STRPTIME 1)
set (HAVE_STRUCT_TM_GMTOFF 1)
set (HAVE_TIMEGM 1)
diff --git a/borrowed/libc/CMakeLists.txt b/borrowed/libc/CMakeLists.txt
index c88f8d1..f89cfe1 100644
--- a/borrowed/libc/CMakeLists.txt
+++ b/borrowed/libc/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(libc_SOURCES libc-missing-noop.c setenv.c strfmon.c strptime.c)
-set(libc_HEADERS pow.h setenv.h strfmon.h strptime.h)
+set(libc_SOURCES libc-missing-noop.c setenv.c strptime.c)
+set(libc_HEADERS pow.h setenv.h strptime.h)
-set_dist_list(libc_DIST CMakeLists.txt ${libc_SOURCES} ${libc_HEADERS})
\ No newline at end of file
+set_dist_list(libc_DIST CMakeLists.txt ${libc_SOURCES} ${libc_HEADERS})
diff --git a/borrowed/libc/strfmon.c b/borrowed/libc/strfmon.c
deleted file mode 100644
index d5ce44f..0000000
--- a/borrowed/libc/strfmon.c
+++ /dev/null
@@ -1,619 +0,0 @@
-/*-
- * Copyright (c) 2001 Alexey Zelkin <phantom at FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-
-#include <sys/types.h>
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <locale.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "strfmon.h"
-
-/* internal flags */
-#define NEED_GROUPING 0x01 /* print digits grouped (default) */
-#define SIGN_POSN_USED 0x02 /* '+' or '(' usage flag */
-#define LOCALE_POSN 0x04 /* use locale defined +/- (default) */
-#define PARENTH_POSN 0x08 /* enclose negative amount in () */
-#define SUPRESS_CURR_SYMBOL 0x10 /* suppress the currency from output */
-#define LEFT_JUSTIFY 0x20 /* left justify */
-#define USE_INTL_CURRENCY 0x40 /* use international currency symbol */
-#define IS_NEGATIVE 0x80 /* is argument value negative ? */
-
-/* internal macros */
-#define PRINT(CH) do { \
- if (dst >= s + maxsize) \
- goto e2big_error; \
- *dst++ = CH; \
-} while (0)
-
-#define PRINTS(STR) do { \
- char *tmps = STR; \
- while (*tmps != '\0') \
- PRINT(*tmps++); \
-} while (0)
-
-#define GET_NUMBER(VAR) do { \
- VAR = 0; \
- while (isdigit((unsigned char)*fmt)) { \
- VAR *= 10; \
- VAR += *fmt - '0'; \
- fmt++; \
- } \
-} while (0)
-
-#define GRPCPY(howmany) do { \
- int i = howmany; \
- while (i-- > 0) { \
- avalue_size--; \
- *--bufend = *(avalue+avalue_size+padded); \
- } \
-} while (0)
-
-#define GRPSEP do { \
- *--bufend = thousands_sep; \
- groups++; \
-} while (0)
-
-static void __setup_vars(int, char *, char *, char *, char **);
-static int __calc_left_pad(int, char *);
-static char *__format_grouped_double(double, int *, int, int, int);
-
-ssize_t
-strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
- ...)
-{
- va_list ap;
- char *dst; /* output destination pointer */
- const char *fmt; /* current format position pointer */
- struct lconv *lc; /* pointer to lconv structure */
- char *asciivalue; /* formatted double pointer */
-
- int flags; /* formatting options */
- int pad_char; /* padding character */
- int pad_size; /* pad size */
- int width; /* field width */
- int left_prec; /* left precision */
- int right_prec; /* right precision */
- double value; /* just value */
- char space_char = ' '; /* space after currency */
-
- char cs_precedes, /* values gathered from struct lconv */
- sep_by_space,
- sign_posn,
- *signstr,
- *currency_symbol;
-
- char *tmpptr; /* temporary vars */
- int sverrno;
-
- va_start(ap, format);
-
- lc = localeconv();
- dst = s;
- fmt = format;
- asciivalue = NULL;
- currency_symbol = NULL;
- pad_size = 0;
-
- while (*fmt) {
- /* pass nonformating characters AS IS */
- if (*fmt != '%')
- goto literal;
-
- /* '%' found ! */
-
- /* "%%" mean just '%' */
- if (*(fmt+1) == '%') {
- fmt++;
- literal:
- PRINT(*fmt++);
- continue;
- }
-
- /* set up initial values */
- flags = (NEED_GROUPING|LOCALE_POSN);
- pad_char = ' '; /* padding character is "space" */
- left_prec = -1; /* no left precision specified */
- right_prec = -1; /* no right precision specified */
- width = -1; /* no width specified */
- value = 0; /* we have no value to print now */
-
- /* Flags */
- while (1) {
- switch (*++fmt) {
- case '=': /* fill character */
- pad_char = *++fmt;
- if (pad_char == '\0')
- goto format_error;
- continue;
- case '^': /* not group currency */
- flags &= ~(NEED_GROUPING);
- continue;
- case '+': /* use locale defined signs */
- if (flags & SIGN_POSN_USED)
- goto format_error;
- flags |= (SIGN_POSN_USED|LOCALE_POSN);
- continue;
- case '(': /* enclose negatives with () */
- if (flags & SIGN_POSN_USED)
- goto format_error;
- flags |= (SIGN_POSN_USED|PARENTH_POSN);
- continue;
- case '!': /* suppress currency symbol */
- flags |= SUPRESS_CURR_SYMBOL;
- continue;
- case '-': /* alignment (left) */
- flags |= LEFT_JUSTIFY;
- continue;
- default:
- break;
- }
- break;
- }
-
- /* field Width */
- if (isdigit((unsigned char)*fmt)) {
- GET_NUMBER(width);
- /* Do we have enough space to put number with
- * required width ?
- */
- if (dst + width >= s + maxsize)
- goto e2big_error;
- }
-
- /* Left precision */
- if (*fmt == '#') {
- if (!isdigit((unsigned char)*++fmt))
- goto format_error;
- GET_NUMBER(left_prec);
- }
-
- /* Right precision */
- if (*fmt == '.') {
- if (!isdigit((unsigned char)*++fmt))
- goto format_error;
- GET_NUMBER(right_prec);
- }
-
- /* Conversion Characters */
- switch (*fmt++) {
- case 'i': /* use international currency format */
- flags |= USE_INTL_CURRENCY;
- break;
- case 'n': /* use national currency format */
- flags &= ~(USE_INTL_CURRENCY);
- break;
- default: /* required character is missing or
- premature EOS */
- goto format_error;
- }
-
- if (flags & USE_INTL_CURRENCY) {
- currency_symbol = strdup(lc->int_curr_symbol);
- if (currency_symbol != NULL)
- space_char = *(currency_symbol+3);
- } else
- currency_symbol = strdup(lc->currency_symbol);
-
- if (currency_symbol == NULL)
- goto end_error; /* ENOMEM. */
-
- /* value itself */
- value = va_arg(ap, double);
-
- /* detect sign */
- if (value < 0) {
- flags |= IS_NEGATIVE;
- value = -value;
- }
-
- /* fill left_prec with amount of padding chars */
- if (left_prec >= 0) {
- pad_size = __calc_left_pad((flags ^ IS_NEGATIVE),
- currency_symbol) -
- __calc_left_pad(flags, currency_symbol);
- if (pad_size < 0)
- pad_size = 0;
- }
-
- asciivalue = __format_grouped_double(value, &flags,
- left_prec, right_prec, pad_char);
- if (asciivalue == NULL)
- goto end_error; /* errno already set */
- /* to ENOMEM by malloc() */
-
- /* set some variables for later use */
- __setup_vars(flags, &cs_precedes, &sep_by_space,
- &sign_posn, &signstr);
-
- /*
- * Description of some LC_MONETARY's values:
- *
- * p_cs_precedes & n_cs_precedes
- *
- * = 1 - $currency_symbol precedes the value
- * for a monetary quantity with a non-negative value
- * = 0 - symbol succeeds the value
- *
- * p_sep_by_space & n_sep_by_space
- *
- * = 0 - no space separates $currency_symbol
- * from the value for a monetary quantity with a
- * non-negative value
- * = 1 - space separates the symbol from the value
- * = 2 - space separates the symbol and the sign string,
- * if adjacent.
- *
- * p_sign_posn & n_sign_posn
- *
- * = 0 - parentheses enclose the quantity and the
- * $currency_symbol
- * = 1 - the sign string precedes the quantity and the
- * $currency_symbol
- * = 2 - the sign string succeeds the quantity and the
- * $currency_symbol
- * = 3 - the sign string precedes the $currency_symbol
- * = 4 - the sign string succeeds the $currency_symbol
- *
- */
-
- tmpptr = dst;
-
- while (pad_size-- > 0)
- PRINT(' ');
-
- if (sign_posn == 0 && (flags & IS_NEGATIVE))
- PRINT('(');
-
- if (cs_precedes == 1) {
- if (sign_posn == 1 || sign_posn == 3) {
- PRINTS(signstr);
- if (sep_by_space == 2) /* XXX: ? */
- PRINT(' ');
- }
-
- if (!(flags & SUPRESS_CURR_SYMBOL)) {
- PRINTS(currency_symbol);
-
- if (sign_posn == 4) {
- if (sep_by_space == 2)
- PRINT(space_char);
- PRINTS(signstr);
- if (sep_by_space == 1)
- PRINT(' ');
- } else if (sep_by_space == 1)
- PRINT(space_char);
- }
- } else if (sign_posn == 1)
- PRINTS(signstr);
-
- PRINTS(asciivalue);
-
- if (cs_precedes == 0) {
- if (sign_posn == 3) {
- if (sep_by_space == 1)
- PRINT(' ');
- PRINTS(signstr);
- }
-
- if (!(flags & SUPRESS_CURR_SYMBOL)) {
- if ((sign_posn == 3 && sep_by_space == 2)
- || (sep_by_space == 1
- && (sign_posn == 0
- || sign_posn == 1
- || sign_posn == 2
- || sign_posn == 4)))
- PRINT(space_char);
- PRINTS(currency_symbol); /* XXX: len */
- if (sign_posn == 4) {
- if (sep_by_space == 2)
- PRINT(' ');
- PRINTS(signstr);
- }
- }
- }
-
- if (sign_posn == 2) {
- if (sep_by_space == 2)
- PRINT(' ');
- PRINTS(signstr);
- }
-
- if (sign_posn == 0 && (flags & IS_NEGATIVE))
- PRINT(')');
-
- if (dst - tmpptr < width) {
- if (flags & LEFT_JUSTIFY) {
- while (dst - tmpptr < width)
- PRINT(' ');
- } else {
- pad_size = dst-tmpptr;
- memmove(tmpptr + width-pad_size, tmpptr,
- pad_size);
- memset(tmpptr, ' ', width-pad_size);
- dst += width-pad_size;
- }
- }
- }
-
- PRINT('\0');
- va_end(ap);
- free(asciivalue);
- free(currency_symbol);
- return (dst - s - 1); /* return size of put data except trailing '\0' */
-
-e2big_error:
- errno = E2BIG;
- goto end_error;
-
-format_error:
- errno = EINVAL;
-
-end_error:
- sverrno = errno;
- if (asciivalue != NULL)
- free(asciivalue);
- if (currency_symbol != NULL)
- free(currency_symbol);
- errno = sverrno;
- va_end(ap);
- return (-1);
-}
-
-static void
-__setup_vars(int flags, char *cs_precedes, char *sep_by_space,
- char *sign_posn, char **signstr) {
-
- struct lconv *lc = localeconv();
-
-#if defined _WIN32 && !defined __cygwin__
- if (flags & IS_NEGATIVE) {
-#else
- if ((flags & IS_NEGATIVE) && (flags & USE_INTL_CURRENCY)) {
- *cs_precedes = lc->int_n_cs_precedes;
- *sep_by_space = lc->int_n_sep_by_space;
- *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_n_sign_posn;
- *signstr = (lc->negative_sign == '\0') ? "-"
- : lc->negative_sign;
- } else if (flags & USE_INTL_CURRENCY) {
- *cs_precedes = lc->int_p_cs_precedes;
- *sep_by_space = lc->int_p_sep_by_space;
- *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->int_p_sign_posn;
- *signstr = lc->positive_sign;
- } else if (flags & IS_NEGATIVE) {
-#endif
- *cs_precedes = lc->n_cs_precedes;
- *sep_by_space = lc->n_sep_by_space;
- *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->n_sign_posn;
- *signstr = (lc->negative_sign == NULL) ? "-"
- : lc->negative_sign;
- } else {
- *cs_precedes = lc->p_cs_precedes;
- *sep_by_space = lc->p_sep_by_space;
- *sign_posn = (flags & PARENTH_POSN) ? 0 : lc->p_sign_posn;
- *signstr = lc->positive_sign;
- }
-
- /* Set default values for unspecified information. */
- if (*cs_precedes != 0)
- *cs_precedes = 1;
- if (*sep_by_space == CHAR_MAX)
- *sep_by_space = 0;
- if (*sign_posn == CHAR_MAX)
- *sign_posn = 0;
-}
-
-static int
-__calc_left_pad(int flags, char *cur_symb) {
-
- char cs_precedes, sep_by_space, sign_posn, *signstr;
- int left_chars = 0;
-
- __setup_vars(flags, &cs_precedes, &sep_by_space, &sign_posn, &signstr);
-
- if (cs_precedes != 0) {
- left_chars += strlen(cur_symb);
- if (sep_by_space != 0)
- left_chars++;
- }
-
- switch (sign_posn) {
- case 1:
- left_chars += strlen(signstr);
- break;
- case 3:
- case 4:
- if (cs_precedes != 0)
- left_chars += strlen(signstr);
- }
- return (left_chars);
-}
-
-static int
-get_groups(int size, char *grouping) {
-
- int chars = 0;
-
- if (*grouping == CHAR_MAX || *grouping <= 0) /* no grouping ? */
- return (0);
-
- while (size > (int)*grouping) {
- chars++;
- size -= (int)*grouping++;
- /* no more grouping ? */
- if (*grouping == CHAR_MAX)
- break;
- /* rest grouping with same value ? */
- if (*grouping == 0) {
- chars += (size - 1) / *(grouping - 1);
- break;
- }
- }
- return (chars);
-}
-
-#define BUFFSIZE 255
-
-/* convert double to ASCII */
-static char *
-__format_grouped_double(double value, int *flags,
- int left_prec, int right_prec, int pad_char) {
-
- char *rslt;
- char *avalue;
- int avalue_size;
- char fmt[32];
-
- size_t bufsize;
- char *bufend;
-
- int padded;
-
- struct lconv *lc = localeconv();
- char *grouping;
- char decimal_point;
- char thousands_sep;
-
- int groups = 0;
-
- grouping = lc->mon_grouping;
- decimal_point = *lc->mon_decimal_point;
- if (decimal_point == '\0')
- decimal_point = *lc->decimal_point;
- thousands_sep = *lc->mon_thousands_sep;
- if (thousands_sep == '\0')
- thousands_sep = *lc->thousands_sep;
-
- /* fill left_prec with default value */
- if (left_prec == -1)
- left_prec = 0;
-
- /* fill right_prec with default value */
- if (right_prec == -1) {
- if (*flags & USE_INTL_CURRENCY)
- right_prec = lc->int_frac_digits;
- else
- right_prec = lc->frac_digits;
-
- if (right_prec == CHAR_MAX) /* POSIX locale ? */
- right_prec = 2;
- }
-
- if (*flags & NEED_GROUPING)
- left_prec += get_groups(left_prec, grouping);
-
- /* convert to string */
- snprintf(fmt, sizeof(fmt), "%%%d.%df", left_prec + right_prec + 1,
- right_prec);
- avalue = malloc (BUFFSIZE);
- if (!avalue)
- return (NULL);
- avalue_size = snprintf(avalue, BUFFSIZE, fmt, value);
- if (BUFFSIZE < avalue_size)
- {
- avalue = realloc (avalue, avalue_size + 1);
- if (!avalue)
- return (NULL);
- avalue_size = sprintf(avalue, fmt, value);
- }
- if (avalue_size < 0)
- return (NULL);
-
- /* make sure that we've enough space for result string */
- bufsize = strlen(avalue)*2+1;
- rslt = malloc(bufsize);
- if (rslt == NULL) {
- free(avalue);
- return (NULL);
- }
- memset(rslt, 0, bufsize);
- bufend = rslt + bufsize - 1; /* reserve space for trailing '\0' */
-
- /* skip spaces at beginning */
- padded = 0;
- while (avalue[padded] == ' ') {
- padded++;
- avalue_size--;
- }
-
- if (right_prec > 0) {
- bufend -= right_prec;
- memcpy(bufend, avalue + avalue_size+padded-right_prec,
- right_prec);
- *--bufend = decimal_point;
- avalue_size -= (right_prec + 1);
- }
-
- if ((*flags & NEED_GROUPING) &&
- thousands_sep != '\0' && /* XXX: need investigation */
- *grouping != CHAR_MAX &&
- *grouping > 0) {
- while (avalue_size > (int)*grouping) {
- GRPCPY(*grouping);
- GRPSEP;
- grouping++;
-
- /* no more grouping ? */
- if (*grouping == CHAR_MAX)
- break;
-
- /* rest grouping with same value ? */
- if (*grouping == 0) {
- grouping--;
- while (avalue_size > *grouping) {
- GRPCPY(*grouping);
- GRPSEP;
- }
- }
- }
- if (avalue_size != 0)
- GRPCPY(avalue_size);
- padded -= groups;
-
- } else {
- bufend -= avalue_size;
- memcpy(bufend, avalue+padded, avalue_size);
- if (right_prec == 0)
- padded--; /* decrease assumed $decimal_point */
- }
-
- /* do padding with pad_char */
- if (padded > 0) {
- bufend -= padded;
- memset(bufend, pad_char, padded);
- }
-
- bufsize = bufsize - (bufend - rslt) + 1;
- memmove(rslt, bufend, bufsize);
- free(avalue);
- return (rslt);
-}
diff --git a/borrowed/libc/strfmon.h b/borrowed/libc/strfmon.h
deleted file mode 100644
index 8380450..0000000
--- a/borrowed/libc/strfmon.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*-
- * Copyright (c) 2001 Alexey Zelkin <phantom at FreeBSD.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-#ifndef __STRFMON_H__
-#define __STRFMON_H__
-
-#ifndef HAVE_STRFMON
-/*
- * Version of "strfmon()", for the benefit of OSes that don't have it.
- */
-ssize_t
-strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
- ...);
-
-#endif
-
-#endif
diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in
index 200b129..7a0cc8a 100644
--- a/common/config.h.cmake.in
+++ b/common/config.h.cmake.in
@@ -219,9 +219,6 @@
/* Define to 1 if you have the `stpcpy' function. */
#cmakedefine HAVE_STPCPY 1
-/* Define to 1 if you have the `strfmon' function. */
-#cmakedefine HAVE_STRFMON 1
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 80c165e..3e99c19 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -123,10 +123,6 @@ set (gnc_gnome_SOURCES
set_source_files_properties (${gnc_gnome_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
-if (WIN32)
- set (gnc_gnome_SOURCES ${gnc_gnome_SOURCES} ${CMAKE_SOURCE_DIR}/borrowed/libc/strfmon.c)
-endif(WIN32)
-
add_library (gnc-gnome ${gnc_gnome_SOURCES} ${gnc_gnome_noinst_HEADERS} ${SWIG_GNOME_C})
target_link_libraries(gnc-gnome gncmod-gnome-search gncmod-ledger-core gncmod-report-gnome gncmod-report-system
gncmod-register-gnome gncmod-register-core gncmod-gnome-utils gncmod-engine ${GTK3_LDFLAGS} ${GTK_MAC_LDFLAGS})
diff --git a/gnucash/gnome/assistant-loan.cpp b/gnucash/gnome/assistant-loan.cpp
index fbca2a7..00af266 100644
--- a/gnucash/gnome/assistant-loan.cpp
+++ b/gnucash/gnome/assistant-loan.cpp
@@ -47,14 +47,15 @@ extern "C"
#include "gnc-ui-util.h"
#include "gnc-frequency.h"
#include "gnc-engine.h"
-
-#ifndef HAVE_STRFMON
-# include "strfmon.h"
-#else
-# include <monetary.h>
-#endif
}
+#include <boost/locale.hpp>
+#include <string>
+#include <sstream>
+#include <iomanip>
+
+namespace bl = boost::locale;
+
#define DIALOG_LOAN_ASSISTANT_CM_CLASS "assistant-loan-setup"
static QofLogModule log_module = GNC_MOD_ASSISTANT;
@@ -2298,26 +2299,46 @@ gfloat loan_apr_to_simple_formula (gfloat rate, gfloat compounding_periods)
return (simple_rate);
}
-#define MAX_FORMULA 1024
+using boost::locale::conv::utf_to_utf;
+
+// Define a monetary facet template for printing monetary values
+// with a custom precision <prec>
+// This will be used to generate the loan formulas, which use 5 decimal places
+// for the loan percentage and 2 decimal places for all other numbers.
+
+// Note this facet is wchar_t based: some locales have non-ascii thousands
+// separators and these can't be handled by a char based moneypunct facet.
+
+template<int prec>
+struct cust_prec_punct : std::moneypunct_byname<wchar_t, false> {
+ cust_prec_punct(const char* name) : moneypunct_byname(name) {}
+ int do_frac_digits() const { return prec; }
+};
+
+// Convert a double to a string hardcoding <prec> decimal places
+template<int prec>
+std::string to_str_with_prec (const gdouble val)
+{
+ auto loc = std::locale(std::locale(""), new cust_prec_punct<prec>(""));
+ std::wstringstream valstr;
+ valstr.imbue(loc);
+ valstr << std::put_money(val * pow(10, prec));
+ return utf_to_utf<char>(valstr.str());
+}
static
void
-loan_get_formula_internal( LoanAssistantData *ldd, GString *gstr, const gchar* tpl )
+loan_get_formula_internal( LoanAssistantData *ldd, GString *gstr, const gchar *tpl )
{
- gint rate_case;
- gfloat pass_thru_rate, period_rate;
- gfloat periods;
- gfloat principal;
- gchar formula[MAX_FORMULA];
-
g_assert( ldd != NULL );
g_assert( gstr != NULL );
- pass_thru_rate = ldd->ld.interestRate / 100;
- periods = (ldd->ld.numPer * (ldd->ld.perSize == GNC_MONTHS ? 1 : 12)) * 1.;
- principal = gnc_numeric_to_double(ldd->ld.principal);
+ gdouble pass_thru_rate = ldd->ld.interestRate / 100.0;
+ gdouble periods = (ldd->ld.numPer * (ldd->ld.perSize == GNC_MONTHS ? 1 : 12)) * 1.;
+ auto principal = gnc_numeric_to_double(ldd->ld.principal);
- rate_case = ldd->ld.rateType;
+ gdouble period_rate;
+ auto rate_case = ldd->ld.rateType;
switch (rate_case)
{
case GNC_IRATE_SIMPLE:
@@ -2343,17 +2364,29 @@ loan_get_formula_internal( LoanAssistantData *ldd, GString *gstr, const gchar* t
break;
}
- if (0 < strfmon (formula, MAX_FORMULA, tpl,
- period_rate, 12.0, periods, principal ))
- g_string_append (gstr, formula);
+ auto period_rate_str = to_str_with_prec<5> (period_rate);
+ auto period_base_str = to_str_with_prec<2> (12.0);
+ auto periods_str = to_str_with_prec<2> (periods);
+ auto principal_str = to_str_with_prec<2> (principal);
+
+ // Using boost::locale::format here to merge a template
+ // with plain strings. We can't use bl::format directly on the double
+ // values as it will use numeric punctuation instead of monetary punctuation.
+ // This is different in several locales (like nl_BE and ru_RU)
+ // and our parsing function does expect monetary punctuation to work properly.
+ // So instead of bl::format we could also have used boost::format.
+ // However at the time of this writing that sublibrary is not yet a requirement
+ // for gnucash. So I stuck with bl::format, which is.
+ auto formula = (bl::format (tpl) % period_rate_str %
+ period_base_str % periods_str % principal_str).str();
+ g_string_append (gstr, formula.c_str());
}
-
static
void
loan_get_pmt_formula( LoanAssistantData *ldd, GString *gstr )
{
- loan_get_formula_internal (ldd, gstr, "pmt( %!.5i / %!0.2i : %!0.2i : %!0.2i : 0 : 0 )");
+ loan_get_formula_internal (ldd, gstr, "pmt( {1} / {2} : {3} : {4} : 0 : 0 )");
}
@@ -2361,7 +2394,7 @@ static
void
loan_get_ppmt_formula( LoanAssistantData *ldd, GString *gstr )
{
- loan_get_formula_internal (ldd, gstr, "ppmt( %!.5i / %!0.2i : i : %!0.2i : %!0.2i : 0 : 0 )");
+ loan_get_formula_internal (ldd, gstr, "ppmt( {1} / {2} : i : {3} : {4} : 0 : 0 )");
}
@@ -2369,7 +2402,7 @@ static
void
loan_get_ipmt_formula( LoanAssistantData *ldd, GString *gstr )
{
- loan_get_formula_internal (ldd, gstr, "ipmt( %!.5i / %!0.2i : i : %!0.2i : %!0.2i : 0 : 0 )");
+ loan_get_formula_internal (ldd, gstr, "ipmt( {1} / {2} : i : {3} : {4} : 0 : 0 )");
}
/******************* Scheduled Transaction Functions ********************/
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 06f9c4d..9f051b9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -36,7 +36,6 @@ borrowed/gwengui-gtk3/w_vspacer.c
borrowed/jenny/jenny.c
borrowed/libc/libc-missing-noop.c
borrowed/libc/setenv.c
-borrowed/libc/strfmon.c
borrowed/libc/strptime.c
doc/tip_of_the_day.list.c
gnucash/gnome/assistant-acct-period.c
commit 34cb4925a4be639e8d3e211ce2020d2190d5a41d
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sat Aug 11 15:33:19 2018 +0200
Compile assistant-loan as c++
Fix only c++ compatibility issues, which primarily boils down
to dealing with stricter type checking.
diff --git a/gnucash/gnome/CMakeLists.txt b/gnucash/gnome/CMakeLists.txt
index 44bd887..80c165e 100644
--- a/gnucash/gnome/CMakeLists.txt
+++ b/gnucash/gnome/CMakeLists.txt
@@ -64,7 +64,7 @@ gnc_add_swig_guile_command (swig-gnome-c
set (gnc_gnome_SOURCES
assistant-acct-period.c
assistant-hierarchy.c
- assistant-loan.c
+ assistant-loan.cpp
assistant-stock-split.c
business-options-gnome.c
business-urls.c
diff --git a/gnucash/gnome/assistant-loan.c b/gnucash/gnome/assistant-loan.cpp
similarity index 94%
rename from gnucash/gnome/assistant-loan.c
rename to gnucash/gnome/assistant-loan.cpp
index 388af79..fbca2a7 100644
--- a/gnucash/gnome/assistant-loan.c
+++ b/gnucash/gnome/assistant-loan.cpp
@@ -23,6 +23,8 @@
* Boston, MA 02110-1301, USA gnu at gnu.org *
\********************************************************************/
+extern "C"
+{
#include <config.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
@@ -51,6 +53,8 @@
#else
# include <monetary.h>
#endif
+}
+
#define DIALOG_LOAN_ASSISTANT_CM_CLASS "assistant-loan-setup"
static QofLogModule log_module = GNC_MOD_ASSISTANT;
@@ -102,8 +106,8 @@ typedef struct RepayOptData_
**/
typedef struct RepayOptDataDefault_
{
- char *name;
- char *defaultTxnMemo;
+ const char *name;
+ const char *defaultTxnMemo;
gboolean escrowDefault;
gboolean specSrcAcctDefault;
} RepayOptDataDefault;
@@ -362,10 +366,12 @@ static gint loan_find_ttsplit_with_acct( gconstpointer elt, gconstpointer crit )
static void loan_create_sx_from_tcSX( LoanAssistantData *ldd, toCreateSX *tcSX );
static void loan_tcSX_free( gpointer data, gpointer user_data );
+extern "C" {
void loan_assistant_prepare( GtkAssistant *assistant, GtkWidget *page, gpointer user_data );
void loan_assistant_finish( GtkAssistant *gtkassistant, gpointer user_data );
void loan_assistant_cancel( GtkAssistant *gtkassistant, gpointer user_data );
void loan_assistant_close( GtkAssistant *gtkassistant, gpointer user_data );
+}
/*****************************************************************************/
@@ -374,7 +380,7 @@ static
void
loan_assistant_close_handler( gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
gtk_widget_destroy( ldd->window );
}
@@ -383,7 +389,7 @@ static
void
loan_assistant_window_destroy_cb( GtkWidget *object, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
g_assert( ldd );
@@ -951,7 +957,7 @@ static
void
loan_info_prep( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
gnc_amount_edit_set_amount( ldd->prmOrigPrincGAE, ldd->ld.principal );
gtk_spin_button_set_value( ldd->prmIrateSpin, ldd->ld.interestRate );
@@ -959,9 +965,11 @@ loan_info_prep( GtkAssistant *assistant, gpointer user_data )
gtk_combo_box_set_active( ldd->prmType, ldd->ld.type );
if ( ldd->ld.type != GNC_FIXED )
{
- g_signal_handlers_block_by_func( GNC_FREQUENCY( ldd->prmVarGncFreq), loan_info_page_valid_cb , ldd );
+ g_signal_handlers_block_by_func( GNC_FREQUENCY( ldd->prmVarGncFreq),
+ (gpointer) loan_info_page_valid_cb, ldd );
gnc_frequency_setup_recurrence(ldd->prmVarGncFreq, ldd->ld.loan_schedule, ldd->ld.varStartDate);
- g_signal_handlers_unblock_by_func( GNC_FREQUENCY( ldd->prmVarGncFreq), loan_info_page_valid_cb , ldd );
+ g_signal_handlers_unblock_by_func( GNC_FREQUENCY( ldd->prmVarGncFreq),
+ (gpointer) loan_info_page_valid_cb, ldd );
}
/* start date */
@@ -989,7 +997,7 @@ static
void
loan_info_prm_type_cb( GtkWidget *w, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
gint index;
index = gtk_combo_box_get_active( ldd->prmType );
@@ -1002,7 +1010,7 @@ static
void
loan_info_calc_update_cb( GtkWidget *w, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GDate start, now;
int i, totalVal, total, remain;
@@ -1034,7 +1042,7 @@ loan_info_calc_update_cb( GtkWidget *w, gpointer user_data )
void
loan_info_page_valid_cb (GtkWidget *widget, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GtkAssistant *assistant = GTK_ASSISTANT(ldd->window);
gint num = gtk_assistant_get_current_page (assistant);
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
@@ -1048,7 +1056,7 @@ static
gboolean
loan_info_page_complete( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
ldd->ld.primaryAcct = gnc_account_sel_get_account( ldd->prmAccountGAS );
/* Test for valid Account */
@@ -1063,7 +1071,7 @@ static
void
loan_info_page_save( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
ldd->ld.primaryAcct = gnc_account_sel_get_account( ldd->prmAccountGAS );
@@ -1073,8 +1081,8 @@ loan_info_page_save( GtkAssistant *assistant, gpointer user_data )
}
ldd->ld.principal = gnc_amount_edit_get_amount( ldd->prmOrigPrincGAE );
ldd->ld.interestRate = gtk_spin_button_get_value( ldd->prmIrateSpin );
- ldd->ld.rateType = gtk_combo_box_get_active (ldd->prmIrateType );
- ldd->ld.type = gtk_combo_box_get_active( ldd->prmType );
+ ldd->ld.rateType = static_cast<IRateType>( gtk_combo_box_get_active (ldd->prmIrateType ));
+ ldd->ld.type = static_cast<LoanType>( gtk_combo_box_get_active( ldd->prmType ));
if ( ldd->ld.type != GNC_FIXED )
{
@@ -1095,7 +1103,7 @@ loan_info_page_save( GtkAssistant *assistant, gpointer user_data )
{
g_date_set_dmy( ldd->ld.startDate,
tmpTm->tm_mday,
- (tmpTm->tm_mon + 1),
+ static_cast<GDateMonth>(tmpTm->tm_mon + 1),
(1900 + tmpTm->tm_year) );
gnc_tm_free (tmpTm);
}
@@ -1121,7 +1129,7 @@ loan_opt_prep( GtkAssistant *assistant, gpointer user_data )
{
int i;
RepayOptUIData *rouid;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
/* Save Previous Page ( Information ) */
loan_info_page_save(assistant, ldd);
@@ -1190,7 +1198,7 @@ loan_opt_escrow_toggle_cb( GtkToggleButton *tb, gpointer user_data )
int i;
gboolean newState;
RepayOptUIData *rouid;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GtkAssistant *assistant = GTK_ASSISTANT(ldd->window);
gint num = gtk_assistant_get_current_page (assistant);
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
@@ -1221,7 +1229,7 @@ loan_opt_escrow_toggle_cb( GtkToggleButton *tb, gpointer user_data )
/* prevent the toggle handler from running and "trashing" the
* state of the throughEscrowP selection */
g_signal_handlers_block_by_func( rouid->escrowCb,
- loan_opt_escrow_toggled_cb,
+ (gpointer) loan_opt_escrow_toggled_cb,
rouid );
gtk_toggle_button_set_active(
GTK_TOGGLE_BUTTON(rouid->escrowCb),
@@ -1233,7 +1241,7 @@ loan_opt_escrow_toggle_cb( GtkToggleButton *tb, gpointer user_data )
newState
&& gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(rouid->optCb) ) );
g_signal_handlers_unblock_by_func( rouid->escrowCb,
- loan_opt_escrow_toggled_cb,
+ (gpointer) loan_opt_escrow_toggled_cb,
rouid );
if ( newState )
{
@@ -1261,7 +1269,7 @@ loan_opt_escrow_toggled_cb( GtkToggleButton *tb, gpointer user_data )
void
loan_opt_page_valid_cb (GtkWidget *widget, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GtkAssistant *assistant = GTK_ASSISTANT(ldd->window);
gint num = gtk_assistant_get_current_page (assistant);
@@ -1276,7 +1284,7 @@ static
gboolean
loan_opt_page_complete( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(ldd->optEscrowCb) ) )
{
@@ -1299,7 +1307,7 @@ static
void
loan_rep_prep( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GString *str;
if ( ldd->ld.repAmount )
@@ -1322,9 +1330,11 @@ loan_rep_prep( GtkAssistant *assistant, gpointer user_data )
gnc_account_sel_set_account( ldd->repPrincToGAS, ldd->ld.repPriAcct, FALSE );
gnc_account_sel_set_account( ldd->repIntToGAS, ldd->ld.repIntAcct, FALSE );
- g_signal_handlers_block_by_func( ldd->repGncFreq, loan_rep_page_valid_cb , ldd );
+ g_signal_handlers_block_by_func( ldd->repGncFreq,
+ (gpointer) loan_rep_page_valid_cb, ldd );
gnc_frequency_setup_recurrence(ldd->repGncFreq, ldd->ld.repayment_schedule, ldd->ld.repStartDate);
- g_signal_handlers_unblock_by_func( ldd->repGncFreq, loan_rep_page_valid_cb , ldd );
+ g_signal_handlers_unblock_by_func( ldd->repGncFreq,
+ (gpointer) loan_rep_page_valid_cb, ldd );
/* Find the first enabled option */
{
@@ -1345,7 +1355,7 @@ loan_rep_prep( GtkAssistant *assistant, gpointer user_data )
void
loan_rep_page_valid_cb (GtkWidget *widget, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GtkAssistant *assistant = GTK_ASSISTANT(ldd->window);
gint num = gtk_assistant_get_current_page (assistant);
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
@@ -1359,7 +1369,7 @@ static
gboolean
loan_rep_page_complete( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
ldd->ld.repFromAcct =
gnc_account_sel_get_account( ldd->repAssetsFromGAS );
@@ -1387,7 +1397,7 @@ static
void
loan_rep_page_save( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
if ( ldd->ld.repMemo )
g_free( ldd->ld.repMemo );
@@ -1420,7 +1430,7 @@ static
void
loan_pay_prep( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
RepayOptData *rod;
GString *str;
@@ -1457,7 +1467,7 @@ loan_pay_prep( GtkAssistant *assistant, gpointer user_data )
{
g_signal_handlers_block_by_func( ldd->payUseEscrow,
- loan_pay_use_esc_toggle_cb,
+ (gpointer) loan_pay_use_esc_toggle_cb,
ldd );
loan_pay_use_esc_setup( ldd,
@@ -1468,38 +1478,43 @@ loan_pay_prep( GtkAssistant *assistant, gpointer user_data )
&& ldd->ld.escrowAcct != NULL) );
g_signal_handlers_unblock_by_func( ldd->payUseEscrow,
- loan_pay_use_esc_toggle_cb,
+ (gpointer) loan_pay_use_esc_toggle_cb,
ldd );
}
{
g_signal_handlers_block_by_func( ldd->paySpecSrcAcct,
- loan_pay_spec_src_toggle_cb,
+ (gpointer) loan_pay_spec_src_toggle_cb,
ldd );
loan_pay_spec_src_setup( ldd, rod->specSrcAcctP );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->paySpecSrcAcct),
rod->specSrcAcctP );
g_signal_handlers_unblock_by_func( ldd->paySpecSrcAcct,
- loan_pay_spec_src_toggle_cb,
+ (gpointer) loan_pay_spec_src_toggle_cb,
ldd );
}
- g_signal_handlers_block_by_func(ldd->payAcctToGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_block_by_func(ldd->payAcctToGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
gnc_account_sel_set_account( ldd->payAcctToGAS, rod->to, FALSE );
- g_signal_handlers_unblock_by_func(ldd->payAcctToGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_unblock_by_func(ldd->payAcctToGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
- g_signal_handlers_block_by_func(ldd->payTxnFreqUniqRb, loan_pay_freq_toggle_cb, ldd );
+ g_signal_handlers_block_by_func(ldd->payTxnFreqUniqRb,
+ (gpointer) loan_pay_freq_toggle_cb, ldd );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payTxnFreqPartRb), !rod->FreqUniq );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(ldd->payTxnFreqUniqRb), rod->FreqUniq );
- g_signal_handlers_unblock_by_func(ldd->payTxnFreqUniqRb, loan_pay_freq_toggle_cb, ldd );
+ g_signal_handlers_unblock_by_func(ldd->payTxnFreqUniqRb,
+ (gpointer) loan_pay_freq_toggle_cb, ldd );
gtk_widget_set_sensitive( GTK_WIDGET(ldd->payFreqHBox), rod->FreqUniq );
if ( rod->FreqUniq )
{
- g_signal_handlers_disconnect_by_func( ldd->payGncFreq, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_disconnect_by_func( ldd->payGncFreq,
+ (gpointer) loan_pay_page_valid_cb, ldd );
gtk_container_remove( GTK_CONTAINER(ldd->payFreqHBox), GTK_WIDGET(ldd->payGncFreq) );
ldd->payGncFreq = NULL;
ldd->payGncFreq = GNC_FREQUENCY(gnc_frequency_new_from_recurrence( rod->schedule, rod->startDate ));
@@ -1516,7 +1531,7 @@ loan_pay_prep( GtkAssistant *assistant, gpointer user_data )
void
loan_pay_page_valid_cb (GtkWidget *widget, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GtkAssistant *assistant = GTK_ASSISTANT(ldd->window);
gint num = gtk_assistant_get_current_page (assistant);
GtkWidget *page = gtk_assistant_get_nth_page (assistant, num);
@@ -1535,12 +1550,16 @@ loan_pay_use_esc_setup( LoanAssistantData *ldd, gboolean newState )
gtk_widget_set_sensitive( GTK_WIDGET(ldd->payEscFromLabel), newState );
if ( newState )
{
- g_signal_handlers_block_by_func( ldd->payAcctEscToGAS, loan_pay_page_valid_cb, ldd );
- g_signal_handlers_block_by_func( ldd->payAcctEscFromGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_block_by_func( ldd->payAcctEscToGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_block_by_func( ldd->payAcctEscFromGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
gnc_account_sel_set_account( ldd->payAcctEscToGAS, ldd->ld.escrowAcct, FALSE );
gnc_account_sel_set_account( ldd->payAcctEscFromGAS, ldd->ld.escrowAcct, FALSE );
- g_signal_handlers_unblock_by_func( ldd->payAcctEscToGAS, loan_pay_page_valid_cb, ldd );
- g_signal_handlers_unblock_by_func( ldd->payAcctEscFromGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_unblock_by_func( ldd->payAcctEscToGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_unblock_by_func( ldd->payAcctEscFromGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
}
}
@@ -1550,7 +1569,7 @@ void
loan_pay_use_esc_toggle_cb( GtkToggleButton *tb, gpointer user_data )
{
gboolean newState;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
newState = gtk_toggle_button_get_active( tb );
loan_pay_use_esc_setup( ldd, newState );
@@ -1565,16 +1584,20 @@ loan_pay_spec_src_setup( LoanAssistantData *ldd, gboolean newState )
gtk_widget_set_sensitive( GTK_WIDGET(ldd->payAcctFromGAS), newState );
if ( newState )
{
- g_signal_handlers_block_by_func( ldd->payAcctFromGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_block_by_func( ldd->payAcctFromGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
gnc_account_sel_set_account( ldd->payAcctFromGAS, ldd->ld.repayOpts[ldd->currentIdx]->from, FALSE );
- g_signal_handlers_unblock_by_func( ldd->payAcctFromGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_unblock_by_func( ldd->payAcctFromGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
}
else
{
- g_signal_handlers_block_by_func( ldd->payAcctFromGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_block_by_func( ldd->payAcctFromGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
gnc_account_sel_set_account( ldd->payAcctFromGAS, NULL, FALSE );
ldd->ld.repayOpts[ldd->currentIdx]->from = NULL;
- g_signal_handlers_unblock_by_func( ldd->payAcctFromGAS, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_unblock_by_func( ldd->payAcctFromGAS,
+ (gpointer) loan_pay_page_valid_cb, ldd );
}
}
@@ -1584,7 +1607,7 @@ void
loan_pay_spec_src_toggle_cb( GtkToggleButton *tb, gpointer user_data )
{
gboolean newState;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
newState = gtk_toggle_button_get_active( tb );
loan_pay_spec_src_setup( ldd, newState );
@@ -1595,7 +1618,7 @@ static
void
loan_pay_freq_toggle_cb( GtkToggleButton *tb, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
RepayOptData *rod;
g_assert( ldd->currentIdx >= 0 );
@@ -1620,9 +1643,11 @@ loan_pay_freq_toggle_cb( GtkToggleButton *tb, gpointer user_data )
rod->startDate = g_date_new();
*rod->startDate = *ldd->ld.startDate;
}
- g_signal_handlers_block_by_func( ldd->payGncFreq, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_block_by_func( ldd->payGncFreq,
+ (gpointer) loan_pay_page_valid_cb, ldd );
gnc_frequency_setup_recurrence(ldd->payGncFreq, rod->schedule, rod->startDate);
- g_signal_handlers_unblock_by_func( ldd->payGncFreq, loan_pay_page_valid_cb, ldd );
+ g_signal_handlers_unblock_by_func( ldd->payGncFreq,
+ (gpointer) loan_pay_page_valid_cb, ldd );
}
else
{
@@ -1644,7 +1669,7 @@ void
loan_pay_next_button_cb( GtkButton *button, gpointer user_data )
{
int i;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
/* save current data */
if ( loan_pay_complete ( GTK_ASSISTANT(ldd->window), user_data ) != FALSE )
@@ -1668,7 +1693,7 @@ void
loan_pay_back_button_cb( GtkButton *button, gpointer user_data )
{
int i;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
/* save current data */
if ( loan_pay_complete ( GTK_ASSISTANT(ldd->window), user_data ) != FALSE)
@@ -1691,7 +1716,7 @@ static
gboolean
loan_pay_all_opt_valid ( GtkAssistant *assistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
int i;
gboolean all_valid;
all_valid = FALSE;
@@ -1716,7 +1741,7 @@ gboolean
loan_pay_complete( GtkAssistant *assistant, gpointer user_data )
{
gchar *tmpStr;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
RepayOptData *rod;
g_assert( ldd->currentIdx >= 0 );
@@ -1783,7 +1808,7 @@ loan_rev_prep( GtkAssistant *assistant, gpointer user_data )
{
/* 3, here, does not include the Date column. */
static const int BASE_COLS = 3;
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
GtkListStore *store;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
@@ -1892,7 +1917,7 @@ static
void
loan_rev_range_opt_changed_cb( GtkComboBox *combo, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
int opt;
opt = gtk_combo_box_get_active( ldd->revRangeOpt );
@@ -1912,7 +1937,7 @@ static
void
loan_rev_range_changed_cb( GNCDateEdit *gde, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
{
GDate start, end;
g_date_clear( &start, 1 );
@@ -2085,7 +2110,7 @@ loan_rev_recalc_schedule( LoanAssistantData *ldd )
/* evaluate the expressions given the correct
* sequence number i */
ival = gnc_numeric_create( i, 1 );
- g_hash_table_insert( ivar, "i", &ival );
+ g_hash_table_insert( ivar, (gpointer) "i", &ival );
if ( ! gnc_exp_parser_parse_separate_vars(
pmtFormula->str, &val, &eloc, ivar ) )
@@ -2207,7 +2232,7 @@ static
void
loan_rev_update_view( LoanAssistantData *ldd, GDate *start, GDate *end )
{
- static gchar *NO_AMT_CELL_TEXT = " ";
+ static const gchar *NO_AMT_CELL_TEXT = " ";
GList *l;
GNCPrintAmountInfo pai;
GtkListStore *store;
@@ -2277,7 +2302,7 @@ gfloat loan_apr_to_simple_formula (gfloat rate, gfloat compounding_periods)
static
void
-loan_get_formula_internal( LoanAssistantData *ldd, GString *gstr, const gchar* template )
+loan_get_formula_internal( LoanAssistantData *ldd, GString *gstr, const gchar* tpl )
{
gint rate_case;
gfloat pass_thru_rate, period_rate;
@@ -2318,7 +2343,7 @@ loan_get_formula_internal( LoanAssistantData *ldd, GString *gstr, const gchar* t
break;
}
- if (0 < strfmon (formula, MAX_FORMULA, template,
+ if (0 < strfmon (formula, MAX_FORMULA, tpl,
period_rate, 12.0, periods, principal ))
g_string_append (gstr, formula);
}
@@ -2944,7 +2969,7 @@ loan_create_sxes( LoanAssistantData *ldd )
void
loan_assistant_finish ( GtkAssistant *gtkassistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
loan_create_sxes( ldd );
}
@@ -2953,7 +2978,7 @@ loan_assistant_finish ( GtkAssistant *gtkassistant, gpointer user_data )
void
loan_assistant_cancel( GtkAssistant *gtkassistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
gnc_close_gui_component_by_data( DIALOG_LOAN_ASSISTANT_CM_CLASS, ldd );
}
@@ -2961,7 +2986,7 @@ loan_assistant_cancel( GtkAssistant *gtkassistant, gpointer user_data )
void
loan_assistant_close( GtkAssistant *gtkassistant, gpointer user_data )
{
- LoanAssistantData *ldd = user_data;
+ LoanAssistantData *ldd = static_cast<LoanAssistantData*> (user_data);
gnc_close_gui_component_by_data( DIALOG_LOAN_ASSISTANT_CM_CLASS, ldd );
}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 386ea54..06f9c4d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -41,7 +41,7 @@ borrowed/libc/strptime.c
doc/tip_of_the_day.list.c
gnucash/gnome/assistant-acct-period.c
gnucash/gnome/assistant-hierarchy.c
-gnucash/gnome/assistant-loan.c
+gnucash/gnome/assistant-loan.cpp
gnucash/gnome/assistant-stock-split.c
gnucash/gnome/business-gnome-utils.c
gnucash/gnome/business-options-gnome.c
commit 6ba47846c05805deaa1b79867b69f798523d5573
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Aug 5 22:39:18 2018 +0100
Improve the generation of the filter text
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 9abfba1..24a3953 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -2892,23 +2892,32 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
LEAVE(" ");
}
-static gchar*
-gpp_get_cleared_match_filter_text (gchar *text_in, gboolean *first, const gchar *text)
+static void
+gpp_update_match_filter_text (cleared_match_t match, const guint mask,
+ const gchar *filter_name, gchar **show, gchar **hide)
{
- gchar *result;
- gchar *temp = g_strdup (text_in);
- g_free (text_in);
-
- if (*first)
+ if ((match & mask) == mask)
{
- result = g_strconcat (temp, text, NULL);
- *first = FALSE;
+ if (*show == NULL)
+ *show = g_strdup (filter_name);
+ else
+ {
+ gchar *temp = g_strdup (*show);
+ g_free (*show);
+ *show = g_strconcat (temp, ", ", filter_name, NULL);
+ }
}
else
- result = g_strconcat (temp, ", ", text, NULL);
- g_free (temp);
-
- return result;
+ {
+ if (*hide == NULL)
+ *hide = g_strdup (filter_name);
+ else
+ {
+ gchar *temp = g_strdup (*hide);
+ g_free (*hide);
+ *hide = g_strconcat (temp, ", ", filter_name, NULL);
+ }
+ }
}
static void
@@ -2951,44 +2960,22 @@ gnc_plugin_page_register_set_filter_tooltip (GncPluginPageRegister *page)
// filtered match items
if (priv->fd.cleared_match != 31)
{
- gchar *show = g_strdup ("");
- gchar *hide = g_strdup ("");
+ gchar *show = NULL;
+ gchar *hide = NULL;
- gboolean first_show = TRUE, first_hide = TRUE;
+ gpp_update_match_filter_text (priv->fd.cleared_match, 0x01, _("Unreconciled"), &show, &hide);
+ gpp_update_match_filter_text (priv->fd.cleared_match, 0x02, _("Cleared"), &show, &hide);
+ gpp_update_match_filter_text (priv->fd.cleared_match, 0x04, _("Reconciled"), &show, &hide);
+ gpp_update_match_filter_text (priv->fd.cleared_match, 0x08, _("Frozen"), &show, &hide);
+ gpp_update_match_filter_text (priv->fd.cleared_match, 0x10, _("Voided"), &show, &hide);
- if ((priv->fd.cleared_match & 0x01) == 0x01)
- show = gpp_get_cleared_match_filter_text (show, &first_show, _("Unreconciled"));
- else
- hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Unreconciled"));
-
- if ((priv->fd.cleared_match & 0x02) == 0x02)
- show = gpp_get_cleared_match_filter_text (show, &first_show, _("Cleared"));
- else
- hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Cleared"));
-
- if ((priv->fd.cleared_match & 0x04) == 0x04)
- show = gpp_get_cleared_match_filter_text (show, &first_show, _("Reconciled"));
- else
- hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Reconciled"));
-
- if ((priv->fd.cleared_match & 0x08) == 0x08)
- show = gpp_get_cleared_match_filter_text (show, &first_show, _("Frozen"));
- else
- hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Frozen"));
-
- if ((priv->fd.cleared_match & 0x10) == 0x10)
- show = gpp_get_cleared_match_filter_text (show, &first_show, _("Voided"));
- else
- hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Voided"));
-
- if (g_strcmp0 (show, "") == 0)
+ if (show == NULL)
text_cleared = g_strconcat (_("Hide:"), " ", hide, NULL);
else
text_cleared = g_strconcat (_("Show:"), " ", show, "\n", _("Hide:"), " ", hide, NULL);
g_free (show);
g_free (hide);
-
}
// create the tooltip based on created text variables
if ((text_start != NULL) || (text_end != NULL) || (text_cleared != NULL))
commit a650693d07269d82515bc132a334dac9aa96d43c
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 17:06:43 2018 +0100
New feature for register sort/filter settings move.
diff --git a/libgnucash/engine/gnc-features.c b/libgnucash/engine/gnc-features.c
index e56491e..453ecfc 100644
--- a/libgnucash/engine/gnc-features.c
+++ b/libgnucash/engine/gnc-features.c
@@ -48,6 +48,7 @@ static gncFeature known_features[] =
{ GNC_FEATURE_GUID_BAYESIAN, "Use account GUID as key for Bayesian data (requires at least GnuCash 2.6.12)" },
{ GNC_FEATURE_GUID_FLAT_BAYESIAN, "Use account GUID as key for bayesian data and store KVP flat (requires at least Gnucash 2.6.19)" },
{ GNC_FEATURE_SQLITE3_ISO_DATES, "Use ISO formatted date-time strings in SQLite3 databases (requires at least GnuCash 2.6.20)"},
+ { GNC_FEATURE_REG_SORT_FILTER, "Store the register sort and filter settings in .gcm metadata file (requires at least GnuCash 3.3)"},
{ NULL },
};
diff --git a/libgnucash/engine/gnc-features.h b/libgnucash/engine/gnc-features.h
index 0386077..a53be43 100644
--- a/libgnucash/engine/gnc-features.h
+++ b/libgnucash/engine/gnc-features.h
@@ -52,6 +52,7 @@ extern "C" {
#define GNC_FEATURE_GUID_BAYESIAN "Account GUID based Bayesian data"
#define GNC_FEATURE_GUID_FLAT_BAYESIAN "Account GUID based bayesian with flat KVP"
#define GNC_FEATURE_SQLITE3_ISO_DATES "ISO-8601 formatted date strings in SQLite3 databases."
+#define GNC_FEATURE_REG_SORT_FILTER "Register sort and filter settings stored in .gcm file"
/** @} */
commit 9423e0913ba4d2878174cb4049c7d3e70e249321
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 17:05:55 2018 +0100
Remove white space and re-indent gnc-features.c
diff --git a/libgnucash/engine/gnc-features.c b/libgnucash/engine/gnc-features.c
index ca4cb9b..e56491e 100644
--- a/libgnucash/engine/gnc-features.c
+++ b/libgnucash/engine/gnc-features.c
@@ -72,7 +72,7 @@ static void gnc_features_init ()
}
static void gnc_features_test_one(gpointer pkey, gpointer value,
- gpointer data)
+ gpointer data)
{
const gchar *key = (const gchar*)pkey;
const gchar *feature_desc = (const gchar*)value;
@@ -89,7 +89,7 @@ static void gnc_features_test_one(gpointer pkey, gpointer value,
g_assert(feature_desc);
*unknown_features = g_list_prepend(*unknown_features,
- (gpointer)feature_desc);
+ (gpointer)feature_desc);
}
/* Check if the session requires features unknown to this version of GnuCash.
@@ -108,25 +108,25 @@ gchar *gnc_features_test_unknown (QofBook *book)
/* Iterate over the members of this frame for unknown features */
g_hash_table_foreach (features_used, &gnc_features_test_one,
- &features_list);
+ &features_list);
if (features_list)
{
- GList *i;
- char* msg = g_strdup(_("This Dataset contains features not supported "
- "by this version of GnuCash. You must use a "
- "newer version of GnuCash in order to support "
- "the following features:"
- ));
-
- for (i = features_list; i; i = i->next)
- {
- char *tmp = g_strconcat(msg, "\n* ", i->data, NULL);
- g_free (msg);
- msg = tmp;
- }
-
- g_list_free(features_list);
- return msg;
+ GList *i;
+ char* msg = g_strdup(_("This Dataset contains features not supported "
+ "by this version of GnuCash. You must use a "
+ "newer version of GnuCash in order to support "
+ "the following features:"
+ ));
+
+ for (i = features_list; i; i = i->next)
+ {
+ char *tmp = g_strconcat(msg, "\n* ", i->data, NULL);
+ g_free (msg);
+ msg = tmp;
+ }
+
+ g_list_free(features_list);
+ return msg;
}
g_hash_table_unref (features_used);
return NULL;
@@ -159,7 +159,7 @@ struct CheckFeature
};
static void gnc_features_check_feature_cb (gpointer pkey, gpointer value,
- gpointer data)
+ gpointer data)
{
const gchar *key = (const gchar*)pkey;
struct CheckFeature * check_data = data;
commit c6001d855aceae1e1cea4777ba5b8d9036b99ff0
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 15:44:15 2018 +0100
Allow loading the sort and filter settings for the GL
By default the GL loads the last 30 days but this can be changed and
saved depending on requirements.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 80e0ff5..9abfba1 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -1151,7 +1151,6 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
ledger_type = gnc_ledger_display_type (priv->ledger);
- if (ledger_type == LD_SINGLE || ledger_type == LD_SUBACCOUNT)
{
/* Set the sort order for the split register and status of save order button */
priv->sd.save_order = FALSE;
@@ -1218,15 +1217,32 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
priv->fd.original_save_filter = priv->fd.save_filter;
g_strfreev(filter);
}
- else // LD_GL
+
+ if (ledger_type == LD_GL)
{
time64 start_time = 0, end_time = 0;
- if ((priv->fd.days == 0) && (reg->type == GENERAL_JOURNAL))
+ if (reg->type == GENERAL_JOURNAL)
{
- priv->fd.days = 30; // default number of days for gl
- priv->fd.original_days = priv->fd.days;
+ if ((priv->fd.days == 0) && (priv->fd.start_time == 0) && (priv->fd.end_time == 0))
+ priv->fd.days = 30; // default number of days for gl
+ else
+ {
+ start_time = priv->fd.start_time;
+ end_time = priv->fd.end_time;
+ }
}
+ else // search ledger and the like
+ {
+ priv->fd.days = 0;
+ priv->fd.cleared_match = (gint)g_ascii_strtoll (DEFAULT_FILTER, NULL, 16);
+ gnc_split_reg_set_sort_type (priv->gsr, SortTypefromString (DEFAULT_SORT_ORDER));
+ priv->sd.reverse_order = FALSE;
+ priv->fd.save_filter = FALSE;
+ priv->sd.save_order = FALSE;
+ }
+
+ priv->fd.original_days = priv->fd.days;
priv->fd.original_start_time = start_time;
priv->fd.start_time = start_time;
commit ed05b89518af94526542b7daf1b70b7262d376a0
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 15:40:43 2018 +0100
Load the sort and filter settings to the .gcm file.
Load the sort and filter settings first from the .gcm file and if none
are found try the account kvp entries. This is part of a transition to
saving and loading these settings only in the .gcm file.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 0c83d58..80e0ff5 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -1762,7 +1762,13 @@ gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
- const char* filter;
+ const char* filter = NULL;
+
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar *filter_text;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ GError *error = NULL;
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
@@ -1770,11 +1776,24 @@ gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
ld = priv->ledger;
ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
- filter = NULL;
- if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
- filter = xaccAccountGetFilter (leader);
+ // get the filter from the .gcm file
+ guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
+ state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
+ filter_text = g_key_file_get_string (state_file, state_section, KEY_PAGE_FILTER, &error);
+ if (error)
+ {
+ if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+ filter = xaccAccountGetFilter (leader);
+ g_clear_error (&error);
+ }
+ else
+ {
+ filter_text = g_strdelimit (filter_text, ";", ',');
+ filter = g_strdup (filter_text);
+ g_free (filter_text);
+ }
return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
}
@@ -1829,7 +1848,13 @@ gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page)
GNCLedgerDisplayType ledger_type;
GNCLedgerDisplay *ld;
Account *leader;
- const char* sort_order;
+ const char* sort_order = NULL;
+
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar *sort_text;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ GError *error = NULL;
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), _("unknown"));
@@ -1837,11 +1862,23 @@ gnc_plugin_page_register_get_sort_order (GncPluginPage *plugin_page)
ld = priv->ledger;
ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
- sort_order = NULL;
- if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
- sort_order = xaccAccountGetSortOrder (leader);
+ // get the sort_order from the .gcm file
+ guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
+ state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
+ sort_text = g_key_file_get_string (state_file, state_section, KEY_PAGE_SORT, &error);
+ if (error)
+ {
+ if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+ sort_order = xaccAccountGetSortOrder (leader);
+ g_clear_error (&error);
+ }
+ else
+ {
+ sort_order = g_strdup (sort_text);
+ g_free (sort_text);
+ }
return g_strdup(sort_order ? sort_order : DEFAULT_SORT_ORDER);
}
@@ -1891,6 +1928,11 @@ gnc_plugin_page_register_get_sort_reversed (GncPluginPage *plugin_page)
Account *leader;
gboolean sort_reversed = FALSE;
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+ GError *error = NULL;
+
g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), FALSE);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
@@ -1898,9 +1940,17 @@ gnc_plugin_page_register_get_sort_reversed (GncPluginPage *plugin_page)
ledger_type = gnc_ledger_display_type (ld);
leader = gnc_ledger_display_leader (ld);
- if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
- sort_reversed = xaccAccountGetSortReversed (leader);
+ // get the sort_reversed from the .gcm file
+ guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
+ state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
+ sort_reversed = g_key_file_get_boolean (state_file, state_section, KEY_PAGE_SORT_REV, &error);
+ if (error)
+ {
+ if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
+ sort_reversed = xaccAccountGetSortReversed (leader);
+ g_clear_error (&error);
+ }
return sort_reversed;
}
commit 13c5b53931a55b634d001f24675fecbe88a5d4fc
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 15:35:25 2018 +0100
Save the sort and filter settings to the .gcm file
Save the sort and filter settings to the .gcm file as well as the
account kvp. If default entries are saved then the corresponding entry
in the .gcm file will be removed. This is part of a transition to saving
these settings only in the .gcm file.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 536d762..0c83d58 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -67,6 +67,7 @@
#include "gnc-gui-query.h"
#include "gnc-icons.h"
#include "gnc-split-reg.h"
+#include "gnc-state.h"
#include "gnc-prefs.h"
#include "gnc-ui-util.h"
#include "gnc-window.h"
@@ -1365,6 +1366,10 @@ static const gchar *style_names[] =
#define KEY_REGISTER_STYLE "RegisterStyle"
#define KEY_DOUBLE_LINE "DoubleLineMode"
+#define KEY_PAGE_SORT "register_order"
+#define KEY_PAGE_SORT_REV "register_reversed"
+#define KEY_PAGE_FILTER "register_filter"
+
#define LABEL_ACCOUNT "Account"
#define LABEL_SUBACCOUNT "SubAccount"
#define LABEL_GL "GL"
@@ -1779,7 +1784,12 @@ gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *fi
GncPluginPageRegisterPrivate *priv;
GNCLedgerDisplay *ld;
Account *leader;
- gchar *default_filter;
+ gchar *default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
+
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar *filter_text;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
@@ -1787,16 +1797,28 @@ gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *fi
if (leader != NULL)
{
- default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
-
if (!filter || (g_strcmp0 (filter, default_filter) == 0))
xaccAccountSetFilter (leader, NULL);
else
xaccAccountSetFilter (leader, filter);
-
- g_free (default_filter);
}
+ // save the filter to the .gcm file also
+ guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
+ state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
+ if (!filter || (g_strcmp0 (filter, default_filter) == 0))
+ {
+ if (g_key_file_has_key (state_file, state_section, KEY_PAGE_FILTER, NULL))
+ g_key_file_remove_key (state_file, state_section, KEY_PAGE_FILTER, NULL);
+ }
+ else
+ {
+ filter_text = g_strdup (filter);
+ filter_text = g_strdelimit (filter_text, ",", ';'); // make it conform to .gcm file list
+ g_key_file_set_string (state_file, state_section, KEY_PAGE_FILTER, filter_text);
+ g_free (filter_text);
+ }
+ g_free (default_filter);
return;
}
@@ -1830,6 +1852,10 @@ gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar
GNCLedgerDisplay *ld;
Account *leader;
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
leader = gnc_ledger_display_leader (ld);
@@ -1842,6 +1868,17 @@ gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar
xaccAccountSetSortOrder (leader, sort_order);
}
+ // save sort_order to the .gcm file also
+ guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
+ state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
+ if (!sort_order || (g_strcmp0 (sort_order, DEFAULT_SORT_ORDER) == 0))
+ {
+ if (g_key_file_has_key (state_file, state_section, KEY_PAGE_SORT, NULL))
+ g_key_file_remove_key (state_file, state_section, KEY_PAGE_SORT, NULL);
+ }
+ else
+ g_key_file_set_string (state_file, state_section, KEY_PAGE_SORT, sort_order);
+
return;
}
@@ -1874,6 +1911,10 @@ gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean
GNCLedgerDisplay *ld;
Account *leader;
+ GKeyFile *state_file = gnc_state_get_current();
+ gchar *state_section;
+ gchar acct_guid[GUID_ENCODING_LENGTH + 1];
+
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(plugin_page);
ld = priv->ledger;
leader = gnc_ledger_display_leader (ld);
@@ -1881,6 +1922,17 @@ gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean
if (leader != NULL)
xaccAccountSetSortReversed (leader, reverse_order);
+ // save reverse_order to the .gcm file also
+ guid_to_string_buff (xaccAccountGetGUID (leader), acct_guid);
+ state_section = g_strconcat (STATE_SECTION_REG_PREFIX, " ", acct_guid, NULL);
+ if (!reverse_order)
+ {
+ if (g_key_file_has_key (state_file, state_section, KEY_PAGE_SORT_REV, NULL))
+ g_key_file_remove_key (state_file, state_section, KEY_PAGE_SORT_REV, NULL);
+ }
+ else
+ g_key_file_set_boolean (state_file, state_section, KEY_PAGE_SORT_REV, reverse_order);
+
return;
}
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index da5ba2c..f5ddfb5 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -60,8 +60,6 @@
// static QofLogModule log_module = GNC_MOD_SX;
static QofLogModule log_module = GNC_MOD_GUI;
-#define STATE_SECTION_REG_PREFIX "Register"
-
/***** PROTOTYPES ***************************************************/
void gnc_split_reg_raise( GNCSplitReg *gsr );
diff --git a/gnucash/gnome/gnc-split-reg.h b/gnucash/gnome/gnc-split-reg.h
index 6dd048e..16ecae1 100644
--- a/gnucash/gnome/gnc-split-reg.h
+++ b/gnucash/gnome/gnc-split-reg.h
@@ -36,6 +36,8 @@
#define GNC_SPLIT_REG_CLASS(klass) G_TYPE_CHECK_CLASS_CAST( klass, gnc_split_reg_get_type(), GNCSplitRegClass )
#define IS_GNC_SPLIT_REG(obj) G_TYPE_CHECK_INSTANCE_TYPE( obj, gnc_split_reg_get_type() )
+#define STATE_SECTION_REG_PREFIX "Register"
+
typedef struct _GNCSplitReg GNCSplitReg;
typedef struct _GNCSplitRegClass GNCSplitRegClass;
commit 72a29a83af4915920a7a2f486346696b2e7fb4e8
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 15:24:07 2018 +0100
Fix the save option on sort/filter dialog
When unticking the save option on the sort and filter dialog the actual
save items are not cleared so check for this and clear the saved items.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 676bccb..536d762 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -2041,6 +2041,12 @@ gnc_plugin_page_register_sort_response_cb (GtkDialog *dialog,
}
else
{
+ // clear the sort when unticking the save option
+ if ((priv->sd.save_order == FALSE) && (priv->sd.original_save_order == TRUE))
+ {
+ gnc_plugin_page_register_set_sort_order (plugin_page, DEFAULT_SORT_ORDER);
+ gnc_plugin_page_register_set_sort_reversed (plugin_page, FALSE);
+ }
priv->sd.original_save_order = priv->sd.save_order;
if (priv->sd.save_order)
@@ -2711,6 +2717,10 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
}
else
{
+ // clear the filter when unticking the save option
+ if ((priv->fd.save_filter == FALSE) && (priv->fd.original_save_filter == TRUE))
+ gnc_plugin_page_register_set_filter (plugin_page, NULL);
+
priv->fd.original_save_filter = priv->fd.save_filter;
if (priv->fd.save_filter)
commit 8a0ee0e38f1e569e8ae8d5e1f3b409356e6aca23
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 10:33:01 2018 +0100
Hide the filter/sort save button when appropiate
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 40969ff..676bccb 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -3446,6 +3446,33 @@ gnc_plugin_page_register_cmd_reverse_transaction (GtkAction *action,
LEAVE(" ");
}
+static gboolean
+gnc_plugin_page_register_show_fs_save (GncPluginPageRegister *page)
+{
+ GncPluginPageRegisterPrivate *priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+ GNCLedgerDisplayType ledger_type = gnc_ledger_display_type (priv->ledger);
+ SplitRegister *reg = gnc_ledger_display_get_split_register (priv->ledger);
+
+ if (ledger_type == LD_SINGLE || ledger_type == LD_SUBACCOUNT)
+ return TRUE;
+ else
+ {
+ switch (reg->type)
+ {
+ case GENERAL_JOURNAL:
+ return TRUE;
+ break;
+
+ case INCOME_LEDGER:
+ case PORTFOLIO_LEDGER:
+ case SEARCH_LEDGER:
+ default:
+ return FALSE;
+ break;
+ }
+ }
+}
+
static void
gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
GncPluginPageRegister *page)
@@ -3495,6 +3522,10 @@ gnc_plugin_page_register_cmd_view_sort_by (GtkAction *action,
if (priv->sd.save_order == TRUE)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ // hide the save button if appropiate
+ gtk_widget_set_visible (GTK_WIDGET(button),
+ gnc_plugin_page_register_show_fs_save (page));
+
/* Set the button for the current reverse_order order */
button = GTK_WIDGET(gtk_builder_get_object (builder, "sort_reverse"));
if(priv->sd.reverse_order == TRUE)
@@ -3576,6 +3607,10 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
if (priv->fd.save_filter == TRUE)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ // hide the save button if appropiate
+ gtk_widget_set_visible (GTK_WIDGET(button),
+ gnc_plugin_page_register_show_fs_save (page));
+
/* Set up number of days */
priv->fd.num_days = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_num_days"));
button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_days"));
@@ -3694,7 +3729,7 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, page);
/* Show it */
- gtk_widget_show_all(dialog);
+ gtk_widget_show(dialog);
g_object_unref(G_OBJECT(builder));
LEAVE(" ");
}
commit e281b50b2963dfe2243bff1a1383ec9f14310bc4
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 08:13:58 2018 +0100
Add new filter option to register
Add new option to the register filter so that it will display the last
number of days based on current day. This is stored as an extra element
on the end of account filter setting.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 85d3ebd..40969ff 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -128,6 +128,7 @@ void gnc_plugin_page_register_filter_response_cb(GtkDialog *dialog, gint respons
void gnc_plugin_page_register_filter_status_all_cb(GtkButton *button, GncPluginPageRegister *plugin_page);
void gnc_plugin_page_register_filter_status_one_cb(GtkToggleButton *button, GncPluginPageRegister *page);
void gnc_plugin_page_register_filter_save_cb(GtkToggleButton *button, GncPluginPageRegister *page);
+void gnc_plugin_page_register_filter_days_changed_cb (GtkSpinButton *button, GncPluginPageRegister *page);
static time64 gnc_plugin_page_register_filter_dmy2time (char *date_string);
static gchar *gnc_plugin_page_register_filter_time2dmy (time64 raw_time);
@@ -567,12 +568,15 @@ typedef struct GncPluginPageRegisterPrivate
GtkWidget *end_date_choose;
GtkWidget *end_date_today;
GtkWidget *end_date;
+ GtkWidget *num_days;
cleared_match_t original_cleared_match;
cleared_match_t cleared_match;
time64 original_start_time;
time64 original_end_time;
time64 start_time;
time64 end_time;
+ gint days;
+ gint original_days;
gboolean original_save_filter;
gboolean save_filter;
} fd;
@@ -798,6 +802,7 @@ gnc_plugin_page_register_init (GncPluginPageRegister *plugin_page)
priv->lines_default = DEFAULT_LINES_AMOUNT;
priv->read_only = FALSE;
priv->fd.cleared_match = CLEARED_ALL;
+ priv->fd.days = 0;
}
static void
@@ -1198,28 +1203,40 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
filter_changed = filter_changed + 1;
}
+ if (filter[3] && (g_strcmp0 (filter[3], "0") != 0 ))
+ {
+ PINFO("Loaded Filter Days is %s", filter[3]);
+
+ priv->fd.days = (gint)g_ascii_strtoll(filter[3], NULL, 10);
+ filter_changed = filter_changed + 1;
+ }
+
if (filter_changed != 0)
priv->fd.save_filter = TRUE;
priv->fd.original_save_filter = priv->fd.save_filter;
g_strfreev(filter);
-
- /* Update Query with Filter Status and Dates */
- gnc_ppr_update_status_query (page);
- gnc_ppr_update_date_query(page);
}
else // LD_GL
{
- time64 start_time, end_time;
- Query *query = gnc_ledger_display_get_query (priv->ledger);
+ time64 start_time = 0, end_time = 0;
+
+ if ((priv->fd.days == 0) && (reg->type == GENERAL_JOURNAL))
+ {
+ priv->fd.days = 30; // default number of days for gl
+ priv->fd.original_days = priv->fd.days;
+ }
- xaccQueryGetDateMatchTT(query, &start_time, &end_time);
priv->fd.original_start_time = start_time;
priv->fd.start_time = start_time;
priv->fd.original_end_time = end_time;
priv->fd.end_time = end_time;
}
+ /* Update Query with Filter Status and Dates */
+ gnc_ppr_update_status_query (page);
+ gnc_ppr_update_date_query(page);
+
// Set filter tooltip for summary bar
gnc_plugin_page_register_set_filter_tooltip (page);
@@ -1753,7 +1770,7 @@ gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page)
if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
filter = xaccAccountGetFilter (leader);
- return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
+ return filter ? g_strdup(filter) : g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
}
void
@@ -1770,7 +1787,7 @@ gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *fi
if (leader != NULL)
{
- default_filter = g_strdup_printf("%s,%s,%s", DEFAULT_FILTER, "0", "0");
+ default_filter = g_strdup_printf("%s,%s,%s,%s", DEFAULT_FILTER, "0", "0", "0");
if (!filter || (g_strcmp0 (filter, default_filter) == 0))
xaccAccountSetFilter (leader, NULL);
@@ -2233,6 +2250,18 @@ gnc_ppr_update_date_query (GncPluginPageRegister *page)
QOF_QUERY_AND);
}
+ if (priv->fd.days > 0)
+ {
+ time64 start;
+ struct tm tm;
+
+ gnc_tm_get_today_start(&tm);
+
+ tm.tm_mday = tm.tm_mday - priv->fd.days;
+ start = gnc_mktime (&tm);
+ xaccQueryAddDateMatchTT (query, TRUE, start, FALSE, 0, QOF_QUERY_AND);
+ }
+
// Set filter tooltip for summary bar
gnc_plugin_page_register_set_filter_tooltip (page);
@@ -2417,15 +2446,11 @@ get_filter_times(GncPluginPageRegister *page)
}
-/** This function is called when the "select range" radio button
- * changes state. Since there are only two choices in this radio
- * group, this one signal can be used to handle all cases. This
- * function is responsible for setting the sensitivity of the table
- * of widgets underneath the "select range" choice, and updating the
- * time limitation on the register query. This is handled by a
- * helper function when the radio button is selected (as potentially
- * all the widgets in the table need to be inspected), and is trivial
- * for the other case.
+/** This function is called when the radio buttons changes state. This
+ * function is responsible for setting the sensitivity of the widgets
+ * controlled by each radio button choice and updating the time
+ * limitation on the register query. This is handled by a helper
+ * function as potentialy all widgets will need to be examined.
*
* @param button A pointer to the "select range" radio button.
*
@@ -2438,20 +2463,33 @@ gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
{
GncPluginPageRegisterPrivate *priv;
gboolean active;
+ const gchar *name;
g_return_if_fail(GTK_IS_RADIO_BUTTON(button));
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
ENTER("(button %p, page %p)", button, page);
priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+ name = gtk_buildable_get_name(GTK_BUILDABLE(button));
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button));
- gtk_widget_set_sensitive(priv->fd.table, active);
- if (active)
+
+ if (active && g_strcmp0(name, "filter_show_range") == 0)
{
+ gtk_widget_set_sensitive(priv->fd.table, active);
+ gtk_widget_set_sensitive(priv->fd.num_days, !active);
get_filter_times(page);
}
+ else if (active && g_strcmp0(name, "filter_show_days") == 0)
+ {
+ gtk_widget_set_sensitive(priv->fd.table, !active);
+ gtk_widget_set_sensitive(priv->fd.num_days, active);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(priv->fd.num_days), priv->fd.days);
+ }
else
{
+ gtk_widget_set_sensitive(priv->fd.table, FALSE);
+ gtk_widget_set_sensitive(priv->fd.num_days, FALSE);
+ priv->fd.days = 0;
priv->fd.start_time = 0;
priv->fd.end_time = 0;
}
@@ -2460,6 +2498,34 @@ gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button,
}
+/** This function is called when the "number of days" spin button is
+ * changed which is then saved and updates the time limitation on
+ * the register query. This is handled by a helper function as
+ * potentialy all widgets will need to be examined.
+ *
+ * @param button A pointer to the "number of days" spin button.
+ *
+ * @param page A pointer to the GncPluginPageRegister that is
+ * associated with this filter dialog.
+ */
+void
+gnc_plugin_page_register_filter_days_changed_cb (GtkSpinButton *button,
+ GncPluginPageRegister *page)
+{
+ GncPluginPageRegisterPrivate *priv;
+
+ g_return_if_fail(GTK_IS_SPIN_BUTTON(button));
+ g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+
+ ENTER("(button %p, page %p)", button, page);
+ priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+
+ priv->fd.days = gtk_spin_button_get_value(GTK_SPIN_BUTTON(button));
+ gnc_ppr_update_date_query(page);
+ LEAVE(" ");
+}
+
+
/** This function is called when one of the start date entry widgets
* is updated. It simply calls common routines to determine the
* start/end times and update the register query.
@@ -2639,6 +2705,7 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
gnc_ppr_update_status_query(page);
priv->fd.start_time = priv->fd.original_start_time;
priv->fd.end_time = priv->fd.original_end_time;
+ priv->fd.days = priv->fd.original_days;
priv->fd.save_filter = priv->fd.original_save_filter;
gnc_ppr_update_date_query(page);
}
@@ -2676,6 +2743,16 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
filter = g_strconcat (tmp, ",0", NULL);
g_free (tmp);
+ tmp = g_strdup (filter);
+ g_free (filter);
+
+ // number of days
+ if (priv->fd.days > 0)
+ filter = g_strdup_printf ("%s,%d", tmp, priv->fd.days);
+ else
+ filter = g_strconcat (tmp, ",0", NULL);
+
+ g_free (tmp);
PINFO("The filter to save is %s", filter);
gnc_plugin_page_register_set_filter (plugin_page, filter);
@@ -2730,6 +2807,11 @@ gnc_plugin_page_register_set_filter_tooltip (GncPluginPageRegister *page)
text_start = g_strdup_printf ("%s %s", _("Start Date:"), sdate);
g_free (sdate);
}
+
+ // filtered number of days
+ if (priv->fd.days > 0)
+ text_start = g_strdup_printf ("%s %d", _("Show previous number of days:"), priv->fd.days);
+
// filtered end time
if (priv->fd.end_time != 0)
{
@@ -2737,6 +2819,7 @@ gnc_plugin_page_register_set_filter_tooltip (GncPluginPageRegister *page)
text_end = g_strdup_printf ("%s %s", _("End Date:"), edate);
g_free (edate);
}
+
// filtered match items
if (priv->fd.cleared_match != 31)
{
@@ -3466,6 +3549,7 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
/* Create the dialog */
builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "days_adjustment");
gnc_builder_add_from_file (builder, "gnc-plugin-page-register.glade", "filter_by_dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "filter_by_dialog"));
priv->fd.dialog = dialog;
@@ -3492,16 +3576,40 @@ gnc_plugin_page_register_cmd_view_filter_by (GtkAction *action,
if (priv->fd.save_filter == TRUE)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ /* Set up number of days */
+ priv->fd.num_days = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_num_days"));
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_days"));
- /* Set the date info */
- button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_range"));
query = gnc_ledger_display_get_query (priv->ledger);
- xaccQueryGetDateMatchTT(query, &start_time, &end_time);
+
+ if (priv->fd.days > 0) // using number of days
+ {
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(priv->fd.num_days), TRUE);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(priv->fd.num_days), priv->fd.days);
+ priv->fd.original_days = priv->fd.days;
+
+ /* Set the start_time and end_time to 0 */
+ start_time = 0;
+ end_time = 0;
+ }
+ else
+ {
+ gtk_widget_set_sensitive(GTK_WIDGET(priv->fd.num_days), FALSE);
+ priv->fd.original_days = 0;
+ priv->fd.days = 0;
+
+ /* Get the start and end times */
+ xaccQueryGetDateMatchTT(query, &start_time, &end_time);
+ }
+
+ /* Set the date info */
priv->fd.original_start_time = start_time;
priv->fd.start_time = start_time;
priv->fd.original_end_time = end_time;
priv->fd.end_time = end_time;
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "filter_show_range"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), start_time || end_time);
table = GTK_WIDGET(gtk_builder_get_object (builder, "select_range_table"));
priv->fd.table = table;
diff --git a/gnucash/gtkbuilder/gnc-plugin-page-register.glade b/gnucash/gtkbuilder/gnc-plugin-page-register.glade
index 20bf4e0..ba509bd 100644
--- a/gnucash/gtkbuilder/gnc-plugin-page-register.glade
+++ b/gnucash/gtkbuilder/gnc-plugin-page-register.glade
@@ -1,7 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
+ <object class="GtkAdjustment" id="days_adjustment">
+ <property name="upper">1100</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
<object class="GtkDialog" id="filter_by_dialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -87,19 +92,53 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label847680">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioButton" id="filter_show_days">
+ <property name="label" translatable="yes">Show _number of days</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">filter_show_all</property>
+ <signal name="toggled" handler="gnc_plugin_page_register_filter_select_range_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="filter_show_num_days">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Valid range is 0 to 1100 days
+If 0, all previous days included</property>
+ <property name="adjustment">days_adjustment</property>
+ <property name="numeric">True</property>
+ <signal name="value-changed" handler="gnc_plugin_page_register_filter_days_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="filter_show_range">
- <property name="label" translatable="yes">Select Range:</property>
+ <property name="label" translatable="yes">Select _Range:</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -123,6 +162,7 @@
<child>
<object class="GtkLabel" id="label847682">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Filter By Dialog, Date Tab, Start section">Start:</property>
</object>
<packing>
@@ -209,6 +249,7 @@
<child>
<object class="GtkLabel" id="label847684">
<property name="visible">True</property>
+ <property name="can_focus">False</property>
<property name="label" translatable="yes" comments="Filter By Dialog, Date Tab, End section">End:</property>
</object>
<packing>
@@ -510,6 +551,9 @@
<action-widget response="-6">cancelbutton4</action-widget>
<action-widget response="-5">okbutton4</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkAdjustment" id="num_adjustment">
<property name="upper">1000000000</property>
@@ -864,6 +908,9 @@
<action-widget response="-6">cancelbutton2</action-widget>
<action-widget response="-5">okbutton2</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkAdjustment" id="tnum_adjustment">
<property name="upper">1000000000</property>
@@ -1053,6 +1100,9 @@
<action-widget response="-6">button76</action-widget>
<action-widget response="-5">button77</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkDialog" id="void_transaction_dialog">
<property name="can_focus">False</property>
@@ -1158,5 +1208,8 @@
<action-widget response="-6">cancelbutton1</action-widget>
<action-widget response="-5">okbutton1</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
commit 97a566ae280f664b4172375a331cd7859f78395c
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 06:13:35 2018 +0100
Creating filter was leaking while being put together
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index b779651..85d3ebd 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -2648,29 +2648,36 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
if (priv->fd.save_filter)
{
- gchar* filter;
- filter = g_strdup_printf("0x%04x", priv->fd.cleared_match);
+ gchar* filter = g_strdup_printf("0x%04x", priv->fd.cleared_match); // cleared match
+ gchar *tmp = g_strdup (filter);
+ // start time
if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.start_date_choose)) && priv->fd.start_time != 0 )
{
gchar *timeval = gnc_plugin_page_register_filter_time2dmy(priv->fd.start_time);
- filter = g_strconcat ( filter, ",", timeval, NULL);
+ filter = g_strconcat (tmp, ",", timeval, NULL);
g_free (timeval);
}
else
- filter = g_strconcat ( filter, ",0", NULL);
+ filter = g_strconcat (tmp, ",0", NULL);
+ g_free (tmp);
+ tmp = g_strdup (filter);
+ g_free (filter);
+
+ // end time
if ( gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->fd.end_date_choose)) && priv->fd.end_time != 0 )
{
gchar *timeval = gnc_plugin_page_register_filter_time2dmy(priv->fd.end_time);
- filter = g_strconcat ( filter, ",", timeval, NULL);
+ filter = g_strconcat (tmp, ",", timeval, NULL);
g_free (timeval);
}
else
- filter = g_strconcat ( filter, ",0", NULL);
+ filter = g_strconcat (tmp, ",0", NULL);
- PINFO("The filter to save is %s", filter);
+ g_free (tmp);
+ PINFO("The filter to save is %s", filter);
gnc_plugin_page_register_set_filter (plugin_page, filter);
g_free (filter);
}
commit 6eac7e1ed0b5cfc8e42fb1afd846e387f6aec680
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Jun 19 05:26:11 2018 +0100
There is no reason why you can not just have an end date
Change the logic so the date checks are not nested.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index fc1f903..b779651 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -1187,15 +1187,15 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
priv->fd.start_time = gnc_plugin_page_register_filter_dmy2time (filter[1] );
priv->fd.start_time = gnc_time64_get_day_start(priv->fd.start_time);
filter_changed = filter_changed + 1;
+ }
- if (filter[2] && (g_strcmp0 (filter[2], "0") != 0 ))
- {
- PINFO("Loaded Filter End Date is %s", filter[2]);
+ if (filter[2] && (g_strcmp0 (filter[2], "0") != 0 ))
+ {
+ PINFO("Loaded Filter End Date is %s", filter[2]);
- priv->fd.end_time = gnc_plugin_page_register_filter_dmy2time (filter[2] );
- priv->fd.end_time = gnc_time64_get_day_end(priv->fd.end_time);
- filter_changed = filter_changed + 1;
- }
+ priv->fd.end_time = gnc_plugin_page_register_filter_dmy2time (filter[2] );
+ priv->fd.end_time = gnc_time64_get_day_end(priv->fd.end_time);
+ filter_changed = filter_changed + 1;
}
if (filter_changed != 0)
commit 632c7c724ea4f4137d265e4e034fbec85920aecc
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Mon Jun 18 18:07:46 2018 +0100
Update the filter when General Journal created.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 04c5ab4..fc1f903 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -1208,6 +1208,17 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
gnc_ppr_update_status_query (page);
gnc_ppr_update_date_query(page);
}
+ else // LD_GL
+ {
+ time64 start_time, end_time;
+ Query *query = gnc_ledger_display_get_query (priv->ledger);
+
+ xaccQueryGetDateMatchTT(query, &start_time, &end_time);
+ priv->fd.original_start_time = start_time;
+ priv->fd.start_time = start_time;
+ priv->fd.original_end_time = end_time;
+ priv->fd.end_time = end_time;
+ }
// Set filter tooltip for summary bar
gnc_plugin_page_register_set_filter_tooltip (page);
commit d74ec9aa6cc794d34a6d7082a8948463d896034c
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Mon Jun 18 18:06:13 2018 +0100
Only show update the summary bar left labels when present
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index ad8a6d4..da5ba2c 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -540,21 +540,24 @@ gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
print_info = gnc_account_print_info( leader, TRUE );
reverse = gnc_reverse_balance( leader );
- gsr_update_summary_label( gsr->balance_label,
- xaccAccountGetPresentBalance,
- leader, print_info, commodity, reverse, euro );
- gsr_update_summary_label( gsr->cleared_label,
- xaccAccountGetClearedBalance,
- leader, print_info, commodity, reverse, euro );
- gsr_update_summary_label( gsr->reconciled_label,
- xaccAccountGetReconciledBalance,
- leader, print_info, commodity, reverse, euro );
- gsr_update_summary_label( gsr->future_label,
- xaccAccountGetBalance,
- leader, print_info, commodity, reverse, euro );
- gsr_update_summary_label( gsr->projectedminimum_label,
- xaccAccountGetProjectedMinimumBalance,
- leader, print_info, commodity, reverse, euro );
+ if (gsr->balance_label != NULL) // only test the first as they are a group
+ {
+ gsr_update_summary_label( gsr->balance_label,
+ xaccAccountGetPresentBalance,
+ leader, print_info, commodity, reverse, euro );
+ gsr_update_summary_label( gsr->cleared_label,
+ xaccAccountGetClearedBalance,
+ leader, print_info, commodity, reverse, euro );
+ gsr_update_summary_label( gsr->reconciled_label,
+ xaccAccountGetReconciledBalance,
+ leader, print_info, commodity, reverse, euro );
+ gsr_update_summary_label( gsr->future_label,
+ xaccAccountGetBalance,
+ leader, print_info, commodity, reverse, euro );
+ gsr_update_summary_label( gsr->projectedminimum_label,
+ xaccAccountGetProjectedMinimumBalance,
+ leader, print_info, commodity, reverse, euro );
+ }
// Sort label
if (gsr->sort_label != NULL)
commit 3f9a8977c176eb43131e34de9f83505fb20eb727
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Mon Jun 18 18:05:30 2018 +0100
Add the summary bar to the GL and subaccount registers
Add the summary bar to the General Journal and sub account register but
only show sort and filter labels.
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index 6e20748..ad8a6d4 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -2139,7 +2139,9 @@ gsr_summarybar_set_arrow_draw (GNCSplitReg *gsr)
GtkWidget *
gsr_create_summary_bar( GNCSplitReg *gsr )
{
- GtkWidget *summarybar;
+ GtkWidget *summarybar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
+ gtk_box_set_homogeneous (GTK_BOX (summarybar), FALSE);
+ gtk_widget_set_name (summarybar, "gnc-id-summarybar");
gsr->cleared_label = NULL;
gsr->balance_label = NULL;
@@ -2152,28 +2154,21 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
gsr->shares_label = NULL;
gsr->value_label = NULL;
- if ( gnc_ledger_display_type(gsr->ledger) >= LD_SUBACCOUNT )
- {
- gsr->summarybar = NULL;
- return NULL;
- }
-
- summarybar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_set_homogeneous (GTK_BOX (summarybar), FALSE);
- gtk_widget_set_name (summarybar, "gnc-id-summarybar");
-
- if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
+ if (gnc_ledger_display_type(gsr->ledger) == LD_SINGLE)
{
- gsr->balance_label = add_summary_label (summarybar, TRUE, _("Present:"), NULL);
- gsr->future_label = add_summary_label (summarybar, TRUE, _("Future:"), NULL);
- gsr->cleared_label = add_summary_label (summarybar, TRUE, _("Cleared:"), NULL);
- gsr->reconciled_label = add_summary_label (summarybar, TRUE, _("Reconciled:"), NULL);
- gsr->projectedminimum_label = add_summary_label (summarybar, TRUE, _("Projected Minimum:"), NULL);
- }
- else
- {
- gsr->shares_label = add_summary_label (summarybar, TRUE, _("Shares:"), NULL);
- gsr->value_label = add_summary_label (summarybar, TRUE, _("Current Value:"), NULL);
+ if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
+ {
+ gsr->balance_label = add_summary_label (summarybar, TRUE, _("Present:"), NULL);
+ gsr->future_label = add_summary_label (summarybar, TRUE, _("Future:"), NULL);
+ gsr->cleared_label = add_summary_label (summarybar, TRUE, _("Cleared:"), NULL);
+ gsr->reconciled_label = add_summary_label (summarybar, TRUE, _("Reconciled:"), NULL);
+ gsr->projectedminimum_label = add_summary_label (summarybar, TRUE, _("Projected Minimum:"), NULL);
+ }
+ else
+ {
+ gsr->shares_label = add_summary_label (summarybar, TRUE, _("Shares:"), NULL);
+ gsr->value_label = add_summary_label (summarybar, TRUE, _("Current Value:"), NULL);
+ }
}
gsr->filter_label = add_summary_label (summarybar, FALSE, "", NULL);
commit b50c8a57fa539bd50e61739511e28f60e8a09dfc
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Mon Jun 18 17:37:32 2018 +0100
Show whether there is a filter on the right of the summary bar
On the right of the summary bar indicate whether there is a filter and
if there is display a tooltip with the settings. Also the filter label
can be altered by the css class "gnc-class-highlight".
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index d3e7283..04c5ab4 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -133,6 +133,7 @@ static time64 gnc_plugin_page_register_filter_dmy2time (char *date_string);
static gchar *gnc_plugin_page_register_filter_time2dmy (time64 raw_time);
static gchar *gnc_plugin_page_register_get_filter (GncPluginPage *plugin_page);
void gnc_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter);
+static void gnc_plugin_page_register_set_filter_tooltip (GncPluginPageRegister *page);
static void gnc_ppr_update_status_query (GncPluginPageRegister *page);
static void gnc_ppr_update_date_query (GncPluginPageRegister *page);
@@ -1208,6 +1209,9 @@ gnc_plugin_page_register_create_widget (GncPluginPage *plugin_page)
gnc_ppr_update_date_query(page);
}
+ // Set filter tooltip for summary bar
+ gnc_plugin_page_register_set_filter_tooltip (page);
+
plugin_page->summarybar = gsr_create_summary_bar(priv->gsr);
if (plugin_page->summarybar)
{
@@ -2159,6 +2163,9 @@ gnc_ppr_update_status_query (GncPluginPageRegister *page)
if (priv->fd.cleared_match != CLEARED_ALL)
xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QOF_QUERY_AND);
+ // Set filter tooltip for summary bar
+ gnc_plugin_page_register_set_filter_tooltip (page);
+
gnc_ledger_display_refresh (priv->ledger);
LEAVE(" ");
}
@@ -2215,6 +2222,9 @@ gnc_ppr_update_date_query (GncPluginPageRegister *page)
QOF_QUERY_AND);
}
+ // Set filter tooltip for summary bar
+ gnc_plugin_page_register_set_filter_tooltip (page);
+
gnc_ledger_display_refresh (priv->ledger);
LEAVE(" ");
}
@@ -2659,6 +2669,148 @@ gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog,
LEAVE(" ");
}
+static gchar*
+gpp_get_cleared_match_filter_text (gchar *text_in, gboolean *first, const gchar *text)
+{
+ gchar *result;
+ gchar *temp = g_strdup (text_in);
+ g_free (text_in);
+
+ if (*first)
+ {
+ result = g_strconcat (temp, text, NULL);
+ *first = FALSE;
+ }
+ else
+ result = g_strconcat (temp, ", ", text, NULL);
+ g_free (temp);
+
+ return result;
+}
+
+static void
+gnc_plugin_page_register_set_filter_tooltip (GncPluginPageRegister *page)
+{
+ GncPluginPageRegisterPrivate *priv;
+ GncPluginPage *plugin_page;
+ gchar *text = NULL;
+ gchar *text_header = g_strdup_printf ("%s", _("Filter By:"));
+ gchar *text_start = NULL;
+ gchar *text_end = NULL;
+ gchar *text_cleared = NULL;
+
+ g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+
+ ENTER(" ");
+ priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
+ plugin_page = GNC_PLUGIN_PAGE(page);
+
+ // filtered start time
+ if (priv->fd.start_time != 0)
+ {
+ gchar *sdate = qof_print_date (priv->fd.start_time);
+ text_start = g_strdup_printf ("%s %s", _("Start Date:"), sdate);
+ g_free (sdate);
+ }
+ // filtered end time
+ if (priv->fd.end_time != 0)
+ {
+ gchar *edate = qof_print_date (priv->fd.end_time);
+ text_end = g_strdup_printf ("%s %s", _("End Date:"), edate);
+ g_free (edate);
+ }
+ // filtered match items
+ if (priv->fd.cleared_match != 31)
+ {
+ gchar *show = g_strdup ("");
+ gchar *hide = g_strdup ("");
+
+ gboolean first_show = TRUE, first_hide = TRUE;
+
+ if ((priv->fd.cleared_match & 0x01) == 0x01)
+ show = gpp_get_cleared_match_filter_text (show, &first_show, _("Unreconciled"));
+ else
+ hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Unreconciled"));
+
+ if ((priv->fd.cleared_match & 0x02) == 0x02)
+ show = gpp_get_cleared_match_filter_text (show, &first_show, _("Cleared"));
+ else
+ hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Cleared"));
+
+ if ((priv->fd.cleared_match & 0x04) == 0x04)
+ show = gpp_get_cleared_match_filter_text (show, &first_show, _("Reconciled"));
+ else
+ hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Reconciled"));
+
+ if ((priv->fd.cleared_match & 0x08) == 0x08)
+ show = gpp_get_cleared_match_filter_text (show, &first_show, _("Frozen"));
+ else
+ hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Frozen"));
+
+ if ((priv->fd.cleared_match & 0x10) == 0x10)
+ show = gpp_get_cleared_match_filter_text (show, &first_show, _("Voided"));
+ else
+ hide = gpp_get_cleared_match_filter_text (hide, &first_hide, _("Voided"));
+
+ if (g_strcmp0 (show, "") == 0)
+ text_cleared = g_strconcat (_("Hide:"), " ", hide, NULL);
+ else
+ text_cleared = g_strconcat (_("Show:"), " ", show, "\n", _("Hide:"), " ", hide, NULL);
+
+ g_free (show);
+ g_free (hide);
+
+ }
+ // create the tooltip based on created text variables
+ if ((text_start != NULL) || (text_end != NULL) || (text_cleared != NULL))
+ {
+ if (text_start != NULL)
+ text = g_strconcat (text_header, "\n", text_start, NULL);
+
+ if (text_end != NULL)
+ {
+ if (text == NULL)
+ text = g_strconcat (text_header, "\n", text_end, NULL);
+ else
+ {
+ gchar *temp = g_strdup (text);
+ g_free (text);
+ text = g_strconcat (temp, "\n", text_end, NULL);
+ g_free (temp);
+ }
+ }
+
+ if (text_cleared != NULL)
+ {
+ if (text == NULL)
+ text = g_strconcat (text_header, "\n", text_cleared, NULL);
+ else
+ {
+ gchar *temp = g_strdup (text);
+ g_free (text);
+ text = g_strconcat (temp, "\n", text_cleared, NULL);
+ g_free (temp);
+ }
+ }
+ }
+ // free the existing text if present
+ if (priv->gsr->filter_text != NULL)
+ g_free (priv->gsr->filter_text);
+
+ // set the tooltip text variable in the gsr
+ priv->gsr->filter_text = g_strdup (text);
+
+ if (text_start)
+ g_free (text_start);
+ if (text_end)
+ g_free (text_end);
+ if (text_cleared)
+ g_free (text_cleared);
+ g_free (text_header);
+ g_free (text);
+
+ LEAVE(" ");
+}
/************************************************************/
/* Report Helper Functions */
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index 4f87827..6e20748 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -351,6 +351,7 @@ gnc_split_reg_init( GNCSplitReg *gsr )
gsr->sort_type = BY_STANDARD;
gsr->sort_rev = FALSE;
gsr->sort_arrow_handler_id = 0;
+ gsr->filter_text = NULL;
gsr->width = -1;
gsr->height = -1;
gsr->numRows = 10;
@@ -447,6 +448,10 @@ gsr_setup_status_widgets( GNCSplitReg *gsr )
void
gnc_split_reg_destroy_cb(GtkWidget *widget, gpointer data)
{
+ GNCSplitReg *gsr = data;
+
+ if (gsr->filter_text)
+ g_free (gsr->filter_text);
}
/**
@@ -615,6 +620,26 @@ gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
gtk_label_set_text (GTK_LABEL(gsr->sort_label), text);
}
+ // Filter label
+ if (gsr->filter_label != NULL)
+ {
+ gchar *old_tt_text = gtk_widget_get_tooltip_text (GTK_WIDGET(gsr->filter_label));
+
+ // check for a change in text
+ if (g_strcmp0 (old_tt_text, gsr->filter_text) != 0)
+ {
+ if (gsr->filter_text != NULL)
+ gtk_label_set_text (GTK_LABEL(gsr->filter_label), _("Filtered"));
+ else
+ gtk_label_set_text (GTK_LABEL(gsr->filter_label), "");
+
+ gtk_widget_set_tooltip_text (GTK_WIDGET(gsr->filter_label), gsr->filter_text);
+
+ if (old_tt_text)
+ g_free (old_tt_text);
+ }
+ }
+
if (gsr->shares_label == NULL && gsr->value_label == NULL)
return;
amount = xaccAccountGetBalance( leader );
@@ -2092,7 +2117,7 @@ add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label
label = gtk_label_new( "" );
gnc_label_set_alignment(label, 1.0, 0.5 );
gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
-
+
if (extra != NULL)
gtk_box_pack_start( GTK_BOX(hbox), extra, FALSE, FALSE, 0 );
@@ -2123,6 +2148,7 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
gsr->projectedminimum_label = NULL;
gsr->sort_label = NULL;
gsr->sort_arrow = NULL;
+ gsr->filter_label = NULL;
gsr->shares_label = NULL;
gsr->value_label = NULL;
@@ -2150,8 +2176,11 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
gsr->value_label = add_summary_label (summarybar, TRUE, _("Current Value:"), NULL);
}
+ gsr->filter_label = add_summary_label (summarybar, FALSE, "", NULL);
gsr->sort_arrow = gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_SMALL_TOOLBAR);
gsr->sort_label = add_summary_label (summarybar, FALSE, _("Sort By: "), gsr->sort_arrow);
+
+ gnc_widget_set_style_context (GTK_WIDGET(gsr->filter_label), "gnc-class-highlight");
gnc_widget_set_style_context (GTK_WIDGET(gsr->sort_arrow), "gnc-class-highlight");
gsr->summarybar = summarybar;
diff --git a/gnucash/gnome/gnc-split-reg.h b/gnucash/gnome/gnc-split-reg.h
index a8e2d26..6dd048e 100644
--- a/gnucash/gnome/gnc-split-reg.h
+++ b/gnucash/gnome/gnc-split-reg.h
@@ -76,6 +76,7 @@ struct _GNCSplitReg
GtkWidget *value_label;
GtkWidget *sort_label;
GtkWidget *sort_arrow;
+ GtkWidget *filter_label;
/** The current ledger display. **/
GNCLedgerDisplay *ledger;
@@ -87,6 +88,7 @@ struct _GNCSplitReg
guint sort_type;
gboolean sort_rev;
gulong sort_arrow_handler_id;
+ gchar *filter_text;
gboolean read_only;
};
commit b4db066d84f3ec665928bf6e7c984e1d8dba1505
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Mon Jun 18 13:11:37 2018 +0100
Add the sort order to the right of the summary bar
Add the sort order to the right of the summary bar with a tooltip that
shows whether ascending or descending and an arrow. When arrow can
also be emphasized with css by using the class "gnc-class-highlight".
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index b7829e6..4f87827 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -66,7 +66,9 @@ static QofLogModule log_module = GNC_MOD_GUI;
void gnc_split_reg_raise( GNCSplitReg *gsr );
static GtkWidget* add_summary_label( GtkWidget *summarybar, gboolean pack_start,
- const char *label_str );
+ const char *label_str, GtkWidget *extra );
+
+static void gsr_summarybar_set_arrow_draw (GNCSplitReg *gsr);
static void gnc_split_reg_determine_read_only( GNCSplitReg *gsr );
@@ -347,6 +349,8 @@ gnc_split_reg_init( GNCSplitReg *gsr )
gtk_orientable_set_orientation (GTK_ORIENTABLE(gsr), GTK_ORIENTATION_VERTICAL);
gsr->sort_type = BY_STANDARD;
+ gsr->sort_rev = FALSE;
+ gsr->sort_arrow_handler_id = 0;
gsr->width = -1;
gsr->height = -1;
gsr->numRows = 10;
@@ -546,6 +550,71 @@ gsr_redraw_all_cb (GnucashRegister *g_reg, gpointer data)
gsr_update_summary_label( gsr->projectedminimum_label,
xaccAccountGetProjectedMinimumBalance,
leader, print_info, commodity, reverse, euro );
+
+ // Sort label
+ if (gsr->sort_label != NULL)
+ {
+ gchar *old_tt_text = gtk_widget_get_tooltip_text (GTK_WIDGET(gsr->sort_label));
+ gchar *new_tt_text;
+ gchar *text = NULL;
+
+ switch (gsr->sort_type)
+ {
+ case (0):
+ text = _("None");
+ break;
+ case (1):
+ text = _("Standard Order");
+ break;
+ case (2):
+ text = _("Date");
+ break;
+ case (3):
+ text = _("Date of Entry");
+ break;
+ case (4):
+ text = _("Statement Date");
+ break;
+ case (5):
+ text = _("Number");
+ break;
+ case (6):
+ text = _("Amount");
+ break;
+ case (7):
+ text = _("Memo");
+ break;
+ case (8):
+ text = _("Description");
+ break;
+ case (9):
+ text = _("Action");
+ break;
+ case (10):
+ text = _("Notes");
+ break;
+ }
+
+ if (gsr->sort_rev)
+ gtk_widget_set_tooltip_text (GTK_WIDGET(gsr->sort_label), _("Descending"));
+ else
+ gtk_widget_set_tooltip_text (GTK_WIDGET(gsr->sort_label), _("Ascending"));
+
+ new_tt_text = gtk_widget_get_tooltip_text (GTK_WIDGET(gsr->sort_label));
+
+ // does the arrow need changing
+ if (g_strcmp0 (old_tt_text, new_tt_text) != 0)
+ gsr_summarybar_set_arrow_draw (gsr);
+
+ if (old_tt_text)
+ g_free (old_tt_text);
+
+ if (new_tt_text)
+ g_free (new_tt_text);
+
+ gtk_label_set_text (GTK_LABEL(gsr->sort_label), text);
+ }
+
if (gsr->shares_label == NULL && gsr->value_label == NULL)
return;
amount = xaccAccountGetBalance( leader );
@@ -1868,14 +1937,15 @@ gnc_split_reg_sort_notes_cb(GtkWidget *w, gpointer data)
void
gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev)
{
- /* Note: sort_reversed is the boolean opposite of sort_increasing
- * so when rev == true, we're sorting decreasing
- * In other words, qof_query_set_sort_increasing should
- * always use the inverse of rev.
- */
- Query *query = gnc_ledger_display_get_query( gsr->ledger );
- qof_query_set_sort_increasing (query, !rev, !rev, !rev);
- gnc_ledger_display_refresh( gsr->ledger );
+ /* Note: sort_reversed is the boolean opposite of sort_increasing
+ * so when rev == true, we're sorting decreasing
+ * In other words, qof_query_set_sort_increasing should
+ * always use the inverse of rev.
+ */
+ Query *query = gnc_ledger_display_get_query( gsr->ledger );
+ qof_query_set_sort_increasing (query, !rev, !rev, !rev);
+ gsr->sort_rev = rev;
+ gnc_ledger_display_refresh( gsr->ledger );
}
static void
@@ -2003,7 +2073,7 @@ gnc_split_reg_size_allocate (GtkWidget *widget,
static
GtkWidget*
-add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label_str)
+add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label_str, GtkWidget *extra)
{
GtkWidget *hbox;
GtkWidget *label;
@@ -2022,10 +2092,25 @@ add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label
label = gtk_label_new( "" );
gnc_label_set_alignment(label, 1.0, 0.5 );
gtk_box_pack_start( GTK_BOX(hbox), label, FALSE, FALSE, 0 );
+
+ if (extra != NULL)
+ gtk_box_pack_start( GTK_BOX(hbox), extra, FALSE, FALSE, 0 );
return label;
}
+static void
+gsr_summarybar_set_arrow_draw (GNCSplitReg *gsr)
+{
+ if (gsr->sort_arrow_handler_id > 0)
+ g_signal_handler_disconnect (G_OBJECT(gsr->sort_arrow), gsr->sort_arrow_handler_id);
+
+ gsr->sort_arrow_handler_id = g_signal_connect (G_OBJECT (gsr->sort_arrow), "draw",
+ G_CALLBACK (gnc_draw_arrow_cb), GINT_TO_POINTER(gsr->sort_rev));
+
+ gtk_widget_queue_draw (gsr->sort_arrow);
+}
+
GtkWidget *
gsr_create_summary_bar( GNCSplitReg *gsr )
{
@@ -2036,6 +2121,8 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
gsr->reconciled_label = NULL;
gsr->future_label = NULL;
gsr->projectedminimum_label = NULL;
+ gsr->sort_label = NULL;
+ gsr->sort_arrow = NULL;
gsr->shares_label = NULL;
gsr->value_label = NULL;
@@ -2047,21 +2134,26 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
summarybar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_box_set_homogeneous (GTK_BOX (summarybar), FALSE);
+ gtk_widget_set_name (summarybar, "gnc-id-summarybar");
if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
{
- gsr->balance_label = add_summary_label (summarybar, TRUE, _("Present:"));
- gsr->future_label = add_summary_label (summarybar, TRUE, _("Future:"));
- gsr->cleared_label = add_summary_label (summarybar, TRUE, _("Cleared:"));
- gsr->reconciled_label = add_summary_label (summarybar, TRUE, _("Reconciled:"));
- gsr->projectedminimum_label = add_summary_label (summarybar, TRUE, _("Projected Minimum:"));
+ gsr->balance_label = add_summary_label (summarybar, TRUE, _("Present:"), NULL);
+ gsr->future_label = add_summary_label (summarybar, TRUE, _("Future:"), NULL);
+ gsr->cleared_label = add_summary_label (summarybar, TRUE, _("Cleared:"), NULL);
+ gsr->reconciled_label = add_summary_label (summarybar, TRUE, _("Reconciled:"), NULL);
+ gsr->projectedminimum_label = add_summary_label (summarybar, TRUE, _("Projected Minimum:"), NULL);
}
else
{
- gsr->shares_label = add_summary_label (summarybar, TRUE, _("Shares:"));
- gsr->value_label = add_summary_label (summarybar, TRUE, _("Current Value:"));
+ gsr->shares_label = add_summary_label (summarybar, TRUE, _("Shares:"), NULL);
+ gsr->value_label = add_summary_label (summarybar, TRUE, _("Current Value:"), NULL);
}
+ gsr->sort_arrow = gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ gsr->sort_label = add_summary_label (summarybar, FALSE, _("Sort By: "), gsr->sort_arrow);
+ gnc_widget_set_style_context (GTK_WIDGET(gsr->sort_arrow), "gnc-class-highlight");
+
gsr->summarybar = summarybar;
/* Force the first update */
diff --git a/gnucash/gnome/gnc-split-reg.h b/gnucash/gnome/gnc-split-reg.h
index 018836f..a8e2d26 100644
--- a/gnucash/gnome/gnc-split-reg.h
+++ b/gnucash/gnome/gnc-split-reg.h
@@ -74,6 +74,8 @@ struct _GNCSplitReg
GtkWidget *projectedminimum_label;
GtkWidget *shares_label;
GtkWidget *value_label;
+ GtkWidget *sort_label;
+ GtkWidget *sort_arrow;
/** The current ledger display. **/
GNCLedgerDisplay *ledger;
@@ -82,7 +84,9 @@ struct _GNCSplitReg
gint numRows;
- guint sort_type;
+ guint sort_type;
+ gboolean sort_rev;
+ gulong sort_arrow_handler_id;
gboolean read_only;
};
@@ -197,7 +201,7 @@ void gnc_split_reg_set_sort_type_force( GNCSplitReg *gsr, SortType t, gboolean f
/**
* Set/get sort order of register
- **/
+ **/
void gnc_split_reg_set_sort_reversed(GNCSplitReg *gsr, gboolean rev);
commit c3724431e9fd3cd840bc6910e4c0df99bdf08abe
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jun 17 20:39:35 2018 +0100
Add a parameter to add_summary_label to specify packing order
Add boolean pack_start to add_summary_label to indicate whether the
labels should be packed at the start or end of the summary bar.
diff --git a/gnucash/gnome/gnc-split-reg.c b/gnucash/gnome/gnc-split-reg.c
index aba9fdc..b7829e6 100644
--- a/gnucash/gnome/gnc-split-reg.c
+++ b/gnucash/gnome/gnc-split-reg.c
@@ -65,7 +65,7 @@ static QofLogModule log_module = GNC_MOD_GUI;
/***** PROTOTYPES ***************************************************/
void gnc_split_reg_raise( GNCSplitReg *gsr );
-static GtkWidget* add_summary_label( GtkWidget *summarybar,
+static GtkWidget* add_summary_label( GtkWidget *summarybar, gboolean pack_start,
const char *label_str );
static void gnc_split_reg_determine_read_only( GNCSplitReg *gsr );
@@ -2003,14 +2003,17 @@ gnc_split_reg_size_allocate (GtkWidget *widget,
static
GtkWidget*
-add_summary_label (GtkWidget *summarybar, const char *label_str)
+add_summary_label (GtkWidget *summarybar, gboolean pack_start, const char *label_str)
{
GtkWidget *hbox;
GtkWidget *label;
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
- gtk_box_pack_start( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
+ if (pack_start)
+ gtk_box_pack_start( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
+ else
+ gtk_box_pack_end( GTK_BOX(summarybar), hbox, FALSE, FALSE, 5 );
label = gtk_label_new( label_str );
gnc_label_set_alignment(label, 1.0, 0.5 );
@@ -2047,16 +2050,16 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
if (!xaccAccountIsPriced(gnc_ledger_display_leader(gsr->ledger)))
{
- gsr->balance_label = add_summary_label (summarybar, _("Present:"));
- gsr->future_label = add_summary_label (summarybar, _("Future:"));
- gsr->cleared_label = add_summary_label (summarybar, _("Cleared:"));
- gsr->reconciled_label = add_summary_label (summarybar, _("Reconciled:"));
- gsr->projectedminimum_label = add_summary_label (summarybar, _("Projected Minimum:"));
+ gsr->balance_label = add_summary_label (summarybar, TRUE, _("Present:"));
+ gsr->future_label = add_summary_label (summarybar, TRUE, _("Future:"));
+ gsr->cleared_label = add_summary_label (summarybar, TRUE, _("Cleared:"));
+ gsr->reconciled_label = add_summary_label (summarybar, TRUE, _("Reconciled:"));
+ gsr->projectedminimum_label = add_summary_label (summarybar, TRUE, _("Projected Minimum:"));
}
else
{
- gsr->shares_label = add_summary_label (summarybar, _("Shares:"));
- gsr->value_label = add_summary_label (summarybar, _("Current Value:"));
+ gsr->shares_label = add_summary_label (summarybar, TRUE, _("Shares:"));
+ gsr->value_label = add_summary_label (summarybar, TRUE, _("Current Value:"));
}
gsr->summarybar = summarybar;
commit 446446948404b4fd61846042fc93724a8fe84f95
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 16 16:12:14 2018 -0700
Revert changes associated with Bug 775368
Return commodity-utilities.scm to its state at 5803c141.
Too many changes in between to do a straight revert.
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 6d7b5dc..4238d1a 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -63,28 +63,16 @@
(xaccSplitGetParent s)))
(acc-comm
(xaccAccountGetCommodity
- (xaccSplitGetAccount s)))
- (acc-type
- (xaccAccountGetType
- (xaccSplitGetAccount s)))
- (split-amt
- (xaccSplitGetAmount s))
- )
+ (xaccSplitGetAccount s))))
(and
- ;; Same commodities, so no price:
(not (gnc-commodity-equiv
trans-comm acc-comm))
(or
- ;; No commodity, bad split
(not commodity)
- ;; Not a price that interests us
- (gnc-commodity-equiv commodity trans-comm)
- (gnc-commodity-equiv commodity acc-comm))
- ;; No amount, so no price:
- (not (gnc-numeric-zero-p split-amt))
- ;; no trading accounts so we don't count twice
- (not (eq? acc-type ACCT-TYPE-TRADING))
- )))
+ (gnc-commodity-equiv
+ commodity trans-comm)
+ (gnc-commodity-equiv
+ commodity acc-comm)))))
(qof-query-run query)))
(qof-query-destroy query)
splits))
@@ -98,8 +86,9 @@
(sort (gnc:get-match-commodity-splits currency-accounts
end-date commodity)
(lambda (a b)
- (< (xaccTransGetDate (xaccSplitGetParent a))
- (xaccTransGetDate (xaccSplitGetParent b))))))
+ (<
+ (xaccTransGetDate (xaccSplitGetParent a))
+ (xaccTransGetDate (xaccSplitGetParent b))))))
;; Returns a list of all splits in the currency-accounts up to
@@ -368,8 +357,8 @@
;; (gnc-numeric-to-double (second later))))
(if (and earlier later)
- (if (< (abs (- (first earlier) date))
- (abs (- (first later) date)))
+ (if (< (abs (- date (first earlier)))
+ (abs (- date (first later))))
(second earlier)
(second later))
(or
@@ -515,10 +504,17 @@
;; report-commodity ((cdadr newrate) 'total
;; #f))))
(set! reportlist (cons newrate reportlist))))))
- ;; The report-currency showed up on the wrong side, so it was a
- ;; "sell" for that commodity. We ignore those for cost reports
- ;; and they're already aggregated for non-cost reports.
- ))
+ ;; Huh, the report-currency showed up on the wrong side
+ ;; -- we will just add it to the reportlist on the
+ ;; right side.
+ (let ((newrate (list (car otherlist)
+ (cons (cdadr pair) (caadr pair)))))
+ ;; (warn "created new rate: "
+ ;; (gnc-commodity-value->string (list (car newrate)
+ ;; ((caadr newrate) 'total #f))) " = "
+ ;; (gnc-commodity-value->string (list
+ ;; report-commodity ((cdadr newrate) 'total #f))))
+ (set! reportlist (cons newrate reportlist)))))
(cadr otherlist))))
sumlist)
@@ -530,58 +526,29 @@
;; or more runs of gnc:resolve-unknown-comm. Maybe we could transform
;; this functions to use some kind of recursiveness.
-(define (create-commodity-list inner-comm outer-comm value-amount share-amount)
- (let ((pair (list inner-comm
- (cons (gnc:make-number-collector)
- (gnc:make-number-collector)))))
- ((caadr pair) 'add value-amount)
- ((cdadr pair) 'add share-amount)
- (list outer-comm (list pair))))
-
-(define (create-foreign-list comm-list transaction-comm account-comm
- share-amount value-amount)
- (let ((foreign-list
- (if (gnc-commodity-equiv transaction-comm (car comm-list))
- (list account-comm share-amount value-amount)
- (list transaction-comm value-amount share-amount))))
- foreign-list))
-
-(define (create-foreign-cost-list comm-list transaction-comm account-comm
- share-amount value-amount)
- (let ((foreign-list
- (if (gnc-commodity-equiv transaction-comm (car comm-list))
- (list account-comm share-amount value-amount)
- (list transaction-comm (gnc-numeric-neg value-amount)
- (gnc-numeric-neg share-amount)))))
- foreign-list))
-
-(define (create-commodity-pair foreignlist comm-list sumlist)
- (let ((pair (assoc (car foreignlist) (cadr comm-list))))
- ;; no pair already, create one
- (if (not pair)
- (set! pair (list (car foreignlist)
- (cons (gnc:make-number-collector)
- (gnc:make-number-collector)))))
- pair))
-
-;; sumlist: a multilevel alist. Each element has a commodity as key, and another
-;; alist as a value. The value-alist's elements consist of a commodity as a key,
-;; and a pair of two value-collectors as value, e.g. with only one (the report-)
-;; commodity DEM in the outer alist: ( {DEM ( [USD (400 . 1000)] [FRF (300
-;; . 100)] ) } ) where DEM,USD,FRF are <gnc:commodity> and the numbers are a
-;; numeric-collector which in turn store a <gnc:numeric>. In the example, USD
-;; 400 were bought for an amount of DEM 1000, FRF 300 were bought for DEM
-;; 100. The reason for the outer alist is that there might be commodity
-;; transactions which do not involve the report-commodity, but which can still
-;; be calculated after *all* transactions are processed. Calculate the weighted
-;; average exchange rate between all commodities and the
-;; 'report-commodity'. Uses all currency transactions up until the
-;; 'end-date'. Returns an alist, see sumlist.
-(define (gnc:get-exchange-totals report-commodity end-date cost)
+
+;; Calculate the weighted average exchange rate between all
+;; commodities and the 'report-commodity'. Uses all currency
+;; transactions up until the 'end-date'. Returns an alist, see
+;; sumlist.
+(define (gnc:get-exchange-totals report-commodity end-date)
(let ((curr-accounts
;;(filter gnc:account-has-shares? ))
;; -- use all accounts, not only share accounts, since gnucash-1.7
(gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
+ ;; sumlist: a multilevel alist. Each element has a commodity
+ ;; as key, and another alist as a value. The value-alist's
+ ;; elements consist of a commodity as a key, and a pair of two
+ ;; value-collectors as value, e.g. with only one (the report-)
+ ;; commodity DEM in the outer alist: ( {DEM ( [USD (400 .
+ ;; 1000)] [FRF (300 . 100)] ) } ) where DEM,USD,FRF are
+ ;; <gnc:commodity> and the numbers are a numeric-collector
+ ;; which in turn store a <gnc:numeric>. In the example, USD
+ ;; 400 were bought for an amount of DEM 1000, FRF 300 were
+ ;; bought for DEM 100. The reason for the outer alist is that
+ ;; there might be commodity transactions which do not involve
+ ;; the report-commodity, but which can still be calculated
+ ;; after *all* transactions are processed.
(sumlist (list (list report-commodity '()))))
(if (not (null? curr-accounts))
@@ -593,47 +560,170 @@
(xaccSplitGetParent a)))
(account-comm (xaccAccountGetCommodity
(xaccSplitGetAccount a)))
- (share-amount (if cost
- (xaccSplitGetAmount a)
- (gnc-numeric-abs (xaccSplitGetAmount a))))
- (value-amount (if cost
- (xaccSplitGetValue a)
- (gnc-numeric-abs (xaccSplitGetValue a))))
+ ;; Always use the absolute value here.
+ (share-amount (gnc-numeric-abs
+ (xaccSplitGetAmount a)))
+ (value-amount (gnc-numeric-abs
+ (xaccSplitGetValue a)))
(tmp (assoc transaction-comm sumlist))
(comm-list (if (not tmp)
(assoc account-comm sumlist)
tmp)))
- ;; entry exists already in comm-list?
- (if (not comm-list)
- ;; no, create sub-alist from scratch
- (begin
- (set! comm-list (create-commodity-list
- account-comm transaction-comm
- value-amount share-amount))
- (set! sumlist (cons comm-list sumlist)))
-
- ;;yes, check for second commodity
- (let* ((foreignlist (if cost
- (create-foreign-cost-list
- comm-list transaction-comm account-comm
- share-amount value-amount)
- (create-foreign-list
- comm-list transaction-comm account-comm
- share-amount value-amount)))
- (pair (create-commodity-pair foreignlist comm-list
- sumlist)))
- (set! comm-list (list (car comm-list)
- (cons pair (cadr comm-list))))
- (set! sumlist (cons comm-list
- (alist-delete (car comm-list) sumlist)))
- ((caadr pair) 'add (cadr foreignlist))
- ((cdadr pair) 'add (caddr foreignlist))))))
-
- (gnc:get-all-commodity-splits curr-accounts end-date)))
-
- (gnc:resolve-unknown-comm sumlist report-commodity)))
-
-(define (gnc:make-exchange-alist report-commodity end-date cost)
+
+ (cond ((gnc-numeric-zero-p share-amount)
+ ;; Without shares this is not a buy or sell; ignore it.
+ #f)
+
+ ((not comm-list)
+ ;; entry doesn't exist in comm-list
+ ;; create sub-alist from scratch
+ (let ((pair (list transaction-comm
+ (cons (gnc:make-number-collector)
+ (gnc:make-number-collector)))))
+ ((caadr pair) 'add value-amount)
+ ((cdadr pair) 'add share-amount)
+ (set! comm-list (list account-comm (list pair)))
+ ;; and add the new sub-alist to sumlist.
+ (set! sumlist (cons comm-list sumlist))))
+
+ (else
+ (let*
+ ;; Put the amounts in the right place.
+ ((foreignlist
+ (if (gnc-commodity-equiv transaction-comm
+ (car comm-list))
+ (list account-comm
+ share-amount value-amount)
+ (list transaction-comm
+ value-amount share-amount)))
+ ;; second commodity already existing in comm-list?
+ (pair (assoc (car foreignlist) (cadr comm-list))))
+ ;; if not, create a new entry in comm-list.
+ (if (not pair)
+ (begin
+ (set!
+ pair (list (car foreignlist)
+ (cons (gnc:make-number-collector)
+ (gnc:make-number-collector))))
+ (set!
+ comm-list (list (car comm-list)
+ (cons pair (cadr comm-list))))
+ (set!
+ sumlist (cons comm-list
+ (alist-delete
+ (car comm-list) sumlist)))))
+ ;; And add the balances to the comm-list entry.
+ ((caadr pair) 'add (cadr foreignlist))
+ ((cdadr pair) 'add (caddr foreignlist)))))))
+ (gnc:get-all-commodity-splits curr-accounts end-date)))
+
+ (gnc:resolve-unknown-comm sumlist report-commodity)))
+
+;; Calculate the volume-weighted average cost of all commodities,
+;; priced in the 'report-commodity'. Uses all transactions up until
+;; the 'end-date'. Returns an alist, see sumlist.
+(define (gnc:get-exchange-cost-totals report-commodity end-date)
+ (let ((curr-accounts
+ ;;(filter gnc:account-has-shares? ))
+ ;; -- use all accounts, not only share accounts, since gnucash-1.7
+ (gnc-account-get-descendants-sorted (gnc-get-current-root-account)))
+ ;; sumlist: a multilevel alist. Each element has a commodity
+ ;; as key, and another alist as a value. The value-alist's
+ ;; elements consist of a commodity as a key, and a pair of two
+ ;; value-collectors as value, e.g. with only one (the report-)
+ ;; commodity DEM in the outer alist: ( {DEM ( [USD (400 .
+ ;; 1000)] [FRF (300 . 100)] ) } ) where DEM,USD,FRF are
+ ;; <gnc:commodity> and the numbers are a numeric-collector
+ ;; which in turn store a <gnc:numeric>. In the example, USD
+ ;; 400 were bought for an amount of DEM 1000, FRF 300 were
+ ;; bought for DEM 100. The reason for the outer alist is that
+ ;; there might be commodity transactions which do not involve
+ ;; the report-commodity, but which can still be calculated
+ ;; after *all* transactions are processed.
+ (sumlist (list (list report-commodity '()))))
+
+ (if (not (null? curr-accounts))
+ ;; Go through all splits and add up all value-amounts
+ ;; and share-amounts
+ ;; However skip splits in trading accounts as these counterbalance
+ ;; the actual value and share amounts back to zero
+ (for-each
+ (lambda (a)
+ (if (not (eq? (xaccAccountGetType (xaccSplitGetAccount a)) ACCT-TYPE-TRADING))
+ (let* ((transaction-comm (xaccTransGetCurrency
+ (xaccSplitGetParent a)))
+ (account-comm (xaccAccountGetCommodity
+ (xaccSplitGetAccount a)))
+ (share-amount (xaccSplitGetAmount a))
+ (value-amount (xaccSplitGetValue a))
+ (tmp (assoc transaction-comm sumlist))
+ (comm-list (if (not tmp)
+ (assoc account-comm sumlist)
+ tmp)))
+
+ ;; entry exists already in comm-list?
+ (if (not comm-list)
+ ;; no, create sub-alist from scratch
+ (let ((pair (list transaction-comm
+ (cons (gnc:make-number-collector)
+ (gnc:make-number-collector)))))
+ ((caadr pair) 'add value-amount)
+ ((cdadr pair) 'add share-amount)
+ (set! comm-list (list account-comm (list pair)))
+ ;; and add the new sub-alist to sumlist.
+ (set! sumlist (cons comm-list sumlist)))
+ ;; yes, check for second commodity.
+ (let*
+ ;; Put the amounts in the right place.
+ ((foreignlist
+ (if (gnc-commodity-equiv transaction-comm
+ (car comm-list))
+ (list account-comm
+ share-amount value-amount)
+ (list transaction-comm
+ (gnc-numeric-neg value-amount)
+ (gnc-numeric-neg share-amount))))
+ ;; second commodity already existing in comm-list?
+ (pair (assoc (car foreignlist) (cadr comm-list))))
+ ;; if not, create a new entry in comm-list.
+ (if (not pair)
+ (begin
+ (set!
+ pair (list (car foreignlist)
+ (cons (gnc:make-number-collector)
+ (gnc:make-number-collector))))
+ (set!
+ comm-list (list (car comm-list)
+ (cons pair (cadr comm-list))))
+ (set!
+ sumlist (cons comm-list
+ (alist-delete
+ (car comm-list) sumlist)))))
+ ;; And add the balances to the comm-list entry.
+ ((caadr pair) 'add (cadr foreignlist))
+ ((cdadr pair) 'add (caddr foreignlist)))))))
+ (gnc:get-all-commodity-splits curr-accounts end-date)))
+
+ (gnc:resolve-unknown-comm sumlist report-commodity)))
+
+;; Anybody feel free to reimplement any of these functions, either in
+;; scheme or in C. -- cstim
+
+(define (gnc:make-exchange-alist report-commodity end-date)
+ ;; This returns the alist with the actual exchange rates, i.e. the
+ ;; total balances from get-exchange-totals are divided by each
+ ;; other.
+ (map
+ (lambda (e)
+ (list (car e)
+ (gnc-numeric-abs
+ (gnc-numeric-div ((cdadr e) 'total #f)
+ ((caadr e) 'total #f)
+ GNC-DENOM-AUTO
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))))
+ (gnc:get-exchange-totals report-commodity end-date)))
+
+(define (gnc:make-exchange-cost-alist report-commodity end-date)
;; This returns the alist with the actual exchange rates, i.e. the
;; total balances from get-exchange-totals are divided by each
;; other.
@@ -641,13 +731,16 @@
(lambda (e)
(list (car e)
(if (zero? ((caadr e) 'total #f)) #f
- (gnc-numeric-abs
+ (gnc-numeric-abs
(gnc-numeric-div ((cdadr e) 'total #f)
((caadr e) 'total #f)
GNC-DENOM-AUTO
- (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))
- )))
- (gnc:get-exchange-totals report-commodity end-date cost)))
+ (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND))))))
+ (gnc:get-exchange-cost-totals report-commodity end-date)))
+
+
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Actual functions for exchanging amounts.
@@ -839,18 +932,18 @@
;; the value of 'source-option', whose possible values are set in
;; gnc:options-add-price-source!.
(define (gnc:case-exchange-fn
- source-option report-currency to-date)
+ source-option report-currency to-date-tp)
(case source-option
((average-cost) (gnc:make-exchange-function
- (gnc:make-exchange-alist
- report-currency to-date #t)))
+ (gnc:make-exchange-cost-alist
+ report-currency to-date-tp)))
((weighted-average) (gnc:make-exchange-function
(gnc:make-exchange-alist
- report-currency to-date #f)))
+ report-currency to-date-tp)))
((pricedb-latest) gnc:exchange-by-pricedb-latest)
((pricedb-nearest) (lambda (foreign domestic)
(gnc:exchange-by-pricedb-nearest
- foreign domestic to-date)))
+ foreign domestic to-date-tp)))
(else
(begin
;; FIX-ME
@@ -863,7 +956,7 @@
source-option " using pricedb-nearest.")
(lambda (foreign domestic)
(gnc:exchange-by-pricedb-nearest
- foreign domestic to-date))))))
+ foreign domestic to-date-tp))))))
;; Return a ready-to-use function. Which one to use is determined by
;; the value of 'source-option', whose possible values are set in
@@ -873,25 +966,25 @@
;; section of the progress bar while running this function.
;;
(define (gnc:case-exchange-time-fn
- source-option report-currency commodity-list to-date
+ source-option report-currency commodity-list to-date-tp
start-percent delta-percent)
(case source-option
;; Make this the same as gnc:case-exchange-fn
((average-cost) (let* ((exchange-fn (gnc:make-exchange-function
- (gnc:make-exchange-alist
- report-currency to-date #t))))
+ (gnc:make-exchange-cost-alist
+ report-currency to-date-tp))))
(lambda (foreign domestic date)
(exchange-fn foreign domestic))))
((weighted-average) (let ((pricealist
(gnc:get-commoditylist-totalavg-prices
- commodity-list report-currency to-date
+ commodity-list report-currency to-date-tp
start-percent delta-percent)))
(lambda (foreign domestic date)
(gnc:exchange-by-pricealist-nearest
pricealist foreign domestic date))))
((actual-transactions) (let ((pricealist
(gnc:get-commoditylist-inst-prices
- commodity-list report-currency to-date)))
+ commodity-list report-currency to-date-tp)))
(lambda (foreign domestic date)
(gnc:exchange-by-pricealist-nearest
pricealist foreign domestic date))))
commit 88597d0b647076423208ae3e9670ca7415b4ea1c
Merge: 44c3dc8 c08dee6
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 16 10:54:51 2018 -0700
Merge branch 'remove-timespec' into maint
commit c08dee67bae803e4855f6c0a58ad50270a0e7541
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Aug 13 11:51:06 2018 -0700
Preserve timespec-using functions in Guile bindings.
There's an example of use in text-extras.scm, function
gnc-pricedb-create.
Unfortunately the deprecation messages issue no warnings.
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 72f9417..dd9c8fb 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -10,6 +10,7 @@ set(engine_noinst_HEADERS
SX-book.h
SX-ttinfo.h
TransactionP.h
+ engine-deprecated.h
gnc-backend-prov.hpp
gnc-date-p.h
gnc-hooks-scm.h
@@ -149,6 +150,7 @@ set (engine_SOURCES
Transaction.c
cap-gains.c
cashobjects.c
+ engine-deprecated.c
gnc-aqbanking-templates.cpp
gnc-budget.c
gnc-commodity.c
@@ -304,6 +306,7 @@ set(engine_EXTRA_DIST
design.txt
engine.i
engine-common.i
+ engine-deprecated.i
extensions.txt
iso-4217-currencies.xml
iso-currencies-to-c.xsl
diff --git a/libgnucash/engine/engine-deprecated.c b/libgnucash/engine/engine-deprecated.c
new file mode 100644
index 0000000..eba2641
--- /dev/null
+++ b/libgnucash/engine/engine-deprecated.c
@@ -0,0 +1,208 @@
+/********************************************************************\
+ * engine-deprecated.i: Guile wrappers for deleted C functions. *
+ * Copyright 2018 John Ralls <jralls at ceridwen.us> *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ * *
+\********************************************************************/
+
+/* The functions in this file have been removed from the C library and are
+ * provided here for backward compatibility. They will be removed completely
+ * from the next major release of GnuCash.
+ */
+
+#include "engine-deprecated.h"
+
+#include <libguile/deprecation.h>
+
+void xaccSplitSetDateReconciledTS(Split* s, Timespec *ts)
+{
+ scm_c_issue_deprecation_warning("xaccSplitSetDateReconciled is deprecated. Use xaccSplitSetDateReconciledSecs instead.");
+ xaccSplitSetDateReconciledSecs (s, ts->tv_sec);
+}
+
+void xaccSplitGetDateReconciledTS(Split* s, Timespec *ts)
+{
+ scm_c_issue_deprecation_warning("xaccSplitGetDateReconciled is deprecated. Use xaccSplitGetDateReconciledSecs instead.");
+ ts->tv_sec = xaccSplitGetDateReconciled (s);
+ ts->tv_nsec = 0;
+}
+
+Timespec xaccSplitRetDateReconciledTS(Split* s)
+{
+ Timespec ts = {0, 0};
+ scm_c_issue_deprecation_warning("xaccSplitSetDateReconciled is deprecated. Use xaccSplitSetDateReconciledSecs instead.");
+ ts.tv_sec = xaccSplitGetDateReconciled (s);
+ return ts;
+}
+
+Timespec
+gnc_transaction_get_date_posted(const Transaction *t)
+{
+ Timespec ts = {0, 0};
+ scm_c_issue_deprecation_warning("gnc_transaction_get_date_posted is deprecated. Use xaccTransRetDatePosted instead.");
+ ts.tv_sec = xaccTransRetDatePosted(t);
+ return ts;
+}
+
+Timespec
+gnc_transaction_get_date_entered(const Transaction *t)
+{
+ Timespec ts = {0, 0};
+ scm_c_issue_deprecation_warning("gnc_transaction_get_date_entered is deprecated. Use xaccTransGetDateEntered instead.");
+ ts.tv_sec = xaccTransRetDateEntered(t);
+ return ts;
+}
+
+Timespec
+gnc_split_get_date_reconciled(const Split *s)
+{
+ Timespec ts = {0, 0};
+ scm_c_issue_deprecation_warning("gnc_split_get_date_reconciled is deprecated. Use xaccSplitGetDateReconciled instead.");
+ ts.tv_sec = xaccSplitGetDateReconciled(s);
+ return ts;
+}
+
+void
+gnc_transaction_set_date(Transaction *t, Timespec ts)
+{
+ scm_c_issue_deprecation_warning("gnc_transaction_set_date is deprecated. Use xaccTransSetDatePostedSecs instead.");
+ xaccTransSetDatePostedSecs(t, ts.tv_sec);
+}
+
+Timespec
+gncTaxTableLastModified (const GncTaxTable *table)
+{
+ Timespec t = {0, 0};
+ scm_c_issue_deprecation_warning("gncTaxTableLastModified is deprecated. Use gncTaxTableLastModifiedSecs instead.");
+ t.tv_sec = gncTaxTableLastModifiedSecs (table);
+ return t;
+}
+
+void
+gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn,
+ GList *lots, Account *posted_acc, Account *xfer_acc,
+ gnc_numeric amount, gnc_numeric exch, Timespec date,
+ const char *memo, const char *num,
+ gboolean auto_pay)
+{
+ scm_c_issue_deprecation_warning("gncOwnerApplyPayment is deprecated. Use gncOwnerApplyPaymentSecs instead.");
+ gncOwnerApplyPaymentSecs (owner, preset_txn, lots, posted_acc,
+ xfer_acc, amount, exch, date.tv_sec,
+ memo, num, auto_pay);
+}
+
+GNCLot*
+gncOwnerCreatePaymentLot (const GncOwner *owner,
+ Transaction **preset_txn, Account *posted_acc,
+ Account *xfer_acc, gnc_numeric amount,
+ gnc_numeric exch, Timespec date,
+ const char *memo, const char *num)
+{
+ GNCLot* lot = NULL;
+ scm_c_issue_deprecation_warning("gncOwnerCreatePaymentLot is deprecated. Use gncOwnerCreatePaymentLotSecs instead.");
+ lot = gncOwnerCreatePaymentLotSecs (owner, preset_txn, posted_acc,
+ xfer_acc, amount, exch, date.tv_sec,
+ memo, num);
+ return lot;
+}
+
+void
+gnc_price_set_time (GNCPrice *p, Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_price_set_time is deprecated. Use gnc_price_set_time64 instead.");
+ gnc_price_set_time64(p, t.tv_sec);
+}
+
+Timespec
+gnc_price_get_time (GNCPrice *p)
+{
+ Timespec t = {0, 0};
+ scm_c_issue_deprecation_warning("gnc_price_get_time is deprecated. Use gnc_price_get_time64 instead.");
+ t.tv_sec = gnc_price_get_time64(p);
+ return t;
+}
+
+GNCPrice*
+gnc_pricedb_lookup_at_time(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ const gnc_commodity *currency,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_lookup_at_time is deprecated. Use gnc_pricedb_lookup_at_time64 instead.");
+ return gnc_pricedb_lookup_at_time64(db, commodity, currency, t.tv_sec);
+}
+
+GNCPrice*
+gnc_pricedb_lookup_day(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ const gnc_commodity *currency,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_lookup_day is deprecated. Use gnc_pricedb_lookup_day_t64 instead.");
+ return gnc_pricedb_lookup_day_t64(db, commodity, currency, t.tv_sec);
+}
+
+GNCPrice*
+gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
+ const gnc_commodity *c,
+ const gnc_commodity *currency,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_lookup_nearest_in_time is deprecated. Use gnc_pricedb_lookup_nearest_in_time64 instead.");
+ return gnc_pricedb_lookup_nearest_in_time64(db, c, currency, t.tv_sec);
+}
+
+PriceList*
+gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
+ const gnc_commodity *c,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_lookup_nearest_in_time_any_currency is deprecated. Use gnc_pricedb_lookup_nearest_in_time_any_currency_t64 instead.");
+ return gnc_pricedb_lookup_nearest_in_time_any_currency_t64(db, c, t.tv_sec);
+}
+
+GNCPrice*
+gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
+ gnc_commodity *c,
+ gnc_commodity *currency,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_lookup_latest_before is deprecated. Use gnc_pricedb_lookup_latest_before_t64 instead.");
+ return gnc_pricedb_lookup_latest_before_t64(db, c, currency, t.tv_sec);
+}
+
+PriceList*
+gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
+ const gnc_commodity *c,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_lookup_latest_before_any_currency is deprecated. Use gnc_pricedb_lookup_latest_before_any_currency_t64 instead.");
+ return gnc_pricedb_lookup_latest_before_any_currency_t64(db, c, t.tv_sec);
+}
+
+gnc_numeric
+gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
+ gnc_numeric balance,
+ const gnc_commodity *balance_currency,
+ const gnc_commodity *new_currency,
+ Timespec t)
+{
+ scm_c_issue_deprecation_warning("gnc_pricedb_convert_balance_nearest_price is deprecated. Use gnc_pricedb_convert_balance_nearest_price_t64 instead.");
+ return gnc_pricedb_convert_balance_nearest_price_t64(pdb, balance, balance_currency, new_currency, t.tv_sec);
+}
diff --git a/libgnucash/engine/engine-deprecated.h b/libgnucash/engine/engine-deprecated.h
new file mode 100644
index 0000000..90bd4a1
--- /dev/null
+++ b/libgnucash/engine/engine-deprecated.h
@@ -0,0 +1,90 @@
+/********************************************************************\
+ * engine-deprecated.h: Guile wrappers for deleted C functions. *
+ * Copyright 2018 John Ralls <jralls at ceridwen.us> *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ * *
+\********************************************************************/
+
+#include "config.h"
+#include "Split.h"
+#include "Transaction.h"
+#include "gncTaxTable.h"
+#include "gncOwner.h"
+
+typedef struct
+{
+ time64 tv_sec;
+ time64 tv_nsec;
+} Timespec;
+
+
+void xaccSplitSetDateReconciledTS(Split* s, Timespec *ts);
+void xaccSplitGetDateReconciledTS(Split* s, Timespec *ts);
+Timespec xaccSplitRetDateReconciledTS(Split* s);
+
+Timespec gnc_transaction_get_date_posted(const Transaction *t);
+Timespec gnc_transaction_get_date_entered(const Transaction *t);
+Timespec gnc_split_get_date_reconciled(const Split *s);
+void gnc_transaction_set_date(Transaction *t, Timespec ts);
+
+Timespec gncTaxTableLastModified (const GncTaxTable *table);
+
+void gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn,
+ GList *lots, Account *posted_acc, Account *xfer_acc,
+ gnc_numeric amount, gnc_numeric exch, Timespec date,
+ const char *memo, const char *num,
+ gboolean auto_pay);
+
+GNCLot* gncOwnerCreatePaymentLot (const GncOwner *owner,
+ Transaction **preset_txn, Account *posted_acc,
+ Account *xfer_acc, gnc_numeric amount,
+ gnc_numeric exch, Timespec date,
+ const char *memo, const char *num);
+
+void gnc_price_set_time (GNCPrice *p, Timespec t);
+Timespec gnc_price_get_time (GNCPrice *p);
+GNCPrice* gnc_pricedb_lookup_at_time(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ const gnc_commodity *currency,
+ Timespec t);
+GNCPrice* gnc_pricedb_lookup_day(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ const gnc_commodity *currency,
+ Timespec t);
+GNCPrice* gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
+ const gnc_commodity *c,
+ const gnc_commodity *currency,
+ Timespec t);
+PriceList* gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
+ const gnc_commodity *c,
+ Timespec t);
+GNCPrice* gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
+ gnc_commodity *c,
+ gnc_commodity *currency,
+ Timespec t);
+PriceList* gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
+ const gnc_commodity *c,
+ Timespec t);
+gnc_numeric
+gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
+ gnc_numeric balance,
+ const gnc_commodity *balance_currency,
+ const gnc_commodity *new_currency,
+ Timespec t);
+
diff --git a/libgnucash/engine/engine.i b/libgnucash/engine/engine.i
index 288f484..ec8dd3d 100644
--- a/libgnucash/engine/engine.i
+++ b/libgnucash/engine/engine.i
@@ -33,6 +33,7 @@
#include "gnc-lot.h"
#include "gnc-session.h"
#include "gnc-hooks-scm.h"
+#include "engine-deprecated.h"
#include "engine-helpers.h"
#include "engine-helpers-guile.h"
#include "policy.h"
@@ -80,6 +81,7 @@ engine-common.i */
%newobject gnc_account_get_full_name;
%include "engine-common.i"
+%include "engine-deprecated.h"
%inline %{
static const GncGUID * gncPriceGetGUID(GNCPrice *x)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 80cf8c0..386ea54 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -624,6 +624,7 @@ libgnucash/engine/business-core.scm
libgnucash/engine/cap-gains.c
libgnucash/engine/cashobjects.c
libgnucash/engine/commodity-table.scm
+libgnucash/engine/engine-deprecated.c
libgnucash/engine/engine-helpers.c
libgnucash/engine/engine-interface.scm
libgnucash/engine/engine.scm
commit e9098d08d28167266a8cbe51a0864efed45b24ca
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Aug 13 11:48:56 2018 -0700
Change ISO date format to remove fractional seconds.
diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp
index 9f70cd8..fd394b3 100644
--- a/libgnucash/engine/gnc-date.cpp
+++ b/libgnucash/engine/gnc-date.cpp
@@ -1115,7 +1115,7 @@ char *
gnc_time64_to_iso8601_buff (time64 time, char * buff)
{
constexpr size_t max_iso_date_length = 32;
- const char* format = "%Y-%m-%d %H:%M:%s %q";
+ const char* format = "%Y-%m-%d %H:%M:%S %q";
if (! buff) return NULL;
try
commit 35fabe26908d8158d4b576dadfe09ca8cdc8b956
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Aug 4 18:06:29 2018 -0700
Remove Timespec from gnc-date.
diff --git a/libgnucash/engine/gnc-date-p.h b/libgnucash/engine/gnc-date-p.h
index 96f6175..0a09d37 100644
--- a/libgnucash/engine/gnc-date-p.h
+++ b/libgnucash/engine/gnc-date-p.h
@@ -74,7 +74,6 @@ const char *qof_win32_get_time_format(QofWin32Picture picture);
/* Test Access for static functions */
typedef struct
{
- void (*timespec_normalize) (Timespec *t);
GTimeZone* (*timezone_new_local) (void);
} Testfuncs;
diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp
index 23e2a81..9f70cd8 100644
--- a/libgnucash/engine/gnc-date.cpp
+++ b/libgnucash/engine/gnc-date.cpp
@@ -378,114 +378,12 @@ gnc_print_time64(time64 time, const char* format)
/********************************************************************\
\********************************************************************/
-static void
-timespec_normalize(Timespec *t)
-{
- if (t->tv_nsec > NANOS_PER_SECOND)
- {
- t->tv_sec += (t->tv_nsec / NANOS_PER_SECOND);
- t->tv_nsec = t->tv_nsec % NANOS_PER_SECOND;
- }
-
- if (t->tv_nsec < - NANOS_PER_SECOND)
- {
- t->tv_sec += - (-t->tv_nsec / NANOS_PER_SECOND);
- t->tv_nsec = - (-t->tv_nsec % NANOS_PER_SECOND);
- }
-
- if (t->tv_sec > 0 && t->tv_nsec < 0)
- {
- t->tv_sec--;
- t->tv_nsec = NANOS_PER_SECOND + t->tv_nsec;
- }
-
- if (t->tv_sec < 0 && t->tv_nsec > 0)
- {
- t->tv_sec++;
- t->tv_nsec = - NANOS_PER_SECOND + t->tv_nsec;
- }
- return;
-}
-
-gboolean
-timespec_equal (const Timespec *ta, const Timespec *tb)
-{
- Timespec pta, ptb;
-
- if (ta == tb) return TRUE;
-/* Copy and normalize the copies */
- pta = *ta;
- ptb = *tb;
- timespec_normalize (&pta);
- timespec_normalize (&ptb);
-
- if (pta.tv_sec != ptb.tv_sec) return FALSE;
- if (pta.tv_nsec != ptb.tv_nsec) return FALSE;
- return TRUE;
-}
-
-gint
-timespec_cmp(const Timespec *ta, const Timespec *tb)
-{
- Timespec pta, ptb;
-
- if (ta == tb) return 0;
-/* Copy and normalize the copies */
- pta = *ta;
- ptb = *tb;
- timespec_normalize (&pta);
- timespec_normalize (&ptb);
-
- if (pta.tv_sec < ptb.tv_sec) return -1;
- if (pta.tv_sec > ptb.tv_sec) return 1;
- if (pta.tv_nsec < ptb.tv_nsec) return -1;
- if (pta.tv_nsec > ptb.tv_nsec) return 1;
- return 0;
-}
-
-Timespec
-timespec_diff(const Timespec *ta, const Timespec *tb)
-{
- Timespec retval;
- retval.tv_sec = ta->tv_sec - tb->tv_sec;
- retval.tv_nsec = ta->tv_nsec - tb->tv_nsec;
- timespec_normalize(&retval);
- return retval;
-}
-
-Timespec
-timespec_abs(const Timespec *t)
-{
- Timespec retval = *t;
-
- timespec_normalize(&retval);
- if (retval.tv_sec < 0)
- {
- retval.tv_sec = - retval.tv_sec;
- retval.tv_nsec = - retval.tv_nsec;
- }
-
- return retval;
-}
/* Converts any time on a day to midday that day.
* given a timepair contains any time on a certain day (local time)
* converts it to be midday that day.
*/
-Timespec
-timespecCanonicalDayTime(Timespec t)
-{
- struct tm tm;
- Timespec retval;
- time64 t_secs = t.tv_sec + (t.tv_nsec / NANOS_PER_SECOND);
- gnc_localtime_r(&t_secs, &tm);
- gnc_tm_set_day_middle(&tm);
- retval.tv_sec = gnc_mktime(&tm);
- retval.tv_nsec = 0;
- return retval;
-}
-
time64
time64CanonicalDayTime (time64 t)
{
@@ -697,20 +595,6 @@ qof_print_date (time64 t)
return g_strdup (buff);
}
-const char *
-gnc_print_date (Timespec ts)
-{
- static char buff[MAX_DATE_LENGTH];
- time64 t;
-
- memset (buff, 0, sizeof (buff));
- t = ts.tv_sec + (time64)(ts.tv_nsec / 1000000000.0);
-
- qof_print_date_buff (buff, MAX_DATE_LENGTH, t);
-
- return buff;
-}
-
/* ============================================================== */
/* return the greatest integer <= a/b; works for b > 0 and positive or
@@ -1230,20 +1114,13 @@ gnc_iso8601_to_time64_gmt(const char *cstr)
char *
gnc_time64_to_iso8601_buff (time64 time, char * buff)
{
- Timespec ts = {time, 0};
- return gnc_timespec_to_iso8601_buff (ts, buff);
-}
-
-char *
-gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)
-{
constexpr size_t max_iso_date_length = 32;
const char* format = "%Y-%m-%d %H:%M:%s %q";
if (! buff) return NULL;
try
{
- GncDateTime gncdt(ts.tv_sec);
+ GncDateTime gncdt(time);
auto sstr = gncdt.format(format);
memset(buff, 0, sstr.length() + 1);
@@ -1252,117 +1129,63 @@ gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)
}
catch(std::logic_error& err)
{
- PWARN("Error processing time64 %" PRId64 ": %s", ts.tv_sec, err.what());
+ PWARN("Error processing time64 %" PRId64 ": %s", time, err.what());
return buff;
}
catch(std::runtime_error& err)
{
- PWARN("Error processing time64 %" PRId64 ": %s", ts.tv_sec, err.what());
+ PWARN("Error processing time64 %" PRId64 ": %s", time, err.what());
return buff;
}
}
#define THIRTY_TWO_YEARS 0x3c30fc00LL
-static Timespec
-gnc_dmy2timespec_internal (int day, int month, int year, DayPart day_part)
+static time64
+gnc_dmy2time64_internal (int day, int month, int year, DayPart day_part)
{
try
{
auto date = GncDate(year, month, day);
- return { static_cast<time64>(GncDateTime (date, day_part)), 0 };
+ return static_cast<time64>(GncDateTime (date, day_part));
}
catch(const std::logic_error& err)
{
PWARN("Date computation error from Y-M-D %d-%d-%d: %s",
year, month, day, err.what());
- return {INT64_MAX, 0};
+ return INT64_MAX;
}
catch(const std::runtime_error& err)
{
PWARN("Date computation error from Y-M-D %d-%d-%d: %s",
year, month, day, err.what());
- return {INT64_MAX, 0};
+ return INT64_MAX;
}
}
time64
gnc_dmy2time64 (int day, int month, int year)
{
- return gnc_dmy2timespec_internal (day, month, year, DayPart::start).tv_sec;
+ return gnc_dmy2time64_internal (day, month, year, DayPart::start);
}
time64
gnc_dmy2time64_end (int day, int month, int year)
{
- return gnc_dmy2timespec_internal (day, month, year, DayPart::end).tv_sec;
+ return gnc_dmy2time64_internal (day, month, year, DayPart::end);
}
time64
gnc_dmy2time64_neutral (int day, int month, int year)
{
- return gnc_dmy2timespec_internal (day, month, year, DayPart::neutral).tv_sec;
-}
-
-Timespec
-gnc_dmy2timespec (int day, int month, int year)
-{
- return gnc_dmy2timespec_internal (day, month, year, DayPart::start);
-}
-
-Timespec
-gnc_dmy2timespec_end (int day, int month, int year)
-{
- return gnc_dmy2timespec_internal (day, month, year, DayPart::end);
-}
-
-Timespec
-gnc_dmy2timespec_neutral (int day, int month, int year)
-{
- return gnc_dmy2timespec_internal (day, month, year, DayPart::neutral);
-}
-/********************************************************************\
-\********************************************************************/
-void
-timespecFromTime64 ( Timespec *ts, time64 t )
-{
- ts->tv_sec = t;
- ts->tv_nsec = 0;
-}
-
-Timespec
-timespec_now()
-{
- Timespec ts;
- ts.tv_sec = gnc_time(NULL);
- ts.tv_nsec = 0;
- return ts;
+ return gnc_dmy2time64_internal (day, month, year, DayPart::neutral);
}
-time64
-timespecToTime64 (Timespec ts)
-{
- return ts.tv_sec;
-}
/* The GDate setter functions all in the end use g_date_set_time_t,
* which in turn relies on localtime and is therefore subject to the
* 2038 bug.
*/
-GDate timespec_to_gdate (Timespec ts)
-{
- GDate result;
-
- g_date_clear (&result, 1);
- GncDateTime time(ts.tv_sec);
- auto date = time.date().year_month_day();
- g_date_set_dmy (&result, date.day, static_cast<GDateMonth>(date.month),
- date.year);
- g_assert(g_date_valid (&result));
-
- return result;
-}
-
GDate time64_to_gdate (time64 t)
{
GDate result;
@@ -1411,13 +1234,6 @@ time64 gdate_to_time64 (GDate d)
g_date_get_year(&d));
}
-Timespec gdate_to_timespec (GDate d)
-{
- return gnc_dmy2timespec_neutral (g_date_get_day(&d),
- g_date_get_month(&d),
- g_date_get_year(&d));
-}
-
static void
gnc_tm_get_day_start (struct tm *tm, time64 time_val)
{
@@ -1538,14 +1354,6 @@ time64_get_type( void )
return type;
}
-Testfuncs*
-gnc_date_load_funcs (void)
-{
- Testfuncs *tf = g_slice_new (Testfuncs);
- tf->timespec_normalize = timespec_normalize;
- return tf;
-}
-
/* ================================================= */
gboolean
@@ -1799,3 +1607,10 @@ gnc_gdate_set_prev_fiscal_year_end (GDate *date,
gnc_gdate_set_fiscal_year_end(date, fy_end);
g_date_subtract_years(date, 1);
}
+
+Testfuncs*
+gnc_date_load_funcs (void)
+{
+ Testfuncs *tf = g_slice_new (Testfuncs);
+ return tf;
+}
diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h
index 140dc92..b3dc51e 100644
--- a/libgnucash/engine/gnc-date.h
+++ b/libgnucash/engine/gnc-date.h
@@ -91,16 +91,6 @@ typedef struct
} Time64;
-/** The Timespec is just like the unix 'struct timespec'
- * except that we use a 64-bit unsigned int to
- * store the seconds. This should adequately cover dates in the
- * distant future as well as the distant past, as long as they're not
- * more than a couple dozen times the age of the universe
- * Values of this type can range from -9,223,372,036,854,775,808 to
- * 9,223,372,036,854,775,807.
- */
-typedef struct timespec64 Timespec;
-
/** @name GValue
@{
*/
@@ -295,97 +285,29 @@ void gnc_gdate_set_today (GDate* gd);
void gnc_gdate_set_time64 (GDate* gd, time64 time);
/** @} */
-
-/* Datatypes *******************************************************/
-
-/** \brief Use a 64-bit unsigned int timespec
- *
- * struct timespec64 is just like the unix 'struct timespec' except
- * that we use a 64-bit
- * unsigned int to store the seconds. This should adequately cover
- * dates in the distant future as well as the distant past, as long as
- * they're not more than a couple dozen times the age of the universe.
- * Values of this type can range from -9,223,372,036,854,775,808 to
- * 9,223,372,036,854,775,807.
- */
-
-#ifndef SWIG /* swig 1.1p5 can't hack the long long type */
-struct timespec64
-{
- time64 tv_sec;
- glong tv_nsec;
-};
-#endif /* SWIG */
-
-
-
-/* Prototypes ******************************************************/
-
-/** \name Timespec functions */
-// @{
-/** strict equality */
-gboolean timespec_equal(const Timespec *ta, const Timespec *tb);
-
-/** comparison: if (ta < tb) -1; else if (ta > tb) 1; else 0; */
-gint timespec_cmp(const Timespec *ta, const Timespec *tb);
-
-/** difference between ta and tb, results are normalized
- * ie tv_sec and tv_nsec of the result have the same size
- * abs(result.tv_nsec) <= 1000000000 */
-Timespec timespec_diff(const Timespec *ta, const Timespec *tb);
-
-/** absolute value, also normalized */
-Timespec timespec_abs(const Timespec *t);
-
-/** convert a timespec on a certain day (localtime) to
- * the timespec representing midday on that day. Watch out - this is *not* the
+/** convert a time64 on a certain day (localtime) to
+ * the time64 representing midday on that day. Watch out - this is *not* the
* first second of the day, which is returned by various other functions
- * returning a Timespec. */
-Timespec timespecCanonicalDayTime(Timespec t);
-
+ * returning a time64. */
time64 time64CanonicalDayTime(time64 t);
-/** Returns the current clock time as a Timespec, taken from time(2). */
-Timespec timespec_now (void);
-
-/** Turns a time64 into a Timespec */
-void timespecFromTime64 (Timespec *ts, time64 t );
-
-/** Turns a Timespec into a time64 */
-time64 timespecToTime64 (Timespec ts);
-
-GDate time64_to_gdate (time64 t);
-
-/** Turns a Timespec into a GDate */
-GDate timespec_to_gdate (Timespec ts);
-
-/** Turns a GDate into a Timespec, returning the first second of the day */
-Timespec gdate_to_timespec (GDate d);
-
/** Turns a GDate into a time64, returning the first second of the day */
time64 gdate_to_time64 (GDate d);
/** Convert a day, month, and year to a time64, returning the first second of the day */
time64 gnc_dmy2time64 (gint day, gint month, gint year);
-time64 gnc_dmy2time64_neutral (gint day, gint month, gint year);
-
-time64 gnc_dmy2time64_end (gint day, gint month, gint year);
-
-/** Convert a day, month, and year to a Timespec, returning the first second of the day */
-Timespec gnc_dmy2timespec (gint day, gint month, gint year);
-
-/** Same as gnc_dmy2timespec, but last second of the day */
-Timespec gnc_dmy2timespec_end (gint day, gint month, gint year);
-
-/** Converts a day, month, and year to a Timespec representing 11:00:00 UTC
+/** Converts a day, month, and year to a time64 representing 11:00:00 UTC
* 11:00:00 UTC falls on the same time in almost all timezones, the exceptions
* being the +13, +14, and -12 timezones used by countries along the
* International Date Line. Since users in those timezones would see dates
* immediately change by one day, the function checks the current timezone for
* those changes and adjusts the UTC time so that the date will be consistent.
*/
-Timespec gnc_dmy2timespec_neutral (gint day, gint month, gint year);
+time64 gnc_dmy2time64_neutral (gint day, gint month, gint year);
+
+/** Same as gnc_dmy2time64, but last second of the day */
+time64 gnc_dmy2time64_end (gint day, gint month, gint year);
/** The gnc_iso8601_to_time64_gmt() routine converts an ISO-8601 style
* date/time string to time64. Please note that ISO-8601 strings
@@ -405,8 +327,8 @@ Timespec gnc_dmy2timespec_neutral (gint day, gint month, gint year);
*/
time64 gnc_iso8601_to_time64_gmt(const gchar *);
-/** The gnc_timespec_to_iso8601_buff() routine takes the input
- * UTC Timespec value and prints it as an ISO-8601 style string.
+/** The gnc_time64_to_iso8601_buff() routine takes the input
+ * UTC time64 value and prints it as an ISO-8601 style string.
* The buffer must be long enough to contain the NULL-terminated
* string (32 characters + NUL). This routine returns a pointer
* to the null terminator (and can thus be used in the 'stpcpy'
@@ -421,7 +343,6 @@ time64 gnc_iso8601_to_time64_gmt(const gchar *);
* The string generated by this routine uses the local time zone
* on the machine on which it is executing to create the time string.
*/
-gchar * gnc_timespec_to_iso8601_buff (Timespec ts, gchar * buff);
gchar * gnc_time64_to_iso8601_buff (time64, char * buff);
// @}
@@ -555,13 +476,6 @@ size_t qof_print_gdate(char *buf, size_t bufflen, const GDate *gd);
* **/
char * qof_print_date (time64 secs);
-/** Convenience; calls through to qof_print_date_dmy_buff().
- * Return: static global string.
- * \warning This routine is not thread-safe, because it uses a single
- * global buffer to store the return value. Use qof_print_date_buff()
- * or qof_print_date() instead.
- * **/
-const char * gnc_print_date(Timespec ts);
/* ------------------------------------------------------------------ */
/* time printing utilities */
@@ -706,6 +620,11 @@ guint gnc_gdate_hash( gconstpointer gd );
/** \name GDate to time64 conversions */
// @{
+/** Returns the GDate in which the time64 occurs.
+ * @param t The time64
+ * @returns A GDate for the day in which the time64 occurs.
+ */
+GDate time64_to_gdate (time64 t);
/** The gnc_time64_get_day_start() routine will take the given time in
* GLib GDate format and adjust it to the first second of that day.
diff --git a/libgnucash/engine/test/CMakeLists.txt b/libgnucash/engine/test/CMakeLists.txt
index 7d698f5..a19c1fb 100644
--- a/libgnucash/engine/test/CMakeLists.txt
+++ b/libgnucash/engine/test/CMakeLists.txt
@@ -26,7 +26,6 @@ add_dependencies(check test-link)
add_engine_test(test-load-engine test-load-engine.c)
add_engine_test(test-guid test-guid.cpp)
-add_engine_test(test-date test-date.cpp)
add_engine_test(test-object test-object.c)
add_engine_test(test-commodities test-commodities.cpp)
@@ -271,7 +270,6 @@ set(test_engine_SOURCES_DIST
test-business.c
test-commodities.cpp
test-customer.c
- test-date.cpp
test-employee.c
test-engine-kvp-properties.c
test-engine.c
diff --git a/libgnucash/engine/test/test-date.cpp b/libgnucash/engine/test/test-date.cpp
deleted file mode 100644
index acf502a..0000000
--- a/libgnucash/engine/test/test-date.cpp
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * -- fix borken timezone test -- linas May 2004
- */
-/********************************************************************\
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
- * *
-\********************************************************************/
-
-extern "C"
-{
-#include <config.h>
-#include <ctype.h>
-#include <glib.h>
-#include <time.h>
-
-#include "gnc-date.h"
-#include "gnc-module.h"
-#include "test-stuff.h"
-#include "test-engine-stuff.h"
-}
-
-static gboolean
-check_time (Timespec ts, gboolean always_print)
-{
- Timespec ts_2;
- char str[128];
- gboolean ok;
-
- ts.tv_nsec = MIN (ts.tv_nsec, 999999999);
- ts.tv_nsec /= 1000;
- ts.tv_nsec *= 1000;
-
- gnc_timespec_to_iso8601_buff (ts, str);
-
- /* The time, in seconds, everywhere on the planet, is always
- * the same, and is independent of location. In particular,
- * the time, in seconds, is identical to the local time in
- * Greenwich (GMT).
- */
- ts_2 = {gnc_iso8601_to_time64_gmt (str), 0};
-
- ok = timespec_equal (&ts, &ts_2);
-
- if (!ok || always_print)
- {
- fprintf (stderr,
- "\n%" G_GINT64_FORMAT ":%ld -> %s ->\n"
- "\t%" G_GINT64_FORMAT ":%ld"
- " (diff of %" G_GINT64_FORMAT " secs %ld nsecs)\n",
- ts.tv_sec, ts.tv_nsec, str,
- ts_2.tv_sec, ts_2.tv_nsec,
- ts.tv_sec - ts_2.tv_sec, ts.tv_nsec - ts_2.tv_nsec);
-
- if (!ok)
- {
- failure ("timespec to iso8601 string conversion failed");
- return FALSE;
- }
- }
-
- success ("timespec to iso8601 string conversion passes");
-
- return TRUE;
-}
-
-static gboolean
-check_conversion (const char * str, Timespec expected_ts)
-{
- Timespec ts;
- struct tm tm;
- int day, month, year;
- GDate d1, d2;
-
- ts = {gnc_iso8601_to_time64_gmt (str), 0};
-
- // We test the conversion to GDate against the gnc_localtime_r
- // conversion, and also the conversion back to timespec and again
- // to GDate so that it is still the original GDate
- gnc_localtime_r (&ts.tv_sec, &tm);
- day = tm.tm_mday;
- month = tm.tm_mon + 1;
- year = tm.tm_year + 1900;
- d1 = timespec_to_gdate(ts);
- d2 = timespec_to_gdate(gdate_to_timespec(d1));
- if ((g_date_compare(&d1, &d2) != 0)
- || (g_date_get_day(&d1) != day)
- || (g_date_get_month(&d1) != month)
- || (g_date_get_year(&d1) != year))
- {
- fprintf (stderr,
- "\nmis-converted \"%s\" to GDate. "
- "Got d1(Y-M-D) = %i-%i-%i, d2(Y-M-D) = %i-%i-%i\n",
- str, year, month, day,
- g_date_get_year(&d2), g_date_get_month(&d2), g_date_get_day(&d2));
- failure ("misconverted timespec");
- return FALSE;
- }
-
- if ((expected_ts.tv_sec != ts.tv_sec) || (expected_ts.tv_nsec != ts.tv_nsec))
- {
- fprintf (stderr,
- "\nmis-converted \"%s\" to %" G_GUINT64_FORMAT ".%09ld seconds\n"
- "\twas expecting %" G_GUINT64_FORMAT ".%09ld seconds\n",
- str, ts.tv_sec, ts.tv_nsec,
- expected_ts.tv_sec, expected_ts.tv_nsec);
- failure ("misconverted timespec");
- return FALSE;
- }
- success ("good conversion");
- return TRUE;
-}
-
-static void
-run_test (void)
-{
- Timespec ts;
- int i;
- gboolean do_print = FALSE;
-
- /* Now leaving the 60's:
- *
- * Black Panthers
- * Weather Underground
- * Kent State
- * Evacuation of Vietnam
- * Impeachment
- * Gas Crisis
- * New York Garbage Crisis
- * Stagflation
- * Delapidated Bicentennial
- * Sex Pistols
- * Punk Rock
- *
- * Of course, anything had to be better than the miserable 70's,
- * which explains why Reagan was elected. Food for thought.
- */
- ts.tv_sec = 10 * 365 * 24 * 3600 + 2 * 24 * 3600;
- ts.tv_nsec = 0;
- check_conversion ("1979-12-31 15:00:00.000000 -0900", ts);
- check_conversion ("1979-12-31 16:00:00.000000 -0800", ts);
- check_conversion ("1979-12-31 17:00:00.000000 -0700", ts);
- check_conversion ("1979-12-31 18:00:00.000000 -0600", ts);
- check_conversion ("1979-12-31 19:00:00.000000 -0500", ts);
- check_conversion ("1979-12-31 20:00:00.000000 -0400", ts);
- check_conversion ("1979-12-31 21:00:00.000000 -0300", ts);
- check_conversion ("1979-12-31 22:00:00.000000 -0200", ts);
- check_conversion ("1979-12-31 23:00:00.000000 -0100", ts);
-
- check_conversion ("1980-01-01 00:00:00.000000 -0000", ts);
- check_conversion ("1980-01-01 00:00:00.000000 +0000", ts);
-
- check_conversion ("1980-01-01 01:00:00.000000 +0100", ts);
- check_conversion ("1980-01-01 02:00:00.000000 +0200", ts);
- check_conversion ("1980-01-01 03:00:00.000000 +0300", ts);
- check_conversion ("1980-01-01 04:00:00.000000 +0400", ts);
- check_conversion ("1980-01-01 05:00:00.000000 +0500", ts);
- check_conversion ("1980-01-01 06:00:00.000000 +0600", ts);
- check_conversion ("1980-01-01 07:00:00.000000 +0700", ts);
- check_conversion ("1980-01-01 08:00:00.000000 +0800", ts);
-
- /* check minute-offsets as well */
- check_conversion ("1980-01-01 08:01:00.000000 +0801", ts);
- check_conversion ("1980-01-01 08:02:00.000000 +0802", ts);
- check_conversion ("1980-01-01 08:03:00.000000 +0803", ts);
- check_conversion ("1980-01-01 08:23:00.000000 +0823", ts);
- check_conversion ("1980-01-01 08:35:00.000000 +0835", ts);
- check_conversion ("1980-01-01 08:47:00.000000 +0847", ts);
- check_conversion ("1980-01-01 08:59:00.000000 +0859", ts);
-
- check_conversion ("1979-12-31 15:01:00.000000 -0859", ts);
- check_conversion ("1979-12-31 15:02:00.000000 -0858", ts);
- check_conversion ("1979-12-31 15:03:00.000000 -0857", ts);
- check_conversion ("1979-12-31 15:23:00.000000 -0837", ts);
- check_conversion ("1979-12-31 15:45:00.000000 -0815", ts);
-
-
- /* The 90's */
- ts.tv_sec = 20 * 365 * 24 * 3600 + 5 * 24 * 3600;
- ts.tv_nsec = 0;
- check_conversion ("1989-12-31 15:00:00.000000 -0900", ts);
- check_conversion ("1989-12-31 16:00:00.000000 -0800", ts);
- check_conversion ("1989-12-31 17:00:00.000000 -0700", ts);
- check_conversion ("1989-12-31 18:00:00.000000 -0600", ts);
- check_conversion ("1989-12-31 19:00:00.000000 -0500", ts);
- check_conversion ("1989-12-31 20:00:00.000000 -0400", ts);
- check_conversion ("1989-12-31 21:00:00.000000 -0300", ts);
- check_conversion ("1989-12-31 22:00:00.000000 -0200", ts);
- check_conversion ("1989-12-31 23:00:00.000000 -0100", ts);
-
- check_conversion ("1990-01-01 00:00:00.000000 -0000", ts);
- check_conversion ("1990-01-01 00:00:00.000000 +0000", ts);
-
- check_conversion ("1990-01-01 01:00:00.000000 +0100", ts);
- check_conversion ("1990-01-01 02:00:00.000000 +0200", ts);
- check_conversion ("1990-01-01 03:00:00.000000 +0300", ts);
- check_conversion ("1990-01-01 04:00:00.000000 +0400", ts);
- check_conversion ("1990-01-01 05:00:00.000000 +0500", ts);
- check_conversion ("1990-01-01 06:00:00.000000 +0600", ts);
- check_conversion ("1990-01-01 07:00:00.000000 +0700", ts);
- check_conversion ("1990-01-01 08:00:00.000000 +0800", ts);
-
- /* check minute-offsets as well */
- check_conversion ("1990-01-01 08:01:00.000000 +0801", ts);
- check_conversion ("1990-01-01 08:02:00.000000 +0802", ts);
- check_conversion ("1990-01-01 08:03:00.000000 +0803", ts);
- check_conversion ("1990-01-01 08:23:00.000000 +0823", ts);
- check_conversion ("1990-01-01 08:35:00.000000 +0835", ts);
- check_conversion ("1990-01-01 08:47:00.000000 +0847", ts);
- check_conversion ("1990-01-01 08:59:00.000000 +0859", ts);
-
- check_conversion ("1989-12-31 15:01:00.000000 -0859", ts);
- check_conversion ("1989-12-31 15:02:00.000000 -0858", ts);
- check_conversion ("1989-12-31 15:03:00.000000 -0857", ts);
- check_conversion ("1989-12-31 15:23:00.000000 -0837", ts);
- check_conversion ("1989-12-31 15:45:00.000000 -0815", ts);
-
-
- /* The naughties */
- ts.tv_sec = 30 * 365 * 24 * 3600 + 7 * 24 * 3600;
- ts.tv_nsec = 0;
- check_conversion ("1999-12-31 15:00:00.000000 -0900", ts);
- check_conversion ("1999-12-31 16:00:00.000000 -0800", ts);
- check_conversion ("1999-12-31 17:00:00.000000 -0700", ts);
- check_conversion ("1999-12-31 18:00:00.000000 -0600", ts);
- check_conversion ("1999-12-31 19:00:00.000000 -0500", ts);
- check_conversion ("1999-12-31 20:00:00.000000 -0400", ts);
- check_conversion ("1999-12-31 21:00:00.000000 -0300", ts);
- check_conversion ("1999-12-31 22:00:00.000000 -0200", ts);
- check_conversion ("1999-12-31 23:00:00.000000 -0100", ts);
-
- check_conversion ("2000-01-01 00:00:00.000000 -0000", ts);
- check_conversion ("2000-01-01 00:00:00.000000 +0000", ts);
-
- check_conversion ("2000-01-01 01:00:00.000000 +0100", ts);
- check_conversion ("2000-01-01 02:00:00.000000 +0200", ts);
- check_conversion ("2000-01-01 03:00:00.000000 +0300", ts);
- check_conversion ("2000-01-01 04:00:00.000000 +0400", ts);
- check_conversion ("2000-01-01 05:00:00.000000 +0500", ts);
- check_conversion ("2000-01-01 06:00:00.000000 +0600", ts);
- check_conversion ("2000-01-01 07:00:00.000000 +0700", ts);
- check_conversion ("2000-01-01 08:00:00.000000 +0800", ts);
-
- /* check minute-offsets as well */
- check_conversion ("2000-01-01 08:01:00.000000 +0801", ts);
- check_conversion ("2000-01-01 08:02:00.000000 +0802", ts);
- check_conversion ("2000-01-01 08:03:00.000000 +0803", ts);
- check_conversion ("2000-01-01 08:23:00.000000 +0823", ts);
- check_conversion ("2000-01-01 08:35:00.000000 +0835", ts);
- check_conversion ("2000-01-01 08:47:00.000000 +0847", ts);
- check_conversion ("2000-01-01 08:59:00.000000 +0859", ts);
-
- check_conversion ("1999-12-31 15:01:00.000000 -0859", ts);
- check_conversion ("1999-12-31 15:02:00.000000 -0858", ts);
- check_conversion ("1999-12-31 15:03:00.000000 -0857", ts);
- check_conversion ("1999-12-31 15:23:00.000000 -0837", ts);
- check_conversion ("1999-12-31 15:45:00.000000 -0815", ts);
-
-
- /* The nows */
- ts.tv_sec = 35 * 365 * 24 * 3600 + 9 * 24 * 3600;
- ts.tv_nsec = 0;
- check_conversion ("2004-12-31 15:00:00.000000 -0900", ts);
- check_conversion ("2004-12-31 16:00:00.000000 -0800", ts);
- check_conversion ("2004-12-31 17:00:00.000000 -0700", ts);
- check_conversion ("2004-12-31 18:00:00.000000 -0600", ts);
- check_conversion ("2004-12-31 19:00:00.000000 -0500", ts);
- check_conversion ("2004-12-31 20:00:00.000000 -0400", ts);
- check_conversion ("2004-12-31 21:00:00.000000 -0300", ts);
- check_conversion ("2004-12-31 22:00:00.000000 -0200", ts);
- check_conversion ("2004-12-31 23:00:00.000000 -0100", ts);
-
- check_conversion ("2005-01-01 00:00:00.000000 -0000", ts);
- check_conversion ("2005-01-01 00:00:00.000000 +0000", ts);
-
- check_conversion ("2005-01-01 01:00:00.000000 +0100", ts);
- check_conversion ("2005-01-01 02:00:00.000000 +0200", ts);
- check_conversion ("2005-01-01 03:00:00.000000 +0300", ts);
- check_conversion ("2005-01-01 04:00:00.000000 +0400", ts);
- check_conversion ("2005-01-01 05:00:00.000000 +0500", ts);
- check_conversion ("2005-01-01 06:00:00.000000 +0600", ts);
- check_conversion ("2005-01-01 07:00:00.000000 +0700", ts);
- check_conversion ("2005-01-01 08:00:00.000000 +0800", ts);
-
- /* check minute-offsets as well */
- check_conversion ("2005-01-01 08:01:00.000000 +0801", ts);
- check_conversion ("2005-01-01 08:02:00.000000 +0802", ts);
- check_conversion ("2005-01-01 08:03:00.000000 +0803", ts);
- check_conversion ("2005-01-01 08:23:00.000000 +0823", ts);
- check_conversion ("2005-01-01 08:35:00.000000 +0835", ts);
- check_conversion ("2005-01-01 08:47:00.000000 +0847", ts);
- check_conversion ("2005-01-01 08:59:00.000000 +0859", ts);
-
- check_conversion ("2004-12-31 15:01:00.000000 -0859", ts);
- check_conversion ("2004-12-31 15:02:00.000000 -0858", ts);
- check_conversion ("2004-12-31 15:03:00.000000 -0857", ts);
- check_conversion ("2004-12-31 15:23:00.000000 -0837", ts);
- check_conversion ("2004-12-31 15:45:00.000000 -0815", ts);
-
-
- /* Various leap-year days and near-leap times. */
- ts = {gnc_iso8601_to_time64_gmt ("1980-02-29 00:00:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("1979-02-28 00:00:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("1990-02-28 00:00:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("2000-02-29 00:00:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("2004-02-29 00:00:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("2008-02-29 00:00:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("2008-02-29 00:01:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("2008-02-29 02:02:00.000000 -0000"), 0};
- check_time (ts, do_print);
-
- ts = {gnc_iso8601_to_time64_gmt ("2008-02-28 23:23:23.000000 -0000"), 0};
- check_time (ts, do_print);
-
- /* Here's a date ten days after the 2038 rollover that should work
- if/when we support it. */
- ts.tv_nsec = 0;
- ts.tv_sec = (long long int) 0x7fffffff + 3600 * 24 * 10;
- check_time(ts, do_print);
-
- /* Various 'special' times. What makes these so special? */
- ts.tv_sec = 152098136;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1162088421;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 325659000 - 6500;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1143943200;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1603591171;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1738909365;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1603591171;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1143943200 - 1;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1143943200;
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1143943200 + (7 * 60 * 60);
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = 1143943200 + (8 * 60 * 60);
- ts.tv_nsec = 0;
- check_time (ts, do_print);
-
- ts.tv_sec = get_random_time ();
-
- for (i = 0; i < 10000; i++)
- {
- ts.tv_sec += 10800;
- if (!check_time (ts, FALSE))
- return;
- }
-
- for (i = 0; i < 5000; i++)
- {
- ts.tv_sec = get_random_time ();
-
- if (!check_time (ts, FALSE))
- return;
- }
-}
-
-int
-main (int argc, char **argv)
-{
- run_test ();
-
- success ("dates seem to work");
-
- print_test_results();
- exit(get_rv());
-}
diff --git a/libgnucash/engine/test/test-gnc-date.c b/libgnucash/engine/test/test-gnc-date.c
index c084b3d..2c38565 100644
--- a/libgnucash/engine/test/test-gnc-date.c
+++ b/libgnucash/engine/test/test-gnc-date.c
@@ -61,12 +61,12 @@ typedef struct
TZOffset off_zulu;
TZOffset off_05w;
TZOffset off_0840e;
- Timespec ts0;
- Timespec ts1;
- Timespec ts2;
- Timespec ts3;
- Timespec ts4;
- Timespec ts5;
+ time64 t0;
+ time64 t1;
+ time64 t2;
+ time64 t3;
+ time64 t4;
+ time64 t5;
} FixtureA;
static int
@@ -83,15 +83,15 @@ offset_string (TZOffset tz)
static void setup (FixtureA *f, gconstpointer pData)
{
- f->ts0 = (Timespec){gnc_time(NULL), 0};
+ f->t0 = gnc_time(NULL);
f->off_zulu = (TZOffset){0, 0};
f->off_05w = (TZOffset){-5, 0};
f->off_0840e = (TZOffset){8, 40};
- f->ts1 = (Timespec){607009407, 0}; //1989-3-27 13:43:27 Z
- f->ts2 = (Timespec){1604748079, 0}; //2020-11-7 06:21:19 -05:00
- f->ts3 = (Timespec){1341398864, 0}; //2012-07-04 19:27:44 +08:40
- f->ts4 = (Timespec){-261104801, 0}; //1961-09-22 17:53:19 -05:00
- f->ts5 = (Timespec){2873938879LL, 0}; //2061-01-25 23:21:19 -05:00
+ f->t1 = 607009407; //1989-3-27 13:43:27 Z
+ f->t2 = 1604748079; //2020-11-7 06:21:19 -05:00
+ f->t3 = 1341398864; //2012-07-04 19:27:44 +08:40
+ f->t4 = -261104801; //1961-09-22 17:53:19 -05:00
+ f->t5 = 2873938879LL; //2061-01-25 23:21:19 -05:00
}
typedef struct
@@ -492,217 +492,23 @@ test_gnc_setlocale (int category, gchar *locale)
"if a suffix is needed it's in the suffixes array.");
g_assert_not_reached ();
}
-/* timespec_normalize
-static void
-timespec_normalize(Timespec *t)// Local: 2:0:0
-*/
-static void
-test_timespec_normalize (void)
-{
- const int offset = 4396432;
- const int factor = 2;
- int base = 50;
- Timespec t = { base, factor * NANOS_PER_SECOND + offset };
- Testfuncs *tf = gnc_date_load_funcs ();
-
- tf->timespec_normalize (&t);
- g_assert_cmpint (t.tv_sec, ==, base + factor);
- g_assert_cmpint (t.tv_nsec, ==, offset);
-
- t.tv_sec = base;
- t.tv_nsec = - factor * NANOS_PER_SECOND - offset;
- tf->timespec_normalize (&t);
- g_assert_cmpint (t.tv_sec, ==, base - factor - 1);
- g_assert_cmpint (t.tv_nsec, ==, NANOS_PER_SECOND - offset);
-
- t.tv_sec = - base;
- t.tv_nsec = factor * NANOS_PER_SECOND + offset;
- tf->timespec_normalize (&t);
- g_assert_cmpint (t.tv_sec, ==, - base + factor + 1);
- g_assert_cmpint (t.tv_nsec, ==, - NANOS_PER_SECOND + offset);
-
- t.tv_sec = - base;
- t.tv_nsec = - factor * NANOS_PER_SECOND - offset;
- tf->timespec_normalize (&t);
- g_assert_cmpint (t.tv_sec, ==, - base - factor);
- g_assert_cmpint (t.tv_nsec, ==, - offset);
-
- g_slice_free (Testfuncs, tf);
-}
-
-
-/* timespec_equal
-gboolean
-timespec_equal (const Timespec *ta, const Timespec *tb)// C: 19 in 8 Local: 0:0:0
-*/
-static void
-test_timespec_equal (void)
-{
- const int sec_per_day = 24 * 3600;
- const int sec_per_mo = 30 * sec_per_day;
- const time64 sec_per_yr = 365 * sec_per_day;
- const int nsec1 = 439652, nsec2 = 132794892, nsec3 = 1132794892;
- const time64 secs1 = 23 * sec_per_yr + 5 * sec_per_mo + 11 * sec_per_day;
- const time64 secs2 = 21 * sec_per_yr + 11 * sec_per_mo + 19 * sec_per_day;
- const time64 secs3 = 72 * sec_per_yr + 2 * sec_per_mo + 26 * sec_per_day;
- Timespec ta = { secs1, nsec1 };
- Timespec tb = { secs2, nsec2 };
- Timespec tc = { secs1, nsec1 };
- Timespec td = { secs3, nsec1 };
- Timespec te = { secs1, nsec2 };
- Timespec tf = { secs2 - 1, nsec3 }; /* When normalized, equal to tb */
-
- g_assert (timespec_equal (&ta, &ta));
- g_assert (timespec_equal (&ta, &tc));
- g_assert (!timespec_equal (&ta, &tb));
- g_assert (!timespec_equal (&ta, &td));
- g_assert (!timespec_equal (&ta, &te));
- g_assert (timespec_equal (&tb, &tf));
-}
-/* timespec_cmp
-gint
-timespec_cmp(const Timespec *ta, const Timespec *tb)// C: 28 in 11 Local: 0:0:0
-*/
-static void
-test_timespec_cmp (void)
-{
- const int sec_per_day = 24 * 3600;
- const int sec_per_mo = 30 * sec_per_day;
- const time64 sec_per_yr = 365 * sec_per_day;
- const int nsec1 = 439652, nsec2 = 132794892, nsec3 = 1132794892;
- const time64 secs1 = 23 * sec_per_yr + 5 * sec_per_mo + 11 * sec_per_day;
- const time64 secs2 = 21 * sec_per_yr + 11 * sec_per_mo + 19 * sec_per_day;
- const time64 secs3 = 72 * sec_per_yr + 2 * sec_per_mo + 26 * sec_per_day;
- Timespec ta = { secs1, nsec1 };
- Timespec tb = { secs2, nsec2 };
- Timespec tc = { secs1, nsec1 };
- Timespec td = { secs3, nsec1 };
- Timespec te = { secs1, nsec2 };
- Timespec tf = { secs2 - 1, nsec3 }; /* When normalized, equal to tb */
- Timespec tg = { -secs2, nsec2 };
- Timespec th = { secs1, -nsec1 };
-
- g_assert_cmpint (timespec_cmp (&ta, &ta), ==, 0);
- g_assert_cmpint (timespec_cmp (&ta, &tc), ==, 0);
- g_assert_cmpint (timespec_cmp (&tf, &tb), ==, 0);
- g_assert_cmpint (timespec_cmp (&ta, &tb), ==, 1);
- g_assert_cmpint (timespec_cmp (&te, &ta), ==, 1);
- g_assert_cmpint (timespec_cmp (&td, &ta), ==, 1);
- g_assert_cmpint (timespec_cmp (&ta, &te), ==, -1);
- g_assert_cmpint (timespec_cmp (&ta, &tg), ==, 1);
- g_assert_cmpint (timespec_cmp (&th, &ta), ==, -1);
-
-}
-/* timespec_diff
-Timespec
-timespec_diff(const Timespec *ta, const Timespec *tb)// C: 4 in 1 Local: 0:0:0
-*/
-static void
-test_timespec_diff (void)
-{
- const gint sec_per_day = 24 * 3600;
- const gint sec_per_mo = 30 * sec_per_day;
- const time64 sec_per_yr = 365 * sec_per_day;
- const time64 nsec1 = 439652, nsec2 = 132794892, nsec3 = 1132794892;
- const time64 secs1 = 23 * sec_per_yr + 5 * sec_per_mo + 11 * sec_per_day;
- const time64 secs2 = 21 * sec_per_yr + 11 * sec_per_mo + 19 * sec_per_day;
- const time64 secs3 = 72 * sec_per_yr + 2 * sec_per_mo + 26 * sec_per_day;
- Timespec ta = { secs1, nsec1 };
- Timespec tb = { secs2, nsec2 };
- Timespec td = { secs3, nsec1 };
- Timespec te = { secs1, nsec2 };
- Timespec tf = { secs2 - 1, nsec3 }; /* When normalized, equal to tb */
- Timespec tg = { -secs2, nsec2 };
- Timespec th = { secs1, -nsec3 };
-
- Timespec tt = timespec_diff (&ta, &ta);
-
- g_assert_cmpint (tt.tv_sec, ==, 0);
- g_assert_cmpint (tt.tv_nsec, ==, 0);
-
- tt = timespec_diff (&ta, &tb);
- g_assert_cmpint (tt.tv_sec, ==, secs1 - secs2 - 1);
- g_assert_cmpint (tt.tv_nsec, ==, nsec1 - nsec2 + NANOS_PER_SECOND);
-
- tt = timespec_diff (&ta, &te);
- g_assert_cmpint (tt.tv_sec, ==, 0);
- g_assert_cmpint (tt.tv_nsec, ==, nsec1 - nsec2);
-
- tt = timespec_diff (&tb, &tf);
- g_assert_cmpint (tt.tv_sec, ==, 0);
- g_assert_cmpint (tt.tv_nsec, ==, 0);
-
- tt = timespec_diff (&tf, &th);
- if (sizeof (glong) > 4)
- {
- glong nsec_diff_norm = 2 * nsec3 - 2 * NANOS_PER_SECOND - NANOS_PER_SECOND;
- g_assert_cmpint (tt.tv_sec, ==, secs2 - secs1 + 2);
- g_assert_cmpint (tt.tv_nsec, ==, nsec_diff_norm);
- }
- else
- {
- g_assert_cmpint (tt.tv_sec, ==, secs2 - secs1 - 3);
- g_assert_cmpint (tt.tv_nsec, <, 0); /* Overflow nanosecs */
- }
- tt = timespec_diff (&tg, &td);
- g_assert_cmpint (tt.tv_sec, ==, -secs2 - secs3 + 1);
- g_assert_cmpint (tt.tv_nsec, ==, nsec2 - nsec1 - NANOS_PER_SECOND);
-
-}
-/* timespec_abs
-Timespec
-timespec_abs(const Timespec *t)// C: 4 in 1 Local: 0:0:0
-*/
-static void
-test_timespec_abs (void)
-{
- const int sec_per_day = 24 * 3600;
- const int sec_per_mo = 30 * sec_per_day;
- const int sec_per_yr = 365 * sec_per_day;
- const int nsec1 = 439652, nsec2 = 132794892, nsec3 = 1132794892;
- const time64 secs1 = 23 * sec_per_yr + 5 * sec_per_mo + 11 * sec_per_day;
- const time64 secs2 = 21 * sec_per_yr + 11 * sec_per_mo + 19 * sec_per_day;
- Timespec ta = { secs1, nsec1 };
- Timespec tf = { secs2 - 1, nsec3 }; /* When normalized, equal to tb */
- Timespec tg = { -secs2, nsec2 };
- Timespec th = { secs1, -nsec1 };
-
- Timespec tt = timespec_abs (&ta);
- g_assert_cmpint (tt.tv_sec, ==, secs1);
- g_assert_cmpint (tt.tv_nsec, ==, nsec1);
-
- tt = timespec_abs (&tf);
- g_assert_cmpint (tt.tv_sec, ==, secs2);
- g_assert_cmpint (tt.tv_nsec, ==, nsec2);
-
- tt = timespec_abs (&tg);
- g_assert_cmpint (tt.tv_sec, ==, secs2 - 1);
- g_assert_cmpint (tt.tv_nsec, ==, NANOS_PER_SECOND - nsec2);
-
- tt = timespec_abs (&th);
- g_assert_cmpint (tt.tv_sec, ==, secs1 - 1);
- g_assert_cmpint (tt.tv_nsec, ==, NANOS_PER_SECOND - nsec1);
-
-}
/* timespecCanonicalDayTime
-Timespec
-timespecCanonicalDayTime(Timespec t)// C: 12 in 5 SCM: 19 in 10 Local: 0:0:0
+time64
+time64CanonicalDayTime(time64 t)// C: 12 in 5 SCM: 19 in 10 Local: 0:0:0
*/
-static Timespec
-compute_noon_of_day (Timespec *ts)
-{
- Timespec nt = {0, 0};
- time_t secs = (time_t)ts->tv_sec;
- struct tm *time = localtime(&secs);
- time->tm_hour = 12;
- time->tm_min = 0;
- time->tm_sec = 0;
- nt.tv_sec = mktime(time);
- return nt;
+static time64
+compute_noon_of_day (const time64 *t)
+{
+ struct tm time;
+ gnc_localtime_r(t, &time);
+ time.tm_hour = 12;
+ time.tm_min = 0;
+ time.tm_sec = 0;
+ return gnc_mktime(&time);
}
static void
-test_timespecCanonicalDayTime (void)
+test_time64CanonicalDayTime (void)
{
const int sec_per_day = 24 * 3600;
const int sec_per_mo = 30 * sec_per_day;
@@ -713,21 +519,17 @@ test_timespecCanonicalDayTime (void)
const time64 secs2 = 21 * sec_per_yr + 11 * sec_per_mo +
19 * sec_per_day + 21 * 3600 + 9 * 60 + 48; /* 1991-11-19 21:09:48 Z */
- Timespec t0 = { secs, 0 };
- Timespec ta = { secs1, 0 };
- Timespec tb = { secs2, 0 };
+ time64 n0 = compute_noon_of_day (&secs);
+ time64 na = compute_noon_of_day (&secs1);
+ time64 nb = compute_noon_of_day (&secs2);
- Timespec n0 = compute_noon_of_day (&t0);
- Timespec na = compute_noon_of_day (&ta);
- Timespec nb = compute_noon_of_day (&tb);
+ time64 r0 = time64CanonicalDayTime (secs);
+ time64 ra = time64CanonicalDayTime (secs1);
+ time64 rb = time64CanonicalDayTime (secs2);
- Timespec r0 = timespecCanonicalDayTime (t0);
- Timespec ra = timespecCanonicalDayTime (ta);
- Timespec rb = timespecCanonicalDayTime (tb);
-
- g_assert_cmpint (n0.tv_sec, ==, r0.tv_sec);
- g_assert_cmpint (na.tv_sec, ==, ra.tv_sec);
- g_assert_cmpint (nb.tv_sec, ==, rb.tv_sec);
+ g_assert_cmpint (n0, ==, r0);
+ g_assert_cmpint (na, ==, ra);
+ g_assert_cmpint (nb, ==, rb);
}
@@ -1339,74 +1141,6 @@ test_qof_print_date (void)
setlocale (LC_TIME, locale);
g_free (locale);
}
-/* gnc_print_date
-const char *
-gnc_print_date (Timespec ts)// C: 11 in 9 SCM: 166 in 59 Local: 0:0:0
-*/
-static void
-test_gnc_print_date (void)
-{
- gchar t_buff[MAX_DATE_LENGTH];
- gchar *locale = g_strdup (setlocale (LC_TIME, NULL));
- GDate *gd1 = g_date_new_dmy (23, 11, 1974);
- GDate *gd2 = g_date_new_dmy (2, 2, 1961);
- GDate *gd3 = g_date_new_dmy (16, 6, 2045);
- Timespec tm1 = gdate_to_timespec (*gd1);
- Timespec tm2 = gdate_to_timespec (*gd2);
- Timespec tm3 = gdate_to_timespec (*gd3);
-
-
- qof_date_format_set (QOF_DATE_FORMAT_UK);
- g_assert_cmpstr (gnc_print_date (tm1), ==, "23/11/1974");
- g_assert_cmpstr (gnc_print_date (tm2), ==, "02/02/1961");
- g_assert_cmpstr (gnc_print_date (tm3), ==, "16/06/2045");
-
- qof_date_format_set (QOF_DATE_FORMAT_CE);
- g_assert_cmpstr (gnc_print_date (tm1), ==, "23.11.1974");
- g_assert_cmpstr (gnc_print_date (tm2), ==, "02.02.1961");
- g_assert_cmpstr (gnc_print_date (tm3), ==, "16.06.2045");
-
- qof_date_format_set (QOF_DATE_FORMAT_US);
- g_assert_cmpstr (gnc_print_date (tm1), ==, "11/23/1974");
- g_assert_cmpstr (gnc_print_date (tm2), ==, "02/02/1961");
- g_assert_cmpstr (gnc_print_date (tm3), ==, "06/16/2045");
-
- qof_date_format_set (QOF_DATE_FORMAT_ISO);
- g_assert_cmpstr (gnc_print_date (tm1), ==, "1974-11-23");
- g_assert_cmpstr (gnc_print_date (tm2), ==, "1961-02-02");
- g_assert_cmpstr (gnc_print_date (tm3), ==, "2045-06-16");
-
- qof_date_format_set (QOF_DATE_FORMAT_LOCALE);
- test_gnc_setlocale (LC_TIME, "en_US");
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd1);
- g_assert_cmpstr (gnc_print_date (tm1), ==, t_buff);
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd2);
- g_assert_cmpstr (gnc_print_date (tm2), ==, t_buff);
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd3);
- g_assert_cmpstr (gnc_print_date (tm3), ==, t_buff);
-
- test_gnc_setlocale (LC_TIME, "en_GB");
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd1);
- g_assert_cmpstr (gnc_print_date (tm1), ==, t_buff);
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd2);
- g_assert_cmpstr (gnc_print_date (tm2), ==, t_buff);
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd3);
- g_assert_cmpstr (gnc_print_date (tm3), ==, t_buff);
-
- test_gnc_setlocale (LC_TIME, "fr_FR");
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd1);
- g_assert_cmpstr (gnc_print_date (tm1), ==, t_buff);
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd2);
- g_assert_cmpstr (gnc_print_date (tm2), ==, t_buff);
- g_date_strftime (t_buff, MAX_DATE_LENGTH, GNC_D_FMT, gd3);
- g_assert_cmpstr (gnc_print_date (tm3), ==, t_buff);
-
- setlocale (LC_TIME, locale);
- g_free (locale);
- g_date_free (gd1);
- g_date_free (gd2);
- g_date_free (gd3);
-}
/* floordiv
static int
floordiv(int a, int b)// Local: 1:0:0
@@ -1622,9 +1356,9 @@ test_gnc_date_timestamp (void)
g_free (timestr);
}
-/* gnc_iso8601_to_timespec_gmt
-Timespec
-gnc_iso8601_to_timespec_gmt(const char *str)// C: 6 in 3 Local: 0:0:0
+/* 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)
@@ -1642,44 +1376,43 @@ test_gnc_iso8601_to_time64_gmt (FixtureA *f, gconstpointer pData)
g_assert_cmpint (t, ==, 0);
t = gnc_iso8601_to_time64_gmt ("1989-03-27 13:43:27");
- g_assert_cmpint (t, ==, f->ts1.tv_sec);
+ g_assert_cmpint (t, ==, f->t1);
t = gnc_iso8601_to_time64_gmt ("2020-11-07 06:21:19 -05");
- g_assert_cmpint (t, ==, f->ts2.tv_sec);
+ g_assert_cmpint (t, ==, f->t2);
t = gnc_iso8601_to_time64_gmt ("2012-07-04 19:27:44.0+08:40");
- g_assert_cmpint (t, ==, f->ts3.tv_sec);
+ g_assert_cmpint (t, ==, f->t3);
t = gnc_iso8601_to_time64_gmt ("1961-09-22 17:53:19 -05");
- g_assert_cmpint (t, ==, f->ts4.tv_sec);
+ g_assert_cmpint (t, ==, f->t4);
t = gnc_iso8601_to_time64_gmt ("2061-01-25 23:21:19.0 -05:00");
- g_assert_cmpint (t, ==, f->ts5.tv_sec);
+ g_assert_cmpint (t, ==, f->t5);
}
-/* gnc_timespec_to_iso8601_buff
+/* gnc_time64_to_iso8601_buff
char *
-gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)// C: 18 in 7 Local: 0:0:0
+gnc_time64_to_iso8601_buff (time64 t, char * buff)// C: 18 in 7 Local: 0:0:0
*/
-static Timespec
-g_date_time_to_timespec (GDateTime *gdt)
+static time64
+g_date_time_to_time64 (GDateTime *gdt)
{
- Timespec t;
- t.tv_sec = g_date_time_to_unix (gdt);
- t.tv_nsec = g_date_time_get_microsecond (gdt) * 1000;
+ time64 t;
+ t = g_date_time_to_unix (gdt);
return t;
}
#define ISO8601_SIZE MAX_DATE_LENGTH + 4
static gchar*
-format_timestring (Timespec ts, TZOffset tz)
+format_timestring (time64 t, TZOffset tz)
{
- static const unsigned tzlen = MAX_DATE_LENGTH - 26;
- char *fmt = "%Y-%m-%d %H:%M:%S";
+ static const unsigned tzlen = MAX_DATE_LENGTH - 26;
+ char *fmt = "%Y-%m-%d %H:%M:%S %z";
struct tm tm;
- char buf[MAX_DATE_LENGTH], *retval;
+ char buf[MAX_DATE_LENGTH + 1];
char tzbuf[tzlen];
memset(tzbuf, 0, sizeof(tzbuf));
- gnc_localtime_r(&ts.tv_sec, &tm);
+ gnc_localtime_r(&t, &tm);
#if PLATFORM(WINDOWS)
strftime(tzbuf, sizeof(tzbuf), "%Z", &tm);
#else
@@ -1687,74 +1420,73 @@ format_timestring (Timespec ts, TZOffset tz)
#endif
memset (buf, 0, sizeof(buf));
strftime(buf, sizeof(buf), fmt, &tm);
- retval = g_strdup_printf ("%s.%06ld %s", buf, ts.tv_nsec / 1000, tzbuf);
- return retval;
+ return g_strdup(buf);
}
static void
-test_gnc_timespec_to_iso8601_buff (FixtureA *f, gconstpointer pData)
+test_gnc_time64_to_iso8601_buff (FixtureA *f, gconstpointer pData)
{
gchar buff[ISO8601_SIZE];
gchar *time_str;
- Timespec t = { 0, 0 };
+ time64 t = 0;
gchar *end;
memset (buff, 0, sizeof buff);
- end = gnc_timespec_to_iso8601_buff (t, NULL);
+ end = gnc_time64_to_iso8601_buff (t, NULL);
g_assert (end == NULL);
- end = gnc_timespec_to_iso8601_buff (f->ts0, buff);
+ end = gnc_time64_to_iso8601_buff (f->t0, buff);
g_assert_cmpint (end - buff, ==, strlen (buff));
- time_str = format_timestring (f->ts0, f->off_zulu);
+ time_str = format_timestring (f->t0, f->off_zulu);
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
- end = gnc_timespec_to_iso8601_buff (f->ts1, buff);
- time_str = format_timestring (f->ts1, f->off_zulu);
+ end = gnc_time64_to_iso8601_buff (f->t1, buff);
+ time_str = format_timestring (f->t1, f->off_zulu);
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
- end = gnc_timespec_to_iso8601_buff (f->ts2, buff);
- time_str = format_timestring (f->ts2, f->off_05w);
+ end = gnc_time64_to_iso8601_buff (f->t2, buff);
+ time_str = format_timestring (f->t2, f->off_05w);
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
- end = gnc_timespec_to_iso8601_buff (f->ts3, buff);
- time_str = format_timestring (f->ts3, f->off_0840e);
+ end = gnc_time64_to_iso8601_buff (f->t3, buff);
+ time_str = format_timestring (f->t3, f->off_0840e);
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
- end = gnc_timespec_to_iso8601_buff (f->ts4, buff);
- time_str = format_timestring (f->ts4, f->off_05w);
+ end = gnc_time64_to_iso8601_buff (f->t4, buff);
+ time_str = format_timestring (f->t4, f->off_05w);
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
- end = gnc_timespec_to_iso8601_buff (f->ts5, buff);
- time_str = format_timestring (f->ts5, f->off_05w);
+ end = gnc_time64_to_iso8601_buff (f->t5, buff);
+ time_str = format_timestring (f->t5, f->off_05w);
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
}
-/* gnc_dmy2timespec_internal
-static Timespec
-gnc_dmy2timespec_internal (int day, int month, int year, gboolean start_of_day)// Local: 2:0:0
+/* gnc_dmy2time64_internal
+static time64
+gnc_dmy2time64_internal (int day, int month, int year, gboolean start_of_day)// Local: 2:0:0
*/
/* static void
-test_gnc_dmy2timespec_internal (void)
+test_gnc_dmy2time64_internal (void)
{
}*/
-/* gnc_dmy2timespec
-Timespec
-gnc_dmy2timespec (int day, int month, int year)// C: 8 in 5 Local: 1:0:0
+/* gnc_dmy2time64
+time64
+gnc_dmy2time64 (int day, int month, int year)// C: 8 in 5 Local: 1:0:0
*/
static void
-test_gnc_dmy2timespec (FixtureB *f, gconstpointer pData)
+test_gnc_dmy2time64 (FixtureB *f, gconstpointer pData)
{
- gchar *msg1 = "[qof_dmy2timespec()] Date computation error from Y-M-D 1257-7-2: Time value is outside the supported year range.";
+ gchar *msg1 = "[qof_dmy2time64()] Date computation error from Y-M-D 1257-7-2: Time value is outside the supported year range.";
gint loglevel = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
gchar *logdomain = "qof.engine";
TestErrorStruct check = {loglevel, logdomain, msg1, 0};
@@ -1769,27 +1501,27 @@ test_gnc_dmy2timespec (FixtureB *f, gconstpointer pData)
struct tm tm = {0, 0, 0, f->test[i].day, f->test[i].mon - 1,
f->test[i].yr - 1900, 0, 0, -1};
#endif
- Timespec r_t = gnc_dmy2timespec (f->test[i].day, f->test[i].mon,
+ time64 r_t = gnc_dmy2time64 (f->test[i].day, f->test[i].mon,
f->test[i].yr);
struct tm time1 = tm, time2 = tm;
int offset = gnc_mktime(&time1) - gnc_timegm(&time2);
if (f->test[i].secs == INT64_MAX)
- /* We use INT64_MAX as invalid timespec.secs.
+ /* We use INT64_MAX as invalid time64.secs.
* As we can't *add* to the max, we can ignore the tz offset in this case. */
- g_assert_cmpint (r_t.tv_sec, ==, INT64_MAX);
+ g_assert_cmpint (r_t, ==, INT64_MAX);
else
- g_assert_cmpint (r_t.tv_sec, ==, f->test[i].secs - offset);
+ g_assert_cmpint (r_t, ==, f->test[i].secs - offset);
}
g_log_set_default_handler (hdlr, 0);
}
-/* gnc_dmy2timespec_end
-Timespec
-gnc_dmy2timespec_end (int day, int month, int year)// C: 1 Local: 0:0:0
+/* gnc_dmy2time64_end
+time64
+gnc_dmy2time64_end (int day, int month, int year)// C: 1 Local: 0:0:0
*/
static void
-test_gnc_dmy2timespec_end (FixtureB *f, gconstpointer pData)
+test_gnc_dmy2time64_end (FixtureB *f, gconstpointer pData)
{
- gchar *msg1 = "[qof_dmy2timespec_end()] Date computation error from Y-M-D 1257-7-2: Time value is outside the supported year range.";
+ gchar *msg1 = "[qof_dmy2time64_end()] Date computation error from Y-M-D 1257-7-2: Time value is outside the supported year range.";
gint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
gchar *logdomain = "qof.engine";
TestErrorStruct check = {loglevel, logdomain, msg1, 0};
@@ -1804,15 +1536,15 @@ test_gnc_dmy2timespec_end (FixtureB *f, gconstpointer pData)
struct tm tm = {59, 59, 23, f->test[i].day, f->test[i].mon - 1,
f->test[i].yr - 1900, 0, 0, -1};
#endif
- Timespec r_t = gnc_dmy2timespec_end (f->test[i].day, f->test[i].mon,
+ time64 r_t = gnc_dmy2time64_end (f->test[i].day, f->test[i].mon,
f->test[i].yr);
int offset = gnc_mktime(&tm) - gnc_timegm(&tm);
if (f->test[i].secs == INT64_MAX)
- /* We use INT64_MAX as invalid timespec.secs.
+ /* We use INT64_MAX as invalid time64.secs.
* As we can't *add* to the max, we can ignore the tz offset in this case. */
- g_assert_cmpint (r_t.tv_sec, ==, INT64_MAX);
+ g_assert_cmpint (r_t, ==, INT64_MAX);
else
- g_assert_cmpint (r_t.tv_sec, ==, f->test[i].secs - offset);
+ g_assert_cmpint (r_t, ==, f->test[i].secs - offset);
}
g_log_set_default_handler (hdlr, 0);
}
@@ -1833,18 +1565,18 @@ offset_adjust(GDateTime *gdt)
return new_gdt;
}
-/*gnc_dmy2timespec_neutral*/
+/*gnc_dmy2time64_neutral*/
static void
-test_gnc_dmy2timespec_neutral (FixtureB *f, gconstpointer pData)
+test_gnc_dmy2time64_neutral (FixtureB *f, gconstpointer pData)
{
- gchar *msg1 = "[qof_dmy2timespec_neutral()] Date computation error from Y-M-D 1257-7-2: Time value is outside the supported year range.";
+ gchar *msg1 = "[qof_dmy2time64_neutral()] Date computation error from Y-M-D 1257-7-2: Time value is outside the supported year range.";
gint loglevel = G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL;
gchar *logdomain = "qof.engine";
TestErrorStruct check = {loglevel, logdomain, msg1, 0};
GLogFunc hdlr = g_log_set_default_handler ((GLogFunc)test_null_handler, &check);
struct tm check_tz;
gnc_localtime_r(&(f->test[0].secs), &check_tz);
- /* gnc_dmy2timespec_neutral returns the timespec for 10:59:00 Z
+ /* gnc_dmy2time64_neutral returns the time64 for 10:59:00 Z
* for timezones in the range -11 to +13. If the timezone being
* tested is outside that range then the day of the month will be
* different from the one in the test fixture and we skip the
@@ -1855,10 +1587,10 @@ test_gnc_dmy2timespec_neutral (FixtureB *f, gconstpointer pData)
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check);
for (int i = 0; i < sizeof(f->test)/sizeof(TimeMap); ++i)
{
- Timespec r_t = gnc_dmy2timespec_neutral (f->test[i].day, f->test[i].mon,
+ time64 r_t = gnc_dmy2time64_neutral (f->test[i].day, f->test[i].mon,
f->test[i].yr);
- g_assert_cmpint (r_t.tv_sec, ==, f->test[i].secs);
+ g_assert_cmpint (r_t, ==, f->test[i].secs);
}
}
g_log_set_default_handler (hdlr, 0);
@@ -1872,83 +1604,59 @@ gnc_timezone (const struct tm *tm)// C: 5 in 2 Local: 2:0:0
test_gnc_timezone (void)
{
}*/
-/* timespecFromtime64
-void
-timespecFromtime64( Timespec *ts, time64 t )// C: 22 in 11 Local: 0:0:0
-*/
-/* static void
-test_timespecFromtime64 (void)
-{
-}*/
-/* timespec_now
-Timespec
-timespec_now()// C: 2 in 2 Local: 0:0:0
-*/
-/* static void
-test_timespec_now (void)
-{
-}*/
-/* timespecTotime64
-time64
-timespecTotime64 (Timespec ts)// C: 10 in 6 Local: 1:0:0
-*/
-/* static void
-test_timespecTotime64 (void)
-{
-}*/
-/* timespec_to_gdate
-GDate timespec_to_gdate (Timespec ts)// C: 5 in 4 Local: 0:0:0
+/* time64_to_gdate
+GDate time64_to_gdate (time64 t)// C: 5 in 4 Local: 0:0:0
*/
static void
-test_timespec_to_gdate (FixtureA *f, gconstpointer pData)
+test_time64_to_gdate (FixtureA *f, gconstpointer pData)
{
GDate date1, date2;
struct tm tm;
g_date_clear (&date2, 1);
- date1 = timespec_to_gdate (f->ts0);
- gnc_localtime_r(&f->ts0.tv_sec, &tm);
+ date1 = time64_to_gdate (f->t0);
+ gnc_localtime_r(&f->t0, &tm);
g_date_set_dmy (&date2, tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
g_assert_cmpint (g_date_get_julian (&date1), ==,
g_date_get_julian (&date2));
- date1 = timespec_to_gdate (f->ts1);
- gnc_localtime_r(&f->ts1.tv_sec, &tm);
+ date1 = time64_to_gdate (f->t1);
+ gnc_localtime_r(&f->t1, &tm);
g_date_set_dmy (&date2, tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
g_assert_cmpint (g_date_get_julian (&date1), ==,
g_date_get_julian (&date2));
- date1 = timespec_to_gdate (f->ts2);
- gnc_localtime_r(&f->ts2.tv_sec, &tm);
+ date1 = time64_to_gdate (f->t2);
+ gnc_localtime_r(&f->t2, &tm);
g_date_set_dmy (&date2, tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
g_assert_cmpint (g_date_get_julian (&date1), ==,
g_date_get_julian (&date2));
- date1 = timespec_to_gdate (f->ts3);
- gnc_localtime_r(&f->ts3.tv_sec, &tm);
+ date1 = time64_to_gdate (f->t3);
+ gnc_localtime_r(&f->t3, &tm);
g_date_set_dmy (&date2, tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
g_assert_cmpint (g_date_get_julian (&date1), ==,
g_date_get_julian (&date2));
- date1 = timespec_to_gdate (f->ts4);
- gnc_localtime_r(&f->ts4.tv_sec, &tm);
+ date1 = time64_to_gdate (f->t4);
+ gnc_localtime_r(&f->t4, &tm);
g_date_set_dmy (&date2, tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
g_assert_cmpint (g_date_get_julian (&date1), ==,
g_date_get_julian (&date2));
- date1 = timespec_to_gdate (f->ts5);
- gnc_localtime_r(&f->ts5.tv_sec, &tm);
+ date1 = time64_to_gdate (f->t5);
+ gnc_localtime_r(&f->t5, &tm);
g_date_set_dmy (&date2, tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);
g_assert_cmpint (g_date_get_julian (&date1), ==,
g_date_get_julian (&date2));
}
-/* gdate_to_timespec
-Timespec gdate_to_timespec (GDate d)// C: 7 in 6 Local: 0:0:0
+/* gdate_to_time64
+time64 gdate_to_time64 (GDate d)// C: 7 in 6 Local: 0:0:0
*/
static void
-test_gdate_to_timespec (FixtureB *f, gconstpointer pData)
+test_gdate_to_time64 (FixtureB *f, gconstpointer pData)
{
gchar *msg = "g_date_set_dmy: assertion 'g_date_valid_dmy (day, m, y)' failed";
@@ -1958,7 +1666,7 @@ test_gdate_to_timespec (FixtureB *f, gconstpointer pData)
GLogFunc hdlr = g_log_set_default_handler ((GLogFunc)test_null_handler, &check);
struct tm check_tz;
gnc_localtime_r(&(f->test[0].secs), &check_tz);
- /* gdate_to_timespec returns the timespec for 10:59:00 Z
+ /* gdate_to_time64 returns the time64 for 10:59:00 Z
* for timezones in the range -11 to +13. If the timezone being
* tested is outside that range then the day of the month will be
* different from the one in the test fixture and we skip the
@@ -1970,15 +1678,15 @@ test_gdate_to_timespec (FixtureB *f, gconstpointer pData)
for (int i = 0; i < sizeof(f->test)/sizeof(TimeMap); ++i)
{
GDate gd, gd2;
- Timespec r_t;
+ time64 r_t;
g_date_clear(&gd, 1);
g_date_clear(&gd2, 1);
g_date_set_dmy(&gd, f->test[i].day, f->test[i].mon, f->test[i].yr);
- r_t = gdate_to_timespec(gd);
- g_assert_cmpint (r_t.tv_sec, ==, f->test[i].secs);
+ r_t = gdate_to_time64(gd);
+ g_assert_cmpint (r_t, ==, f->test[i].secs);
if (f->test[i].secs < INT64_MAX)
{
- gd2 = timespec_to_gdate(r_t);
+ gd2 = time64_to_gdate(r_t);
g_assert (g_date_compare (&gd2, &gd) == 0);
}
}
@@ -2020,40 +1728,40 @@ test_gnc_time64_get_day_start (FixtureA *f, gconstpointer pData)
struct tm tm;
time64 t_time, r_time;
- gnc_localtime_r(&f->ts0.tv_sec, &tm);
+ gnc_localtime_r(&f->t0, &tm);
tm_day_begin(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_start (f->ts0.tv_sec);
+ r_time = gnc_time64_get_day_start (f->t0);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts1.tv_sec, &tm);
+ gnc_localtime_r(&f->t1, &tm);
tm_day_begin(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_start (f->ts1.tv_sec);
+ r_time = gnc_time64_get_day_start (f->t1);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts2.tv_sec, &tm);
+ gnc_localtime_r(&f->t2, &tm);
tm_day_begin(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_start (f->ts2.tv_sec);
+ r_time = gnc_time64_get_day_start (f->t2);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts3.tv_sec, &tm);
+ gnc_localtime_r(&f->t3, &tm);
tm_day_begin(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_start (f->ts3.tv_sec);
+ r_time = gnc_time64_get_day_start (f->t3);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts4.tv_sec, &tm);
+ gnc_localtime_r(&f->t4, &tm);
tm_day_begin(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_start (f->ts4.tv_sec);
+ r_time = gnc_time64_get_day_start (f->t4);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts5.tv_sec, &tm);
+ gnc_localtime_r(&f->t5, &tm);
tm_day_begin(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_start (f->ts5.tv_sec);
+ r_time = gnc_time64_get_day_start (f->t5);
g_assert_cmpint (t_time, ==, r_time);
}
@@ -2075,40 +1783,40 @@ test_gnc_time64_get_day_end (FixtureA *f, gconstpointer pData)
struct tm tm;
time64 t_time, r_time;
- gnc_localtime_r(&f->ts0.tv_sec, &tm);
+ gnc_localtime_r(&f->t0, &tm);
tm_day_end(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_end (f->ts0.tv_sec);
+ r_time = gnc_time64_get_day_end (f->t0);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts1.tv_sec, &tm);
+ gnc_localtime_r(&f->t1, &tm);
tm_day_end(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_end (f->ts1.tv_sec);
+ r_time = gnc_time64_get_day_end (f->t1);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts2.tv_sec, &tm);
+ gnc_localtime_r(&f->t2, &tm);
tm_day_end(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_end (f->ts2.tv_sec);
+ r_time = gnc_time64_get_day_end (f->t2);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts3.tv_sec, &tm);
+ gnc_localtime_r(&f->t3, &tm);
tm_day_end(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_end (f->ts3.tv_sec);
+ r_time = gnc_time64_get_day_end (f->t3);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts4.tv_sec, &tm);
+ gnc_localtime_r(&f->t4, &tm);
tm_day_end(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_end (f->ts4.tv_sec);
+ r_time = gnc_time64_get_day_end (f->t4);
g_assert_cmpint (t_time, ==, r_time);
- gnc_localtime_r(&f->ts5.tv_sec, &tm);
+ gnc_localtime_r(&f->t5, &tm);
tm_day_end(&tm);
t_time = gnc_mktime(&tm);
- r_time = gnc_time64_get_day_end (f->ts5.tv_sec);
+ r_time = gnc_time64_get_day_end (f->t5);
g_assert_cmpint (t_time, ==, r_time);
}
@@ -2149,26 +1857,26 @@ gnc_dow_abbrev(gchar *buf, int buf_len, int dow)// C: 4 in 2 Local: 0:0:0
test_gnc_dow_abbrev (void)
{
}*/
-/* timespec_boxed_copy_func
+/* time64_boxed_copy_func
static gpointer
-timespec_boxed_copy_func( gpointer in_timespec )// Local: 0:1:0
+time64_boxed_copy_func( gpointer in_time64 )// Local: 0:1:0
*/
/* static void
-test_timespec_boxed_copy_func (void)
+test_time64_boxed_copy_func (void)
{
}*/
-/* timespec_boxed_free_func
+/* time64_boxed_free_func
static void
-timespec_boxed_free_func( gpointer in_timespec )// Local: 0:1:0
+time64_boxed_free_func( gpointer in_time64 )// Local: 0:1:0
*/
/* static void
-test_timespec_boxed_free_func (void)
+test_time64_boxed_free_func (void)
{
}*/
// Not Used
-/* timespec_get_type
+/* time64_get_type
GType
-timespec_get_type( void )// Local: 0:0:0
+time64_get_type( void )// Local: 0:0:0
*/
@@ -2187,12 +1895,7 @@ test_suite_gnc_date (void)
GNC_TEST_ADD_FUNC (suitename, "gnc date string to dateformat", test_gnc_date_string_to_dateformat);
GNC_TEST_ADD_FUNC (suitename, "gnc date monthformat to string", test_gnc_date_monthformat_to_string);
GNC_TEST_ADD_FUNC (suitename, "gnc date string to monthformat", test_gnc_date_string_to_monthformat);
- GNC_TEST_ADD_FUNC (suitename, "timespec normalize", test_timespec_normalize);
- GNC_TEST_ADD_FUNC (suitename, "timespec equal", test_timespec_equal);
- GNC_TEST_ADD_FUNC (suitename, "timespec cmp", test_timespec_cmp);
- GNC_TEST_ADD_FUNC (suitename, "timespec diff", test_timespec_diff);
- GNC_TEST_ADD_FUNC (suitename, "timespec abs", test_timespec_abs);
- GNC_TEST_ADD_FUNC (suitename, "timespecCanonicalDayTime", test_timespecCanonicalDayTime);
+ GNC_TEST_ADD_FUNC (suitename, "time64CanonicalDayTime", test_time64CanonicalDayTime);
GNC_TEST_ADD_FUNC (suitename, "date get last mday", test_gnc_date_get_last_mday);
GNC_TEST_ADD_FUNC (suitename, "qof date format set", test_qof_date_format_set);
// GNC_TEST_ADD_FUNC (suitename, "qof date completion set", test_qof_date_completion_set);
@@ -2200,7 +1903,6 @@ test_suite_gnc_date (void)
GNC_TEST_ADD_FUNC (suitename, "qof print date buff", test_qof_print_date_buff);
GNC_TEST_ADD_FUNC (suitename, "qof print gdate", test_qof_print_gdate);
GNC_TEST_ADD_FUNC (suitename, "qof print date", test_qof_print_date);
- GNC_TEST_ADD_FUNC (suitename, "gnc print date", test_gnc_print_date);
// GNC_TEST_ADD_FUNC (suitename, "floordiv", test_floordiv);
// GNC_TEST_ADD_FUNC (suitename, "qof scan date internal", test_qof_scan_date_internal);
GNC_TEST_ADD_FUNC (suitename, "qof scan date", test_qof_scan_date);
@@ -2211,18 +1913,15 @@ test_suite_gnc_date (void)
// GNC_TEST_ADD_FUNC (suitename, "qof strftime", test_qof_strftime);
GNC_TEST_ADD_FUNC (suitename, "gnc_date_timestamp", test_gnc_date_timestamp);
GNC_TEST_ADD (suitename, "gnc iso8601 to time64 gmt", FixtureA, NULL, setup, test_gnc_iso8601_to_time64_gmt, NULL);
- GNC_TEST_ADD (suitename, "gnc timespec to iso8601 buff", FixtureA, NULL, setup, test_gnc_timespec_to_iso8601_buff, NULL);
-// GNC_TEST_ADD_FUNC (suitename, "gnc dmy2timespec internal", test_gnc_dmy2timespec_internal);
+ GNC_TEST_ADD (suitename, "gnc time64 to iso8601 buff", FixtureA, NULL, setup, test_gnc_time64_to_iso8601_buff, NULL);
+// GNC_TEST_ADD_FUNC (suitename, "gnc dmy2time64 internal", test_gnc_dmy2time64_internal);
- GNC_TEST_ADD (suitename, "gnc dmy2timespec", FixtureB, NULL, setup_begin, test_gnc_dmy2timespec, NULL);
- GNC_TEST_ADD (suitename, "gnc dmy2timespec end", FixtureB, NULL, setup_end, test_gnc_dmy2timespec_end, NULL);
- GNC_TEST_ADD (suitename, "gnc dmy2timespec Neutral", FixtureB, NULL, setup_neutral, test_gnc_dmy2timespec_neutral, NULL);
+ GNC_TEST_ADD (suitename, "gnc dmy2time64", FixtureB, NULL, setup_begin, test_gnc_dmy2time64, NULL);
+ GNC_TEST_ADD (suitename, "gnc dmy2time64 end", FixtureB, NULL, setup_end, test_gnc_dmy2time64_end, NULL);
+ GNC_TEST_ADD (suitename, "gnc dmy2time64 Neutral", FixtureB, NULL, setup_neutral, test_gnc_dmy2time64_neutral, NULL);
// GNC_TEST_ADD_FUNC (suitename, "gnc timezone", test_gnc_timezone);
-// GNC_TEST_ADD_FUNC (suitename, "timespecFromTime t", test_timespecFromtime64);
-// GNC_TEST_ADD_FUNC (suitename, "timespec now", test_timespec_now);
-// GNC_TEST_ADD_FUNC (suitename, "timespecToTime t", test_timespecTotime64);
- GNC_TEST_ADD (suitename, "timespec to gdate", FixtureA, NULL, setup, test_timespec_to_gdate, NULL);
- GNC_TEST_ADD (suitename, "gdate to timespec", FixtureB, NULL, setup_neutral, test_gdate_to_timespec, NULL);
+ GNC_TEST_ADD (suitename, "time64 to gdate", FixtureA, NULL, setup, test_time64_to_gdate, NULL);
+ GNC_TEST_ADD (suitename, "gdate to time64", FixtureB, NULL, setup_neutral, test_gdate_to_time64, NULL);
// GNC_TEST_ADD_FUNC (suitename, "gnc tm get day start", test_gnc_tm_get_day_start);
// GNC_TEST_ADD_FUNC (suitename, "gnc tm get day end", test_gnc_tm_get_day_end);
GNC_TEST_ADD (suitename, "gnc time64 get day start", FixtureA, NULL, setup, test_gnc_time64_get_day_start, NULL);
@@ -2231,7 +1930,7 @@ test_suite_gnc_date (void)
// GNC_TEST_ADD_FUNC (suitename, "gnc timet get today start", test_gnc_time64_get_today_start);
// GNC_TEST_ADD_FUNC (suitename, "gnc timet get today end", test_gnc_time64_get_today_end);
// GNC_TEST_ADD_FUNC (suitename, "gnc dow abbrev", test_gnc_dow_abbrev);
-// GNC_TEST_ADD_FUNC (suitename, "timespec boxed copy func", test_timespec_boxed_copy_func);
-// GNC_TEST_ADD_FUNC (suitename, "timespec boxed free func", test_timespec_boxed_free_func);
+// GNC_TEST_ADD_FUNC (suitename, "time64 boxed copy func", test_time64_boxed_copy_func);
+// GNC_TEST_ADD_FUNC (suitename, "time64 boxed free func", test_time64_boxed_free_func);
g_time_zone_unref(tz);
}
commit 20f6e4e690cf9d29a9181f5cb7f628eb38179bad
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Aug 4 14:18:39 2018 -0700
Remove Timespec from the SQL backend.
diff --git a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
index 4c0d7ac..534c185 100644
--- a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+++ b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
@@ -138,7 +138,7 @@ setup_memory (Fixture* fixture, gconstpointer pData)
frame->set ({"int64-val"}, new KvpValue (INT64_C (100)));
frame->set ({"double-val"}, new KvpValue (3.14159));
frame->set ({"numeric-val"}, new KvpValue (gnc_numeric_zero ()));
- frame->set ({"timespec-val"}, new KvpValue (gnc_time(nullptr)));
+ frame->set ({"time-val"}, new KvpValue (gnc_time(nullptr)));
frame->set ({"string-val"}, new KvpValue ("abcdefghijklmnop"));
auto guid = qof_instance_get_guid (QOF_INSTANCE (acct1));
frame->set ({"guid-val"}, new KvpValue (const_cast<GncGUID*> (guid_copy (
diff --git a/libgnucash/backend/sql/gnc-entry-sql.cpp b/libgnucash/backend/sql/gnc-entry-sql.cpp
index f68e210..b22bc55 100644
--- a/libgnucash/backend/sql/gnc-entry-sql.cpp
+++ b/libgnucash/backend/sql/gnc-entry-sql.cpp
@@ -70,9 +70,9 @@ static void entry_set_bill (gpointer pObject, gpointer val);
static EntryVec col_table
({
gnc_sql_make_table_entry<CT_GUID>("guid", 0, COL_NNUL | COL_PKEY, "guid"),
- gnc_sql_make_table_entry<CT_TIME64>("date", 0, COL_NNUL, ENTRY_DATE,
+ gnc_sql_make_table_entry<CT_TIME>("date", 0, COL_NNUL, ENTRY_DATE,
true),
- gnc_sql_make_table_entry<CT_TIME64>("date_entered", 0, 0,
+ gnc_sql_make_table_entry<CT_TIME>("date_entered", 0, 0,
ENTRY_DATE_ENTERED, true),
gnc_sql_make_table_entry<CT_STRING>(
"description", MAX_DESCRIPTION_LEN, 0, "description"),
diff --git a/libgnucash/backend/sql/gnc-invoice-sql.cpp b/libgnucash/backend/sql/gnc-invoice-sql.cpp
index 29a18fd..b134bc7 100644
--- a/libgnucash/backend/sql/gnc-invoice-sql.cpp
+++ b/libgnucash/backend/sql/gnc-invoice-sql.cpp
@@ -67,9 +67,9 @@ static EntryVec col_table
gnc_sql_make_table_entry<CT_GUID>("guid", 0, COL_NNUL | COL_PKEY, "guid"),
gnc_sql_make_table_entry<CT_STRING>("id", MAX_ID_LEN, COL_NNUL, INVOICE_ID,
true),
- gnc_sql_make_table_entry<CT_TIME64>("date_opened", 0, 0, INVOICE_OPENED,
+ gnc_sql_make_table_entry<CT_TIME>("date_opened", 0, 0, INVOICE_OPENED,
true),
- gnc_sql_make_table_entry<CT_TIME64>("date_posted", 0, 0, INVOICE_POSTED,
+ gnc_sql_make_table_entry<CT_TIME>("date_posted", 0, 0, INVOICE_POSTED,
true),
gnc_sql_make_table_entry<CT_STRING>("notes", MAX_NOTES_LEN, COL_NNUL,
"notes"),
diff --git a/libgnucash/backend/sql/gnc-order-sql.cpp b/libgnucash/backend/sql/gnc-order-sql.cpp
index 50cde38..453a7a4 100644
--- a/libgnucash/backend/sql/gnc-order-sql.cpp
+++ b/libgnucash/backend/sql/gnc-order-sql.cpp
@@ -66,9 +66,9 @@ static EntryVec col_table
gnc_sql_make_table_entry<CT_STRING>(
"reference", MAX_REFERENCE_LEN, COL_NNUL, "reference"),
gnc_sql_make_table_entry<CT_BOOLEAN>("active", 0, COL_NNUL, "order"),
- gnc_sql_make_table_entry<CT_TIMESPEC>("date_opened", 0, COL_NNUL,
+ gnc_sql_make_table_entry<CT_TIME>("date_opened", 0, COL_NNUL,
"date-opened"),
- gnc_sql_make_table_entry<CT_TIMESPEC>("date_closed", 0, COL_NNUL,
+ gnc_sql_make_table_entry<CT_TIME>("date_closed", 0, COL_NNUL,
"date-closed"),
gnc_sql_make_table_entry<CT_OWNERREF>("owner", 0, COL_NNUL,
ORDER_OWNER, true),
diff --git a/libgnucash/backend/sql/gnc-price-sql.cpp b/libgnucash/backend/sql/gnc-price-sql.cpp
index 6a12872..1fcc5d5 100644
--- a/libgnucash/backend/sql/gnc-price-sql.cpp
+++ b/libgnucash/backend/sql/gnc-price-sql.cpp
@@ -63,7 +63,7 @@ static const EntryVec col_table
"commodity"),
gnc_sql_make_table_entry<CT_COMMODITYREF>("currency_guid", 0, COL_NNUL,
"currency"),
- gnc_sql_make_table_entry<CT_TIMESPEC>("date", 0, COL_NNUL, "date"),
+ gnc_sql_make_table_entry<CT_TIME>("date", 0, COL_NNUL, "date"),
gnc_sql_make_table_entry<CT_STRING>("source", PRICE_MAX_SOURCE_LEN, 0,
"source"),
gnc_sql_make_table_entry<CT_STRING>("type", PRICE_MAX_TYPE_LEN, 0, "type"),
diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp
index 6cb48ff..cf1fc7b 100644
--- a/libgnucash/backend/sql/gnc-slots-sql.cpp
+++ b/libgnucash/backend/sql/gnc-slots-sql.cpp
@@ -90,8 +90,8 @@ static gpointer get_string_val (gpointer pObject);
static void set_string_val (gpointer pObject, gpointer pValue);
static gpointer get_double_val (gpointer pObject);
static void set_double_val (gpointer pObject, gpointer pValue);
-static Timespec get_timespec_val (gpointer pObject);
-static void set_timespec_val (gpointer pObject, Timespec *ts);
+static time64 get_time_val (gpointer pObject);
+static void set_time_val (gpointer pObject, time64 t);
static gpointer get_guid_val (gpointer pObject);
static void set_guid_val (gpointer pObject, gpointer pValue);
static gnc_numeric get_numeric_val (gpointer pObject);
@@ -112,7 +112,7 @@ enum
int64_val_col,
string_val_col,
double_val_col,
- timespec_val_col,
+ time_val_col,
guid_val_col,
numeric_val_col,
gdate_val_col
@@ -140,9 +140,9 @@ static const EntryVec col_table
gnc_sql_make_table_entry<CT_DOUBLE>("double_val", 0, 0,
(QofAccessFunc)get_double_val,
set_double_val),
- gnc_sql_make_table_entry<CT_TIMESPEC>("timespec_val", 0, 0,
- (QofAccessFunc)get_timespec_val,
- (QofSetterFunc)set_timespec_val),
+ gnc_sql_make_table_entry<CT_TIME>("time_val", 0, 0,
+ (QofAccessFunc)get_time_val,
+ (QofSetterFunc)set_time_val),
gnc_sql_make_table_entry<CT_GUID>("guid_val", 0, 0,
(QofAccessFunc)get_guid_val,
set_guid_val),
@@ -390,24 +390,24 @@ set_double_val (gpointer pObject, gpointer pValue)
set_slot_from_value (pInfo, value);
}
-static Timespec
-get_timespec_val (gpointer pObject)
+static time64
+get_time_val (gpointer pObject)
{
slot_info_t* pInfo = (slot_info_t*)pObject;
- g_return_val_if_fail (pObject != NULL, gnc_dmy2timespec (1, 1, 1970));
+ g_return_val_if_fail (pObject != NULL, 0);
//if( kvp_value_get_type( pInfo->pKvpValue ) == KvpValue::Type::TIME64 ) {
auto t = pInfo->pKvpValue->get<Time64> ();
- return {t.t, 0};
+ return t.t;
}
static void
-set_timespec_val (gpointer pObject, Timespec *ts)
+set_time_val (gpointer pObject, time64 time)
{
slot_info_t* pInfo = (slot_info_t*)pObject;
KvpValue* value = NULL;
- Time64 t{ts->tv_sec};
+ Time64 t{time};
g_return_if_fail (pObject != NULL);
if (pInfo->value_type != KvpValue::Type::TIME64) return;
diff --git a/libgnucash/backend/sql/gnc-sql-backend.hpp b/libgnucash/backend/sql/gnc-sql-backend.hpp
index bde8700..051b3ed 100644
--- a/libgnucash/backend/sql/gnc-sql-backend.hpp
+++ b/libgnucash/backend/sql/gnc-sql-backend.hpp
@@ -246,7 +246,7 @@ protected:
bool m_loading; /**< We are performing an initial load */
bool m_in_query; /**< We are processing a query */
bool m_is_pristine_db; /**< Are we saving to a new pristine db? */
- const char* m_timespec_format = nullptr; /**< Server-specific date-time string format */
+ const char* m_time_format = nullptr; /**< Server-specific date-time string format */
VersionVec m_versions; /**< Version number for each table */
private:
bool write_account_tree(Account*);
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
index 6daed1d..e48c165 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
@@ -367,29 +367,22 @@ GncSqlColumnTableEntryImpl<CT_GUID>::add_to_query(QofIdTypeConst obj_name,
}
}
/* ----------------------------------------------------------------- */
-typedef Timespec (*TimespecAccessFunc) (const gpointer);
-typedef void (*TimespecSetterFunc) (const gpointer, Timespec*);
-
-#define TIMESPEC_COL_SIZE (4+3+3+3+3+3)
+typedef time64 (*Time64AccessFunc) (const gpointer);
+typedef void (*Time64SetterFunc) (const gpointer, time64);
+constexpr int TIME_COL_SIZE = 4 + 3 + 3 + 3 + 3 + 3;
template<> void
-GncSqlColumnTableEntryImpl<CT_TIMESPEC>::load (const GncSqlBackend* sql_be,
- GncSqlRow& row,
- QofIdTypeConst obj_name,
- gpointer pObject) const noexcept
+GncSqlColumnTableEntryImpl<CT_TIME>::load (const GncSqlBackend* sql_be,
+ GncSqlRow& row,
+ QofIdTypeConst obj_name,
+ gpointer pObject)
+ const noexcept
{
-
- Timespec ts = {0, 0};
- gboolean isOK = FALSE;
-
-
- g_return_if_fail (pObject != NULL);
+ time64 t{0};
g_return_if_fail (m_gobj_param_name != nullptr || get_setter(obj_name) != nullptr);
-
try
{
- auto val = row.get_time64_at_col(m_col_name);
- timespecFromTime64 (&ts, val);
+ t = row.get_time64_at_col (m_col_name);
}
catch (std::invalid_argument&)
{
@@ -397,121 +390,64 @@ GncSqlColumnTableEntryImpl<CT_TIMESPEC>::load (const GncSqlBackend* sql_be,
{
auto val = row.get_string_at_col(m_col_name);
GncDateTime time(val);
- ts.tv_sec = static_cast<time64>(time);
+ t = static_cast<time64>(time);
}
catch (const std::invalid_argument& err)
{
if (strcmp(err.what(), "Column empty.") != 0)
{
- auto val = row.get_string_at_col(m_col_name);
+ auto val = row.get_string_at_col (m_col_name);
PWARN("An invalid date %s was found in your database."
"It has been set to 1 January 1970.", val.c_str());
}
- ts.tv_sec = 0;
}
}
- set_parameter(pObject, &ts,
- reinterpret_cast<TimespecSetterFunc>(get_setter(obj_name)),
- m_gobj_param_name);
- }
-
-template<> void
-GncSqlColumnTableEntryImpl<CT_TIMESPEC>::add_to_table(ColVec& vec) const noexcept
-{
- GncSqlColumnInfo info{*this, BCT_DATETIME, TIMESPEC_COL_SIZE, FALSE};
- vec.emplace_back(std::move(info));
-}
-
-template<> void
-GncSqlColumnTableEntryImpl<CT_TIMESPEC>::add_to_query(QofIdTypeConst obj_name,
- const gpointer pObject,
- PairVec& vec) const noexcept
-{
- TimespecAccessFunc ts_getter;
- Timespec ts;
-/* Can't use get_row_value_from_object because g_object_get returns a
- * Timespec* and the getter returns a Timespec. Will be fixed by the
- * replacement of timespecs with time64s.
- */
- g_return_if_fail (obj_name != NULL);
- g_return_if_fail (pObject != NULL);
-
- if (m_gobj_param_name != NULL)
- {
- Timespec* pts;
- g_object_get (pObject, m_gobj_param_name, &pts, NULL);
- ts = *pts;
- }
- else
+ if (m_gobj_param_name != nullptr)
{
- ts_getter = (TimespecAccessFunc)get_getter (obj_name);
- g_return_if_fail (ts_getter != NULL);
- ts = (*ts_getter) (pObject);
- }
- if (ts.tv_sec > MINTIME && ts.tv_sec < MAXTIME)
- {
- GncDateTime time(ts.tv_sec);
- vec.emplace_back (std::make_pair (std::string{m_col_name},
- time.format_zulu ("'%Y-%m-%d %H:%M:%S'")));
+ Time64 t64{t};
+ set_parameter(pObject, &t64, m_gobj_param_name);
}
else
{
- vec.emplace_back (std::make_pair (std::string{m_col_name},
- "NULL"));
+ set_parameter(pObject, t,
+ reinterpret_cast<Time64SetterFunc>(get_setter(obj_name)),
+ nullptr);
}
}
-/* ----------------------------------------------------------------- */
-typedef time64 (*Time64AccessFunc) (const gpointer);
-typedef void (*Time64SetterFunc) (const gpointer, time64);
template<> void
-GncSqlColumnTableEntryImpl<CT_TIME64>::load (const GncSqlBackend* sql_be,
- GncSqlRow& row,
- QofIdTypeConst obj_name,
- gpointer pObject)
- const noexcept
+GncSqlColumnTableEntryImpl<CT_TIME>::add_to_table(ColVec& vec) const noexcept
{
- time64 t;
- g_return_if_fail (m_gobj_param_name != nullptr || get_setter(obj_name) != nullptr);
- try
- {
- t = row.get_time64_at_col (m_col_name);
- }
- catch (std::invalid_argument&)
- {
- try
- {
- auto val = row.get_string_at_col(m_col_name);
- GncDateTime time(val);
- t = static_cast<time64>(time);
- }
- catch (std::invalid_argument&)
- {
- return;
- }
- }
- set_parameter(pObject, t,
- reinterpret_cast<Time64SetterFunc>(get_setter(obj_name)),
- m_gobj_param_name);
-}
-template<> void
-GncSqlColumnTableEntryImpl<CT_TIME64>::add_to_table(ColVec& vec) const noexcept
-{
-
- GncSqlColumnInfo info{*this, BCT_DATETIME, TIMESPEC_COL_SIZE, FALSE};
+ GncSqlColumnInfo info{*this, BCT_DATETIME, TIME_COL_SIZE, FALSE};
vec.emplace_back(std::move(info));
}
template<> void
-GncSqlColumnTableEntryImpl<CT_TIME64>::add_to_query(QofIdTypeConst obj_name,
+GncSqlColumnTableEntryImpl<CT_TIME>::add_to_query(QofIdTypeConst obj_name,
const gpointer pObject,
PairVec& vec) const noexcept
{
- auto t = get_row_value_from_object<time64>(obj_name, pObject);
- if (t > MINTIME && t < MAXTIME)
+ /* We still can't use get_row_value_from_object because while g_value could
+ * contentedly store a time64 in an int64, KVP wouldn't be able to tell them
+ * apart, so we have the struct Time64 hack, see engine/gnc-date.c.
+ */
+ time64 t64;
+ if (m_gobj_param_name != nullptr)
+ {
+ Time64* t;
+ g_object_get (pObject, m_gobj_param_name, &t, nullptr);
+ t64 = t->t;
+ }
+ else
+ {
+ auto getter = (Time64AccessFunc)get_getter (obj_name);
+ g_return_if_fail(getter != nullptr);
+ t64 = (*getter)(pObject);
+ }
+ if (t64 > MINTIME && t64 < MAXTIME)
{
- GncDateTime time(t);
+ GncDateTime time(t64);
vec.emplace_back (std::make_pair (std::string{m_col_name},
time.format_zulu ("'%Y-%m-%d %H:%M:%S'")));
}
@@ -539,7 +475,7 @@ GncSqlColumnTableEntryImpl<CT_GDATE>::load (const GncSqlBackend* sql_be,
g_date_clear (&date, 1);
try
{
- /* timespec_to_gdate applies the tz, and gdates are saved
+ /* time64_to_gdate applies the tz, and gdates are saved
* as ymd, so we don't want that.
*/
auto time = row.get_time64_at_col(m_col_name);
@@ -667,7 +603,7 @@ GncSqlColumnTableEntryImpl<CT_NUMERIC>::add_to_query(QofIdTypeConst obj_name,
const gpointer pObject,
PairVec& vec) const noexcept
{
-/* We can't use get_row_value_from_object for the same reason as Timespec. */
+/* We can't use get_row_value_from_object for the same reason as time64. */
NumericGetterFunc getter;
gnc_numeric n;
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
index b365d4a..7ea6e93 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
@@ -71,8 +71,7 @@ enum GncSqlObjectType
CT_GUID,
CT_INT,
CT_INT64,
- CT_TIMESPEC,
- CT_TIME64,
+ CT_TIME,
CT_GDATE,
CT_NUMERIC,
CT_DOUBLE,
diff --git a/libgnucash/backend/sql/gnc-transaction-sql.cpp b/libgnucash/backend/sql/gnc-transaction-sql.cpp
index df1c950..780cfcf 100644
--- a/libgnucash/backend/sql/gnc-transaction-sql.cpp
+++ b/libgnucash/backend/sql/gnc-transaction-sql.cpp
@@ -90,8 +90,8 @@ static const EntryVec tx_col_table
gnc_sql_make_table_entry<CT_COMMODITYREF>("currency_guid", 0, COL_NNUL,
"currency"),
gnc_sql_make_table_entry<CT_STRING>("num", TX_MAX_NUM_LEN, COL_NNUL, "num"),
- gnc_sql_make_table_entry<CT_TIMESPEC>("post_date", 0, 0, "post-date"),
- gnc_sql_make_table_entry<CT_TIMESPEC>("enter_date", 0, 0, "enter-date"),
+ gnc_sql_make_table_entry<CT_TIME>("post_date", 0, 0, "post-date"),
+ gnc_sql_make_table_entry<CT_TIME>("enter_date", 0, 0, "enter-date"),
gnc_sql_make_table_entry<CT_STRING>("description", TX_MAX_DESCRIPTION_LEN,
0, "description"),
};
@@ -116,7 +116,7 @@ static const EntryVec split_col_table
gnc_sql_make_table_entry<CT_STRING>("reconcile_state", 1, COL_NNUL,
(QofAccessFunc)get_split_reconcile_state,
set_split_reconcile_state),
- gnc_sql_make_table_entry<CT_TIMESPEC>("reconcile_date", 0, 0,
+ gnc_sql_make_table_entry<CT_TIME>("reconcile_date", 0, 0,
"reconcile-date"),
gnc_sql_make_table_entry<CT_NUMERIC>("value", 0, COL_NNUL, "value"),
gnc_sql_make_table_entry<CT_NUMERIC>("quantity", 0, COL_NNUL, "amount"),
@@ -127,7 +127,7 @@ static const EntryVec split_col_table
static const EntryVec post_date_col_table
{
- gnc_sql_make_table_entry<CT_TIMESPEC>("post_date", 0, 0, "post-date"),
+ gnc_sql_make_table_entry<CT_TIME>("post_date", 0, 0, "post-date"),
};
static const EntryVec account_guid_col_table
diff --git a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp
index a990385..81e95e1 100644
--- a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp
+++ b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp
@@ -597,30 +597,6 @@ gnc_sql_add_objectref_guid_col_info_to_list (,// 1
test_gnc_sql_add_objectref_guid_col_info_to_list (Fixture *fixture, gconstpointer pData)
{
}*/
-/* load_timespec
-static void
-load_timespec (const GncSqlBackend* sql_be, GncSqlRow& row,// 2
-*/
-/* static void
-test_load_timespec (Fixture *fixture, gconstpointer pData)
-{
-}*/
-/* add_timespec_col_info_to_list
-static void
-add_timespec_col_info_to_list (const GncSqlBackend* sql_be, const GncSqlColumnTableEntry& table_row,// 2
-*/
-/* static void
-test_add_timespec_col_info_to_list (Fixture *fixture, gconstpointer pData)
-{
-}*/
-/* add_value_timespec_to_vec
-static void
-add_gvalue_timespec_to_slist (const GncSqlBackend* sql_be, QofIdTypeConst obj_name,// 2
-*/
-/* static void
-test_add_value_timespec_to_vec (Fixture *fixture, gconstpointer pData)
-{
-}*/
/* load_date
static void
load_date (const GncSqlBackend* sql_be, GncSqlRow& row,// 2
@@ -915,9 +891,6 @@ test_suite_gnc_backend_sql (void)
// GNC_TEST_ADD (suitename, "add value guid to vec", Fixture, nullptr, test_add_value_guid_to_vec, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add gvalue objectref guid to slist", Fixture, nullptr, test_gnc_sql_add_objectref_guid_to_vec, teardown);
// GNC_TEST_ADD (suitename, "gnc sql add objectref guid col info to list", Fixture, nullptr, test_gnc_sql_add_objectref_guid_col_info_to_list, teardown);
-// GNC_TEST_ADD (suitename, "load timespec", Fixture, nullptr, test_load_timespec, teardown);
-// GNC_TEST_ADD (suitename, "add timespec col info to list", Fixture, nullptr, test_add_timespec_col_info_to_list, teardown);
-// GNC_TEST_ADD (suitename, "add value timespec to vec", Fixture, nullptr, test_add_value_timespec_to_vec, teardown);
// GNC_TEST_ADD (suitename, "load date", Fixture, nullptr, test_load_date, teardown);
// GNC_TEST_ADD (suitename, "add date col info to list", Fixture, nullptr, test_add_date_col_info_to_list, teardown);
// GNC_TEST_ADD (suitename, "add value date to vec", Fixture, nullptr, test_add_value_date_to_vec, teardown);
commit 755773ac4cf225bbd78000a8290a4809d3b09a18
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 3 14:00:07 2018 -0700
Clean up timespec comments in the XML backend.
Noting where the word must stay; most significantly for KVP types and for
parsing Version 1 XML files.
diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp
index bbb6c70..6cdf405 100644
--- a/libgnucash/backend/xml/sixtp-dom-generators.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp
@@ -271,6 +271,9 @@ add_kvp_value_node (xmlNodePtr node, const gchar* tag, KvpValue* val)
add_text_to_node (val_node, "guid", guidstr);
break;
}
+ /* Note: The type attribute must remain 'timespec' to maintain
+ * compatibility.
+ */
case KvpValue::Type::TIME64:
{
auto t = val->get<Time64> ();
diff --git a/libgnucash/backend/xml/sixtp-dom-parsers.cpp b/libgnucash/backend/xml/sixtp-dom-parsers.cpp
index 5d9cae9..0bde990 100644
--- a/libgnucash/backend/xml/sixtp-dom-parsers.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-parsers.cpp
@@ -348,6 +348,8 @@ struct kvp_val_converter
const gchar* tag;
KvpValue* (*converter) (xmlNodePtr node);
};
+/* Note: The type attribute must remain 'timespec' to maintain compatibility.
+ */
struct kvp_val_converter val_converters[] =
{
@@ -531,17 +533,16 @@ dom_tree_to_time64 (xmlNodePtr node)
/* Turn something like this
<date-posted>
- <s>Mon, 05 Jun 2000 23:16:19 -0500</s>
- <ns>658864000</ns>
+ <ts:date>Mon, 05 Jun 2000 23:16:19 -0500</ts:date>
</date-posted>
- into a time64. If this returns FALSE, the effects on *ts are
- undefined. The XML is valid if it has at least one of <s> or <ns>
- and no more than one of each. Order is irrelevant. */
+ into a time64, returning INT64_MAX that we're using to flag an erroneous
+ date if there's a problem. Only one ts:date element is permitted for any
+ date attribute.
+ */
time64 ret {INT64_MAX};
- gboolean seen_s = FALSE;
- gboolean seen_ns = FALSE;
+ gboolean seen = FALSE;
xmlNodePtr n;
for (n = node->xmlChildrenNode; n; n = n->next)
@@ -554,7 +555,7 @@ dom_tree_to_time64 (xmlNodePtr node)
case XML_ELEMENT_NODE:
if (g_strcmp0 ("ts:date", (char*)n->name) == 0)
{
- if (seen_s)
+ if (seen)
{
return INT64_MAX;
}
@@ -568,21 +569,21 @@ dom_tree_to_time64 (xmlNodePtr node)
ret = gnc_iso8601_to_time64_gmt (content);
g_free (content);
- seen_s = TRUE;
+ seen = TRUE;
}
}
break;
default:
PERR ("unexpected sub-node.");
- return time_parse_failure ();
+ return INT64_MAX;
break;
}
}
- if (!seen_s)
+ if (!seen)
{
PERR ("no ts:date node found.");
- return time_parse_failure ();
+ return INT64_MAX;
}
return ret;
diff --git a/libgnucash/backend/xml/sixtp-utils.cpp b/libgnucash/backend/xml/sixtp-utils.cpp
index 03933c7..12ecd87 100644
--- a/libgnucash/backend/xml/sixtp-utils.cpp
+++ b/libgnucash/backend/xml/sixtp-utils.cpp
@@ -346,7 +346,7 @@ simple_chars_only_parser_new (sixtp_end_handler end_handler)
}
/****************************************************************************/
-/* generic timespec handler.
+/* generic timespec handler for XML Version 1 files.
A collection of node functions intended to parse a sub-node set
that looks like this:
diff --git a/libgnucash/backend/xml/test/test-dom-converters1.cpp b/libgnucash/backend/xml/test/test-dom-converters1.cpp
index 29182d1..aa2b6c3 100644
--- a/libgnucash/backend/xml/test/test-dom-converters1.cpp
+++ b/libgnucash/backend/xml/test/test-dom-converters1.cpp
@@ -138,7 +138,7 @@ test_dom_tree_to_time64 (void)
time64 test_spec2 = dom_tree_to_time64 (test_node);
if (!dom_tree_valid_time64 (test_spec2, (const xmlChar*)"test-spec"))
{
- failure_args ("dom_tree_to_timespec",
+ failure_args ("dom_tree_to_time64",
__FILE__, __LINE__, "NULL return");
printf ("Node looks like:\n");
xmlElemDump (stdout, NULL, test_node);
commit b32a8a9390da697cfddad9b33296efdb1d32f264
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 3 13:52:47 2018 -0700
Remove time64_to_string and string_to_time64 and their tests.
Each was used exactly once and simply wrapped a function call.
Also replace static function time_parse_failure that just returned a
constant with the constant.
diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp
index 4d8fff4..bbb6c70 100644
--- a/libgnucash/backend/xml/sixtp-dom-generators.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp
@@ -131,18 +131,12 @@ commodity_ref_to_dom_tree (const char* tag, const gnc_commodity* c)
return ret;
}
-char*
-time64_to_string (time64 time)
-{
- return gnc_print_time64 (time, TIMESPEC_TIME_FORMAT " %q");
-}
-
xmlNodePtr
time64_to_dom_tree (const char* tag, const time64 time)
{
xmlNodePtr ret;
g_return_val_if_fail (time != INT64_MAX, NULL);
- auto date_str = time64_to_string (time);
+ auto date_str = gnc_print_time64 (time, "%Y-%m-%d %H:%M:%S %q");
if (!date_str)
return NULL;
ret = xmlNewNode (NULL, BAD_CAST tag);
diff --git a/libgnucash/backend/xml/sixtp-dom-generators.h b/libgnucash/backend/xml/sixtp-dom-generators.h
index 68a4cf0..daf5bac 100644
--- a/libgnucash/backend/xml/sixtp-dom-generators.h
+++ b/libgnucash/backend/xml/sixtp-dom-generators.h
@@ -41,7 +41,6 @@ xmlNodePtr boolean_to_dom_tree (const char* tag, gboolean val);
xmlNodePtr guid_to_dom_tree (const char* tag, const GncGUID* gid);
xmlNodePtr commodity_ref_to_dom_tree (const char* tag, const gnc_commodity* c);
xmlNodePtr time64_to_dom_tree (const char* tag, time64);
-gchar* time64_to_string (time64);
xmlNodePtr gdate_to_dom_tree (const char* tag, const GDate* spec);
xmlNodePtr gnc_numeric_to_dom_tree (const char* tag, const gnc_numeric* num);
xmlNodePtr qof_instance_slots_to_dom_tree (const char* tag,
diff --git a/libgnucash/backend/xml/sixtp-dom-parsers.cpp b/libgnucash/backend/xml/sixtp-dom-parsers.cpp
index 1408004..5d9cae9 100644
--- a/libgnucash/backend/xml/sixtp-dom-parsers.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-parsers.cpp
@@ -524,12 +524,6 @@ dom_tree_to_gnc_numeric (xmlNodePtr node)
return ret;
}
-static time64
-time_parse_failure ()
-{
- return INT64_MAX;
-}
-
time64
dom_tree_to_time64 (xmlNodePtr node)
@@ -562,21 +556,17 @@ dom_tree_to_time64 (xmlNodePtr node)
{
if (seen_s)
{
- return time_parse_failure ();
+ return INT64_MAX;
}
else
{
gchar* content = dom_tree_to_text (n);
if (!content)
{
- return time_parse_failure ();
+ return INT64_MAX;
}
- if (!string_to_time64 (content, &ret))
- {
- g_free (content);
- return time_parse_failure ();
- }
+ ret = gnc_iso8601_to_time64_gmt (content);
g_free (content);
seen_s = TRUE;
}
diff --git a/libgnucash/backend/xml/sixtp-utils.cpp b/libgnucash/backend/xml/sixtp-utils.cpp
index 5c7dfbd..03933c7 100644
--- a/libgnucash/backend/xml/sixtp-utils.cpp
+++ b/libgnucash/backend/xml/sixtp-utils.cpp
@@ -362,13 +362,6 @@ simple_chars_only_parser_new (sixtp_end_handler end_handler)
all goes well, returns the time64 as the result.
*/
-gboolean
-string_to_time64 (const gchar* str, time64* time)
-{
- *time = gnc_iso8601_to_time64_gmt (str);
- return (TRUE);
-}
-
/* Top level timespec node:
input: user end handler *
@@ -436,17 +429,17 @@ generic_timespec_secs_end_handler (gpointer data_for_children,
{
gchar* txt = NULL;
Time64ParseInfo* info = (Time64ParseInfo*) parent_data;
- gboolean ok;
g_return_val_if_fail (parent_data, FALSE);
txt = concatenate_child_result_chars (data_from_children);
g_return_val_if_fail (txt, FALSE);
- ok = string_to_time64 (txt, & info->time);
+ info->time = gnc_iso8601_to_time64_gmt (txt);
g_free (txt);
- g_return_val_if_fail (ok, FALSE);
+// gnc_iso8601_to_time64_gmt returns INT64_MAX on failure.
+ g_return_val_if_fail (info->time < INT64_MAX, FALSE);
info->s_block_count++;
return (TRUE);
diff --git a/libgnucash/backend/xml/sixtp-utils.h b/libgnucash/backend/xml/sixtp-utils.h
index 4129fe3..2ee7aa1 100644
--- a/libgnucash/backend/xml/sixtp-utils.h
+++ b/libgnucash/backend/xml/sixtp-utils.h
@@ -35,10 +35,6 @@ typedef struct
guint s_block_count;
} Time64ParseInfo;
-#define TIMESPEC_TIME_FORMAT "%Y-%m-%d %H:%M:%S"
-#define TIMESPEC_PARSE_TIME_FORMAT "%Y-%m-%d %H:%M:%S"
-#define TIMESPEC_SEC_FORMAT_MAX 256
-
gboolean isspace_str (const gchar* str, int nomorethan);
gboolean allow_and_ignore_only_whitespace (GSList* sibling_data,
@@ -84,8 +80,6 @@ gboolean generic_return_chars_end_handler (gpointer data_for_children,
sixtp* simple_chars_only_parser_new (sixtp_end_handler end_handler);
-gboolean string_to_time64 (const gchar* str, time64* ts);
-
gboolean generic_timespec_start_handler (GSList* sibling_data,
gpointer parent_data,
gpointer global_data,
diff --git a/libgnucash/backend/xml/test/CMakeLists.txt b/libgnucash/backend/xml/test/CMakeLists.txt
index 1468dfe..77b126c 100644
--- a/libgnucash/backend/xml/test/CMakeLists.txt
+++ b/libgnucash/backend/xml/test/CMakeLists.txt
@@ -57,7 +57,7 @@ set(test_backend_xml_module_SOURCES
)
set_local_dist(test_backend_xml_DIST_local CMakeLists.txt grab-types.pl
- README test-date-converting.cpp test-dom-converters1.cpp
+ README test-dom-converters1.cpp
test-dom-parser1.cpp test-file-stuff.cpp test-file-stuff.h test-kvp-frames.cpp
test-load-backend.cpp test-load-example-account.cpp test-load-xml2.cpp
test-save-in-lang.cpp test-string-converters.cpp test-xml2-is-file.cpp
@@ -65,7 +65,6 @@ set_local_dist(test_backend_xml_DIST_local CMakeLists.txt grab-types.pl
test-xml-pricedb.cpp test-xml-transaction.cpp)
set(test_backend_xml_DIST ${test_backend_xml_DIST_local} ${test_backend_xml_test_files_DIST} PARENT_SCOPE)
-add_xml_test(test-date-converting "${test_backend_xml_base_SOURCES};test-date-converting.cpp")
add_xml_test(test-dom-converters1 "${test_backend_xml_base_SOURCES};test-dom-converters1.cpp")
add_xml_test(test-kvp-frames "${test_backend_xml_base_SOURCES};test-kvp-frames.cpp")
add_xml_test(test-load-backend test-load-backend.cpp)
diff --git a/libgnucash/backend/xml/test/test-date-converting.cpp b/libgnucash/backend/xml/test/test-date-converting.cpp
deleted file mode 100644
index d940d81..0000000
--- a/libgnucash/backend/xml/test/test-date-converting.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
- * *
-\********************************************************************/
-extern "C"
-{
-#include <config.h>
-
-#include "test-engine-stuff.h"
-
-#include <stdlib.h>
-}
-
-#include "test-file-stuff.h"
-#include "sixtp-utils.h"
-#include "sixtp-dom-generators.h"
-#include "test-stuff.h"
-
-#define GNC_V2_STRING "gnc-v2"
-const gchar* gnc_v2_xml_version_string = GNC_V2_STRING;
-
-int
-main (int argc, char** argv)
-{
- int i;
-
- for (i = 0; i < 20; i++)
- {
- time64 spec2;
- auto spec1 = get_random_time ();
- auto sec_str = time64_to_string (spec1);
- if (!string_to_time64 (sec_str, &spec2))
- {
- failure_args ("string_to_timespec_secs", __FILE__, __LINE__,
- "string is %s", sec_str);
- }
- else if (spec1 != spec2)
- {
- failure_args ("timespec_secs", __FILE__, __LINE__,
- "not equal ints are %" G_GINT64_FORMAT
- " and %" G_GINT64_FORMAT "\n",
- spec1, spec2);
- }
- else
- {
- success ("timespec");
- }
- g_free (sec_str);
- }
- print_test_results ();
- exit (get_rv ());
-}
commit 62b17ca5db863e3d08182f17c14bdba8c2046f65
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 3 12:51:11 2018 -0700
Timespec removal, engine odds-and-ends.
diff --git a/libgnucash/engine/engine.i b/libgnucash/engine/engine.i
index 9cc7c9d..288f484 100644
--- a/libgnucash/engine/engine.i
+++ b/libgnucash/engine/engine.i
@@ -211,7 +211,6 @@ SplitList * qof_query_run_subquery (QofQuery *q, const QofQuery *q);
%ignore GNC_ERROR_REMAINDER;
%include <gnc-numeric.h>
-Timespec timespecCanonicalDayTime(Timespec t);
time64 time64CanonicalDayTime(time64 t);
%include <gnc-budget.h>
diff --git a/libgnucash/engine/qofinstance-p.h b/libgnucash/engine/qofinstance-p.h
index 8fcff1b..45d4eeb 100644
--- a/libgnucash/engine/qofinstance-p.h
+++ b/libgnucash/engine/qofinstance-p.h
@@ -51,7 +51,7 @@ void qof_instance_set_slots (QofInstance *, KvpFrame *);
* used for comparing version in local memory to that in remote
* server.
*/
-void qof_instance_set_last_update (QofInstance *inst, Timespec ts);
+void qof_instance_set_last_update (QofInstance *inst, time64 time);
/** Set the dirty flag of just the instance. Don't modify the
* collection flag at all. */
diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp
index 06ae8ca..670f91b 100644
--- a/libgnucash/engine/qofinstance.cpp
+++ b/libgnucash/engine/qofinstance.cpp
@@ -86,7 +86,7 @@ typedef struct QofInstancePrivate
* SQL backend, this field is reserved for SQL use, to compare
* the version in local memory to the remote, server version.
*/
- Timespec last_update;
+ time64 last_update;
/* Keep track of nesting level of begin/end edit calls */
int editlevel;
@@ -264,8 +264,7 @@ qof_instance_init (QofInstance *inst)
priv = GET_PRIVATE(inst);
priv->book = NULL;
inst->kvp_data = new KvpFrame;
- priv->last_update.tv_sec = 0;
- priv->last_update.tv_nsec = -1;
+ priv->last_update = 0;
priv->editlevel = 0;
priv->do_free = FALSE;
priv->dirty = FALSE;
@@ -415,7 +414,7 @@ qof_instance_set_property (GObject *object,
GParamSpec *pspec)
{
QofInstance *inst;
- Timespec *ts;
+ Time64 t;
g_return_if_fail(QOF_IS_INSTANCE(object));
@@ -435,8 +434,8 @@ qof_instance_set_property (GObject *object,
static_cast<QofBook*>(g_value_get_object(value)));
break;
case PROP_LAST_UPDATE:
- ts = static_cast<Timespec*>(g_value_get_pointer(value));
- qof_instance_set_last_update(inst, *ts);
+ t = *(static_cast<Time64*>(g_value_get_pointer(value)));
+ qof_instance_set_last_update(inst, t.t);
break;
case PROP_DESTROYING:
qof_instance_set_destroying(inst, g_value_get_boolean(value));
@@ -598,10 +597,10 @@ qof_instance_set_slots (QofInstance *inst, KvpFrame *frm)
}
void
-qof_instance_set_last_update (QofInstance *inst, Timespec ts)
+qof_instance_set_last_update (QofInstance *inst, time64 t)
{
if (!inst) return;
- GET_PRIVATE(inst)->last_update = ts;
+ GET_PRIVATE(inst)->last_update = t;
}
gint
@@ -640,11 +639,8 @@ qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
lpriv = GET_PRIVATE(left);
rpriv = GET_PRIVATE(right);
- if (lpriv->last_update.tv_sec < rpriv->last_update.tv_sec) return -1;
- if (lpriv->last_update.tv_sec > rpriv->last_update.tv_sec) return +1;
- if (lpriv->last_update.tv_nsec < rpriv->last_update.tv_nsec) return -1;
- if (lpriv->last_update.tv_nsec > rpriv->last_update.tv_nsec) return +1;
- return 0;
+ return lpriv->last_update < rpriv->last_update ? -1 :
+ lpriv->last_update > rpriv->last_update ? 1 : 0;
}
gboolean
diff --git a/libgnucash/engine/qofquery.cpp b/libgnucash/engine/qofquery.cpp
index 07278df..f91d204 100644
--- a/libgnucash/engine/qofquery.cpp
+++ b/libgnucash/engine/qofquery.cpp
@@ -1827,9 +1827,12 @@ qof_query_printValueForParam (QofQueryPredData *pd, GString * gs)
if (!g_strcmp0 (pd->type_name, QOF_TYPE_DATE))
{
query_date_t pdata = (query_date_t) pd;
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, 0, sizeof(datebuff));
+ qof_print_date_buff (datebuff, sizeof(datebuff), pdata->date);
g_string_append_printf (gs, " Match type %s",
qof_query_printDateMatch (pdata->options));
- g_string_append_printf (gs, " query_date: %s", gnc_print_date ({pdata->date, 0}));
+ g_string_append_printf (gs, " query_date: %s", datebuff);
return;
}
if (!g_strcmp0 (pd->type_name, QOF_TYPE_CHAR))
diff --git a/libgnucash/engine/qofquerycore.cpp b/libgnucash/engine/qofquerycore.cpp
index 91c5afa..f9c8b98 100644
--- a/libgnucash/engine/qofquerycore.cpp
+++ b/libgnucash/engine/qofquerycore.cpp
@@ -450,7 +450,7 @@ date_to_string (gpointer object, QofParam *getter)
time64 tt = ((query_date_getter)getter->param_getfcn)(object, getter);
if (tt != INT64_MAX)
- return g_strdup (gnc_print_date ({tt, 0}));
+ return qof_print_date (tt);
return NULL;
}
diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp
index 24caa5a..05f3203 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.cpp
+++ b/libgnucash/engine/test-core/test-engine-stuff.cpp
@@ -157,20 +157,6 @@ kvp_type_excluded (KvpValue::Type kvp_type)
static gboolean zero_nsec = FALSE;
-void
-random_timespec_zero_nsec (gboolean zero_nsec_in)
-{
- zero_nsec = zero_nsec_in;
-}
-
-static gboolean usec_resolution = FALSE;
-
-void
-random_timespec_usec_resolution (gboolean usec_resolution_in)
-{
- usec_resolution = usec_resolution_in;
-}
-
/* ========================================================== */
static inline gboolean
@@ -236,20 +222,6 @@ get_random_time (void)
return ret;
}
-Timespec*
-get_random_timespec(void)
-{
- Timespec *ret;
-
- ret = g_new0(Timespec, 1);
-
- while (ret->tv_sec <= 0)
- ret->tv_sec = rand();
-
- ret->tv_nsec = 0;
- return ret;
-}
-
GncGUID*
get_random_guid(void)
{
diff --git a/libgnucash/engine/test-core/test-engine-stuff.h b/libgnucash/engine/test-core/test-engine-stuff.h
index 5f8d69d..bc661da 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.h
+++ b/libgnucash/engine/test-core/test-engine-stuff.h
@@ -45,10 +45,8 @@ typedef struct KvpValueImpl KvpValue;
typedef struct KvpFrameImpl KvpFrame;
#define __KVP_FRAME
#endif
-Timespec* get_random_timespec(void);
+
time64 get_random_time(void);
-void random_timespec_zero_nsec (gboolean zero_nsec);
-void random_timespec_usec_resolution (gboolean usec_resolution);
KvpValue* get_random_kvp_value(int type);
diff --git a/libgnucash/engine/test/test-date.cpp b/libgnucash/engine/test/test-date.cpp
index 86f802d..acf502a 100644
--- a/libgnucash/engine/test/test-date.cpp
+++ b/libgnucash/engine/test/test-date.cpp
@@ -391,7 +391,7 @@ run_test (void)
ts.tv_nsec = 0;
check_time (ts, do_print);
- ts = *get_random_timespec ();
+ ts.tv_sec = get_random_time ();
for (i = 0; i < 10000; i++)
{
@@ -402,7 +402,7 @@ run_test (void)
for (i = 0; i < 5000; i++)
{
- ts = *get_random_timespec ();
+ ts.tv_sec = get_random_time ();
if (!check_time (ts, FALSE))
return;
diff --git a/libgnucash/engine/test/test-qofinstance.cpp b/libgnucash/engine/test/test-qofinstance.cpp
index 292e250..6e04b49 100644
--- a/libgnucash/engine/test/test-qofinstance.cpp
+++ b/libgnucash/engine/test/test-qofinstance.cpp
@@ -194,7 +194,7 @@ test_instance_new_destroy( void )
QofInstance *inst;
QofInstanceClass *klass;
/* test var */
- Timespec *timespec_priv;
+ Time64 *time_priv;
const char *msg1 = "qof_instance_get_collection: assertion 'QOF_IS_INSTANCE(ptr)' failed";
const char *msg2 = "qof_instance_get_editlevel: assertion 'QOF_IS_INSTANCE(ptr)' failed";
const char *msg3 = "qof_instance_get_destroying: assertion 'QOF_IS_INSTANCE(ptr)' failed";
@@ -217,9 +217,8 @@ test_instance_new_destroy( void )
g_assert( !qof_instance_get_collection( inst ) );
g_assert( qof_instance_get_book( inst ) == NULL );
g_assert( inst->kvp_data );
- g_object_get( inst, "last-update", ×pec_priv, NULL);
- g_assert_cmpint( timespec_priv->tv_sec, == , 0 );
- g_assert_cmpint( timespec_priv->tv_nsec, == , -1 );
+ g_object_get( inst, "last-update", &time_priv, NULL);
+ g_assert_cmpint( time_priv->t, == , 0 );
g_assert_cmpint( qof_instance_get_editlevel( inst ), == , 0 );
g_assert( !qof_instance_get_destroying( inst ) );
g_assert( !qof_instance_get_dirty_flag( inst ) );
@@ -311,7 +310,7 @@ test_instance_version_cmp( void )
{
QofInstance *left, *right;
int result;
- Timespec timespec_left, timespec_right;
+ time64 time_left = 0, time_right = 1;
/* set up*/
left = static_cast<QofInstance*>(g_object_new( QOF_TYPE_INSTANCE, NULL ));
@@ -330,48 +329,24 @@ test_instance_version_cmp( void )
g_assert_cmpint( result, == , 1 );
g_test_message( "Test left tv_sec lesser than right" );
- timespec_left.tv_sec = 0;
- timespec_right.tv_sec = 1;
- qof_instance_set_last_update( left, timespec_left );
- qof_instance_set_last_update( right, timespec_right );
+ qof_instance_set_last_update( left, time_left );
+ qof_instance_set_last_update( right, time_right );
result = qof_instance_version_cmp( left, right );
g_assert_cmpint( result, == , -1 );
g_test_message( "Test right tv_sec lesser than left" );
- timespec_left.tv_sec = 1;
- timespec_right.tv_sec = 0;
- qof_instance_set_last_update( left, timespec_left );
- qof_instance_set_last_update( right, timespec_right );
- result = qof_instance_version_cmp( left, right );
- g_assert_cmpint( result, == , 1 );
-
- g_test_message( "Test left tv_nsec lesser than right" );
- timespec_left.tv_sec = 1;
- timespec_left.tv_nsec = 0;
- timespec_right.tv_sec = 1;
- timespec_right.tv_nsec = 1;
- qof_instance_set_last_update( left, timespec_left );
- qof_instance_set_last_update( right, timespec_right );
- result = qof_instance_version_cmp( left, right );
- g_assert_cmpint( result, == , -1 );
-
- g_test_message( "Test right tv_sec lesser than left" );
- timespec_left.tv_sec = 1;
- timespec_left.tv_nsec = 1;
- timespec_right.tv_sec = 1;
- timespec_right.tv_nsec = 0;
- qof_instance_set_last_update( left, timespec_left );
- qof_instance_set_last_update( right, timespec_right );
+ time_left = 1;
+ time_right = 0;
+ qof_instance_set_last_update( left, time_left );
+ qof_instance_set_last_update( right, time_right );
result = qof_instance_version_cmp( left, right );
g_assert_cmpint( result, == , 1 );
g_test_message( "Test both equal" );
- timespec_left.tv_sec = 1;
- timespec_left.tv_nsec = 1;
- timespec_right.tv_sec = 1;
- timespec_right.tv_nsec = 1;
- qof_instance_set_last_update( left, timespec_left );
- qof_instance_set_last_update( right, timespec_right );
+ time_left = 1;
+ time_right = 1;
+ qof_instance_set_last_update( left, time_left );
+ qof_instance_set_last_update( right, time_right );
result = qof_instance_version_cmp( left, right );
g_assert_cmpint( result, == , 0 );
commit 358cd979d9376c1795124d18f8cfe0eb551d4d03
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 2 18:19:15 2018 -0700
Remove Timespec from the main engine classes (Transaction, Split, & Account.
diff --git a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
index 6a397f6..e7c4c92 100644
--- a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
+++ b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
@@ -63,15 +63,6 @@ add_time64 (xmlNodePtr node, const gchar * tag, time64 time, gboolean always)
xmlAddChild (node, time64_to_dom_tree (tag, time));
}
-static void
-add_timespec (xmlNodePtr node, const gchar* tag, Timespec tms, gboolean always)
-{
- if (always || tms.tv_sec)
- {
- xmlAddChild (node, time64_to_dom_tree (tag, tms.tv_sec));
- }
-}
-
static xmlNodePtr
split_to_dom_tree (const gchar* tag, Split* spl)
{
@@ -113,8 +104,8 @@ split_to_dom_tree (const gchar* tag, Split* spl)
BAD_CAST tmp);
}
- add_timespec (ret, "split:reconcile-date",
- xaccSplitRetDateReconciledTS (spl), FALSE);
+ add_time64 (ret, "split:reconcile-date",
+ xaccSplitGetDateReconciled (spl), FALSE);
add_gnc_num (ret, "split:value", xaccSplitGetValue (spl));
@@ -445,12 +436,11 @@ set_tran_time64 (xmlNodePtr node, Transaction * trn,
static inline gboolean
set_tran_date (xmlNodePtr node, Transaction* trn,
- void (*func) (Transaction* trn, const Timespec* tm))
+ void (*func) (Transaction* trn, const time64 tm))
{
time64 time = dom_tree_to_time64 (node);
if (!dom_tree_valid_time64 (time, node->name)) time = 0;
- Timespec ts {time, 0};
- func (trn, &ts);
+ func (trn, time);
return TRUE;
}
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index 141609d..72ae32b 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -3311,19 +3311,6 @@ xaccAccountGetBalanceAsOfDate (Account *acc, time64 date)
priv = GET_PRIVATE(acc);
balance = priv->balance;
- /* Since transaction post times are stored as a Timespec,
- * convert date into a Timespec as well rather than converting
- * each transaction's Timespec into a time64.
- *
- * FIXME: CAS: I think this comment is a bogus justification for
- * using xaccTransGetDatePostedTS. There's no benefit to using
- * Timespec when the input argument is time64, and it's hard to
- * imagine that casting long long to long and comparing two longs is
- * worse than comparing two long longs every time. IMO,
- * xaccAccountGetPresentBalance gets this right, and its algorithm
- * should be used here.
- */
-
lp = priv->splits;
while ( lp && !found )
{
@@ -3432,7 +3419,6 @@ xaccAccountConvertBalanceToCurrencyAsOfDate(const Account *acc, /* for book */
{
QofBook *book;
GNCPriceDB *pdb;
- Timespec ts;
if (gnc_numeric_zero_p (balance) ||
gnc_commodity_equiv (balance_currency, new_currency))
diff --git a/libgnucash/engine/Recurrence.c b/libgnucash/engine/Recurrence.c
index c9805f4..093836a 100644
--- a/libgnucash/engine/Recurrence.c
+++ b/libgnucash/engine/Recurrence.c
@@ -391,23 +391,23 @@ time64
recurrenceGetPeriodTime(const Recurrence *r, guint period_num, gboolean end)
{
GDate date;
- Timespec ts;
+ time64 time;
recurrenceNthInstance(r, period_num + (end ? 1 : 0), &date);
if (end)
{
g_date_subtract_days(&date, 1);
- ts = gnc_dmy2timespec_end (g_date_get_day(&date),
+ time = gnc_dmy2time64_end (g_date_get_day(&date),
g_date_get_month(&date),
g_date_get_year (&date));
}
else
{
- ts = gnc_dmy2timespec (g_date_get_day(&date),
+ time = gnc_dmy2time64 (g_date_get_day(&date),
g_date_get_month(&date),
g_date_get_year (&date));
}
- return timespecToTime64(ts);
+ return time;
}
gnc_numeric
diff --git a/libgnucash/engine/Split.c b/libgnucash/engine/Split.c
index b709551..65c3e2e 100644
--- a/libgnucash/engine/Split.c
+++ b/libgnucash/engine/Split.c
@@ -115,8 +115,7 @@ gnc_split_init(Split* split)
split->amount = gnc_numeric_zero();
split->value = gnc_numeric_zero();
- split->date_reconciled.tv_sec = 0;
- split->date_reconciled.tv_nsec = 0;
+ split->date_reconciled = 0;
split->balance = gnc_numeric_zero();
split->cleared_balance = gnc_numeric_zero();
@@ -151,6 +150,7 @@ gnc_split_get_property(GObject *object,
{
Split *split;
gchar *key;
+ Time64 t;
g_return_if_fail(GNC_IS_SPLIT(object));
@@ -170,7 +170,8 @@ gnc_split_get_property(GObject *object,
g_value_set_boxed(value, &split->amount);
break;
case PROP_RECONCILE_DATE:
- g_value_set_boxed(value, &split->date_reconciled.tv_sec);
+ t.t = split->date_reconciled;
+ g_value_set_boxed(value, &t);
break;
case PROP_TX:
g_value_take_object(value, split->parent);
@@ -507,8 +508,7 @@ xaccSplitReinit(Split * split)
split->amount = gnc_numeric_zero();
split->value = gnc_numeric_zero();
- split->date_reconciled.tv_sec = 0;
- split->date_reconciled.tv_nsec = 0;
+ split->date_reconciled = 0;
split->balance = gnc_numeric_zero();
split->cleared_balance = gnc_numeric_zero();
@@ -654,6 +654,9 @@ xaccSplitCopyOnto(const Split *from_split, Split *to_split)
void
xaccSplitDump (const Split *split, const char *tag)
{
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, 0, sizeof(datebuff));
+ qof_print_date_buff (datebuff, sizeof(datebuff), split->date_reconciled);
printf(" %s Split %p", tag, split);
printf(" Book: %p\n", qof_instance_get_book(split));
printf(" Account: %p (%s)\n", split->acc,
@@ -668,8 +671,8 @@ xaccSplitDump (const Split *split, const char *tag)
printf(" Memo: %s\n", split->memo ? split->memo : "(null)");
printf(" Action: %s\n", split->action ? split->action : "(null)");
printf(" KVP Data: %s\n", qof_instance_kvp_as_string (QOF_INSTANCE (split)));
- printf(" Recncld: %c (date %s)\n", split->reconciled,
- gnc_print_date(split->date_reconciled));
+ printf(" Recncld: %c (date %s)\n", split->reconciled, datebuff);
+
printf(" Value: %s\n", gnc_numeric_to_string(split->value));
printf(" Amount: %s\n", gnc_numeric_to_string(split->amount));
printf(" Balance: %s\n", gnc_numeric_to_string(split->balance));
@@ -708,8 +711,7 @@ xaccFreeSplit (Split *split)
split->acc = NULL;
split->orig_acc = NULL;
- split->date_reconciled.tv_sec = 0;
- split->date_reconciled.tv_nsec = 0;
+ split->date_reconciled = 0;
G_OBJECT_CLASS (QOF_INSTANCE_GET_CLASS (&split->inst))->dispose(G_OBJECT (split));
// Is this right?
if (split->gains_split) split->gains_split->gains_split = NULL;
@@ -818,7 +820,7 @@ xaccSplitEqual(const Split *sa, const Split *sb,
return FALSE;
}
- if (timespec_cmp(&(sa->date_reconciled), &(sb->date_reconciled)))
+ if (sa->date_reconciled != sb->date_reconciled)
{
PINFO ("reconciled date differs");
return FALSE;
@@ -1514,7 +1516,10 @@ xaccSplitOrder (const Split *sa, const Split *sb)
if (comp > 0) return +1;
/* if dates differ, return */
- DATE_CMP(sa, sb, date_reconciled);
+ if (sa->date_reconciled < sb->date_reconciled)
+ return -1;
+ else if (sa->date_reconciled > sb->date_reconciled)
+ return 1;
/* else, sort on guid - keeps sort stable. */
retval = qof_instance_guid_compare(sa, sb);
@@ -1772,44 +1777,18 @@ xaccSplitSetDateReconciledSecs (Split *split, time64 secs)
if (!split) return;
xaccTransBeginEdit (split->parent);
- split->date_reconciled.tv_sec = secs;
- split->date_reconciled.tv_nsec = 0;
- qof_instance_set_dirty(QOF_INSTANCE(split));
- xaccTransCommitEdit(split->parent);
-
-}
-
-void
-xaccSplitSetDateReconciledTS (Split *split, Timespec *ts)
-{
- if (!split || !ts) return;
- xaccTransBeginEdit (split->parent);
-
- split->date_reconciled = *ts;
+ split->date_reconciled = secs;
qof_instance_set_dirty(QOF_INSTANCE(split));
xaccTransCommitEdit(split->parent);
}
-void
-xaccSplitGetDateReconciledTS (const Split * split, Timespec *ts)
-{
- if (!split || !ts) return;
- *ts = (split->date_reconciled);
-}
-
-Timespec
-xaccSplitRetDateReconciledTS (const Split * split)
-{
- Timespec ts = {0, 0};
- return split ? split->date_reconciled : ts;
-}
/*################## Added for Reg2 #################*/
time64
xaccSplitGetDateReconciled (const Split * split)
{
- return split ? split->date_reconciled.tv_sec : 0;
+ return split ? split->date_reconciled : 0;
}
/*################## Added for Reg2 #################*/
@@ -2004,7 +1983,7 @@ xaccSplitAddPeerSplit (Split *split, const Split *other_split,
guid = qof_instance_get_guid (QOF_INSTANCE (other_split));
xaccTransBeginEdit (split->parent);
qof_instance_kvp_add_guid (QOF_INSTANCE (split), "lot-split",
- timespec_now(), "peer_guid", guid_copy(guid));
+ gnc_time(NULL), "peer_guid", guid_copy(guid));
mark_split (split);
qof_instance_set_dirty (QOF_INSTANCE (split));
xaccTransCommitEdit (split->parent);
diff --git a/libgnucash/engine/Split.h b/libgnucash/engine/Split.h
index 4d7f417..963413e 100644
--- a/libgnucash/engine/Split.h
+++ b/libgnucash/engine/Split.h
@@ -191,15 +191,6 @@ char xaccSplitGetReconcile (const Split *split);
/** Set the date on which this split was reconciled by specifying the
* time as time64. */
void xaccSplitSetDateReconciledSecs (Split *split, time64 time);
-/** Set the date on which this split was reconciled by specifying the
- * time as Timespec. Caller still owns *ts! */
-void xaccSplitSetDateReconciledTS (Split *split, Timespec *ts);
-/** Get the date on which this split was reconciled by having it
- * written into the Timespec that 'ts' is pointing to. */
-void xaccSplitGetDateReconciledTS (const Split *split,
- Timespec *ts);
-/** Returns the date (as Timespec) on which this split was reconciled. */
-Timespec xaccSplitRetDateReconciledTS (const Split *split);
/*################## Added for Reg2 #################*/
/** Retrieve the date when the Split was reconciled. */
diff --git a/libgnucash/engine/SplitP.h b/libgnucash/engine/SplitP.h
index 2832dc8..9815d41 100644
--- a/libgnucash/engine/SplitP.h
+++ b/libgnucash/engine/SplitP.h
@@ -93,8 +93,8 @@ struct split_s
*/
char * action; /* Buy, Sell, Div, etc. */
- Timespec date_reconciled; /* date split was reconciled */
- char reconciled; /* The reconciled field */
+ time64 date_reconciled; /* date split was reconciled */
+ char reconciled; /* The reconciled field */
/* gains is a flag used to track the relationship between
* capital-gains splits. Depending on its value, this flag indicates
@@ -202,28 +202,6 @@ void DxaccSplitSetShareAmount (Split *split, double amount);
\********************************************************************/
-#define DATE_CMP(aaa,bbb,field) { \
- /* if dates differ, return */ \
- if ( (aaa->field.tv_sec) < \
- (bbb->field.tv_sec)) { \
- return -1; \
- } else \
- if ( (aaa->field.tv_sec) > \
- (bbb->field.tv_sec)) { \
- return +1; \
- } \
- \
- /* else, seconds match. check nanoseconds */ \
- if ( (aaa->field.tv_nsec) < \
- (bbb->field.tv_nsec)) { \
- return -1; \
- } else \
- if ( (aaa->field.tv_nsec) > \
- (bbb->field.tv_nsec)) { \
- return +1; \
- } \
-}
-
#define CHECK_GAINS_STATUS(s) \
if (GAINS_STATUS_UNKNOWN == s->gains) xaccSplitDetermineGainStatus(s);
diff --git a/libgnucash/engine/TransLog.c b/libgnucash/engine/TransLog.c
index b88d982..50b9ae7 100644
--- a/libgnucash/engine/TransLog.c
+++ b/libgnucash/engine/TransLog.c
@@ -244,7 +244,7 @@ xaccTransWriteLog (Transaction *trans, char flag)
for (node = trans->splits; node; node = node->next)
{
- Timespec ts;
+ time64 time;
Split *split = node->data;
const char * accname = "";
char acc_guid_str[GUID_ENCODING_LENGTH + 1];
@@ -261,8 +261,7 @@ xaccTransWriteLog (Transaction *trans, char flag)
acc_guid_str[0] = '\0';
}
- timespecFromTime64(&ts, split->date_reconciled.tv_sec);
- gnc_timespec_to_iso8601_buff (ts, drecn);
+ gnc_time64_to_iso8601_buff (split->date_reconciled, drecn);
guid_to_string_buff (xaccSplitGetGUID(split), split_guid_str);
amt = xaccSplitGetAmount (split);
diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 2223c89..17e8608 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -310,6 +310,7 @@ gnc_transaction_get_property(GObject* object,
{
Transaction* tx;
gchar *key;
+ Time64 time;
g_return_if_fail(GNC_IS_TRANSACTION(object));
@@ -326,10 +327,12 @@ gnc_transaction_get_property(GObject* object,
g_value_take_object(value, tx->common_currency);
break;
case PROP_POST_DATE:
- g_value_set_boxed(value, &tx->date_posted);
+ time.t = tx->date_posted;
+ g_value_set_boxed(value, &time);
break;
case PROP_ENTER_DATE:
- g_value_set_boxed(value, &tx->date_entered);
+ time.t = tx->date_entered;
+ g_value_set_boxed(value, &time);
break;
case PROP_INVOICE:
qof_instance_get_kvp (QOF_INSTANCE (tx), value, 2, GNC_INVOICE_ID, GNC_INVOICE_GUID);
@@ -530,8 +533,12 @@ xaccTransDump (const Transaction *trans, const char *tag)
GList *node;
printf("%s Trans %p", tag, trans);
- printf(" Entered: %s\n", gnc_print_date(trans->date_entered));
- printf(" Posted: %s\n", gnc_print_date(trans->date_posted));
+ memset(datebuff, 0, sizeof(datebuff));
+ qof_print_date_buff(datebuff, sizeof(datebuff), trans->date_entered);
+ printf(" Entered: %s\n", datebuff);
+ memset(datebuff, 0, sizeof(datebuff));
+ qof_print_date_buff(datebuff, sizeof(datebuff), trans->date_posted);
+ printf(" Posted: %s\n", datebuff);
printf(" Num: %s\n", trans->num ? trans->num : "(null)");
printf(" Description: %s\n",
trans->description ? trans->description : "(null)");
@@ -1955,7 +1962,7 @@ xaccTransSetDatePostedSecs (Transaction *trans, time64 secs)
{
if (!trans) return;
xaccTransSetDateInternal(trans, &trans->date_posted, secs);
- set_gains_date_dirty (trans);
+ set_gains_date_dirty(trans);
}
void
@@ -1974,7 +1981,7 @@ xaccTransSetDatePostedGDate (Transaction *trans, GDate date)
/* We additionally save this date into a kvp frame to ensure in
* the future a date which was set as *date* (without time) can
- * clearly be distinguished from the Timespec. */
+ * clearly be distinguished from the time64. */
g_value_init (&v, G_TYPE_DATE);
g_value_set_boxed (&v, &date);
qof_instance_set_kvp (QOF_INSTANCE(trans), &v, 1, TRANS_DATE_POSTED);
@@ -1992,25 +1999,21 @@ xaccTransSetDateEnteredSecs (Transaction *trans, time64 secs)
}
static void
-qofTransSetDatePosted (Transaction *trans, Timespec ts)
+qofTransSetDatePosted (Transaction *trans, time64 time)
{
if (!trans) return;
- if ((ts.tv_nsec == 0) && (ts.tv_sec == 0)) return;
if (!qof_begin_edit(&trans->inst)) return;
- xaccTransSetDateInternal(trans, &trans->date_posted, ts.tv_sec);
+ xaccTransSetDateInternal(trans, &trans->date_posted, time);
set_gains_date_dirty(trans);
qof_commit_edit(&trans->inst);
}
static void
-qofTransSetDateEntered (Transaction *trans, Timespec ts)
+qofTransSetDateEntered (Transaction *trans, time64 time)
{
- /*This is called from the query framework, so we'll leave the timespec
- * until the query framework is converted, too.*/
if (!trans) return;
- if ((ts.tv_nsec == 0) && (ts.tv_sec == 0)) return;
if (!qof_begin_edit(&trans->inst)) return;
- xaccTransSetDateInternal(trans, &trans->date_entered, ts.tv_sec);
+ xaccTransSetDateInternal(trans, &trans->date_entered, time);
qof_commit_edit(&trans->inst);
}
@@ -2383,7 +2386,7 @@ xaccTransGetDatePostedGDate (const Transaction *trans)
/* Well, this txn doesn't have a GDate saved in a
* slot. Avoid getting the date in the local TZ by
* converting to UTC before generating the
- * date. (timespec_to_gdate doesn't do this so don't use
+ * date. (time64_to_gdate doesn't do this so don't use
* it.
*/
time64 time = xaccTransGetDate(trans);
@@ -2414,7 +2417,7 @@ xaccTransRetDateDue(const Transaction *trans)
if (!trans) return 0;
qof_instance_get_kvp (QOF_INSTANCE (trans), &v, 1, TRANS_DATE_DUE_KVP);
if (G_VALUE_HOLDS_BOXED (&v))
- ret = ((Timespec*)g_value_get_boxed (&v))->tv_sec;
+ ret = ((Time64*)g_value_get_boxed (&v))->t;
if (!ret)
return xaccTransRetDatePosted (trans);
return ret;
@@ -2654,7 +2657,7 @@ xaccTransVoid(Transaction *trans, const char *reason)
g_value_set_string (&v, reason);
qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, void_reason_str);
- gnc_timespec_to_iso8601_buff (timespec_now (), iso8601_str);
+ gnc_time64_to_iso8601_buff (gnc_time(NULL), iso8601_str);
g_value_set_string (&v, iso8601_str);
qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, void_time_str);
@@ -2939,39 +2942,6 @@ trans_is_balanced_p (const Transaction *trans)
return trans ? xaccTransIsBalanced(trans) : FALSE;
}
-static Timespec
-xaccTransRetDateEnteredTS (Transaction * trans)
-{
- Timespec ret = {xaccTransRetDateEntered (trans), 0};
- return ret;
-}
-
-static void
-qofTransSetDateEnteredTS (Transaction * trans, Timespec t)
-{
- xaccTransSetDateEnteredSecs (trans, t.tv_sec);
-}
-
-static Timespec
-xaccTransRetDatePostedTS (Transaction * trans)
-{
- Timespec ret = {xaccTransRetDatePosted (trans), 0};
- return ret;
-}
-
-static void
-qofTransSetDatePostedTS (Transaction * trans, Timespec t)
-{
- xaccTransSetDatePostedSecs (trans, t.tv_sec);
-}
-
-static Timespec
-xaccTransRetDateDueTS (Transaction * trans)
-{
- Timespec ret = {xaccTransRetDateDue (trans), 0};
- return ret;
-}
-
gboolean xaccTransRegister (void)
{
static QofParam params[] =
diff --git a/libgnucash/engine/cap-gains.c b/libgnucash/engine/cap-gains.c
index 9d14d9e..f32f154 100644
--- a/libgnucash/engine/cap-gains.c
+++ b/libgnucash/engine/cap-gains.c
@@ -106,23 +106,21 @@ struct find_lot_s
{
GNCLot *lot;
gnc_commodity *currency;
- Timespec ts;
+ time64 time;
int (*numeric_pred)(gnc_numeric);
- gboolean (*date_pred)(Timespec e, Timespec tr);
+ gboolean (*date_pred)(time64 e, time64 tr);
};
static gboolean
-earliest_pred (Timespec earl, Timespec tran)
+earliest_pred (time64 earl, time64 tran)
{
- return ((earl.tv_sec > tran.tv_sec) ||
- ((earl.tv_sec == tran.tv_sec) && (earl.tv_nsec > tran.tv_nsec)));
+ return earl > tran;
}
static gboolean
-latest_pred (Timespec earl, Timespec tran)
+latest_pred (time64 earl, time64 tran)
{
- return ((earl.tv_sec < tran.tv_sec) ||
- ((earl.tv_sec == tran.tv_sec) && (earl.tv_nsec < tran.tv_nsec)));
+ return earl < tran;
}
static gpointer
@@ -133,7 +131,7 @@ finder_helper (GNCLot *lot, gpointer user_data)
Transaction *trans;
gnc_numeric bal;
gboolean opening_is_positive, bal_is_positive;
- Timespec posted_ts = {0,0};
+ time64 posted = 0;
if (gnc_lot_is_closed (lot)) return NULL;
@@ -158,10 +156,10 @@ finder_helper (GNCLot *lot, gpointer user_data)
return NULL;
}
- posted_ts.tv_sec = trans->date_posted;
- if (els->date_pred (els->ts, posted_ts))
+ posted = trans->date_posted;
+ if (els->date_pred (els->time, posted))
{
- els->ts.tv_sec = trans->date_posted;
+ els->time = trans->date_posted;
els->lot = lot;
}
@@ -172,14 +170,13 @@ static inline GNCLot *
xaccAccountFindOpenLot (Account *acc, gnc_numeric sign,
gnc_commodity *currency,
gint64 guess,
- gboolean (*date_pred)(Timespec, Timespec))
+ gboolean (*date_pred)(time64, time64))
{
struct find_lot_s es;
es.lot = NULL;
es.currency = currency;
- es.ts.tv_sec = guess;
- es.ts.tv_nsec = 0;
+ es.time = guess;
es.date_pred = date_pred;
if (gnc_numeric_positive_p(sign)) es.numeric_pred = gnc_numeric_negative_p;
@@ -324,13 +321,12 @@ xaccSplitAssignToLot (Split *split, GNCLot *lot)
/* If we are here, then (cmp == +1 iff (amt > baln)) and we need
* to split up the split into pieces. Do it. */
{
- time64 now = gnc_time (NULL);
+ time64 now = gnc_time (NULL), time = 0;
Split * new_split;
gnc_numeric amt_a, amt_b, amt_tot;
gnc_numeric val_a, val_b, val_tot;
gnc_numeric frac;
Transaction *trans;
- Timespec ts;
acc = split->acc;
xaccAccountBeginEdit (acc);
@@ -400,8 +396,8 @@ xaccSplitAssignToLot (Split *split, GNCLot *lot)
* split-action which is the same as xaccSplitGetAction */
gnc_set_num_action(NULL, new_split, NULL, gnc_get_num_action(NULL, split));
xaccSplitSetReconcile (new_split, xaccSplitGetReconcile (split));
- ts = xaccSplitRetDateReconciledTS (split);
- xaccSplitSetDateReconciledTS (new_split, &ts);
+ time = xaccSplitGetDateReconciled (split);
+ xaccSplitSetDateReconciledSecs (new_split, time);
/* Set the lot-split and peer_guid properties on the two
* splits to indicate that they're linked.
diff --git a/libgnucash/engine/engine-helpers.c b/libgnucash/engine/engine-helpers.c
index f589346..f078c30 100644
--- a/libgnucash/engine/engine-helpers.c
+++ b/libgnucash/engine/engine-helpers.c
@@ -51,34 +51,6 @@ cannot be considered "standard" or public parts of QOF. */
static QofLogModule log_module = GNC_MOD_ENGINE;
-Timespec
-gnc_transaction_get_date_posted(const Transaction *t)
-{
- Timespec ret = {xaccTransRetDatePosted(t), 0};
- return ret;
-}
-
-Timespec
-gnc_transaction_get_date_entered(const Transaction *t)
-{
- Timespec result = {xaccTransRetDateEntered(t), 0};
- return result;
-}
-
-Timespec
-gnc_split_get_date_reconciled(const Split *s)
-{
- Timespec result;
- xaccSplitGetDateReconciledTS(s, &result);
- return(result);
-}
-
-void
-gnc_transaction_set_date(Transaction *t, Timespec ts)
-{
- xaccTransSetDatePostedSecs(t, ts.tv_sec);
-}
-
/** Gets the transaction Number or split Action based on book option:
* if the book option is TRUE (split action is used for NUM) and a
* split is provided, split-action is returned; if book option is FALSE
diff --git a/libgnucash/engine/engine-helpers.h b/libgnucash/engine/engine-helpers.h
index 757b5b4..6fc38a3 100644
--- a/libgnucash/engine/engine-helpers.h
+++ b/libgnucash/engine/engine-helpers.h
@@ -34,13 +34,6 @@
typedef void (*GncBOCb) (gpointer new_val, gpointer user_data);
-Timespec gnc_transaction_get_date_posted(const Transaction *t);
-Timespec gnc_transaction_get_date_entered(const Transaction *t);
-
-Timespec gnc_split_get_date_reconciled(const Split *s);
-
-void gnc_transaction_set_date(Transaction *t, Timespec ts);
-
/** Gets the transaction Number or split Action based on book option:
* if the book option is TRUE (split action is used for NUM) and a
* split is provided, split-action is returned; if book option is FALSE
diff --git a/libgnucash/engine/qofinstance-p.h b/libgnucash/engine/qofinstance-p.h
index 801663c..8fcff1b 100644
--- a/libgnucash/engine/qofinstance-p.h
+++ b/libgnucash/engine/qofinstance-p.h
@@ -144,7 +144,7 @@ int qof_instance_compare_kvp (const QofInstance *a, const QofInstance *b);
/** Returns a g_strdup'd string which must be g_freed. */
char* qof_instance_kvp_as_string (const QofInstance *inst);
void qof_instance_kvp_add_guid (const QofInstance *inst, const char* path,
- const Timespec time, const char* key,
+ time64 time, const char* key,
const GncGUID *guid);
void qof_instance_kvp_remove_guid (const QofInstance *inst, const char *path,
const char* key, const GncGUID *guid);
diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp
index 0ce79c0..06ae8ca 100644
--- a/libgnucash/engine/qofinstance.cpp
+++ b/libgnucash/engine/qofinstance.cpp
@@ -1138,13 +1138,13 @@ qof_instance_kvp_as_string (const QofInstance *inst)
void
qof_instance_kvp_add_guid (const QofInstance *inst, const char* path,
- const Timespec time, const char *key,
+ time64 time, const char *key,
const GncGUID *guid)
{
g_return_if_fail (inst->kvp_data != NULL);
auto container = new KvpFrame;
- Time64 t{time.tv_sec};
+ Time64 t{time};
container->set({key}, new KvpValue(const_cast<GncGUID*>(guid)));
container->set({"date"}, new KvpValue(t));
delete inst->kvp_data->set_path({path}, new KvpValue(container));
diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp
index a1da304..24caa5a 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.cpp
+++ b/libgnucash/engine/test-core/test-engine-stuff.cpp
@@ -1267,7 +1267,7 @@ get_random_split(QofBook *book, Account *acct, Transaction *trn)
const gchar *str;
gnc_commodity *com;
int scu, denom;
- Timespec *ts;
+ time64 time;
com = xaccTransGetCurrency (trn);
scu = gnc_commodity_get_fraction(com);
@@ -1281,9 +1281,8 @@ get_random_split(QofBook *book, Account *acct, Transaction *trn)
xaccSplitSetReconcile(ret, possible_chars[get_random_int_in_range(0, 3)]);
- ts = get_random_timespec();
- xaccSplitSetDateReconciledTS(ret, ts);
- g_free(ts);
+ time = get_random_time();
+ xaccSplitSetDateReconciledSecs (ret, time);
/* Split must be in an account before we can set an amount */
/* and in a transaction before it can be added to an account. */
@@ -1364,7 +1363,7 @@ void
make_random_changes_to_split (Split *split)
{
Transaction *trans;
- Timespec *ts;
+ time64 time;
g_return_if_fail (split);
@@ -1377,9 +1376,8 @@ make_random_changes_to_split (Split *split)
xaccSplitSetReconcile (split, possible_chars[get_random_int_in_range(0, 3)]);
- ts = get_random_timespec();
- xaccSplitSetDateReconciledTS (split, ts);
- g_free(ts);
+ time = get_random_time();
+ xaccSplitSetDateReconciledSecs (split, time);
qof_instance_set_slots (QOF_INSTANCE (split), get_random_kvp_frame());
diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp
index bbf296f..bdc8f3e 100644
--- a/libgnucash/engine/test/utest-Split.cpp
+++ b/libgnucash/engine/test/utest-Split.cpp
@@ -65,7 +65,7 @@ setup (Fixture *fixture, gconstpointer pData)
GNCLot *lot = gnc_lot_new (book);
gnc_numeric value = gnc_numeric_create (123, 240);
gnc_numeric amount = gnc_numeric_create (321, 1000);
- Timespec time = timespec_now ();
+ time64 time = gnc_time(NULL);
Split *gains_split = xaccMallocSplit (book);
fixture->curr = gnc_commodity_new (book, "Gnu Rand", "CURRENCY", "GNR", "", 240);
fixture->comm = gnc_commodity_new (book, "Wildebeest Fund", "FUND", "WBFXX", "", 1000);
@@ -303,7 +303,7 @@ test_xaccDupeSplit (Fixture *fixture, gconstpointer pData)
g_assert_cmpstr (split->action, ==, f_split->action);
g_assert (compare (split->inst.kvp_data, f_split->inst.kvp_data) == 0);
g_assert_cmpint (split->reconciled, ==, f_split->reconciled);
- g_assert (timespec_equal (&(split->date_reconciled), &(f_split->date_reconciled)));
+ g_assert_cmpint (split->date_reconciled, ==, f_split->date_reconciled);
g_assert (gnc_numeric_equal (split->value, f_split->value));
g_assert (gnc_numeric_equal (split->amount, f_split->amount));
/* xaccDupeSplit intentionally doesn't copy the balances */
@@ -338,7 +338,7 @@ test_xaccSplitCloneNoKvp (Fixture *fixture, gconstpointer pData)
g_assert_cmpstr (split->action, ==, f_split->action);
g_assert (split->inst.kvp_data->empty());
g_assert_cmpint (split->reconciled, ==, f_split->reconciled);
- g_assert (timespec_equal (&(split->date_reconciled), &(f_split->date_reconciled)));
+ g_assert_cmpint (split->date_reconciled, == , f_split->date_reconciled);
g_assert (gnc_numeric_equal (split->value, f_split->value));
g_assert (gnc_numeric_equal (split->amount, f_split->amount));
g_assert (gnc_numeric_equal (split->balance, f_split->balance));
@@ -1204,14 +1204,14 @@ test_xaccSplitOrder (Fixture *fixture, gconstpointer pData)
o_split->value = split->value;
/* Make sure that it doesn't crash if o_split->date_reconciled == NULL */
g_assert_cmpint (xaccSplitOrder (split, o_split), ==, 1);
- o_split->date_reconciled = timespec_now();
- o_split->date_reconciled.tv_sec -= 50;
+ o_split->date_reconciled = gnc_time(NULL);
+ o_split->date_reconciled -= 50;
g_assert_cmpint (xaccSplitOrder (split, o_split), ==, 1);
- o_split->date_reconciled.tv_sec += 100;
+ o_split->date_reconciled += 100;
g_assert_cmpint (xaccSplitOrder (split, o_split), ==, -1);
- o_split->date_reconciled.tv_sec = split->date_reconciled.tv_sec;
- o_split->date_reconciled.tv_nsec = split->date_reconciled.tv_nsec;
+ o_split->date_reconciled = split->date_reconciled;
+ o_split->date_reconciled = split->date_reconciled;
g_assert_cmpint (xaccSplitOrder (split, o_split), ==,
qof_instance_guid_compare (split, o_split));
diff --git a/libgnucash/engine/test/utest-Transaction.cpp b/libgnucash/engine/test/utest-Transaction.cpp
index 370addb..4a3e93c 100644
--- a/libgnucash/engine/test/utest-Transaction.cpp
+++ b/libgnucash/engine/test/utest-Transaction.cpp
@@ -408,7 +408,8 @@ test_gnc_transaction_set_get_property (Fixture *fixture, gconstpointer pData)
gchar *t_num = NULL, *t_desc = NULL;
gnc_commodity *curr = gnc_commodity_new (book, "Gnu Rand", "CURRENCY",
"GNR", "", 240), *t_curr = NULL;
- Timespec now = timespec_now (), *t_entered = NULL, *t_posted = NULL;
+ time64 now = gnc_time(NULL);
+ Time64 *t_entered, *t_posted;
g_assert_cmpstr (txn->num, ==, "");
g_assert_cmpstr (txn->description, ==, "");
g_assert (txn->common_currency == NULL);
@@ -427,8 +428,8 @@ test_gnc_transaction_set_get_property (Fixture *fixture, gconstpointer pData)
g_assert_cmpstr (txn->num, ==, num);
g_assert_cmpstr (txn->description, ==, desc);
g_assert (txn->common_currency == curr);
- g_assert (txn->date_entered == now.tv_sec);
- g_assert (txn->date_posted == now.tv_sec);
+ g_assert (txn->date_entered == now);
+ g_assert (txn->date_posted == now);
g_object_get (G_OBJECT (txn),
"num", &t_num,
@@ -441,8 +442,8 @@ test_gnc_transaction_set_get_property (Fixture *fixture, gconstpointer pData)
g_assert_cmpstr (t_num, ==, num);
g_assert_cmpstr (t_desc, ==, desc);
g_assert (t_curr == curr);
- g_assert (t_entered->tv_sec == now.tv_sec);
- g_assert (t_posted->tv_sec == now.tv_sec);
+ g_assert_cmpint (t_entered->t, ==, now);
+ g_assert_cmpint (t_posted->t, ==, now);
xaccTransRollbackEdit (txn);
test_destroy (txn);
test_destroy (curr);
@@ -1772,10 +1773,7 @@ test_xaccTransOrder_num_action (Fixture *fixture, gconstpointer pData)
* xaccTransSetDatePostedSecs C: 17 in 13 Local: 0:0:0
* xaccTransSetDatePostedGDate C: 1 Local: 1:0:0
* xaccTransSetDateEnteredSecs C: 10 in 9 Local: 0:0:0
- * xaccTransSetDatePostedTS C: 9 in 8 Local: 2:0:0
- * xaccTransSetDateEnteredTS C: 3 in 3 Local: 1:0:0
* xaccTransSetDate C: 43 in 23 SCM: 2 in 2 Local: 0:0:0
- * xaccTransSetDateDueTS C: 2 in 2 Local: 0:0:0
* xaccTransSetTxnType C: 4 in 3 Local: 0:0:0
* xaccTransClearReadOnly C: 4 in 2 Local: 1:0:0
* xaccTransSetReadOnly C: 2 in 2 Local: 1:0:0
@@ -1843,7 +1841,7 @@ test_xaccTransVoid (Fixture *fixture, gconstpointer pData)
auto frame = fixture->txn->inst.kvp_data;
auto void_reason = "Voided for Unit Test";
auto txn_notes = g_strdup (frame->get_slot({trans_notes_str})->get<const char*>());
- Timespec now = timespec_now ();
+ time64 now = gnc_time(NULL);
char iso8601_str[ISO_DATELENGTH + 1] = "";
GList *split = NULL;
@@ -1854,7 +1852,7 @@ test_xaccTransVoid (Fixture *fixture, gconstpointer pData)
==, txn_notes);
g_assert_cmpstr (frame->get_slot({void_reason_str})->get<const char*>(), ==,
void_reason);
- gnc_timespec_to_iso8601_buff (now, iso8601_str);
+ gnc_time64_to_iso8601_buff (now, iso8601_str);
g_assert_cmpstr (frame->get_slot({void_time_str})->get<const char*>(), ==,
iso8601_str);
g_assert_cmpstr (frame->get_slot({TRANS_READ_ONLY_REASON})->get<const char*>(),
commit fee589b28cb0c554109cb934c24fa573c1dd9757
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 2 15:46:27 2018 -0700
Remove Timespec from pricedb.
Includes removing the time64 specialized functions because the regular ones
handle time64 now.
diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index 43fdabc..58e9429 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -375,10 +375,10 @@ class GncPriceDB(GnuCashCoreClass):
GncPriceDB.add_methods_with_prefix('gnc_pricedb_')
PriceDB_dict = {
'lookup_latest' : GncPrice,
- 'lookup_nearest_in_time' : GncPrice,
- 'lookup_latest_before' : GncPrice,
+ 'lookup_nearest_in_time64' : GncPrice,
+ 'lookup_latest_before_t64' : GncPrice,
'convert_balance_latest_price' : GncNumeric,
- 'convert_balance_nearest_price' : GncNumeric,
+ 'convert_balance_nearest_price_t64' : GncNumeric,
}
methods_return_instance(GncPriceDB,PriceDB_dict)
GncPriceDB.get_prices = method_function_returns_instance_list(
diff --git a/gnucash/gnome-utils/dialog-transfer.c b/gnucash/gnome-utils/dialog-transfer.c
index fb15697..f77a972 100644
--- a/gnucash/gnome-utils/dialog-transfer.c
+++ b/gnucash/gnome-utils/dialog-transfer.c
@@ -266,7 +266,7 @@ lookup_price(PriceReq *pr, PriceDate pd)
break;
case NEAREST:
prc = gnc_pricedb_lookup_nearest_in_time64 (pr->pricedb, pr->from,
- pr->to, pr->time);
+ pr->to, pr->time);
break;
case LATEST:
prc = gnc_pricedb_lookup_latest (pr->pricedb, pr->from, pr->to);
diff --git a/gnucash/gnome-utils/gnc-tree-model-price.c b/gnucash/gnome-utils/gnc-tree-model-price.c
index 2192806..3656ec0 100644
--- a/gnucash/gnome-utils/gnc-tree-model-price.c
+++ b/gnucash/gnome-utils/gnc-tree-model-price.c
@@ -770,7 +770,7 @@ gnc_tree_model_price_get_value (GtkTreeModel *tree_model,
break;
case GNC_TREE_MODEL_PRICE_COL_DATE:
qof_print_date_buff (datebuff, sizeof(datebuff),
- gnc_price_get_time (price));
+ gnc_price_get_time64 (price));
g_value_init (value, G_TYPE_STRING);
g_value_set_string (value, datebuff);
break;
diff --git a/gnucash/gnome-utils/window-main-summarybar.c b/gnucash/gnome-utils/window-main-summarybar.c
index 700c94d..aa56466 100644
--- a/gnucash/gnome-utils/window-main-summarybar.c
+++ b/gnucash/gnome-utils/window-main-summarybar.c
@@ -189,10 +189,11 @@ gnc_ui_accounts_recurse (Account *parent, GList **currency_list,
case ACCT_TYPE_RECEIVABLE:
end_amount = xaccAccountGetBalanceAsOfDate(account, options.end_date);
end_amount_default_currency =
- gnc_pricedb_convert_balance_nearest_price (pricedb, end_amount,
- account_currency,
- to_curr,
- options.end_date);
+ gnc_pricedb_convert_balance_nearest_price_t64 (pricedb,
+ end_amount,
+ account_currency,
+ to_curr,
+ options.end_date);
if (!non_currency || options.non_currency)
{
@@ -224,17 +225,18 @@ gnc_ui_accounts_recurse (Account *parent, GList **currency_list,
case ACCT_TYPE_EXPENSE:
start_amount = xaccAccountGetBalanceAsOfDate(account, options.start_date);
start_amount_default_currency =
- gnc_pricedb_convert_balance_nearest_price (pricedb,
- start_amount,
- account_currency,
- to_curr,
- options.start_date);
+ gnc_pricedb_convert_balance_nearest_price_t64 (pricedb,
+ start_amount,
+ account_currency,
+ to_curr,
+ options.start_date);
end_amount = xaccAccountGetBalanceAsOfDate(account, options.end_date);
end_amount_default_currency =
- gnc_pricedb_convert_balance_nearest_price (pricedb, end_amount,
- account_currency,
- to_curr,
- options.end_date);
+ gnc_pricedb_convert_balance_nearest_price_t64 (pricedb,
+ end_amount,
+ account_currency,
+ to_curr,
+ options.end_date);
if (!non_currency || options.non_currency)
{
diff --git a/gnucash/report/locale-specific/us/taxtxf.scm b/gnucash/report/locale-specific/us/taxtxf.scm
index 1ec3fff..67b5a67 100644
--- a/gnucash/report/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/locale-specific/us/taxtxf.scm
@@ -712,7 +712,7 @@
(begin ;; do so
(set! missing-pricedb-entry? #f)
(set! pricedb-lookup-price
- (let ((price (gnc-pricedb-lookup-nearest-in-time64
+ (let ((price (gnc-pricedb-lookup-nearest-in-time-t64
pricedb
account-commodity
USD-currency
@@ -725,9 +725,8 @@
(gnc-price-get-value
pricedb-lookup-price))
(set! pricedb-lookup-price-time
- (gnc-price-get-time64
- pricedb-lookup-price))
- (gnc-pricedb-convert-balance-nearest-price
+ (gnc-price-get-time64 pricedb-lookup-price))
+ (gnc-pricedb-convert-balance-nearest-price-t64
pricedb
(if neg?
(gnc-numeric-neg splt-rpt-amount)
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index a6b8bbd..6d7b5dc 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -794,7 +794,7 @@
(gnc:exchange-if-same foreign domestic)
(gnc:make-gnc-monetary
domestic
- (gnc-pricedb-convert-balance-nearest-price
+ (gnc-pricedb-convert-balance-nearest-price-t64
(gnc-pricedb-get-db (gnc-get-current-book))
(gnc:gnc-monetary-amount foreign)
(gnc:gnc-monetary-commodity foreign)
diff --git a/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp b/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp
index fbde09a..a8d228f 100644
--- a/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp
+++ b/libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp
@@ -115,8 +115,7 @@ price_parse_xml_sub_node (GNCPrice* p, xmlNodePtr sub_node, QofBook* book)
{
time64 time = dom_tree_to_time64 (sub_node);
if (!dom_tree_valid_time64 (time, sub_node->name)) time = 0;
- Timespec ts {time, 0};
- gnc_price_set_time (p, ts);
+ gnc_price_set_time64 (p, time);
}
else if (g_strcmp0 ("price:source", (char*)sub_node->name) == 0)
{
@@ -416,7 +415,7 @@ gnc_price_to_dom_tree (const xmlChar* tag, GNCPrice* price)
xmlNodePtr tmpnode;
gnc_commodity* commodity;
gnc_commodity* currency;
- Timespec timesp;
+ time64 time;
gnc_numeric value;
if (! (tag && price)) return NULL;
@@ -438,8 +437,8 @@ gnc_price_to_dom_tree (const xmlChar* tag, GNCPrice* price)
tmpnode = commodity_ref_to_dom_tree ("price:currency", currency);
if (!add_child_or_kill_parent (price_xml, tmpnode)) return NULL;
- timesp = gnc_price_get_time (price);
- tmpnode = time64_to_dom_tree ("price:time", timesp.tv_sec);
+ time = gnc_price_get_time64 (price);
+ tmpnode = time64_to_dom_tree ("price:time", time);
if (!add_child_or_kill_parent (price_xml, tmpnode)) return NULL;
sourcestr = gnc_price_get_source_string (price);
diff --git a/libgnucash/backend/xml/io-gncxml-v1.cpp b/libgnucash/backend/xml/io-gncxml-v1.cpp
index c25b5cd..4a605ff 100644
--- a/libgnucash/backend/xml/io-gncxml-v1.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v1.cpp
@@ -2961,8 +2961,7 @@ price_parse_xml_sub_node (GNCPrice* p, xmlNodePtr sub_node, QofBook* book)
{
time64 time = dom_tree_to_time64 (sub_node);
if (!dom_tree_valid_time64 (time, sub_node->name)) time = 0;
- Timespec ts = {time, 0};
- gnc_price_set_time (p, ts);
+ gnc_price_set_time64 (p, time);
}
else if (g_strcmp0 ("price:source", (char*)sub_node->name) == 0)
{
diff --git a/libgnucash/doc/design/engine.texi b/libgnucash/doc/design/engine.texi
index dea627e..2c1baf0 100644
--- a/libgnucash/doc/design/engine.texi
+++ b/libgnucash/doc/design/engine.texi
@@ -1551,7 +1551,7 @@ Return the commodity of @var{p}.
Return the currency of @var{p}.
@end deftypefun
- at deftypefun Timespec gnc_price_get_time (GNCPrice * @var{p})
+ at deftypefun time64 gnc_price_get_time64 (GNCPrice * @var{p})
Return the time of @var{p}.
@end deftypefun
@@ -1596,7 +1596,7 @@ Set the commodity of @var{p} to @var{c}.
Set the currency of @var{p} to @var{c}.
@end deftypefun
- at deftypefun void gnc_price_set_time (GNCPrice * @var{p}, Timespec @var{t})
+ at deftypefun void gnc_price_set_time64 (GNCPrice * @var{p}, time64 @var{t})
Set the time of @var{p} to @var{t}.
@end deftypefun
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index 5379b0a..141609d 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -3441,7 +3441,7 @@ xaccAccountConvertBalanceToCurrencyAsOfDate(const Account *acc, /* for book */
book = gnc_account_get_book (acc);
pdb = gnc_pricedb_get_db (book);
- balance = gnc_pricedb_convert_balance_nearest_price(
+ balance = gnc_pricedb_convert_balance_nearest_price_t64(
pdb, balance, balance_currency, new_currency, date);
return balance;
diff --git a/libgnucash/engine/engine.i b/libgnucash/engine/engine.i
index 45c62d6..9cc7c9d 100644
--- a/libgnucash/engine/engine.i
+++ b/libgnucash/engine/engine.i
@@ -97,10 +97,14 @@ functions. */
%newobject gnc_pricedb_lookup_latest_any_currency;
%newobject gnc_pricedb_lookup_nearest_in_time_any_currency;
+%newobject gnc_pricedb_lookup_nearest_in_time_any_currency_t64;
%newobject gnc_pricedb_lookup_latest_before_any_currency;
+%newobject gnc_pricedb_lookup_latest_before_any_currency_t64;
%newobject gnc_pricedb_get_prices;
%newobject gnc_pricedb_lookup_at_time;
+%newobject gnc_pricedb_lookup_at_time64;
%newobject gnc_pricedb_lookup_day;
+%newobject gnc_pricedb_lookup_day_t64;
%newobject xaccQueryGetSplitsUniqueTrans;
%newobject xaccQueryGetTransactions;
diff --git a/libgnucash/engine/gnc-pricedb-p.h b/libgnucash/engine/gnc-pricedb-p.h
index 249580f..06c611e 100644
--- a/libgnucash/engine/gnc-pricedb-p.h
+++ b/libgnucash/engine/gnc-pricedb-p.h
@@ -38,7 +38,7 @@ struct gnc_price_s
GNCPriceDB *db;
gnc_commodity *commodity;
gnc_commodity *currency;
- Timespec tmspec;
+ time64 tmspec;
PriceSource source;
char *type;
gnc_numeric value;
@@ -82,7 +82,7 @@ typedef struct gnc_price_lookup_helper_s
{
GList **return_list;
gnc_commodity *key;
- Timespec time;
+ time64 time;
} GNCPriceLookupHelper;
#define gnc_price_set_guid(P,G) qof_instance_set_guid(QOF_INSTANCE(P),(G))
diff --git a/libgnucash/engine/gnc-pricedb.c b/libgnucash/engine/gnc-pricedb.c
index d148570..e9f1594 100644
--- a/libgnucash/engine/gnc-pricedb.c
+++ b/libgnucash/engine/gnc-pricedb.c
@@ -27,6 +27,7 @@
#include <glib.h>
#include <string.h>
#include <stdint.h>
+#include <stdlib.h>
#include "gnc-date.h"
#include "gnc-pricedb-p.h"
#include <qofinstance-p.h>
@@ -38,7 +39,7 @@ static gboolean add_price(GNCPriceDB *db, GNCPrice *p);
static gboolean remove_price(GNCPriceDB *db, GNCPrice *p, gboolean cleanup);
static GNCPrice *lookup_nearest_in_time(GNCPriceDB *db, const gnc_commodity *c,
const gnc_commodity *currency,
- Timespec t, gboolean sameday);
+ time64 t, gboolean sameday);
static gboolean
pricedb_pricelist_traversal(GNCPriceDB *db,
gboolean (*f)(GList *p, gpointer user_data),
@@ -61,6 +62,13 @@ typedef struct
gpointer value;
} HashEntry;
+/* Like strcmp, returns -1 if a < b, +1 if a > b, and 0 if they're equal. */
+static inline int
+time64_cmp (time64 a, time64 b)
+{
+ return a < b ? -1 : a > b ? 1 : 0;
+}
+
static void
hash_entry_insert(gpointer key, gpointer val, gpointer user_data)
{
@@ -179,7 +187,7 @@ gnc_price_set_property(GObject* object, guint prop_id, const GValue* value, GPar
{
GNCPrice* price;
gnc_numeric* number;
- Timespec* ts;
+ Time64* time;
g_return_if_fail(GNC_IS_PRICE(object));
@@ -205,8 +213,8 @@ gnc_price_set_property(GObject* object, guint prop_id, const GValue* value, GPar
gnc_price_set_currency(price, g_value_get_object(value));
break;
case PROP_DATE:
- ts = g_value_get_boxed(value);
- gnc_price_set_time(price, *ts);
+ time = g_value_get_boxed(value);
+ gnc_price_set_time64(price, time->t);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
@@ -380,7 +388,7 @@ gnc_price_clone (GNCPrice* p, QofBook *book)
gnc_price_begin_edit(new_p);
/* never ever clone guid's */
gnc_price_set_commodity(new_p, gnc_price_get_commodity(p));
- gnc_price_set_time(new_p, gnc_price_get_time(p));
+ gnc_price_set_time64(new_p, gnc_price_get_time64(p));
gnc_price_set_source(new_p, gnc_price_get_source(p));
gnc_price_set_typestr(new_p, gnc_price_get_typestr(p));
gnc_price_set_value(new_p, gnc_price_get_value(p));
@@ -397,7 +405,7 @@ gnc_price_invert (GNCPrice *p)
GNCPrice *new_p = gnc_price_create (book);
qof_instance_copy_version(new_p, p);
gnc_price_begin_edit(new_p);
- gnc_price_set_time(new_p, gnc_price_get_time(p));
+ gnc_price_set_time64(new_p, gnc_price_get_time64(p));
gnc_price_set_source(new_p, PRICE_SOURCE_TEMP);
gnc_price_set_typestr(new_p, gnc_price_get_typestr(p));
gnc_price_set_commodity(new_p, gnc_price_get_currency(p));
@@ -499,10 +507,10 @@ gnc_price_set_currency(GNCPrice *p, gnc_commodity *c)
}
void
-gnc_price_set_time(GNCPrice *p, Timespec t)
+gnc_price_set_time64(GNCPrice *p, time64 t)
{
if (!p) return;
- if (!timespec_equal(&(p->tmspec), &t))
+ if (p->tmspec != t)
{
/* Changing the datestamp requires the hash table
* position to be modified. The easiest way of doing
@@ -519,27 +527,6 @@ gnc_price_set_time(GNCPrice *p, Timespec t)
}
void
-gnc_price_set_time64(GNCPrice *p, time64 t64)
-{
- if (!p) return;
- if (p->tmspec.tv_sec != t64) // do we need to check nsec as well?
- {
- /* Changing the datestamp requires the hash table
- * position to be modified. The easiest way of doing
- * this is to remove and reinsert. */
- gnc_price_ref (p);
- remove_price (p->db, p, FALSE);
- gnc_price_begin_edit (p);
- p->tmspec.tv_sec = t64;
- p->tmspec.tv_nsec = 0;
- gnc_price_set_dirty(p);
- gnc_price_commit_edit (p);
- add_price (p->db, p);
- gnc_price_unref (p);
- }
-}
-
-void
gnc_price_set_source(GNCPrice *p, PriceSource s)
{
if (!p) return;
@@ -616,21 +603,7 @@ gnc_price_get_commodity(const GNCPrice *p)
time64
gnc_price_get_time64(const GNCPrice *p)
{
- if (!p) return 0;
- return p->tmspec.tv_sec;
-}
-
-Timespec
-gnc_price_get_time(const GNCPrice *p)
-{
- if (!p)
- {
- Timespec result;
- result.tv_sec = 0;
- result.tv_nsec = 0;
- return result;
- }
- return p->tmspec;
+ return p ? p->tmspec : 0;
}
PriceSource
@@ -675,8 +648,7 @@ gnc_price_get_currency(const GNCPrice *p)
gboolean
gnc_price_equal (const GNCPrice *p1, const GNCPrice *p2)
{
- Timespec ts1;
- Timespec ts2;
+ time64 time1, time2;
if (p1 == p2) return TRUE;
if (!p1 || !p2) return FALSE;
@@ -689,10 +661,10 @@ gnc_price_equal (const GNCPrice *p1, const GNCPrice *p2)
gnc_price_get_currency (p2)))
return FALSE;
- ts1 = gnc_price_get_time (p1);
- ts2 = gnc_price_get_time (p2);
+ time1 = gnc_price_get_time64 (p1);
+ time2 = gnc_price_get_time64 (p2);
- if (!timespec_equal (&ts1, &ts2))
+ if (time1 != time2)
return FALSE;
if (gnc_price_get_source (p1) != gnc_price_get_source (p2))
@@ -715,18 +687,18 @@ gnc_price_equal (const GNCPrice *p1, const GNCPrice *p2)
static gint
compare_prices_by_date(gconstpointer a, gconstpointer b)
{
- Timespec time_a;
- Timespec time_b;
+ time64 time_a, time_b;
gint result;
if (!a && !b) return 0;
/* nothing is always less than something */
if (!a) return -1;
- time_a = gnc_price_get_time((GNCPrice *) a);
- time_b = gnc_price_get_time((GNCPrice *) b);
+ time_a = gnc_price_get_time64((GNCPrice *) a);
+ time_b = gnc_price_get_time64((GNCPrice *) b);
- result = -timespec_cmp(&time_a, &time_b);
+ /* Note we return -1 if time_b is before time_a. */
+ result = time64_cmp(time_b, time_a);
if (result) return result;
/* For a stable sort */
@@ -745,17 +717,17 @@ price_list_is_duplicate( gpointer data, gpointer user_data )
{
GNCPrice* pPrice = (GNCPrice*)data;
PriceListIsDuplStruct* pStruct = (PriceListIsDuplStruct*)user_data;
- Timespec time_a, time_b;
+ time64 time_a, time_b;
- time_a = timespecCanonicalDayTime( gnc_price_get_time( pPrice ) );
- time_b = timespecCanonicalDayTime( gnc_price_get_time( pStruct->pPrice ) );
+ time_a = time64CanonicalDayTime( gnc_price_get_time64( pPrice ) );
+ time_b = time64CanonicalDayTime( gnc_price_get_time64( pStruct->pPrice ) );
/* If the date, currency, commodity and price match, it's a duplicate */
if ( !gnc_numeric_equal( gnc_price_get_value( pPrice ), gnc_price_get_value( pStruct->pPrice ) ) ) return;
if ( gnc_price_get_commodity( pPrice ) != gnc_price_get_commodity( pStruct->pPrice ) ) return;
if ( gnc_price_get_currency( pPrice ) != gnc_price_get_currency( pStruct->pPrice ) ) return;
- if ( timespec_cmp( &time_a, &time_b ) != 0 ) return;
+ if (time_a != time_b) return;
pStruct->isDupl = TRUE;
}
@@ -1137,7 +1109,7 @@ add_price(GNCPriceDB *db, GNCPrice *p)
* add this one. If this price is of equal or better precedence than the old
* one, copy this one over the old one.
*/
- old_price = gnc_pricedb_lookup_day (db, p->commodity, p->currency,
+ old_price = gnc_pricedb_lookup_day_t64 (db, p->commodity, p->currency,
p->tmspec);
if (!db->bulk_update && old_price != NULL)
{
@@ -1299,15 +1271,18 @@ gboolean
gnc_pricedb_remove_price(GNCPriceDB *db, GNCPrice *p)
{
gboolean rc;
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset(datebuff, 0, sizeof(datebuff));
if (!db || !p) return FALSE;
ENTER ("db=%p, pr=%p dirty=%d destroying=%d",
db, p, qof_instance_get_dirty_flag(p),
qof_instance_get_destroying(p));
gnc_price_ref(p);
-
- DEBUG("Remove Date is %s, Commodity is %s, Source is %s", gnc_print_date (gnc_price_get_time (p)),
- gnc_commodity_get_fullname (gnc_price_get_commodity (p)), gnc_price_get_source_string (p));
+ qof_print_date_buff(datebuff, sizeof(datebuff), gnc_price_get_time64 (p));
+ DEBUG("Remove Date is %s, Commodity is %s, Source is %s", datebuff,
+ gnc_commodity_get_fullname (gnc_price_get_commodity (p)),
+ gnc_price_get_source_string (p));
rc = remove_price (db, p, TRUE);
gnc_pricedb_begin_edit(db);
@@ -1339,7 +1314,7 @@ check_one_price_date (GNCPrice *price, gpointer user_data)
{
remove_info *data = user_data;
PriceSource source;
- Timespec pt;
+ time64 time;
ENTER("price %p (%s), data %p", price,
gnc_commodity_get_mnemonic(gnc_price_get_commodity(price)),
@@ -1359,13 +1334,13 @@ check_one_price_date (GNCPrice *price, gpointer user_data)
return TRUE;
}
- pt = gnc_price_get_time (price);
+ time = gnc_price_get_time64 (price);
{
gchar buf[40];
- gnc_timespec_to_iso8601_buff(pt , buf);
+ gnc_time64_to_iso8601_buff(time, buf);
DEBUG("checking date %s", buf);
}
- if (pt.tv_sec < data->cutoff)
+ if (time < data->cutoff)
{
data->list = g_slist_prepend(data->list, price);
DEBUG("will delete");
@@ -1394,8 +1369,7 @@ pricedb_remove_foreach_pricelist (gpointer key,
static gint
compare_prices_by_commodity_date (gconstpointer a, gconstpointer b)
{
- Timespec time_a;
- Timespec time_b;
+ time64 time_a, time_b;
gnc_commodity *comma;
gnc_commodity *commb;
gnc_commodity *curra;
@@ -1419,10 +1393,11 @@ compare_prices_by_commodity_date (gconstpointer a, gconstpointer b)
if (!gnc_commodity_equal(curra, currb))
return gnc_commodity_compare(curra, currb);
- time_a = gnc_price_get_time((GNCPrice *) a);
- time_b = gnc_price_get_time((GNCPrice *) b);
+ time_a = gnc_price_get_time64((GNCPrice *) a);
+ time_b = gnc_price_get_time64((GNCPrice *) b);
- result = -timespec_cmp(&time_a, &time_b);
+ /* Note we return -1 if time_b is before time_a. */
+ result = time64_cmp(time_b, time_a);
if (result) return result;
/* For a stable sort */
@@ -1448,7 +1423,7 @@ price_commodity_and_currency_equal (GNCPrice *a, GNCPrice *b)
static void
gnc_pricedb_remove_old_prices_pinfo (GNCPrice *price, gboolean keep_message)
{
- GDate price_date = timespec_to_gdate (gnc_price_get_time (price));
+ GDate price_date = time64_to_gdate (gnc_price_get_time64 (price));
char date_buf[MAX_DATE_LENGTH+1];
if (g_date_valid (&price_date))
@@ -1557,8 +1532,8 @@ gnc_pricedb_process_removal_list (GNCPriceDB *db, GDate *fiscal_end_date,
}
// get the price dates
- saved_price_date = timespec_to_gdate (gnc_price_get_time (cloned_price));
- next_price_date = timespec_to_gdate (gnc_price_get_time (item->data));
+ saved_price_date = time64_to_gdate (gnc_price_get_time64 (cloned_price));
+ next_price_date = time64_to_gdate (gnc_price_get_time64 (item->data));
// Keep last price in fiscal year
if (keep == PRICE_REMOVE_KEEP_LAST_PERIOD && save_first_price == FALSE)
@@ -1632,7 +1607,7 @@ gnc_pricedb_remove_old_prices (GNCPriceDB *db, GList *comm_list,
remove_info data;
GList *node;
char datebuff[MAX_DATE_LENGTH + 1];
- memset (datebuff, sizeof(datebuff), 0);
+ memset (datebuff, 0, sizeof(datebuff));
data.db = db;
data.cutoff = cutoff;
@@ -1810,8 +1785,7 @@ pricedb_get_prices_internal(GNCPriceDB *db, const gnc_commodity *commodity,
return forward_list;
}
-GNCPrice *
-gnc_pricedb_lookup_latest(GNCPriceDB *db,
+GNCPrice *gnc_pricedb_lookup_latest(GNCPriceDB *db,
const gnc_commodity *commodity,
const gnc_commodity *currency)
{
@@ -1837,7 +1811,7 @@ typedef struct
{
GList **list;
const gnc_commodity *com;
- Timespec t;
+ time64 t;
} UsesCommodity;
/* price_list_scan_any_currency is the helper function used with
@@ -1875,8 +1849,8 @@ price_list_scan_any_currency(GList *price_list, gpointer data)
while (node != NULL)
{
GNCPrice *price = node->data;
- Timespec price_t = gnc_price_get_time(price);
- if (timespec_cmp(&price_t, &helper->t) < 0)
+ time64 price_t = gnc_price_get_time64(price);
+ if (price_t < helper->t)
{
/* If there is a previous price add it to the results. */
if (node->prev)
@@ -1917,7 +1891,7 @@ is_in_list (GList *list, const gnc_commodity *c)
* want only the first one before the specified time containing both the target
* and some other commodity. */
static PriceList*
-latest_before (PriceList *prices, const gnc_commodity* target, Timespec t)
+latest_before (PriceList *prices, const gnc_commodity* target, time64 t)
{
GList *node, *found_coms = NULL, *retval = NULL;
for (node = prices; node != NULL; node = g_list_next(node))
@@ -1925,8 +1899,8 @@ latest_before (PriceList *prices, const gnc_commodity* target, Timespec t)
GNCPrice *price = (GNCPrice*)node->data;
gnc_commodity *com = gnc_price_get_commodity(price);
gnc_commodity *cur = gnc_price_get_currency(price);
- Timespec price_t = gnc_price_get_time(price);
- if (timespec_cmp(&t, &price_t) <= 0 ||
+ time64 price_t = gnc_price_get_time64(price);
+ if (t < price_t ||
(com == target && is_in_list(found_coms, cur)) ||
(cur == target && is_in_list(found_coms, com)))
continue;
@@ -1957,14 +1931,14 @@ find_comtime(GPtrArray* array, gnc_commodity *com)
static GList*
add_nearest_price(GList *target_list, GPtrArray *price_array, GNCPrice *price,
- const gnc_commodity *target, Timespec t)
+ const gnc_commodity *target, time64 t)
{
gnc_commodity *com = gnc_price_get_commodity(price);
gnc_commodity *cur = gnc_price_get_currency(price);
- Timespec price_t = gnc_price_get_time(price);
+ time64 price_t = gnc_price_get_time64(price);
gnc_commodity *other = com == target ? cur : com;
GNCPrice **com_price = find_comtime(price_array, other);
- Timespec com_t;
+ time64 com_t;
if (com_price == NULL)
{
com_price = (GNCPrice**)g_slice_new(gpointer);
@@ -1972,19 +1946,19 @@ add_nearest_price(GList *target_list, GPtrArray *price_array, GNCPrice *price,
g_ptr_array_add(price_array, com_price);
/* If the first price we see for this commodity is not newer than
the target date add it to the return list. */
- if (timespec_cmp(&price_t, &t) <= 0)
+ if (price_t <= t)
{
gnc_price_ref(price);
target_list = g_list_prepend(target_list, price);
}
return target_list;
}
- com_t = gnc_price_get_time(*com_price);
- if (timespec_cmp(&com_t, &t) <= 0)
+ com_t = gnc_price_get_time64(*com_price);
+ if (com_t <= t)
/* No point in checking any more prices, they'll all be further from
* t. */
return target_list;
- if (timespec_cmp(&price_t, &t) > 0)
+ if (price_t > t)
/* The price list is sorted newest->oldest, so as long as this price
* is newer than t then it should replace the saved one. */
{
@@ -1992,9 +1966,9 @@ add_nearest_price(GList *target_list, GPtrArray *price_array, GNCPrice *price,
}
else
{
- Timespec com_diff = timespec_diff(&com_t, &t);
- Timespec price_diff = timespec_diff(&t, &price_t);
- if (timespec_cmp(&com_diff, &price_diff) < 0)
+ time64 com_diff = com_t - t;
+ time64 price_diff = t - price_t;
+ if (com_diff < price_diff)
{
gnc_price_ref(*com_price);
target_list = g_list_prepend(target_list, *com_price);
@@ -2010,7 +1984,7 @@ add_nearest_price(GList *target_list, GPtrArray *price_array, GNCPrice *price,
}
static PriceList *
-nearest_to (PriceList *prices, const gnc_commodity* target, Timespec t)
+nearest_to (PriceList *prices, const gnc_commodity* target, time64 t)
{
GList *node, *retval = NULL;
const guint prealloc_size = 5; /*More than 5 "other" is unlikely as long as
@@ -2032,8 +2006,8 @@ nearest_to (PriceList *prices, const gnc_commodity* target, Timespec t)
for (index = 0; index < price_array->len; ++index)
{
GNCPrice **com_price = g_ptr_array_index(price_array, index);
- Timespec price_t = gnc_price_get_time(*com_price);
- if (timespec_cmp(&price_t, &t) >= 0)
+ time64 price_t = gnc_price_get_time64(*com_price);
+ if (price_t >= t)
{
gnc_price_ref(*com_price);
retval = g_list_prepend(retval, *com_price);
@@ -2049,13 +2023,14 @@ PriceList *
gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
const gnc_commodity *commodity)
{
- return gnc_pricedb_lookup_latest_before_any_currency(db, commodity, timespec_now());
+ return gnc_pricedb_lookup_latest_before_any_currency_t64(db, commodity,
+ gnc_time(NULL));
}
PriceList *
-gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
- const gnc_commodity *commodity,
- Timespec t)
+gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ time64 t)
{
GList *prices = NULL, *result;
UsesCommodity helper = {&prices, commodity, t};
@@ -2064,8 +2039,7 @@ gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
if (!db || !commodity) return NULL;
ENTER ("db=%p commodity=%p", db, commodity);
- pricedb_pricelist_traversal(db, price_list_scan_any_currency,
- &helper);
+ pricedb_pricelist_traversal(db, price_list_scan_any_currency, &helper);
prices = g_list_sort(prices, compare_prices_by_date);
result = nearest_to(prices, commodity, t);
gnc_price_list_destroy(prices);
@@ -2074,21 +2048,9 @@ gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
}
PriceList *
-gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
- const gnc_commodity *commodity,
- time64 t64)
-{
- Timespec t;
- t.tv_sec = t64;
- t.tv_nsec = 0;
-
- return gnc_pricedb_lookup_nearest_in_time_any_currency(db, commodity, t);
-}
-
-PriceList *
-gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
- const gnc_commodity *commodity,
- Timespec t)
+gnc_pricedb_lookup_latest_before_any_currency_t64(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ time64 t)
{
GList *prices = NULL, *result;
UsesCommodity helper = {&prices, commodity, t};
@@ -2288,31 +2250,19 @@ gnc_pricedb_nth_price (GNCPriceDB *db,
}
GNCPrice *
-gnc_pricedb_lookup_day(GNCPriceDB *db,
- const gnc_commodity *c,
- const gnc_commodity *currency,
- Timespec t)
-{
- return lookup_nearest_in_time(db, c, currency, t, TRUE);
-}
-
-GNCPrice *
gnc_pricedb_lookup_day_t64(GNCPriceDB *db,
- const gnc_commodity *c,
- const gnc_commodity *currency,
- time64 t64)
+ const gnc_commodity *c,
+ const gnc_commodity *currency,
+ time64 t)
{
- Timespec t;
- t.tv_sec = t64;
- t.tv_nsec = 0;
return lookup_nearest_in_time(db, c, currency, t, TRUE);
}
GNCPrice *
-gnc_pricedb_lookup_at_time(GNCPriceDB *db,
- const gnc_commodity *c,
- const gnc_commodity *currency,
- Timespec t)
+gnc_pricedb_lookup_at_time64(GNCPriceDB *db,
+ const gnc_commodity *c,
+ const gnc_commodity *currency,
+ time64 t)
{
GList *price_list;
GList *item = NULL;
@@ -2324,8 +2274,8 @@ gnc_pricedb_lookup_at_time(GNCPriceDB *db,
while (item)
{
GNCPrice *p = item->data;
- Timespec price_time = gnc_price_get_time(p);
- if (timespec_equal(&price_time, &t))
+ time64 price_time = gnc_price_get_time64(p);
+ if (price_time == t)
{
gnc_price_ref(p);
g_list_free (price_list);
@@ -2342,7 +2292,7 @@ static GNCPrice *
lookup_nearest_in_time(GNCPriceDB *db,
const gnc_commodity *c,
const gnc_commodity *currency,
- Timespec t,
+ time64 t,
gboolean sameday)
{
GList *price_list;
@@ -2352,7 +2302,7 @@ lookup_nearest_in_time(GNCPriceDB *db,
GList *item = NULL;
if (!db || !c || !currency) return NULL;
- if (t.tv_sec == INT64_MAX) return NULL;
+ if (t == INT64_MAX) return NULL;
ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
price_list = pricedb_get_prices_internal (db, c, currency, TRUE);
if (!price_list) return NULL;
@@ -2366,8 +2316,8 @@ lookup_nearest_in_time(GNCPriceDB *db,
while (!next_price && item)
{
GNCPrice *p = item->data;
- Timespec price_time = gnc_price_get_time(p);
- if (timespec_cmp(&price_time, &t) <= 0)
+ time64 price_time = gnc_price_get_time64(p);
+ if (price_time <= t)
{
next_price = item->data;
break;
@@ -2385,11 +2335,11 @@ lookup_nearest_in_time(GNCPriceDB *db,
if (sameday)
{
/* Must be on the same day. */
- Timespec price_day;
- Timespec t_day;
- price_day = timespecCanonicalDayTime(gnc_price_get_time(current_price));
- t_day = timespecCanonicalDayTime(t);
- if (!timespec_equal(&price_day, &t_day))
+ time64 price_day;
+ time64 t_day;
+ price_day = time64CanonicalDayTime(gnc_price_get_time64(current_price));
+ t_day = time64CanonicalDayTime(t);
+ if (price_day != t_day)
result = NULL;
}
}
@@ -2397,25 +2347,25 @@ lookup_nearest_in_time(GNCPriceDB *db,
{
/* If the requested time is not earlier than the first price on the
list, then current_price and next_price will be the same. */
- Timespec current_t = gnc_price_get_time(current_price);
- Timespec next_t = gnc_price_get_time(next_price);
- Timespec diff_current = timespec_diff(¤t_t, &t);
- Timespec diff_next = timespec_diff(&next_t, &t);
- Timespec abs_current = timespec_abs(&diff_current);
- Timespec abs_next = timespec_abs(&diff_next);
+ time64 current_t = gnc_price_get_time64(current_price);
+ time64 next_t = gnc_price_get_time64(next_price);
+ time64 diff_current = current_t - t;
+ time64 diff_next = next_t - t;
+ time64 abs_current = llabs(diff_current);
+ time64 abs_next = llabs(diff_next);
if (sameday)
{
/* Result must be on same day, see if either of the two isn't */
- Timespec t_day = timespecCanonicalDayTime(t);
- Timespec current_day = timespecCanonicalDayTime(current_t);
- Timespec next_day = timespecCanonicalDayTime(next_t);
- if (timespec_equal(¤t_day, &t_day))
+ time64 t_day = time64CanonicalDayTime(t);
+ time64 current_day = time64CanonicalDayTime(current_t);
+ time64 next_day = time64CanonicalDayTime(next_t);
+ if (current_day == t_day)
{
- if (timespec_equal(&next_day, &t_day))
+ if (next_day == t_day)
{
/* Both on same day, return nearest */
- if (timespec_cmp(&abs_current, &abs_next) < 0)
+ if (abs_current < abs_next)
result = current_price;
else
result = next_price;
@@ -2424,7 +2374,7 @@ lookup_nearest_in_time(GNCPriceDB *db,
/* current_price on same day, next_price not */
result = current_price;
}
- else if (timespec_equal(&next_day, &t_day))
+ else if (next_day == t_day)
/* next_price on same day, current_price not */
result = next_price;
}
@@ -2433,7 +2383,7 @@ lookup_nearest_in_time(GNCPriceDB *db,
/* Choose the price that is closest to the given time. In case of
* a tie, prefer the older price since it actually existed at the
* time. (This also fixes bug #541970.) */
- if (timespec_cmp(&abs_current, &abs_next) < 0)
+ if (abs_current < abs_next)
{
result = current_price;
}
@@ -2452,38 +2402,27 @@ lookup_nearest_in_time(GNCPriceDB *db,
}
GNCPrice *
-gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
- const gnc_commodity *c,
- const gnc_commodity *currency,
- Timespec t)
-{
- return lookup_nearest_in_time(db, c, currency, t, FALSE);
-}
-
-GNCPrice *
gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,
const gnc_commodity *c,
const gnc_commodity *currency,
- time64 t64)
+ time64 t)
{
- Timespec t;
- t.tv_sec = t64;
- t.tv_nsec = 0;
return lookup_nearest_in_time(db, c, currency, t, FALSE);
}
+
GNCPrice *
-gnc_pricedb_lookup_latest_before (GNCPriceDB *db,
- gnc_commodity *c,
- gnc_commodity *currency,
- Timespec t)
+gnc_pricedb_lookup_latest_before_t64 (GNCPriceDB *db,
+ gnc_commodity *c,
+ gnc_commodity *currency,
+ time64 t)
{
GList *price_list;
GNCPrice *current_price = NULL;
/* GNCPrice *next_price = NULL;
GNCPrice *result = NULL;*/
GList *item = NULL;
- Timespec price_time;
+ time64 price_time;
if (!db || !c || !currency) return NULL;
ENTER ("db=%p commodity=%p currency=%p", db, c, currency);
@@ -2492,12 +2431,12 @@ gnc_pricedb_lookup_latest_before (GNCPriceDB *db,
item = price_list;
do
{
- price_time = gnc_price_get_time (item->data);
- if (timespec_cmp(&price_time, &t) <= 0)
+ price_time = gnc_price_get_time64 (item->data);
+ if (price_time <= t)
current_price = item->data;
item = item->next;
}
- while (timespec_cmp(&price_time, &t) > 0 && item);
+ while (price_time > t && item);
gnc_price_ref(current_price);
g_list_free (price_list);
LEAVE (" ");
@@ -2678,11 +2617,11 @@ gnc_pricedb_convert_balance_latest_price(GNCPriceDB *pdb,
}
gnc_numeric
-gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
- gnc_numeric balance,
- const gnc_commodity *balance_currency,
- const gnc_commodity *new_currency,
- time64 t)
+gnc_pricedb_convert_balance_nearest_price_t64(GNCPriceDB *pdb,
+ gnc_numeric balance,
+ const gnc_commodity *balance_currency,
+ const gnc_commodity *new_currency,
+ time64 t)
{
gnc_numeric new_value;
@@ -3158,7 +3097,7 @@ price_printable(gpointer obj)
#endif
val = gnc_numeric_to_string (pr->value);
- da = qof_print_date (pr->tmspec.tv_sec);
+ da = qof_print_date (pr->tmspec);
commodity = gnc_price_get_commodity(pr);
currency = gnc_price_get_currency(pr);
diff --git a/libgnucash/engine/gnc-pricedb.h b/libgnucash/engine/gnc-pricedb.h
index 61ed2c9..3fbefe4 100644
--- a/libgnucash/engine/gnc-pricedb.h
+++ b/libgnucash/engine/gnc-pricedb.h
@@ -238,8 +238,7 @@ void gnc_price_commit_edit (GNCPrice *p);
void gnc_price_set_commodity(GNCPrice *p, gnc_commodity *c);
void gnc_price_set_currency(GNCPrice *p, gnc_commodity *c);
-void gnc_price_set_time(GNCPrice *p, Timespec t);
-void gnc_price_set_time64(GNCPrice *p, time64 t64);
+void gnc_price_set_time64(GNCPrice *p, time64 t);
void gnc_price_set_source(GNCPrice *p, PriceSource source);
void gnc_price_set_source_string(GNCPrice *p, const char* s);
void gnc_price_set_typestr(GNCPrice *p, const char* type);
@@ -257,7 +256,6 @@ void gnc_price_set_value(GNCPrice *p, gnc_numeric value);
gnc_commodity * gnc_price_get_commodity(const GNCPrice *p);
/*@ dependent @*/
gnc_commodity * gnc_price_get_currency(const GNCPrice *p);
-Timespec gnc_price_get_time(const GNCPrice *p);
time64 gnc_price_get_time64(const GNCPrice *p);
PriceSource gnc_price_get_source(const GNCPrice *p);
const char * gnc_price_get_source_string(const GNCPrice *p);
@@ -463,21 +461,21 @@ PriceList * gnc_pricedb_get_prices(GNCPriceDB *db,
const gnc_commodity *commodity,
const gnc_commodity *currency);
-/** @brief Find the price between two commodities at a timespec.
+/** @brief Find the price between two commodities at a time64.
*
* The returned GNCPrice may be in either direction so check to ensure that its
* value is correctly applied.
* @param db The pricedb
* @param commodity The first commodity
* @param currency The second commodity
- * @param t The timespec at which to retrieve the price.
+ * @param t The time64 at which to retrieve the price.
* @return A GNCPrice or NULL if none matches.
*/
/* NOT USED */
-GNCPrice * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
- const gnc_commodity *commodity,
- const gnc_commodity *currency,
- Timespec t);
+GNCPrice * gnc_pricedb_lookup_at_time64(GNCPriceDB *db,
+ const gnc_commodity *commodity,
+ const gnc_commodity *currency,
+ time64 t);
/** @brief Return the price between the two commodities on the indicated
* day. Note that the notion of day might be distorted by changes in timezone.
@@ -491,15 +489,10 @@ GNCPrice * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
* according to the local timezone.
* @return A GNCPrice or NULL on failure.
*/
-GNCPrice * gnc_pricedb_lookup_day(GNCPriceDB *db,
- const gnc_commodity *commodity,
- const gnc_commodity *currency,
- Timespec t);
-
GNCPrice * gnc_pricedb_lookup_day_t64(GNCPriceDB *db,
- const gnc_commodity *commodity,
- const gnc_commodity *currency,
- time64 t64);
+ const gnc_commodity *commodity,
+ const gnc_commodity *currency,
+ time64 t);
/** @brief Return the price between the two commoditiesz nearest to the given
* time.
@@ -512,15 +505,10 @@ GNCPrice * gnc_pricedb_lookup_day_t64(GNCPriceDB *db,
* @param t The time nearest to which the returned price should be.
* @return A GNCPrice or NULL if no prices exist between the two commodities.
*/
-GNCPrice * gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
- const gnc_commodity *c,
- const gnc_commodity *currency,
- Timespec t);
-
GNCPrice * gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,
- const gnc_commodity *c,
- const gnc_commodity *currency,
- time64 t);
+ const gnc_commodity *c,
+ const gnc_commodity *currency,
+ time64 t);
/** @brief Return the price nearest in time to that given between the given
* commodity and every other.
@@ -534,12 +522,9 @@ GNCPrice * gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,
* @return A PriceList of prices for each commodity pair found or NULL if none
* are.
*/
-PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
- const gnc_commodity *c,
- Timespec t);
PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
const gnc_commodity *c,
- time64 t64);
+ time64 t);
/** @brief Return the latest price between the given commodities before the
* given time.
@@ -553,10 +538,10 @@ PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
* @return A GNCPrice or NULL if no prices are found before t.
*/
/* NOT USED, but see bug 743753 */
-GNCPrice * gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
- gnc_commodity *c,
- gnc_commodity *currency,
- Timespec t);
+GNCPrice * gnc_pricedb_lookup_latest_before_t64(GNCPriceDB *db,
+ gnc_commodity *c,
+ gnc_commodity *currency,
+ time64 t);
/** @brief Return the latest price between the given commodity and any other
* before the given time.
@@ -569,9 +554,9 @@ GNCPrice * gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
* @return A PriceList of prices for each commodity found or NULL if none are.
*/
/* NOT USED, but see bug 743753 */
-PriceList * gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
+PriceList * gnc_pricedb_lookup_latest_before_any_currency_t64(GNCPriceDB *db,
const gnc_commodity *c,
- Timespec t);
+ time64 t);
/** @brief Convert a balance from one currency to another using the most recent
@@ -600,11 +585,11 @@ gnc_pricedb_convert_balance_latest_price(GNCPriceDB *pdb,
* @return A new balance or gnc_numeric_zero if no price is available.
*/
gnc_numeric
-gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,
- gnc_numeric balance,
- const gnc_commodity *balance_currency,
- const gnc_commodity *new_currency,
- time64 t);
+gnc_pricedb_convert_balance_nearest_price_t64(GNCPriceDB *pdb,
+ gnc_numeric balance,
+ const gnc_commodity *balance_currency,
+ const gnc_commodity *new_currency,
+ time64 t);
typedef gboolean (*GncPriceForeachFunc)(GNCPrice *p, gpointer user_data);
diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp
index 045ac34..a1da304 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.cpp
+++ b/libgnucash/engine/test-core/test-engine-stuff.cpp
@@ -647,7 +647,7 @@ make_random_changes_to_commodity_table (gnc_commodity_table *table)
void
make_random_changes_to_price (QofBook *book, GNCPrice *p)
{
- Timespec *ts;
+ time64 time;
PriceSource ps;
char *string;
gnc_commodity *c;
@@ -662,9 +662,8 @@ make_random_changes_to_price (QofBook *book, GNCPrice *p)
c = get_random_commodity (book);
gnc_price_set_currency (p, c);
- ts = get_random_timespec ();
- gnc_price_set_time (p, *ts);
- g_free (ts);
+ time = get_random_time ();
+ gnc_price_set_time64 (p, time);
ps = (PriceSource)get_random_int_in_range((int)PRICE_SOURCE_EDIT_DLG,
(int)PRICE_SOURCE_INVALID);
diff --git a/libgnucash/engine/test/utest-Account.cpp b/libgnucash/engine/test/utest-Account.cpp
index 4e59778..7c14615 100644
--- a/libgnucash/engine/test/utest-Account.cpp
+++ b/libgnucash/engine/test/utest-Account.cpp
@@ -1962,7 +1962,7 @@ test_xaccAccountGetPresentBalance (Fixture *fixture, gconstpointer pData)
* xaccAccountConvertBalanceToCurrency
* xaccAccountConvertBalanceToCurrencyAsOfDate are wrappers around
* gnc_pricedb_convert_balance_latest_price and
- * gnc_pricedb_convert_balance_nearest_price. Don't test.
+ * gnc_pricedb_convert_balance_nearest_price_t64. Don't test.
*
* The rest of these are convenience functions that wrap
* xaccAccountConvertBalanceToCurrency* with one of the balance getter
diff --git a/libgnucash/engine/test/utest-Budget.c b/libgnucash/engine/test/utest-Budget.c
index fd311d1..6b188a4 100644
--- a/libgnucash/engine/test/utest-Budget.c
+++ b/libgnucash/engine/test/utest-Budget.c
@@ -1924,7 +1924,7 @@ test_xaccAccountGetPresentBalance (Fixture *fixture, gconstpointer pData)
* xaccAccountConvertBalanceToCurrency
* xaccAccountConvertBalanceToCurrencyAsOfDate are wrappers around
* gnc_pricedb_convert_balance_latest_price and
- * gnc_pricedb_convert_balance_nearest_price. Don't test.
+ * gnc_pricedb_convert_balance_nearest_price_t64. Don't test.
*
* The rest of these are convenience functions that wrap
* xaccAccountConvertBalanceToCurrency* with one of the balance getter
diff --git a/libgnucash/engine/test/utest-gnc-pricedb.c b/libgnucash/engine/test/utest-gnc-pricedb.c
index 841260a..670bf6f 100644
--- a/libgnucash/engine/test/utest-gnc-pricedb.c
+++ b/libgnucash/engine/test/utest-gnc-pricedb.c
@@ -70,12 +70,12 @@ setup_commodities (QofBook *book)
*/
static GNCPrice *
construct_price(QofBook *book, gnc_commodity *com, gnc_commodity *cur,
- Timespec t, PriceSource source, gnc_numeric price)
+ time64 t, PriceSource source, gnc_numeric price)
{
GNCPrice *p = gnc_price_create(book);
gnc_price_set_commodity(p, com);
gnc_price_set_currency(p, cur);
- gnc_price_set_time(p, t);
+ gnc_price_set_time64(p, t);
gnc_price_set_source(p, source);
gnc_price_set_value(p, price);
return p;
@@ -229,12 +229,12 @@ gnc_price_set_currency(GNCPrice *p, gnc_commodity *c)// C: 7 in 7 SCM: 1 Local:
test_gnc_price_set_currency (Fixture *fixture, gconstpointer pData)
{
}*/
-/* gnc_price_set_time
+/* gnc_price_set_time64
void
-gnc_price_set_time(GNCPrice *p, Timespec t)// C: 9 in 7 SCM: 2 in 1 Local: 2:0:0
+gnc_price_set_time64(GNCPrice *p, time64 t)// C: 9 in 7 SCM: 2 in 1 Local: 2:0:0
*/
/* static void
-test_gnc_price_set_time (Fixture *fixture, gconstpointer pData)
+test_gnc_price_set_time64 (Fixture *fixture, gconstpointer pData)
{
}*/
/* gnc_price_set_source
@@ -285,12 +285,12 @@ gnc_price_get_commodity(const GNCPrice *p)// C: 12 in 5 Local: 20:1:0
test_gnc_price_get_commodity (Fixture *fixture, gconstpointer pData)
{
}*/
-/* gnc_price_get_time
-Timespec
-gnc_price_get_time(const GNCPrice *p)// C: 7 in 4 SCM: 1 Local: 18:1:0
+/* gnc_price_get_time64
+time64
+gnc_price_get_time64(const GNCPrice *p)// C: 7 in 4 SCM: 1 Local: 18:1:0
*/
/* static void
-test_gnc_price_get_time (Fixture *fixture, gconstpointer pData)
+test_gnc_price_get_time64 (Fixture *fixture, gconstpointer pData)
{
}*/
/* gnc_price_get_source
@@ -412,171 +412,171 @@ create_some_prices (PriceDBFixture *fixture)
Commodities *c = fixture->com;
gnc_pricedb_set_bulk_update(db, TRUE);
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->aud,
- gnc_dmy2timespec(11, 4, 2009),
+ gnc_dmy2time64(11, 4, 2009),
PRICE_SOURCE_FQ,
gnc_numeric_create(131190, 10000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->aud,
- gnc_dmy2timespec(12, 4, 2009),
+ gnc_dmy2time64(12, 4, 2009),
PRICE_SOURCE_USER_PRICE,
gnc_numeric_create(131190, 10000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->aud,
- gnc_dmy2timespec(21, 8, 2010),
+ gnc_dmy2time64(21, 8, 2010),
PRICE_SOURCE_FQ,
gnc_numeric_create(111794, 10000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->aud,
- gnc_dmy2timespec(1, 8, 2013),
+ gnc_dmy2time64(1, 8, 2013),
PRICE_SOURCE_FQ,
gnc_numeric_create(111878, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->aud,
- gnc_dmy2timespec(12, 11, 2014),
+ gnc_dmy2time64(12, 11, 2014),
PRICE_SOURCE_FQ,
gnc_numeric_create(114784, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(11, 4, 2009),
+ gnc_dmy2time64(11, 4, 2009),
PRICE_SOURCE_FQ,
gnc_numeric_create(166651, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->aud, c->usd,
- gnc_dmy2timespec(20, 7, 2011),
+ gnc_dmy2time64(20, 7, 2011),
PRICE_SOURCE_FQ,
gnc_numeric_create(106480, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->aud, c->usd,
- gnc_dmy2timespec(17, 11, 2012),
+ gnc_dmy2time64(17, 11, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(103415, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(21, 8, 2010),
+ gnc_dmy2time64(21, 8, 2010),
PRICE_SOURCE_FQ,
gnc_numeric_create(159037, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(20, 7, 2011),
+ gnc_dmy2time64(20, 7, 2011),
PRICE_SOURCE_FQ,
gnc_numeric_create(161643, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(17, 11, 2012),
+ gnc_dmy2time64(17, 11, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(158855, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(13, 10, 2012),
+ gnc_dmy2time64(13, 10, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(160705, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(1, 8, 2013),
+ gnc_dmy2time64(1, 8, 2013),
PRICE_SOURCE_FQ,
gnc_numeric_create(151173, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->usd,
- gnc_dmy2timespec(12, 11, 2014),
+ gnc_dmy2time64(12, 11, 2014),
PRICE_SOURCE_FQ,
gnc_numeric_create(157658, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(11, 4, 2009),
+ gnc_dmy2time64(11, 4, 2009),
PRICE_SOURCE_FQ,
gnc_numeric_create(111257, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(21, 8, 2010),
+ gnc_dmy2time64(21, 8, 2010),
PRICE_SOURCE_FQ,
gnc_numeric_create(122195, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(20, 7, 2011),
+ gnc_dmy2time64(20, 7, 2011),
PRICE_SOURCE_FQ,
gnc_numeric_create(113289, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(17, 11, 2012),
+ gnc_dmy2time64(17, 11, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(124646, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(13, 10, 2012),
+ gnc_dmy2time64(13, 10, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(124072, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(1, 8, 2013),
+ gnc_dmy2time64(1, 8, 2013),
PRICE_SOURCE_FQ,
gnc_numeric_create(114420, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(12, 11, 2014),
+ gnc_dmy2time64(12, 11, 2014),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->dkk,
- gnc_dmy2timespec(11, 4, 2009),
+ gnc_dmy2time64(11, 4, 2009),
PRICE_SOURCE_FQ,
gnc_numeric_create(567859, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->dkk,
- gnc_dmy2timespec(21, 8, 2010),
+ gnc_dmy2time64(21, 8, 2010),
PRICE_SOURCE_FQ,
gnc_numeric_create(585810, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->dkk,
- gnc_dmy2timespec(20, 7, 2011),
+ gnc_dmy2time64(20, 7, 2011),
PRICE_SOURCE_FQ,
gnc_numeric_create(522449, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->dkk,
- gnc_dmy2timespec(17, 11, 2012),
+ gnc_dmy2time64(17, 11, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(585380, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->dkk,
- gnc_dmy2timespec(1, 8, 2013),
+ gnc_dmy2time64(1, 8, 2013),
PRICE_SOURCE_FQ,
gnc_numeric_create(564281, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->usd, c->dkk,
- gnc_dmy2timespec(12, 11, 2014),
+ gnc_dmy2time64(12, 11, 2014),
PRICE_SOURCE_FQ,
gnc_numeric_create(598693, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->amzn, c->usd,
- gnc_dmy2timespec(13, 4, 2009),
+ gnc_dmy2time64(13, 4, 2009),
PRICE_SOURCE_FQ,
gnc_numeric_create(7805, 100)));
gnc_pricedb_add_price(db, construct_price(book, c->amzn, c->usd,
- gnc_dmy2timespec(23, 8, 2010),
+ gnc_dmy2time64(23, 8, 2010),
PRICE_SOURCE_FQ,
gnc_numeric_create(12664, 100)));
gnc_pricedb_add_price(db, construct_price(book, c->amzn, c->usd,
- gnc_dmy2timespec(25, 7, 2011),
+ gnc_dmy2time64(25, 7, 2011),
PRICE_SOURCE_FQ,
gnc_numeric_create(22252, 100)));
gnc_pricedb_add_price(db, construct_price(book, c->amzn, c->usd,
- gnc_dmy2timespec(19, 11, 2012),
+ gnc_dmy2time64(19, 11, 2012),
PRICE_SOURCE_FQ,
gnc_numeric_create(23988, 100)));
gnc_pricedb_add_price(db, construct_price(book, c->amzn, c->usd,
- gnc_dmy2timespec(5, 8, 2013),
+ gnc_dmy2time64(5, 8, 2013),
PRICE_SOURCE_FQ,
gnc_numeric_create(29726, 100)));
gnc_pricedb_add_price(db, construct_price(book, c->amzn, c->usd,
- gnc_dmy2timespec(12, 11, 2014),
+ gnc_dmy2time64(12, 11, 2014),
PRICE_SOURCE_FQ,
gnc_numeric_create(31151, 100)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(12, 05, 2007),
+ gnc_dmy2time64(12, 05, 2007),
PRICE_SOURCE_USER_PRICE,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(12, 05, 2008),
+ gnc_dmy2time64(12, 05, 2008),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(13, 05, 2008),
+ gnc_dmy2time64(13, 05, 2008),
PRICE_SOURCE_USER_PRICE,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(14, 05, 2008),
+ gnc_dmy2time64(14, 05, 2008),
PRICE_SOURCE_USER_PRICE,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(19, 05, 2008),
+ gnc_dmy2time64(19, 05, 2008),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(22, 05, 2008),
+ gnc_dmy2time64(22, 05, 2008),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(12, 06, 2008),
+ gnc_dmy2time64(12, 06, 2008),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(12, 07, 2008),
+ gnc_dmy2time64(12, 07, 2008),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_add_price(db, construct_price(book, c->gbp, c->eur,
- gnc_dmy2timespec(12, 11, 2008),
+ gnc_dmy2time64(12, 11, 2008),
PRICE_SOURCE_FQ,
gnc_numeric_create(126836, 100000)));
gnc_pricedb_set_bulk_update(db, FALSE);
@@ -876,11 +876,11 @@ test_gnc_pricedb_lookup_latest (PriceDBFixture *fixture, gconstpointer pData)
GNCPrice *price2, *price = gnc_pricedb_lookup_latest(fixture->pricedb,
fixture->com->gbp,
fixture->com->eur);
- Timespec t = gnc_dmy2timespec(12, 11, 2014);
- Timespec price_time = gnc_price_get_time(price);
+ time64 t = gnc_dmy2time64(12, 11, 2014);
+ time64 price_time = gnc_price_get_time64(price);
g_assert(gnc_price_get_commodity(price) == fixture->com->gbp);
g_assert(gnc_price_get_currency(price) == fixture->com->eur);
- g_assert(timespec_equal(&price_time, &t));
+ g_assert_cmpint(price_time, ==, t);
price2 = gnc_pricedb_lookup_latest(fixture->pricedb, fixture->com->eur,
fixture->com->gbp);
g_assert(price2 == price);
@@ -910,7 +910,7 @@ test_is_in_list (Fixture *fixture, gconstpointer pData)
}*/
/* latest_before
static PriceList*
-latest_before (PriceList *prices, const gnc_commodity* target, Timespec t)// Local: 2:0:0
+latest_before (PriceList *prices, const gnc_commodity* target, time64 t)// Local: 2:0:0
*/
/* static void
test_latest_before (Fixture *fixture, gconstpointer pData)
@@ -934,7 +934,7 @@ test_add_nearest_price (Fixture *fixture, gconstpointer pData)
}*/
/* nearest_to
static PriceList *
-nearest_to (PriceList *prices, const gnc_commodity* target, Timespec t)// Local: 1:0:0
+nearest_to (PriceList *prices, const gnc_commodity* target, time64 t)// Local: 1:0:0
*/
/* static void
test_nearest_to (PriceDBFixture *fixture, gconstpointer pData)
@@ -974,26 +974,28 @@ test_gnc_pricedb_lookup_latest_any_currency (PriceDBFixture *fixture, gconstpoin
gnc_price_list_destroy(prices);
}
// Make Static
-/* gnc_pricedb_lookup_nearest_in_time_any_currency
+/* gnc_pricedb_lookup_nearest_in_time_any_currency_t64
PriceList *
-gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,// Local: 2:0:0
+gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,// Local: 2:0:0
*/
static void
-test_gnc_pricedb_lookup_nearest_in_time_any_currency (PriceDBFixture *fixture, gconstpointer pData)
+test_gnc_pricedb_lookup_nearest_in_time_any_currency_t64 (PriceDBFixture *fixture, gconstpointer pData)
{
- Timespec t1 = gnc_dmy2timespec(25, 3, 2013);
- Timespec t2 = gnc_dmy2timespec(26, 3, 2013);
+ time64 t1 = gnc_dmy2time64(25, 3, 2013);
+ time64 t2 = gnc_dmy2time64(26, 3, 2013);
PriceList *prices =
- gnc_pricedb_lookup_nearest_in_time_any_currency(fixture->pricedb,
- fixture->com->usd, t1);
+ gnc_pricedb_lookup_nearest_in_time_any_currency_t64(fixture->pricedb,
+ fixture->com->usd,
+ t1);
g_assert_cmpint(g_list_length(prices), ==, 4);
prices = g_list_sort(prices, compare_price_commodities);
g_assert_cmpstr(GET_COM_NAME(prices->next->data), ==, "AUD");
g_assert_cmpstr(GET_CUR_NAME(prices->next->data), ==, "USD");
gnc_price_list_destroy(prices);
prices =
- gnc_pricedb_lookup_nearest_in_time_any_currency(fixture->pricedb,
- fixture->com->usd, t2);
+ gnc_pricedb_lookup_nearest_in_time_any_currency_t64(fixture->pricedb,
+ fixture->com->usd,
+ t2);
g_assert_cmpint(g_list_length(prices), ==, 4);
prices = g_list_sort(prices, compare_price_commodities);
g_assert_cmpstr(GET_CUR_NAME(prices->next->data), ==, "AUD");
@@ -1002,18 +1004,18 @@ test_gnc_pricedb_lookup_nearest_in_time_any_currency (PriceDBFixture *fixture, g
}
// Not Used
-/* gnc_pricedb_lookup_latest_before_any_currency
+/* gnc_pricedb_lookup_latest_before_any_currency_t64
PriceList *
-gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,// Local: 0:0:0
+gnc_pricedb_lookup_latest_before_any_currency_t64(GNCPriceDB *db,// Local: 0:0:0
*/
static void
-test_gnc_pricedb_lookup_latest_before_any_currency (PriceDBFixture *fixture,
+test_gnc_pricedb_lookup_latest_before_any_currency_t64 (PriceDBFixture *fixture,
gconstpointer pData)
{
- Timespec t1 = gnc_dmy2timespec(31, 7, 2013);
- Timespec t2 = gnc_dmy2timespec(5, 8, 2013);
+ time64 t1 = gnc_dmy2time64(31, 7, 2013);
+ time64 t2 = gnc_dmy2time64(5, 8, 2013);
PriceList *prices =
- gnc_pricedb_lookup_latest_before_any_currency(fixture->pricedb,
+ gnc_pricedb_lookup_latest_before_any_currency_t64(fixture->pricedb,
fixture->com->usd, t1);
g_assert_cmpint(g_list_length(prices), ==, 4);
prices = g_list_sort(prices, compare_price_commodities);
@@ -1021,7 +1023,7 @@ test_gnc_pricedb_lookup_latest_before_any_currency (PriceDBFixture *fixture,
g_assert_cmpstr(GET_CUR_NAME(prices->next->data), ==, "USD");
gnc_price_list_destroy(prices);
prices =
- gnc_pricedb_lookup_latest_before_any_currency(fixture->pricedb,
+ gnc_pricedb_lookup_latest_before_any_currency_t64(fixture->pricedb,
fixture->com->usd, t2);
g_assert_cmpint(g_list_length(prices), ==, 4);
prices = g_list_sort(prices, compare_price_commodities);
@@ -1062,31 +1064,31 @@ test_gnc_pricedb_get_prices (PriceDBFixture *fixture, gconstpointer pData)
g_assert_cmpint(g_list_length(prices), ==, 5);
gnc_price_list_destroy(prices);
}
-/* gnc_pricedb_lookup_day
+/* gnc_pricedb_lookup_day_t64
GNCPrice *
-gnc_pricedb_lookup_day(GNCPriceDB *db,// C: 4 in 2 SCM: 2 in 1 Local: 1:0:0
+gnc_pricedb_lookup_day_t64(GNCPriceDB *db,// C: 4 in 2 SCM: 2 in 1 Local: 1:0:0
*/
static void
-test_gnc_pricedb_lookup_day (PriceDBFixture *fixture, gconstpointer pData)
+test_gnc_pricedb_lookup_day_t64 (PriceDBFixture *fixture, gconstpointer pData)
{
gchar *msg1 = "[gnc_dmy2timespec_internal()] Date computation error from Y-M-D 12-11-18: Year is out of valid range: 1400..10000";
gint loglevel = G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
gchar *logdomain = "qof.engine";
TestErrorStruct check = {loglevel, logdomain, msg1, 0};
GLogFunc hdlr = g_log_set_default_handler ((GLogFunc)test_null_handler, &check);
- Timespec t = gnc_dmy2timespec(17, 11, 2012);
- GNCPrice *price = gnc_pricedb_lookup_day(fixture->pricedb,
+ time64 t = gnc_dmy2time64(17, 11, 2012);
+ GNCPrice *price = gnc_pricedb_lookup_day_t64(fixture->pricedb,
fixture->com->usd,
fixture->com->gbp, t);
g_assert_cmpstr(GET_COM_NAME(price), ==, "GBP");
- t.tv_sec += 20247; /* A random number of seconds later, still the same day.*/
- price = gnc_pricedb_lookup_day(fixture->pricedb,
+ t += 20247; /* A random number of seconds later, still the same day.*/
+ price = gnc_pricedb_lookup_day_t64(fixture->pricedb,
fixture->com->usd,
fixture->com->gbp, t);
g_assert_cmpstr(GET_COM_NAME(price), ==, "GBP");
g_test_log_set_fatal_handler ((GTestLogFatalFunc)test_checked_handler, &check);
- t = gnc_dmy2timespec(18, 11, 12);
- price = gnc_pricedb_lookup_day(fixture->pricedb,
+ t = gnc_dmy2time64(18, 11, 12);
+ price = gnc_pricedb_lookup_day_t64(fixture->pricedb,
fixture->com->usd,
fixture->com->gbp, t);
g_assert(price == NULL);
@@ -1094,9 +1096,9 @@ test_gnc_pricedb_lookup_day (PriceDBFixture *fixture, gconstpointer pData)
}
// Not Used
-/* gnc_pricedb_lookup_at_time
+/* gnc_pricedb_lookup_at_time64
GNCPrice *
-gnc_pricedb_lookup_at_time(GNCPriceDB *db,// Local: 0:0:0
+gnc_pricedb_lookup_at_time64(GNCPriceDB *db,// Local: 0:0:0
*/
/* lookup_nearest_in_time
static GNCPrice *
@@ -1105,30 +1107,32 @@ lookup_nearest_in_time(GNCPriceDB *db,// Local: 2:0:0
/* test_lookup_nearest_in_time (Fixture *fixture, gconstpointer pData)
{
}*/
-/* gnc_pricedb_lookup_nearest_in_time
+/* gnc_pricedb_lookup_nearest_in_time64
GNCPrice *
-gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,// C: 2 in 1 Local: 1:0:0
+gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,// C: 2 in 1 Local: 1:0:0
*/
static void
-test_gnc_pricedb_lookup_nearest_in_time (PriceDBFixture *fixture, gconstpointer pData)
+test_gnc_pricedb_lookup_nearest_in_time64 (PriceDBFixture *fixture, gconstpointer pData)
{
- Timespec t1 = gnc_dmy2timespec(25, 3, 2013);
- Timespec t2 = gnc_dmy2timespec(26, 3, 2013);
+ time64 t1 = gnc_dmy2time64(25, 3, 2013);
+ time64 t2 = gnc_dmy2time64(26, 3, 2013);
GNCPrice *price =
- gnc_pricedb_lookup_nearest_in_time(fixture->pricedb, fixture->com->usd,
- fixture->com->aud, t1);
+ gnc_pricedb_lookup_nearest_in_time64(fixture->pricedb,
+ fixture->com->usd,
+ fixture->com->aud, t1);
g_assert_cmpstr(GET_COM_NAME(price), ==, "AUD");
g_assert_cmpstr(GET_CUR_NAME(price), ==, "USD");
price =
- gnc_pricedb_lookup_nearest_in_time(fixture->pricedb, fixture->com->usd,
- fixture->com->aud, t2);
+ gnc_pricedb_lookup_nearest_in_time64(fixture->pricedb,
+ fixture->com->usd,
+ fixture->com->aud, t2);
g_assert_cmpstr(GET_CUR_NAME(price), ==, "AUD");
g_assert_cmpstr(GET_COM_NAME(price), ==, "USD");
}
// Not Used
-/* gnc_pricedb_lookup_latest_before
+/* gnc_pricedb_lookup_latest_before_t64
GNCPrice *
-gnc_pricedb_lookup_latest_before (GNCPriceDB *db,// Local: 0:0:0
+gnc_pricedb_lookup_latest_before_t64 (GNCPriceDB *db,// Local: 0:0:0
*/
/* direct_balance_conversion
static gnc_numeric
@@ -1199,39 +1203,47 @@ test_gnc_pricedb_convert_balance_latest_price (PriceDBFixture *fixture, gconstpo
}
-/* gnc_pricedb_convert_balance_nearest_price
+/* gnc_pricedb_convert_balance_nearest_price_t64
gnc_numeric
-gnc_pricedb_convert_balance_nearest_price(GNCPriceDB *pdb,// C: 1 Local: 0:0:0
+gnc_pricedb_convert_balance_nearest_price_t64(GNCPriceDB *pdb,// C: 1 Local: 0:0:0
*/
static void
-test_gnc_pricedb_convert_balance_nearest_price (PriceDBFixture *fixture, gconstpointer pData)
+test_gnc_pricedb_convert_balance_nearest_price_t64 (PriceDBFixture *fixture, gconstpointer pData)
{
time64 t = gnc_dmy2time64(15, 8, 2011);
gnc_numeric from = gnc_numeric_create(10000, 100);
gnc_numeric result =
- gnc_pricedb_convert_balance_nearest_price(fixture->pricedb, from,
- fixture->com->usd,
- fixture->com->aud, t);
+ gnc_pricedb_convert_balance_nearest_price_t64(fixture->pricedb, from,
+ fixture->com->usd,
+ fixture->com->aud, t);
g_assert_cmpint(result.num, ==, 9391);
g_assert_cmpint(result.denom, ==, 100);
- result = gnc_pricedb_convert_balance_nearest_price(fixture->pricedb, from,
- fixture->com->usd,
- fixture->com->gbp, t);
+ result = gnc_pricedb_convert_balance_nearest_price_t64(fixture->pricedb,
+ from,
+ fixture->com->usd,
+ fixture->com->gbp,
+ t);
g_assert_cmpint(result.num, ==, 6186);
g_assert_cmpint(result.denom, ==, 100);
- result = gnc_pricedb_convert_balance_nearest_price(fixture->pricedb, from,
- fixture->com->usd,
- fixture->com->eur, t);
+ result = gnc_pricedb_convert_balance_nearest_price_t64(fixture->pricedb,
+ from,
+ fixture->com->usd,
+ fixture->com->eur,
+ t);
g_assert_cmpint(result.num, ==, 7009);
g_assert_cmpint(result.denom, ==, 100);
- result = gnc_pricedb_convert_balance_nearest_price(fixture->pricedb, from,
- fixture->com->gbp,
- fixture->com->dkk, t);
+ result = gnc_pricedb_convert_balance_nearest_price_t64(fixture->pricedb,
+ from,
+ fixture->com->gbp,
+ fixture->com->dkk,
+ t);
g_assert_cmpint(result.num, ==, 84450);
g_assert_cmpint(result.denom, ==, 100);
- result = gnc_pricedb_convert_balance_nearest_price(fixture->pricedb, from,
- fixture->com->amzn,
- fixture->com->aud, t);
+ result = gnc_pricedb_convert_balance_nearest_price_t64(fixture->pricedb,
+ from,
+ fixture->com->amzn,
+ fixture->com->aud,
+ t);
g_assert_cmpint(result.num, ==, 2089782);
g_assert_cmpint(result.denom, ==, 100);
@@ -1426,14 +1438,14 @@ test_suite_gnc_pricedb (void)
// GNC_TEST_ADD (suitename, "gnc price set dirty", Fixture, NULL, setup, test_gnc_price_set_dirty, teardown);
// GNC_TEST_ADD (suitename, "gnc price set commodity", Fixture, NULL, setup, test_gnc_price_set_commodity, teardown);
// GNC_TEST_ADD (suitename, "gnc price set currency", Fixture, NULL, setup, test_gnc_price_set_currency, teardown);
-// GNC_TEST_ADD (suitename, "gnc price set time", Fixture, NULL, setup, test_gnc_price_set_time, teardown);
+// GNC_TEST_ADD (suitename, "gnc price set time", Fixture, NULL, setup, test_gnc_price_set_time64, teardown);
// GNC_TEST_ADD (suitename, "gnc price set source", Fixture, NULL, setup, test_gnc_price_set_source, teardown);
// GNC_TEST_ADD (suitename, "gnc price set source string", Fixture, NULL, setup, test_gnc_price_set_source_string, teardown);
// GNC_TEST_ADD (suitename, "gnc price set typestr", Fixture, NULL, setup, test_gnc_price_set_typestr, teardown);
// GNC_TEST_ADD (suitename, "gnc price set value", Fixture, NULL, setup, test_gnc_price_set_value, teardown);
// GNC_TEST_ADD (suitename, "gnc price lookup", Fixture, NULL, setup, test_gnc_price_lookup, teardown);
// GNC_TEST_ADD (suitename, "gnc price get commodity", Fixture, NULL, setup, test_gnc_price_get_commodity, teardown);
-// GNC_TEST_ADD (suitename, "gnc price get time", Fixture, NULL, setup, test_gnc_price_get_time, teardown);
+// GNC_TEST_ADD (suitename, "gnc price get time", Fixture, NULL, setup, test_gnc_price_get_time64, teardown);
// GNC_TEST_ADD (suitename, "gnc price get source", Fixture, NULL, setup, test_gnc_price_get_source, teardown);
// GNC_TEST_ADD (suitename, "gnc price get source string", Fixture, NULL, setup, test_gnc_price_get_source_string, teardown);
// GNC_TEST_ADD (suitename, "gnc price get typestr", Fixture, NULL, setup, test_gnc_price_get_typestr, teardown);
@@ -1478,20 +1490,20 @@ test_suite_gnc_pricedb (void)
// GNC_TEST_ADD (suitename, "add nearest price", Fixture, NULL, setup, test_add_nearest_price, teardown);
// GNC_TEST_ADD (suitename, "nearest to", Fixture, NULL, setup, test_nearest_to, teardown);
GNC_TEST_ADD (suitename, "gnc pricedb lookup latest any currency", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_latest_any_currency, teardown);
- GNC_TEST_ADD (suitename, "gnc pricedb lookup nearest in time any currency", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_nearest_in_time_any_currency, teardown);
- GNC_TEST_ADD (suitename, "gnc pricedb lookup latest before any currency", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_latest_before_any_currency, teardown);
+ GNC_TEST_ADD (suitename, "gnc pricedb lookup nearest in time any currency", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_nearest_in_time_any_currency_t64, teardown);
+ GNC_TEST_ADD (suitename, "gnc pricedb lookup latest before any currency", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_latest_before_any_currency_t64, teardown);
// GNC_TEST_ADD (suitename, "hash values helper", PriceDBFixture, NULL, setup, test_hash_values_helper, teardown);
GNC_TEST_ADD (suitename, "gnc pricedb has prices", PriceDBFixture, NULL, setup, test_gnc_pricedb_has_prices, teardown);
GNC_TEST_ADD (suitename, "gnc pricedb get prices", PriceDBFixture, NULL, setup, test_gnc_pricedb_get_prices, teardown);
- GNC_TEST_ADD (suitename, "gnc pricedb lookup day", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_day, teardown);
+ GNC_TEST_ADD (suitename, "gnc pricedb lookup day", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_day_t64, teardown);
// GNC_TEST_ADD (suitename, "lookup nearest in time", Fixture, NULL, setup, test_lookup_nearest_in_time, teardown);
- GNC_TEST_ADD (suitename, "gnc pricedb lookup nearest in time", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_nearest_in_time, teardown);
+ GNC_TEST_ADD (suitename, "gnc pricedb lookup nearest in time", PriceDBFixture, NULL, setup, test_gnc_pricedb_lookup_nearest_in_time64, teardown);
// GNC_TEST_ADD (suitename, "direct balance conversion", Fixture, NULL, setup, test_direct_balance_conversion, teardown);
// GNC_TEST_ADD (suitename, "extract common prices", Fixture, NULL, setup, test_extract_common_prices, teardown);
// GNC_TEST_ADD (suitename, "convert balance", Fixture, NULL, setup, test_convert_balance, teardown);
// GNC_TEST_ADD (suitename, "indirect balance conversion", Fixture, NULL, setup, test_indirect_balance_conversion, teardown);
GNC_TEST_ADD (suitename, "gnc pricedb convert balance latest price", PriceDBFixture, NULL, setup, test_gnc_pricedb_convert_balance_latest_price, teardown);
- GNC_TEST_ADD (suitename, "gnc pricedb convert balance nearest price", PriceDBFixture, NULL, setup, test_gnc_pricedb_convert_balance_nearest_price, teardown);
+ GNC_TEST_ADD (suitename, "gnc pricedb convert balance nearest price", PriceDBFixture, NULL, setup, test_gnc_pricedb_convert_balance_nearest_price_t64, teardown);
// GNC_TEST_ADD (suitename, "pricedb foreach pricelist", Fixture, NULL, setup, test_pricedb_foreach_pricelist, teardown);
// GNC_TEST_ADD (suitename, "pricedb foreach currencies hash", Fixture, NULL, setup, test_pricedb_foreach_currencies_hash, teardown);
// GNC_TEST_ADD (suitename, "unstable price traversal", Fixture, NULL, setup, test_unstable_price_traversal, teardown);
commit 92a8cf330aece720dd02cc85d181d3bffbcaee08
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 2 13:55:24 2018 -0700
Timespec->time64 in business code.
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index 39465a8..ef3a9ea 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -973,9 +973,9 @@ gnc_payment_ok_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
else
auto_pay = gnc_prefs_get_bool (GNC_PREFS_GROUP_BILL, GNC_PREF_AUTO_PAY);
- gncOwnerApplyPayment (&pw->owner, &(pw->tx_info->txn), selected_lots,
- pw->post_acct, pw->xfer_acct, pw->amount_tot,
- exch, t, memo, num, auto_pay);
+ gncOwnerApplyPaymentSecs (&pw->owner, &(pw->tx_info->txn), selected_lots,
+ pw->post_acct, pw->xfer_acct, pw->amount_tot,
+ exch, t, memo, num, auto_pay);
}
gnc_resume_gui_refresh ();
diff --git a/libgnucash/engine/gncBillTerm.c b/libgnucash/engine/gncBillTerm.c
index 73e19d7..93c03f6 100644
--- a/libgnucash/engine/gncBillTerm.c
+++ b/libgnucash/engine/gncBillTerm.c
@@ -764,7 +764,7 @@ compute_monthyear (const GncBillTerm *term, time64 post_date,
gnc_localtime_r (&post_date, &tm);
iday = tm.tm_mday;
imonth = tm.tm_mon + 1;
- iyear = tm.tm_year + 1;
+ iyear = tm.tm_year + 1900;
if (cutoff <= 0)
cutoff += gnc_date_get_last_mday (imonth - 1, iyear);
@@ -801,23 +801,23 @@ compute_monthyear (const GncBillTerm *term, time64 post_date,
* detailed explanation of proximo.
*/
-static Timespec
-compute_time (const GncBillTerm *term, Timespec post_date, int days)
+static time64
+compute_time (const GncBillTerm *term, time64 post_date, int days)
{
- Timespec res = post_date;
+ time64 res = post_date;
int day, month, year;
switch (term->type)
{
case GNC_TERM_TYPE_DAYS:
- res.tv_sec += (SECS_PER_DAY * days);
+ res += (SECS_PER_DAY * days);
break;
case GNC_TERM_TYPE_PROXIMO:
- compute_monthyear (term, post_date.tv_sec, &month, &year);
+ compute_monthyear (term, post_date, &month, &year);
day = gnc_date_get_last_mday (month - 1, year);
if (days < day)
day = days;
- res = gnc_dmy2timespec (day, month, year);
+ res = gnc_dmy2time64 (day, month, year);
break;
}
return res;
@@ -826,9 +826,8 @@ compute_time (const GncBillTerm *term, Timespec post_date, int days)
time64
gncBillTermComputeDueDate (const GncBillTerm *term, time64 post_date)
{
- Timespec pass = {post_date, 0};
if (!term) return post_date;
- return compute_time (term, pass, term->due_days).tv_sec;
+ return compute_time (term, post_date, term->due_days);
}
/* Package-Private functions */
diff --git a/libgnucash/engine/gncEntry.c b/libgnucash/engine/gncEntry.c
index a47fd3b..654e7ec 100644
--- a/libgnucash/engine/gncEntry.c
+++ b/libgnucash/engine/gncEntry.c
@@ -1324,20 +1324,20 @@ gncEntryRecomputeValues (GncEntry *entry)
/* See if either tax table changed since we last computed values */
if (entry->i_tax_table)
{
- Timespec modtime = gncTaxTableLastModified (entry->i_tax_table);
- if (entry->i_taxtable_modtime != modtime.tv_sec)
+ time64 modtime = gncTaxTableLastModifiedSecs (entry->i_tax_table);
+ if (entry->i_taxtable_modtime != modtime)
{
entry->values_dirty = TRUE;
- entry->i_taxtable_modtime = modtime.tv_sec;
+ entry->i_taxtable_modtime = modtime;
}
}
if (entry->b_tax_table)
{
- Timespec modtime = gncTaxTableLastModified (entry->b_tax_table);
- if (entry->b_taxtable_modtime == modtime.tv_sec)
+ time64 modtime = gncTaxTableLastModifiedSecs (entry->b_tax_table);
+ if (entry->b_taxtable_modtime == modtime)
{
entry->values_dirty = TRUE;
- entry->b_taxtable_modtime = modtime.tv_sec;
+ entry->b_taxtable_modtime = modtime;
}
}
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 40d87be..670242c 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -1943,9 +1943,10 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn,
g_return_if_fail (owner->owner.undefined);
/* Create a lot for this payment */
- payment_lot = gncOwnerCreatePaymentLot (owner, &txn, invoice->posted_acc,
- xfer_acc, amount, exch,
- date, memo, num);
+ payment_lot = gncOwnerCreatePaymentLotSecs (owner, &txn,
+ invoice->posted_acc,
+ xfer_acc, amount, exch,
+ date, memo, num);
/* Select the invoice as only payment candidate */
selected_lots = g_list_prepend (selected_lots, invoice->posted_lot);
diff --git a/libgnucash/engine/gncInvoice.h b/libgnucash/engine/gncInvoice.h
index fce06f2..4fc2e52 100644
--- a/libgnucash/engine/gncInvoice.h
+++ b/libgnucash/engine/gncInvoice.h
@@ -246,7 +246,7 @@ gncInvoiceAutoApplyPayments (GncInvoice *invoice);
* or payments for the owner will be considered
* to balance the payment.
*
- * This code is actually a convenience wrapper around gncOwnerCreatePaymentLot
+ * This code is actually a convenience wrapper around gncOwnerCreatePaymentLotSecs
* and gncOwnerAutoApplyPaymentsWithLots. See their descriptions for more
* details on what happens exactly.
*/
diff --git a/libgnucash/engine/gncOwner.c b/libgnucash/engine/gncOwner.c
index 6011936..a409b79 100644
--- a/libgnucash/engine/gncOwner.c
+++ b/libgnucash/engine/gncOwner.c
@@ -723,10 +723,10 @@ gncOwnerLotsSortFunc (GNCLot *lotA, GNCLot *lotB)
}
GNCLot *
-gncOwnerCreatePaymentLot (const GncOwner *owner, Transaction **preset_txn,
- Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, time64 date,
- const char *memo, const char *num)
+gncOwnerCreatePaymentLotSecs (const GncOwner *owner, Transaction **preset_txn,
+ Account *posted_acc, Account *xfer_acc,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
+ const char *memo, const char *num)
{
QofBook *book;
Split *split;
@@ -1376,10 +1376,10 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots)
* then all open lots for the owner are considered.
*/
void
-gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, GList *lots,
- Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, time64 date,
- const char *memo, const char *num, gboolean auto_pay)
+gncOwnerApplyPaymentSecs (const GncOwner *owner, Transaction **preset_txn,
+ GList *lots, Account *posted_acc, Account *xfer_acc,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
+ const char *memo, const char *num, gboolean auto_pay)
{
GNCLot *payment_lot = NULL;
GList *selected_lots = NULL;
@@ -1391,8 +1391,10 @@ gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, GList *lo
/* If there's a real amount to transfer create a lot for this payment */
if (!gnc_numeric_zero_p (amount))
- payment_lot = gncOwnerCreatePaymentLot (owner, preset_txn, posted_acc, xfer_acc,
- amount, exch, date, memo, num);
+ payment_lot = gncOwnerCreatePaymentLotSecs (owner, preset_txn,
+ posted_acc, xfer_acc,
+ amount, exch, date, memo,
+ num);
if (lots)
selected_lots = lots;
diff --git a/libgnucash/engine/gncOwner.h b/libgnucash/engine/gncOwner.h
index 79bbaba..28251ac 100644
--- a/libgnucash/engine/gncOwner.h
+++ b/libgnucash/engine/gncOwner.h
@@ -214,10 +214,10 @@ gboolean gncOwnerGetOwnerFromTypeGuid (QofBook *book, GncOwner *owner, QofIdType
* split in the transfer account).
*/
GNCLot *
-gncOwnerCreatePaymentLot (const GncOwner *owner, Transaction **preset_txn,
- Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, time64 date,
- const char *memo, const char *num);
+gncOwnerCreatePaymentLotSecs (const GncOwner *owner, Transaction **preset_txn,
+ Account *posted_acc, Account *xfer_acc,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
+ const char *memo, const char *num);
/**
* Given a list of lots, try to balance as many of them as possible
@@ -267,10 +267,10 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots);
* details on what happens exactly.
*/
void
-gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, GList *lots,
- Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, time64 date,
- const char *memo, const char *num, gboolean auto_pay);
+gncOwnerApplyPaymentSecs (const GncOwner *owner, Transaction **preset_txn,
+ GList *lots, Account *posted_acc, Account *xfer_acc,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
+ const char *memo, const char *num, gboolean auto_pay);
/** Helper function to find a split in lot that best offsets target_value
* Obviously it should be of opposite sign.
diff --git a/libgnucash/engine/gncTaxTable.c b/libgnucash/engine/gncTaxTable.c
index f691f70..9175216 100644
--- a/libgnucash/engine/gncTaxTable.c
+++ b/libgnucash/engine/gncTaxTable.c
@@ -39,7 +39,7 @@ struct _gncTaxTable
QofInstance inst;
char * name;
GncTaxTableEntryList* entries;
- Timespec modtime; /* internal date of last modtime */
+ time64 modtime; /* internal date of last modtime */
/* See src/doc/business.txt for an explanation of the following */
/* Code that handles this is *identical* to that in gncBillTerm */
@@ -165,7 +165,7 @@ maybe_resort_list (GncTaxTable *table)
static inline void
mod_table (GncTaxTable *table)
{
- timespecFromTime64 (&table->modtime, gnc_time (NULL));
+ table->modtime = gnc_time (NULL);
}
static inline void addObj (GncTaxTable *table)
@@ -761,10 +761,9 @@ gint64 gncTaxTableGetRefcount (const GncTaxTable *table)
return table->refcount;
}
-Timespec gncTaxTableLastModified (const GncTaxTable *table)
+time64 gncTaxTableLastModifiedSecs (const GncTaxTable *table)
{
- Timespec ts = { 0 , 0 };
- if (!table) return ts;
+ if (!table) return 0;
return table->modtime;
}
diff --git a/libgnucash/engine/gncTaxTable.h b/libgnucash/engine/gncTaxTable.h
index 7d9579a..5215585 100644
--- a/libgnucash/engine/gncTaxTable.h
+++ b/libgnucash/engine/gncTaxTable.h
@@ -41,7 +41,7 @@ is *identical* to that in ::GncBillTerm
@param QofInstance inst;
@param char * name;
@param GncTaxTableEntryList* entries;
- at param Timespec modtime;
+ at param time64 modtime;
@param gint64 refcount;
@param GncTaxTable * parent; if non-null, we are an immutable child
@param GncTaxTable * child; if non-null, we have not changed
@@ -162,7 +162,7 @@ GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new);
typedef GList GncTaxTableEntryList;
GncTaxTableEntryList* gncTaxTableGetEntries (const GncTaxTable *table);
gint64 gncTaxTableGetRefcount (const GncTaxTable *table);
-Timespec gncTaxTableLastModified (const GncTaxTable *table);
+time64 gncTaxTableLastModifiedSecs (const GncTaxTable *table);
Account * gncTaxTableEntryGetAccount (const GncTaxTableEntry *entry);
GncAmountType gncTaxTableEntryGetType (const GncTaxTableEntry *entry);
commit 44c3dc836af2c685644370a908bd8bb4388604a0
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Mon Aug 13 15:47:12 2018 +0100
Bug 796785 - dates cannot be keyboard entered on vendor bill
transactions
Make the gncEntryLedgerModel 'get_date_help' function the same format
as that used in the register.
diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index ef47c13..f9e2737 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -569,19 +569,16 @@ static char * get_date_help (VirtualLocation virt_loc, gpointer user_data)
GncEntryLedger *ledger = user_data;
BasicCell *cell;
char string[1024];
- struct tm tm;
- time64 tt;
+ GDate date;
cell = gnc_table_get_cell (ledger->table, virt_loc);
- if (!cell)
+ if (!cell || !cell->value || *cell->value == '\0')
return NULL;
- if (!cell->value || *cell->value == '\0')
- return NULL;
+ g_date_clear (&date, 1);
+ gnc_date_cell_get_date_gdate ((DateCell *) cell, &date);
- gnc_date_cell_get_date ((DateCell *) cell, &tt);
- gnc_localtime_r (&tt, &tm);
- qof_strftime (string, sizeof(string), _("%A %d %B %Y"), &tm);
+ g_date_strftime (string, sizeof (string), _("%A %d %B %Y"), &date);
return g_strdup (string);
}
commit c8b372e3906a365085a91d2a6f0fa6cd572b6162
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Aug 2 13:29:47 2018 -0700
Convert GNC_TYPE_TIMESPEC to GNC_TYPE_TIME64, Kvp::Type::Timespec to Kvp::Type::Time64
They have to go together because of using gvalues to hide KVP from most of
GnuCash.
diff --git a/gnucash/import-export/aqb/gnc-ab-kvp.c b/gnucash/import-export/aqb/gnc-ab-kvp.c
index 4b5b1f6..ed0a1c5 100644
--- a/gnucash/import-export/aqb/gnc-ab-kvp.c
+++ b/gnucash/import-export/aqb/gnc-ab-kvp.c
@@ -98,20 +98,20 @@ gnc_ab_set_account_uid(Account *a, guint32 uid)
time64
gnc_ab_get_account_trans_retrieval(const Account *a)
{
- Timespec *t = NULL;
+ Time64 *t = NULL;
qof_instance_get (QOF_INSTANCE (a),
"ab-trans-retrieval", &t,
NULL);
- return t ? t->tv_sec : 0;
+ return t ? t->t : 0;
}
void
gnc_ab_set_account_trans_retrieval(Account *a, time64 time)
{
- Timespec ts = {time, 0};
+ Time64 t = {time};
xaccAccountBeginEdit(a);
qof_instance_set (QOF_INSTANCE (a),
- "ab-trans-retrieval", &ts,
+ "ab-trans-retrieval", &t,
NULL);
xaccAccountCommitEdit(a);
}
diff --git a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
index 1447f39..4c0d7ac 100644
--- a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+++ b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
@@ -138,7 +138,7 @@ setup_memory (Fixture* fixture, gconstpointer pData)
frame->set ({"int64-val"}, new KvpValue (INT64_C (100)));
frame->set ({"double-val"}, new KvpValue (3.14159));
frame->set ({"numeric-val"}, new KvpValue (gnc_numeric_zero ()));
- frame->set ({"timespec-val"}, new KvpValue (timespec_now ()));
+ frame->set ({"timespec-val"}, new KvpValue (gnc_time(nullptr)));
frame->set ({"string-val"}, new KvpValue ("abcdefghijklmnop"));
auto guid = qof_instance_get_guid (QOF_INSTANCE (acct1));
frame->set ({"guid-val"}, new KvpValue (const_cast<GncGUID*> (guid_copy (
diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp
index d0a5145..6cb48ff 100644
--- a/libgnucash/backend/sql/gnc-slots-sql.cpp
+++ b/libgnucash/backend/sql/gnc-slots-sql.cpp
@@ -397,8 +397,9 @@ get_timespec_val (gpointer pObject)
g_return_val_if_fail (pObject != NULL, gnc_dmy2timespec (1, 1, 1970));
-//if( kvp_value_get_type( pInfo->pKvpValue ) == KvpValue::Type::TIMESPEC ) {
- return pInfo->pKvpValue->get<Timespec> ();
+//if( kvp_value_get_type( pInfo->pKvpValue ) == KvpValue::Type::TIME64 ) {
+ auto t = pInfo->pKvpValue->get<Time64> ();
+ return {t.t, 0};
}
static void
@@ -406,11 +407,11 @@ set_timespec_val (gpointer pObject, Timespec *ts)
{
slot_info_t* pInfo = (slot_info_t*)pObject;
KvpValue* value = NULL;
-
+ Time64 t{ts->tv_sec};
g_return_if_fail (pObject != NULL);
- if (pInfo->value_type != KvpValue::Type::TIMESPEC) return;
- value = new KvpValue {*ts};
+ if (pInfo->value_type != KvpValue::Type::TIME64) return;
+ value = new KvpValue {t};
set_slot_from_value (pInfo, value);
}
diff --git a/libgnucash/backend/xml/sixtp-dom-generators.cpp b/libgnucash/backend/xml/sixtp-dom-generators.cpp
index ce7bc5b..4d8fff4 100644
--- a/libgnucash/backend/xml/sixtp-dom-generators.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-generators.cpp
@@ -237,7 +237,7 @@ add_kvp_value_node (xmlNodePtr node, const gchar* tag, KvpValue* val)
g_free (newstr);
break;
}
- case KvpValue::Type::TIMESPEC:
+ case KvpValue::Type::TIME64:
val_node = NULL;
break;
case KvpValue::Type::GDATE:
@@ -277,10 +277,10 @@ add_kvp_value_node (xmlNodePtr node, const gchar* tag, KvpValue* val)
add_text_to_node (val_node, "guid", guidstr);
break;
}
- case KvpValue::Type::TIMESPEC:
+ case KvpValue::Type::TIME64:
{
- auto ts = val->get<Timespec> ();
- val_node = time64_to_dom_tree (tag, ts.tv_sec);
+ auto t = val->get<Time64> ();
+ val_node = time64_to_dom_tree (tag, t.t);
xmlSetProp (val_node, BAD_CAST "type", BAD_CAST "timespec");
xmlAddChild (node, val_node);
break;
diff --git a/libgnucash/backend/xml/sixtp-dom-parsers.cpp b/libgnucash/backend/xml/sixtp-dom-parsers.cpp
index a788ef0..1408004 100644
--- a/libgnucash/backend/xml/sixtp-dom-parsers.cpp
+++ b/libgnucash/backend/xml/sixtp-dom-parsers.cpp
@@ -235,7 +235,8 @@ dom_tree_to_guid_kvp_value (xmlNodePtr node)
static KvpValue*
dom_tree_to_time64_kvp_value (xmlNodePtr node)
{
- return new KvpValue {Timespec {dom_tree_to_time64 (node), 0}};
+ Time64 t{dom_tree_to_time64 (node)};
+ return new KvpValue {t};
}
static KvpValue*
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index 7920660..5379b0a 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -995,7 +995,7 @@ gnc_account_class_init (AccountClass *klass)
"AQBanking Last Transaction Retrieval",
"The time of the last transaction retrieval for this "
"account.",
- GNC_TYPE_TIMESPEC,
+ GNC_TYPE_TIME64,
static_cast<GParamFlags>(G_PARAM_READWRITE)));
}
diff --git a/libgnucash/engine/Split.c b/libgnucash/engine/Split.c
index b10714e..b709551 100644
--- a/libgnucash/engine/Split.c
+++ b/libgnucash/engine/Split.c
@@ -170,7 +170,7 @@ gnc_split_get_property(GObject *object,
g_value_set_boxed(value, &split->amount);
break;
case PROP_RECONCILE_DATE:
- g_value_set_boxed(value, &split->date_reconciled);
+ g_value_set_boxed(value, &split->date_reconciled.tv_sec);
break;
case PROP_TX:
g_value_take_object(value, split->parent);
@@ -223,7 +223,7 @@ gnc_split_set_property(GObject *object,
Split *split;
gnc_numeric* number;
gchar *key;
-
+ Time64 *t;
g_return_if_fail(GNC_IS_SPLIT(object));
split = GNC_SPLIT(object);
@@ -247,7 +247,8 @@ gnc_split_set_property(GObject *object,
xaccSplitSetAmount(split, *number);
break;
case PROP_RECONCILE_DATE:
- xaccSplitSetDateReconciledTS(split, g_value_get_boxed(value));
+ t = g_value_get_boxed(value);
+ xaccSplitSetDateReconciledSecs(split, t->t);
break;
case PROP_TX:
xaccSplitSetParent(split, g_value_get_object(value));
@@ -353,7 +354,7 @@ gnc_split_class_init(SplitClass* klass)
g_param_spec_boxed("reconcile-date",
"Reconcile Date",
"The date this split was reconciled.",
- GNC_TYPE_TIMESPEC,
+ GNC_TYPE_TIME64,
G_PARAM_READWRITE));
g_object_class_install_property
diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 8f8469b..2223c89 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -310,7 +310,6 @@ gnc_transaction_get_property(GObject* object,
{
Transaction* tx;
gchar *key;
- Timespec ts = {0,0};
g_return_if_fail(GNC_IS_TRANSACTION(object));
@@ -327,12 +326,10 @@ gnc_transaction_get_property(GObject* object,
g_value_take_object(value, tx->common_currency);
break;
case PROP_POST_DATE:
- ts.tv_sec = tx->date_posted;
- g_value_set_boxed(value, &ts);
+ g_value_set_boxed(value, &tx->date_posted);
break;
case PROP_ENTER_DATE:
- ts.tv_sec = tx->date_entered;
- g_value_set_boxed(value, &ts);
+ g_value_set_boxed(value, &tx->date_entered);
break;
case PROP_INVOICE:
qof_instance_get_kvp (QOF_INSTANCE (tx), value, 2, GNC_INVOICE_ID, GNC_INVOICE_GUID);
@@ -357,6 +354,7 @@ gnc_transaction_set_property(GObject* object,
{
Transaction* tx;
gchar *key;
+ Time64 *t;
g_return_if_fail(GNC_IS_TRANSACTION(object));
@@ -375,10 +373,12 @@ gnc_transaction_set_property(GObject* object,
xaccTransSetCurrency(tx, g_value_get_object(value));
break;
case PROP_POST_DATE:
- xaccTransSetDatePostedSecs(tx, ((Timespec*)g_value_get_boxed(value))->tv_sec);
+ t = (Time64*)g_value_get_boxed(value);
+ xaccTransSetDatePostedSecs(tx, t->t);
break;
case PROP_ENTER_DATE:
- xaccTransSetDateEnteredSecs(tx, ((Timespec*)g_value_get_boxed(value))->tv_sec);
+ t = (Time64*)g_value_get_boxed(value);
+ xaccTransSetDateEnteredSecs(tx, t->t);
break;
case PROP_INVOICE:
qof_instance_set_kvp (QOF_INSTANCE (tx), value, 2, GNC_INVOICE_ID, GNC_INVOICE_GUID);
@@ -446,7 +446,7 @@ gnc_transaction_class_init(TransactionClass* klass)
g_param_spec_boxed("post-date",
"Post Date",
"The date the transaction occurred.",
- GNC_TYPE_TIMESPEC,
+ GNC_TYPE_TIME64,
G_PARAM_READWRITE));
g_object_class_install_property
@@ -455,7 +455,7 @@ gnc_transaction_class_init(TransactionClass* klass)
g_param_spec_boxed("enter-date",
"Enter Date",
"The date the transaction was entered.",
- GNC_TYPE_TIMESPEC,
+ GNC_TYPE_TIME64,
G_PARAM_READWRITE));
g_object_class_install_property(
@@ -2035,10 +2035,9 @@ void
xaccTransSetDateDue (Transaction * trans, time64 time)
{
GValue v = G_VALUE_INIT;
- Timespec send_ts = {time, 0};
if (!trans) return;
- g_value_init (&v, GNC_TYPE_TIMESPEC);
- g_value_set_boxed (&v, &send_ts);
+ g_value_init (&v, GNC_TYPE_TIME64);
+ g_value_set_boxed (&v, &time);
xaccTransBeginEdit(trans);
qof_instance_set_kvp (QOF_INSTANCE (trans), &v, 1, TRANS_DATE_DUE_KVP);
qof_instance_set_dirty(QOF_INSTANCE(trans));
diff --git a/libgnucash/engine/gnc-date.cpp b/libgnucash/engine/gnc-date.cpp
index 3107f1a..23e2a81 100644
--- a/libgnucash/engine/gnc-date.cpp
+++ b/libgnucash/engine/gnc-date.cpp
@@ -1262,18 +1262,6 @@ gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)
}
}
-void
-gnc_timespec2dmy (Timespec t, int *day, int *month, int *year)
-{
- struct tm result;
- time64 t_secs = t.tv_sec + (t.tv_nsec / NANOS_PER_SECOND);
- gnc_localtime_r(&t_secs, &result);
-
- if (day) *day = result.tm_mday;
- if (month) *month = result.tm_mon + 1;
- if (year) *year = result.tm_year + 1900;
-}
-
#define THIRTY_TWO_YEARS 0x3c30fc00LL
static Timespec
@@ -1518,33 +1506,34 @@ gnc_dow_abbrev(gchar *buf, int buf_len, int dow)
/* *******************************************************************
* GValue handling
********************************************************************/
+
static gpointer
-timespec_boxed_copy_func( gpointer in_timespec )
+time64_boxed_copy_func (gpointer in_time64)
{
- Timespec* newvalue;
+ Time64* newvalue;
- newvalue = static_cast<Timespec*>(g_malloc (sizeof (Timespec)));
- memcpy( newvalue, in_timespec, sizeof( Timespec ) );
+ newvalue = static_cast<Time64*>(g_malloc (sizeof (Time64)));
+ memcpy (newvalue, in_time64, sizeof(Time64));
return newvalue;
}
static void
-timespec_boxed_free_func( gpointer in_timespec )
+time64_boxed_free_func (gpointer in_time64)
{
- g_free( in_timespec );
+ g_free (in_time64);
}
GType
-timespec_get_type( void )
+time64_get_type( void )
{
static GType type = 0;
if ( type == 0 )
{
- type = g_boxed_type_register_static( "timespec",
- timespec_boxed_copy_func,
- timespec_boxed_free_func );
+ type = g_boxed_type_register_static( "time64",
+ time64_boxed_copy_func,
+ time64_boxed_free_func );
}
return type;
}
diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h
index ce00801..140dc92 100644
--- a/libgnucash/engine/gnc-date.h
+++ b/libgnucash/engine/gnc-date.h
@@ -82,6 +82,14 @@ extern "C"
* this stops working in 2038, we define our own:
*/
typedef gint64 time64;
+/* A bit of a hack to create a type separate from the alias of int64_t so that
+ * compile-time dispatch can use the right KVP visitor.
+ */
+typedef struct
+{
+ time64 t;
+} Time64;
+
/** The Timespec is just like the unix 'struct timespec'
* except that we use a 64-bit unsigned int to
@@ -96,8 +104,8 @@ typedef struct timespec64 Timespec;
/** @name GValue
@{
*/
-GType timespec_get_type( void );
-#define GNC_TYPE_TIMESPEC (timespec_get_type ())
+GType time64_get_type( void );
+#define GNC_TYPE_TIME64 (time64_get_type ())
/** @} */
/** The default date format for use with strftime. */
diff --git a/libgnucash/engine/gncInvoice.h b/libgnucash/engine/gncInvoice.h
index fa9eedc..fce06f2 100644
--- a/libgnucash/engine/gncInvoice.h
+++ b/libgnucash/engine/gncInvoice.h
@@ -101,7 +101,7 @@ GncInvoice *gncInvoiceCopy (const GncInvoice *other_invoice);
void gncInvoiceSetID (GncInvoice *invoice, const char *id);
void gncInvoiceSetOwner (GncInvoice *invoice, GncOwner *owner);
/** Set the DateOpened using a GDate argument. (Note: Internally this stores
-the date in a time64 as created through timespecCanonicalDayTime()). */
+the date in a time64 as created through time64CanonicalDayTime()). */
void gncInvoiceSetDateOpenedGDate (GncInvoice *invoice, const GDate *date);
void gncInvoiceSetDateOpened (GncInvoice *invoice, time64 date);
void gncInvoiceSetDatePosted (GncInvoice *invoice, time64 date);
diff --git a/libgnucash/engine/gncOrder.c b/libgnucash/engine/gncOrder.c
index b80f406..2130e6d 100644
--- a/libgnucash/engine/gncOrder.c
+++ b/libgnucash/engine/gncOrder.c
@@ -257,7 +257,7 @@ gnc_order_class_init (GncOrderClass *klass)
g_param_spec_boxed("date-opened",
"Date Opened",
"The date the order was opened.",
- GNC_TYPE_TIMESPEC,
+ GNC_TYPE_TIME64,
G_PARAM_READWRITE));
g_object_class_install_property
@@ -266,7 +266,7 @@ gnc_order_class_init (GncOrderClass *klass)
g_param_spec_boxed("date-closed",
"Date Closed",
"The date the order was closed.",
- GNC_TYPE_TIMESPEC,
+ GNC_TYPE_TIME64,
G_PARAM_READWRITE));
g_object_class_install_property
diff --git a/libgnucash/engine/kvp-frame.cpp b/libgnucash/engine/kvp-frame.cpp
index b320814..60a46ed 100644
--- a/libgnucash/engine/kvp-frame.cpp
+++ b/libgnucash/engine/kvp-frame.cpp
@@ -261,7 +261,7 @@ gvalue_from_kvp_value (const KvpValue *kval)
{
GValue *val;
gnc_numeric num;
- Timespec tm;
+ Time64 tm;
GDate gdate;
if (kval == NULL) return NULL;
@@ -290,9 +290,9 @@ gvalue_from_kvp_value (const KvpValue *kval)
g_value_init (val, GNC_TYPE_GUID);
g_value_set_boxed (val, kval->get<GncGUID*>());
break;
- case KvpValue::Type::TIMESPEC:
- g_value_init (val, GNC_TYPE_TIMESPEC);
- tm = kval->get<Timespec>();
+ case KvpValue::Type::TIME64:
+ g_value_init (val, GNC_TYPE_TIME64);
+ tm = kval->get<Time64>();
g_value_set_boxed (val, &tm);
break;
case KvpValue::Type::GDATE:
@@ -357,8 +357,8 @@ kvp_value_from_gvalue (const GValue *gval)
if (boxed != nullptr)
val = new KvpValue(guid_copy(static_cast<GncGUID*>(boxed)));
}
- else if (type == GNC_TYPE_TIMESPEC)
- val = new KvpValue(*(Timespec*)g_value_get_boxed (gval));
+ else if (type == GNC_TYPE_TIME64)
+ val = new KvpValue(*(Time64*)g_value_get_boxed (gval));
else if (type == G_TYPE_DATE)
val = new KvpValue(*(GDate*)g_value_get_boxed (gval));
else if (type == GNC_TYPE_VALUE_LIST)
diff --git a/libgnucash/engine/kvp-value.cpp b/libgnucash/engine/kvp-value.cpp
index 990197e..ab2f3be 100644
--- a/libgnucash/engine/kvp-value.cpp
+++ b/libgnucash/engine/kvp-value.cpp
@@ -85,8 +85,8 @@ KvpValueImpl::get_type() const noexcept
return KvpValue::Type::STRING;
else if (datastore.type() == typeid(GncGUID *))
return KvpValue::Type::GUID;
- else if (datastore.type() == typeid(Timespec))
- return KvpValue::Type::TIMESPEC;
+ else if (datastore.type() == typeid(Time64))
+ return KvpValue::Type::TIME64;
else if (datastore.type() == typeid(GList *))
return KvpValue::Type::GLIST;
else if (datastore.type() == typeid(KvpFrameImpl *))
@@ -155,11 +155,11 @@ struct to_string_visitor : boost::static_visitor<void>
output << ")";
}
- void operator()(Timespec val)
+ void operator()(Time64 val)
{
- char tmp1[40] {};
- gnc_timespec_to_iso8601_buff (val, tmp1);
- output << tmp1 << " (timespec)";
+ char tmp1[MAX_DATE_LENGTH + 1] {};
+ gnc_time64_to_iso8601_buff (val.t, tmp1);
+ output << tmp1 << " (time64)";
}
void operator()(gnc_numeric val)
@@ -301,9 +301,9 @@ template <> int compare_visitor::operator()(GncGUID * const & one, GncGUID * con
{
return guid_compare(one, two);
}
-template <> int compare_visitor::operator()(Timespec const & one, Timespec const & two) const
+template <> int compare_visitor::operator()(Time64 const & one, Time64 const & two) const
{
- return timespec_cmp(&one,&two);
+ return one.t < two.t ? -1 : one.t > two.t ? 1 : 0;
}
template <> int compare_visitor::operator()(GDate const & one, GDate const & two) const
{
diff --git a/libgnucash/engine/kvp-value.hpp b/libgnucash/engine/kvp-value.hpp
index 78a8eb7..acc072b 100644
--- a/libgnucash/engine/kvp-value.hpp
+++ b/libgnucash/engine/kvp-value.hpp
@@ -65,7 +65,7 @@ struct KvpValueImpl
NUMERIC, /**< QOF_TYPE_NUMERIC */
STRING, /**< QOF_TYPE_STRING gchar* */
GUID, /**< QOF_TYPE_GUID */
- TIMESPEC, /**< QOF_TYPE_DATE */
+ TIME64, /**< QOF_TYPE_DATE */
PLACEHOLDER_DONT_USE, /* Replaces KVP_TYPE_BINARY */
GLIST, /**< no QOF equivalent. */
FRAME, /**< no QOF equivalent. */
@@ -156,7 +156,7 @@ struct KvpValueImpl
gnc_numeric,
const char*,
GncGUID *,
- Timespec,
+ Time64,
GList *,
KvpFrame *,
GDate> datastore;
diff --git a/libgnucash/engine/kvp_doc.txt b/libgnucash/engine/kvp_doc.txt
index e9f6717..4f36b40 100644
--- a/libgnucash/engine/kvp_doc.txt
+++ b/libgnucash/engine/kvp_doc.txt
@@ -72,7 +72,7 @@ Use: An enumerated identifier indicating how often books are supposed
\verbatim
Name: /book/close-date
-Type: Timespec
+Type: Time64
Entities: Book
Use: The posted closing date of this book. This book only contains
transactions whose posted date is earlier than this closing date.
@@ -98,7 +98,7 @@ Use: The GUID of the book for which this transaction represents the
\verbatim
Name: /book/log-date
-Type: Timespec
+Type: Time64
Entities: Book
Use: A log of the date which the user performed the closing of the book.
\endverbatim
@@ -131,7 +131,7 @@ Use: User-suplied notes for the book. The user can set this to any value
\verbatim
Name: /book/open-date
-Type: Timespec
+Type: Time64
Entities: Book
Use: The posted opening date of this book. This book only contains transactions
whose posted date is later than this closing date.
@@ -254,7 +254,7 @@ Use: When this appears in an account, then it contains the guid of
\verbatim
Name: /gemini/<type>/date
-Type: timespec
+Type: time64
Entities: Account, Book
Use: date that the copy was created.
\endverbatim
@@ -293,7 +293,7 @@ Use: Country code of the bank of HBCI account
\verbatim
Name: /hbci/trans-retrieval
-Type: Timespec
+Type: Time64
Entities: Account
Use: Time of the last statement retrieval through HBCI for this
specific account
@@ -577,7 +577,7 @@ Use: A user-supplied title for the lot. The user can set this to
\verbatim
Name: trans-date-due
-Type: Timespec
+Type: Time64
Entities: Transaction
Use: Accounts/Receivable, Accounts/Payable Due Date.
\endverbatim
diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp
index db5a88b..0ce79c0 100644
--- a/libgnucash/engine/qofinstance.cpp
+++ b/libgnucash/engine/qofinstance.cpp
@@ -1144,8 +1144,9 @@ qof_instance_kvp_add_guid (const QofInstance *inst, const char* path,
g_return_if_fail (inst->kvp_data != NULL);
auto container = new KvpFrame;
+ Time64 t{time.tv_sec};
container->set({key}, new KvpValue(const_cast<GncGUID*>(guid)));
- container->set({"date"}, new KvpValue(time));
+ container->set({"date"}, new KvpValue(t));
delete inst->kvp_data->set_path({path}, new KvpValue(container));
}
diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp
index 9f9d5f9..045ac34 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.cpp
+++ b/libgnucash/engine/test-core/test-engine-stuff.cpp
@@ -324,11 +324,10 @@ get_random_kvp_value_depth (int type, gint depth)
}
break;
- case KvpValue::Type::TIMESPEC:
+ case KvpValue::Type::TIME64:
{
- Timespec *ts = get_random_timespec();
- ret = new KvpValue(*ts);
- g_free(ts);
+ time64 t = get_random_time();
+ ret = new KvpValue(t);
}
break;
diff --git a/libgnucash/engine/test/test-engine-kvp-properties.c b/libgnucash/engine/test/test-engine-kvp-properties.c
index f857e5d..baddd35 100644
--- a/libgnucash/engine/test/test-engine-kvp-properties.c
+++ b/libgnucash/engine/test/test-engine-kvp-properties.c
@@ -144,8 +144,8 @@ test_account_kvp_properties (Fixture *fixture, gconstpointer pData)
gchar *online_id_r, *ab_acct_id_r, *ab_bank_code_r;
GncGUID *ofx_income_acct = guid_malloc ();
GncGUID *ofx_income_acct_r;
- Timespec trans_retr = timespec_now ();
- Timespec *trans_retr_r;
+ Time64 trans_retr = {gnc_time(NULL)};
+ Time64 *trans_retr_r;
xaccAccountBeginEdit (fixture->acct);
qof_instance_set (QOF_INSTANCE (fixture->acct),
@@ -176,7 +176,7 @@ test_account_kvp_properties (Fixture *fixture, gconstpointer pData)
g_assert_cmpstr (ab_acct_id, ==, ab_acct_id_r);
g_assert_cmpstr (ab_bank_code, ==, ab_bank_code_r);
g_assert_cmpint (ab_acct_uid, ==, ab_acct_uid_r);
- g_assert (timespec_equal (&trans_retr, trans_retr_r));
+ g_assert_cmpint (trans_retr.t, ==, trans_retr_r->t);
g_assert (!qof_instance_is_dirty (QOF_INSTANCE (fixture->acct)));
}
diff --git a/libgnucash/engine/test/test-kvp-value.cpp b/libgnucash/engine/test/test-kvp-value.cpp
index f564fe3..b89a408 100644
--- a/libgnucash/engine/test/test-kvp-value.cpp
+++ b/libgnucash/engine/test/test-kvp-value.cpp
@@ -55,14 +55,14 @@ TEST (KvpValueTest, Equality)
v2 = std::unique_ptr<KvpValueImpl> {new KvpValueImpl {guid_copy (guid)}};
EXPECT_EQ (compare (*v1, *v2), 0);
- v1 = std::unique_ptr<KvpValueImpl> {new KvpValueImpl {timespec_now ()}};
+ v1 = std::unique_ptr<KvpValueImpl> {new KvpValueImpl {gnc_time(nullptr)}};
v2 = std::unique_ptr<KvpValueImpl> {new KvpValueImpl {*v1}};
EXPECT_EQ (compare (*v1, *v2), 0);
}
TEST (KvpValueTest, Add)
{
- auto v3 = new KvpValueImpl {timespec_now ()};
+ auto v3 = new KvpValueImpl {gnc_time(nullptr)};
auto v4 = new KvpValueImpl {*v3};
auto new_one = v3->add (v4);
EXPECT_NE (new_one, v3);
diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp
index 23bff9b..bbf296f 100644
--- a/libgnucash/engine/test/utest-Split.cpp
+++ b/libgnucash/engine/test/utest-Split.cpp
@@ -201,7 +201,8 @@ test_gnc_split_set_get_property ()
Account *acc = xaccMallocAccount (book), *racc = NULL;
GNCLot *lot = gnc_lot_new (book), *rlot = NULL;
Split *split = xaccMallocSplit (book);
- Timespec time = timespec_now (), *rtime;
+ time64 time = gnc_time(nullptr);
+ Time64 t = {time}, *rtime;
char *r_action, *r_memo;
gnc_numeric value = gnc_numeric_create (123, 100);
gnc_numeric amount = gnc_numeric_create (321, 100);
@@ -218,7 +219,7 @@ test_gnc_split_set_get_property ()
"memo", "bar",
"value", &value,
"amount", &amount,
- "reconcile-date", &time,
+ "reconcile-date", &t,
"account", acc,
"lot", lot,
"transaction", txn,
@@ -240,7 +241,7 @@ test_gnc_split_set_get_property ()
g_assert (gnc_numeric_equal (*r_value, value));
/* Setting the transaction causes the amount to be scrubbed into the value */
g_assert (gnc_numeric_equal (*r_amount, value));
- g_assert (timespec_equal (rtime, &time));
+ g_assert_cmpint (rtime->t, ==, time);
g_assert (txn == rtxn);
g_assert (acc == racc);
g_assert (lot == rlot);
commit b60aef9d2a5f793227c58c302345975c28a6c774
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jul 31 16:19:39 2018 -0700
Remove timespec2dmy.
It had only two uses and one was in a test. Replace those calls with
gnc_localtime_r.
diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h
index 2b34ae3..ce00801 100644
--- a/libgnucash/engine/gnc-date.h
+++ b/libgnucash/engine/gnc-date.h
@@ -415,15 +415,6 @@ time64 gnc_iso8601_to_time64_gmt(const gchar *);
*/
gchar * gnc_timespec_to_iso8601_buff (Timespec ts, gchar * buff);
gchar * gnc_time64_to_iso8601_buff (time64, char * buff);
-
-/** Set the proleptic Gregorian day, month, and year from a Timespec
- * \param ts: input timespec
- * \param day: output day, 1 - 31
- * \param month: output month, 1 - 12
- * \param year: output year, 0001 - 9999 CE
- */
-void gnc_timespec2dmy (Timespec ts, gint *day, gint *month, gint *year);
-
// @}
/* ======================================================== */
diff --git a/libgnucash/engine/gncBillTerm.c b/libgnucash/engine/gncBillTerm.c
index 525d8f1..73e19d7 100644
--- a/libgnucash/engine/gncBillTerm.c
+++ b/libgnucash/engine/gncBillTerm.c
@@ -753,15 +753,18 @@ gboolean gncBillTermIsDirty (const GncBillTerm *term)
*
*/
static void
-compute_monthyear (const GncBillTerm *term, Timespec post_date,
+compute_monthyear (const GncBillTerm *term, time64 post_date,
int *month, int *year)
{
int iday, imonth, iyear;
+ struct tm tm;
int cutoff = term->cutoff;
g_return_if_fail (term->type == GNC_TERM_TYPE_PROXIMO);
-
- gnc_timespec2dmy (post_date, &iday, &imonth, &iyear);
+ gnc_localtime_r (&post_date, &tm);
+ iday = tm.tm_mday;
+ imonth = tm.tm_mon + 1;
+ iyear = tm.tm_year + 1;
if (cutoff <= 0)
cutoff += gnc_date_get_last_mday (imonth - 1, iyear);
@@ -810,7 +813,7 @@ compute_time (const GncBillTerm *term, Timespec post_date, int days)
res.tv_sec += (SECS_PER_DAY * days);
break;
case GNC_TERM_TYPE_PROXIMO:
- compute_monthyear (term, post_date, &month, &year);
+ compute_monthyear (term, post_date.tv_sec, &month, &year);
day = gnc_date_get_last_mday (month - 1, year);
if (days < day)
day = days;
diff --git a/libgnucash/engine/test/test-date.cpp b/libgnucash/engine/test/test-date.cpp
index 9014fcd..86f802d 100644
--- a/libgnucash/engine/test/test-date.cpp
+++ b/libgnucash/engine/test/test-date.cpp
@@ -82,15 +82,19 @@ static gboolean
check_conversion (const char * str, Timespec expected_ts)
{
Timespec ts;
+ struct tm tm;
int day, month, year;
GDate d1, d2;
ts = {gnc_iso8601_to_time64_gmt (str), 0};
- // We test the conversion to GDate against the timespec2dmy
+ // We test the conversion to GDate against the gnc_localtime_r
// conversion, and also the conversion back to timespec and again
// to GDate so that it is still the original GDate
- gnc_timespec2dmy(ts, &day, &month, &year);
+ gnc_localtime_r (&ts.tv_sec, &tm);
+ day = tm.tm_mday;
+ month = tm.tm_mon + 1;
+ year = tm.tm_year + 1900;
d1 = timespec_to_gdate(ts);
d2 = timespec_to_gdate(gdate_to_timespec(d1));
if ((g_date_compare(&d1, &d2) != 0)
diff --git a/libgnucash/engine/test/test-gnc-date.c b/libgnucash/engine/test/test-gnc-date.c
index b262ff6..c084b3d 100644
--- a/libgnucash/engine/test/test-gnc-date.c
+++ b/libgnucash/engine/test/test-gnc-date.c
@@ -1738,54 +1738,7 @@ test_gnc_timespec_to_iso8601_buff (FixtureA *f, gconstpointer pData)
g_assert_cmpstr (buff, ==, time_str);
g_free (time_str);
}
-/* gnc_timespec2dmy
-void
-gnc_timespec2dmy (Timespec t, int *day, int *month, int *year)// C: 1 Local: 0:0:0
-*/
-static void
-test_gnc_timespec2dmy (FixtureA *f, gconstpointer pData)
-{
- struct tm tm;
- int day, r_day, mo, r_mo, yr, r_yr;
-
-
- gnc_timespec2dmy (f->ts0, &r_day, &r_mo, &r_yr);
- gnc_localtime_r (&f->ts0.tv_sec, &tm);
- g_assert_cmpint (r_day, ==, tm.tm_mday);
- g_assert_cmpint (r_mo, ==, tm.tm_mon + 1);
- g_assert_cmpint (r_yr, ==, tm.tm_year + 1900);
-
- gnc_timespec2dmy (f->ts1, &r_day, &r_mo, &r_yr);
- gnc_localtime_r (&f->ts1.tv_sec, &tm);
- g_assert_cmpint (r_day, ==, tm.tm_mday);
- g_assert_cmpint (r_mo, ==, tm.tm_mon + 1);
- g_assert_cmpint (r_yr, ==, tm.tm_year + 1900);
-
- gnc_timespec2dmy (f->ts2, &r_day, &r_mo, &r_yr);
- gnc_localtime_r (&f->ts2.tv_sec, &tm);
- g_assert_cmpint (r_day, ==, tm.tm_mday);
- g_assert_cmpint (r_mo, ==, tm.tm_mon + 1);
- g_assert_cmpint (r_yr, ==, tm.tm_year + 1900);
-
- gnc_timespec2dmy (f->ts3, &r_day, &r_mo, &r_yr);
- gnc_localtime_r (&f->ts3.tv_sec, &tm);
- g_assert_cmpint (r_day, ==, tm.tm_mday);
- g_assert_cmpint (r_mo, ==, tm.tm_mon + 1);
- g_assert_cmpint (r_yr, ==, tm.tm_year + 1900);
-
- gnc_timespec2dmy (f->ts4, &r_day, &r_mo, &r_yr);
- gnc_localtime_r (&f->ts4.tv_sec, &tm);
- g_assert_cmpint (r_day, ==, tm.tm_mday);
- g_assert_cmpint (r_mo, ==, tm.tm_mon + 1);
- g_assert_cmpint (r_yr, ==, tm.tm_year + 1900);
-
- gnc_timespec2dmy (f->ts5, &r_day, &r_mo, &r_yr);
- gnc_localtime_r (&f->ts5.tv_sec, &tm);
- g_assert_cmpint (r_day, ==, tm.tm_mday);
- g_assert_cmpint (r_mo, ==, tm.tm_mon + 1);
- g_assert_cmpint (r_yr, ==, tm.tm_year + 1900);
-}
/* gnc_dmy2timespec_internal
static Timespec
gnc_dmy2timespec_internal (int day, int month, int year, gboolean start_of_day)// Local: 2:0:0
@@ -2259,7 +2212,6 @@ test_suite_gnc_date (void)
GNC_TEST_ADD_FUNC (suitename, "gnc_date_timestamp", test_gnc_date_timestamp);
GNC_TEST_ADD (suitename, "gnc iso8601 to time64 gmt", FixtureA, NULL, setup, test_gnc_iso8601_to_time64_gmt, NULL);
GNC_TEST_ADD (suitename, "gnc timespec to iso8601 buff", FixtureA, NULL, setup, test_gnc_timespec_to_iso8601_buff, NULL);
- GNC_TEST_ADD (suitename, "gnc timespec2dmy", FixtureA, NULL, setup, test_gnc_timespec2dmy, NULL);
// GNC_TEST_ADD_FUNC (suitename, "gnc dmy2timespec internal", test_gnc_dmy2timespec_internal);
GNC_TEST_ADD (suitename, "gnc dmy2timespec", FixtureB, NULL, setup_begin, test_gnc_dmy2timespec, NULL);
commit 6f89bd62b3cf7089fb10c1c1ed908f0d9b5cc31c
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jul 31 14:43:27 2018 -0700
Remove timespec from gnucash/gnome.
With a little API bleed into engine.
diff --git a/gnucash/gnome/assistant-acct-period.c b/gnucash/gnome/assistant-acct-period.c
index 87a503a..06e9bb4 100644
--- a/gnucash/gnome/assistant-acct-period.c
+++ b/gnucash/gnome/assistant-acct-period.c
@@ -465,7 +465,6 @@ ap_assistant_finish (GtkAssistant *assistant, gpointer user_data)
gint len;
const char *btitle;
char *bnotes;
- Timespec closing_date;
ENTER("info=%p", info);
@@ -478,8 +477,6 @@ ap_assistant_finish (GtkAssistant *assistant, gpointer user_data)
bnotes = gtk_text_buffer_get_text(buffer, &startiter, &enditer , 0);
PINFO("Book title is - %s\n", btitle);
- timespecFromTime64 (&closing_date,
- gnc_time64_get_day_end_gdate (&info->closing_date));
g_free(bnotes);
/* Report the status back to the user. */
diff --git a/gnucash/gnome/assistant-stock-split.c b/gnucash/gnome/assistant-stock-split.c
index 287a437..77fb8b3 100644
--- a/gnucash/gnome/assistant-stock-split.c
+++ b/gnucash/gnome/assistant-stock-split.c
@@ -388,19 +388,14 @@ gnc_stock_split_assistant_finish (GtkAssistant *assistant,
GNCPrice *price;
GNCPriceDB *pdb;
GNCCurrencyEdit *ce;
- Timespec ts;
ce = GNC_CURRENCY_EDIT (info->price_currency_edit);
-
- ts.tv_sec = date;
- ts.tv_nsec = 0;
-
price = gnc_price_create (gnc_get_current_book ());
gnc_price_begin_edit (price);
gnc_price_set_commodity (price, xaccAccountGetCommodity (account));
gnc_price_set_currency (price, gnc_currency_edit_get_currency (ce));
- gnc_price_set_time (price, ts);
+ gnc_price_set_time64 (price, date);
gnc_price_set_source (price, PRICE_SOURCE_STOCK_SPLIT);
gnc_price_set_typestr (price, PRICE_TYPE_UNK);
gnc_price_set_value (price, amount);
diff --git a/gnucash/gnome/dialog-date-close.c b/gnucash/gnome/dialog-date-close.c
index 6a34d80..977a637 100644
--- a/gnucash/gnome/dialog-date-close.c
+++ b/gnucash/gnome/dialog-date-close.c
@@ -45,7 +45,7 @@ typedef struct _dialog_date_close_window
GtkWidget *memo_entry;
GtkWidget *question_check;
GncBillTerm *terms;
- Timespec *ts, *ts2;
+ time64 t, t2;
GList * acct_types;
GList * acct_commodities;
QofBook *book;
@@ -87,14 +87,14 @@ gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data)
}
if (ddc->post_date)
- ddc->ts2->tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->post_date));
+ ddc->t2 = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->post_date));
if (ddc->date)
{
if (ddc->terms)
- ddc->ts->tv_sec = gncBillTermComputeDueDate (ddc->terms, ddc->ts2->tv_sec);
+ ddc->t = gncBillTermComputeDueDate (ddc->terms, ddc->t2);
else
- ddc->ts->tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->date));
+ ddc->t = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->date));
}
if (ddc->memo_entry && ddc->memo)
@@ -122,7 +122,7 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
const char *label_message,
gboolean ok_is_default,
/* Returned data ... */
- Timespec *ts)
+ time64 *t)
{
DialogDateClose *ddc;
GtkWidget *date_box;
@@ -130,11 +130,11 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
GtkBuilder *builder;
gboolean retval;
- if (!message || !label_message || !ts)
+ if (!message || !label_message || !t)
return FALSE;
ddc = g_new0 (DialogDateClose, 1);
- ddc->ts = ts;
+ ddc->t = *t;
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "dialog-date-close.glade", "date_close_dialog");
@@ -146,7 +146,7 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
date_box = GTK_WIDGET(gtk_builder_get_object (builder, "date_box"));
ddc->date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
gtk_box_pack_start (GTK_BOX(date_box), ddc->date, TRUE, TRUE, 0);
- gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), ts->tv_sec);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), *t);
if (parent)
gtk_window_set_transient_for (GTK_WINDOW(ddc->dialog), GTK_WINDOW(parent));
@@ -203,7 +203,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
GList * acct_types, GList * acct_commodities,
QofBook *book, GncBillTerm *terms,
/* Returned Data... */
- Timespec *ddue, Timespec *post,
+ time64 *ddue, time64 *post,
char **memo, Account **acct, gboolean *answer)
{
DialogDateClose *ddc;
@@ -220,8 +220,8 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
return FALSE;
ddc = g_new0 (DialogDateClose, 1);
- ddc->ts = ddue;
- ddc->ts2 = post;
+ ddc->t = *ddue;
+ ddc->t2 = *post;
ddc->book = book;
ddc->acct_types = acct_types;
ddc->acct_commodities = acct_commodities;
@@ -278,7 +278,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
/* Set the post date widget */
- gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->post_date), post->tv_sec);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->post_date), *post);
/* Deal with the terms handling of the due date */
if (terms)
@@ -289,7 +289,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
post_date_changed_cb (GNC_DATE_EDIT (ddc->post_date), ddc);
}
else
- gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), ddue->tv_sec);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), *ddue);
/* Setup the account widget */
fill_in_acct_info (ddc, set_default_acct);
@@ -329,7 +329,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
gboolean ok_is_default,
GList * acct_types, QofBook *book,
/* Returned Data... */
- Timespec *date, Account **acct)
+ time64 *date, Account **acct)
{
DialogDateClose *ddc;
GtkLabel *label;
@@ -343,7 +343,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
return FALSE;
ddc = g_new0 (DialogDateClose, 1);
- ddc->ts = date;
+ ddc->t = *date;
ddc->book = book;
ddc->acct_types = acct_types;
ddc->acct = *acct;
@@ -378,7 +378,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
gtk_label_set_text (label, acct_label_message);
/* Set the date widget */
- gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), date->tv_sec);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), *date);
/* Setup the account widget */
fill_in_acct_info (ddc, FALSE);
diff --git a/gnucash/gnome/dialog-date-close.h b/gnucash/gnome/dialog-date-close.h
index 03d33f0..757113e 100644
--- a/gnucash/gnome/dialog-date-close.h
+++ b/gnucash/gnome/dialog-date-close.h
@@ -33,7 +33,7 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
const char *label_message,
gboolean ok_is_default,
/* Returned data ... */
- Timespec *date);
+ time64 *date);
/*
@@ -55,7 +55,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
GList * acct_types, GList * acct_commodities,
QofBook *book, GncBillTerm *terms,
/* Returned Data... */
- Timespec *ddue, Timespec *post,
+ time64 *ddue, time64 *post,
char **memo, Account **acct, gboolean *answer);
@@ -66,6 +66,6 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
gboolean ok_is_default,
GList * acct_types, QofBook *book,
/* Returned Data... */
- Timespec *date, Account **acct);
+ time64 *date, Account **acct);
#endif /* _DIALOG_DATE_CLOSE_H */
diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index f1cb06a..8c2ece9 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -686,7 +686,7 @@ gnc_invoice_window_printCB (GtkWindow* parent, gpointer data)
static gboolean
gnc_dialog_post_invoice(InvoiceWindow *iw, char *message,
- Timespec *ddue, Timespec *postdate,
+ time64 *ddue, time64 *postdate,
char **memo, Account **acc, gboolean *accumulate)
{
GncInvoice *invoice;
@@ -719,17 +719,17 @@ gnc_dialog_post_invoice(InvoiceWindow *iw, char *message,
* For Vendor Bills and Employee Vouchers
* that would be the date of the most recent invoice entry.
* Failing that, today is used as a fallback */
- *postdate = timespec_now();
+ *postdate = gnc_time(NULL);
if (entries && ((gncInvoiceGetOwnerType (invoice) == GNC_OWNER_VENDOR) ||
(gncInvoiceGetOwnerType (invoice) == GNC_OWNER_EMPLOYEE)))
{
- postdate->tv_sec = gncEntryGetDate ((GncEntry*)entries->data);
+ *postdate = gncEntryGetDate ((GncEntry*)entries->data);
for (entries_iter = entries; entries_iter != NULL; entries_iter = g_list_next(entries_iter))
{
time64 entrydate = gncEntryGetDate ((GncEntry*)entries_iter->data);
- if (entrydate > postdate->tv_sec)
- postdate->tv_sec = entrydate;
+ if (entrydate > *postdate)
+ *postdate = entrydate;
}
}
@@ -758,8 +758,8 @@ gnc_dialog_post_invoice(InvoiceWindow *iw, char *message,
struct post_invoice_params
{
- Timespec ddue; /* Due date */
- Timespec postdate; /* Date posted */
+ time64 ddue; /* Due date */
+ time64 postdate; /* Date posted */
char *memo; /* Memo for posting transaction */
Account *acc; /* Account to post to */
gboolean accumulate; /* Whether to accumulate splits */
@@ -772,7 +772,7 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
GncInvoice *invoice;
char *message, *memo;
Account *acc = NULL;
- Timespec ddue, postdate;
+ time64 ddue, postdate;
gboolean accumulate;
QofInstance *owner_inst;
const char *text;
@@ -873,7 +873,7 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
xfer = gnc_xfer_dialog (iw_get_window(iw), acc);
gnc_xfer_dialog_is_exchange_dialog(xfer, &exch_rate);
gnc_xfer_dialog_select_to_currency(xfer, account_currency);
- gnc_xfer_dialog_set_date (xfer, timespecToTime64 (postdate));
+ gnc_xfer_dialog_set_date (xfer, postdate);
/* Even if amount is 0 ask for an exchange rate. It's required
* for the transaction generating code. Use an amount of 1 in
* that case as the dialog won't allow to specify an exchange
@@ -913,7 +913,7 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
gnc_price_begin_edit (convprice);
gnc_price_set_commodity (convprice, account_currency);
gnc_price_set_currency (convprice, gncInvoiceGetCurrency (invoice));
- gnc_price_set_time (convprice, postdate);
+ gnc_price_set_time64 (convprice, postdate);
gnc_price_set_source (convprice, PRICE_SOURCE_TEMP);
gnc_price_set_typestr (convprice, PRICE_TYPE_LAST);
gnc_price_set_value (convprice, exch_rate);
@@ -948,7 +948,7 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
else
auto_pay = gnc_prefs_get_bool (GNC_PREFS_GROUP_BILL, GNC_PREF_AUTO_PAY);
- gncInvoicePostToAccount (invoice, acc, postdate.tv_sec, ddue.tv_sec, memo, accumulate, auto_pay);
+ gncInvoicePostToAccount (invoice, acc, postdate, ddue, memo, accumulate, auto_pay);
cleanup:
gncInvoiceCommitEdit (invoice);
diff --git a/gnucash/gnome/dialog-order.c b/gnucash/gnome/dialog-order.c
index 1cb7cb9..0c9bfbe 100644
--- a/gnucash/gnome/dialog-order.c
+++ b/gnucash/gnome/dialog-order.c
@@ -261,7 +261,7 @@ gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data)
GList *entries;
char *message, *label;
gboolean non_inv = FALSE;
- Timespec ts = {gnc_time (NULL), 0};
+ time64 t = gnc_time (NULL);
/* Make sure the order is ok */
if (!gnc_order_window_verify_ok (ow))
@@ -310,10 +310,10 @@ gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data)
message = _("Do you really want to close the order?");
label = _("Close Date");
- if (!gnc_dialog_date_close_parented (ow->dialog, message, label, TRUE, &ts))
+ if (!gnc_dialog_date_close_parented (ow->dialog, message, label, TRUE, &t))
return;
- gncOrderSetDateClosed (order, ts.tv_nsec);
+ gncOrderSetDateClosed (order, t);
/* save it off */
gnc_order_window_ok_save (ow);
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index ee6d20c..39465a8 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -921,7 +921,7 @@ gnc_payment_ok_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
{
const char *memo, *num;
GDate date;
- Timespec ts;
+ time64 t;
gnc_numeric exch = gnc_numeric_create(1, 1); //default to "one to one" rate
GList *selected_lots = NULL;
GtkTreeSelection *selection;
@@ -932,7 +932,7 @@ gnc_payment_ok_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
num = gtk_entry_get_text (GTK_ENTRY (pw->num_entry));
g_date_clear (&date, 1);
gnc_date_edit_get_gdate (GNC_DATE_EDIT (pw->date_edit), &date);
- ts = gdate_to_timespec (date);
+ t = gdate_to_time64 (date);
/* Obtain the list of selected lots (documents/payments) from the dialog */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(pw->docs_list_tree_view));
@@ -974,8 +974,8 @@ gnc_payment_ok_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
auto_pay = gnc_prefs_get_bool (GNC_PREFS_GROUP_BILL, GNC_PREF_AUTO_PAY);
gncOwnerApplyPayment (&pw->owner, &(pw->tx_info->txn), selected_lots,
- pw->post_acct, pw->xfer_acct, pw->amount_tot, exch,
- ts, memo, num, auto_pay);
+ pw->post_acct, pw->xfer_acct, pw->amount_tot,
+ exch, t, memo, num, auto_pay);
}
gnc_resume_gui_refresh ();
diff --git a/gnucash/gnome/dialog-price-edit-db.c b/gnucash/gnome/dialog-price-edit-db.c
index 4fdcc09..99835f9 100644
--- a/gnucash/gnome/dialog-price-edit-db.c
+++ b/gnucash/gnome/dialog-price-edit-db.c
@@ -223,7 +223,7 @@ gnc_prices_dialog_remove_clicked (GtkWidget *widget, gpointer data)
/** Enumeration for the price delete list-store */
enum GncPriceColumn {PRICED_FULL_NAME, PRICED_COMM, PRICED_DATE, PRICED_COUNT};
-static Timespec
+static time64
gnc_prices_dialog_load_view (GtkTreeView *view, GNCPriceDB *pdb)
{
GtkTreeModel *model = gtk_tree_view_get_model (view);
@@ -234,8 +234,7 @@ gnc_prices_dialog_load_view (GtkTreeView *view, GNCPriceDB *pdb)
GList *commodity_list = NULL;
GtkTreeIter iter;
- Timespec oldest_ts = timespec_now ();
- oldest_ts.tv_nsec = 0;
+ time64 oldest = gnc_time (NULL);
namespace_list = g_list_first (namespace_list);
while (namespace_list != NULL)
@@ -256,14 +255,13 @@ gnc_prices_dialog_load_view (GtkTreeView *view, GNCPriceDB *pdb)
PriceList *list = gnc_pricedb_get_prices (pdb, tmp_commodity, NULL);
GList *node = g_list_last (list);
GNCPrice *price = (GNCPrice*)node->data;
- Timespec price_ts = gnc_price_get_time (price);
+ time64 price_time = gnc_price_get_time64 (price);
const gchar *name_str = gnc_commodity_get_printname (tmp_commodity);
gchar *date_str, *num_str;
+ if (oldest > price_time)
+ oldest = price_time;
- if (timespec_cmp(&oldest_ts, &price_ts) >= 0)
- oldest_ts.tv_sec = price_ts.tv_sec;
-
- date_str = g_strdup (gnc_print_date (price_ts));
+ date_str = qof_print_date (price_time);
num_str = g_strdup_printf ("%d", num);
gtk_list_store_append (GTK_LIST_STORE(model), &iter);
@@ -282,7 +280,7 @@ gnc_prices_dialog_load_view (GtkTreeView *view, GNCPriceDB *pdb)
g_list_free (commodity_list);
g_list_free (namespace_list);
- return oldest_ts;
+ return oldest;
}
static GList *
@@ -371,15 +369,16 @@ selection_changed_cb (GtkTreeSelection *selection, gpointer data)
static GDate
get_fiscal_end_date (void)
{
- Timespec ts_end;
- GDate f_end;
-
- timespecFromTime64 (&ts_end, gnc_accounting_period_fiscal_end());
- f_end = timespec_to_gdate (ts_end);
+ time64 end;
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, 0, sizeof(datebuff));
+ end = gnc_accounting_period_fiscal_end();
+ qof_print_date_buff(datebuff, sizeof(datebuff),
+ gnc_accounting_period_fiscal_end());
+ PINFO("Fiscal end date is %s", datebuff);
- PINFO("Fiscal end date is %s", qof_print_date (gnc_accounting_period_fiscal_end()));
+ return time64_to_gdate (end);
- return f_end;
}
void
@@ -393,7 +392,7 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
GtkTreeSelection *selection;
GtkTreeViewColumn *tree_column;
GtkCellRenderer *cr;
- Timespec first_ts;
+ time64 first;
gint result;
ENTER(" ");
@@ -430,7 +429,7 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
gtk_cell_renderer_set_alignment (cr, 0.5, 0.5);
// Load the view and get the earliest date
- first_ts = gnc_prices_dialog_load_view (pdb_dialog->remove_view, pdb_dialog->price_db);
+ first = gnc_prices_dialog_load_view (pdb_dialog->remove_view, pdb_dialog->price_db);
gtk_tree_selection_select_all (selection);
g_signal_connect (selection, "changed", G_CALLBACK(selection_changed_cb), pdb_dialog);
@@ -455,7 +454,7 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
// Are you sure you want to delete the entries and we have commodities
if ((g_list_length (comm_list) != 0) && (gnc_verify_dialog (GTK_WINDOW (pdb_dialog->remove_dialog), FALSE, fmt, NULL)))
{
- Timespec last_ts;
+ time64 last;
GDate fiscal_end_date = get_fiscal_end_date ();
PriceRemoveSourceFlags source = PRICE_REMOVE_SOURCE_FQ;
PriceRemoveKeepOptions keep = PRICE_REMOVE_KEEP_NONE;
@@ -466,8 +465,7 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
gtk_tree_view_set_model (GTK_TREE_VIEW(pdb_dialog->price_tree), NULL);
DEBUG("deleting prices");
- last_ts.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (date));
- last_ts.tv_nsec = 0;
+ last = gnc_date_edit_get_date (GNC_DATE_EDIT (date));
button = GTK_WIDGET(gtk_builder_get_object (builder, "radiobutton_last_week"));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
@@ -486,23 +484,29 @@ gnc_prices_dialog_remove_old_clicked (GtkWidget *widget, gpointer data)
keep = PRICE_REMOVE_KEEP_SCALED;
if (keep != PRICE_REMOVE_KEEP_SCALED)
- gnc_pricedb_remove_old_prices (pdb_dialog->price_db, comm_list, &fiscal_end_date,
- last_ts, pdb_dialog->remove_source, keep);
+ gnc_pricedb_remove_old_prices (pdb_dialog->price_db, comm_list,
+ &fiscal_end_date,
+ last, pdb_dialog->remove_source,
+ keep);
else
{
- Timespec tmp_ts;
- GDate tmp_date = timespec_to_gdate (last_ts);
+ time64 tmp;
+ GDate tmp_date = time64_to_gdate (last);
g_date_subtract_months (&tmp_date, 6);
- tmp_ts = gdate_to_timespec (tmp_date);
+ tmp = gdate_to_time64 (tmp_date);
- gnc_pricedb_remove_old_prices (pdb_dialog->price_db, comm_list, &fiscal_end_date, tmp_ts,
- pdb_dialog->remove_source, PRICE_REMOVE_KEEP_LAST_WEEKLY);
+ gnc_pricedb_remove_old_prices (pdb_dialog->price_db, comm_list,
+ &fiscal_end_date, tmp,
+ pdb_dialog->remove_source,
+ PRICE_REMOVE_KEEP_LAST_WEEKLY);
g_date_subtract_months (&tmp_date, 6);
- tmp_ts = gdate_to_timespec (tmp_date);
+ tmp = gdate_to_time64 (tmp_date);
- gnc_pricedb_remove_old_prices (pdb_dialog->price_db, comm_list, &fiscal_end_date, tmp_ts,
- pdb_dialog->remove_source, PRICE_REMOVE_KEEP_LAST_MONTHLY);
+ gnc_pricedb_remove_old_prices (pdb_dialog->price_db, comm_list,
+ &fiscal_end_date, tmp,
+ pdb_dialog->remove_source,
+ PRICE_REMOVE_KEEP_LAST_MONTHLY);
}
// reconnect the model to the price treeview
gtk_tree_view_set_model (GTK_TREE_VIEW(pdb_dialog->price_tree), model);
diff --git a/gnucash/gnome/dialog-price-editor.c b/gnucash/gnome/dialog-price-editor.c
index 5b474c6..e6ccfa1 100644
--- a/gnucash/gnome/dialog-price-editor.c
+++ b/gnucash/gnome/dialog-price-editor.c
@@ -143,7 +143,7 @@ price_to_gui (PriceEditDialog *pedit_dialog)
const char *source;
const char *type;
gnc_numeric value;
- Timespec date;
+ time64 date;
if (pedit_dialog->price)
{
@@ -160,7 +160,7 @@ price_to_gui (PriceEditDialog *pedit_dialog)
name_space, fullname);
currency = gnc_price_get_currency (pedit_dialog->price);
- date = gnc_price_get_time (pedit_dialog->price);
+ date = gnc_price_get_time64 (pedit_dialog->price);
source = gnc_price_get_source_string (pedit_dialog->price);
type = gnc_price_get_typestr (pedit_dialog->price);
value = gnc_price_get_value (pedit_dialog->price);
@@ -168,8 +168,7 @@ price_to_gui (PriceEditDialog *pedit_dialog)
else
{
currency = gnc_default_currency ();
- date.tv_sec = gnc_time (NULL);
- date.tv_nsec = 0;
+ date = gnc_time (NULL);
source = "user:price-editor"; //Sync with source_names in gnc-pricedb.c
type = "";
value = gnc_numeric_zero ();
@@ -182,7 +181,7 @@ price_to_gui (PriceEditDialog *pedit_dialog)
(GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
}
- gnc_date_edit_set_time (GNC_DATE_EDIT (pedit_dialog->date_edit), date.tv_sec);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (pedit_dialog->date_edit), date);
gtk_entry_set_text (GTK_ENTRY (pedit_dialog->source_entry), source);
@@ -203,7 +202,7 @@ gui_to_price (PriceEditDialog *pedit_dialog)
const char *source;
const char *type;
gnc_numeric value;
- Timespec date;
+ time64 date;
name_space = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbwe);
fullname = gtk_entry_get_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN( GTK_COMBO_BOX(pedit_dialog->commodity_cbwe)))));
@@ -217,8 +216,7 @@ gui_to_price (PriceEditDialog *pedit_dialog)
if (!currency)
return _("You must select a Currency.");
- date.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
- date.tv_nsec = 0;
+ date = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
source = gtk_entry_get_text (GTK_ENTRY (pedit_dialog->source_entry));
@@ -236,7 +234,7 @@ gui_to_price (PriceEditDialog *pedit_dialog)
gnc_price_begin_edit (pedit_dialog->price);
gnc_price_set_commodity (pedit_dialog->price, commodity);
gnc_price_set_currency (pedit_dialog->price, currency);
- gnc_price_set_time (pedit_dialog->price, date);
+ gnc_price_set_time64 (pedit_dialog->price, date);
gnc_price_set_source_string (pedit_dialog->price, source);
gnc_price_set_typestr (pedit_dialog->price, type);
gnc_price_set_value (pedit_dialog->price, value);
diff --git a/gnucash/gnome/dialog-trans-assoc.c b/gnucash/gnome/dialog-trans-assoc.c
index 9429a32..0c1eab8 100644
--- a/gnucash/gnome/dialog-trans-assoc.c
+++ b/gnucash/gnome/dialog-trans-assoc.c
@@ -336,11 +336,12 @@ get_trans_info (AssocDialog *assoc_dialog)
{
gchar *uri_u;
gboolean rel = FALSE;
- Timespec ts = {xaccTransRetDatePosted (trans),0};
-
- if (ts.tv_sec == 0)
- ts.tv_sec = gnc_time (NULL);
-
+ time64 t = xaccTransRetDatePosted (trans);
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, 0, sizeof(datebuff));
+ if (t == 0)
+ t = gnc_time (NULL);
+ qof_print_date_buff (datebuff, sizeof(datebuff), t);
gtk_list_store_append (GTK_LIST_STORE(model), &iter);
if (g_str_has_prefix (uri,"file:/") && !g_str_has_prefix (uri,"file://")) // path is relative
@@ -349,7 +350,7 @@ get_trans_info (AssocDialog *assoc_dialog)
uri_u = convert_uri_to_unescaped (assoc_dialog, uri);
gtk_list_store_set (GTK_LIST_STORE(model), &iter,
- DATE_TRANS, gnc_print_date (ts),
+ DATE_TRANS, datebuff,
DESC_TRANS, xaccTransGetDescription (trans),
URI_U, uri_u, AVAILABLE, _("Unknown"),
URI_SPLIT, split, URI, uri,
diff --git a/libgnucash/engine/gnc-pricedb.c b/libgnucash/engine/gnc-pricedb.c
index daa0aa7..d148570 100644
--- a/libgnucash/engine/gnc-pricedb.c
+++ b/libgnucash/engine/gnc-pricedb.c
@@ -1327,7 +1327,7 @@ gnc_pricedb_remove_price(GNCPriceDB *db, GNCPrice *p)
typedef struct
{
GNCPriceDB *db;
- Timespec cutoff;
+ time64 cutoff;
gboolean delete_fq;
gboolean delete_user;
gboolean delete_app;
@@ -1365,7 +1365,7 @@ check_one_price_date (GNCPrice *price, gpointer user_data)
gnc_timespec_to_iso8601_buff(pt , buf);
DEBUG("checking date %s", buf);
}
- if (timespec_cmp (&pt, &data->cutoff) < 0)
+ if (pt.tv_sec < data->cutoff)
{
data->list = g_slist_prepend(data->list, price);
DEBUG("will delete");
@@ -1625,12 +1625,14 @@ gnc_pricedb_process_removal_list (GNCPriceDB *db, GDate *fiscal_end_date,
gboolean
gnc_pricedb_remove_old_prices (GNCPriceDB *db, GList *comm_list,
- GDate *fiscal_end_date, Timespec cutoff,
+ GDate *fiscal_end_date, time64 cutoff,
PriceRemoveSourceFlags source,
PriceRemoveKeepOptions keep)
{
remove_info data;
GList *node;
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, sizeof(datebuff), 0);
data.db = db;
data.cutoff = cutoff;
@@ -1663,7 +1665,9 @@ gnc_pricedb_remove_old_prices (GNCPriceDB *db, GList *comm_list,
LEAVE("Empty price list");
return FALSE;
}
- DEBUG("Number of Prices in list is %d, Cutoff date is %s", g_slist_length (data.list), gnc_print_date (cutoff));
+ qof_print_date_buff (datebuff, sizeof(datebuff), cutoff);
+ DEBUG("Number of Prices in list is %d, Cutoff date is %s",
+ g_slist_length (data.list), datebuff);
// Check for a valid fiscal end of year date
if (fiscal_end_date == NULL)
diff --git a/libgnucash/engine/gnc-pricedb.h b/libgnucash/engine/gnc-pricedb.h
index 3f0b65e..61ed2c9 100644
--- a/libgnucash/engine/gnc-pricedb.h
+++ b/libgnucash/engine/gnc-pricedb.h
@@ -406,7 +406,7 @@ typedef enum
* @return True if there were prices to process, False if not.
*/
gboolean gnc_pricedb_remove_old_prices(GNCPriceDB *db, GList *comm_list,
- GDate *fiscal_end_date, Timespec cutoff,
+ GDate *fiscal_end_date, time64 cutoff,
PriceRemoveSourceFlags source,
PriceRemoveKeepOptions keep);
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 60f643a..40d87be 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -1935,7 +1935,6 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn,
GNCLot *payment_lot;
GList *selected_lots = NULL;
const GncOwner *owner;
- Timespec ts_pass = {date,0};
/* Verify our arguments */
if (!invoice || !gncInvoiceIsPosted (invoice) || !xfer_acc) return;
@@ -1944,8 +1943,9 @@ gncInvoiceApplyPayment (const GncInvoice *invoice, Transaction *txn,
g_return_if_fail (owner->owner.undefined);
/* Create a lot for this payment */
- payment_lot = gncOwnerCreatePaymentLot (owner, &txn, invoice->posted_acc, xfer_acc,
- amount, exch, ts_pass, memo, num);
+ payment_lot = gncOwnerCreatePaymentLot (owner, &txn, invoice->posted_acc,
+ xfer_acc, amount, exch,
+ date, memo, num);
/* Select the invoice as only payment candidate */
selected_lots = g_list_prepend (selected_lots, invoice->posted_lot);
diff --git a/libgnucash/engine/gncOwner.c b/libgnucash/engine/gncOwner.c
index 56b6036..6011936 100644
--- a/libgnucash/engine/gncOwner.c
+++ b/libgnucash/engine/gncOwner.c
@@ -725,7 +725,7 @@ gncOwnerLotsSortFunc (GNCLot *lotA, GNCLot *lotB)
GNCLot *
gncOwnerCreatePaymentLot (const GncOwner *owner, Transaction **preset_txn,
Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, Timespec date,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
const char *memo, const char *num)
{
QofBook *book;
@@ -814,7 +814,7 @@ gncOwnerCreatePaymentLot (const GncOwner *owner, Transaction **preset_txn,
/* set per book option */
xaccTransSetCurrency (txn, commodity);
xaccTransSetDateEnteredSecs (txn, gnc_time (NULL));
- xaccTransSetDatePostedSecs (txn, date.tv_sec);
+ xaccTransSetDatePostedSecs (txn, date);
/* The split for the transfer account */
@@ -1378,7 +1378,7 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots)
void
gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, GList *lots,
Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, Timespec date,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
const char *memo, const char *num, gboolean auto_pay)
{
GNCLot *payment_lot = NULL;
diff --git a/libgnucash/engine/gncOwner.h b/libgnucash/engine/gncOwner.h
index 1542f98..79bbaba 100644
--- a/libgnucash/engine/gncOwner.h
+++ b/libgnucash/engine/gncOwner.h
@@ -216,7 +216,7 @@ gboolean gncOwnerGetOwnerFromTypeGuid (QofBook *book, GncOwner *owner, QofIdType
GNCLot *
gncOwnerCreatePaymentLot (const GncOwner *owner, Transaction **preset_txn,
Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, Timespec date,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
const char *memo, const char *num);
/**
@@ -269,7 +269,7 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots);
void
gncOwnerApplyPayment (const GncOwner *owner, Transaction **preset_txn, GList *lots,
Account *posted_acc, Account *xfer_acc,
- gnc_numeric amount, gnc_numeric exch, Timespec date,
+ gnc_numeric amount, gnc_numeric exch, time64 date,
const char *memo, const char *num, gboolean auto_pay);
/** Helper function to find a split in lot that best offsets target_value
diff --git a/libgnucash/engine/test/utest-gnc-pricedb.c b/libgnucash/engine/test/utest-gnc-pricedb.c
index 345a34d..841260a 100644
--- a/libgnucash/engine/test/utest-gnc-pricedb.c
+++ b/libgnucash/engine/test/utest-gnc-pricedb.c
@@ -789,9 +789,9 @@ static void test_gnc_pricedb_remove_old_prices (PriceDBFixture *fixture, gconstp
PRICE_REMOVE_SOURCE_USER |
PRICE_REMOVE_SOURCE_APP;
- Timespec t_cut = gnc_dmy2timespec(1, 1, 2008);
- Timespec t_cut1 = gnc_dmy2timespec(1, 1, 2009);
- Timespec t_cut2 = gnc_dmy2timespec(1, 1, 2010);
+ time64 t_cut = gnc_dmy2time64(1, 1, 2008);
+ time64 t_cut1 = gnc_dmy2time64(1, 1, 2009);
+ time64 t_cut2 = gnc_dmy2time64(1, 1, 2010);
GDate *fiscal_end_date = g_date_new ();
g_date_set_dmy (fiscal_end_date, 31, 12, 2017);
commit e79612035946a2b0c2d323918d3f1d63152e535b
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jul 31 11:25:45 2018 -0700
Remove Timespec from gnucash/gnome-utils.
Plus a bit of bleed into gnome because of deleted functions.
diff --git a/gnucash/gnome-utils/dialog-dup-trans.c b/gnucash/gnome-utils/dialog-dup-trans.c
index bd30860..0b5692d 100644
--- a/gnucash/gnome-utils/dialog-dup-trans.c
+++ b/gnucash/gnome-utils/dialog-dup-trans.c
@@ -282,7 +282,7 @@ gnc_dup_trans_dialog_gdate (GtkWidget * parent, GDate *gdate_p,
time64 tmp_time;
g_assert(gdate_p);
- tmp_time = timespecToTime64(gdate_to_timespec(*gdate_p));
+ tmp_time = gdate_to_time64 (*gdate_p);
return gnc_dup_trans_dialog_internal(parent, NULL, TRUE, &tmp_time, gdate_p,
num, out_num, NULL, NULL);
}
@@ -293,7 +293,7 @@ gnc_dup_date_dialog (GtkWidget * parent, const char* title, GDate *gdate_p)
time64 tmp_time;
g_assert(gdate_p);
- tmp_time = timespecToTime64(gdate_to_timespec(*gdate_p));
+ tmp_time = gdate_to_time64(*gdate_p);
return gnc_dup_trans_dialog_internal(parent, title, TRUE, &tmp_time, gdate_p,
NULL, NULL, NULL, NULL);
}
diff --git a/gnucash/gnome-utils/dialog-transfer.c b/gnucash/gnome-utils/dialog-transfer.c
index 89a4bd9..fb15697 100644
--- a/gnucash/gnome-utils/dialog-transfer.c
+++ b/gnucash/gnome-utils/dialog-transfer.c
@@ -230,7 +230,7 @@ typedef struct
GNCPriceDB *pricedb;
gnc_commodity *from;
gnc_commodity *to;
- Timespec ts;
+ time64 time;
gboolean reverse;
} PriceReq;
@@ -243,7 +243,7 @@ price_request_from_xferData(PriceReq *pr, XferDialog *xd)
pr->pricedb = xd->pricedb;
pr->from = xd->from_commodity;
pr->to = xd->to_commodity;
- pr->ts = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (xd->date_entry));
+ pr->time = gnc_date_edit_get_date (GNC_DATE_EDIT (xd->date_entry));
pr->reverse = FALSE;
}
@@ -261,12 +261,12 @@ lookup_price(PriceReq *pr, PriceDate pd)
{
default:
case SAME_DAY:
- prc = gnc_pricedb_lookup_day (pr->pricedb, pr->from,
- pr->to, pr->ts);
+ prc = gnc_pricedb_lookup_day_t64 (pr->pricedb, pr->from,
+ pr->to, pr->time);
break;
case NEAREST:
- prc = gnc_pricedb_lookup_nearest_in_time (pr->pricedb, pr->from,
- pr->to, pr->ts);
+ prc = gnc_pricedb_lookup_nearest_in_time64 (pr->pricedb, pr->from,
+ pr->to, pr->time);
break;
case LATEST:
prc = gnc_pricedb_lookup_latest (pr->pricedb, pr->from, pr->to);
@@ -1499,7 +1499,7 @@ check_edit(XferDialog *xferData)
}
static void
-create_transaction(XferDialog *xferData, Timespec *ts,
+create_transaction(XferDialog *xferData, time64 time,
Account *from_account, Account* to_account,
gnc_numeric amount, gnc_numeric to_amount)
{
@@ -1513,7 +1513,7 @@ create_transaction(XferDialog *xferData, Timespec *ts,
xaccTransBeginEdit(trans);
xaccTransSetCurrency(trans, xferData->from_commodity);
- xaccTransSetDatePostedSecs(trans, ts->tv_sec);
+ xaccTransSetDatePostedSecs(trans, time);
/* Trans-Num or Split-Action set with gnc_set_num_action below per book
* option */
@@ -1601,7 +1601,7 @@ update_price(XferDialog *xferData, PriceReq *pr)
return;
}
gnc_price_begin_edit (pr->price);
- gnc_price_set_time (pr->price, pr->ts);
+ gnc_price_set_time64 (pr->price, pr->time);
gnc_price_set_typestr(pr->price, xferData->price_type);
gnc_price_set_value (pr->price, value);
gnc_price_commit_edit (pr->price);
@@ -1613,7 +1613,7 @@ update_price(XferDialog *xferData, PriceReq *pr)
}
static void
-new_price(XferDialog *xferData, Timespec ts)
+new_price(XferDialog *xferData, time64 time)
{
GNCPrice *price = NULL;
gnc_commodity *from = xferData->from_commodity;
@@ -1637,7 +1637,7 @@ new_price(XferDialog *xferData, Timespec ts)
gnc_price_begin_edit (price);
gnc_price_set_commodity (price, from);
gnc_price_set_currency (price, to);
- gnc_price_set_time (price, ts);
+ gnc_price_set_time64 (price, time);
gnc_price_set_source (price, xferData->price_source);
gnc_price_set_typestr (price, xferData->price_type);
gnc_price_set_value (price, value);
@@ -1649,7 +1649,7 @@ new_price(XferDialog *xferData, Timespec ts)
}
static void
-create_price(XferDialog *xferData, Timespec ts)
+create_price(XferDialog *xferData, time64 time)
{
PriceReq pr;
@@ -1664,7 +1664,7 @@ create_price(XferDialog *xferData, Timespec ts)
update_price(xferData, &pr);
return;
}
- new_price (xferData, ts);
+ new_price (xferData, time);
}
void
@@ -1674,7 +1674,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
Account *to_account;
Account *from_account;
gnc_numeric amount, to_amount;
- Timespec ts;
+ time64 time;
GDate date;
g_return_if_fail (xferData != NULL);
@@ -1718,7 +1718,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
}
g_date_clear (&date, 1);
gnc_date_edit_get_gdate (GNC_DATE_EDIT (xferData->date_entry), &date);
- ts = gdate_to_timespec (date);
+ time = gdate_to_time64 (date);
if (!gnc_commodity_equiv(xferData->from_commodity, xferData->to_commodity))
{
@@ -1748,12 +1748,12 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
*(xferData->exch_rate) = gnc_numeric_abs(price_value);
}
else
- create_transaction (xferData, &ts, from_account, to_account,
+ create_transaction (xferData, time, from_account, to_account,
amount, to_amount);
/* try to save this to the pricedb */
if (xferData->pricedb && !gnc_commodity_equal (xferData->from_commodity,
xferData->to_commodity))
- create_price(xferData, ts);
+ create_price(xferData, time);
/* Refresh everything */
gnc_resume_gui_refresh ();
diff --git a/gnucash/gnome-utils/gnc-date-edit.c b/gnucash/gnome-utils/gnc-date-edit.c
index c2e93a9..b729c33 100644
--- a/gnucash/gnome-utils/gnc-date-edit.c
+++ b/gnucash/gnome-utils/gnc-date-edit.c
@@ -184,13 +184,13 @@ gnc_date_edit_popdown(GNCDateEdit *gde)
static void
day_selected (GtkCalendar *calendar, GNCDateEdit *gde)
{
- Timespec t;
+ time64 t;
guint year, month, day;
gde->in_selected_handler = TRUE;
gtk_calendar_get_date (calendar, &year, &month, &day);
/* GtkCalendar returns a 0-based month */
- t = gnc_dmy2timespec (day, month + 1, year);
- gnc_date_edit_set_time_ts (gde, t);
+ t = gnc_dmy2time64 (day, month + 1, year);
+ gnc_date_edit_set_time (gde, t);
gde->in_selected_handler = FALSE;
}
@@ -809,12 +809,6 @@ gnc_date_edit_set_gdate (GNCDateEdit *gde, const GDate *date)
gnc_date_edit_set_time(gde, t);
}
-void
-gnc_date_edit_set_time_ts (GNCDateEdit *gde, Timespec the_time)
-{
- gnc_date_edit_set_time (gde, the_time.tv_sec);
-}
-
/**
* gnc_date_edit_set_popup_range:
* @gde: The GNCDateEdit widget
@@ -1033,13 +1027,6 @@ gnc_date_edit_new (time64 the_time, int show_time, int use_24_format)
| (use_24_format ? GNC_DATE_EDIT_24_HR : 0)));
}
-GtkWidget *
-gnc_date_edit_new_ts (Timespec the_time, int show_time, int use_24_format)
-{
- return gnc_date_edit_new (the_time.tv_sec, show_time, use_24_format);
-}
-
-
/*
* Create a new GncDateEdit widget from a glade file. The widget
* generated is set to today's date, and will not show a time as part
@@ -1193,16 +1180,6 @@ gnc_date_edit_get_gdate (GNCDateEdit *gde, GDate *date)
gnc_gdate_set_time64 (date, t);
}
-Timespec
-gnc_date_edit_get_date_ts (GNCDateEdit *gde)
-{
- Timespec ts = { 0, 0 };
-
- ts.tv_sec = gnc_date_edit_get_date (gde);
-
- return ts;
-}
-
/**
* gnc_date_edit_get_date_end:
* @gde: The GNCDateEdit widget
@@ -1224,16 +1201,6 @@ gnc_date_edit_get_date_end (GNCDateEdit *gde)
return gnc_mktime (&tm);
}
-Timespec
-gnc_date_edit_get_date_end_ts (GNCDateEdit *gde)
-{
- Timespec ts = { 0, 0 };
-
- ts.tv_sec = gnc_date_edit_get_date_end (gde);
-
- return ts;
-}
-
/**
* gnc_date_edit_set_flags:
* @gde: The date editor widget whose flags should be changed.
diff --git a/gnucash/gnome-utils/gnc-date-edit.h b/gnucash/gnome-utils/gnc-date-edit.h
index f6b7472..68f5478 100644
--- a/gnucash/gnome-utils/gnc-date-edit.h
+++ b/gnucash/gnome-utils/gnc-date-edit.h
@@ -93,8 +93,6 @@ GType gnc_date_edit_get_type (void);
GtkWidget *gnc_date_edit_new (time64 the_time,
int show_time, int use_24_format);
-GtkWidget *gnc_date_edit_new_ts (Timespec the_time,
- int show_time, int use_24_format);
/**
* Create a new GncDateEdit widget from a glade file. The widget
@@ -121,16 +119,13 @@ GtkWidget *gnc_date_edit_new_flags (time64 the_time,
void gnc_date_edit_set_gdate (GNCDateEdit *gde, const GDate *date);
void gnc_date_edit_set_time (GNCDateEdit *gde, time64 the_time);
-void gnc_date_edit_set_time_ts (GNCDateEdit *gde, Timespec the_time);
void gnc_date_edit_set_popup_range (GNCDateEdit *gde,
- int low_hour, int up_hour);
+ int low_hour, int up_hour);
void gnc_date_edit_get_gdate (GNCDateEdit *gde, GDate *date);
-time64 gnc_date_edit_get_date (GNCDateEdit *gde);
-Timespec gnc_date_edit_get_date_ts (GNCDateEdit *gde);
-time64 gnc_date_edit_get_date_end (GNCDateEdit *gde);
-Timespec gnc_date_edit_get_date_end_ts (GNCDateEdit *gde);
+time64 gnc_date_edit_get_date (GNCDateEdit *gde);
+time64 gnc_date_edit_get_date_end (GNCDateEdit *gde);
void gnc_date_edit_set_flags (GNCDateEdit *gde,
GNCDateEditFlags flags);
diff --git a/gnucash/gnome-utils/gnc-tree-control-split-reg.c b/gnucash/gnome-utils/gnc-tree-control-split-reg.c
index 3c68ddd..f366e82 100644
--- a/gnucash/gnome-utils/gnc-tree-control-split-reg.c
+++ b/gnucash/gnome-utils/gnc-tree-control-split-reg.c
@@ -1537,15 +1537,15 @@ static gboolean gtcsr_move_current_entry_updown(GncTreeViewSplitReg *view,
}
/* Special treatment if the equality doesn't hold if we access the
- dates as timespec. See the comment in gncEntrySetDateGDate() for the
- reason: Some code used the timespec at noon for the EntryDate, other
- code used the timespec at the start of day. */
+ dates as time64. See the comment in gncEntrySetDateGDate() for the
+ reason: Some code used the time64 at noon for the EntryDate, other
+ code used the time64 at the start of day. */
time1 = xaccTransRetDatePosted(current_trans);
time2 = xaccTransRetDatePosted(target_trans);
if (really_do_it && time1 != time2)
{
- /* Timespecs are not equal, even though the GDates were equal? Then
- we set the GDates again. This will force the timespecs to be equal
+ /* Times are not equal, even though the GDates were equal? Then
+ we set the GDates again. This will force the times to be equal
as well. */
xaccTransSetDatePostedGDate(current_trans, d1);
xaccTransSetDatePostedGDate(target_trans, d2);
diff --git a/gnucash/gnome-utils/gnc-tree-model-price.c b/gnucash/gnome-utils/gnc-tree-model-price.c
index eea39aa..2192806 100644
--- a/gnucash/gnome-utils/gnc-tree-model-price.c
+++ b/gnucash/gnome-utils/gnc-tree-model-price.c
@@ -679,6 +679,8 @@ gnc_tree_model_price_get_value (GtkTreeModel *tree_model,
gnc_commodity_namespace *name_space;
gnc_commodity *commodity;
GNCPrice *price;
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, 0, sizeof(datebuff));
g_return_if_fail (GNC_IS_TREE_MODEL_PRICE (model));
g_return_if_fail (iter != NULL);
@@ -767,8 +769,10 @@ gnc_tree_model_price_get_value (GtkTreeModel *tree_model,
g_value_set_string (value, gnc_commodity_get_printname (commodity));
break;
case GNC_TREE_MODEL_PRICE_COL_DATE:
+ qof_print_date_buff (datebuff, sizeof(datebuff),
+ gnc_price_get_time (price));
g_value_init (value, G_TYPE_STRING);
- g_value_set_string (value, gnc_print_date (gnc_price_get_time (price)));
+ g_value_set_string (value, datebuff);
break;
case GNC_TREE_MODEL_PRICE_COL_SOURCE:
g_value_init (value, G_TYPE_STRING);
diff --git a/gnucash/gnome-utils/gnc-tree-model-split-reg.c b/gnucash/gnome-utils/gnc-tree-model-split-reg.c
index 7965bf3..e44fd76 100644
--- a/gnucash/gnome-utils/gnc-tree-model-split-reg.c
+++ b/gnucash/gnome-utils/gnc-tree-model-split-reg.c
@@ -830,10 +830,11 @@ gnc_tree_model_split_reg_get_tooltip (GncTreeModelSplitReg *model, gint position
{
GncTreeModelSplitRegPrivate *priv;
Transaction *trans;
- const gchar *date_text;
+ char date_text[MAX_DATE_LENGTH + 1];
const gchar *desc_text;
GList *node;
+ memset (date_text, 0, sizeof(date_text));
priv = model->priv;
node = g_list_nth (priv->full_tlist, position);
@@ -848,8 +849,8 @@ gnc_tree_model_split_reg_get_tooltip (GncTreeModelSplitReg *model, gint position
return g_strconcat ("Blank Transaction", NULL);
else
{
- Timespec ts = {xaccTransRetDatePosted (trans), 0};
- date_text = gnc_print_date (ts);
+ time64 t = xaccTransRetDatePosted (trans);
+ qof_print_date_buff (date_text, sizeof(date_text), t);
desc_text = xaccTransGetDescription (trans);
model->current_trans = trans;
return g_strconcat (date_text, "\n", desc_text, NULL);
diff --git a/gnucash/gnome-utils/gnc-tree-view-price.c b/gnucash/gnome-utils/gnc-tree-view-price.c
index ad95cca..f4488fb 100644
--- a/gnucash/gnome-utils/gnc-tree-view-price.c
+++ b/gnucash/gnome-utils/gnc-tree-view-price.c
@@ -219,7 +219,7 @@ static gint
default_sort (GNCPrice *price_a, GNCPrice *price_b)
{
gnc_commodity *curr_a, *curr_b;
- Timespec ts_a, ts_b;
+ time64 time_a, time_b;
gint result;
/* Primary sort (i.e. commodity name) handled by the tree structure. */
@@ -237,9 +237,9 @@ default_sort (GNCPrice *price_a, GNCPrice *price_b)
if (result != 0) return result;
/* tertiary sort: time */
- ts_a = gnc_price_get_time (price_a);
- ts_b = gnc_price_get_time (price_b);
- result = timespec_cmp (&ts_a, &ts_b);
+ time_a = gnc_price_get_time64 (price_a);
+ time_b = gnc_price_get_time64 (price_b);
+ result = time_a < time_b ? -1 : time_a > time_b ? 1 : 0;
if (result)
/* Reverse the result to present the most recent quote first. */
return -result;
@@ -270,16 +270,16 @@ sort_by_date (GtkTreeModel *f_model,
gpointer user_data)
{
GNCPrice *price_a, *price_b;
- Timespec ts_a, ts_b;
+ time64 time_a, time_b;
gboolean result;
if (!get_prices (f_model, f_iter_a, f_iter_b, &price_a, &price_b))
return sort_ns_or_cm (f_model, f_iter_a, f_iter_b);
/* sort by time first */
- ts_a = gnc_price_get_time (price_a);
- ts_b = gnc_price_get_time (price_b);
- result = timespec_cmp (&ts_a, &ts_b);
+ time_a = gnc_price_get_time64 (price_a);
+ time_b = gnc_price_get_time64 (price_b);
+ result = time_a < time_b ? -1 : time_a > time_b ? 1 : 0;
if (result)
/* Reverse the result to present the most recent quote first. */
return -result;
diff --git a/gnucash/gnome-utils/gnc-tree-view-split-reg.c b/gnucash/gnome-utils/gnc-tree-view-split-reg.c
index c10d3af..d6fc079 100644
--- a/gnucash/gnome-utils/gnc-tree-view-split-reg.c
+++ b/gnucash/gnome-utils/gnc-tree-view-split-reg.c
@@ -1394,6 +1394,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
gnc_numeric num = gnc_numeric_zero();
const gchar *s = "";
const gchar *row_color;
+ char datebuff[MAX_DATE_LENGTH + 1];
RowDepth depth;
gint *indices;
Account *anchor = view->priv->anchor;
@@ -1462,6 +1463,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
switch (viewcol) {
case COL_DATE:
/* Column is DATE */
+ memset (datebuff, 0, sizeof(datebuff));
if (is_split)
g_object_set (cell, "cell-background", "white", (gchar*)NULL);
@@ -1474,65 +1476,60 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
show_extra_dates = TRUE;
if (is_trow1) {
- Timespec ts = {xaccTransRetDatePosted (trans),0};
+ time64 t = xaccTransRetDatePosted (trans);
//If the time returned by xaccTransGetDatePostedTS is 0 then assume it
//is a new transaction and set the time to current time to show current
//date on new transactions
- if (ts.tv_sec == 0)
- ts.tv_sec = gnc_time (NULL);
- s = gnc_print_date (ts);
+ if (t == 0)
+ t = gnc_time (NULL);
+ qof_print_date_buff (datebuff, sizeof(datebuff), t);
editable = TRUE;
}
else if (is_trow2 && show_extra_dates) {
- Timespec ts = {xaccTransRetDateEntered (trans),0};
+ time64 t = xaccTransRetDateEntered (trans);
g_object_set (cell, "cell-background", YELLOWCELL, (gchar*)NULL);
//If the time returned by xaccTransGetDateEnteredTS is 0 then assume it
//is a new transaction and set the time to current time to show current
//date on new transactions
- if (ts.tv_sec == 0)
- ts.tv_sec = gnc_time (NULL);
- s = gnc_print_date (ts);
+ if (t == 0)
+ t = gnc_time (NULL);
+ qof_print_date_buff (datebuff, sizeof(datebuff), t);
editable = FALSE;
}
else if (is_split && show_extra_dates) {
- Timespec ts = {0,0};
+ time64 t = 0;
if (xaccSplitGetReconcile (split) == YREC)
{
- xaccSplitGetDateReconciledTS (split, &ts);
+ t = xaccSplitGetDateReconciled (split);
//If the time returned by xaccTransGetDateEnteredTS is 0 then assume it
//is a new transaction and set the time to current time to show current
//date on new transactions
- if (ts.tv_sec == 0)
+ if (t == 0)
{
- ts.tv_sec = gnc_time (NULL);
+ t = gnc_time (NULL);
//xaccSplitSetDateReconciledTS (split, ts.tv_sec);
}//if
- s = gnc_print_date (ts);
+ qof_print_date_buff (datebuff, sizeof(datebuff), 0);
}
- else
- s = "";
editable = FALSE;
}
else {
- s = "";
editable = FALSE;
}
/* Is this a template */
if (is_template && is_trow1)
{
- s = _(" Scheduled ");
+ strncpy (datebuff, _(" Scheduled "), sizeof(datebuff));
editable = FALSE;
}
else if (is_template && is_trow2 && show_extra_dates)
{
- s = "";
editable = FALSE;
}
else if (is_template && is_split && show_extra_dates)
{
- s = "";
editable = FALSE;
}
@@ -1540,11 +1537,12 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
/* This will remove the calander buttons if FALSE */
g_object_set (cell, "use_buttons", view->priv->show_calendar_buttons, NULL );
- g_object_set (cell, "text", s, "editable", editable, NULL);
+ g_object_set (cell, "text", datebuff, "editable", editable, NULL);
break;
case COL_DUEDATE:
/* Column is DUE DATE */
+ memset (datebuff, 0, sizeof(datebuff));
if (is_split)
g_object_set (cell, "cell-background", "white", (gchar*)NULL);
@@ -1552,18 +1550,17 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
/* Only print the due date for invoice transactions */
if (type == TXN_TYPE_INVOICE)
{
- Timespec ts = {xaccTransRetDateDue (trans), 0};
- s = gnc_print_date (ts);
+ time64 t = xaccTransRetDateDue (trans);
+ qof_print_date_buff (datebuff, sizeof(datebuff), t);
editable = FALSE;
}
else {
- s = "";
editable = FALSE;
}
}
editable = (read_only == TRUE) ? FALSE : editable;
- g_object_set (cell, "text", s, "editable", editable, NULL);
+ g_object_set (cell, "text", datebuff, "editable", editable, NULL);
break;
case COL_NUMACT:
diff --git a/gnucash/gnome/dialog-date-close.c b/gnucash/gnome/dialog-date-close.c
index 5c22725..6a34d80 100644
--- a/gnucash/gnome/dialog-date-close.c
+++ b/gnucash/gnome/dialog-date-close.c
@@ -87,14 +87,14 @@ gnc_dialog_date_close_ok_cb (GtkWidget *widget, gpointer user_data)
}
if (ddc->post_date)
- *(ddc->ts2) = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (ddc->post_date));
+ ddc->ts2->tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->post_date));
if (ddc->date)
{
if (ddc->terms)
ddc->ts->tv_sec = gncBillTermComputeDueDate (ddc->terms, ddc->ts2->tv_sec);
else
- *(ddc->ts) = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (ddc->date));
+ ddc->ts->tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (ddc->date));
}
if (ddc->memo_entry && ddc->memo)
@@ -146,7 +146,7 @@ gnc_dialog_date_close_parented (GtkWidget *parent, const char *message,
date_box = GTK_WIDGET(gtk_builder_get_object (builder, "date_box"));
ddc->date = gnc_date_edit_new (time(NULL), FALSE, FALSE);
gtk_box_pack_start (GTK_BOX(date_box), ddc->date, TRUE, TRUE, 0);
- gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->date), *ts);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), ts->tv_sec);
if (parent)
gtk_window_set_transient_for (GTK_WINDOW(ddc->dialog), GTK_WINDOW(parent));
@@ -184,12 +184,12 @@ static void
post_date_changed_cb (GNCDateEdit *gde, gpointer d)
{
DialogDateClose *ddc = d;
- Timespec post_date;
- Timespec due_date = {0,0};
+ time64 post_date;
+ time64 due_date = 0;
- post_date = gnc_date_edit_get_date_ts (gde);
- due_date.tv_sec = gncBillTermComputeDueDate (ddc->terms, post_date.tv_sec);
- gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->date), due_date);
+ post_date = gnc_date_edit_get_date (gde);
+ due_date = gncBillTermComputeDueDate (ddc->terms, post_date);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), due_date);
}
gboolean
@@ -278,7 +278,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
/* Set the post date widget */
- gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->post_date), *post);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->post_date), post->tv_sec);
/* Deal with the terms handling of the due date */
if (terms)
@@ -289,7 +289,7 @@ gnc_dialog_dates_acct_question_parented (GtkWidget *parent, const char *message,
post_date_changed_cb (GNC_DATE_EDIT (ddc->post_date), ddc);
}
else
- gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->date), *ddue);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), ddue->tv_sec);
/* Setup the account widget */
fill_in_acct_info (ddc, set_default_acct);
@@ -378,7 +378,7 @@ gnc_dialog_date_acct_parented (GtkWidget *parent, const char *message,
gtk_label_set_text (label, acct_label_message);
/* Set the date widget */
- gnc_date_edit_set_time_ts (GNC_DATE_EDIT (ddc->date), *date);
+ gnc_date_edit_set_time (GNC_DATE_EDIT (ddc->date), date->tv_sec);
/* Setup the account widget */
fill_in_acct_info (ddc, FALSE);
commit dd8732402f6134ce4e89ab8085f4bff2a185d60f
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 30 17:28:18 2018 -0700
Remove all timespecs from the register.
diff --git a/gnucash/register/ledger-core/gncEntryLedger.c b/gnucash/register/ledger-core/gncEntryLedger.c
index a0d192c..e54c590 100644
--- a/gnucash/register/ledger-core/gncEntryLedger.c
+++ b/gnucash/register/ledger-core/gncEntryLedger.c
@@ -1036,15 +1036,15 @@ void gnc_entry_ledger_move_current_entry_updown (GncEntryLedger *ledger,
return;
/* Special treatment if the equality doesn't hold if we access the
- dates as timespec. See the comment in gncEntrySetDateGDate() for the
- reason: Some code used the timespec at noon for the EntryDate, other
- code used the timespec at the start of day. */
+ dates as time64. See the comment in gncEntrySetDateGDate() for the
+ reason: Some code used the time64 at noon for the EntryDate, other
+ code used the time64 at the start of day. */
t1 = gncEntryGetDate(current);
t2 = gncEntryGetDate(target);
if (t1 != t2)
{
- /* Timespecs are not equal, even though the GDates were equal? Then
- we set the GDates again. This will force the timespecs to be equal
+ /* times are not equal, even though the GDates were equal? Then
+ we set the GDates again. This will force the times to be equal
as well. */
gncEntrySetDateGDate(current, &d1);
gncEntrySetDateGDate(target, &d2);
diff --git a/gnucash/register/ledger-core/gncEntryLedgerModel.c b/gnucash/register/ledger-core/gncEntryLedgerModel.c
index ef47c13..a248fed 100644
--- a/gnucash/register/ledger-core/gncEntryLedgerModel.c
+++ b/gnucash/register/ledger-core/gncEntryLedgerModel.c
@@ -186,13 +186,9 @@ static const char * get_date_entry (VirtualLocation virt_loc,
gpointer user_data)
{
GncEntryLedger *ledger = user_data;
- GncEntry *entry;
- Timespec ts = {0,0};
-
- entry = gnc_entry_ledger_get_entry (ledger, virt_loc.vcell_loc);
-
- ts.tv_sec = gncEntryGetDate (entry);
- return gnc_print_date (ts);
+ GncEntry *entry = gnc_entry_ledger_get_entry (ledger, virt_loc.vcell_loc);
+ time64 time = gncEntryGetDate (entry);
+ return qof_print_date(time);
}
static const char * get_desc_entry (VirtualLocation virt_loc,
diff --git a/gnucash/register/ledger-core/split-register-load.c b/gnucash/register/ledger-core/split-register-load.c
index c1508f8..d5286ad 100644
--- a/gnucash/register/ledger-core/split-register-load.c
+++ b/gnucash/register/ledger-core/split-register-load.c
@@ -487,7 +487,7 @@ gnc_split_register_load (SplitRegister *reg, GList * slist,
{
GDate *d = qof_book_get_autoreadonly_gdate(gnc_get_current_book());
// "d" is NULL if use_autoreadonly is FALSE
- autoreadonly_time = d ? timespecToTime64(gdate_to_timespec(*d)) : 0;
+ autoreadonly_time = d ? gdate_to_time64 (*d) : 0;
g_date_free(d);
}
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index bc65d38..0ecf31f 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -521,11 +521,11 @@ gnc_split_register_get_recn_tooltip (VirtualLocation virt_loc,
if (xaccSplitGetReconcile (split) == YREC)
{
- Timespec ts = {0,0};
- const char *str_rec_date;
- xaccSplitGetDateReconciledTS (split, &ts);
- str_rec_date = gnc_print_date (ts);
- return g_strdup_printf (_("Reconciled on %s"), str_rec_date);
+ char datebuff[MAX_DATE_LENGTH + 1];
+ time64 time = xaccSplitGetDateReconciled (split);
+ memset (datebuff, 0, sizeof(datebuff));
+ qof_print_date_buff (datebuff, sizeof(datebuff), time);
+ return g_strdup_printf (_("Reconciled on %s"), datebuff);
}
else if (xaccSplitGetReconcile (split) == VREC)
{
@@ -904,7 +904,6 @@ gnc_split_register_get_due_date_entry (VirtualLocation virt_loc,
SplitRegister *reg = user_data;
Transaction *trans;
Split *split;
- Timespec ts = {0, 0};
gboolean is_current;
char type;
@@ -941,10 +940,9 @@ gnc_split_register_get_due_date_entry (VirtualLocation virt_loc,
return NULL;
}
- ts.tv_sec = xaccTransRetDateDue (trans);
//PWARN ("returning valid due_date entry");
- return gnc_print_date (ts);
+ return qof_print_date (xaccTransRetDateDue (trans));
}
static const char *
@@ -956,16 +954,12 @@ gnc_split_register_get_date_entry (VirtualLocation virt_loc,
SplitRegister *reg = user_data;
Transaction *trans;
Split *split;
- Timespec ts = {0, 0};
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
trans = xaccSplitGetParent (split);
if (!trans)
return NULL;
-
- ts.tv_sec = xaccTransRetDatePosted (trans);
-
- return gnc_print_date (ts);
+ return qof_print_date (xaccTransRetDatePosted (trans));
}
static char *
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 9e3beac..5d1eb78 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -2078,7 +2078,6 @@ record_price (SplitRegister *reg, Account *account, gnc_numeric value,
time64 time;
BasicCell *cell = gnc_table_layout_get_cell (reg->table->layout, DATE_CELL);
gboolean swap = FALSE;
- Timespec ts;
/* Only record the price for account types that don't have a
* "rate" cell. They'll get handled later by
@@ -2087,9 +2086,7 @@ record_price (SplitRegister *reg, Account *account, gnc_numeric value,
if (gnc_split_reg_has_rate_cell (reg->type))
return;
gnc_date_cell_get_date ((DateCell*)cell, &time);
- ts.tv_sec = time;
- ts.tv_nsec = 0;
- price = gnc_pricedb_lookup_day (pricedb, comm, curr, ts);
+ price = gnc_pricedb_lookup_day_t64 (pricedb, comm, curr, time);
if (gnc_commodity_equiv (comm, gnc_price_get_currency (price)))
swap = TRUE;
@@ -2116,7 +2113,7 @@ record_price (SplitRegister *reg, Account *account, gnc_numeric value,
value = gnc_numeric_convert(value, scu * COMMODITY_DENOM_MULT,
GNC_HOW_RND_ROUND_HALF_UP);
gnc_price_begin_edit (price);
- gnc_price_set_time (price, ts);
+ gnc_price_set_time64 (price, time);
gnc_price_set_source (price, source);
gnc_price_set_typestr (price, PRICE_TYPE_TRN);
gnc_price_set_value (price, value);
@@ -2131,7 +2128,7 @@ record_price (SplitRegister *reg, Account *account, gnc_numeric value,
gnc_price_begin_edit (price);
gnc_price_set_commodity (price, comm);
gnc_price_set_currency (price, curr);
- gnc_price_set_time (price, ts);
+ gnc_price_set_time64 (price, time);
gnc_price_set_source (price, source);
gnc_price_set_typestr (price, PRICE_TYPE_TRN);
gnc_price_set_value (price, value);
diff --git a/gnucash/register/register-core/datecell.h b/gnucash/register/register-core/datecell.h
index e49a72f..e3ce703 100644
--- a/gnucash/register/register-core/datecell.h
+++ b/gnucash/register/register-core/datecell.h
@@ -120,13 +120,13 @@ void gnc_date_cell_set_value_secs (DateCell *cell, time64 secs);
*/
void gnc_date_cell_commit (DateCell *cell);
-/** Set a Timespec to the value in the DateCell.
+/** Set a time64 to the value in the DateCell.
* @param cell The DateCell
* @param time A time64* to which the function will write the time.
*/
void gnc_date_cell_get_date (DateCell *cell, time64 *time);
-/** Timespec to the value in the DateCell.
+/** Set a GDate to the value in the DateCell.
* @param cell The DateCell
* @param date A GDate* into which the functino will write the date.
*/
commit 6846a68691d6bf9b5873ed2dcc434e904d9bbd8c
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jul 29 17:11:43 2018 -0700
Remove two unused functions, one of which used Timespec.
diff --git a/gnucash/register/ledger-core/split-register-control.c b/gnucash/register/ledger-core/split-register-control.c
index de1bc8d..5effb4c 100644
--- a/gnucash/register/ledger-core/split-register-control.c
+++ b/gnucash/register/ledger-core/split-register-control.c
@@ -1204,36 +1204,6 @@ gnc_split_register_get_account_always (SplitRegister *reg,
return gnc_split_register_get_account_by_name (reg, cell, name);
}
-#if 0 /* Not Used */
-static const char *
-gnc_split_register_get_cell_string (SplitRegister *reg, const char *cell_name)
-{
- BasicCell *cell;
-
- cell = gnc_table_layout_get_cell (reg->table->layout, cell_name);
- if (!cell)
- return "";
-
- return gnc_basic_cell_get_value (cell);
-}
-
-static Timespec
-gnc_split_register_get_cell_date (SplitRegister *reg, const char *cell_name)
-{
- DateCell *cell;
- Timespec ts;
-
- cell = (DateCell*) gnc_table_layout_get_cell (reg->table->layout, cell_name);
-
- if (cell)
- gnc_date_cell_get_date (cell, &ts);
- else
- timespecFromTime64 (&ts, gnc_time (NULL));
-
- return ts;
-}
-#endif /* Not Used */
-
/* Creates a transfer dialog and fills its values from register cells (if
* available) or from the provided transaction and split.
*/
commit e3dce951c714ac94a6e717406f470746fecdc29e
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jul 29 16:45:39 2018 -0700
Remove Timespec from qif importer.
diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index 1d16f99..dcff2f6 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -1137,7 +1137,8 @@ refresh_old_transactions(QIFImportWindow * wind, int selection)
while (!scm_is_null(possible_matches))
{
- Timespec ts_send = {0,0};
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset(datebuff, 0, sizeof(datebuff));
current_xtn = SCM_CAR(possible_matches);
#define FUNC_NAME "xaccTransCountSplits"
gnc_xtn = SWIG_MustGetPtr(SCM_CAR(current_xtn),
@@ -1159,11 +1160,12 @@ refresh_old_transactions(QIFImportWindow * wind, int selection)
}
gtk_list_store_append(store, &iter);
- ts_send.tv_sec = xaccTransRetDatePosted(gnc_xtn);
+ qof_print_date_buff(datebuff, sizeof(datebuff),
+ xaccTransRetDatePosted(gnc_xtn));
gtk_list_store_set
(store, &iter,
QIF_TRANS_COL_INDEX, rownum++,
- QIF_TRANS_COL_DATE, gnc_print_date(ts_send),
+ QIF_TRANS_COL_DATE, datebuff,
QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
QIF_TRANS_COL_AMOUNT, amount_str,
QIF_TRANS_COL_CHECKED, selected != SCM_BOOL_F,
@@ -3138,8 +3140,8 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
while (!scm_is_null(duplicates))
{
time64 send_time = 0;
- char date_buf[MAX_DATE_LENGTH + 1];
- memset (date_buf, 0, sizeof(date_buf));
+ char datebuff[MAX_DATE_LENGTH + 1];
+ memset (datebuff, 0, sizeof(datebuff));
current_xtn = SCM_CAAR(duplicates);
#define FUNC_NAME "xaccTransCountSplits"
gnc_xtn = SWIG_MustGetPtr(current_xtn,
@@ -3157,12 +3159,12 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
}
gtk_list_store_append(store, &iter);
send_time = xaccTransRetDatePosted(gnc_xtn);
- qof_print_date_buff (date_buf, sizeof(date_buf), send_time);
+ qof_print_date_buff (datebuff, sizeof(datebuff), send_time);
gtk_list_store_set
(store, &iter,
QIF_TRANS_COL_INDEX, rownum++,
QIF_TRANS_COL_DATE,
- date_buf,
+ datebuff,
QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
QIF_TRANS_COL_AMOUNT, amount_str,
-1);
commit 14335b78626762d0eba11888334796cff6809d27
Merge: 22dd716 b3f1104
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sat Aug 11 21:04:26 2018 +0200
Merge branch 'Bug796788' of https://github.com/Bob-IT/gnucash into maint
commit b3f1104d39d2326cba7304e7981836e0725aba6d
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Aug 10 14:29:44 2018 +0100
Fix a possible transient parent dialogue warning
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index da5c14a..7952fb1 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -4335,7 +4335,7 @@ scm_apply_cb (GNCOptionWin *win, gpointer data)
results = gnc_option_db_commit (win->option_db);
for (iter = results; iter; iter = iter->next)
{
- GtkWidget *dialog = gtk_message_dialog_new(NULL,
+ GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(gnc_options_dialog_widget(win)),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
diff --git a/gnucash/report/report-gnome/dialog-report-column-view.c b/gnucash/report/report-gnome/dialog-report-column-view.c
index ebd4e7e..4453c10 100644
--- a/gnucash/report/report-gnome/dialog-report-column-view.c
+++ b/gnucash/report/report-gnome/dialog-report-column-view.c
@@ -292,7 +292,7 @@ gnc_column_view_edit_apply_cb(GNCOptionWin * w, gpointer user_data)
results = gnc_option_db_commit (win->odb);
for (iter = results; iter; iter = iter->next)
{
- GtkWidget *dialog = gtk_message_dialog_new(NULL,
+ GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(gnc_options_dialog_widget(w)),
0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
commit 19d6eb902824e7dbca1b12476dffb83a58b717b9
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Aug 11 12:39:48 2018 +0100
Improve the button sensitivity function
diff --git a/gnucash/report/report-gnome/dialog-report-column-view.c b/gnucash/report/report-gnome/dialog-report-column-view.c
index 82751d1..ebd4e7e 100644
--- a/gnucash/report/report-gnome/dialog-report-column-view.c
+++ b/gnucash/report/report-gnome/dialog-report-column-view.c
@@ -239,44 +239,45 @@ gnc_column_view_update_buttons_cb (GtkTreeSelection *selection,
{
GtkTreeModel *model;
GtkTreeIter iter;
- GtkTreeSelection *available_selection;
+ gboolean is_selected;
- /* compare selection to establish which treeview selected */
- available_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->available));
-
- /* available treeview */
- if (available_selection == selection)
+ /* compare treeviews to establish which selected treeview */
+ if (gtk_tree_selection_get_tree_view (selection) == r->available)
{
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_widget_set_sensitive (r->add_button, TRUE);
- else
- gtk_widget_set_sensitive (r->add_button, FALSE);
+ /* available treeview */
+ is_selected = gtk_tree_selection_get_selected (selection, &model, &iter);
+ gtk_widget_set_sensitive (r->add_button, is_selected);
return;
}
/* contents treeview */
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ is_selected = gtk_tree_selection_get_selected (selection, &model, &iter);
+ gtk_widget_set_sensitive (r->size_button, is_selected);
+ gtk_widget_set_sensitive (r->remove_button, is_selected);
+
+ if (is_selected)
{
int len = scm_ilength (r->contents_list);
- gtk_tree_model_get(model, &iter,
+ gtk_tree_model_get (model, &iter,
CONTENTS_COL_ROW, &r->contents_selected, -1);
- gtk_widget_set_sensitive (r->size_button, TRUE);
- gtk_widget_set_sensitive (r->remove_button, TRUE);
-
if (len > 1)
{
gtk_widget_set_sensitive (r->up_button, TRUE);
gtk_widget_set_sensitive (r->down_button, TRUE);
+
+ if (r->contents_selected == len -1)
+ gtk_widget_set_sensitive (r->down_button, FALSE);
+
+ if (r->contents_selected == 0)
+ gtk_widget_set_sensitive (r->up_button, FALSE);
}
}
else
{
gtk_widget_set_sensitive (r->up_button, FALSE);
gtk_widget_set_sensitive (r->down_button, FALSE);
- gtk_widget_set_sensitive (r->size_button, FALSE);
- gtk_widget_set_sensitive (r->remove_button, FALSE);
}
}
commit 22dd716b58a6a9c424a71268f78af37b972ab23b
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 10 12:57:46 2018 -0700
Set the SWIG minimum version to 2.0.11 now that we require Guile-2.0.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f5d372e..42a23b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -285,7 +285,7 @@ endif (WIN32)
# SWIG
if(GENERATE_SWIG_WRAPPERS)
- find_package (SWIG REQUIRED)
+ find_package (SWIG 2.0.10 REQUIRED)
include (${SWIG_USE_FILE})
endif()
commit 2f861bc2a49d77cecce056cbc605a74d0b963f5a
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Aug 10 12:21:28 2018 -0700
Ensure all C++ class member raw pointers are default-initialized to nullptr.
diff --git a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
index 336d2c4..0c7e854 100644
--- a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
+++ b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
@@ -53,7 +53,7 @@ public:
void add_where_cond(QofIdTypeConst, const PairVec&) override;
private:
- const GncSqlConnection* m_conn;
+ const GncSqlConnection* m_conn = nullptr;
std::string m_sql;
};
diff --git a/libgnucash/backend/dbi/gnc-dbisqlconnection.hpp b/libgnucash/backend/dbi/gnc-dbisqlconnection.hpp
index 56766e1..bb71a96 100644
--- a/libgnucash/backend/dbi/gnc-dbisqlconnection.hpp
+++ b/libgnucash/backend/dbi/gnc-dbisqlconnection.hpp
@@ -86,7 +86,7 @@ public:
const ColVec& info_vec) const noexcept;
bool drop_indexes() noexcept;
private:
- QofBackend* m_qbe;
+ QofBackend* m_qbe = nullptr;
dbi_conn m_conn;
std::unique_ptr<GncDbiProvider> m_provider;
/** Used by the error handler routines to flag if the connection is ok to
diff --git a/libgnucash/backend/dbi/gnc-dbisqlresult.hpp b/libgnucash/backend/dbi/gnc-dbisqlresult.hpp
index c0dd59e..52da0d2 100644
--- a/libgnucash/backend/dbi/gnc-dbisqlresult.hpp
+++ b/libgnucash/backend/dbi/gnc-dbisqlresult.hpp
@@ -63,11 +63,11 @@ protected:
return dbi_result_field_is_null(m_inst->m_dbi_result, col);
}
private:
- GncDbiSqlResult* m_inst;
+ GncDbiSqlResult* m_inst = nullptr;
};
private:
- const GncDbiSqlConnection* m_conn;
+ const GncDbiSqlConnection* m_conn = nullptr;
dbi_result m_dbi_result;
IteratorImpl m_iter;
GncSqlRow m_row;
diff --git a/libgnucash/backend/sql/gnc-sql-backend.hpp b/libgnucash/backend/sql/gnc-sql-backend.hpp
index 1d8a97c..bde8700 100644
--- a/libgnucash/backend/sql/gnc-sql-backend.hpp
+++ b/libgnucash/backend/sql/gnc-sql-backend.hpp
@@ -241,12 +241,12 @@ public:
void finish_progress() const noexcept;
protected:
- GncSqlConnection* m_conn; /**< SQL connection */
- QofBook* m_book; /**< The primary, main open book */
+ GncSqlConnection* m_conn = nullptr; /**< SQL connection */
+ QofBook* m_book = nullptr; /**< The primary, main open book */
bool m_loading; /**< We are performing an initial load */
bool m_in_query; /**< We are processing a query */
bool m_is_pristine_db; /**< Are we saving to a new pristine db? */
- const char* m_timespec_format; /**< Server-specific date-time string format */
+ const char* m_timespec_format = nullptr; /**< Server-specific date-time string format */
VersionVec m_versions; /**< Version number for each table */
private:
bool write_account_tree(Account*);
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
index 3ded4c4..b365d4a 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
@@ -231,12 +231,12 @@ protected:
*/
void add_objectref_guid_to_table (ColVec& vec) const noexcept;
private:
- const char* m_col_name; /**< Column name */
+ const char* m_col_name = nullptr; /**< Column name */
const GncSqlObjectType m_col_type; /**< Column type */
unsigned int m_size; /**< Column size in bytes, for string columns */
ColumnFlags m_flags; /**< Column flags */
- const char* m_gobj_param_name; /**< If non-null, g_object param name */
- const char* m_qof_param_name; /**< If non-null, qof parameter name */
+ const char* m_gobj_param_name = nullptr; /**< If non-null, g_object param name */
+ const char* m_qof_param_name = nullptr; /**< If non-null, qof parameter name */
QofAccessFunc m_getter; /**< General access function */
QofSetterFunc m_setter; /**< General setter function */
template <typename T> T get_row_value_from_object(QofIdTypeConst obj_name,
diff --git a/libgnucash/backend/sql/gnc-sql-object-backend.hpp b/libgnucash/backend/sql/gnc-sql-object-backend.hpp
index 316e64d..bd3f705 100644
--- a/libgnucash/backend/sql/gnc-sql-object-backend.hpp
+++ b/libgnucash/backend/sql/gnc-sql-object-backend.hpp
@@ -131,9 +131,9 @@ struct write_objects_t
void commit (QofInstance* inst) {
if (is_ok) is_ok = obe->commit (be, inst);
}
- GncSqlBackend* be;
- bool is_ok;
- GncSqlObjectBackend* obe;
+ GncSqlBackend* be = nullptr;
+ bool is_ok = false;
+ GncSqlObjectBackend* obe = nullptr;
};
diff --git a/libgnucash/engine/test/test-kvp-frame.cpp b/libgnucash/engine/test/test-kvp-frame.cpp
index 9e0491c..29a162c 100644
--- a/libgnucash/engine/test/test-kvp-frame.cpp
+++ b/libgnucash/engine/test/test-kvp-frame.cpp
@@ -42,8 +42,8 @@ public:
}
protected:
KvpFrameImpl t_root;
- KvpValue *t_int_val;
- KvpValue *t_str_val;
+ KvpValue *t_int_val = nullptr;
+ KvpValue *t_str_val = nullptr;
};
template <typename A, typename B> void
commit 9768a2158d312d3d91c4661fd6f5ed1f4d73218c
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Aug 10 12:40:51 2018 +0100
Save the contents_selected value in selection callback
With the use of the selection call back for button sensitivity it make
sense to use that to store the contents_selected value for the contents
tree view.
diff --git a/gnucash/report/report-gnome/dialog-report-column-view.c b/gnucash/report/report-gnome/dialog-report-column-view.c
index 1dc5587..82751d1 100644
--- a/gnucash/report/report-gnome/dialog-report-column-view.c
+++ b/gnucash/report/report-gnome/dialog-report-column-view.c
@@ -259,6 +259,9 @@ gnc_column_view_update_buttons_cb (GtkTreeSelection *selection,
{
int len = scm_ilength (r->contents_list);
+ gtk_tree_model_get(model, &iter,
+ CONTENTS_COL_ROW, &r->contents_selected, -1);
+
gtk_widget_set_sensitive (r->size_button, TRUE);
gtk_widget_set_sensitive (r->remove_button, TRUE);
@@ -459,7 +462,7 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
int oldlength, id;
gchar *guid_str;
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->available));
- GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->available));
+ GtkTreeModel *model;
GtkTreeIter iter;
/* make sure there is a selected entry */
@@ -526,16 +529,6 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
SCM oldlist = r->contents_list;
int count;
int oldlength;
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->contents));
- GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->contents));
- GtkTreeIter iter;
-
- /* make sure there is a selected entry */
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- CONTENTS_COL_ROW, &r->contents_selected, -1);
- else
- return;
if (scm_is_list(r->contents_list))
{
@@ -579,16 +572,6 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
SCM temp;
int oldlength;
int count;
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->contents));
- GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->contents));
- GtkTreeIter iter;
-
- /* make sure there is a selected entry */
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- CONTENTS_COL_ROW, &r->contents_selected, -1);
- else
- return;
oldlength = scm_ilength(r->contents_list);
if ((r->contents_selected > 0) && (oldlength > r->contents_selected))
@@ -627,16 +610,6 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
SCM temp;
int oldlength;
int count;
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->contents));
- GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->contents));
- GtkTreeIter iter;
-
- /* make sure there is a selected entry */
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- CONTENTS_COL_ROW, &r->contents_selected, -1);
- else
- return;
oldlength = scm_ilength(r->contents_list);
if (oldlength > (r->contents_selected + 1))
commit 5ff8d8daba7278b242628ba8c0f9f23fae868904
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Aug 10 11:36:41 2018 +0100
Update buttons on Multicolumn report options
Change the sensitivity of the multicolumn report options based on the
selection in the two tree views using the select callback.
diff --git a/gnucash/gtkbuilder/dialog-report.glade b/gnucash/gtkbuilder/dialog-report.glade
index c7dd029..17d2ea5 100644
--- a/gnucash/gtkbuilder/dialog-report.glade
+++ b/gnucash/gtkbuilder/dialog-report.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkAdjustment" id="col_adjustment">
@@ -95,9 +95,10 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="button85">
+ <object class="GtkButton" id="add_button1">
<property name="label" translatable="yes">A_dd >></property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
@@ -110,9 +111,10 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="button86">
+ <object class="GtkButton" id="remove_button1">
<property name="label" translatable="yes"><< _Remove</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
@@ -137,9 +139,10 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="button87">
+ <object class="GtkButton" id="up_button1">
<property name="label" translatable="yes">Move _up</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
@@ -152,9 +155,10 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="button88">
+ <object class="GtkButton" id="down_button1">
<property name="label" translatable="yes">Move dow_n</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
@@ -179,9 +183,10 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="button89">
+ <object class="GtkButton" id="size_button1">
<property name="label" translatable="yes">Si_ze...</property>
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
@@ -241,9 +246,11 @@
</child>
</object>
</child>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
</object>
<object class="GtkDialog" id="html_style_sheet_dialog">
- <property name="visible">False</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">HTML Style Sheets</property>
<property name="type_hint">dialog</property>
@@ -416,6 +423,9 @@
<action-widgets>
<action-widget response="-7">closebutton1</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkAdjustment" id="row_adjustment">
<property name="upper">100</property>
@@ -573,6 +583,9 @@
<action-widget response="-6">cancelbutton</action-widget>
<action-widget response="-5">okbutton</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkDialog" id="select_style_sheet_dialog">
<property name="can_focus">False</property>
@@ -690,6 +703,9 @@
<action-widget response="2">delete_button</action-widget>
<action-widget response="-7">close_button</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
<object class="GtkListStore" id="template_liststore">
<columns>
@@ -849,5 +865,8 @@
<action-widget response="-6">cancelbutton1</action-widget>
<action-widget response="-5">okbutton1</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/gnucash/report/report-gnome/dialog-report-column-view.c b/gnucash/report/report-gnome/dialog-report-column-view.c
index 84bdd93..1dc5587 100644
--- a/gnucash/report/report-gnome/dialog-report-column-view.c
+++ b/gnucash/report/report-gnome/dialog-report-column-view.c
@@ -67,6 +67,12 @@ struct gncp_column_view_edit
SCM available_list;
SCM contents_list;
int contents_selected;
+
+ GtkWidget *add_button;
+ GtkWidget *remove_button;
+ GtkWidget *up_button;
+ GtkWidget *down_button;
+ GtkWidget *size_button;
};
void gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data);
@@ -228,6 +234,50 @@ update_contents_lists(gnc_column_view_edit * view)
}
static void
+gnc_column_view_update_buttons_cb (GtkTreeSelection *selection,
+ gnc_column_view_edit *r)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ GtkTreeSelection *available_selection;
+
+ /* compare selection to establish which treeview selected */
+ available_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->available));
+
+ /* available treeview */
+ if (available_selection == selection)
+ {
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_widget_set_sensitive (r->add_button, TRUE);
+ else
+ gtk_widget_set_sensitive (r->add_button, FALSE);
+ return;
+ }
+
+ /* contents treeview */
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ {
+ int len = scm_ilength (r->contents_list);
+
+ gtk_widget_set_sensitive (r->size_button, TRUE);
+ gtk_widget_set_sensitive (r->remove_button, TRUE);
+
+ if (len > 1)
+ {
+ gtk_widget_set_sensitive (r->up_button, TRUE);
+ gtk_widget_set_sensitive (r->down_button, TRUE);
+ }
+ }
+ else
+ {
+ gtk_widget_set_sensitive (r->up_button, FALSE);
+ gtk_widget_set_sensitive (r->down_button, FALSE);
+ gtk_widget_set_sensitive (r->size_button, FALSE);
+ gtk_widget_set_sensitive (r->remove_button, FALSE);
+ }
+}
+
+static void
gnc_column_view_edit_apply_cb(GNCOptionWin * w, gpointer user_data)
{
SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
@@ -278,6 +328,7 @@ gnc_column_view_edit_options(SCM options, SCM view)
GtkListStore *store;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
+ GtkTreeSelection *selection;
ptr = scm_call_1(get_editor, view);
if (ptr != SCM_BOOL_F)
@@ -304,6 +355,13 @@ gnc_column_view_edit_options(SCM options, SCM view)
editor = GTK_WIDGET(gtk_builder_get_object (builder, "view_contents_table"));
r->available = GTK_TREE_VIEW (gtk_builder_get_object (builder, "available_view"));
r->contents = GTK_TREE_VIEW (gtk_builder_get_object (builder, "contents_view"));
+
+ r->add_button = GTK_WIDGET(gtk_builder_get_object (builder, "add_button1"));
+ r->remove_button = GTK_WIDGET(gtk_builder_get_object (builder, "remove_button1"));
+ r->up_button = GTK_WIDGET(gtk_builder_get_object (builder, "up_button1"));
+ r->down_button = GTK_WIDGET(gtk_builder_get_object (builder, "down_button1"));
+ r->size_button = GTK_WIDGET(gtk_builder_get_object (builder, "size_button1"));
+
r->options = options;
r->view = view;
r->available_list = SCM_EOL;
@@ -335,6 +393,11 @@ gnc_column_view_edit_options(SCM options, SCM view)
NULL);
gtk_tree_view_append_column(r->available, column);
+ /* use the selection cb to update buttons */
+ selection = gtk_tree_view_get_selection(r->available);
+ g_signal_connect(selection, "changed",
+ G_CALLBACK(gnc_column_view_update_buttons_cb), r);
+
/* Build the 'contents' view */
store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
G_TYPE_INT, G_TYPE_INT);
@@ -359,6 +422,11 @@ gnc_column_view_edit_options(SCM options, SCM view)
NULL);
gtk_tree_view_append_column(r->contents, column);
+ /* use the selection cb to update buttons */
+ selection = gtk_tree_view_get_selection(r->contents);
+ g_signal_connect(selection, "changed",
+ G_CALLBACK(gnc_column_view_update_buttons_cb), r);
+
update_available_lists(r);
update_contents_lists(r);
commit 847766fc136154dc35ebcb6eeb7dc7bf6c1bc30a
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Wed Aug 8 15:43:36 2018 +0100
Bug 796788 - strange behaviour in options of multicolumn report
This bug stemmed from the use of GTK_TREE_SORTABLE, the list store
entries for available reports are not stored as entered but in a sorted
order. Replaced the use of entry numbers to that of the report guid and
also used the tree selection to maintain a pointer to the
selected report. Also separated the updating of the two treeviews so
selected report position will be maintained.
diff --git a/gnucash/report/report-gnome/dialog-report-column-view.c b/gnucash/report/report-gnome/dialog-report-column-view.c
index 76e0b9d..84bdd93 100644
--- a/gnucash/report/report-gnome/dialog-report-column-view.c
+++ b/gnucash/report/report-gnome/dialog-report-column-view.c
@@ -41,7 +41,7 @@
enum available_cols
{
AVAILABLE_COL_NAME = 0,
- AVAILABLE_COL_ROW,
+ AVAILABLE_COL_GUID,
NUM_AVAILABLE_COLS
};
@@ -65,8 +65,6 @@ struct gncp_column_view_edit
GNCOptionDB * odb;
SCM available_list;
- int available_selected;
-
SCM contents_list;
int contents_selected;
};
@@ -104,82 +102,95 @@ gnc_column_view_edit_destroy(gnc_column_view_edit * view)
}
static void
-update_display_lists(gnc_column_view_edit * view)
+update_available_lists(gnc_column_view_edit * view)
{
SCM get_rpt_guids = scm_c_eval_string("gnc:all-report-template-guids");
SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
- SCM report_menu_name = scm_c_eval_string("gnc:report-menu-name");
SCM rpt_guids = scm_call_0(get_rpt_guids);
- SCM contents =
- gnc_option_db_lookup_option(view->odb, "__general", "report-list",
- SCM_BOOL_F);
- SCM this_report;
SCM selection;
+
gchar *name;
- int row, i, id;
+ gchar *guid_str;
+
+ GtkTreeModel *model;
GtkListStore *store;
GtkTreeIter iter;
- GtkTreePath *path;
GtkTreeSelection *tree_selection;
-
/* Update the list of available reports (left selection box). */
- row = view->available_selected;
+ tree_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view->available));
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW(view->available));
- if (scm_is_list(view->available_list) && !scm_is_null (view->available_list))
+ if (gtk_tree_selection_get_selected(tree_selection, &model, &iter))
{
- row = MIN (row, scm_ilength (view->available_list) - 1);
- selection = scm_list_ref (view->available_list, scm_from_int (row));
+ gchar *guid_str;
+ gtk_tree_model_get(model, &iter,
+ AVAILABLE_COL_GUID, &guid_str,
+ -1);
+ selection = scm_from_utf8_string(guid_str);
+ g_free (guid_str);
}
else
- {
selection = SCM_UNDEFINED;
- }
scm_gc_unprotect_object(view->available_list);
view->available_list = rpt_guids;
scm_gc_protect_object(view->available_list);
- store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
+ store = GTK_LIST_STORE(model);
gtk_list_store_clear(store);
if (scm_is_list(rpt_guids))
{
- for (i = 0; !scm_is_null(rpt_guids); rpt_guids = SCM_CDR(rpt_guids), i++)
+ for (int i = 0; !scm_is_null(rpt_guids); rpt_guids = SCM_CDR(rpt_guids), i++)
{
- if (scm_is_equal (SCM_CAR(rpt_guids), selection))
- row = i;
- name = gnc_scm_to_utf8_string (scm_call_2(template_menu_name, SCM_CAR(rpt_guids),
+ SCM rpt_guids_temp = SCM_CAR(rpt_guids);
+
+ guid_str = scm_to_utf8_string (rpt_guids_temp);
+ name = gnc_scm_to_utf8_string (scm_call_2(template_menu_name, rpt_guids_temp,
SCM_BOOL_F));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
AVAILABLE_COL_NAME, _(name),
- AVAILABLE_COL_ROW, i,
+ AVAILABLE_COL_GUID, guid_str,
-1);
+
+ if (scm_is_equal (rpt_guids_temp, selection))
+ gtk_tree_selection_select_iter (tree_selection, &iter);
+
g_free (name);
+ g_free (guid_str);
}
-
}
+}
- tree_selection = gtk_tree_view_get_selection(view->available);
- path = gtk_tree_path_new_from_indices(row, -1);
- gtk_tree_selection_select_path(tree_selection, path);
- gtk_tree_path_free(path);
+static void
+update_contents_lists(gnc_column_view_edit * view)
+{
+ SCM report_menu_name = scm_c_eval_string("gnc:report-menu-name");
+ SCM contents =
+ gnc_option_db_lookup_option(view->odb, "__general", "report-list",
+ SCM_BOOL_F);
+ SCM this_report;
+ SCM selection;
+ gchar *name;
+ GtkListStore *store;
+ GtkTreeIter iter;
+ GtkTreeSelection *tree_selection;
/* Update the list of selected reports (right selection box). */
- row = view->contents_selected;
+ tree_selection = gtk_tree_view_get_selection(view->contents);
if (scm_is_list(view->contents_list) && !scm_is_null (view->contents_list))
{
+ int row = view->contents_selected;
row = MIN (row, scm_ilength (view->contents_list) - 1);
- selection = scm_list_ref (view->contents_list, scm_from_int (row));
+ selection = scm_list_ref (view->contents_list, scm_from_int (row));
}
else
- {
selection = SCM_UNDEFINED;
- }
scm_gc_unprotect_object(view->contents_list);
view->contents_list = contents;
@@ -187,14 +198,15 @@ update_display_lists(gnc_column_view_edit * view)
store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
gtk_list_store_clear(store);
+
if (scm_is_list(contents))
{
- for (i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++)
+ for (int i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++)
{
- if (scm_is_equal (SCM_CAR(contents), selection))
- row = i;
+ SCM contents_temp = SCM_CAR(contents);
+
+ int id = scm_to_int(SCM_CAAR(contents));
- id = scm_to_int(SCM_CAAR(contents));
this_report = gnc_report_find(id);
name = gnc_scm_to_utf8_string (scm_call_1(report_menu_name, this_report));
@@ -203,44 +215,16 @@ update_display_lists(gnc_column_view_edit * view)
(store, &iter,
CONTENTS_COL_NAME, _(name),
CONTENTS_COL_ROW, i,
- CONTENTS_COL_REPORT_COLS, scm_to_int(SCM_CADR(SCM_CAR(contents))),
- CONTENTS_COL_REPORT_ROWS, scm_to_int(SCM_CADDR(SCM_CAR(contents))),
+ CONTENTS_COL_REPORT_COLS, scm_to_int(SCM_CADR(contents_temp)),
+ CONTENTS_COL_REPORT_ROWS, scm_to_int(SCM_CADDR(contents_temp)),
-1);
+
+ if (scm_is_equal (contents_temp, selection))
+ gtk_tree_selection_select_iter (tree_selection, &iter);
+
g_free (name);
}
}
-
- tree_selection = gtk_tree_view_get_selection(view->contents);
- path = gtk_tree_path_new_from_indices(row, -1);
- gtk_tree_selection_select_path(tree_selection, path);
- // gtk_tree_view_scroll_to_cell(view->contents, path, NULL, TRUE, 0.5, 0.0);
- gtk_tree_path_free(path);
-}
-
-static void
-gnc_column_view_select_avail_cb(GtkTreeSelection *selection,
- gnc_column_view_edit *r)
-{
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- AVAILABLE_COL_ROW, &r->available_selected,
- -1);
-}
-
-static void
-gnc_column_view_select_contents_cb(GtkTreeSelection *selection,
- gnc_column_view_edit *r)
-{
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- AVAILABLE_COL_ROW, &r->contents_selected,
- -1);
}
static void
@@ -294,7 +278,6 @@ gnc_column_view_edit_options(SCM options, SCM view)
GtkListStore *store;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
ptr = scm_call_1(get_editor, view);
if (ptr != SCM_BOOL_F)
@@ -323,7 +306,6 @@ gnc_column_view_edit_options(SCM options, SCM view)
r->contents = GTK_TREE_VIEW (gtk_builder_get_object (builder, "contents_view"));
r->options = options;
r->view = view;
- r->available_selected = 0;
r->available_list = SCM_EOL;
r->contents_selected = 0;
r->contents_list = SCM_EOL;
@@ -342,7 +324,7 @@ gnc_column_view_edit_options(SCM options, SCM view)
scm_gc_protect_object(r->contents_list);
/* Build the 'available' view */
- store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
+ store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), AVAILABLE_COL_NAME, GTK_SORT_ASCENDING);
g_object_unref(store);
@@ -353,10 +335,6 @@ gnc_column_view_edit_options(SCM options, SCM view)
NULL);
gtk_tree_view_append_column(r->available, column);
- selection = gtk_tree_view_get_selection(r->available);
- g_signal_connect(selection, "changed",
- G_CALLBACK(gnc_column_view_select_avail_cb), r);
-
/* Build the 'contents' view */
store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
G_TYPE_INT, G_TYPE_INT);
@@ -381,11 +359,8 @@ gnc_column_view_edit_options(SCM options, SCM view)
NULL);
gtk_tree_view_append_column(r->contents, column);
- selection = gtk_tree_view_get_selection(r->contents);
- g_signal_connect(selection, "changed",
- G_CALLBACK(gnc_column_view_select_contents_cb), r);
-
- update_display_lists(r);
+ update_available_lists(r);
+ update_contents_lists(r);
gnc_options_dialog_set_apply_cb(r->optwin,
gnc_column_view_edit_apply_cb, r);
@@ -414,12 +389,22 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
SCM oldlist = r->contents_list;
int count;
int oldlength, id;
+ gchar *guid_str;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->available));
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->available));
+ GtkTreeIter iter;
+
+ /* make sure there is a selected entry */
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_tree_model_get(model, &iter,
+ AVAILABLE_COL_GUID, &guid_str, -1);
+ else
+ return;
- if (scm_is_list(r->available_list) &&
- (scm_ilength(r->available_list) > r->available_selected))
+ if (scm_is_list(r->available_list))
{
- template_name = scm_list_ref(r->available_list,
- scm_from_int (r->available_selected));
+ template_name = scm_from_utf8_string(guid_str);
+
new_report = scm_call_1(make_report, template_name);
id = scm_to_int(new_report);
scm_call_2(mark_report, gnc_report_find(id), SCM_BOOL_T);
@@ -461,8 +446,8 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
r->contents_list);
gnc_options_dialog_changed (r->optwin);
}
-
- update_display_lists(r);
+ g_free (guid_str);
+ update_contents_lists(r);
}
void
@@ -473,6 +458,16 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
SCM oldlist = r->contents_list;
int count;
int oldlength;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->contents));
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->contents));
+ GtkTreeIter iter;
+
+ /* make sure there is a selected entry */
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_tree_model_get(model, &iter,
+ CONTENTS_COL_ROW, &r->contents_selected, -1);
+ else
+ return;
if (scm_is_list(r->contents_list))
{
@@ -504,8 +499,7 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
gnc_options_dialog_changed (r->optwin);
}
-
- update_display_lists(r);
+ update_contents_lists(r);
}
void
@@ -517,6 +511,16 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
SCM temp;
int oldlength;
int count;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->contents));
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->contents));
+ GtkTreeIter iter;
+
+ /* make sure there is a selected entry */
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_tree_model_get(model, &iter,
+ CONTENTS_COL_ROW, &r->contents_selected, -1);
+ else
+ return;
oldlength = scm_ilength(r->contents_list);
if ((r->contents_selected > 0) && (oldlength > r->contents_selected))
@@ -542,7 +546,7 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
gnc_options_dialog_changed (r->optwin);
- update_display_lists(r);
+ update_contents_lists(r);
}
}
@@ -555,6 +559,16 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
SCM temp;
int oldlength;
int count;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(r->contents));
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW(r->contents));
+ GtkTreeIter iter;
+
+ /* make sure there is a selected entry */
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_tree_model_get(model, &iter,
+ CONTENTS_COL_ROW, &r->contents_selected, -1);
+ else
+ return;
oldlength = scm_ilength(r->contents_list);
if (oldlength > (r->contents_selected + 1))
@@ -580,7 +594,7 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
gnc_options_dialog_changed (r->optwin);
- update_display_lists(r);
+ update_contents_lists(r);
}
}
@@ -636,7 +650,7 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
current);
scm_gc_protect_object(r->contents_list);
gnc_options_dialog_changed (r->optwin);
- update_display_lists(r);
+ update_contents_lists(r);
}
g_object_unref(G_OBJECT(builder));
commit 1e87d069f651a1c1642b518d734e4cdf5afcd9fb
Merge: de2a1e9 47ad60c
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 16:26:35 2018 +0200
Merge branch 'maint-upgrade-test-balsheet' of https://github.com/christopherlam/gnucash into maint
commit de2a1e9e6793575c1f9dbce41d1c484bd96200ff
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 15:58:38 2018 +0200
A few updates to the guile hacking document
diff --git a/doc/guile-hackers.txt b/doc/guile-hackers.txt
index d759382..df53925 100644
--- a/doc/guile-hackers.txt
+++ b/doc/guile-hackers.txt
@@ -33,10 +33,6 @@ either end. Guile supports a superset of R4RS (the Scheme standard).
For initial experimentation, you can use Guile as an interactive Scheme
shell to play around with the system.
-SLIB is a library for Scheme implementations (including guile)
-that implements a large collection of useful data structures
-and algorithms.
-
FIXME: Starting gnucash as a guile shell. ..
While the Guile documentation (in info format) explains
@@ -50,18 +46,6 @@ FAQs, online copies of the Scheme standard (which is actually
quite readable and useful), and pointers to web tutorials
and other resources.
-g-wrap
-------
-
-Note: gwrap has been replaced by swig and dropped completely in
-SVN-trunk on 2006-10-20 and for gnucash-2.2.0.
-
-(Old info: g-wrap is the tool used to automate the wrapping of C
-functions to make them callable from the guile code. g-wrap is
-now maintained by Rob Browning and is available from
-ftp://ftp.gnucash.org/pub/g-wrap )
-
-
Garbage collection:
-------------------
@@ -97,14 +81,10 @@ use it.
The moral of this story is that if you need to have the C side ferret
away a scheme item for later, you must also keep at least one
reference to that item on the guile side until the C side is finished
-with it. I believe that the guile people have recently come up with a
-nice general solution to this problem, but until that's generally
-available, there are a number of ways you can solve this.
-
-If nothing else, you can just create a global hash on the guile side,
-place the object in question in the hash table, and then have the
-C-side delete that item from the hash when it's finished with it.
+with it.
+You can protect an object using scm_gc_protect_object. When you're done
+with it you can release it using scm_gc_unprotect_object.
Guile Interrupts:
-----------------
commit d69d1f6a32a57ff34f4e80df2e32902719f0c8c8
Merge: 239ee67 2b0b3d4
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 15:52:51 2018 +0200
Merge branch 'maint' of https://github.com/yurchor/gnucash into maint
commit 239ee6797a95b24f8f865997cc4ddb1d91f882ae
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 15:46:23 2018 +0200
Fix crash when cancelling a Save As... overwrite action
This was discovered while trying to fix bug 796792. However that bug itself
is totally unrelated.
diff --git a/libgnucash/backend/xml/gnc-xml-backend.hpp b/libgnucash/backend/xml/gnc-xml-backend.hpp
index 2710115..cc3ff7c 100644
--- a/libgnucash/backend/xml/gnc-xml-backend.hpp
+++ b/libgnucash/backend/xml/gnc-xml-backend.hpp
@@ -61,6 +61,6 @@ private:
std::string m_linkfile;
int m_lockfd;
- QofBook* m_book; /* The primary, main open book */
+ QofBook* m_book = nullptr; /* The primary, main open book */
};
#endif // __GNC_XML_BACKEND_HPP__
commit e330a781f0360a1c5a031c47a67cf5fae1db6126
Merge: 3b74574 97c191c
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Aug 8 14:22:49 2018 +0200
Merge branch 'Bug796792' of https://github.com/Bob-IT/gnucash into maint
commit 2b0b3d4fce4e2f41e0e6857d5812a1dbc723b02c
Author: Yuri Chornoivan <yurchor at ukr.net>
Date: Tue Aug 7 16:25:37 2018 +0300
Fix more minor typos
Signed-off-by: Yuri Chornoivan <yurchor at ukr.net>
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index da5c14a..2d1c600 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -639,7 +639,7 @@ gnc_set_default_gain_loss_account_widget(gnc_commodity *commodity)
{
book_currency_data->default_gain_loss_account_text =
gtk_label_new( _("Because no accounts have " \
- "been set up yet,you will need to return to this " \
+ "been set up yet, you will need to return to this " \
"dialog (via File->Properties), after account setup, " \
"if you want to set a default gain/loss account.") );
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index 53edc3c..9dd28a6 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -72,7 +72,7 @@
</key>
<key name="migrate-prefs-done" type="b">
<default>false</default>
- <summary>Tool to migrate preferences from old backend (CGonf) to new one (GSettings) has run successfully.</summary>
+ <summary>Tool to migrate preferences from old backend (GConf) to new one (GSettings) has run successfully.</summary>
<description>GnuCash switched to another backend to store user preferences between 2.4 and 2.6. To smooth the transition, most preferences will be migrated the first time a 2.6 version of GnuCash is run. This migration should only run once. This preference keeps track whether or not this migration tool has run successfully.</description>
</key>
<key name="retain-type-never" type="b">
diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c
index a39090c..81d278f 100644
--- a/gnucash/import-export/csv-exp/assistant-csv-export.c
+++ b/gnucash/import-export/csv-exp/assistant-csv-export.c
@@ -88,7 +88,7 @@ static const gchar *finish_trans_string = N_(
static const gchar *finish_trans_search_gl_string = N_(
/* Translators: %s is the file name string. */
- "When you click 'Apply', the transactions will be exported to the file '%s.\n\n"
+ "When you click 'Apply', the transactions will be exported to the file '%s'.\n\n"
"You can also verify your selections by clicking on 'Back' or 'Cancel' to Abort Export.\n");
static const gchar *start_tree_string = N_(
commit 97c191cd4208fb5a8f4894968686dbe178f06bbd
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Aug 7 10:33:04 2018 +0100
Replace tabs with spaces and fix some indenting in gnc-file.c
diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c
index 840601e..d983061 100644
--- a/gnucash/gnome-utils/gnc-file.c
+++ b/gnucash/gnome-utils/gnc-file.c
@@ -834,8 +834,8 @@ RESTART:
if (!show_session_error (parent, io_err, newfile, GNC_FILE_DIALOG_OPEN))
{
/* user told us to create a new database. Do it. We
- * shouldn't have to worry about locking or clobbering,
- * it's supposed to be new. */
+ * shouldn't have to worry about locking or clobbering,
+ * it's supposed to be new. */
qof_session_begin (new_session, newfile, FALSE, TRUE, FALSE);
}
}
@@ -1193,14 +1193,14 @@ gnc_file_do_export(GtkWindow *parent, const char * filename)
/* Some extra steps for file based uri's only */
if (gnc_uri_is_file_protocol(protocol))
{
- if (check_file_path (path))
- {
- show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
- GNC_FILE_DIALOG_SAVE);
- return;
- }
- gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
- g_path_get_dirname(path));
+ if (check_file_path (path))
+ {
+ show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
+ GNC_FILE_DIALOG_SAVE);
+ return;
+ }
+ gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
+ g_path_get_dirname(path));
}
/* Check to see if the user specified the same file as the current
* file. If so, prevent the export from happening to avoid killing this file */
@@ -1425,14 +1425,14 @@ gnc_file_do_save_as (GtkWindow *parent, const char* filename)
/* Some extra steps for file based uri's only */
if (gnc_uri_is_file_protocol(protocol))
{
- if (check_file_path (path))
- {
- show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
- GNC_FILE_DIALOG_SAVE);
- return;
- }
- gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
- g_path_get_dirname (path));
+ if (check_file_path (path))
+ {
+ show_session_error (parent, ERR_FILEIO_RESERVED_WRITE, newfile,
+ GNC_FILE_DIALOG_SAVE);
+ return;
+ }
+ gnc_set_default_directory (GNC_PREFS_GROUP_OPEN_SAVE,
+ g_path_get_dirname (path));
}
/* Check to see if the user specified the same file as the current
commit 641925f2d0b7fc54824b7b05136ada0bd605da6f
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Tue Aug 7 10:31:13 2018 +0100
Bug 796792 - SaveAs Overwrite dialogue in background and not visible
Firstly the wrong parent was being used for these secondary warning
messages, should be the dialogue and not the main Gnucash application so
these have been changed.
Also some of these secondary warning dialogues still had NULL as the
parent and so the transient parent warning would occur, added parent.
diff --git a/gnucash/gnome-utils/dialog-file-access.c b/gnucash/gnome-utils/dialog-file-access.c
index ce88602..3126d3b 100644
--- a/gnucash/gnome-utils/dialog-file-access.c
+++ b/gnucash/gnome-utils/dialog-file-access.c
@@ -146,15 +146,15 @@ gnc_ui_file_access_response_cb(GtkDialog *dialog, gint response, GtkDialog *unus
gboolean open_readonly = faw->readonly_checkbutton
? gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(faw->readonly_checkbutton))
: FALSE;
- gnc_file_open_file (gnc_ui_get_main_window (GTK_WIDGET (dialog)), url, open_readonly);
+ gnc_file_open_file (GTK_WINDOW(dialog), url, open_readonly);
}
else if ( faw->type == FILE_ACCESS_SAVE_AS )
{
- gnc_file_do_save_as (gnc_ui_get_main_window (GTK_WIDGET (dialog)), url);
+ gnc_file_do_save_as (GTK_WINDOW(dialog), url);
}
else if ( faw->type == FILE_ACCESS_EXPORT )
{
- gnc_file_do_export (gnc_ui_get_main_window (GTK_WIDGET (dialog)), url);
+ gnc_file_do_export (GTK_WINDOW(dialog), url);
}
break;
diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c
index 72dddbe..840601e 100644
--- a/gnucash/gnome-utils/gnc-file.c
+++ b/gnucash/gnome-utils/gnc-file.c
@@ -1019,7 +1019,7 @@ RESTART:
{
gchar *message = gnc_account_name_violations_errmsg ( gnc_get_account_separator_string(),
invalid_account_names );
- gnc_warning_dialog(NULL, "%s", message);
+ gnc_warning_dialog(parent, "%s", message);
g_free ( message );
}
return TRUE;
@@ -1234,7 +1234,7 @@ gnc_file_do_export(GtkWindow *parent, const char * filename)
else
name = gnc_uri_normalize_uri ( newfile, FALSE );
/* if user says cancel, we should break out */
- if (!gnc_verify_dialog (NULL, FALSE, format, name))
+ if (!gnc_verify_dialog (parent, FALSE, format, name))
{
return;
}
@@ -1269,7 +1269,7 @@ gnc_file_do_export(GtkWindow *parent, const char * filename)
/* %s is the strerror(3) error string of the error that occurred. */
const char *format = _("There was an error saving the file.\n\n%s");
- gnc_error_dialog (NULL, format, strerror(errno));
+ gnc_error_dialog (parent, format, strerror(errno));
return;
}
}
@@ -1471,7 +1471,7 @@ gnc_file_do_save_as (GtkWindow *parent, const char* filename)
name = gnc_uri_normalize_uri ( newfile, FALSE );
/* if user says cancel, we should break out */
- if (!gnc_verify_dialog (NULL, FALSE, format, name ))
+ if (!gnc_verify_dialog (parent, FALSE, format, name ))
{
xaccLogDisable();
qof_session_destroy (new_session);
@@ -1600,7 +1600,7 @@ gnc_file_revert (GtkWindow *parent)
else
filename = fileurl;
- if (!gnc_verify_dialog (NULL, FALSE, title, filename))
+ if (!gnc_verify_dialog (parent, FALSE, title, filename))
return;
qof_book_mark_session_saved (qof_session_get_book (session));
commit 3b74574cde3b808d80d60d7ce8d479d321da79c6
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Aug 2 23:50:06 2018 +0800
[test-stress-options] remove need for test-stress-optionlist.scm
This commit modifies test-stress-options to retrieve the report-list,
and for each report-list, retrieve their options, and for each
multichoice and boolean option, add to optionslist. I now know how to
generate the optionslist dynamically from the unit tests, therefore
there's no need to maintain a test-stress-optionslist.scm anymore. Yay!
diff --git a/gnucash/report/standard-reports/test/test-stress-options.scm b/gnucash/report/standard-reports/test/test-stress-options.scm
index 4265273..e85cd61 100644
--- a/gnucash/report/standard-reports/test/test-stress-options.scm
+++ b/gnucash/report/standard-reports/test/test-stress-options.scm
@@ -26,60 +26,35 @@
;;
;; e.g. COMBINATORICS=/home/user/jenny/jenny ninja check
-(load "test-stress-optionslist.scm")
-;; The above optionslist was generated programmatically. It was
-;; generated by running a sentinel function in the middle of an
-;; existing report renderer. The sentinel function is defined as
-;; follows, then was cleaned up using emacs' indenting. No other
-;; processing was done. Only the multichoice and boolean options for
-;; most reports were dumped. Although this cannot provide whole
-;; coverage for option permutations, it can catch many errors while
-;; refactoring inner functions.
-
-;; (define (mydump)
-;; (with-output-to-file "test-stress-optionslist.scm"
-;; (lambda ()
-;; (display "(define optionslist\n (list \n")
-;; (gnc:report-templates-for-each
-;; (lambda (report-id template)
-;; (let* ((options-generator (gnc:report-template-options-generator template))
-;; (name (gnc:report-template-name template))
-;; (options (and (not (string=? name "General Journal"))
-;; (options-generator))))
-;; (define (disp d)
-;; (define (try proc)
-;; (catch 'wrong-type-arg
-;; (lambda () (proc d))
-;; (const #f)))
-;; (or (and (symbol? d) (string-append "'" (symbol->string d)))
-;; (and (list? d) (string-append "(list " (string-join (map disp d) " ") ")"))
-;; (and (pair? d) (format #f "(cons ~a . ~a)"
-;; (disp (car d))
-;; (disp (cdr d))))
-;; (try gnc-commodity-get-mnemonic)
-;; (try xaccAccountGetName)
-;; (try gnc-budget-get-name)
-;; (format #f "~s" d)))
-;; (format #t "(list (cons 'report-id ~s)\n (cons 'report-name ~s)\n (cons 'options\n (list\n"
-;; report-id (gnc:report-template-name template))
-;; (if options
-;; (gnc:options-for-each
-;; (lambda (option)
-;; (if (memq (gnc:option-type option) '(multichoice boolean))
-;; (format #t " (vector ~s ~s '~s '~s)\n"
-;; (gnc:option-section option)
-;; (gnc:option-name option)
-;; (gnc:option-type option)
-;; (case (gnc:option-type option)
-;; ((multichoice) (map (lambda (d) (vector-ref d 0)) (gnc:option-data option)))
-;; ((boolean) (list #t #f))
-;; ;; (else "\"\"")
-;; (else (disp (gnc:option-value option)))))))
-;; options)
-;; )
-;; (display ")))\n"))))
-;; (display "))\n"))))
+(define optionslist '())
+(define (generate-optionslist)
+ (gnc:report-templates-for-each
+ (lambda (report-id template)
+ (let* ((options-generator (gnc:report-template-options-generator template))
+ (name (gnc:report-template-name template))
+ (options (options-generator)))
+ (set! optionslist
+ (cons (list (cons 'report-id report-id)
+ (cons 'report-name (gnc:report-template-name template))
+ (cons 'options (let ((report-options-tested '()))
+ (gnc:options-for-each
+ (lambda (option)
+ (when (memq (gnc:option-type option)
+ '(multichoice boolean))
+ (set! report-options-tested
+ (cons (vector
+ (gnc:option-section option)
+ (gnc:option-name option)
+ (gnc:option-type option)
+ (case (gnc:option-type option)
+ ((multichoice) (map (lambda (d) (vector-ref d 0))
+ (gnc:option-data option)))
+ ((boolean) (list #t #f))))
+ report-options-tested))))
+ options)
+ report-options-tested)))
+ optionslist))))))
;; Explicitly set locale to make the report output predictable
(setlocale LC_ALL "C")
@@ -87,6 +62,7 @@
(define (run-test)
(test-runner-factory gnc:test-runner)
(test-begin "stress options")
+ (generate-optionslist)
(tests)
(test-end "stress options"))
diff --git a/gnucash/report/standard-reports/test/test-stress-optionslist.scm b/gnucash/report/standard-reports/test/test-stress-optionslist.scm
deleted file mode 100644
index b9c0220..0000000
--- a/gnucash/report/standard-reports/test/test-stress-optionslist.scm
+++ /dev/null
@@ -1,972 +0,0 @@
-(define optionslist
- (list
- (list (cons 'report-id "e9cf815f79db44bcb637d0295093ae3d")
- (cons 'report-name "Assets Over Time")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
- (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show long account names" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "e45218c6d76f11e7b5ef0800277ef320")
- (cons 'report-name "Reconciliation Report")
- (cons 'options
- (list
- (vector "Accounts" "Filter Type" 'multichoice '(none include exclude))
- (vector "Display" "Sign Reverses" 'multichoice '(global none income-expense credit-accounts))
- (vector "Display" "Description" 'boolean '(#t #f))
- (vector "Display" "Amount" 'multichoice '(none single double))
- (vector "Display" "Num" 'boolean '(#t #f))
- (vector "Display" "Shares" 'boolean '(#t #f))
- (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
- (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Detail Level" 'multichoice '(multi-line single))
- (vector "Display" "Account Code" 'boolean '(#t #f))
- (vector "Display" "Memo" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Account Name" 'boolean '(#t #f))
- (vector "Display" "Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Price" 'boolean '(#t #f))
- (vector "Display" "Other Account Code" 'boolean '(#t #f))
- (vector "Display" "Reconciled Date" 'boolean '(#t #f))
- (vector "Display" "Subtotal Table" 'boolean '(#t #f))
- (vector "Display" "Notes" 'boolean '(#t #f))
- (vector "Display" "Date" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Show Informal Debit/Credit Headers" 'boolean '(#t #f))
- (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
- (vector "Filter" "Closing transactions" 'multichoice '(exclude-closing include-both closing-only))
- (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
- (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
- (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
- (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
- (vector "General" "Show original currency amount" 'boolean '(#t #f))
- (vector "General" "Table for Exporting" 'boolean '(#t #f))
- (vector "General" "Add options summary" 'multichoice '(no-match always never))
- (vector "General" "Common Currency" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "583c313fcc484efc974c4c844404f454")
- (cons 'report-name "Budget Income Statement")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Display" "Display as a two column report" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Label the revenue section" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Include expense total" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Include revenue total" 'boolean '(#t #f))
- (vector "Display" "Label the expense section" 'boolean '(#t #f))
- (vector "General" "Report for range of budget periods" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "4166a20981985fd2b07ff8cb3b7d384e")
- (cons 'report-name "Customer Summary")
- (cons 'options
- (list
- (vector "Display" "Sort Order" 'multichoice '(ascend descend))
- (vector "Display" "Show Inactive Customers" 'boolean '(#t #f))
- (vector "Display" "Show Lines with All Zeros" 'boolean '(#t #f))
- (vector "Display" "Show Expense Column" 'boolean '(#t #f))
- (vector "Display" "Sort Column" 'multichoice '(customername profit markup sales expense))
- (vector "Display" "Show Company Address" 'boolean '(#t #f))
- (vector "__reg" "reverse?" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "d8ba4a2e89e8479ca9f6eccdeb164588")
- (cons 'report-name "Multicolumn View")
- (cons 'options
- (list
- )))
- (list (cons 'report-id "216cd0cf6931453ebcce85415aba7082")
- (cons 'report-name "Trial Balance")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Entries" "Adjusting Entries Pattern is regular expression" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
- (vector "Entries" "Adjusting Entries pattern is case-sensitive" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "General" "Report variation" 'multichoice '(current pre-adj work-sheet))
- )))
- (list (cons 'report-id "47f45d7d6d57b68518481c1fc8d4e4ba")
- (cons 'report-name "Future Scheduled Transactions Summary")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Depth limit behavior" 'multichoice '(summarize flatten truncate))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Account Description" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Account Code" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Account Notes" 'boolean '(#t #f))
- (vector "Display" "Account Type" 'boolean '(#t #f))
- (vector "Display" "Account Balance" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "c2a996c8970f43448654ca84f17dda24")
- (cons 'report-name "Equity Statement")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "3dbbc2584da64e7a8674355bc3fbfe3d")
- (cons 'report-name "Australian Tax Invoice")
- (cons 'options
- (list
- (vector "Display" "table-border-collapse" 'boolean '(#t #f))
- (vector "Elements" "Show net price" 'boolean '(#t #f))
- (vector "Elements" "column: Units" 'boolean '(#t #f))
- (vector "Elements" "Show Job number" 'boolean '(#t #f))
- (vector "Elements" "row: Address" 'boolean '(#t #f))
- (vector "Elements" "column: Date" 'boolean '(#t #f))
- (vector "Elements" "column: Tax Rate" 'boolean '(#t #f))
- (vector "Elements" "Invoice number next to title" 'boolean '(#t #f))
- (vector "Elements" "row: Company Name" 'boolean '(#t #f))
- (vector "Elements" "row: Invoice Number" 'boolean '(#t #f))
- (vector "Elements" "Show Job name" 'boolean '(#t #f))
- (vector "Elements" "row: Contact" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "2e3751edeb7544e8a20fd19e9d08bb65")
- (cons 'report-name "Balance Sheet (eguile)")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Accounts" "Exclude accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Negative amount format" 'multichoice '(negsign negbrackets))
- (vector "Display" "1- or 2-column report" 'multichoice '(autocols onecol twocols))
- )))
- (list (cons 'report-id "e9418ff64f2c11e5b61d1c7508d793ed")
- (cons 'report-name "Securities")
- (cons 'options
- (list
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "Display" "Show long names" 'boolean '(#t #f))
- (vector "Display" "Show Percents" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "e1bd09b8a1dd49dd85760db9d82b045c")
- (cons 'report-name "Income Accounts")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "Display" "Show long names" 'boolean '(#t #f))
- (vector "Display" "Show Percents" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "General" "Show Average" 'multichoice '(None YearDelta MonthDelta WeekDelta))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "2e22929e5c5b4b769f615a815ef0c20f")
- (cons 'report-name "General Ledger")
- (cons 'options
- (list
- (vector "Accounts" "Filter Type" 'multichoice '(none include exclude))
- (vector "Display" "Sign Reverses" 'multichoice '(global none income-expense credit-accounts))
- (vector "Display" "Description" 'boolean '(#t #f))
- (vector "Display" "Amount" 'multichoice '(none single double))
- (vector "Display" "Num" 'boolean '(#t #f))
- (vector "Display" "Running Balance" 'boolean '(#t #f))
- (vector "Display" "Shares" 'boolean '(#t #f))
- (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
- (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Detail Level" 'multichoice '(multi-line single))
- (vector "Display" "Account Code" 'boolean '(#t #f))
- (vector "Display" "Memo" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Account Name" 'boolean '(#t #f))
- (vector "Display" "Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Price" 'boolean '(#t #f))
- (vector "Display" "Other Account Code" 'boolean '(#t #f))
- (vector "Display" "Reconciled Date" 'boolean '(#t #f))
- (vector "Display" "Subtotal Table" 'boolean '(#t #f))
- (vector "Display" "Notes" 'boolean '(#t #f))
- (vector "Display" "Date" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Show Informal Debit/Credit Headers" 'boolean '(#t #f))
- (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
- (vector "Filter" "Closing transactions" 'multichoice '(exclude-closing include-both closing-only))
- (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
- (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
- (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
- (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
- (vector "General" "Stylesheet" 'multichoice '(Default Easy Footer #{Head or Tail}# Technicolor))
- (vector "General" "Show original currency amount" 'boolean '(#t #f))
- (vector "General" "Table for Exporting" 'boolean '(#t #f))
- (vector "General" "Add options summary" 'multichoice '(no-match always never))
- (vector "General" "Common Currency" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "9cf76bed17f14401b8e3e22d0079cb98")
- (cons 'report-name "Receivable Aging")
- (cons 'options
- (list
- (vector "Display" "Address Name" 'boolean '(#t #f))
- (vector "Display" "Address 1" 'boolean '(#t #f))
- (vector "Display" "Active" 'boolean '(#t #f))
- (vector "Display" "Address 2" 'boolean '(#t #f))
- (vector "Display" "Address 3" 'boolean '(#t #f))
- (vector "Display" "Address Source" 'multichoice '(billing shipping))
- (vector "Display" "Address Email" 'boolean '(#t #f))
- (vector "Display" "Address Phone" 'boolean '(#t #f))
- (vector "Display" "Address 4" 'boolean '(#t #f))
- (vector "Display" "Address Fax" 'boolean '(#t #f))
- (vector "General" "Sort By" 'multichoice '(name total oldest-bracket))
- (vector "General" "Show zero balance items" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Sort Order" 'multichoice '(increasing decreasing))
- (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
- (vector "General" "Show Multi-currency Totals" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "3ce293441e894423a2425d7a22dd1ac6")
- (cons 'report-name "Fancy Invoice")
- (cons 'options
- (list
- (vector "Display" "Payable to" 'boolean '(#t #f))
- (vector "Display" "Individual Taxes" 'boolean '(#t #f))
- (vector "Display" "Billing Terms" 'boolean '(#t #f))
- (vector "Display" "References" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Invoice Notes" 'boolean '(#t #f))
- (vector "Display" "Billing ID" 'boolean '(#t #f))
- (vector "Display" "Payments" 'boolean '(#t #f))
- (vector "Display" "Company contact" 'boolean '(#t #f))
- (vector "Display Columns" "Tax Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Discount" 'boolean '(#t #f))
- (vector "Display Columns" "Total" 'boolean '(#t #f))
- (vector "Display Columns" "Action" 'boolean '(#t #f))
- (vector "Display Columns" "Taxable" 'boolean '(#t #f))
- (vector "Display Columns" "Quantity" 'boolean '(#t #f))
- (vector "Display Columns" "Price" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "08ae9c2e884b4f9787144f47eacd7f44")
- (cons 'report-name "Employee Report")
- (cons 'options
- (list
- (vector "Display Columns" "Tax" 'boolean '(#t #f))
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Debits" 'boolean '(#t #f))
- (vector "Display Columns" "Type" 'boolean '(#t #f))
- (vector "Display Columns" "Due Date" 'boolean '(#t #f))
- (vector "Display Columns" "Sale" 'boolean '(#t #f))
- (vector "Display Columns" "Reference" 'boolean '(#t #f))
- (vector "Display Columns" "Credits" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
- (vector "__reg" "reverse?" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "8758ba23984c40dea5527f5f0ca2779e")
- (cons 'report-name "Profit & Loss")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
- (vector "Display" "Display as a two column report" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Label the revenue section" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Include expense total" 'boolean '(#t #f))
- (vector "Display" "Include trading accounts total" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Include revenue total" 'boolean '(#t #f))
- (vector "Display" "Label the expense section" 'boolean '(#t #f))
- (vector "Display" "Label the trading accounts section" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "c4173ac99b2b448289bf4d11c731af13")
- (cons 'report-name "Balance Sheet")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Include assets total" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Include liabilities total" 'boolean '(#t #f))
- (vector "Display" "Label the liabilities section" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Label the assets section" 'boolean '(#t #f))
- (vector "Display" "Include equity total" 'boolean '(#t #f))
- (vector "Display" "Label the equity section" 'boolean '(#t #f))
- (vector "General" "Single column Balance Sheet" 'boolean '(#t #f))
- (vector "General" "Use standard US layout" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "c146317be32e4948a561ec7fc89d15c1")
- (cons 'report-name "Customer Report")
- (cons 'options
- (list
- (vector "Display Columns" "Tax" 'boolean '(#t #f))
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Debits" 'boolean '(#t #f))
- (vector "Display Columns" "Type" 'boolean '(#t #f))
- (vector "Display Columns" "Due Date" 'boolean '(#t #f))
- (vector "Display Columns" "Sale" 'boolean '(#t #f))
- (vector "Display Columns" "Reference" 'boolean '(#t #f))
- (vector "Display Columns" "Credits" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
- (vector "__reg" "reverse?" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "2fe3b9833af044abb929a88d5a59620f")
- (cons 'report-name "Transaction Report")
- (cons 'options
- (list
- (vector "Accounts" "Filter Type" 'multichoice '(none include exclude))
- (vector "Display" "Sign Reverses" 'multichoice '(global none income-expense credit-accounts))
- (vector "Display" "Description" 'boolean '(#t #f))
- (vector "Display" "Amount" 'multichoice '(none single double))
- (vector "Display" "Num" 'boolean '(#t #f))
- (vector "Display" "Running Balance" 'boolean '(#t #f))
- (vector "Display" "Shares" 'boolean '(#t #f))
- (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
- (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Detail Level" 'multichoice '(multi-line single))
- (vector "Display" "Account Code" 'boolean '(#t #f))
- (vector "Display" "Memo" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Account Name" 'boolean '(#t #f))
- (vector "Display" "Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Price" 'boolean '(#t #f))
- (vector "Display" "Other Account Code" 'boolean '(#t #f))
- (vector "Display" "Reconciled Date" 'boolean '(#t #f))
- (vector "Display" "Subtotal Table" 'boolean '(#t #f))
- (vector "Display" "Notes" 'boolean '(#t #f))
- (vector "Display" "Date" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Show Informal Debit/Credit Headers" 'boolean '(#t #f))
- (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
- (vector "Filter" "Closing transactions" 'multichoice '(exclude-closing include-both closing-only))
- (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
- (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
- (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
- (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
- (vector "General" "Show original currency amount" 'boolean '(#t #f))
- (vector "General" "Table for Exporting" 'boolean '(#t #f))
- (vector "General" "Add options summary" 'multichoice '(no-match always never))
- (vector "General" "Common Currency" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "e57770f2dbca46619d6dac4ac5469b50")
- (cons 'report-name "Payable Aging")
- (cons 'options
- (list
- (vector "Display" "Address Name" 'boolean '(#t #f))
- (vector "Display" "Address 1" 'boolean '(#t #f))
- (vector "Display" "Active" 'boolean '(#t #f))
- (vector "Display" "Address 2" 'boolean '(#t #f))
- (vector "Display" "Address 3" 'boolean '(#t #f))
- (vector "Display" "Address Email" 'boolean '(#t #f))
- (vector "Display" "Address Phone" 'boolean '(#t #f))
- (vector "Display" "Address 4" 'boolean '(#t #f))
- (vector "Display" "Address Fax" 'boolean '(#t #f))
- (vector "General" "Sort By" 'multichoice '(name total oldest-bracket))
- (vector "General" "Show zero balance items" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Sort Order" 'multichoice '(increasing decreasing))
- (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
- (vector "General" "Show Multi-currency Totals" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "5426e4d987f6444387fe70880e5b28a0")
- (cons 'report-name "Cash Flow Barchart")
- (cons 'options
- (list
- (vector "Accounts" "Include Trading Accounts in report" 'boolean '(#t #f))
- (vector "Display" "Show Table" 'boolean '(#t #f))
- (vector "Display" "Show Money In" 'boolean '(#t #f))
- (vector "Display" "Show Money Out" 'boolean '(#t #f))
- (vector "Display" "Show Net Flow" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "0769e242be474010b4acf264a5512e6e")
- (cons 'report-name "Tax Invoice")
- (cons 'options
- (list
- (vector "Display" "table-border-collapse" 'boolean '(#t #f))
- (vector "Elements" "Show net price" 'boolean '(#t #f))
- (vector "Elements" "column: Units" 'boolean '(#t #f))
- (vector "Elements" "Show Job number" 'boolean '(#t #f))
- (vector "Elements" "row: Address" 'boolean '(#t #f))
- (vector "Elements" "column: Date" 'boolean '(#t #f))
- (vector "Elements" "column: Tax Rate" 'boolean '(#t #f))
- (vector "Elements" "Invoice number next to title" 'boolean '(#t #f))
- (vector "Elements" "row: Company Name" 'boolean '(#t #f))
- (vector "Elements" "row: Invoice Number" 'boolean '(#t #f))
- (vector "Elements" "Show Job name" 'boolean '(#t #f))
- (vector "Elements" "row: Contact" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "dde49fed4ca940959ae7d01b72742530")
- (cons 'report-name "Expenses vs. Day of Week")
- (cons 'options
- (list
- (vector "Accounts" "Include Sub-Accounts" 'boolean '(#t #f))
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "d5adcc61c62e4b8684dd8907448d7900")
- (cons 'report-name "Average Balance")
- (cons 'options
- (list
- (vector "Accounts" "Include Sub-Accounts" 'boolean '(#t #f))
- (vector "Accounts" "Exclude transactions between selected accounts" 'boolean '(#t #f))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show plot" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "25455562bd234dd0b048ecc5a8af9e43")
- (cons 'report-name "General Journal")
- (cons 'options
- (list
- )))
- (list (cons 'report-id "67112f318bef4fc496bdc27d106bbda4")
- (cons 'report-name "Easy Invoice")
- (cons 'options
- (list
- (vector "Display" "My Company" 'boolean '(#t #f))
- (vector "Display" "Subtotal" 'boolean '(#t #f))
- (vector "Display" "Individual Taxes" 'boolean '(#t #f))
- (vector "Display" "Billing Terms" 'boolean '(#t #f))
- (vector "Display" "Due Date" 'boolean '(#t #f))
- (vector "Display" "References" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "My Company ID" 'boolean '(#t #f))
- (vector "Display" "Invoice Notes" 'boolean '(#t #f))
- (vector "Display" "Billing ID" 'boolean '(#t #f))
- (vector "Display" "Payments" 'boolean '(#t #f))
- (vector "Display Columns" "Tax Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Discount" 'boolean '(#t #f))
- (vector "Display Columns" "Total" 'boolean '(#t #f))
- (vector "Display Columns" "Charge Type" 'boolean '(#t #f))
- (vector "Display Columns" "Taxable" 'boolean '(#t #f))
- (vector "Display Columns" "Quantity" 'boolean '(#t #f))
- (vector "Display Columns" "Price" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "3298541c236b494998b236dfad6ad752")
- (cons 'report-name "Account Summary")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Depth limit behavior" 'multichoice '(summarize flatten truncate))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Account Description" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Account Code" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Account Notes" 'boolean '(#t #f))
- (vector "Display" "Account Type" 'boolean '(#t #f))
- (vector "Display" "Account Balance" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "80769921e87943adade887b9835a7685")
- (cons 'report-name "Income/Expense Chart")
- (cons 'options
- (list
- (vector "Display" "Show Income/Expense" 'boolean '(#t #f))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show Net Profit" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "f8921f4e5c284d7caca81e239f468a68")
- (cons 'report-name "Tax Schedule Report/TXF Export")
- (cons 'options
- (list
- (vector "Display" "Do not print transaction detail" 'boolean '(#t #f))
- (vector "Display" "Do not print Action:Memo data" 'boolean '(#t #f))
- (vector "Display" "Currency conversion date" 'multichoice '(conv-to-tran-date conv-to-report-date))
- (vector "Display" "Print TXF export parameters" 'boolean '(#t #f))
- (vector "Display" "Print all Transfer To/From Accounts" 'boolean '(#t #f))
- (vector "Display" "Suppress $0.00 values" 'boolean '(#t #f))
- (vector "Display" "Do not use special date processing" 'boolean '(#t #f))
- (vector "Display" "Do not print full account names" 'boolean '(#t #f))
- (vector "General" "Alternate Period" 'multichoice '(from-to #{1st-est}# #{2nd-est}# #{3rd-est}# #{4th-est}# last-year #{1st-last}# #{2nd-last}# #{3rd-last}# #{4th-last}#))
- )))
- (list (cons 'report-id "810ed4b25ef0486ea43bbd3dddb32b11")
- (cons 'report-name "Budget Report")
- (cons 'options
- (list
- (vector "Accounts" "Always show sub-accounts" 'boolean '(#t #f))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Accounts" "Account Display Depth" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Actual" 'boolean '(#t #f))
- (vector "Display" "Show Budget" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances and budget values" 'boolean '(#t #f))
- (vector "Display" "Roll up budget amounts to parent" 'boolean '(#t #f))
- (vector "Display" "Show Column with Totals" 'boolean '(#t #f))
- (vector "Display" "Show Difference" 'boolean '(#t #f))
- (vector "General" "Report for range of budget periods" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Range end" 'multichoice '(first previous current next last manual))
- (vector "General" "Include collapsed periods before selected." 'boolean '(#t #f))
- (vector "General" "Range start" 'multichoice '(first previous current next last manual))
- (vector "General" "Include collapsed periods after selected." 'boolean '(#t #f))
- (vector "General" "Show Full Account Names" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "cbba1696c8c24744848062c7f1cf4a72")
- (cons 'report-name "Net Worth Barchart")
- (cons 'options
- (list
- (vector "Display" "Show Asset & Liability" 'boolean '(#t #f))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show Net Worth" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "4a6b82e8678c4f3d9e85d9f09634ca89")
- (cons 'report-name "Investment Portfolio")
- (cons 'options
- (list
- (vector "Accounts" "Include accounts with no shares" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "44f81bee049b4b3ea908f8dac9a9474e")
- (cons 'report-name "Income Over Time")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
- (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show long account names" 'boolean '(#t #f))
- (vector "General" "Show Average" 'multichoice '(None MonthDelta WeekDelta DayDelta))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "5bf27f249a0d11e7abc4cec278b6b50a")
- (cons 'report-name "Income and GST Statement")
- (cons 'options
- (list
- (vector "Display" "Description" 'boolean '(#t #f))
- (vector "Display" "Num" 'boolean '(#t #f))
- (vector "Display" "Tax payable" 'boolean '(#t #f))
- (vector "Display" "Individual income columns" 'boolean '(#t #f))
- (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
- (vector "Display" "Net Income" 'boolean '(#t #f))
- (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Individual expense columns" 'boolean '(#t #f))
- (vector "Display" "Account Code" 'boolean '(#t #f))
- (vector "Display" "Individual tax columns" 'boolean '(#t #f))
- (vector "Display" "Remittance amount" 'boolean '(#t #f))
- (vector "Display" "Memo" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Account Name" 'boolean '(#t #f))
- (vector "Display" "Other Account Name" 'boolean '(#t #f))
- (vector "Display" "Other Account Code" 'boolean '(#t #f))
- (vector "Display" "Reconciled Date" 'boolean '(#t #f))
- (vector "Display" "Subtotal Table" 'boolean '(#t #f))
- (vector "Display" "Notes" 'boolean '(#t #f))
- (vector "Display" "Date" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
- (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
- (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
- (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
- (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
- (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
- (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
- (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
- (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
- (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
- (vector "General" "Table for Exporting" 'boolean '(#t #f))
- (vector "General" "Add options summary" 'multichoice '(no-match always never))
- (vector "General" "Common Currency" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "3fe6dce77da24c66bdc8f8efdea7f9ac")
- (cons 'report-name "Liabilities")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "Display" "Show long names" 'boolean '(#t #f))
- (vector "Display" "Show Percents" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "5123a759ceb9483abf2182d01c140e8d")
- (cons 'report-name "Printable Invoice")
- (cons 'options
- (list
- (vector "Display" "Individual Taxes" 'boolean '(#t #f))
- (vector "Display" "Billing Terms" 'boolean '(#t #f))
- (vector "Display" "References" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Invoice Notes" 'boolean '(#t #f))
- (vector "Display" "Billing ID" 'boolean '(#t #f))
- (vector "Display" "Payments" 'boolean '(#t #f))
- (vector "Display" "Job Details" 'boolean '(#t #f))
- (vector "Display Columns" "Tax Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Discount" 'boolean '(#t #f))
- (vector "Display Columns" "Total" 'boolean '(#t #f))
- (vector "Display Columns" "Action" 'boolean '(#t #f))
- (vector "Display Columns" "Taxable" 'boolean '(#t #f))
- (vector "Display Columns" "Quantity" 'boolean '(#t #f))
- (vector "Display Columns" "Price" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "21d7cfc59fc74f22887596ebde7e462d")
- (cons 'report-name "Advanced Portfolio")
- (cons 'options
- (list
- (vector "Accounts" "Include accounts with no shares" 'boolean '(#t #f))
- (vector "Display" "Show ticker symbols" 'boolean '(#t #f))
- (vector "Display" "Show number of shares" 'boolean '(#t #f))
- (vector "Display" "Show prices" 'boolean '(#t #f))
- (vector "Display" "Show listings" 'boolean '(#t #f))
- (vector "General" "How to report brokerage fees" 'multichoice '(include-in-basis include-in-gain ignore-brokerage))
- (vector "General" "Price Source" 'multichoice '(pricedb-latest pricedb-nearest))
- (vector "General" "Basis calculation method" 'multichoice '(average-basis fifo-basis filo-basis))
- (vector "General" "Set preference for price list data" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "7eb3df21073d4c33920a0257da15fba5")
- (cons 'report-name "Receipt")
- (cons 'options
- (list
- )))
- (list (cons 'report-id "e6e34fa3b6e748debde3cb3bc76d3e53")
- (cons 'report-name "Budget Flow")
- (cons 'options
- (list
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "b1f15b2052c149df93e698fe85a81ea6")
- (cons 'report-name "Expense Over Time")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
- (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show long account names" 'boolean '(#t #f))
- (vector "General" "Show Average" 'multichoice '(None MonthDelta WeekDelta DayDelta))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "898d78ec92854402bf76e20a36d24ade")
- (cons 'report-name "Hello, World")
- (cons 'options
- (list
- (vector "Hello, World!" "Multi Choice Option" 'multichoice '(first second third fourth))
- (vector "Hello, World!" "Boolean Option" 'boolean '(#t #f))
- (vector "Testing" "Crash the report" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "5e2d129f28d14df881c3e47e3053f604")
- (cons 'report-name "Income vs. Day of Week")
- (cons 'options
- (list
- (vector "Accounts" "Include Sub-Accounts" 'boolean '(#t #f))
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "faf410e8f8da481fbc09e4763da40bcc")
- (cons 'report-name "Liabilities Over Time")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
- (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show long account names" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "0b81a3bdfd504aff849ec2e8630524bc")
- (cons 'report-name "Income Statement")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
- (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
- (vector "Display" "Display as a two column report" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Label the revenue section" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Include expense total" 'boolean '(#t #f))
- (vector "Display" "Include trading accounts total" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Include revenue total" 'boolean '(#t #f))
- (vector "Display" "Label the expense section" 'boolean '(#t #f))
- (vector "Display" "Label the trading accounts section" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "415cd38d39054d9e9c4040455290c2b1")
- (cons 'report-name "Budget Chart")
- (cons 'options
- (list
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Chart Type" 'multichoice '(bars lines))
- (vector "Display" "Running Sum" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "f8748b813fab4220ba26e743aedf38da")
- (cons 'report-name "Cash Flow")
- (cons 'options
- (list
- (vector "Accounts" "Always show sub-accounts" 'boolean '(#t #f))
- (vector "Accounts" "Include Trading Accounts in report" 'boolean '(#t #f))
- (vector "Accounts" "Account Display Depth" 'multichoice '(all 1 2 3 4 5 6))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "General" "Show Full Account Names" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "65135608f2014c6ca8412793a8cdf169")
- (cons 'report-name "Welcome to GnuCash")
- (cons 'options
- (list
- )))
- (list (cons 'report-id "d7d1e53505ee4b1b82efad9eacedaea0")
- (cons 'report-name "Vendor Report")
- (cons 'options
- (list
- (vector "Display Columns" "Tax" 'boolean '(#t #f))
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Debits" 'boolean '(#t #f))
- (vector "Display Columns" "Type" 'boolean '(#t #f))
- (vector "Display Columns" "Due Date" 'boolean '(#t #f))
- (vector "Display Columns" "Sale" 'boolean '(#t #f))
- (vector "Display Columns" "Reference" 'boolean '(#t #f))
- (vector "Display Columns" "Credits" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
- (vector "__reg" "reverse?" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "5518ac227e474f47a34439f2d4d049de")
- (cons 'report-name "Job Report")
- (cons 'options
- (list
- (vector "Display Columns" "Description" 'boolean '(#t #f))
- (vector "Display Columns" "Amount" 'boolean '(#t #f))
- (vector "Display Columns" "Type" 'boolean '(#t #f))
- (vector "Display Columns" "Due Date" 'boolean '(#t #f))
- (vector "Display Columns" "Reference" 'boolean '(#t #f))
- (vector "Display Columns" "Date" 'boolean '(#t #f))
- (vector "__reg" "reverse?" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "e5fa5ce805e840ecbeca4dba3fa4ead9")
- (cons 'report-name "Budget Profit & Loss")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Display" "Display as a two column report" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Label the revenue section" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Include expense total" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Include revenue total" 'boolean '(#t #f))
- (vector "Display" "Label the expense section" 'boolean '(#t #f))
- (vector "General" "Report for range of budget periods" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "e533c998186b11e1b2e2001558291366")
- (cons 'report-name "Income & Expense Linechart")
- (cons 'options
- (list
- (vector "Display" "Grid" 'boolean '(#t #f))
- (vector "Display" "Data markers?" 'boolean '(#t #f))
- (vector "Display" "Show Income/Expense" 'boolean '(#t #f))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show Net Profit" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "22104e02654c4adba844ee75a3f8d173")
- (cons 'report-name "Register")
- (cons 'options
- (list
- (vector "Display" "Description" 'boolean '(#t #f))
- (vector "Display" "Account" 'boolean '(#t #f))
- (vector "Display" "Amount" 'multichoice '(single double))
- (vector "Display" "Num" 'boolean '(#t #f))
- (vector "Display" "Running Balance" 'boolean '(#t #f))
- (vector "Display" "Shares" 'boolean '(#t #f))
- (vector "Display" "Lot" 'boolean '(#t #f))
- (vector "Display" "Memo" 'boolean '(#t #f))
- (vector "Display" "Totals" 'boolean '(#t #f))
- (vector "Display" "Price" 'boolean '(#t #f))
- (vector "Display" "Date" 'boolean '(#t #f))
- (vector "Display" "Value" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "d8b63264186b11e19038001558291366")
- (cons 'report-name "Net Worth Linechart")
- (cons 'options
- (list
- (vector "Display" "Grid" 'boolean '(#t #f))
- (vector "Display" "Show Asset & Liability" 'boolean '(#t #f))
- (vector "Display" "Data markers?" 'boolean '(#t #f))
- (vector "Display" "Show table" 'boolean '(#t #f))
- (vector "Display" "Show Net Worth" 'boolean '(#t #f))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "1d241609fd4644caad765c95be20ff4c")
- (cons 'report-name "Price")
- (cons 'options
- (list
- (vector "Display" "Marker" 'multichoice '(diamond circle square cross plus dash filleddiamond filledcircle filledsquare))
- (vector "Price" "Invert prices" 'boolean '(#t #f))
- (vector "Price" "Price Source" 'multichoice '(weighted-average actual-transactions pricedb))
- (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
- )))
- (list (cons 'report-id "ecc35ea9dbfa4e20ba389fc85d59cb69")
- (cons 'report-name "Budget Balance Sheet")
- (cons 'options
- (list
- (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
- (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
- (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
- (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
- (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
- (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
- (vector "Display" "Include assets total" 'boolean '(#t #f))
- (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
- (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
- (vector "Display" "Include liabilities total" 'boolean '(#t #f))
- (vector "Display" "Label the liabilities section" 'boolean '(#t #f))
- (vector "Display" "Include new/existing totals" 'boolean '(#t #f))
- (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
- (vector "Display" "Label the assets section" 'boolean '(#t #f))
- (vector "Display" "Include equity total" 'boolean '(#t #f))
- (vector "Display" "Label the equity section" 'boolean '(#t #f))
- (vector "General" "Single column Balance Sheet" 'boolean '(#t #f))
- )))
- (list (cons 'report-id "5c7fd8a1fe9a4cd38884ff54214aa88a")
- (cons 'report-name "Assets")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "Display" "Show long names" 'boolean '(#t #f))
- (vector "Display" "Show Percents" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- (list (cons 'report-id "9bf1892805cb4336be6320fe48ce5446")
- (cons 'report-name "Expense Accounts")
- (cons 'options
- (list
- (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
- (vector "Display" "Show Totals" 'boolean '(#t #f))
- (vector "Display" "Show long names" 'boolean '(#t #f))
- (vector "Display" "Show Percents" 'boolean '(#t #f))
- (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
- (vector "General" "Show Average" 'multichoice '(None YearDelta MonthDelta WeekDelta))
- (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
- )))
- ))
commit 47ad60c7235503134f6c1b8cdde232db2b507d48
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 31 11:22:07 2018 +0800
[test-balsheet-pnl] add more SELL transactions
this is to thoroughly test average-cost and weighted-average
diff --git a/gnucash/report/standard-reports/test/test-balsheet-pnl.scm b/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
index d02cb48..954798e 100644
--- a/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
+++ b/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
@@ -125,8 +125,10 @@
;; pre-existing GBPs
(env-transfer-foreign env 01 01 1970 bank1current foreignsavings 130 100 #:description "buy 100GBP at $1.30")
(env-transfer-foreign env 01 02 1970 bank1current foreignsavings 140 100 #:description "buy 100GBP at $1.40")
+ (env-transfer-foreign env 15 02 1970 bank1current foreignsavings -142 -100 #:description "sell 100GBP at $1.42")
(env-transfer-foreign env 01 03 1970 bank1current foreignsavings 150 100 #:description "buy 100GBP at $1.50")
(env-transfer-foreign env 01 04 1970 bank1current foreignsavings 155 100 #:description "buy 100GBP at $1.55")
+ (env-transfer-foreign env 15 04 1970 bank1current foreignsavings -157 -100 #:description "sell 100GBP at $1.57")
(env-transfer-foreign env 01 05 1970 bank1current foreignsavings -160 -100 #:description "sell 100GBP at $1.60")
(env-transfer-foreign env 01 06 1970 bank1current foreignsavings 155 100 #:description "buy 100GBP at $1.55")
(env-transfer-foreign env 01 07 1970 bank1current foreignsavings -145 -100 #:description "sell 100GBP at $1.45")
@@ -168,25 +170,25 @@
(env-transfer env 01 01 1980 income bank1current 250)
(env-transfer env 01 01 1980 income-GBP foreignsavings 500)
(env-transfer-foreign env 01 02 1980 income-GBP bank1current 100 170 #:description "earn 100GBP into $170")
-
+
;; Finally we can begin testing balsheet
(display "\n\n balsheet tests\n\n")
(let* ((balance-sheet-options (default-balsheet-testing-options))
(sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-default")))
- (test-equal "total assets = $116,010"
- (list "$116,010.00")
+ (test-equal "total assets = $116,009"
+ (list "$116,009.00")
(sxml->table-row-col sxml 1 15 6))
(test-equal "total liabilities = $9,500.00"
(list "$9,500.00")
(sxml->table-row-col sxml 1 23 6))
- (test-equal "total equity = $106,510.00"
- (list "$106,510.00")
+ (test-equal "total equity = $106,509.00"
+ (list "$106,509.00")
(sxml->table-row-col sxml 1 28 6))
(set-option! balance-sheet-options "Commodities" "Price Source" 'weighted-average)
(let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-weighted-average")))
- (test-equal "weighted average assets = $114,072.86"
- (list "$114,072.86")
+ (test-equal "weighted average assets = $114,071.66"
+ (list "$114,071.66")
(sxml->table-row-col sxml 1 15 6)))
(set-option! balance-sheet-options "Commodities" "Price Source" 'average-cost)
@@ -197,14 +199,14 @@
(set-option! balance-sheet-options "Commodities" "Price Source" 'pricedb-nearest)
(let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-pricedb-nearest")))
- (test-equal "pricedb-nearest assets = $116,010"
- (list "$116,010.00")
+ (test-equal "pricedb-nearest assets = $116,009"
+ (list "$116,009.00")
(sxml->table-row-col sxml 1 15 6)))
(set-option! balance-sheet-options "Commodities" "Price Source" 'pricedb-latest)
(let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-pricedb-latest")))
- (test-equal "pricedb-latest assets = $122,090"
- (list "$122,090.00")
+ (test-equal "pricedb-latest assets = $122,049"
+ (list "$122,049.00")
(sxml->table-row-col sxml 1 15 6)))
;; set multilevel subtotal style
@@ -224,8 +226,8 @@
(test-equal "multilevel. bonds = $2,000.00"
(list "$2,000.00")
(sxml->table-row-col sxml 1 6 3))
- (test-equal "multilevel. current = $2310.00"
- (list "$2,310.00")
+ (test-equal "multilevel. current = $2609.00"
+ (list "$2,609.00")
(sxml->table-row-col sxml 1 7 3))
(test-equal "multilevel. empty = $0.00"
(list "$0.00")
@@ -233,8 +235,8 @@
(test-equal "multilevel. savings = $100.00"
(list "$100.00")
(sxml->table-row-col sxml 1 9 3))
- (test-equal "multilevel. total bank1 = $4,410"
- (list "$4,410.00")
+ (test-equal "multilevel. total bank1 = $4709"
+ (list "$4,709.00")
(sxml->table-row-col sxml 1 10 4))
(test-equal "multilevel. broker = $2,000.00"
(list "$2,000.00")
@@ -248,23 +250,23 @@
(test-equal "multilevel. foreign = $0.00"
(list "$0.00")
(sxml->table-row-col sxml 1 14 3))
- (test-equal "multilevel. foreignsavings = #400.00 = $680"
- (list "#400.00" "$680.00" "$680.00")
+ (test-equal "multilevel. foreignsavings = #200.00 = $340"
+ (list "#200.00" "$340.00" "$340.00")
(sxml->table-row-col sxml 1 15 3))
- (test-equal "multilevel. total foreign = $680"
- (list "$680.00")
+ (test-equal "multilevel. total foreign = $340"
+ (list "$340.00")
(sxml->table-row-col sxml 1 16 4))
(test-equal "multilevel. house = $100,000"
(list "$100,000.00")
(sxml->table-row-col sxml 1 17 4))
- (test-equal "multilevel. total asset = $122,090"
- (list "$122,090.00")
+ (test-equal "multilevel. total asset = $122,049"
+ (list "$122,049.00")
(sxml->table-row-col sxml 1 18 5))
- (test-equal "multilevel. total root = $122,090"
- (list "$122,090.00")
+ (test-equal "multilevel. total root = $122,049"
+ (list "$122,049.00")
(sxml->table-row-col sxml 1 19 6))
- (test-equal "multilevel. total assets = $122,090"
- (list "$122,090.00")
+ (test-equal "multilevel. total assets = $122,049"
+ (list "$122,049.00")
(sxml->table-row-col sxml 1 20 6)))
;; set recursive-subtotal subtotal style
@@ -272,19 +274,19 @@
(set-option! balance-sheet-options "Display" "Parent account subtotals" 'f)
(let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-recursive")))
(test-equal "recursive. root = $760+15000+104600"
- (list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
+ (list "#200.00" "$340.00" "30 FUNDS" "$15,000.00" "$106,709.00" "$106,709.00")
(sxml->table-row-col sxml 1 3 6))
(test-equal "recursive. assets = $760+15000+104600"
- (list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
+ (list "#200.00" "$340.00" "30 FUNDS" "$15,000.00" "$106,709.00" "$106,709.00")
(sxml->table-row-col sxml 1 4 5))
- (test-equal "recursive. bank1 = $4,410.00"
- (list "$4,410.00")
+ (test-equal "recursive. bank1 = $4,709.00"
+ (list "$4,709.00")
(sxml->table-row-col sxml 1 5 4))
(test-equal "recursive. bonds = $2,000.00"
(list "$2,000.00")
(sxml->table-row-col sxml 1 6 3))
- (test-equal "recursive. current = $2310.00"
- (list "$2,310.00")
+ (test-equal "recursive. current = $2609.00"
+ (list "$2,609.00")
(sxml->table-row-col sxml 1 7 3))
(test-equal "recursive. empty = $0.00"
(list "$0.00")
@@ -298,24 +300,24 @@
(test-equal "recursive. funds = $15,000.00"
(list "30 FUNDS" "$15,000.00" "$15,000.00")
(sxml->table-row-col sxml 1 11 3))
- (test-equal "recursive. foreign = $680.00"
- (list "#400.00" "$680.00")
+ (test-equal "recursive. foreign = $340.00"
+ (list "#200.00" "$340.00")
(sxml->table-row-col sxml 1 12 4))
- (test-equal "recursive. foreignsavings = #400.00 = $760"
- (list "#400.00" "$680.00" "$680.00")
+ (test-equal "recursive. foreignsavings = #200.00 = $340"
+ (list "#200.00" "$340.00" "$340.00")
(sxml->table-row-col sxml 1 13 3))
(test-equal "recursive. house = $100,000"
(list "$100,000.00")
(sxml->table-row-col sxml 1 14 4))
- (test-equal "recursive. total assets = $122,090.00"
- (list "$122,090.00")
+ (test-equal "recursive. total assets = $122,049.00"
+ (list "$122,049.00")
(sxml->table-row-col sxml 1 15 6)))
(set-option! balance-sheet-options "Commodities" "Show Foreign Currencies" #f)
(set-option! balance-sheet-options "Commodities" "Show Exchange Rates" #f)
(let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-disable show-fcur show-rates")))
(test-equal "show-fcur disabled"
- (list "$122,090.00")
+ (list "$122,049.00")
(sxml->table-row-col sxml 1 3 6))
(test-equal "show-rates disabled"
'()
@@ -325,7 +327,7 @@
(set-option! balance-sheet-options "Commodities" "Show Exchange Rates" #t)
(let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-enable show-fcur show-rates")))
(test-equal "show-fcur enabled"
- (list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
+ (list "#200.00" "$340.00" "30 FUNDS" "$15,000.00" "$106,709.00" "$106,709.00")
(sxml->table-row-col sxml 1 3 6))
(test-equal "show-rates enabled"
(list "1 FUNDS" "$500.00" "#1.00" "$1.70")
@@ -368,14 +370,14 @@
(set-option! pnl-options "Commodities" "Price Source" 'weighted-average)
(let ((sxml (options->sxml pnl-uuid pnl-options "pnl-weighted-average")))
- (test-equal "weighted average revenue = $1163.33"
- (list "$1,163.33" "$1,163.33")
+ (test-equal "weighted average revenue = $1160.36"
+ (list "$1,160.36" "$1,160.36")
(sxml->table-row-col sxml 1 5 6)))
(set-option! pnl-options "Commodities" "Price Source" 'average-cost)
(let ((sxml (options->sxml pnl-uuid pnl-options "pnl-average-cost")))
- (test-equal "average-cost revenue = $1,090"
- (list "$1,090.00" "$1,090.00")
+ (test-equal "average-cost revenue = $976"
+ (list "$976.00" "$976.00")
(sxml->table-row-col sxml 1 5 6)))
(set-option! pnl-options "Commodities" "Price Source" 'pricedb-nearest)
commit 58ae3f2a89f2e3ec6d818234aa1d874fd16bb446
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 24 09:29:55 2018 +0800
[test-balsheet-pnl] add income-statement tests
diff --git a/gnucash/report/standard-reports/test/test-balsheet-pnl.scm b/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
index 8a13dc4..d02cb48 100644
--- a/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
+++ b/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
@@ -2,6 +2,7 @@
(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
(use-modules (gnucash engine test test-extras))
(use-modules (gnucash report standard-reports balance-sheet))
+(use-modules (gnucash report standard-reports income-statement))
(use-modules (gnucash report stylesheets))
(use-modules (gnucash report report-system))
(use-modules (gnucash report report-system test test-extras))
@@ -10,19 +11,20 @@
(use-modules (sxml simple))
(use-modules (sxml xpath))
-;; This is implementation testing for Balance Sheet.
+;; This is implementation testing for Balance Sheet and Profit&Loss.
(define balance-sheet-uuid "c4173ac99b2b448289bf4d11c731af13")
+(define pnl-uuid "0b81a3bdfd504aff849ec2e8630524bc")
;; Explicitly set locale to make the report output predictable
(setlocale LC_ALL "C")
(define (run-test)
(test-runner-factory gnc:test-runner)
- (test-begin "balsheet.scm")
+ (test-begin "balsheet and profit&loss")
(null-test)
- (balsheet-tests)
- (test-end "balsheet.scm"))
+ (balsheet-pnl-tests)
+ (test-end "balsheet and profit&loss"))
(define (options->sxml uuid options test-title)
(gnc:options->sxml uuid options "test-balsheet-pnl" test-title))
@@ -78,7 +80,7 @@
(let ((balance-sheet-options (gnc:make-report-options balance-sheet-uuid)))
(test-assert "null-test" (options->sxml balance-sheet-uuid balance-sheet-options "null-test"))))
-(define (balsheet-tests)
+(define (balsheet-pnl-tests)
;; This function will perform implementation testing on the transaction report.
(let* ((env (create-test-env))
(account-alist (env-create-account-structure-alist env structure))
@@ -103,6 +105,14 @@
(set-option! balance-sheet-options "Commodities" "Show Exchange Rates" #t)
balance-sheet-options))
+ (define (default-pnl-testing-options)
+ (let ((pnl-options (gnc:make-report-options pnl-uuid)))
+ (set-option! pnl-options "General" "Start Date" (cons 'absolute (gnc-dmy2time64 1 1 1980)))
+ (set-option! pnl-options "General" "End Date" (cons 'absolute (gnc-dmy2time64 1 1 1981)))
+ (set-option! pnl-options "Accounts" "Levels of Subaccounts" 'all)
+ (set-option! pnl-options "Commodities" "Show Exchange Rates" #t)
+ pnl-options))
+
;; $100 in Savings account
(env-transfer env 01 01 1970 equity bank1savings 100)
;; $2000 in Bonds
@@ -159,7 +169,8 @@
(env-transfer env 01 01 1980 income-GBP foreignsavings 500)
(env-transfer-foreign env 01 02 1980 income-GBP bank1current 100 170 #:description "earn 100GBP into $170")
- ;; Finally we can begin testing
+ ;; Finally we can begin testing balsheet
+ (display "\n\n balsheet tests\n\n")
(let* ((balance-sheet-options (default-balsheet-testing-options))
(sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-default")))
(test-equal "total assets = $116,010"
@@ -343,4 +354,101 @@
(test-equal "incl-zb-accts=#t"
'("Empty" "$0.00")
(sxml->table-row-col sxml 1 8 #f)))
+ )
+
+ (display "\n\n pnl tests\n\n")
+ (let* ((pnl-options (default-pnl-testing-options))
+ (sxml (options->sxml pnl-uuid pnl-options "pnl-default")))
+ (test-equal "total revenue = $1,270.00"
+ (list "$1,270.00" "$1,270.00")
+ (sxml->table-row-col sxml 1 5 6))
+ (test-equal "total expenses = $0.00"
+ (list "$0.00" "$0.00")
+ (sxml->table-row-col sxml 1 3 6))
+
+ (set-option! pnl-options "Commodities" "Price Source" 'weighted-average)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-weighted-average")))
+ (test-equal "weighted average revenue = $1163.33"
+ (list "$1,163.33" "$1,163.33")
+ (sxml->table-row-col sxml 1 5 6)))
+
+ (set-option! pnl-options "Commodities" "Price Source" 'average-cost)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-average-cost")))
+ (test-equal "average-cost revenue = $1,090"
+ (list "$1,090.00" "$1,090.00")
+ (sxml->table-row-col sxml 1 5 6)))
+
+ (set-option! pnl-options "Commodities" "Price Source" 'pricedb-nearest)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-pricedb-nearest")))
+ (test-equal "pricedb-nearest revenue = $1270"
+ (list "$1,270.00" "$1,270.00")
+ (sxml->table-row-col sxml 1 5 6)))
+
+ (set-option! pnl-options "Commodities" "Price Source" 'pricedb-latest)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-pricedb-latest")))
+ (test-equal "pricedb-latest revenue = $1270"
+ (list "$1,270.00" "$1,270.00")
+ (sxml->table-row-col sxml 1 5 6)))
+
+ ;; set multilevel subtotal style
+ ;; verifies amount in EVERY line of the report.
+ (set-option! pnl-options "Display" "Parent account balances" 'immediate-bal)
+ (set-option! pnl-options "Display" "Parent account subtotals" 't)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-multilevel")))
+ (test-equal "multilevel. income = -$250.00"
+ (list "-$250.00" "-$250.00")
+ (sxml->table-row-col sxml 1 3 5))
+ (test-equal "multilevel. income-GBP = $0.00"
+ (list "-#600.00" "-$1,020.00" "-#600.00" "-$1,020.00")
+ (sxml->table-row-col sxml 1 4 5))
+ (test-equal "multilevel. total income = -$1,270.00"
+ (list "-$1,270.00" "-$1,270.00")
+ (sxml->table-row-col sxml 1 5 6))
+ (test-equal "multilevel. total revenue = $1,270.00"
+ (list "$1,270.00" "$1,270.00")
+ (sxml->table-row-col sxml 1 6 6))
+ (test-equal "multilevel. expenses = $0.00"
+ (list "$0.00" "$0.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "multilevel. net-income = $1,270"
+ (list "$1,270.00" "$1,270.00")
+ (sxml->table-row-col sxml 1 4 6)))
+
+ ;; set recursive-subtotal subtotal style
+ (set-option! pnl-options "Display" "Parent account balances" 'recursive-bal)
+ (set-option! pnl-options "Display" "Parent account subtotals" 'f)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-recursive")))
+ (test-equal "recursive. income = $1020+250"
+ (list "-#600.00" "-$1,020.00" "-$250.00" "-$250.00" "$0.00" "-#600.00" "-$1,020.00" "-$250.00" "-$250.00" "$0.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "recursive. income-gbp = $1020"
+ (list "-#600.00" "-$1,020.00" "-#600.00" "-$1,020.00")
+ (sxml->table-row-col sxml 1 4 5))
+ (test-equal "recursive. total revenue = $1270"
+ (list "$1,270.00" "$1,270.00")
+ (sxml->table-row-col sxml 1 5 6)))
+
+ (set-option! pnl-options "Commodities" "Show Foreign Currencies" #f)
+ (set-option! pnl-options "Commodities" "Show Exchange Rates" #f)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-disable show-fcur show-rates")))
+ (test-equal "show-fcur disabled"
+ (list "-$1,270.00" "$0.00" "-$1,270.00" "$0.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "show-rates disabled"
+ '()
+ (sxml->table-row-col sxml 2 #f #f)))
+
+ (set-option! pnl-options "Commodities" "Show Foreign Currencies" #t)
+ (set-option! pnl-options "Commodities" "Show Exchange Rates" #t)
+ (let ((sxml (options->sxml pnl-uuid pnl-options "pnl-enable show-fcur show-rates")))
+ (test-equal "show-fcur enabled"
+ (list "-#600.00" "-$1,020.00" "-$250.00" "-$250.00" "$0.00" "-#600.00" "-$1,020.00" "-$250.00" "-$250.00" "$0.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "show-rates enabled"
+ (list "#1.00" "$1.70")
+ (sxml->table-row-col sxml 2 #f #f)))
+
+ ;;make-multilevel
+ (set-option! pnl-options "Display" "Parent account balances" 'immediate-bal)
+ (set-option! pnl-options "Display" "Parent account subtotals" 't)
)))
commit cabb598c0f0428d0dcc4f43c3b4713acbb1bb0f5
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 24 08:28:45 2018 +0800
[test-balsheet-pnl] rename to allow for pnl tests
diff --git a/gnucash/report/standard-reports/test/CMakeLists.txt b/gnucash/report/standard-reports/test/CMakeLists.txt
index 7fbdd4f..651a06b 100644
--- a/gnucash/report/standard-reports/test/CMakeLists.txt
+++ b/gnucash/report/standard-reports/test/CMakeLists.txt
@@ -9,7 +9,7 @@ set(scm_test_standard_reports_SOURCES
set(scm_test_with_srfi64_SOURCES
test-charts.scm
test-transaction.scm
- test-balance-sheet.scm
+ test-balsheet-pnl.scm
test-income-gst.scm
)
diff --git a/gnucash/report/standard-reports/test/test-balance-sheet.scm b/gnucash/report/standard-reports/test/test-balsheet-pnl.scm
similarity index 100%
rename from gnucash/report/standard-reports/test/test-balance-sheet.scm
rename to gnucash/report/standard-reports/test/test-balsheet-pnl.scm
commit 8273f3eb824d230f347464cc01df2d58f1338e05
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 24 08:27:18 2018 +0800
[test-balance-sheet] prepare for pnl tests
This commit prepares for pnl tests - variables are prefixed with
balance-sheet- to accommodate pnl- tests
diff --git a/gnucash/report/standard-reports/test/test-balance-sheet.scm b/gnucash/report/standard-reports/test/test-balance-sheet.scm
index 2876089..8a13dc4 100644
--- a/gnucash/report/standard-reports/test/test-balance-sheet.scm
+++ b/gnucash/report/standard-reports/test/test-balance-sheet.scm
@@ -24,8 +24,8 @@
(balsheet-tests)
(test-end "balsheet.scm"))
-(define (options->sxml options test-title)
- (gnc:options->sxml balance-sheet-uuid options "test-balsheet" test-title))
+(define (options->sxml uuid options test-title)
+ (gnc:options->sxml uuid options "test-balsheet-pnl" test-title))
(define (set-option! options section name value)
(let ((option (gnc:lookup-option options section name)))
@@ -75,8 +75,8 @@
(define (null-test)
;; This null-test tests for the presence of report.
- (let ((options (gnc:make-report-options balance-sheet-uuid)))
- (test-assert "null-test" (options->sxml options "null-test"))))
+ (let ((balance-sheet-options (gnc:make-report-options balance-sheet-uuid)))
+ (test-assert "null-test" (options->sxml balance-sheet-uuid balance-sheet-options "null-test"))))
(define (balsheet-tests)
;; This function will perform implementation testing on the transaction report.
@@ -96,12 +96,12 @@
(income-GBP (cdr (assoc "Income-GBP" account-alist)))
(YEAR (gnc:time64-get-year (gnc:get-today))))
- (define (default-testing-options)
- (let ((options (gnc:make-report-options balance-sheet-uuid)))
- (set-option! options "General" "Balance Sheet Date" (cons 'absolute (gnc-dmy2time64 1 1 1971)))
- (set-option! options "Accounts" "Levels of Subaccounts" 'all)
- (set-option! options "Commodities" "Show Exchange Rates" #t)
- options))
+ (define (default-balsheet-testing-options)
+ (let ((balance-sheet-options (gnc:make-report-options balance-sheet-uuid)))
+ (set-option! balance-sheet-options "General" "Balance Sheet Date" (cons 'absolute (gnc-dmy2time64 1 1 1971)))
+ (set-option! balance-sheet-options "Accounts" "Levels of Subaccounts" 'all)
+ (set-option! balance-sheet-options "Commodities" "Show Exchange Rates" #t)
+ balance-sheet-options))
;; $100 in Savings account
(env-transfer env 01 01 1970 equity bank1savings 100)
@@ -160,8 +160,8 @@
(env-transfer-foreign env 01 02 1980 income-GBP bank1current 100 170 #:description "earn 100GBP into $170")
;; Finally we can begin testing
- (let* ((options (default-testing-options))
- (sxml (options->sxml options "default")))
+ (let* ((balance-sheet-options (default-balsheet-testing-options))
+ (sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-default")))
(test-equal "total assets = $116,010"
(list "$116,010.00")
(sxml->table-row-col sxml 1 15 6))
@@ -172,35 +172,35 @@
(list "$106,510.00")
(sxml->table-row-col sxml 1 28 6))
- (set-option! options "Commodities" "Price Source" 'weighted-average)
- (let ((sxml (options->sxml options "weighted-average")))
+ (set-option! balance-sheet-options "Commodities" "Price Source" 'weighted-average)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-weighted-average")))
(test-equal "weighted average assets = $114,072.86"
(list "$114,072.86")
(sxml->table-row-col sxml 1 15 6)))
- (set-option! options "Commodities" "Price Source" 'average-cost)
- (let ((sxml (options->sxml options "average-cost")))
+ (set-option! balance-sheet-options "Commodities" "Price Source" 'average-cost)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-average-cost")))
(test-equal "average-cost assets = $113,100"
(list "$113,100.00")
(sxml->table-row-col sxml 1 15 6)))
- (set-option! options "Commodities" "Price Source" 'pricedb-nearest)
- (let ((sxml (options->sxml options "pricedb-nearest")))
+ (set-option! balance-sheet-options "Commodities" "Price Source" 'pricedb-nearest)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-pricedb-nearest")))
(test-equal "pricedb-nearest assets = $116,010"
(list "$116,010.00")
(sxml->table-row-col sxml 1 15 6)))
- (set-option! options "Commodities" "Price Source" 'pricedb-latest)
- (let ((sxml (options->sxml options "pricedb-latest")))
+ (set-option! balance-sheet-options "Commodities" "Price Source" 'pricedb-latest)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-pricedb-latest")))
(test-equal "pricedb-latest assets = $122,090"
(list "$122,090.00")
(sxml->table-row-col sxml 1 15 6)))
;; set multilevel subtotal style
;; verifies amount in EVERY line of the report.
- (set-option! options "Display" "Parent account balances" 'immediate-bal)
- (set-option! options "Display" "Parent account subtotals" 't)
- (let ((sxml (options->sxml options "multilevel")))
+ (set-option! balance-sheet-options "Display" "Parent account balances" 'immediate-bal)
+ (set-option! balance-sheet-options "Display" "Parent account subtotals" 't)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-multilevel")))
(test-equal "multilevel. root = $0.00"
(list "$0.00")
(sxml->table-row-col sxml 1 3 5))
@@ -257,9 +257,9 @@
(sxml->table-row-col sxml 1 20 6)))
;; set recursive-subtotal subtotal style
- (set-option! options "Display" "Parent account balances" 'recursive-bal)
- (set-option! options "Display" "Parent account subtotals" 'f)
- (let ((sxml (options->sxml options "recursive")))
+ (set-option! balance-sheet-options "Display" "Parent account balances" 'recursive-bal)
+ (set-option! balance-sheet-options "Display" "Parent account subtotals" 'f)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-recursive")))
(test-equal "recursive. root = $760+15000+104600"
(list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
(sxml->table-row-col sxml 1 3 6))
@@ -300,9 +300,9 @@
(list "$122,090.00")
(sxml->table-row-col sxml 1 15 6)))
- (set-option! options "Commodities" "Show Foreign Currencies" #f)
- (set-option! options "Commodities" "Show Exchange Rates" #f)
- (let ((sxml (options->sxml options "disable show-fcur show-rates")))
+ (set-option! balance-sheet-options "Commodities" "Show Foreign Currencies" #f)
+ (set-option! balance-sheet-options "Commodities" "Show Exchange Rates" #f)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-disable show-fcur show-rates")))
(test-equal "show-fcur disabled"
(list "$122,090.00")
(sxml->table-row-col sxml 1 3 6))
@@ -310,9 +310,9 @@
'()
(sxml->table-row-col sxml 2 #f #f)))
- (set-option! options "Commodities" "Show Foreign Currencies" #t)
- (set-option! options "Commodities" "Show Exchange Rates" #t)
- (let ((sxml (options->sxml options "enable show-fcur show-rates")))
+ (set-option! balance-sheet-options "Commodities" "Show Foreign Currencies" #t)
+ (set-option! balance-sheet-options "Commodities" "Show Exchange Rates" #t)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-enable show-fcur show-rates")))
(test-equal "show-fcur enabled"
(list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
(sxml->table-row-col sxml 1 3 6))
@@ -321,12 +321,12 @@
(sxml->table-row-col sxml 2 #f #f)))
;;make-multilevel
- (set-option! options "Display" "Parent account balances" 'immediate-bal)
- (set-option! options "Display" "Parent account subtotals" 't)
+ (set-option! balance-sheet-options "Display" "Parent account balances" 'immediate-bal)
+ (set-option! balance-sheet-options "Display" "Parent account subtotals" 't)
- (set-option! options "Display" "Omit zero balance figures" #t)
- (set-option! options "Display" "Include accounts with zero total balances" #f)
- (let ((sxml (options->sxml options "incl-zb-accts=#f omit-zb-bals=#t")))
+ (set-option! balance-sheet-options "Display" "Omit zero balance figures" #t)
+ (set-option! balance-sheet-options "Display" "Include accounts with zero total balances" #f)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-incl-zb-accts=#f omit-zb-bals=#t")))
(test-equal "omit-zb-bals=#t"
'()
(sxml->table-row-col sxml 1 3 5))
@@ -334,9 +334,9 @@
'("Savings" "$100.00") ;i.e.skips "Empty" account with $0.00
(sxml->table-row-col sxml 1 8 #f)))
- (set-option! options "Display" "Omit zero balance figures" #f)
- (set-option! options "Display" "Include accounts with zero total balances" #t)
- (let ((sxml (options->sxml options "incl-zb-accts=#t omit-zb-bals=#f")))
+ (set-option! balance-sheet-options "Display" "Omit zero balance figures" #f)
+ (set-option! balance-sheet-options "Display" "Include accounts with zero total balances" #t)
+ (let ((sxml (options->sxml balance-sheet-uuid balance-sheet-options "balsheet-incl-zb-accts=#t omit-zb-bals=#f")))
(test-equal "omit-zb-bals=#f"
(list "$0.00")
(sxml->table-row-col sxml 1 3 5))
commit 8cbd4d629f8c23e0b312d51a37882cd37904dee2
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Jul 23 22:51:29 2018 +0800
[test-balance-sheet] upgrade to better coverage of balance-sheet
This commit upgrades test-balance-sheet to cover most sensitive data.
It specifically generates the following types of transactions, and
tests the balance sheet generated.
- Equity-USD to nested accounts
- Equity-USD to ForeignBank-GBP
- Equity-USD to Broker:FUNDS
- buy/sell from equity to GBP and FUNDS
- Broker and Broker:FUNDS both have splits with amounts
Two main subtotal strategies are tested: multilevel and recursive-bal,
and all amounts are tested.
diff --git a/gnucash/report/standard-reports/test/test-balance-sheet.scm b/gnucash/report/standard-reports/test/test-balance-sheet.scm
index 61016b1..2876089 100644
--- a/gnucash/report/standard-reports/test/test-balance-sheet.scm
+++ b/gnucash/report/standard-reports/test/test-balance-sheet.scm
@@ -33,18 +33,45 @@
(gnc:option-set-value option value)
(test-assert (format #f "wrong-option ~a ~a" section name) #f))))
+(define (mnemonic->commodity sym)
+ (gnc-commodity-table-lookup
+ (gnc-commodity-table-get-table (gnc-get-current-book))
+ (gnc-commodity-get-namespace (gnc-default-report-currency))
+ sym))
+
+(define USD (gnc-default-report-currency)) ;default currency should be USD because LC_ALL="C"
+(define GBP (mnemonic->commodity "GBP"))
+(define FUNDS (gnc-commodity-new (gnc-get-current-book)
+ "Funds" ;fullname
+ "FUNDS" ;namespace
+ "FUNDS" ;mnemonic
+ "FUNDS" ;cusip
+ 1000 ;fraction
+ ))
+(gnc-commodity-set-user-symbol GBP "#")
+
(define structure
- (list "Root" (list (cons 'type ACCT-TYPE-ASSET))
+ (list "Root" (list (cons 'type ACCT-TYPE-ASSET)
+ (cons 'commodity USD))
(list "Asset"
- (list "Bank"
- (list "Bank-Sub"))
- (list "A/Receivable" (list (cons 'type ACCT-TYPE-RECEIVABLE))))
- (list "Liability" (list (cons 'type ACCT-TYPE-PAYABLE))
- (list "CreditCard")
- (list "A/Payable"))
+ (list "Bank1"
+ (list "Savings")
+ (list "Bonds")
+ (list "Empty")
+ (list "Current"))
+ (list "House")
+ (list "ForeignBank" (list (cons 'commodity GBP))
+ (list "ForeignSavings"))
+ (list "Broker"
+ (list "Funds" (list (cons 'type ACCT-TYPE-STOCK)
+ (cons 'commodity FUNDS)))))
+ (list "Liability" (list (cons 'type ACCT-TYPE-LIABILITY))
+ (list "Bank2"
+ (list "Loan")
+ (list "CreditCard")))
(list "Equity" (list (cons 'type ACCT-TYPE-EQUITY)))
- (list "Income" (list (cons 'type ACCT-TYPE-INCOME)))
- (list "Expenses" (list (cons 'type ACCT-TYPE-EXPENSE)))))
+ (list "Income" (list (cons 'type ACCT-TYPE-INCOME))
+ (list "Income-GBP" (list (cons 'commodity GBP))))))
(define (null-test)
;; This null-test tests for the presence of report.
@@ -55,86 +82,265 @@
;; This function will perform implementation testing on the transaction report.
(let* ((env (create-test-env))
(account-alist (env-create-account-structure-alist env structure))
- (bank (cdr (assoc "Bank" account-alist)))
- (banksub (cdr (assoc "Bank-Sub" account-alist)))
- (income (cdr (assoc "Income" account-alist)))
- (expense (cdr (assoc "Expenses" account-alist)))
+ (bank1savings (cdr (assoc "Savings" account-alist)))
+ (bank1bonds (cdr (assoc "Bonds" account-alist)))
+ (bank1current (cdr (assoc "Current" account-alist)))
+ (house (cdr (assoc "House" account-alist)))
+ (foreignsavings (cdr (assoc "ForeignSavings" account-alist)))
+ (broker (cdr (assoc "Broker" account-alist)))
+ (brokerfunds (cdr (assoc "Funds" account-alist)))
+ (bank2loan (cdr (assoc "Loan" account-alist)))
+ (bank2creditcard (cdr (assoc "CreditCard" account-alist)))
(equity (cdr (assoc "Equity" account-alist)))
- (creditcard (cdr (assoc "CreditCard" account-alist)))
- (payable (cdr (assoc "A/Payable" account-alist)))
- (receivable (cdr (assoc "A/Receivable" account-alist)))
+ (income (cdr (assoc "Income" account-alist)))
+ (income-GBP (cdr (assoc "Income-GBP" account-alist)))
(YEAR (gnc:time64-get-year (gnc:get-today))))
(define (default-testing-options)
- ;; To ease testing of transaction report, we will set default
- ;; options for generating reports. We will elable extra columns
- ;; for Exporting, disable generation of informational text, and
- ;; disable indenting. These options will be tested separately as
- ;; the first test group. By default, we'll select the modern dates.
(let ((options (gnc:make-report-options balance-sheet-uuid)))
- (set-option! options "General" "Balance Sheet Date" (cons 'relative 'end-cal-year))
+ (set-option! options "General" "Balance Sheet Date" (cons 'absolute (gnc-dmy2time64 1 1 1971)))
+ (set-option! options "Accounts" "Levels of Subaccounts" 'all)
+ (set-option! options "Commodities" "Show Exchange Rates" #t)
options))
- (define* (create-txn DD MM YY DESC list-of-splits #:optional txn-type)
- (let ((txn (xaccMallocTransaction (gnc-get-current-book))))
- (xaccTransBeginEdit txn)
- (xaccTransSetDescription txn DESC)
- (xaccTransSetCurrency txn (gnc-default-report-currency))
- (xaccTransSetDate txn DD MM YY)
- (for-each
- (lambda (tfr)
- (let ((split (xaccMallocSplit (gnc-get-current-book))))
- (xaccSplitSetParent split txn)
- (xaccSplitSetAccount split (cdr tfr))
- (xaccSplitSetValue split (car tfr))
- (xaccSplitSetAmount split (car tfr))))
- list-of-splits)
- (if txn-type
- (xaccTransSetTxnType txn txn-type))
- (xaccTransCommitEdit txn)
- txn))
-
- (create-txn 1 1 YEAR "invoice charge $100"
- (list (cons -100 income)
- (cons 100 receivable))
- TXN-TYPE-INVOICE)
-
- (create-txn 1 2 YEAR "receive part-payment $98"
- (list (cons -98 receivable)
- (cons 98 bank))
- TXN-TYPE-PAYMENT)
-
- (create-txn 1 3 YEAR "receive bill $55"
- (list (cons 55 expense)
- (cons -55 payable))
- TXN-TYPE-INVOICE)
-
- (create-txn 1 4 YEAR "part-pay bill $50 using creditcard"
- (list (cons 50 payable)
- (cons -50 creditcard))
- TXN-TYPE-PAYMENT)
-
- (create-txn 1 5 YEAR "part-pay creditcard from bank"
- (list (cons 47 creditcard)
- (cons -47 banksub)))
+ ;; $100 in Savings account
+ (env-transfer env 01 01 1970 equity bank1savings 100)
+ ;; $2000 in Bonds
+ (env-transfer env 01 01 1970 equity bank1bonds 2000)
+ ;; $500 in Current Acc
+ (env-transfer env 01 01 1970 equity bank1current 9000)
+ ;; $100,000 in house
+ (env-transfer env 01 01 1970 equity house 100000)
- ;; Finally we can begin testing
- (test-begin "display options")
+ ;; pre-existing GBPs
+ (env-transfer-foreign env 01 01 1970 bank1current foreignsavings 130 100 #:description "buy 100GBP at $1.30")
+ (env-transfer-foreign env 01 02 1970 bank1current foreignsavings 140 100 #:description "buy 100GBP at $1.40")
+ (env-transfer-foreign env 01 03 1970 bank1current foreignsavings 150 100 #:description "buy 100GBP at $1.50")
+ (env-transfer-foreign env 01 04 1970 bank1current foreignsavings 155 100 #:description "buy 100GBP at $1.55")
+ (env-transfer-foreign env 01 05 1970 bank1current foreignsavings -160 -100 #:description "sell 100GBP at $1.60")
+ (env-transfer-foreign env 01 06 1970 bank1current foreignsavings 155 100 #:description "buy 100GBP at $1.55")
+ (env-transfer-foreign env 01 07 1970 bank1current foreignsavings -145 -100 #:description "sell 100GBP at $1.45")
+ (env-transfer-foreign env 01 08 1970 bank1current foreignsavings 165 100 #:description "buy 100GBP at $1.65")
+
+ ;; broker has $2000
+ (env-transfer env 01 01 1970 equity broker 2000)
+
+ ;; existing FUNDs = 200 USD on 01/01/1970
+ (env-transfer-foreign env 01 01 1970 bank1current brokerfunds 2000 10 #:description "buy 10FUND at $200")
+ (env-transfer-foreign env 01 02 1970 bank1current brokerfunds 2100 10 #:description "buy 10FUND at $210")
+ (env-transfer-foreign env 01 03 1970 bank1current brokerfunds 2250 10 #:description "buy 10FUND at $225")
+ (env-transfer-foreign env 01 04 1970 bank1current brokerfunds 2440 10 #:description "buy 10FUND at $244")
+ (env-transfer-foreign env 01 05 1970 bank1current brokerfunds -2640 -10 #:description "sell 10FUND at $264")
+ (env-transfer-foreign env 01 06 1970 bank1current brokerfunds -2550 -10 #:description "sell 10FUND at $255")
+ (env-transfer-foreign env 01 07 1970 bank1current brokerfunds 2500 10 #:description "buy 10FUND at $250")
+
+ ;; $9000 loan
+ (env-transfer env 01 01 1970 equity bank2loan -9000)
+
+ ;; $500 on creditcard debt
+ (env-transfer env 01 01 1970 equity bank2creditcard -500)
+ ;; further prices into pricedb
+ ;; GBP = 1.50 to 1.90 USD
+ (gnc-pricedb-create USD GBP (gnc-dmy2time64 1 1 1971) 15/10)
+ (gnc-pricedb-create USD GBP (gnc-dmy2time64 1 1 1972) 16/10)
+ (gnc-pricedb-create USD GBP (gnc-dmy2time64 1 1 1973) 17/10)
+ (gnc-pricedb-create USD GBP (gnc-dmy2time64 1 1 1974) 18/10)
+ (gnc-pricedb-create USD GBP (gnc-dmy2time64 1 1 1975) 19/10)
+ ;; FUND = 300 to 500 USD
+ (gnc-pricedb-create USD FUNDS (gnc-dmy2time64 1 1 1971) 300)
+ (gnc-pricedb-create USD FUNDS (gnc-dmy2time64 1 1 1972) 350)
+ (gnc-pricedb-create USD FUNDS (gnc-dmy2time64 1 1 1973) 400)
+ (gnc-pricedb-create USD FUNDS (gnc-dmy2time64 1 1 1974) 450)
+ (gnc-pricedb-create USD FUNDS (gnc-dmy2time64 1 1 1975) 500)
+
+ ;; a couple INCOME transactions, a decade later
+ (env-transfer env 01 01 1980 income bank1current 250)
+ (env-transfer env 01 01 1980 income-GBP foreignsavings 500)
+ (env-transfer-foreign env 01 02 1980 income-GBP bank1current 100 170 #:description "earn 100GBP into $170")
+
+ ;; Finally we can begin testing
(let* ((options (default-testing-options))
(sxml (options->sxml options "default")))
+ (test-equal "total assets = $116,010"
+ (list "$116,010.00")
+ (sxml->table-row-col sxml 1 15 6))
+ (test-equal "total liabilities = $9,500.00"
+ (list "$9,500.00")
+ (sxml->table-row-col sxml 1 23 6))
+ (test-equal "total equity = $106,510.00"
+ (list "$106,510.00")
+ (sxml->table-row-col sxml 1 28 6))
+
+ (set-option! options "Commodities" "Price Source" 'weighted-average)
+ (let ((sxml (options->sxml options "weighted-average")))
+ (test-equal "weighted average assets = $114,072.86"
+ (list "$114,072.86")
+ (sxml->table-row-col sxml 1 15 6)))
+
+ (set-option! options "Commodities" "Price Source" 'average-cost)
+ (let ((sxml (options->sxml options "average-cost")))
+ (test-equal "average-cost assets = $113,100"
+ (list "$113,100.00")
+ (sxml->table-row-col sxml 1 15 6)))
+
+ (set-option! options "Commodities" "Price Source" 'pricedb-nearest)
+ (let ((sxml (options->sxml options "pricedb-nearest")))
+ (test-equal "pricedb-nearest assets = $116,010"
+ (list "$116,010.00")
+ (sxml->table-row-col sxml 1 15 6)))
+
+ (set-option! options "Commodities" "Price Source" 'pricedb-latest)
+ (let ((sxml (options->sxml options "pricedb-latest")))
+ (test-equal "pricedb-latest assets = $122,090"
+ (list "$122,090.00")
+ (sxml->table-row-col sxml 1 15 6)))
+
+ ;; set multilevel subtotal style
+ ;; verifies amount in EVERY line of the report.
+ (set-option! options "Display" "Parent account balances" 'immediate-bal)
+ (set-option! options "Display" "Parent account subtotals" 't)
+ (let ((sxml (options->sxml options "multilevel")))
+ (test-equal "multilevel. root = $0.00"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 3 5))
+ (test-equal "multilevel. assets = $0.00"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 4 4))
+ (test-equal "multilevel. bank1 = $0.00"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 5 3))
+ (test-equal "multilevel. bonds = $2,000.00"
+ (list "$2,000.00")
+ (sxml->table-row-col sxml 1 6 3))
+ (test-equal "multilevel. current = $2310.00"
+ (list "$2,310.00")
+ (sxml->table-row-col sxml 1 7 3))
+ (test-equal "multilevel. empty = $0.00"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 8 3))
+ (test-equal "multilevel. savings = $100.00"
+ (list "$100.00")
+ (sxml->table-row-col sxml 1 9 3))
+ (test-equal "multilevel. total bank1 = $4,410"
+ (list "$4,410.00")
+ (sxml->table-row-col sxml 1 10 4))
+ (test-equal "multilevel. broker = $2,000.00"
+ (list "$2,000.00")
+ (sxml->table-row-col sxml 1 11 3))
+ (test-equal "multilevel. funds = $15,000.00"
+ (list "30 FUNDS" "$15,000.00" "$15,000.00")
+ (sxml->table-row-col sxml 1 12 3))
+ (test-equal "multilevel. total broker = $17,000.00"
+ (list "$17,000.00")
+ (sxml->table-row-col sxml 1 13 4))
+ (test-equal "multilevel. foreign = $0.00"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 14 3))
+ (test-equal "multilevel. foreignsavings = #400.00 = $680"
+ (list "#400.00" "$680.00" "$680.00")
+ (sxml->table-row-col sxml 1 15 3))
+ (test-equal "multilevel. total foreign = $680"
+ (list "$680.00")
+ (sxml->table-row-col sxml 1 16 4))
+ (test-equal "multilevel. house = $100,000"
+ (list "$100,000.00")
+ (sxml->table-row-col sxml 1 17 4))
+ (test-equal "multilevel. total asset = $122,090"
+ (list "$122,090.00")
+ (sxml->table-row-col sxml 1 18 5))
+ (test-equal "multilevel. total root = $122,090"
+ (list "$122,090.00")
+ (sxml->table-row-col sxml 1 19 6))
+ (test-equal "multilevel. total assets = $122,090"
+ (list "$122,090.00")
+ (sxml->table-row-col sxml 1 20 6)))
+
+ ;; set recursive-subtotal subtotal style
+ (set-option! options "Display" "Parent account balances" 'recursive-bal)
+ (set-option! options "Display" "Parent account subtotals" 'f)
+ (let ((sxml (options->sxml options "recursive")))
+ (test-equal "recursive. root = $760+15000+104600"
+ (list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "recursive. assets = $760+15000+104600"
+ (list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
+ (sxml->table-row-col sxml 1 4 5))
+ (test-equal "recursive. bank1 = $4,410.00"
+ (list "$4,410.00")
+ (sxml->table-row-col sxml 1 5 4))
+ (test-equal "recursive. bonds = $2,000.00"
+ (list "$2,000.00")
+ (sxml->table-row-col sxml 1 6 3))
+ (test-equal "recursive. current = $2310.00"
+ (list "$2,310.00")
+ (sxml->table-row-col sxml 1 7 3))
+ (test-equal "recursive. empty = $0.00"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 8 3))
+ (test-equal "recursive. savings = $100.00"
+ (list "$100.00")
+ (sxml->table-row-col sxml 1 9 3))
+ (test-equal "recursive. broker = $15000+2000.00"
+ (list "30 FUNDS" "$15,000.00" "$2,000.00" "$2,000.00")
+ (sxml->table-row-col sxml 1 10 4))
+ (test-equal "recursive. funds = $15,000.00"
+ (list "30 FUNDS" "$15,000.00" "$15,000.00")
+ (sxml->table-row-col sxml 1 11 3))
+ (test-equal "recursive. foreign = $680.00"
+ (list "#400.00" "$680.00")
+ (sxml->table-row-col sxml 1 12 4))
+ (test-equal "recursive. foreignsavings = #400.00 = $760"
+ (list "#400.00" "$680.00" "$680.00")
+ (sxml->table-row-col sxml 1 13 3))
+ (test-equal "recursive. house = $100,000"
+ (list "$100,000.00")
+ (sxml->table-row-col sxml 1 14 4))
+ (test-equal "recursive. total assets = $122,090.00"
+ (list "$122,090.00")
+ (sxml->table-row-col sxml 1 15 6)))
+
+ (set-option! options "Commodities" "Show Foreign Currencies" #f)
+ (set-option! options "Commodities" "Show Exchange Rates" #f)
+ (let ((sxml (options->sxml options "disable show-fcur show-rates")))
+ (test-equal "show-fcur disabled"
+ (list "$122,090.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "show-rates disabled"
+ '()
+ (sxml->table-row-col sxml 2 #f #f)))
- (test-equal "total assets = $53.00"
- (list "Total Assets" "$53.00")
- (sxml->table-row-col sxml 1 7 #f))
+ (set-option! options "Commodities" "Show Foreign Currencies" #t)
+ (set-option! options "Commodities" "Show Exchange Rates" #t)
+ (let ((sxml (options->sxml options "enable show-fcur show-rates")))
+ (test-equal "show-fcur enabled"
+ (list "#400.00" "$680.00" "30 FUNDS" "$15,000.00" "$106,410.00" "$106,410.00")
+ (sxml->table-row-col sxml 1 3 6))
+ (test-equal "show-rates enabled"
+ (list "1 FUNDS" "$500.00" "#1.00" "$1.70")
+ (sxml->table-row-col sxml 2 #f #f)))
- (test-equal "total liabilities = $8.00"
- (list "Total Liabilities" "$8.00")
- (sxml->table-row-col sxml 1 14 #f))
+ ;;make-multilevel
+ (set-option! options "Display" "Parent account balances" 'immediate-bal)
+ (set-option! options "Display" "Parent account subtotals" 't)
- (test-equal "total equity = $45.00"
- (list "Total Equity" "$45.00")
- (sxml->table-row-col sxml 1 19 #f))
+ (set-option! options "Display" "Omit zero balance figures" #t)
+ (set-option! options "Display" "Include accounts with zero total balances" #f)
+ (let ((sxml (options->sxml options "incl-zb-accts=#f omit-zb-bals=#t")))
+ (test-equal "omit-zb-bals=#t"
+ '()
+ (sxml->table-row-col sxml 1 3 5))
+ (test-equal "incl-zb-accts=#f"
+ '("Savings" "$100.00") ;i.e.skips "Empty" account with $0.00
+ (sxml->table-row-col sxml 1 8 #f)))
- )
- (test-end "display options")))
+ (set-option! options "Display" "Omit zero balance figures" #f)
+ (set-option! options "Display" "Include accounts with zero total balances" #t)
+ (let ((sxml (options->sxml options "incl-zb-accts=#t omit-zb-bals=#f")))
+ (test-equal "omit-zb-bals=#f"
+ (list "$0.00")
+ (sxml->table-row-col sxml 1 3 5))
+ (test-equal "incl-zb-accts=#t"
+ '("Empty" "$0.00")
+ (sxml->table-row-col sxml 1 8 #f)))
+ )))
commit 47ba21b8dc62b26dfb167b454c45f6be838e29f8
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Jul 23 23:08:06 2018 +0800
[test-extras] export gnc-pricedb-create
diff --git a/libgnucash/engine/test/test-extras.scm b/libgnucash/engine/test/test-extras.scm
index c1d37b7..a040132 100644
--- a/libgnucash/engine/test/test-extras.scm
+++ b/libgnucash/engine/test/test-extras.scm
@@ -49,6 +49,7 @@
(export env-create-account-structure)
(export env-create-account-structure-alist)
(export env-expense-account-structure)
+(export gnc-pricedb-create)
;;
;; Random test related syntax and the like
commit 78ab26cc2ba78a8e41ad725ae0fd64bc186c92d4
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Aug 6 14:49:07 2018 -0700
Fix gncInvoice test failure.
test_suite_gncInvoice sets up the test suite. It's not part of the test
runtime, so stack variables in it have gone out of scope by the time the
tests are actually run. Making invoiceData static makes it permanent so
it exists at runtime.
diff --git a/libgnucash/engine/test/utest-Invoice.c b/libgnucash/engine/test/utest-Invoice.c
index e772652..4ef8d10 100644
--- a/libgnucash/engine/test/utest-Invoice.c
+++ b/libgnucash/engine/test/utest-Invoice.c
@@ -205,7 +205,7 @@ test_invoice_posted_trans ( Fixture *fixture, gconstpointer pData )
void
test_suite_gncInvoice ( void )
{
- InvoiceData pData = { FALSE, FALSE, { 1000, 100 }, { 2000, 100 } }; // Vendor bill
+ static InvoiceData pData = { FALSE, FALSE, { 1000, 100 }, { 2000, 100 } }; // Vendor bill
GNC_TEST_ADD( suitename, "post/unpost", Fixture, &pData, setup, test_invoice_post, teardown );
GNC_TEST_ADD( suitename, "post trans - vendor bill", Fixture, &pData, setup_with_invoice, test_invoice_posted_trans, teardown_with_invoice );
commit d87fa3a5bed0b948f28651bf8b0897373cc7110e
Author: Geert Janssens <geert at kobaltwit.be>
Date: Mon Aug 6 13:29:12 2018 +0200
Bug 796766 - Credit note creating 'imbalance' with wrong entries
Add fix and regression test.
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 616ef1b..60f643a 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -1509,8 +1509,11 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
total = gncInvoiceGetTotal (invoice);
taxes = gncInvoiceGetTotalTaxList (invoice);
/* The two functions above return signs relative to the document
- * We need to convert them to balance values before we can use them here */
- if (is_cust_doc)
+ * We need to convert them to balance values before we can use them here
+ * Note the odd construct comparing two booleans is to xor them
+ * that is, only evaluate true if both are different.
+ */
+ if (is_cust_doc != is_cn)
{
GList *node;
total = gnc_numeric_neg (total);
diff --git a/libgnucash/engine/test/utest-Invoice.c b/libgnucash/engine/test/utest-Invoice.c
index fe8eb7b..e772652 100644
--- a/libgnucash/engine/test/utest-Invoice.c
+++ b/libgnucash/engine/test/utest-Invoice.c
@@ -31,66 +31,188 @@ void test_suite_gncInvoice ( void );
typedef struct
{
+ gboolean is_cn;
+ gboolean is_cust_doc;
+ gnc_numeric quantity;
+ gnc_numeric price;
+} InvoiceData;
+
+typedef struct
+{
QofBook *book;
Account *account;
+ Account *account2;
GncOwner owner;
GncCustomer *customer;
+ GncVendor *vendor;
gnc_commodity *commodity;
+
+ GncInvoice* invoice;
+ Transaction *trans;
} Fixture;
static void
setup( Fixture *fixture, gconstpointer pData )
{
+ const InvoiceData *data = (InvoiceData*) pData;
+
fixture->book = qof_book_new();
fixture->account = xaccMallocAccount(fixture->book);
+ fixture->account2 = xaccMallocAccount(fixture->book);
fixture->commodity = gnc_commodity_new(fixture->book, "foo", "bar", "xy", "xy", 100);
xaccAccountSetCommodity(fixture->account, fixture->commodity);
+ xaccAccountSetCommodity(fixture->account2, fixture->commodity);
- fixture->customer = gncCustomerCreate(fixture->book);
- gncOwnerInitCustomer(&fixture->owner, fixture->customer);
+ if (data->is_cust_doc)
+ {
+ fixture->customer = gncCustomerCreate(fixture->book);
+ gncOwnerInitCustomer(&fixture->owner, fixture->customer);
+ }
+ else
+ {
+ fixture->vendor = gncVendorCreate(fixture->book);
+ gncOwnerInitVendor(&fixture->owner, fixture->vendor);
+ }
+
+ fixture->invoice = gncInvoiceCreate(fixture->book);
}
static void
teardown( Fixture *fixture, gconstpointer pData )
{
- gncCustomerBeginEdit(fixture->customer);
- gncCustomerDestroy(fixture->customer);
+ const InvoiceData *data = (InvoiceData*) pData;
+
+ gncInvoiceBeginEdit(fixture->invoice);
+ gncInvoiceDestroy(fixture->invoice);
+
+ if (data->is_cust_doc)
+ {
+ gncCustomerBeginEdit(fixture->customer);
+ gncCustomerDestroy(fixture->customer);
+ }
+ else
+ {
+ gncVendorBeginEdit(fixture->vendor);
+ gncVendorDestroy(fixture->vendor);
+ }
xaccAccountBeginEdit(fixture->account);
xaccAccountDestroy(fixture->account);
+ xaccAccountBeginEdit(fixture->account2);
+ xaccAccountDestroy(fixture->account2);
gnc_commodity_destroy(fixture->commodity);
qof_book_destroy( fixture->book );
+};
+
+static void
+setup_with_invoice( Fixture *fixture, gconstpointer pData )
+{
+ const InvoiceData *data = (InvoiceData*) pData;
+
+ time64 ts1 = gnc_time(NULL);
+ time64 ts2 = ts1;
+ const char *desc = "Test description";
+ GncEntry *entry = NULL;
+
+ setup(fixture, pData);
+
+ fixture->invoice = gncInvoiceCreate(fixture->book);
+ gncInvoiceSetCurrency(fixture->invoice, fixture->commodity);
+ gncInvoiceSetOwner(fixture->invoice, &fixture->owner);
+
+ entry = gncEntryCreate(fixture->book);
+ gncEntrySetDate (entry, ts1);
+ gncEntrySetDateEntered (entry, ts1);
+ gncEntrySetDescription (entry, desc);
+ gncEntrySetDocQuantity (entry, data->quantity, data->is_cn);
+
+ if (data->is_cust_doc)
+ {
+ gncEntrySetInvAccount(entry, fixture->account);
+ gncInvoiceAddEntry (fixture->invoice, entry);
+ }
+ else
+ {
+ gncEntrySetBillAccount(entry, fixture->account);
+ gncBillAddEntry(fixture->invoice, entry);
+ }
+
+ fixture->trans = gncInvoicePostToAccount(fixture->invoice, fixture->account2, ts1, ts2, "memo", TRUE, FALSE);
+}
+
+static void
+teardown_with_invoice( Fixture *fixture, gconstpointer pData )
+{
+ gncInvoiceUnpost(fixture->invoice, TRUE);
+ gncInvoiceRemoveEntries (fixture->invoice);
+
+ teardown(fixture, pData);
}
static void
test_invoice_post ( Fixture *fixture, gconstpointer pData )
{
- GncInvoice *invoice = gncInvoiceCreate(fixture->book);
time64 ts1 = gnc_time(NULL);
time64 ts2 = ts1;
- g_assert(invoice);
- g_assert(!gncInvoiceGetIsCreditNote(invoice));
- g_assert(gncInvoiceGetActive(invoice));
- g_assert(gncInvoiceGetPostedAcc(invoice) == NULL);
+ g_assert(fixture->invoice);
+ g_assert(!gncInvoiceGetIsCreditNote(fixture->invoice));
+ g_assert(gncInvoiceGetActive(fixture->invoice));
+ g_assert(gncInvoiceGetPostedAcc(fixture->invoice) == NULL);
- gncInvoiceSetCurrency(invoice, fixture->commodity);
+ gncInvoiceSetCurrency(fixture->invoice, fixture->commodity);
- gncInvoiceSetOwner(invoice, &fixture->owner);
+ gncInvoiceSetOwner(fixture->invoice, &fixture->owner);
g_test_message( "Will now post the invoice" );
- g_assert(!gncInvoiceIsPosted(invoice));
- gncInvoicePostToAccount(invoice, fixture->account, ts1, ts2, "memo", TRUE, FALSE);
- g_assert(gncInvoiceIsPosted(invoice));
+ g_assert(!gncInvoiceIsPosted(fixture->invoice));
+ gncInvoicePostToAccount(fixture->invoice, fixture->account, ts1, ts2, "memo", TRUE, FALSE);
+ g_assert(gncInvoiceIsPosted(fixture->invoice));
+
+ gncInvoiceUnpost(fixture->invoice, TRUE);
+ g_assert(!gncInvoiceIsPosted(fixture->invoice));
+}
+
+static void
+test_invoice_posted_trans ( Fixture *fixture, gconstpointer pData )
+{
+ const InvoiceData *data = (InvoiceData*) pData;
- gncInvoiceUnpost(invoice, TRUE);
- g_assert(!gncInvoiceIsPosted(invoice));
+ gnc_numeric total = gncInvoiceGetTotal(fixture->invoice);
+ gnc_numeric acct_balance, acct2_balance;
+
+ g_assert (1 == xaccAccountCountSplits (fixture->account, FALSE));
+ g_assert (1 == xaccAccountCountSplits (fixture->account2, FALSE));
+
+ acct_balance = xaccAccountGetBalance(fixture->account);
+ acct2_balance = xaccAccountGetBalance(fixture->account2);
+
+ // Handle sign reversals (document values vs balance values)
+ if (data->is_cn != !data->is_cust_doc)
+ {
+ g_assert (gnc_numeric_equal (gnc_numeric_neg(acct_balance), total));
+ g_assert (gnc_numeric_equal (acct2_balance, total));
+ }
+ else
+ {
+ g_assert (gnc_numeric_equal (acct_balance, total));
+ g_assert (gnc_numeric_equal (gnc_numeric_neg(acct2_balance), total));
+ }
}
void
test_suite_gncInvoice ( void )
{
- GNC_TEST_ADD( suitename, "post", Fixture, NULL, setup, test_invoice_post, teardown );
+ InvoiceData pData = { FALSE, FALSE, { 1000, 100 }, { 2000, 100 } }; // Vendor bill
+ GNC_TEST_ADD( suitename, "post/unpost", Fixture, &pData, setup, test_invoice_post, teardown );
+
+ GNC_TEST_ADD( suitename, "post trans - vendor bill", Fixture, &pData, setup_with_invoice, test_invoice_posted_trans, teardown_with_invoice );
+ pData.is_cn = TRUE; // Vendor credit note
+ GNC_TEST_ADD( suitename, "post trans - vendor credit note", Fixture, &pData, setup_with_invoice, test_invoice_posted_trans, teardown_with_invoice );
+ pData.is_cust_doc = TRUE; // Customer credit note
+ GNC_TEST_ADD( suitename, "post trans - customer creditnote", Fixture, &pData, setup_with_invoice, test_invoice_posted_trans, teardown_with_invoice );
+ pData.is_cn = FALSE; // Customer invoice
+ GNC_TEST_ADD( suitename, "post trans - customer invoice", Fixture, &pData, setup_with_invoice, test_invoice_posted_trans, teardown_with_invoice );
}
commit 4c8b07c0fa76b6179fc6e606e5393e056f03426b
Author: Yuri Chornoivan <yurchor at ukr.net>
Date: Thu Aug 2 15:40:00 2018 +0300
More minor fixes
Signed-off-by: Yuri Chornoivan <yurchor at ukr.net>
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index 8d924c0..53edc3c 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -18,7 +18,7 @@
<key name="account-separator" type="s">
<default>'colon'</default>
<summary>Character to use as separator between account names</summary>
- <description>This setting determines the character that will be used between components of an account name. Possible values are any single non-alphanumeric unicode character, or any of the following strings: "colon" "slash", "backslash", "dash" and "period".</description>
+ <description>This setting determines the character that will be used between components of an account name. Possible values are any single non-alphanumeric unicode character, or any of the following strings: "colon", "slash", "backslash", "dash" and "period".</description>
</key>
<key name="assoc-head" type="s">
<default>''</default>
diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade
index 58dfc66..f3cc770 100644
--- a/gnucash/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gtkbuilder/dialog-preferences.glade
@@ -825,7 +825,7 @@
<property name="can_focus">True</property>
<property name="events">GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK</property>
<property name="has_tooltip">True</property>
- <property name="tooltip_markup">The character that will be used between components of an account name. A legal value is any single character except letters and numbers, or any of the following strings: "colon" "slash", "backslash", "dash" and "period".</property>
+ <property name="tooltip_markup">The character that will be used between components of an account name. A legal value is any single character except letters and numbers, or any of the following strings: "colon", "slash", "backslash", "dash" and "period".</property>
<property name="tooltip_text" translatable="yes">The character that will be used between components of an account name. A legal value is any single character except letters and numbers, or any of the following strings: "colon" "slash", "backslash", "dash" and "period".</property>
<property name="invisible_char">â</property>
<property name="primary_icon_activatable">False</property>
diff --git a/gnucash/import-export/aqb/gnc-file-aqb-import.c b/gnucash/import-export/aqb/gnc-file-aqb-import.c
index 16cc8d3..b8af4b7 100644
--- a/gnucash/import-export/aqb/gnc-file-aqb-import.c
+++ b/gnucash/import-export/aqb/gnc-file-aqb-import.c
@@ -331,7 +331,7 @@ gnc_file_aqbanking_import(GtkWindow *parent,
if (num_jobs == 0)
{
gnc_info_dialog(parent,
- _("No jobs to be send.")
+ _("No jobs to be sent.")
);
}
else
commit 69fef8277fde56e7d2df700b21c63c19c115852a
Author: Geert Janssens <geert at kobaltwit.be>
Date: Tue Jul 31 17:30:07 2018 +0200
Revert "Add preference to control toolbar appearance"
This reverts commit 3b0931310730a4ae5d028a1e2120d2a619ae975a.
diff --git a/gnucash/gnome-utils/dialog-preferences.c b/gnucash/gnome-utils/dialog-preferences.c
index f17b2d9..815587e 100644
--- a/gnucash/gnome-utils/dialog-preferences.c
+++ b/gnucash/gnome-utils/dialog-preferences.c
@@ -1229,8 +1229,6 @@ gnc_preferences_dialog_create(GtkWindow *parent)
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "retain_days_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "tab_width_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_formats");
- gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-styles");
- gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-icon-sizes");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "gnucash_preferences_dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_preferences_dialog"));
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 8089191..ae4505f 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -3340,28 +3340,6 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
LEAVE ("");
}
-static void
-gnc_main_window_update_toolbar (gpointer prefs, gchar *pref, gpointer user_data)
-{
- GncMainWindow *window;
- GtkToolbar *tb;
- GncMainWindowPrivate *priv;
- gint selection;
-
- window = GNC_MAIN_WINDOW(user_data);
- priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
- tb = GTK_TOOLBAR(priv->toolbar);
-
- selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
- if (gtk_toolbar_get_style (tb) != selection)
- gtk_toolbar_set_style (tb, selection);
-
- selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
- // prefs has only small and large icons so add 2 to get right enum
- if (gtk_toolbar_get_icon_size (tb) != selection + 2)
- gtk_toolbar_set_icon_size (tb, selection + 2);
-}
-
/*
* Based on code from Epiphany (src/ephy-window.c)
*/
@@ -3728,13 +3706,6 @@ gnc_main_window_setup_window (GncMainWindow *window)
GNC_PREF_TAB_POSITION_RIGHT,
gnc_main_window_update_tab_position,
window);
-
- gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
- gnc_main_window_update_toolbar, window);
-
- gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
- gnc_main_window_update_toolbar, window);
-
gnc_main_window_update_tab_position(NULL, NULL, window);
gnc_main_window_init_menu_updaters(window);
@@ -3867,13 +3838,6 @@ gnc_main_window_add_widget (GtkUIManager *merge,
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
-
- gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
- gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
-
- // prefs has only small and large icons so add 2 to get right enum
- gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
- (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index 8d924c0..6a0bfe2 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -210,16 +210,6 @@
<summary>Display the notebook tabs at the right of the window.</summary>
<description>This setting determines the edge at which the tabs for switching pages in notebooks are drawn. Possible values are "top", "left", "bottom" and "right". It defaults to "top".</description>
</key>
- <key name="toolbar-style" type="i">
- <default>3</default>
- <summary>Toolbar Style choice</summary>
- <description>This setting controls how the toolbar icons are displayed.</description>
- </key>
- <key name="toolbar-icon-size" type="i">
- <default>1</default>
- <summary>Toolbar Icon Size</summary>
- <description>This setting controls the size of the toolbar icons.</description>
- </key>
<key name="summarybar-position-top" type="b">
<default>false</default>
<summary>Display the summary bar at the top of the page.</summary>
@@ -351,7 +341,7 @@
<description>This sets the number of characters before auto complete starts for description, notes and memo fields.</description>
</key>
</schema>
-
+
<schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">
<key name="use-new-window" type="b">
<default>false</default>
diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade
index 58dfc66..4b88f4e 100644
--- a/gnucash/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gtkbuilder/dialog-preferences.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.4 -->
+<!-- Generated with glade 3.20.2 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkAdjustment" id="auto_decimal_places_adj">
@@ -97,40 +97,6 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="toolbar-icon-sizes">
- <columns>
- <!-- column-name sizes-text -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Small Icons</col>
- </row>
- <row>
- <col id="0" translatable="yes">Large Icons</col>
- </row>
- </data>
- </object>
- <object class="GtkListStore" id="toolbar-styles">
- <columns>
- <!-- column-name styles-text -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Icons</col>
- </row>
- <row>
- <col id="0" translatable="yes">Text</col>
- </row>
- <row>
- <col id="0" translatable="yes">Icons and Text</col>
- </row>
- <row>
- <col id="0" translatable="yes">Icons and Important Text</col>
- </row>
- </data>
- </object>
<object class="GtkDialog" id="gnucash_preferences_dialog">
<property name="can_focus">False</property>
<property name="title" translatable="yes">GnuCash Preferences</property>
@@ -3275,114 +3241,6 @@ many months before the current month:</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="pref/general/toolbar-icon-size">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_markup">Specify the icon size for the toolbars.</property>
- <property name="tooltip_text" translatable="yes">Specify the icon size for the toolbars.</property>
- <property name="halign">start</property>
- <property name="margin_left">12</property>
- <property name="model">toolbar-icon-sizes</property>
- <property name="active">1</property>
- <property name="id_column">0</property>
- <child>
- <object class="GtkCellRendererText" id="toolbar-icon-renderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">15</property>
- <property name="width">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="pref/general/toolbar-style">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_markup">Change the way the toolbar items are displayed.</property>
- <property name="tooltip_text" translatable="yes">Change the way the toolbar items are displayed.</property>
- <property name="halign">start</property>
- <property name="margin_left">12</property>
- <property name="model">toolbar-styles</property>
- <property name="active">3</property>
- <property name="id_column">0</property>
- <child>
- <object class="GtkCellRendererText" id="toolbar-style-renderer"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">18</property>
- <property name="width">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label22">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes"><b>Toolbar Icon Size</b></property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">14</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label23">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes"><b>Toolbar Style</b></property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">17</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label24">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">13</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">16</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<placeholder/>
</child>
<child>
diff --git a/libgnucash/core-utils/gnc-prefs.h b/libgnucash/core-utils/gnc-prefs.h
index 4c9137c..41c241d 100644
--- a/libgnucash/core-utils/gnc-prefs.h
+++ b/libgnucash/core-utils/gnc-prefs.h
@@ -71,8 +71,6 @@
#define GNC_PREF_DATE_BACKMONTHS "date-backmonths"
#define GNC_PREF_SHOW_LEAF_ACCT_NAMES "show-leaf-account-names"
#define GNC_PREF_ENTER_MOVES_TO_END "enter-moves-to-end"
-#define GNC_PREF_TOOLBAR_STYLE "toolbar-style"
-#define GNC_PREF_TOOLBAR_ICON_SIZE "toolbar-icon-size"
/* Register preferences */
#define GNC_PREF_DRAW_HOR_LINES "draw-horizontal-lines"
#define GNC_PREF_DRAW_VERT_LINES "draw-vertical-lines"
commit fe371534c2e2c0f0d39e555754877f80532b53f2
Author: Geert Janssens <geert at kobaltwit.be>
Date: Tue Jul 31 17:29:52 2018 +0200
Revert "Add toolbar preference changes to embedded-window."
This reverts commit a75eb4c8ec2668e4e79895b2923ca6a816c90fe1.
diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index c32d1de..605d7dd 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -1,6 +1,6 @@
/*
* gnc-main-window.c -- GtkWindow which represents the
- * GnuCash main window.
+ * GnuCash main window.
*
* Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
* Copyright (C) 2003 David Hampton <hampton at employees.org>
@@ -38,7 +38,6 @@
#include "gnc-plugin-manager.h"
#include "gnc-ui.h"
#include "gnc-window.h"
-#include "gnc-prefs.h"
#include "dialog-utils.h"
/* Static Globals *******************************************************/
@@ -309,13 +308,6 @@ gnc_embedded_window_add_widget (GtkUIManager *merge,
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
-
- gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
- gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
-
- // prefs has only small and large icons so add 2 to get right enum
- gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
- (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
commit 2203118d99f28a08f29af20e163e26ee61fb1fa9
Author: Geert Janssens <geert at kobaltwit.be>
Date: Tue Jul 31 17:29:38 2018 +0200
Revert "Add the toolbar preference changes to window-reconcile."
This reverts commit 0199fef5847fc60f5ed36e1dcf9cc4ed0717dedc.
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 1bcf896..4446eb1 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -81,8 +81,6 @@ struct _RecnWindow
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
- GtkWidget *dock;
- GtkWidget *toolbar;
GtkWidget *starting; /* The starting balance */
GtkWidget *ending; /* The ending balance */
@@ -1681,44 +1679,13 @@ recnWindow (GtkWidget *parent, Account *account)
static void
recnWindow_add_widget (GtkUIManager *merge,
GtkWidget *widget,
- RecnWindow *recnData)
+ GtkBox *dock)
{
-
- if (GTK_IS_TOOLBAR (widget))
- {
- recnData->toolbar = widget;
-
- gtk_toolbar_set_style (GTK_TOOLBAR(widget),
- gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
-
- // prefs has only small and large icons so add 2 to get right enum
- gtk_toolbar_set_icon_size (GTK_TOOLBAR(widget),
- (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
- }
-
- gtk_box_pack_start (GTK_BOX (recnData->dock), widget, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
}
-static void
-recn_window_update_toolbar (gpointer prefs, gchar *pref, RecnWindow *recnData)
-{
- GtkToolbar *tb;
- gint selection;
-
- tb = GTK_TOOLBAR(recnData->toolbar);
-
- selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
- if (gtk_toolbar_get_style (tb) != selection)
- gtk_toolbar_set_style (tb, selection);
-
- selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
- // prefs has only small and large icons so add 2 to get right enum
- if (gtk_toolbar_get_icon_size (tb) != selection + 2)
- gtk_toolbar_set_icon_size (tb, selection + 2);
-}
-
/********************************************************************\
* recnWindowWithBalance
*
@@ -1785,9 +1752,8 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
GError *error = NULL;
recnData->ui_merge = gtk_ui_manager_new ();
- recnData->dock = dock;
g_signal_connect (recnData->ui_merge, "add_widget",
- G_CALLBACK (recnWindow_add_widget), recnData);
+ G_CALLBACK (recnWindow_add_widget), dock);
action_group = gtk_action_group_new ("ReconcileWindowActions");
recnData->action_group = action_group;
@@ -1965,13 +1931,6 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
recnRefresh (recnData);
}
- /* track toolbar preference changes */
- gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
- recn_window_update_toolbar, recnData);
-
- gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
- recn_window_update_toolbar, recnData);
-
/* Allow resize */
gtk_window_set_resizable(GTK_WINDOW(recnData->window), TRUE);
gtk_widget_show_all(recnData->window);
@@ -2055,12 +2014,6 @@ recn_destroy_cb (GtkWidget *w, gpointer data)
if (recnData->delete_refresh)
gnc_resume_gui_refresh ();
- gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
- recn_window_update_toolbar, recnData);
-
- gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
- recn_window_update_toolbar, recnData);
-
g_free (recnData);
}
commit cd7a55a9ccdb8b79ae439eea6913a4eb1ef5dc4a
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 29 12:57:59 2018 +0100
Fix Transient parent warnings in search dialogue
diff --git a/gnucash/gnome-search/dialog-search.c b/gnucash/gnome-search/dialog-search.c
index ece51d9..eebd106 100644
--- a/gnucash/gnome-search/dialog-search.c
+++ b/gnucash/gnome-search/dialog-search.c
@@ -716,6 +716,8 @@ attach_element (GtkWidget *element, GNCSearchWindow *sw, int row)
data = g_object_get_data (G_OBJECT (element), "data");
+ gnc_search_core_type_pass_parent (data->element, GTK_WINDOW(sw->dialog));
+
gtk_grid_attach (GTK_GRID (sw->criteria_table), element, 0, row, 1, 1);
gtk_widget_set_hexpand (element, TRUE);
gtk_widget_set_halign (element, GTK_ALIGN_FILL);
@@ -774,6 +776,8 @@ combo_box_changed (GtkComboBox *combo_box, struct _crit_data *data)
FALSE, FALSE, 0);
}
+ gnc_search_core_type_pass_parent (data->element, GTK_WINDOW(data->dialog));
+
/* Make sure it's visible */
gtk_widget_show_all (data->container);
diff --git a/gnucash/gnome-search/search-account.c b/gnucash/gnome-search/search-account.c
index faf53f2..429e525 100644
--- a/gnucash/gnome-search/search-account.c
+++ b/gnucash/gnome-search/search-account.c
@@ -39,6 +39,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
static gboolean gncs_validate (GNCSearchCoreType *fe);
static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
@@ -54,6 +55,7 @@ struct _GNCSearchAccountPrivate
{
gboolean match_all;
GList * selected_accounts;
+ GtkWindow *parent;
};
#define _PRIVATE(o) \
@@ -102,6 +104,7 @@ gnc_search_account_class_init (GNCSearchAccountClass *klass)
object_class->finalize = gnc_search_account_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->validate = gncs_validate;
gnc_search_core_type->get_widget = gncs_get_widget;
gnc_search_core_type->get_predicate = gncs_get_predicate;
@@ -170,10 +173,11 @@ gncs_validate (GNCSearchCoreType *fe)
g_return_val_if_fail (IS_GNCSEARCH_ACCOUNT (fi), FALSE);
priv = _PRIVATE(fi);
+
if (priv->selected_accounts == NULL && fi->how )
{
valid = FALSE;
- gnc_error_dialog (NULL, "%s", _("You have not selected any accounts"));
+ gnc_error_dialog (GTK_WINDOW(priv->parent), "%s", _("You have not selected any accounts"));
}
/* XXX */
@@ -257,7 +261,7 @@ button_clicked (GtkButton *button, GNCSearchAccount *fi)
/* Create the dialog */
dialog =
GTK_DIALOG(gtk_dialog_new_with_buttons(_("Select the Accounts to Compare"),
- NULL,
+ GTK_WINDOW(priv->parent),
0,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_OK"), GTK_RESPONSE_OK,
@@ -356,3 +360,16 @@ static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
return (GNCSearchCoreType *)se;
}
+
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchAccount *fi = (GNCSearchAccount *)fe;
+ GNCSearchAccountPrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_ACCOUNT (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
diff --git a/gnucash/gnome-search/search-boolean.c b/gnucash/gnome-search/search-boolean.c
index a784c12..caecd6b 100644
--- a/gnucash/gnome-search/search-boolean.c
+++ b/gnucash/gnome-search/search-boolean.c
@@ -35,6 +35,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
static gboolean gncs_validate (GNCSearchCoreType *fe);
static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
@@ -48,6 +49,7 @@ typedef struct _GNCSearchBooleanPrivate GNCSearchBooleanPrivate;
struct _GNCSearchBooleanPrivate
{
+ GtkWindow *parent;
gpointer dummy;
};
@@ -96,6 +98,7 @@ gnc_search_boolean_class_init (GNCSearchBooleanClass *klass)
object_class->finalize = gnc_search_boolean_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->validate = gncs_validate;
gnc_search_core_type->get_widget = gncs_get_widget;
gnc_search_core_type->get_predicate = gncs_get_predicate;
@@ -142,6 +145,19 @@ gnc_search_boolean_set_value (GNCSearchBoolean *fi, gboolean value)
fi->value = value;
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
+ GNCSearchBooleanPrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_BOOLEAN (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-core-type.c b/gnucash/gnome-search/search-core-type.c
index b9fbb31..37424ee 100644
--- a/gnucash/gnome-search/search-core-type.c
+++ b/gnucash/gnome-search/search-core-type.c
@@ -149,6 +149,12 @@ gnc_search_core_type_grab_focus (GNCSearchCoreType *fe)
GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->grab_focus (fe);
}
+void
+gnc_search_core_type_pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNC_SEARCH_CORE_TYPE_GET_CLASS (fe)->pass_parent (fe, parent);
+}
+
gboolean
gnc_search_core_type_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-core-type.h b/gnucash/gnome-search/search-core-type.h
index 921bc3a..4abd856 100644
--- a/gnucash/gnome-search/search-core-type.h
+++ b/gnucash/gnome-search/search-core-type.h
@@ -46,6 +46,7 @@ typedef struct
/* virtual methods */
void (*grab_focus) (GNCSearchCoreType *fe);
void (*editable_enters) (GNCSearchCoreType *fe);
+ void (*pass_parent) (GNCSearchCoreType *fe, gpointer parent);
gboolean (*validate) (GNCSearchCoreType *fe);
GNCSearchCoreType * (*clone) (GNCSearchCoreType *fe);
GtkWidget * (*get_widget) (GNCSearchCoreType *);
@@ -64,6 +65,7 @@ GNCSearchCoreType * gnc_search_core_type_new_type_name (const char *type);
/* methods */
void gnc_search_core_type_grab_focus (GNCSearchCoreType *fe);
void gnc_search_core_type_editable_enters (GNCSearchCoreType *fe);
+void gnc_search_core_type_pass_parent (GNCSearchCoreType *fe, gpointer parent);
gboolean gnc_search_core_type_validate (GNCSearchCoreType *fe);
GNCSearchCoreType * gnc_search_core_type_clone (GNCSearchCoreType *fe);
GtkWidget * gnc_search_core_type_get_widget (GNCSearchCoreType *fe);
diff --git a/gnucash/gnome-search/search-date.c b/gnucash/gnome-search/search-date.c
index 9523c3f..af85414 100644
--- a/gnucash/gnome-search/search-date.c
+++ b/gnucash/gnome-search/search-date.c
@@ -37,6 +37,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static void editable_enters (GNCSearchCoreType *fe);
static void grab_focus (GNCSearchCoreType *fe);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
@@ -53,6 +54,7 @@ typedef struct _GNCSearchDatePrivate GNCSearchDatePrivate;
struct _GNCSearchDatePrivate
{
GtkWidget *entry;
+ GtkWindow *parent;
};
#define _PRIVATE(o) \
@@ -100,6 +102,7 @@ gnc_search_date_class_init (GNCSearchDateClass *klass)
object_class->finalize = gnc_search_date_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->editable_enters = editable_enters;
gnc_search_core_type->grab_focus = grab_focus;
gnc_search_core_type->validate = gncs_validate;
@@ -164,6 +167,19 @@ gnc_search_date_set_how (GNCSearchDate *fi, QofQueryCompare how)
fi->how = how;
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchDate *fi = (GNCSearchDate *)fe;
+ GNCSearchDatePrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_DATE (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-double.c b/gnucash/gnome-search/search-double.c
index e6c45ff..191b270 100644
--- a/gnucash/gnome-search/search-double.c
+++ b/gnucash/gnome-search/search-double.c
@@ -36,6 +36,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static void editable_enters (GNCSearchCoreType *fe);
static void grab_focus (GNCSearchCoreType *fe);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
@@ -53,6 +54,7 @@ struct _GNCSearchDoublePrivate
{
GtkWidget * entry;
GNCAmountEdit *gae;
+ GtkWindow *parent;
};
#define _PRIVATE(o) \
@@ -100,6 +102,7 @@ gnc_search_double_class_init (GNCSearchDoubleClass *klass)
object_class->finalize = gnc_search_double_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->editable_enters = editable_enters;
gnc_search_core_type->grab_focus = grab_focus;
gnc_search_core_type->validate = gncs_validate;
@@ -156,6 +159,19 @@ gnc_search_double_set_how (GNCSearchDouble *fi, QofQueryCompare how)
fi->how = how;
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchDouble *fi = (GNCSearchDouble *)fe;
+ GNCSearchDoublePrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_DOUBLE (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-int64.c b/gnucash/gnome-search/search-int64.c
index bc94f61..a1c3f7f 100644
--- a/gnucash/gnome-search/search-int64.c
+++ b/gnucash/gnome-search/search-int64.c
@@ -36,6 +36,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static void editable_enters (GNCSearchCoreType *fe);
static void grab_focus (GNCSearchCoreType *fe);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
@@ -54,6 +55,7 @@ struct _GNCSearchInt64Private
{
GtkWidget *entry;
GNCAmountEdit *gae;
+ GtkWindow *parent;
};
#define _PRIVATE(o) \
@@ -101,6 +103,7 @@ gnc_search_int64_class_init (GNCSearchInt64Class *klass)
object_class->finalize = gnc_search_int64_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->editable_enters = editable_enters;
gnc_search_core_type->grab_focus = grab_focus;
gnc_search_core_type->validate = gncs_validate;
@@ -157,6 +160,19 @@ gnc_search_int64_set_how (GNCSearchInt64 *fi, QofQueryCompare how)
fi->how = how;
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
+ GNCSearchInt64Private *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_INT64 (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-numeric.c b/gnucash/gnome-search/search-numeric.c
index 582e17c..97d0b4f 100644
--- a/gnucash/gnome-search/search-numeric.c
+++ b/gnucash/gnome-search/search-numeric.c
@@ -36,6 +36,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static void editable_enters (GNCSearchCoreType *fe);
static void grab_focus (GNCSearchCoreType *fe);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
@@ -54,6 +55,7 @@ struct _GNCSearchNumericPrivate
gboolean is_debcred;
GtkWidget * entry;
GNCAmountEdit *gae;
+ GtkWindow *parent;
};
#define _PRIVATE(o) \
@@ -101,6 +103,7 @@ gnc_search_numeric_class_init (GNCSearchNumericClass *klass)
object_class->finalize = gnc_search_numeric_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->editable_enters = editable_enters;
gnc_search_core_type->grab_focus = grab_focus;
gnc_search_core_type->validate = gncs_validate;
@@ -186,6 +189,19 @@ gnc_search_numeric_set_option (GNCSearchNumeric *fi, QofNumericMatch option)
fi->option = option;
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
+ GNCSearchNumericPrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_NUMERIC (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-reconciled.c b/gnucash/gnome-search/search-reconciled.c
index 2b9ffe6..565f377 100644
--- a/gnucash/gnome-search/search-reconciled.c
+++ b/gnucash/gnome-search/search-reconciled.c
@@ -36,6 +36,7 @@
#define d(x)
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
static gboolean gncs_validate (GNCSearchCoreType *fe);
static GtkWidget *gncs_get_widget(GNCSearchCoreType *fe);
@@ -49,6 +50,7 @@ typedef struct _GNCSearchReconciledPrivate GNCSearchReconciledPrivate;
struct _GNCSearchReconciledPrivate
{
+ GtkWindow *parent;
gpointer dummy;
};
@@ -97,6 +99,7 @@ gnc_search_reconciled_class_init (GNCSearchReconciledClass *klass)
object_class->finalize = gnc_search_reconciled_finalize;
/* override methods */
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->validate = gncs_validate;
gnc_search_core_type->get_widget = gncs_get_widget;
gnc_search_core_type->get_predicate = gncs_get_predicate;
@@ -152,6 +155,19 @@ gnc_search_reconciled_set_how (GNCSearchReconciled *fi, QofCharMatch how)
fi->how = how;
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
+ GNCSearchReconciledPrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_RECONCILED (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
diff --git a/gnucash/gnome-search/search-string.c b/gnucash/gnome-search/search-string.c
index 1ba224c..6ccfe4e 100644
--- a/gnucash/gnome-search/search-string.c
+++ b/gnucash/gnome-search/search-string.c
@@ -38,6 +38,7 @@
#define d(x)
static void editable_enters (GNCSearchCoreType *fe);
+static void pass_parent (GNCSearchCoreType *fe, gpointer parent);
static void grab_focus (GNCSearchCoreType *fe);
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe);
static gboolean gncs_validate (GNCSearchCoreType *fe);
@@ -53,6 +54,7 @@ typedef struct _GNCSearchStringPrivate GNCSearchStringPrivate;
struct _GNCSearchStringPrivate
{
GtkWidget *entry;
+ GtkWindow *parent;
};
#define _PRIVATE(o) \
@@ -101,6 +103,7 @@ gnc_search_string_class_init (GNCSearchStringClass *klass)
/* override methods */
gnc_search_core_type->editable_enters = editable_enters;
+ gnc_search_core_type->pass_parent = pass_parent;
gnc_search_core_type->grab_focus = grab_focus;
gnc_search_core_type->validate = gncs_validate;
gnc_search_core_type->get_widget = gncs_get_widget;
@@ -175,15 +178,18 @@ static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
GNCSearchString *fi = (GNCSearchString *)fe;
+ GNCSearchStringPrivate *priv;
gboolean valid = TRUE;
g_return_val_if_fail (fi, FALSE);
g_return_val_if_fail (IS_GNCSEARCH_STRING (fi), FALSE);
+ priv = _PRIVATE(fi);
+
if (!fi->value || *(fi->value) == '\0')
{
GtkWidget *dialog;
- dialog = gtk_message_dialog_new (NULL,
+ dialog = gtk_message_dialog_new (GTK_WINDOW(priv->parent),
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
@@ -221,7 +227,7 @@ gncs_validate (GNCSearchCoreType *fe)
fi->value, regmsg);
g_free (regmsg);
- dialog = gtk_message_dialog_new (NULL,
+ dialog = gtk_message_dialog_new (GTK_WINDOW(priv->parent),
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
@@ -301,6 +307,19 @@ editable_enters (GNCSearchCoreType *fe)
gtk_entry_set_activates_default(GTK_ENTRY (priv->entry), TRUE);
}
+static void
+pass_parent (GNCSearchCoreType *fe, gpointer parent)
+{
+ GNCSearchString *fi = (GNCSearchString *)fe;
+ GNCSearchStringPrivate *priv;
+
+ g_return_if_fail (fi);
+ g_return_if_fail (IS_GNCSEARCH_STRING (fi));
+
+ priv = _PRIVATE(fi);
+ priv->parent = GTK_WINDOW(parent);
+}
+
static GtkWidget *
gncs_get_widget (GNCSearchCoreType *fe)
{
commit e851f249fc525fd0d2e6d505e43b0c8ce5ffb090
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:53:31 2018 +0100
Fix gnc_window_adjust_for_screen using incorrect monitor
This function was always using the primary monitor to get monitor size
so corrected to use the monitor at the specified window coordinates.
diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index 3cc8d84..d4de396 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -240,16 +240,21 @@ gnc_save_window_size(const char *group, GtkWindow *window)
void
gnc_window_adjust_for_screen(GtkWindow * window)
{
-#if GTK_CHECK_VERSION(3,22,0)
- GdkWindow *win;
- GdkMonitor *mon;
GdkRectangle monitor_size;
-#endif
- gint screen_width;
- gint screen_height;
+ gint wpos[2];
gint width;
gint height;
+#if GTK_CHECK_VERSION(3,22,0)
+ GdkDisplay *display = gdk_display_get_default ();
+ GdkMonitor *mon;
+#else
+ GdkScreen *screen = gdk_screen_get_default ();
+ gint mon_num;
+#endif
+
+ ENTER("");
+
if (window == NULL)
return;
@@ -257,31 +262,50 @@ gnc_window_adjust_for_screen(GtkWindow * window)
if (gtk_widget_get_window (GTK_WIDGET(window)) == NULL)
return;
+ gtk_window_get_position(GTK_WINDOW(window), &wpos[0], &wpos[1]);
+ gtk_window_get_size(GTK_WINDOW(window), &width, &height);
+
#if GTK_CHECK_VERSION(3,22,0)
- win = gdk_screen_get_root_window (gtk_window_get_screen (window));
- mon = gdk_display_get_monitor_at_window (gtk_widget_get_display (GTK_WIDGET(window)), win);
+ mon = gdk_display_get_monitor_at_point (display, wpos[0], wpos[1]);
gdk_monitor_get_geometry (mon, &monitor_size);
-
- screen_width = monitor_size.width;
- screen_height = monitor_size.height;
#else
- screen_width = gdk_screen_width();
- screen_height = gdk_screen_height();
+ mon_num = gdk_screen_get_monitor_at_point (screen, wpos[0], wpos[1]);
+ gdk_screen_get_monitor_geometry (screen, mon_num, &monitor_size);
#endif
- width = gdk_window_get_width (gtk_widget_get_window (GTK_WIDGET(window)));
- height = gdk_window_get_height (gtk_widget_get_window (GTK_WIDGET(window)));
- if ((width <= screen_width) && (height <= screen_height))
+ DEBUG("monitor width is %d, height is %d; wwindow width is %d, height is %d",
+ monitor_size.width, monitor_size.height, width, height);
+
+ if ((width <= monitor_size.width) && (height <= monitor_size.height))
return;
- width = MIN(width, screen_width - 10);
- width = MAX(width, 0);
+ /* Keep the window on screen if possible */
+ if (wpos[0] - monitor_size.x + width > monitor_size.x + monitor_size.width)
+ wpos[0] = monitor_size.x + monitor_size.width - width;
+
+ if (wpos[1] - monitor_size.y + height > monitor_size.y + monitor_size.height)
+ wpos[1] = monitor_size.y + monitor_size.height - height;
+
+ /* make sure the cordinates have not left the monitor */
+ if (wpos[0] < monitor_size.x)
+ wpos[0] = monitor_size.x;
- height = MIN(height, screen_height - 10);
- height = MAX(height, 0);
+ if (wpos[1] < monitor_size.y)
+ wpos[1] = monitor_size.y;
- gdk_window_resize(gtk_widget_get_window (GTK_WIDGET(window)), width, height);
+ DEBUG("move window to position %d, %d", wpos[0], wpos[1]);
+
+ gtk_window_move(window, wpos[0], wpos[1]);
+
+ /* if window is bigger, set it to monitor sizes */
+ width = MIN(width, monitor_size.width - 10);
+ height = MIN(height, monitor_size.height - 10);
+
+ DEBUG("resize window to width %d, height %d", width, height);
+
+ gtk_window_resize(GTK_WINDOW(window), width, height);
gtk_widget_queue_resize(GTK_WIDGET(window));
+ LEAVE("");
}
/********************************************************************\
commit 099b659b4b002311a9aa07d4622998f396c2d588
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:52:44 2018 +0100
Add debug message to gnc_save_window_size and some text changes
diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index 406a091..3cc8d84 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -195,7 +195,7 @@ gnc_restore_window_size(const char *group, GtkWindow *window, GtkWindow *parent)
/********************************************************************\
* gnc_save_window_size *
* save the window position and size into options whose names are *
- * prefixed by the group name. *
+ * prefixed by the group name. *
* *
* Args: group - preferences group to save the options in *
* window - the window for which current position and size *
@@ -208,6 +208,8 @@ gnc_save_window_size(const char *group, GtkWindow *window)
gint wpos[2], wsize[2];
GVariant *geometry;
+ ENTER("");
+
g_return_if_fail(group != NULL);
g_return_if_fail(window != NULL);
@@ -216,10 +218,15 @@ gnc_save_window_size(const char *group, GtkWindow *window)
gtk_window_get_position(GTK_WINDOW(window), &wpos[0], &wpos[1]);
gtk_window_get_size(GTK_WINDOW(window), &wsize[0], &wsize[1]);
+
+ DEBUG("save geometry - wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d",
+ wpos[0], wpos[1], wsize[0], wsize[1]);
+
geometry = g_variant_new ("(iiii)", wpos[0], wpos[1],
wsize[0], wsize[1]);
gnc_prefs_set_value (group, GNC_PREF_LAST_GEOMETRY, geometry);
/* Don't unref geometry here, it is consumed by gnc_prefs_set_value */
+ LEAVE("");
}
diff --git a/gnucash/gnome-utils/dialog-utils.h b/gnucash/gnome-utils/dialog-utils.h
index 50611c2..1a93f79 100644
--- a/gnucash/gnome-utils/dialog-utils.h
+++ b/gnucash/gnome-utils/dialog-utils.h
@@ -48,8 +48,7 @@ void gnc_restore_window_size (const char *prefix, GtkWindow *window,
* by the string prefix. *
* *
* Args: prefix - determines the options used to save the values *
- * width - width of the window to save *
- * height - height of the window to save *
+ * window - the window being saved *
* Returns: nothing *
\********************************************************************/
void gnc_save_window_size (const char *section, GtkWindow *window);
commit 8c1adaa28f23770801ff574f5a2b406f75bc92d2
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:51:30 2018 +0100
Fix Transient parent warning for dialog-book-close
diff --git a/gnucash/gnome-utils/dialog-book-close.c b/gnucash/gnome-utils/dialog-book-close.c
index 2d23e41..8cec934 100644
--- a/gnucash/gnome-utils/dialog-book-close.c
+++ b/gnucash/gnome-utils/dialog-book-close.c
@@ -322,7 +322,7 @@ gnc_book_close_response_cb(GtkDialog *dialog, gint response, GtkDialog *unused)
LEAVE("");
}
-void gnc_ui_close_book (QofBook* book)
+void gnc_ui_close_book (QofBook* book, GtkWindow *parent)
{
struct CloseBookWindow *cbw;
GtkBuilder* builder;
@@ -343,6 +343,10 @@ void gnc_ui_close_book (QofBook* book)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(cbw->dialog), "GncBookCloseDialog");
+ /* parent */
+ if (parent != NULL)
+ gtk_window_set_transient_for (GTK_WINDOW(cbw->dialog), GTK_WINDOW(parent));
+
PINFO("Closed Book Window is %p, Dialog is %p", cbw, cbw->dialog);
/* close date */
diff --git a/gnucash/gnome-utils/dialog-book-close.h b/gnucash/gnome-utils/dialog-book-close.h
index 363c0f1..e8a87de 100644
--- a/gnucash/gnome-utils/dialog-book-close.h
+++ b/gnucash/gnome-utils/dialog-book-close.h
@@ -40,8 +40,9 @@
*
* @param book This parameter specifies the book whose data
* will be closed.
+ * @param parent This parameter specifies the parent window
*/
-void gnc_ui_close_book (QofBook* book);
+void gnc_ui_close_book (QofBook* book, GtkWindow *parent);
/** @} */
diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c
index 5e50f6b..566fc97 100644
--- a/gnucash/gnome/gnc-plugin-basic-commands.c
+++ b/gnucash/gnome/gnc-plugin-basic-commands.c
@@ -653,7 +653,7 @@ gnc_main_window_cmd_tools_financial_calculator (GtkAction *action, GncMainWindow
static void
gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWindowActionData *data)
{
- gnc_ui_close_book(gnc_get_current_book());
+ gnc_ui_close_book(gnc_get_current_book(), GTK_WINDOW (data->window));
}
static void
commit 68874495e16d5d0a6b78d435438973d9452c29b8
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:50:31 2018 +0100
Change files for changed gnc_restore_window_size format, part2 of 2
Add the parent window to the calling function gnc_restore_window_size
after the change to that function. This required adding the retrieval of
the parent window for the calling dialogues.
diff --git a/gnucash/gnome/dialog-lot-viewer.c b/gnucash/gnome/dialog-lot-viewer.c
index 655ebd7..14f2683 100644
--- a/gnucash/gnome/dialog-lot-viewer.c
+++ b/gnucash/gnome/dialog-lot-viewer.c
@@ -667,7 +667,6 @@ void
lv_window_destroy_cb (GtkWidget *object, gpointer user_data)
{
GNCLotViewer *lv = user_data;
- gnc_close_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
gnc_unregister_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
g_free (lv);
}
@@ -732,7 +731,7 @@ lv_response_cb (GtkDialog *dialog, gint response, gpointer data)
switch (response)
{
case GTK_RESPONSE_CLOSE:
- lv_close_handler(lv);
+ gnc_close_gui_component_by_data (LOT_VIEWER_CM_CLASS, lv);
return;
case RESPONSE_VIEW:
@@ -979,7 +978,7 @@ lv_init_split_buttons (GNCLotViewer *lv)
/* ======================================================================== */
static void
-lv_create (GNCLotViewer *lv)
+lv_create (GNCLotViewer *lv, GtkWindow *parent)
{
gchar *win_title;
GtkBuilder *builder;
@@ -989,6 +988,8 @@ lv_create (GNCLotViewer *lv)
lv->window = GTK_WIDGET(gtk_builder_get_object (builder, "lot_viewer_dialog"));
+ gtk_window_set_transient_for (GTK_WINDOW (lv->window), parent);
+
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(lv->window), "GncLotViewerDialog");
@@ -1046,13 +1047,13 @@ lv_create (GNCLotViewer *lv)
lv_update_split_buttons(lv);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(lv->window));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(lv->window), parent);
}
/* ======================================================================== */
GNCLotViewer *
-gnc_lot_viewer_dialog (Account *account)
+gnc_lot_viewer_dialog (GtkWindow *parent, Account *account)
{
GNCLotViewer *lv;
gint component_id;
@@ -1061,7 +1062,7 @@ gnc_lot_viewer_dialog (Account *account)
lv = g_new0 (GNCLotViewer, 1);
lv->account = account;
- lv_create (lv);
+ lv_create (lv, parent);
gnc_lot_viewer_fill (lv);
lv_show_splits_free (lv);
diff --git a/gnucash/gnome/dialog-lot-viewer.h b/gnucash/gnome/dialog-lot-viewer.h
index 74670b3..77bc0d3 100644
--- a/gnucash/gnome/dialog-lot-viewer.h
+++ b/gnucash/gnome/dialog-lot-viewer.h
@@ -30,6 +30,6 @@
typedef struct _GNCLotViewer GNCLotViewer;
/** Create and realize and show a lot-viewing dialog. */
-GNCLotViewer * gnc_lot_viewer_dialog (Account *);
+GNCLotViewer * gnc_lot_viewer_dialog (GtkWindow *parent, Account *account);
#endif /* LOT_VIEWER_H */
diff --git a/gnucash/gnome/dialog-trans-assoc.c b/gnucash/gnome/dialog-trans-assoc.c
index ce4747a..4003d29 100644
--- a/gnucash/gnome/dialog-trans-assoc.c
+++ b/gnucash/gnome/dialog-trans-assoc.c
@@ -387,7 +387,7 @@ get_trans_info (AssocDialog *assoc_dialog)
}
static void
-gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
+gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
{
GtkWidget *window;
GtkBuilder *builder;
@@ -475,7 +475,7 @@ gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
g_object_unref (G_OBJECT(builder));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(assoc_dialog->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(assoc_dialog->window), parent);
get_trans_info (assoc_dialog);
gtk_widget_show_all (GTK_WIDGET(window));
@@ -525,7 +525,7 @@ show_handler (const char *klass, gint component_id,
* Return: nothing *
\********************************************************************/
void
-gnc_trans_assoc_dialog (void)
+gnc_trans_assoc_dialog (GtkWindow *parent)
{
AssocDialog *assoc_dialog;
@@ -537,12 +537,11 @@ gnc_trans_assoc_dialog (void)
}
assoc_dialog = g_new0 (AssocDialog, 1);
- gnc_assoc_dialog_create (assoc_dialog);
+ gnc_assoc_dialog_create (parent, assoc_dialog);
gnc_register_gui_component (DIALOG_ASSOC_CM_CLASS,
refresh_handler, close_handler,
assoc_dialog);
-// gtk_widget_show (assoc_dialog->window);
LEAVE(" ");
}
diff --git a/gnucash/gnome/dialog-trans-assoc.h b/gnucash/gnome/dialog-trans-assoc.h
index fa82fcb..c95c5b7 100644
--- a/gnucash/gnome/dialog-trans-assoc.h
+++ b/gnucash/gnome/dialog-trans-assoc.h
@@ -23,6 +23,6 @@
#ifndef DIALOG_TRANS_ASSOC_H
#define DIALOG_TRANS_ASSOC_H
-void gnc_trans_assoc_dialog (void);
+void gnc_trans_assoc_dialog (GtkWindow *parent);
#endif
diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c
index c019a72..5e50f6b 100644
--- a/gnucash/gnome/gnc-plugin-basic-commands.c
+++ b/gnucash/gnome/gnc-plugin-basic-commands.c
@@ -624,7 +624,7 @@ static void
gnc_main_window_cmd_tools_trans_assoc (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor (NULL, TRUE);
- gnc_trans_assoc_dialog ();
+ gnc_trans_assoc_dialog (GTK_WINDOW (data->window));
gnc_unset_busy_cursor (NULL);
}
diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index 80478f5..46f9517 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -1749,10 +1749,9 @@ static void
gnc_plugin_page_account_tree_cmd_lots (GtkAction *action,
GncPluginPageAccountTree *page)
{
- Account *account;
-
- account = gnc_plugin_page_account_tree_get_current_account (page);
- gnc_lot_viewer_dialog (account);
+ Account *account = gnc_plugin_page_account_tree_get_current_account (page);
+ GtkWidget *window = GNC_PLUGIN_PAGE (page)->window;
+ gnc_lot_viewer_dialog (GTK_WINDOW(window), account);
}
static void
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index d3e7283..0ebb798 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -3547,14 +3547,16 @@ static void
gnc_plugin_page_register_cmd_lots (GtkAction *action,
GncPluginPageRegister *page)
{
+ GtkWindow *window;
Account *account;
ENTER("(action %p, plugin_page %p)", action, page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER(page));
+ window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
account = gnc_plugin_page_register_get_account (page);
- gnc_lot_viewer_dialog (account);
+ gnc_lot_viewer_dialog (window, account);
LEAVE(" ");
}
diff --git a/gnucash/gnome/gnc-plugin-page-register2.c b/gnucash/gnome/gnc-plugin-page-register2.c
index 5021607..464d856 100644
--- a/gnucash/gnome/gnc-plugin-page-register2.c
+++ b/gnucash/gnome/gnc-plugin-page-register2.c
@@ -3347,14 +3347,16 @@ static void
gnc_plugin_page_register2_cmd_lots (GtkAction *action,
GncPluginPageRegister2 *page) // this works
{
+ GtkWindow *window;
Account *account;
ENTER("(action %p, plugin_page %p)", action, page);
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(page));
+ window = gnc_window_get_gtk_window(GNC_WINDOW(GNC_PLUGIN_PAGE (page)->window));
account = gnc_plugin_page_register2_get_account (page);
- gnc_lot_viewer_dialog (account);
+ gnc_lot_viewer_dialog (window, account);
LEAVE(" ");
}
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 1bcf896..675bff5 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1674,7 +1674,7 @@ recnWindow (GtkWidget *parent, Account *account)
enable_subaccounts))
return NULL;
- return recnWindowWithBalance (account, new_ending, statement_date);
+ return recnWindowWithBalance (parent, account, new_ending, statement_date);
}
@@ -1725,13 +1725,14 @@ recn_window_update_toolbar (gpointer prefs, gchar *pref, RecnWindow *recnData)
* Opens up the window to reconcile an account, but with ending
* balance and statement date already given.
*
- * Args: account - The account to reconcile
+ * Args: parent - The parent widget of the new window
+ * account - The account to reconcile
* new_ending - The amount for ending balance
* statement_date - The date of the statement
* Return: recnData - the instance of this RecnWindow
\********************************************************************/
RecnWindow *
-recnWindowWithBalance (Account *account, gnc_numeric new_ending,
+recnWindowWithBalance (GtkWidget *parent, Account *account, gnc_numeric new_ending,
time64 statement_date)
{
RecnWindow *recnData;
@@ -1849,7 +1850,8 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
/* Force a reasonable starting size */
gtk_window_set_default_size(GTK_WINDOW(recnData->window), 800, 600);
- gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW(recnData->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE,
+ GTK_WINDOW(recnData->window), GTK_WINDOW(parent));
gtk_container_add(GTK_CONTAINER(frame), main_area);
gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
diff --git a/gnucash/gnome/window-reconcile.h b/gnucash/gnome/window-reconcile.h
index 0516140..dac318d 100644
--- a/gnucash/gnome/window-reconcile.h
+++ b/gnucash/gnome/window-reconcile.h
@@ -52,12 +52,13 @@ RecnWindow *recnWindow (GtkWidget *parent, Account *account);
* Opens up the window to reconcile an account, but with ending
* balance and statement date already given.
*
- * Args: account - The account to reconcile
+ * Args: parent - The parent widget of the new window
+ * account - The account to reconcile
* new_ending - The amount for ending balance
* statement_date - The date of the statement
* Return: recnData - the instance of this RecnWindow
\********************************************************************/
-RecnWindow *recnWindowWithBalance (Account *account,
+RecnWindow *recnWindowWithBalance (GtkWidget *parent, Account *account,
gnc_numeric new_ending,
time64 statement_date);
diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c
index 03d6539..306413d 100644
--- a/gnucash/import-export/aqb/gnc-ab-utils.c
+++ b/gnucash/import-export/aqb/gnc-ab-utils.c
@@ -1060,7 +1060,7 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
/* Show reconciliation window */
if (show_recn_window)
- recnWindowWithBalance(gnc_acc, value, booked_tt);
+ recnWindowWithBalance(GTK_WIDGET (data->parent), gnc_acc, value, booked_tt);
return NULL;
}
commit ec0d081d5e2824de1de9ef97f38cfed25d6825cf
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:45:49 2018 +0100
Change files for changed gnc_restore_window_size format, part1 of 2
Add the parent window to the calling function gnc_restore_window_size
after the change to that function. These files already had access to
the parent window.
diff --git a/gnucash/gnome-search/dialog-search.c b/gnucash/gnome-search/dialog-search.c
index 517b458..ece51d9 100644
--- a/gnucash/gnome-search/dialog-search.c
+++ b/gnucash/gnome-search/dialog-search.c
@@ -1345,7 +1345,7 @@ gnc_search_dialog_create (GtkWindow *parent,
gnc_search_dialog_init_widgets (sw, title);
if (sw->prefs_group)
- gnc_restore_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog));
+ gnc_restore_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog), parent);
gtk_window_set_transient_for(GTK_WINDOW(sw->dialog), parent);
gtk_widget_show(sw->dialog);
diff --git a/gnucash/gnome-utils/dialog-account.c b/gnucash/gnome-utils/dialog-account.c
index d6bbf9a..a23429e 100644
--- a/gnucash/gnome-utils/dialog-account.c
+++ b/gnucash/gnome-utils/dialog-account.c
@@ -1435,7 +1435,7 @@ gnc_account_window_create(GtkWindow *parent, AccountWindow *aw)
}
gnc_account_type_view_create (aw, compat_types);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(aw->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(aw->dialog), parent);
gtk_widget_grab_focus(GTK_WIDGET(aw->name_entry));
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index 936addd..5aafb86 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -2268,7 +2268,7 @@ gnc_options_dialog_new_modal(gboolean modal, gchar *title,
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, retval);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(retval->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(retval->window), parent);
if (title)
gtk_window_set_title(GTK_WINDOW(retval->window), title);
diff --git a/gnucash/gnome-utils/dialog-preferences.c b/gnucash/gnome-utils/dialog-preferences.c
index f17b2d9..7118d4a 100644
--- a/gnucash/gnome-utils/dialog-preferences.c
+++ b/gnucash/gnome-utils/dialog-preferences.c
@@ -1444,7 +1444,7 @@ gnc_preferences_dialog (GtkWindow *parent)
dialog = gnc_preferences_dialog_create(parent);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(dialog), parent);
gtk_widget_show(dialog);
gnc_register_gui_component(DIALOG_PREFERENCES_CM_CLASS,
diff --git a/gnucash/gnome-utils/dialog-reset-warnings.c b/gnucash/gnome-utils/dialog-reset-warnings.c
index 5c810d2..02dd18c 100644
--- a/gnucash/gnome-utils/dialog-reset-warnings.c
+++ b/gnucash/gnome-utils/dialog-reset-warnings.c
@@ -413,7 +413,7 @@ gnc_reset_warnings_dialog (GtkWindow *parent)
/* Record the pointer to the rw data structure and clean up after */
g_object_set_data_full(G_OBJECT(rw_dialog->dialog), "dialog-structure", rw_dialog, g_free);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(rw_dialog->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(rw_dialog->dialog), parent);
gnc_register_gui_component (DIALOG_RESET_WARNINGS_CM_CLASS,
NULL, close_handler, rw_dialog);
diff --git a/gnucash/gnome-utils/dialog-tax-table.c b/gnucash/gnome-utils/dialog-tax-table.c
index dddce0b..9212fa5 100644
--- a/gnucash/gnome-utils/dialog-tax-table.c
+++ b/gnucash/gnome-utils/dialog-tax-table.c
@@ -768,7 +768,7 @@ gnc_ui_tax_table_window_new (GtkWindow *parent, QofBook *book)
ttw);
tax_table_window_refresh (ttw);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW (ttw->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW (ttw->dialog), parent);
gtk_widget_show_all (ttw->dialog);
g_object_unref(G_OBJECT(builder));
diff --git a/gnucash/gnome-utils/dialog-totd.c b/gnucash/gnome-utils/dialog-totd.c
index 0aa680e..d7158b0 100644
--- a/gnucash/gnome-utils/dialog-totd.c
+++ b/gnucash/gnome-utils/dialog-totd.c
@@ -366,7 +366,7 @@ gnc_totd_dialog (GtkWindow *parent, gboolean startup)
gnc_new_tip_number(totd_dialog, 1);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(totd_dialog->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(totd_dialog->dialog), parent);
gtk_widget_show(GTK_WIDGET (totd_dialog->dialog));
gnc_register_gui_component(DIALOG_TOTD_CM_CLASS,
diff --git a/gnucash/gnome-utils/dialog-transfer.c b/gnucash/gnome-utils/dialog-transfer.c
index 89a4bd9..9d2425a 100644
--- a/gnucash/gnome-utils/dialog-transfer.c
+++ b/gnucash/gnome-utils/dialog-transfer.c
@@ -2046,7 +2046,8 @@ gnc_xfer_dialog_create(GtkWidget *parent, XferDialog *xferData)
}
gtk_builder_connect_signals(builder, xferData);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW (xferData->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW (xferData->dialog), GTK_WINDOW (parent));
LEAVE(" ");
}
diff --git a/gnucash/gnome/assistant-hierarchy.c b/gnucash/gnome/assistant-hierarchy.c
index 5e1f8a1..a7f0d11 100644
--- a/gnucash/gnome/assistant-hierarchy.c
+++ b/gnucash/gnome/assistant-hierarchy.c
@@ -1317,7 +1317,8 @@ gnc_create_hierarchy_assistant (gboolean use_defaults, GncHierarchyAssistantFini
data->balance_hash = g_hash_table_new(NULL, NULL);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(data->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(data->dialog), gnc_ui_get_main_window(NULL));
g_signal_connect (G_OBJECT(dialog), "destroy",
G_CALLBACK (gnc_hierarchy_destroy_cb), data);
diff --git a/gnucash/gnome/dialog-commodities.c b/gnucash/gnome/dialog-commodities.c
index f4d0a51..7a5487e 100644
--- a/gnucash/gnome/dialog-commodities.c
+++ b/gnucash/gnome/dialog-commodities.c
@@ -362,7 +362,7 @@ gnc_commodities_dialog_create (GtkWidget * parent, CommoditiesDialog *cd)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), cd->show_currencies);
g_object_unref(G_OBJECT(builder));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(cd->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(cd->dialog), GTK_WINDOW(parent));
}
static void
diff --git a/gnucash/gnome/dialog-fincalc.c b/gnucash/gnome/dialog-fincalc.c
index d710183..8e96f77 100644
--- a/gnucash/gnome/dialog-fincalc.c
+++ b/gnucash/gnome/dialog-fincalc.c
@@ -676,7 +676,7 @@ gnc_ui_fincalc_dialog_create(GtkWindow *parent)
gtk_builder_connect_signals(builder, fcd);
g_object_unref(G_OBJECT(builder));
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(fcd->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(fcd->dialog), parent);
gtk_widget_show(fcd->dialog);
}
diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index 4a57b79..7175bc2 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -377,7 +377,7 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
g_object_unref (G_OBJECT(builder));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window), GTK_WINDOW(parent));
gtk_widget_show_all (GTK_WIDGET(facc_dialog->window));
diff --git a/gnucash/gnome/dialog-imap-editor.c b/gnucash/gnome/dialog-imap-editor.c
index 10456e7..5d43e2e 100644
--- a/gnucash/gnome/dialog-imap-editor.c
+++ b/gnucash/gnome/dialog-imap-editor.c
@@ -716,7 +716,7 @@ gnc_imap_dialog_create (GtkWidget *parent, ImapDialog *imap_dialog)
g_object_unref (G_OBJECT(builder));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(imap_dialog->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(imap_dialog->dialog), GTK_WINDOW(parent));
get_account_info (imap_dialog);
LEAVE(" ");
diff --git a/gnucash/gnome/dialog-price-edit-db.c b/gnucash/gnome/dialog-price-edit-db.c
index 4fdcc09..7ea93d7 100644
--- a/gnucash/gnome/dialog-price-edit-db.c
+++ b/gnucash/gnome/dialog-price-edit-db.c
@@ -735,7 +735,7 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
g_object_unref(G_OBJECT(builder));
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pdb_dialog->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pdb_dialog->dialog), GTK_WINDOW (parent));
LEAVE(" ");
}
diff --git a/gnucash/gnome/dialog-price-editor.c b/gnucash/gnome/dialog-price-editor.c
index 5b474c6..cbf65f3 100644
--- a/gnucash/gnome/dialog-price-editor.c
+++ b/gnucash/gnome/dialog-price-editor.c
@@ -544,7 +544,7 @@ gnc_price_edit_dialog (GtkWidget * parent,
pedit_dialog = g_new0 (PriceEditDialog, 1);
gnc_price_pedit_dialog_create (parent, pedit_dialog, session);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog), GTK_WINDOW(parent));
pedit_dialog->type = type;
switch (type)
diff --git a/gnucash/gnome/dialog-print-check.c b/gnucash/gnome/dialog-print-check.c
index c88a128..8ed5e86 100644
--- a/gnucash/gnome/dialog-print-check.c
+++ b/gnucash/gnome/dialog-print-check.c
@@ -1732,7 +1732,7 @@ gnc_ui_print_check_dialog_create(GtkWidget *parent,
gtk_widget_destroy(GTK_WIDGET(gtk_builder_get_object (builder, "lower_left")));
gnc_ui_print_restore_dialog(pcd);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pcd->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pcd->dialog), GTK_WINDOW (parent));
g_object_unref(G_OBJECT(builder));
gtk_widget_show_all(pcd->dialog);
diff --git a/gnucash/gnome/dialog-sx-editor.c b/gnucash/gnome/dialog-sx-editor.c
index 645bd16..4bb2790 100644
--- a/gnucash/gnome/dialog-sx-editor.c
+++ b/gnucash/gnome/dialog-sx-editor.c
@@ -1240,7 +1240,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create (GtkWindow *parent,
/* Allow resize */
gtk_window_set_resizable (GTK_WINDOW(sxed->dialog), TRUE);
- gnc_restore_window_size(GNC_PREFS_GROUP_SXED, GTK_WINDOW(sxed->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP_SXED, GTK_WINDOW(sxed->dialog), parent);
/* create the frequency-selection widget and example [dense-]calendar. */
schedXact_editor_create_freq_sel( sxed );
diff --git a/gnucash/gnome/dialog-sx-editor2.c b/gnucash/gnome/dialog-sx-editor2.c
index 6b280dd..7ee3b2c 100644
--- a/gnucash/gnome/dialog-sx-editor2.c
+++ b/gnucash/gnome/dialog-sx-editor2.c
@@ -1213,7 +1213,7 @@ gnc_ui_scheduled_xaction_editor_dialog_create2 (GtkWindow *parent,
/* Allow resize */
gtk_window_set_resizable (GTK_WINDOW (sxed->dialog), TRUE);
- gnc_restore_window_size (GNC_PREFS_GROUP_SXED, GTK_WINDOW (sxed->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP_SXED, GTK_WINDOW (sxed->dialog), parent);
/* create the frequency-selection widget and example [dense-]calendar. */
schedXact_editor_create_freq_sel (sxed);
diff --git a/gnucash/gnome/dialog-sx-since-last-run.c b/gnucash/gnome/dialog-sx-since-last-run.c
index 7486daf..0da2f9e 100644
--- a/gnucash/gnome/dialog-sx-since-last-run.c
+++ b/gnucash/gnome/dialog-sx-since-last-run.c
@@ -1040,7 +1040,7 @@ gnc_ui_sx_since_last_run_dialog (GtkWindow *parent, GncSxInstanceModel *sx_insta
g_signal_connect(G_OBJECT(dialog->dialog), "response", G_CALLBACK(dialog_response_cb), dialog);
g_signal_connect(G_OBJECT(dialog->dialog), "destroy", G_CALLBACK(dialog_destroy_cb), dialog);
- gnc_restore_window_size(GNC_PREFS_GROUP_STARTUP, GTK_WINDOW(dialog->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP_STARTUP, GTK_WINDOW(dialog->dialog), parent);
dialog->component_id = gnc_register_gui_component
(DIALOG_SX_SINCE_LAST_RUN_CM_CLASS, NULL, close_handler, dialog);
diff --git a/gnucash/gnome/dialog-tax-info.c b/gnucash/gnome/dialog-tax-info.c
index 3964786..b9ae1ce 100644
--- a/gnucash/gnome/dialog-tax-info.c
+++ b/gnucash/gnome/dialog-tax-info.c
@@ -1456,7 +1456,8 @@ gnc_tax_info_dialog_create (GtkWidget * parent, TaxInfoDialog *ti_dialog)
clear_gui (ti_dialog);
gnc_tax_info_set_changed (ti_dialog, FALSE);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(ti_dialog->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP,
+ GTK_WINDOW(ti_dialog->dialog), GTK_WINDOW (parent));
if (gnc_prefs_get_bool(GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
diff --git a/gnucash/gnome/window-reconcile2.c b/gnucash/gnome/window-reconcile2.c
index 699f97d..658b154 100644
--- a/gnucash/gnome/window-reconcile2.c
+++ b/gnucash/gnome/window-reconcile2.c
@@ -1764,7 +1764,8 @@ recnWindow2WithBalance (GtkWidget *parent, Account *account,
/* Force a reasonable starting size */
gtk_window_set_default_size (GTK_WINDOW (recnData->window), 800, 600);
- gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE,
+ GTK_WINDOW (recnData->window), GTK_WINDOW(parent));
gtk_container_add(GTK_CONTAINER(frame), main_area);
gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
diff --git a/gnucash/import-export/aqb/assistant-ab-initial.c b/gnucash/import-export/aqb/assistant-ab-initial.c
index 4ce2bc2..0f6bbd6 100644
--- a/gnucash/import-export/aqb/assistant-ab-initial.c
+++ b/gnucash/import-export/aqb/assistant-ab-initial.c
@@ -898,7 +898,8 @@ gnc_ab_initial_assistant_new(void)
selection = gtk_tree_view_get_selection(info->account_view);
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(info->window), gnc_ui_get_main_window(NULL));
g_signal_connect(info->account_view, "row-activated",
G_CALLBACK(account_list_clicked_cb), info);
diff --git a/gnucash/import-export/aqb/gnc-gwen-gui.c b/gnucash/import-export/aqb/gnc-gwen-gui.c
index 592e029..5550844 100644
--- a/gnucash/import-export/aqb/gnc-gwen-gui.c
+++ b/gnucash/import-export/aqb/gnc-gwen-gui.c
@@ -626,7 +626,8 @@ reset_dialog(GncGWENGui *gui)
if (gui->parent)
gtk_window_set_transient_for(GTK_WINDOW(gui->dialog),
GTK_WINDOW(gui->parent));
- gnc_restore_window_size(GNC_PREFS_GROUP_CONNECTION, GTK_WINDOW(gui->dialog));
+ gnc_restore_window_size(GNC_PREFS_GROUP_CONNECTION,
+ GTK_WINDOW(gui->dialog), GTK_WINDOW(gui->parent));
gui->keep_alive = TRUE;
gui->state = INIT;
diff --git a/gnucash/import-export/csv-exp/assistant-csv-export.c b/gnucash/import-export/csv-exp/assistant-csv-export.c
index a39090c..7836b14 100644
--- a/gnucash/import-export/csv-exp/assistant-csv-export.c
+++ b/gnucash/import-export/csv-exp/assistant-csv-export.c
@@ -944,7 +944,8 @@ csv_export_assistant_create (CsvExportInfo *info)
g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK(csv_export_assistant_destroy_cb), info);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(info->window), gnc_ui_get_main_window(NULL));
if (gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_SAVE_GEOMETRY))
{
GObject *object = gtk_builder_get_object (builder, "paned");
diff --git a/gnucash/import-export/csv-imp/assistant-csv-account-import.c b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
index aaceb5e..5cb3770 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-account-import.c
+++ b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
@@ -668,7 +668,8 @@ csv_import_assistant_create (CsvImportInfo *info)
g_signal_connect (G_OBJECT(window), "destroy",
G_CALLBACK(csv_import_assistant_destroy_cb), info);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(info->window), gnc_ui_get_main_window(NULL));
gtk_builder_connect_signals (builder, info);
g_object_unref (G_OBJECT(builder));
diff --git a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp
index a4a3ef7..2d6d19b 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp
+++ b/gnucash/import-export/csv-imp/assistant-csv-price-import.cpp
@@ -654,7 +654,8 @@ CsvImpPriceAssist::CsvImpPriceAssist ()
summary_page = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page"));
summary_label = GTK_WIDGET(gtk_builder_get_object (builder, "summary_label"));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(csv_imp_asst));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(csv_imp_asst), gnc_ui_get_main_window(nullptr));
gtk_builder_connect_signals (builder, this);
g_object_unref (G_OBJECT(builder));
diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
index b7369d7..d9132ba 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
+++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
@@ -648,7 +648,8 @@ CsvImpTransAssist::CsvImpTransAssist ()
summary_page = GTK_WIDGET(gtk_builder_get_object (builder, "summary_page"));
summary_label = GTK_WIDGET(gtk_builder_get_object (builder, "summary_label"));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(csv_imp_asst));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(csv_imp_asst), gnc_ui_get_main_window(nullptr));
gtk_builder_connect_signals (builder, this);
g_object_unref (G_OBJECT(builder));
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 78d46af..00fe751 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -573,7 +573,7 @@ GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent,
if (heading)
gtk_label_set_text (GTK_LABEL (heading_label), heading);
- gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->main_widget));
+ gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(info->main_widget), GTK_WINDOW (parent));
gtk_widget_show_all (GTK_WIDGET (info->main_widget));
info->transaction_processed_cb = NULL;
diff --git a/gnucash/import-export/import-match-picker.c b/gnucash/import-export/import-match-picker.c
index c396035..f82774c 100644
--- a/gnucash/import-export/import-match-picker.c
+++ b/gnucash/import-export/import-match-picker.c
@@ -492,7 +492,7 @@ init_match_picker_gui(GtkWidget *parent, GNCImportMatchPicker * matcher)
g_signal_connect((GObject *)matcher->reconciled_chk, "toggled", G_CALLBACK(match_show_reconciled_changed_cb), matcher);
gnc_restore_window_size(GNC_PREFS_GROUP,
- GTK_WINDOW (matcher->transaction_matcher));
+ GTK_WINDOW (matcher->transaction_matcher), GTK_WINDOW(parent));
gtk_widget_show(matcher->transaction_matcher);
g_object_unref(G_OBJECT(builder));
diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index 1d16f99..d2ad329 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -3653,7 +3653,8 @@ gnc_ui_qif_import_assistant_make(QIFImportWindow *qif_win)
box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_picker_hbox"));
gtk_box_pack_start(GTK_BOX(box), qif_win->currency_picker, TRUE, TRUE, 0);
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(qif_win->window));
+ gnc_restore_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(qif_win->window), gnc_ui_get_main_window(NULL));
g_signal_connect( qif_win->window, "destroy",
G_CALLBACK(gnc_ui_qif_import_assistant_destroy), qif_win );
diff --git a/gnucash/report/report-gnome/dialog-custom-report.c b/gnucash/report/report-gnome/dialog-custom-report.c
index be18149..edfb979 100644
--- a/gnucash/report/report-gnome/dialog-custom-report.c
+++ b/gnucash/report/report-gnome/dialog-custom-report.c
@@ -533,7 +533,8 @@ gnc_ui_custom_report_internal(GncMainWindow * window)
// Set the style context for this dialog so it can be easily manipulated with css
gnc_widget_set_style_context (GTK_WIDGET(crd->dialog), "GncCustomReportDialog");
- gnc_restore_window_size (GNC_PREFS_GROUP_REPORT_SAVED_CONFIGS, GTK_WINDOW(crd->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP_REPORT_SAVED_CONFIGS,
+ GTK_WINDOW(crd->dialog), GTK_WINDOW(window));
/* connect the signals */
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, crd);
commit dd59ba67f6d892e4b491941d07aa7848a265019e
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:17:19 2018 +0100
Add the parent window to gnc_restore_window_size function
When a dialogue is open for the first time, there is no saved geometry
so to locate this dialogue try and use the parent window location by
doing the following...
If the dialogue has a size, align it centrally on the parent window.
If the dialogue has no size, let gtk align it.
This commit breaks the build, the following commits changes all
occurrences of gnc_restore_window_size to include parent window.
diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index 60606da..406a091 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -85,10 +85,12 @@ gnc_set_label_color(GtkWidget *label, gnc_numeric value)
* Args: group - the preferences group to look in for saved coords *
* window - the window for which the coords are to be *
* restored *
+ * parent - the parent window that can be used to position *
+ * window when it still has default entries *
* Returns: nothing *
\*******************************************************************/
void
-gnc_restore_window_size(const char *group, GtkWindow *window)
+gnc_restore_window_size(const char *group, GtkWindow *window, GtkWindow *parent)
{
gint wpos[2], wsize[2];
GVariant *geometry;
@@ -153,6 +155,28 @@ gnc_restore_window_size(const char *group, GtkWindow *window)
gtk_window_move(window, wpos[0], wpos[1]);
}
+ else
+ {
+ /* preference is at default value -1,-1,-1,-1 */
+ if (parent != NULL)
+ {
+ gint parent_wpos[2], parent_wsize[2], window_wsize[2];
+ gtk_window_get_position (GTK_WINDOW(parent), &parent_wpos[0], &parent_wpos[1]);
+ gtk_window_get_size (GTK_WINDOW(parent), &parent_wsize[0], &parent_wsize[1]);
+ gtk_window_get_size (GTK_WINDOW(window), &window_wsize[0], &window_wsize[1]);
+
+ DEBUG("parent window - wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d - window size is %dx%d",
+ parent_wpos[0], parent_wpos[1], parent_wsize[0], parent_wsize[1],
+ window_wsize[0], window_wsize[1]);
+
+ /* check for gtk default size, no window size specified, let gtk decide location */
+ if ((window_wsize[0] == 200) && (window_wsize[1] == 200))
+ DEBUG("window size not specified, let gtk locate it");
+ else
+ gtk_window_move (window, parent_wpos[0] + (parent_wsize[0] - window_wsize[0])/2,
+ parent_wpos[1] + (parent_wsize[1] - window_wsize[1])/2);
+ }
+ }
/* Don't attempt to restore invalid sizes */
if ((wsize[0] > 0) && (wsize[1] > 0))
@@ -164,7 +188,6 @@ gnc_restore_window_size(const char *group, GtkWindow *window)
}
}
g_variant_unref (geometry);
-
LEAVE("");
}
diff --git a/gnucash/gnome-utils/dialog-utils.h b/gnucash/gnome-utils/dialog-utils.h
index 37cb849..50611c2 100644
--- a/gnucash/gnome-utils/dialog-utils.h
+++ b/gnucash/gnome-utils/dialog-utils.h
@@ -36,11 +36,12 @@ void gnc_set_label_color (GtkWidget *label, gnc_numeric value);
* if window sizes are being saved, otherwise returns 0 for both. *
* *
* Args: prefix - the option name prefix *
- * width - pointer to width *
- * height - pointer to height *
+ * window - the window being restored *
+ * parent - the parent window for first use alignment *
* Returns: nothing *
\*******************************************************************/
-void gnc_restore_window_size (const char *prefix, GtkWindow *window);
+void gnc_restore_window_size (const char *prefix, GtkWindow *window,
+ GtkWindow *parent);
/********************************************************************\
* Save the window size into options whose names are determined *
commit 0a0d4755c412ac4d08c9b3875cf4c9e52eaa71f4
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:05:59 2018 +0100
Fix restore window geometry
The monitor was not being correctly identified so when Gnucash was
running on the second monitor, a dialogue could be started on the first
which could be confusing. Also when a dialogue is restored a check is
made to try and make sure it fits on the monitor.
diff --git a/gnucash/gnome-utils/dialog-utils.c b/gnucash/gnome-utils/dialog-utils.c
index 203152f..60606da 100644
--- a/gnucash/gnome-utils/dialog-utils.c
+++ b/gnucash/gnome-utils/dialog-utils.c
@@ -104,35 +104,50 @@ gnc_restore_window_size(const char *group, GtkWindow *window)
geometry = gnc_prefs_get_value (group, GNC_PREF_LAST_GEOMETRY);
if (g_variant_is_of_type (geometry, (const GVariantType *) "(iiii)") )
{
- gint screen_width;
- gint screen_height;
-#if GTK_CHECK_VERSION(3,22,0)
- GdkWindow *win = gdk_screen_get_root_window (gtk_window_get_screen (window));
- GdkMonitor *mon = gdk_display_get_monitor_at_window (gtk_widget_get_display (GTK_WIDGET(window)), win);
GdkRectangle monitor_size;
- gdk_monitor_get_geometry (mon, &monitor_size);
-
- screen_width = monitor_size.width;
- screen_height = monitor_size.height;
+#if GTK_CHECK_VERSION(3,22,0)
+ GdkDisplay *display = gdk_display_get_default ();
+ GdkMonitor *mon;
#else
- screen_width = gdk_screen_width(); //default screen
- screen_height = gdk_screen_height(); //default screen
+ GdkScreen *screen = gdk_screen_get_default ();
+ gint mon_num;
#endif
+
g_variant_get (geometry, "(iiii)",
&wpos[0], &wpos[1],
&wsize[0], &wsize[1]);
- DEBUG("geometry from preferences - wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d",
- wpos[0], wpos[1], wsize[0], wsize[1]);
+
+#if GTK_CHECK_VERSION(3,22,0)
+ mon = gdk_display_get_monitor_at_point (display, wpos[0], wpos[1]);
+ gdk_monitor_get_geometry (mon, &monitor_size);
+#else
+ mon_num = gdk_screen_get_monitor_at_point (screen, wpos[0], wpos[1]);
+ gdk_screen_get_monitor_geometry (screen, mon_num, &monitor_size);
+#endif
+
+ DEBUG("monitor left top corner x: %d, y: %d, width: %d, height: %d",
+ monitor_size.x, monitor_size.y, monitor_size.width, monitor_size.height);
+ DEBUG("geometry from preferences - group, %s, wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d",
+ group, wpos[0], wpos[1], wsize[0], wsize[1]);
/* (-1, -1) means no geometry was saved (default preferences value) */
if ((wpos[0] != -1) && (wpos[1] != -1))
{
/* Keep the window on screen if possible */
- if (screen_width != 0)
- wpos[0] = wpos[0] % screen_width;
- if (screen_height != 0)
- wpos[1] = wpos[1] % screen_height;
+ if (wpos[0] - monitor_size.x + wsize[0] > monitor_size.x + monitor_size.width)
+ wpos[0] = monitor_size.x + monitor_size.width - wsize[0];
+
+ if (wpos[1] - monitor_size.y + wsize[1] > monitor_size.y + monitor_size.height)
+ wpos[1] = monitor_size.y + monitor_size.height - wsize[1];
+
+ /* make sure the cordinates have not left the monitor */
+ if (wpos[0] < monitor_size.x)
+ wpos[0] = monitor_size.x;
+
+ if (wpos[1] < monitor_size.y)
+ wpos[1] = monitor_size.y;
+
DEBUG("geometry after screen adaption - wpos[0]: %d, wpos[1]: %d, wsize[0]: %d, wsize[1]: %d",
wpos[0], wpos[1], wsize[0], wsize[1]);
@@ -141,7 +156,12 @@ gnc_restore_window_size(const char *group, GtkWindow *window)
/* Don't attempt to restore invalid sizes */
if ((wsize[0] > 0) && (wsize[1] > 0))
+ {
+ wsize[0] = MIN(wsize[0], monitor_size.width - 10);
+ wsize[1] = MIN(wsize[1], monitor_size.height - 10);
+
gtk_window_resize(window, wsize[0], wsize[1]);
+ }
}
g_variant_unref (geometry);
commit 2c6fbfba6e12ff55f3613b03f6a3a301cb855cfa
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sat Jul 28 17:03:10 2018 +0100
Update to recently changed GtkDialog to GtkWindow dialogues
Add the ability to close the window when the Escape key is pressed and
make sure window geometry is saved when by the buttons are used.
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index da5c14a..936addd 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -165,6 +165,7 @@ void gnc_option_changed_gain_loss_account_widget_cb(GtkTreeSelection *selection,
gpointer data);
void gnc_option_changed_gain_loss_account_del_button_widget_cb (GtkButton *button,
gpointer data);
+static void component_close_handler (gpointer data);
GtkWidget *
gnc_option_get_gtk_widget (GNCOption *option)
@@ -2028,6 +2029,8 @@ gnc_options_dialog_help_button_cb(GtkWidget * widget, GNCOptionWin *win)
static void
gnc_options_dialog_cancel_button_cb(GtkWidget * widget, GNCOptionWin *win)
{
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(win->window));
+
if (win->close_cb)
(win->close_cb)(win, win->close_cb_data);
else
@@ -2077,6 +2080,20 @@ gnc_options_dialog_destroy_cb (GtkWidget *object, GNCOptionWin *win)
}
}
+static gboolean
+gnc_options_dialog_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+ GNCOptionWin *win = data;
+
+ if (event->keyval == GDK_KEY_Escape)
+ {
+ component_close_handler (win);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
static void
gnc_options_dialog_reset_cb(GtkWidget * w, gpointer data)
{
@@ -2139,6 +2156,7 @@ static void
component_close_handler (gpointer data)
{
GNCOptionWin *win = data;
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(win->window));
gnc_options_dialog_cancel_button_cb (NULL, win);
}
@@ -2291,6 +2309,9 @@ gnc_options_dialog_new_modal(gboolean modal, gchar *title,
g_signal_connect (retval->window, "destroy",
G_CALLBACK(gnc_options_dialog_destroy_cb), retval);
+ g_signal_connect (retval->window, "key_press_event",
+ G_CALLBACK(gnc_options_dialog_window_key_press_cb), retval);
+
g_object_unref(G_OBJECT(builder));
retval->destroyed = FALSE;
diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index a25044b..4a57b79 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -65,6 +65,8 @@ typedef struct
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
+static void close_handler (gpointer user_data);
+
static void
gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data)
{
@@ -82,6 +84,20 @@ gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data
LEAVE(" ");
}
+static gboolean
+gnc_find_account_dialog_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
+{
+ FindAccountDialog *facc_dialog = user_data;
+
+ if (event->keyval == GDK_KEY_Escape)
+ {
+ close_handler (facc_dialog);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
static void
jump_to_account (FindAccountDialog *facc_dialog, Account *jump_account)
{
@@ -354,6 +370,9 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
g_signal_connect (facc_dialog->window, "destroy",
G_CALLBACK(gnc_find_account_dialog_window_destroy_cb), facc_dialog);
+ g_signal_connect (facc_dialog->window, "key_press_event",
+ G_CALLBACK(gnc_find_account_dialog_window_key_press_cb), facc_dialog);
+
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, facc_dialog);
g_object_unref (G_OBJECT(builder));
diff --git a/gnucash/gnome/dialog-trans-assoc.c b/gnucash/gnome/dialog-trans-assoc.c
index 9429a32..ce4747a 100644
--- a/gnucash/gnome/dialog-trans-assoc.c
+++ b/gnucash/gnome/dialog-trans-assoc.c
@@ -57,6 +57,8 @@ typedef struct
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
+static void close_handler (gpointer user_data);
+
static void
gnc_assoc_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data)
{
@@ -73,6 +75,20 @@ gnc_assoc_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data)
LEAVE(" ");
}
+static gboolean
+gnc_assoc_dialog_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
+{
+ AssocDialog *assoc_dialog = user_data;
+
+ if (event->keyval == GDK_KEY_Escape)
+ {
+ close_handler (assoc_dialog);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
static gint
sort_iter_compare_func (GtkTreeModel *model,
GtkTreeIter *a,
@@ -452,6 +468,9 @@ gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
g_signal_connect (assoc_dialog->window, "destroy",
G_CALLBACK(gnc_assoc_dialog_window_destroy_cb), assoc_dialog);
+ g_signal_connect (assoc_dialog->window, "key_press_event",
+ G_CALLBACK(gnc_assoc_dialog_window_key_press_cb), assoc_dialog);
+
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, assoc_dialog);
g_object_unref (G_OBJECT(builder));
commit accd154eb007b3fda2c3047fe92bfb22fd11a969
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 27 15:15:57 2018 -0700
Don't run test-stress-options.scm if no textual-ports.
ice-9 textual ports, required by test-stress-options, was introduced
in guile 2.2. We still support using guile-2.0.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e10a09..f5d372e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -342,6 +342,17 @@ if (GNC_SRFI64_RESULT EQUAL 0)
set (HAVE_SRFI64 TRUE)
endif ()
+# Test that guile has textual-ports. This is required for the stress test.
+execute_process (COMMAND ${GUILE_EXECUTABLE} -c "(use-modules (ice-9 textual-ports))"
+ RESULT_VARIABLE GNC_TEXT_PORTS_RESULT
+ ERROR_QUIET
+)
+
+if (GNC_TEXT_PORTS_RESULT EQUAL 0)
+ message (STATUS "Using guile textual-ports")
+ set (HAVE_TEXT_PORTS TRUE)
+endif ()
+
# ############################################################
if (WITH_AQBANKING)
gnc_pkg_check_modules (GWENHYWFAR REQUIRED gwenhywfar)
diff --git a/gnucash/report/standard-reports/test/CMakeLists.txt b/gnucash/report/standard-reports/test/CMakeLists.txt
index ed24291..7fbdd4f 100644
--- a/gnucash/report/standard-reports/test/CMakeLists.txt
+++ b/gnucash/report/standard-reports/test/CMakeLists.txt
@@ -10,10 +10,13 @@ set(scm_test_with_srfi64_SOURCES
test-charts.scm
test-transaction.scm
test-balance-sheet.scm
- test-stress-options.scm
test-income-gst.scm
)
+set(scm_test_with_textual_ports_SOURCES
+ test-stress-options.scm
+)
+
set(GUILE_DEPENDS
scm-gnc-module
scm-app-utils
@@ -28,6 +31,9 @@ set(GUILE_DEPENDS
if (HAVE_SRFI64)
gnc_add_scheme_tests("${scm_test_with_srfi64_SOURCES}")
+ if (HAVE_TEXT_PORTS)
+ gnc_add_scheme_tests("${scm_test_with_textual_ports_SOURCES}")
+ endif (HAVE_TEXT_PORTS)
endif (HAVE_SRFI64)
gnc_add_scheme_tests("${scm_test_standard_reports_SOURCES}")
commit f9700ba98d6af93be7fbccbf88f03025b7188660
Author: Yuri Chornoivan <yurchor at ukr.net>
Date: Fri Jul 27 14:23:15 2018 +0300
Fix minor typos
diff --git a/doc/guile-hackers.txt b/doc/guile-hackers.txt
index e5397da..d759382 100644
--- a/doc/guile-hackers.txt
+++ b/doc/guile-hackers.txt
@@ -33,7 +33,7 @@ either end. Guile supports a superset of R4RS (the Scheme standard).
For initial experimentation, you can use Guile as an interactive Scheme
shell to play around with the system.
-SLIB is a a library for Scheme implementations (including guile)
+SLIB is a library for Scheme implementations (including guile)
that implements a large collection of useful data structures
and algorithms.
diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 4059775..cf6f357 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -424,7 +424,7 @@ gbv_create_widget(GncBudgetView *view)
// Totals scroll window
priv->totals_scroll_window = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(priv->totals_scroll_window),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); // horzontal/vertical
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); // horizontal/vertical
h_adj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(priv->totals_scroll_window));
g_signal_connect(G_OBJECT(h_adj), "value-changed",
diff --git a/gnucash/report/business-reports/receipt.scm b/gnucash/report/business-reports/receipt.scm
index 2af29f7..7aea766 100644
--- a/gnucash/report/business-reports/receipt.scm
+++ b/gnucash/report/business-reports/receipt.scm
@@ -256,7 +256,7 @@
'name (N_ "Receipt")
'report-guid "7eb3df21073d4c33920a0257da15fba5"
'menu-name (N_ "Receipt")
- 'menu-tip (N_ "Display a customer invoice as receipt, cash vousher")
+ 'menu-tip (N_ "Display a customer invoice as receipt, cash voucher")
'menu-path (list gnc:menuname-business-reports)
'options-generator options-generator
'renderer report-renderer)
diff --git a/gnucash/report/jqplot/jquery.jqplot.js b/gnucash/report/jqplot/jquery.jqplot.js
index 30e776b..f88459c 100644
--- a/gnucash/report/jqplot/jquery.jqplot.js
+++ b/gnucash/report/jqplot/jquery.jqplot.js
@@ -1221,7 +1221,7 @@
// Alpha channel transparency of shadow. 0 = transparent.
this.shadowAlpha = '0.1';
// prop: breakOnNull
- // Wether line segments should be be broken at null value.
+ // Wether line segments should be broken at null value.
// False will join point on either side of line.
this.breakOnNull = false;
// prop: markerRenderer
diff --git a/gnucash/report/jqplot/plugins/jqplot.barRenderer.js b/gnucash/report/jqplot/plugins/jqplot.barRenderer.js
index 9001178..aa3b758 100644
--- a/gnucash/report/jqplot/plugins/jqplot.barRenderer.js
+++ b/gnucash/report/jqplot/plugins/jqplot.barRenderer.js
@@ -116,7 +116,7 @@
//////
// This is probably wrong here.
// After going back and forth on wether renderer should be the thing
- // or extend the thing, it seems that it it best if it is a property
+ // or extend the thing, it seems that it is best if it is a property
// on the thing. This should be something that is commonized
// among series renderers in the future.
//////
diff --git a/gnucash/report/jqplot/plugins/jqplot.bubbleRenderer.js b/gnucash/report/jqplot/plugins/jqplot.bubbleRenderer.js
index 1a7e517..f483768 100644
--- a/gnucash/report/jqplot/plugins/jqplot.bubbleRenderer.js
+++ b/gnucash/report/jqplot/plugins/jqplot.bubbleRenderer.js
@@ -100,7 +100,7 @@
// Multiplier the bubble size if autoscaleBubbles is true.
this.autoscaleMultiplier = 1.0;
// prop: autoscalePointsFactor
- // Factor which decreases bubble size based on how many bubbles on on the chart.
+ // Factor which decreases bubble size based on how many bubbles are on the chart.
// 0 means no adjustment for number of bubbles. Negative values will decrease
// size of bubbles as more bubbles are added. Values between 0 and -0.2
// should work well.
diff --git a/gnucash/report/report-system/eguile-utilities.scm b/gnucash/report/report-system/eguile-utilities.scm
index 5d6a9fd..25a91d8 100644
--- a/gnucash/report/report-system/eguile-utilities.scm
+++ b/gnucash/report/report-system/eguile-utilities.scm
@@ -88,7 +88,7 @@
; explicit lambda and has the list expression all the way at the end).
(define-syntax for
(syntax-rules (for in => do hash)
- ; Multiple variables and and equal number of lists (in
+ ; Multiple variables and equal number of lists (in
; parenthesis). e.g.:
;
; (for (a b) in (lsta lstb) do (display (+ a b)))
diff --git a/gnucash/report/standard-reports/budget-barchart.scm b/gnucash/report/standard-reports/budget-barchart.scm
index 4bb7ed4..acb14df 100644
--- a/gnucash/report/standard-reports/budget-barchart.scm
+++ b/gnucash/report/standard-reports/budget-barchart.scm
@@ -132,9 +132,9 @@
;; For each period in the budget:
;; Retrieve the budgeted running sum and actual running sum
-;; for bac chart.
+;; for bar chart.
;;
-;; Create bar and and values
+;; Create bar and values
;;
(define (gnc:chart-create-budget-actual budget acct running-sum chart-type width height report-start-time report-end-time)
(let* (
diff --git a/gnucash/report/standard-reports/budget.scm b/gnucash/report/standard-reports/budget.scm
index fb1d969..66a6d87 100644
--- a/gnucash/report/standard-reports/budget.scm
+++ b/gnucash/report/standard-reports/budget.scm
@@ -136,7 +136,7 @@
(list->vector
(list 'manual
(N_ "Manual period selection")
- (N_ "Explicitly select period valud with spinner below")))))
+ (N_ "Explicitly select period value with spinner below")))))
(ui-use-periods #f)
(ui-start-period-type 'current)
(ui-end-period-type 'next)
diff --git a/libgnucash/app-utils/calculation/fin.c b/libgnucash/app-utils/calculation/fin.c
index a651a24..37bb185 100644
--- a/libgnucash/app-utils/calculation/fin.c
+++ b/libgnucash/app-utils/calculation/fin.c
@@ -653,7 +653,7 @@
*
* For those cases where a yearly summary only is desired, it is not
* necessary to compute each transaction for each payment period,
- * rather the PV may be be computed for the beginning of each year,
+ * rather the PV may be computed for the beginning of each year,
* PV[yr], and the FV computed for the end of the year, FV[yr]. The
* interest paid during the year is the computed as:
*
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
index f95d38e..1624349 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/libgnucash/app-utils/guile-util.h
@@ -84,7 +84,7 @@ char * gnc_get_credit_string(GNCAccountType account_type);
typedef struct _Process Process;
/** Wraps g_spawn_async_with_pipes minimally. Use gnc_process_get_fd to access
- * the file descriptors to the child. To close them them and free the memory
+ * the file descriptors to the child. To close them and free the memory
* allocated for the process once it has exited, call gnc_detach_process.
*
* @param argl A list of null-terminated strings used as arguments for spawning,
commit d6b245772e1d66a53165ee83304b97fe124c6ecc
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 15:22:51 2018 -0700
Fix out-of-order declarations.
Broke Travis.
diff --git a/gnucash/import-export/aqb/gnc-ab-kvp.c b/gnucash/import-export/aqb/gnc-ab-kvp.c
index 9d1988f..4b5b1f6 100644
--- a/gnucash/import-export/aqb/gnc-ab-kvp.c
+++ b/gnucash/import-export/aqb/gnc-ab-kvp.c
@@ -108,8 +108,8 @@ gnc_ab_get_account_trans_retrieval(const Account *a)
void
gnc_ab_set_account_trans_retrieval(Account *a, time64 time)
{
- xaccAccountBeginEdit(a);
Timespec ts = {time, 0};
+ xaccAccountBeginEdit(a);
qof_instance_set (QOF_INSTANCE (a),
"ab-trans-retrieval", &ts,
NULL);
diff --git a/gnucash/import-export/csv-exp/csv-transactions-export.c b/gnucash/import-export/csv-exp/csv-transactions-export.c
index 393e0ed..7a1970e 100644
--- a/gnucash/import-export/csv-exp/csv-transactions-export.c
+++ b/gnucash/import-export/csv-exp/csv-transactions-export.c
@@ -148,9 +148,9 @@ add_reconcile_date (gchar *so_far, Split *split, CsvExportInfo *info)
if (xaccSplitGetReconcile (split) == YREC)
{
+ time64 t = xaccSplitGetDateReconciled (split);
char str_rec_date[MAX_DATE_LENGTH + 1];
memset (str_rec_date, 0, sizeof(str_rec_date));
- time64 t = xaccSplitGetDateReconciled (split);
qof_print_date_buff (str_rec_date, sizeof(str_rec_date), t);
result = g_strconcat (so_far, str_rec_date, info->mid_sep, NULL);
}
commit 216528c130843010c2a4ef573e1ed5ccaa6f9f4f
Merge: 9cb00f8 64778fc
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 14:51:01 2018 -0700
Merge Bob Fewell's 'fixes8' into maint.
commit 9cb00f8fe447632e1bb38607e19e99b161107bd3
Merge: 9993e0c 697d2a1
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 14:45:56 2018 -0700
Merge Di Mang's 'maint-transfer-02' into maint.
Leaving the MAX_TAB_COUNT at 6, so no "further expansion room".
diff --cc gnucash/gnome-utils/dialog-options.c
index f981c5b,d224a52..7301d19
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@@ -74,7 -74,7 +74,7 @@@ static QofLogModule log_module = GNC_MO
* Point where preferences switch control method from a set of
* notebook tabs to a list.
*/
- #define MAX_TAB_COUNT 4
-#define MAX_TAB_COUNT 8
++#define MAX_TAB_COUNT 6
/* A pointer to the last selected filename */
#define LAST_SELECTION "last-selection"
commit 9993e0ce2964d00083489dedb10eb6c0dc62544b
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 14:39:20 2018 -0700
Almost completely remove Timespec from import-export.
KvpValue doesn't have a time64 type so aqb-kvp still needs to use
Timespec internally.
diff --git a/gnucash/import-export/aqb/dialog-ab-daterange.c b/gnucash/import-export/aqb/dialog-ab-daterange.c
index 492e90a..8604a83 100644
--- a/gnucash/import-export/aqb/dialog-ab-daterange.c
+++ b/gnucash/import-export/aqb/dialog-ab-daterange.c
@@ -51,10 +51,10 @@ struct _DaterangeInfo
gboolean
gnc_ab_enter_daterange(GtkWidget *parent,
const char *heading,
- Timespec *from_date,
+ time64 *from_date,
gboolean *last_retv_date,
gboolean *first_possible_date,
- Timespec *to_date,
+ time64 *to_date,
gboolean *to_now)
{
GtkBuilder *builder;
@@ -86,12 +86,12 @@ gnc_ab_enter_daterange(GtkWidget *parent,
now_button = GTK_WIDGET(gtk_builder_get_object (builder, "now_button"));
info.enter_to_button = GTK_WIDGET(gtk_builder_get_object (builder, "enter_to_button"));
- info.from_dateedit = gnc_date_edit_new_ts(*from_date, FALSE, FALSE);
+ info.from_dateedit = gnc_date_edit_new (*from_date, FALSE, FALSE);
gtk_container_add(GTK_CONTAINER(gtk_builder_get_object (builder, "enter_from_box")),
info.from_dateedit);
gtk_widget_show(info.from_dateedit);
- info.to_dateedit = gnc_date_edit_new_ts(*to_date, FALSE, FALSE);
+ info.to_dateedit = gnc_date_edit_new (*to_date, FALSE, FALSE);
gtk_container_add(GTK_CONTAINER(gtk_builder_get_object (builder, "enter_to_box")),
info.to_dateedit);
gtk_widget_show(info.to_dateedit);
@@ -122,14 +122,12 @@ gnc_ab_enter_daterange(GtkWidget *parent,
if (result == GTK_RESPONSE_OK)
{
- *from_date = gnc_date_edit_get_date_ts(
- GNC_DATE_EDIT(info.from_dateedit));
+ *from_date = gnc_date_edit_get_date(GNC_DATE_EDIT(info.from_dateedit));
*last_retv_date = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(last_retrieval_button));
*first_possible_date = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(first_button));
- *to_date = gnc_date_edit_get_date_ts(
- GNC_DATE_EDIT(info.to_dateedit));
+ *to_date = gnc_date_edit_get_date (GNC_DATE_EDIT(info.to_dateedit));
*to_now = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(now_button));
}
diff --git a/gnucash/import-export/aqb/dialog-ab-daterange.h b/gnucash/import-export/aqb/dialog-ab-daterange.h
index 957a64c..38ed426 100644
--- a/gnucash/import-export/aqb/dialog-ab-daterange.h
+++ b/gnucash/import-export/aqb/dialog-ab-daterange.h
@@ -56,10 +56,10 @@ G_BEGIN_DECLS
*/
gboolean gnc_ab_enter_daterange(GtkWidget *parent,
const char *heading,
- Timespec *from_date,
+ time64 *from_date,
gboolean *last_retv_date,
gboolean *first_possible_date,
- Timespec *to_date,
+ time64 *to_date,
gboolean *to_now);
G_END_DECLS
diff --git a/gnucash/import-export/aqb/gnc-ab-gettrans.c b/gnucash/import-export/aqb/gnc-ab-gettrans.c
index 8a7641f..92f02c7 100644
--- a/gnucash/import-export/aqb/gnc-ab-gettrans.c
+++ b/gnucash/import-export/aqb/gnc-ab-gettrans.c
@@ -50,8 +50,7 @@ static gboolean
gettrans_dates(GtkWidget *parent, Account *gnc_acc,
GWEN_TIME **from_date, GWEN_TIME **to_date)
{
- Timespec last_timespec, until_timespec;
- time64 now = gnc_time (NULL);
+ time64 last, until;
gboolean use_last_date = TRUE;
gboolean use_earliest_date = TRUE;
gboolean use_until_now = TRUE;
@@ -59,19 +58,19 @@ gettrans_dates(GtkWidget *parent, Account *gnc_acc,
g_return_val_if_fail(from_date && to_date, FALSE);
/* Get time of last retrieval */
- last_timespec = gnc_ab_get_account_trans_retrieval(gnc_acc);
- if (last_timespec.tv_sec == 0)
+ last = gnc_ab_get_account_trans_retrieval(gnc_acc);
+ if (last == 0)
{
use_last_date = FALSE;
- timespecFromTime64 (&last_timespec, now);
+ last = gnc_time (NULL);
}
- timespecFromTime64 (&until_timespec, now);
+ until = gnc_time (NULL);
/* Let the user choose the date range of retrieval */
if (!gnc_ab_enter_daterange(parent, NULL,
- &last_timespec,
+ &last,
&use_last_date, &use_earliest_date,
- &until_timespec, &use_until_now))
+ &until, &use_until_now))
return FALSE;
/* Now calculate from date */
@@ -82,14 +81,14 @@ gettrans_dates(GtkWidget *parent, Account *gnc_acc,
else
{
if (use_last_date)
- last_timespec = gnc_ab_get_account_trans_retrieval(gnc_acc);
- *from_date = GWEN_Time_fromSeconds(timespecToTime64(last_timespec));
+ last = gnc_ab_get_account_trans_retrieval(gnc_acc);
+ *from_date = GWEN_Time_fromSeconds(last);
}
/* Now calculate to date */
if (use_until_now)
- timespecFromTime64(&until_timespec, now);
- *to_date = GWEN_Time_fromSeconds(timespecToTime64(until_timespec));
+ until = gnc_time (NULL);
+ *to_date = GWEN_Time_fromSeconds(until);
return TRUE;
}
@@ -101,7 +100,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
gboolean online = FALSE;
AB_ACCOUNT *ab_acc;
GWEN_TIME *from_date = NULL, *to_date = NULL;
- Timespec until_timespec;
+ time64 until;
AB_JOB *job = NULL;
AB_JOB_LIST2 *job_list = NULL;
GncGWENGui *gui = NULL;
@@ -145,7 +144,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
goto cleanup;
}
/* Use this as a local storage for the until_time below. */
- timespecFromTime64(&until_timespec, GWEN_Time_toTime_t(to_date));
+ until = GWEN_Time_toTime_t(to_date);
/* Get a GetTransactions job and enqueue it */
job = AB_JobGetTransactions_new(ab_acc);
@@ -217,7 +216,7 @@ gnc_ab_gettrans(GtkWidget *parent, Account *gnc_acc)
}
/* Store the date of this retrieval */
- gnc_ab_set_account_trans_retrieval(gnc_acc, until_timespec);
+ gnc_ab_set_account_trans_retrieval(gnc_acc, until);
cleanup:
if (ieci)
diff --git a/gnucash/import-export/aqb/gnc-ab-kvp.c b/gnucash/import-export/aqb/gnc-ab-kvp.c
index 80be042..9d1988f 100644
--- a/gnucash/import-export/aqb/gnc-ab-kvp.c
+++ b/gnucash/import-export/aqb/gnc-ab-kvp.c
@@ -95,22 +95,23 @@ gnc_ab_set_account_uid(Account *a, guint32 uid)
xaccAccountCommitEdit(a);
}
-Timespec
+time64
gnc_ab_get_account_trans_retrieval(const Account *a)
{
Timespec *t = NULL;
qof_instance_get (QOF_INSTANCE (a),
"ab-trans-retrieval", &t,
NULL);
- return t ? *t : (Timespec){0, 0};
+ return t ? t->tv_sec : 0;
}
void
-gnc_ab_set_account_trans_retrieval(Account *a, Timespec time)
+gnc_ab_set_account_trans_retrieval(Account *a, time64 time)
{
xaccAccountBeginEdit(a);
+ Timespec ts = {time, 0};
qof_instance_set (QOF_INSTANCE (a),
- "ab-trans-retrieval", &time,
+ "ab-trans-retrieval", &ts,
NULL);
xaccAccountCommitEdit(a);
}
diff --git a/gnucash/import-export/aqb/gnc-ab-kvp.h b/gnucash/import-export/aqb/gnc-ab-kvp.h
index 1c21b28..44fe818 100644
--- a/gnucash/import-export/aqb/gnc-ab-kvp.h
+++ b/gnucash/import-export/aqb/gnc-ab-kvp.h
@@ -99,7 +99,7 @@ void gnc_ab_set_account_uid(Account *a, guint32 uid);
* @param a Account
* @return Retrieval time
*/
-Timespec gnc_ab_get_account_trans_retrieval(const Account *a);
+time64 gnc_ab_get_account_trans_retrieval(const Account *a);
/**
* Set the time of last online transaction retrieval for Account @a a. The
@@ -108,7 +108,7 @@ Timespec gnc_ab_get_account_trans_retrieval(const Account *a);
* @param a Account
* @param time Retrieval time
*/
-void gnc_ab_set_account_trans_retrieval(Account *a, Timespec time);
+void gnc_ab_set_account_trans_retrieval(Account *a, time64 time);
/** @} */
diff --git a/gnucash/import-export/aqb/test/test-kvp.c b/gnucash/import-export/aqb/test/test-kvp.c
index fc7fd60..29e7f85 100644
--- a/gnucash/import-export/aqb/test/test-kvp.c
+++ b/gnucash/import-export/aqb/test/test-kvp.c
@@ -150,7 +150,6 @@ test_qofsession_aqb_kvp( void )
QofBook *book = qof_session_get_book(new_session);
Account* account = gnc_book_get_root_account(book);
struct tm *retrieved_date, *original_date;
- gchar buff[MAX_DATE_LENGTH];
g_assert(account);
@@ -158,10 +157,13 @@ test_qofsession_aqb_kvp( void )
// from the xml file?
if (1)
{
- Timespec retrieved_ts = gnc_ab_get_account_trans_retrieval(account);
- g_test_message("retrieved_ts=%s\n", gnc_print_date(retrieved_ts));
+ time64 retrieved = gnc_ab_get_account_trans_retrieval(account);
+ char date_buf [MAX_DATE_LENGTH + 1];
+ memset (date_buf, 0, sizeof(date_buf));
+ qof_print_date_buff (date_buf, sizeof(date_buf), retrieved);
+ g_test_message("retrieved=%s\n", date_buf);
- retrieved_date = gnc_gmtime (&retrieved_ts.tv_sec);
+ retrieved_date = gnc_gmtime (&retrieved);
g_assert_cmpint (retrieved_date->tm_year, ==, 114);
g_assert_cmpint (retrieved_date->tm_mon, ==, 7);
g_assert_cmpint (retrieved_date->tm_mday, ==, 29);
@@ -172,17 +174,23 @@ test_qofsession_aqb_kvp( void )
// Account, just a general Account object.
if (1)
{
- Timespec original_ts = timespec_now(), retrieved_ts;
+ time64 original = gnc_time (NULL), retrieved;
+ char date_buf_1 [MAX_DATE_LENGTH + 1];
+ char date_buf_2 [MAX_DATE_LENGTH + 1];
+ memset (date_buf_1, 0, sizeof(date_buf_1));
+ memset (date_buf_2, 0, sizeof(date_buf_2));
// Check whether the "ab-trans-retrieval" property of Account
// is written and read again correctly.
- gnc_ab_set_account_trans_retrieval(account, original_ts);
- retrieved_ts = gnc_ab_get_account_trans_retrieval(account);
- g_test_message("original_ts=%s\n", gnc_print_date(original_ts));
- g_test_message("retrieved_ts=%s\n", gnc_print_date(retrieved_ts));
-
- original_date = gnc_gmtime (&original_ts.tv_sec);
- retrieved_date = gnc_gmtime (&retrieved_ts.tv_sec);
+ gnc_ab_set_account_trans_retrieval(account, original);
+ retrieved = gnc_ab_get_account_trans_retrieval(account);
+ qof_print_date_buff(date_buf_1, sizeof(date_buf_1), original);
+ qof_print_date_buff(date_buf_2, sizeof(date_buf_2), retrieved);
+ g_test_message("original_ts=%s\n", date_buf_1);
+ g_test_message("retrieved_ts=%s\n", date_buf_2);
+
+ original_date = gnc_gmtime (&original);
+ retrieved_date = gnc_gmtime (&retrieved);
g_assert_cmpint (retrieved_date->tm_year, ==, original_date->tm_year);
g_assert_cmpint (retrieved_date->tm_mon, ==, original_date->tm_mon);
diff --git a/gnucash/import-export/csv-exp/csv-transactions-export.c b/gnucash/import-export/csv-exp/csv-transactions-export.c
index 5526362..393e0ed 100644
--- a/gnucash/import-export/csv-exp/csv-transactions-export.c
+++ b/gnucash/import-export/csv-exp/csv-transactions-export.c
@@ -148,10 +148,10 @@ add_reconcile_date (gchar *so_far, Split *split, CsvExportInfo *info)
if (xaccSplitGetReconcile (split) == YREC)
{
- Timespec ts = {0,0};
- const gchar *str_rec_date;
- xaccSplitGetDateReconciledTS (split, &ts);
- str_rec_date = gnc_print_date (ts);
+ char str_rec_date[MAX_DATE_LENGTH + 1];
+ memset (str_rec_date, 0, sizeof(str_rec_date));
+ time64 t = xaccSplitGetDateReconciled (split);
+ qof_print_date_buff (str_rec_date, sizeof(str_rec_date), t);
result = g_strconcat (so_far, str_rec_date, info->mid_sep, NULL);
}
else
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp
index 1a3ec7b..c989ae8 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-price.cpp
@@ -251,15 +251,14 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
return FAILED;
}
- Timespec date;
- timespecFromTime64 (&date, static_cast<time64>(GncDateTime(*m_date, DayPart::neutral)));
- date.tv_nsec = 0;
+ auto date = static_cast<time64>(GncDateTime(*m_date, DayPart::neutral));
bool rev = false;
auto amount = *m_amount;
Result ret_val = ADDED;
- GNCPrice *old_price = gnc_pricedb_lookup_day (pdb, *m_from_commodity, *m_to_currency, date);
+ GNCPrice *old_price = gnc_pricedb_lookup_day_t64 (pdb, *m_from_commodity,
+ *m_to_currency, date);
// Should old price be over writen
if ((old_price != nullptr) && (over == true))
@@ -287,10 +286,14 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
rev = true;
}
- DEBUG("Date is %s, Rev is %d, Commodity from is '%s', Currency is '%s', Amount is %s", gnc_print_date (date),
- rev, gnc_commodity_get_fullname (*m_from_commodity), gnc_commodity_get_fullname (*m_to_currency),
- amount.to_string().c_str());
-
+ char date_str [MAX_DATE_LENGTH + 1];
+ memset (date_str, 0, sizeof(date_str));
+ qof_print_date_buff (date_str, sizeof(date_str), date);
+ DEBUG("Date is %s, Rev is %d, Commodity from is '%s', Currency is '%s', "
+ "Amount is %s", date_str, rev,
+ gnc_commodity_get_fullname (*m_from_commodity),
+ gnc_commodity_get_fullname (*m_to_currency),
+ amount.to_string().c_str());
// Create the new price
if (old_price == nullptr)
{
@@ -311,7 +314,7 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
auto amount_conv = amount.convert<RoundType::half_up>(CURRENCY_DENOM);
gnc_price_set_value (price, static_cast<gnc_numeric>(amount_conv));
- gnc_price_set_time (price, date);
+ gnc_price_set_time64 (price, date);
gnc_price_set_source (price, PRICE_SOURCE_USER_PRICE);
//FIXME Not sure which one gnc_price_set_source (price, PRICE_SOURCE_FQ);
gnc_price_set_typestr (price, PRICE_TYPE_LAST);
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
index 7c4246d..7e0a35f 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
@@ -556,10 +556,11 @@ static void trans_add_split (Transaction* trans, Account* account, GncNumeric am
value = amount * *price;
else
{
- Timespec ts = {xaccTransRetDatePosted (trans), 0};
+ auto time = xaccTransRetDatePosted (trans);
/* Import data didn't specify price, let's lookup the nearest in time */
- auto nprice = gnc_pricedb_lookup_nearest_in_time(gnc_pricedb_get_db(book),
- acct_comm, trans_curr, ts);
+ auto nprice =
+ gnc_pricedb_lookup_nearest_in_time64(gnc_pricedb_get_db(book),
+ acct_comm, trans_curr, time);
if (nprice)
{
/* Found a usable price. Let's check if the conversion direction is right */
diff --git a/gnucash/import-export/import-parse.c b/gnucash/import-export/import-parse.c
index e56480c..ca90430 100644
--- a/gnucash/import-export/import-parse.c
+++ b/gnucash/import-export/import-parse.c
@@ -292,7 +292,7 @@ fix_year(int y)
}
gboolean
-gnc_import_parse_date(const char *str, GncImportFormat fmt, Timespec *val)
+gnc_import_parse_date(const char *str, GncImportFormat fmt, time64 *val)
{
regmatch_t match[5];
char temp[9];
@@ -405,7 +405,7 @@ gnc_import_parse_date(const char *str, GncImportFormat fmt, Timespec *val)
return FALSE;
y = fix_year(y);
- *val = gnc_dmy2timespec(d, m, y);
+ *val = gnc_dmy2time64(d, m, y);
return TRUE;
}
diff --git a/gnucash/import-export/import-parse.h b/gnucash/import-export/import-parse.h
index d436d20..a6bc850 100644
--- a/gnucash/import-export/import-parse.h
+++ b/gnucash/import-export/import-parse.h
@@ -55,7 +55,7 @@ GncImportFormat gnc_import_choose_fmt(const char* msg, GncImportFormat fmts,
gboolean gnc_import_parse_numeric(const char* str, GncImportFormat fmt,
gnc_numeric *val);
gboolean gnc_import_parse_date(const char *date, GncImportFormat fmt,
- Timespec *val);
+ time64 *val);
/* Set and clear flags in bit-flags */
#define import_set_flag(i,f) (i |= f)
diff --git a/gnucash/import-export/log-replay/gnc-log-replay.c b/gnucash/import-export/log-replay/gnc-log-replay.c
index 00bbb2b..34d135a 100644
--- a/gnucash/import-export/log-replay/gnc-log-replay.c
+++ b/gnucash/import-export/log-replay/gnc-log-replay.c
@@ -71,11 +71,11 @@ typedef struct _split_record
int trans_guid_present;
GncGUID split_guid;
int split_guid_present;
- Timespec log_date;
+ time64 log_date;
int log_date_present;
- Timespec date_entered;
+ time64 date_entered;
int date_entered_present;
- Timespec date_posted;
+ time64 date_posted;
int date_posted_present;
GncGUID acc_guid;
int acc_guid_present;
@@ -97,7 +97,7 @@ typedef struct _split_record
int amount_present;
gnc_numeric value;
int value_present;
- Timespec date_reconciled;
+ time64 date_reconciled;
int date_reconciled_present;
} split_record;
/********************************************************************\
@@ -181,20 +181,17 @@ static split_record interpret_split_record( char *record_line)
}
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
{
- time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
- record.log_date.tv_sec = secs;
+ record.log_date = gnc_iso8601_to_time64_gmt(tok_ptr);
record.log_date_present = TRUE;
}
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
{
- time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
- record.date_entered.tv_sec = secs;
+ record.date_entered = gnc_iso8601_to_time64_gmt(tok_ptr);
record.date_entered_present = TRUE;
}
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
{
- time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
- record.date_posted.tv_sec = secs;
+ record.date_posted = gnc_iso8601_to_time64_gmt(tok_ptr);
record.date_posted_present = TRUE;
}
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
@@ -249,8 +246,7 @@ static split_record interpret_split_record( char *record_line)
}
if (strlen(tok_ptr = my_strtok(NULL, "\t")) != 0)
{
- time64 secs = gnc_iso8601_to_time64_gmt(tok_ptr);
- record.date_reconciled.tv_sec = secs;
+ record.date_reconciled = gnc_iso8601_to_time64_gmt(tok_ptr);
record.date_reconciled_present = TRUE;
}
@@ -298,17 +294,17 @@ static void dump_split_record(split_record record)
}
if (record.log_date_present)
{
- gnc_timespec_to_iso8601_buff (record.log_date, string_buf);
+ gnc_time64_to_iso8601_buff (record.log_date, string_buf);
DEBUG("Log entry date: %s", string_buf);
}
if (record.date_entered_present)
{
- gnc_timespec_to_iso8601_buff (record.date_entered, string_buf);
+ gnc_time64_to_iso8601_buff (record.date_entered, string_buf);
DEBUG("Date entered: %s", string_buf);
}
if (record.date_posted_present)
{
- gnc_timespec_to_iso8601_buff (record.date_posted, string_buf);
+ gnc_time64_to_iso8601_buff (record.date_posted, string_buf);
DEBUG("Date posted: %s", string_buf);
}
if (record.acc_guid_present)
@@ -358,7 +354,7 @@ static void dump_split_record(split_record record)
}
if (record.date_reconciled_present)
{
- gnc_timespec_to_iso8601_buff (record.date_reconciled, string_buf);
+ gnc_time64_to_iso8601_buff (record.date_reconciled, string_buf);
DEBUG("Reconciled date: %s", string_buf);
}
}
@@ -452,11 +448,11 @@ static void process_trans_record( FILE *log_file)
/*Fill the transaction info*/
if (record.date_entered_present)
{
- xaccTransSetDateEnteredSecs(trans, record.date_entered.tv_sec);
+ xaccTransSetDateEnteredSecs(trans, record.date_entered);
}
if (record.date_posted_present)
{
- xaccTransSetDatePostedSecs(trans, record.date_posted.tv_sec);
+ xaccTransSetDatePostedSecs(trans, record.date_posted);
}
if (record.trans_num_present)
{
@@ -510,7 +506,7 @@ static void process_trans_record( FILE *log_file)
}
if (record.date_reconciled_present)
{
- xaccSplitSetDateReconciledTS (split, &(record.date_reconciled));
+ xaccSplitSetDateReconciledSecs (split, record.date_reconciled);
}
if (record.split_reconcile_present)
{
diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index cd4df57..aea382f 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -503,9 +503,8 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
}
if (data.date_funds_available_valid)
{
- Timespec ts;
- timespecFromTime64(&ts, data.date_funds_available);
- gnc_timespec_to_iso8601_buff (ts, dest_string);
+ time64 time = data.date_funds_available;
+ gnc_time64_to_iso8601_buff (time, dest_string);
tmp = notes;
notes = g_strdup_printf("%s%s%s", tmp,
"|Date funds available:", dest_string);
diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index 1ab3788..1d16f99 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -3137,7 +3137,9 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
duplicates = wind->match_transactions;
while (!scm_is_null(duplicates))
{
- Timespec send_ts = {0,0};
+ time64 send_time = 0;
+ char date_buf[MAX_DATE_LENGTH + 1];
+ memset (date_buf, 0, sizeof(date_buf));
current_xtn = SCM_CAAR(duplicates);
#define FUNC_NAME "xaccTransCountSplits"
gnc_xtn = SWIG_MustGetPtr(current_xtn,
@@ -3154,12 +3156,13 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
(xaccSplitGetAccount(gnc_split), TRUE));
}
gtk_list_store_append(store, &iter);
- send_ts.tv_sec = xaccTransRetDatePosted(gnc_xtn);
+ send_time = xaccTransRetDatePosted(gnc_xtn);
+ qof_print_date_buff (date_buf, sizeof(date_buf), send_time);
gtk_list_store_set
(store, &iter,
QIF_TRANS_COL_INDEX, rownum++,
QIF_TRANS_COL_DATE,
- gnc_print_date(send_ts),
+ date_buf,
QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
QIF_TRANS_COL_AMOUNT, amount_str,
-1);
diff --git a/gnucash/import-export/test/test-import-parse.c b/gnucash/import-export/test/test-import-parse.c
index 3314f51..22d9880 100644
--- a/gnucash/import-export/test/test-import-parse.c
+++ b/gnucash/import-export/test/test-import-parse.c
@@ -137,11 +137,11 @@ test_parse_numeric(void)
static void
test_date(const char* str, GncImportFormat fmt, my_ymd_t date)
{
- Timespec ts, ts2;;
+ time64 t1, t2;
- do_test(gnc_import_parse_date(str, fmt, &ts), "Parsing date");
- ts2 = gnc_dmy2timespec(date.d, date.m, date.y);
- do_test(timespec_equal(&ts, &ts2), "Date Equal");
+ do_test(gnc_import_parse_date(str, fmt, &t1), "Parsing date");
+ t2 = gnc_dmy2time64(date.d, date.m, date.y);
+ do_test(t1 == t2, "Date Equal");
}
static void
commit 1131aa6fc44e9d3902197fef37b99c42cbd12a7e
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 12:48:52 2018 -0700
Clean up jenny's whitespace.
diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index 652dfd7..fb8254b 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -3,7 +3,7 @@
By Bob Jenkins, March 2003. Public domain.
jenny.c -- jennyrate tests from m dimensions of features that cover all
- n-tuples of features, n <= m, with each feature chosen from a different
+ n-tuples of features, n <= m, with each feature chosen from a different
dimension. For example, given 10 dimensions (m=10) with 2 to 8 features
apiece, cover all feature triplets (n=3). A lower bound on the number
of tests required is the product of the sizes of the largest n dimensions.
@@ -11,7 +11,7 @@ jenny.c -- jennyrate tests from m dimensions of features that cover all
Arguments
Arguments without a leading '-' : an integer in 2..52. Represents a
- dimension. Dimensions are implicitly numbered 1..65535, in the
+ dimension. Dimensions are implicitly numbered 1..65535, in the
order they appear. Features in dimensions are always implicitly
given 1-character names, which are in order a..z, A..Z . It's a
good idea to pass the output of jenny through a postprocessor that
@@ -37,7 +37,7 @@ Arguments
number followed by a one-character feature name. A single -w can
disallow multiple features in a dimension. For example, -w1a2cd4ac
disallows the combinations (1a,2c,4a),(1a,2c,4c),(1a,2d,4a),(1a,2d,4c)
- where 1a represents the first dimension's first feature, 2c is the
+ where 1a represents the first dimension's first feature, 2c is the
second dimension's third feature, and 4a is the fourth dimension's
first feature.
@@ -227,14 +227,14 @@ wchain *wc) /* restrictions */
while (i<w->len) {
int dimension_match = FALSE; /* match in this dimension */
do {
- if (t->f[w->fe[i].d] == w->fe[i].f) {
- dimension_match = TRUE;
- }
- ++i;
+ if (t->f[w->fe[i].d] == w->fe[i].f) {
+ dimension_match = TRUE;
+ }
+ ++i;
} while (i<w->len && (w->fe[i].d == w->fe[i-1].d));
if (!dimension_match) {
- match = FALSE;
- break;
+ match = FALSE;
+ break;
}
}
if (match) {
@@ -326,10 +326,10 @@ cleanup(state *s)
ub2 d,f;
for (d=0; d<s->ndim; ++d) {
if (s->tu[d]) {
- for (f=0; f<s->dim[d]; ++f) {
- truncate_tuple(&s->tu[d][f], &s->tc[d][f]);
- }
- my_free((char *)s->tu[d]);
+ for (f=0; f<s->dim[d]; ++f) {
+ truncate_tuple(&s->tu[d][f], &s->tc[d][f]);
+ }
+ my_free((char *)s->tu[d]);
}
}
my_free((char *)s->tu);
@@ -340,7 +340,7 @@ cleanup(state *s)
ub2 d;
for (d=0; d<s->ndim; ++d) {
if (s->n[d]) {
- my_free((char *)s->n[d]);
+ my_free((char *)s->n[d]);
}
}
my_free((char *)s->n);
@@ -351,7 +351,7 @@ cleanup(state *s)
ub2 d;
for (d=0; d<s->ndim; ++d) {
if (s->tc[d]) {
- my_free((char *)s->tc[d]);
+ my_free((char *)s->tc[d]);
}
}
my_free((char *)s->tc);
@@ -362,9 +362,9 @@ cleanup(state *s)
ub2 i;
for (i=0; i<s->ndim; ++i) {
while (s->wc[i]) {
- wchain *wc = s->wc[i];
- s->wc[i] = s->wc[i]->next;
- my_free((char *)wc);
+ wchain *wc = s->wc[i];
+ s->wc[i] = s->wc[i]->next;
+ my_free((char *)wc);
}
}
my_free((char *)s->wc);
@@ -431,7 +431,7 @@ my_alloc( state *s, size_t len)
if (!(rsl = (char *)malloc(len+sizeof(size_t)))) {
printf("jenny: could not allocate space\n");
cleanup(s);
- exit(0);
+ exit(0);
}
memset(rsl, 0x00, len);
return rsl;
@@ -571,7 +571,7 @@ subset_tuple( feature *t1, ub1 n1, feature *t2, ub1 n2)
for (i=0, j=0; i<n1; ++i) {
while (t1[i].d > t2[j].d) {
if (++j == n2)
- return FALSE;
+ return FALSE;
}
if (t1[i].d != t2[j].d || t1[i].f != t2[j].f) {
return FALSE;
@@ -648,7 +648,7 @@ parse_token(char *inp, ub4 inl, ub4 *curr, ub4 *rsl)
for (i=*curr+1; i < inl; ++i) {
mychar = inp[i];
if (!(mychar == ' ' || mychar == '\t' || mychar == '\n'))
- break;
+ break;
}
*curr = i;
return TOKEN_SPACE;
@@ -662,16 +662,16 @@ parse_token(char *inp, ub4 inl, ub4 *curr, ub4 *rsl)
*rsl = number;
return TOKEN_NUMBER;
} else if ((mychar >= 'a' && mychar <= 'z') ||
- (mychar >= 'A' && mychar <= 'Z')) {
+ (mychar >= 'A' && mychar <= 'Z')) {
/*------------------------------------------------- parse a feature name */
ub4 i;
for (i=0; i<MAX_FEATURES; ++i)
if (feature_name[i] == mychar)
- break;
+ break;
if (i == MAX_FEATURES) {
printf("jenny: the name '%c' is not used for any feature\n",
- mychar);
- return TOKEN_ERROR;
+ mychar);
+ return TOKEN_ERROR;
}
*rsl = i;
++*curr;
@@ -688,7 +688,7 @@ load( state *s, char *testfile)
{
char buf[BUFSIZE]; /* buffer holding a line read from the file */
FILE *f;
-
+
if (testfile[0] == '\0') {
f = stdin;
} else {
@@ -715,25 +715,25 @@ load( state *s, char *testfile)
for (i=0; i<s->ndim; ++i) {
if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_SPACE) {
- printf("jenny: -o, non-space found where space expected\n");
- goto failure;
+ printf("jenny: -o, non-space found where space expected\n");
+ goto failure;
}
if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_NUMBER) {
- printf("jenny: -o, non-number found where number expected\n");
- goto failure;
+ printf("jenny: -o, non-number found where number expected\n");
+ goto failure;
}
if (value-1 != i) {
- printf("jenny: -o, number %lu found out-of-place\n", value);
- goto failure;
+ printf("jenny: -o, number %lu found out-of-place\n", value);
+ goto failure;
}
if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_FEATURE) {
- printf("jenny: -o, non-feature found where feature expected\n");
- goto failure;
+ printf("jenny: -o, non-feature found where feature expected\n");
+ goto failure;
}
if (value >= s->dim[i]) {
- printf("jenny: -o, feature %c does not exist in dimension %lu\n",
- feature_name[value], i+1);
- goto failure;
+ printf("jenny: -o, feature %c does not exist in dimension %lu\n",
+ feature_name[value], i+1);
+ goto failure;
}
t->f[i] = value;
}
@@ -809,14 +809,14 @@ parse_n( state *s, char *myarg)
printf("jenny: -n should be followed by just an integer\n");
return FALSE;
}
-
+
if ((temp < 1) || (temp > 32)) {
printf("jenny: -n says all n-tuples should be covered.\n");
return FALSE;
}
if (temp > s->ndim) {
printf("jenny: -n, %ld-tuples are impossible with only %d dimensions\n",
- temp, s->ndim);
+ temp, s->ndim);
return FALSE;
}
s->n_final = (ub2)temp;
@@ -839,7 +839,7 @@ parse_w( state *s, sb1 *myarg)
ub4 i, j, k;
size_t len = strlen(myarg);
token_type t = parse_token(myarg, len, &curr, &value);
-
+
for (i=0; i<s->ndim; ++i)
used[i] = FALSE;
if (t != TOKEN_NUMBER) {
@@ -848,7 +848,7 @@ parse_w( state *s, sb1 *myarg)
return FALSE;
}
fe_len=0;
-
+
number:
dimension_number = --value;
if (dimension_number >= s->ndim) {
@@ -858,12 +858,12 @@ parse_w( state *s, sb1 *myarg)
}
if (used[dimension_number]) {
printf("jenny: -w, dimension %lu was given twice in a single without\n",
- dimension_number+1);
+ dimension_number+1);
return FALSE;
}
used[dimension_number] = TRUE;
-
-
+
+
switch (parse_token(myarg, len, &curr, &value)) {
case TOKEN_FEATURE: goto feature;
case TOKEN_END:
@@ -874,22 +874,22 @@ parse_w( state *s, sb1 *myarg)
printf("jenny: proper withouts look like -w2a1bc99a\n");
return FALSE;
}
-
+
feature:
if (value >= s->dim[dimension_number]) {
printf("jenny: -w, there is no feature '%c' in dimension %lu\n",
- feature_name[value], dimension_number+1);
+ feature_name[value], dimension_number+1);
return FALSE;
}
fe[fe_len].d = dimension_number;
fe[fe_len].f = value;
if (++fe_len >= MAX_WITHOUT) {
printf("jenny: -w, at most %d features in a single without\n",
- MAX_WITHOUT);
+ MAX_WITHOUT);
return FALSE;
}
-
+
switch (parse_token(myarg, len, &curr, &value)) {
case TOKEN_FEATURE: goto feature;
case TOKEN_NUMBER: goto number;
@@ -899,21 +899,21 @@ parse_w( state *s, sb1 *myarg)
printf("jenny: proper withouts look like -w2a1bc99a\n");
return FALSE;
}
-
+
end:
/* sort the dimensions and features in this restriction */
for (i=0; i<fe_len; ++i) {
for (j=i+1; j<fe_len; ++j) {
if ((fe[i].d > fe[j].d) ||
- ((fe[i].d == fe[j].d) && (fe[i].f > fe[j].f))) {
- ub2 fe_temp;
- fe_temp = fe[i].d;
- fe[i].d = fe[j].d;
- fe[j].d = fe_temp;
- fe_temp = fe[i].f;
- fe[i].f = fe[j].f;
- fe[j].f = fe_temp;
+ ((fe[i].d == fe[j].d) && (fe[i].f > fe[j].f))) {
+ ub2 fe_temp;
+ fe_temp = fe[i].d;
+ fe[i].d = fe[j].d;
+ fe[j].d = fe_temp;
+ fe_temp = fe[i].f;
+ fe[i].f = fe[j].f;
+ fe[j].f = fe_temp;
}
}
}
@@ -1002,11 +1002,11 @@ preliminary( state *s)
int i;
for (i=0; i<w->len; ++i) {
if (w->fe[i].d != old) {
- wchain *wcx = (wchain *)my_alloc( s, sizeof(wchain));
- wcx->w = w;
- wcx->next = s->wc[w->fe[i].d];
- s->wc[w->fe[i].d] = wcx;
- old = w->fe[i].d;
+ wchain *wcx = (wchain *)my_alloc( s, sizeof(wchain));
+ wcx->w = w;
+ wcx->next = s->wc[w->fe[i].d];
+ s->wc[w->fe[i].d] = wcx;
+ old = w->fe[i].d;
}
}
}
@@ -1034,7 +1034,7 @@ parse( int argc, char *argv[], state *s)
}
if (temp > MAX_DIMENSIONS) {
printf("jenny: maximum number of dimensions is %d. %ld is too many.\n",
- MAX_DIMENSIONS, temp);
+ MAX_DIMENSIONS, temp);
return FALSE;
}
s->ndim = (ub2)temp;
@@ -1049,18 +1049,18 @@ parse( int argc, char *argv[], state *s)
(void)parse_token(myarg, UB4MAXVAL, &curr, &temp);
if (parse_token(myarg, UB4MAXVAL, &curr, &dummy) != TOKEN_END) {
- printf("jenny: something was trailing a dimension number\n");
- return FALSE;
+ printf("jenny: something was trailing a dimension number\n");
+ return FALSE;
}
if (temp > MAX_FEATURES) {
- printf("jenny: dimensions must be smaller than %d. %ld is too big.\n",
- MAX_FEATURES, temp);
- return FALSE;
+ printf("jenny: dimensions must be smaller than %d. %ld is too big.\n",
+ MAX_FEATURES, temp);
+ return FALSE;
}
if (temp < 2) {
- printf("jenny: a dimension must have at least 2 features, not %lu\n",
- temp);
- return FALSE;
+ printf("jenny: a dimension must have at least 2 features, not %lu\n",
+ temp);
+ return FALSE;
}
s->dim[j++] = (ub2)temp;
} else if (argv[i][1] == 'h') {
@@ -1092,14 +1092,14 @@ parse( int argc, char *argv[], state *s)
break;
default:
printf("jenny: legal arguments are numbers, -n, -s, -w, -h, not -%c\n",
- argv[i][1]);
+ argv[i][1]);
return FALSE;
}
} /* for (each argument) if '-' */
if (s->n_final > s->ndim) {
printf("jenny: %hhu-tuples are impossible with only %hu dimensions\n",
- s->n_final, s->ndim);
+ s->n_final, s->ndim);
return FALSE;
}
@@ -1153,8 +1153,8 @@ next_builder( state *s, feature *tuple, ub1 n)
sb4 i = n;
while (i-- &&
- tuple[i].d == s->ndim-n+i &&
- tuple[i].f == s->dim[tuple[i].d]-1)
+ tuple[i].d == s->ndim-n+i &&
+ tuple[i].f == s->dim[tuple[i].d]-1)
;
if (i == -1)
return FALSE;
@@ -1221,19 +1221,19 @@ build_tuples( state *s, ub2 d, ub2 f)
s->tuple_tester->f[tuple[i].d] = tuple[i].f;
}
if (count_withouts(s->tuple_tester, s->wc2) ||
- count_withouts(s->tuple_tester, s->wc3))
+ count_withouts(s->tuple_tester, s->wc3))
goto make_next_tuple;
/* is this tuple covered by the existing tests? */
for (j=0; j<s->ntests; ++j) {
test *t = s->t[j];
for (i=0; i<n; ++i) {
- if (t->f[tuple[i].d] != tuple[i].f) {
- break;
- }
+ if (t->f[tuple[i].d] != tuple[i].f) {
+ break;
+ }
}
if (i == n) {
- goto make_next_tuple;
+ goto make_next_tuple;
}
}
@@ -1301,7 +1301,7 @@ ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
ub4 j;
ub2 best[MAX_FEATURES]; /* best features so far */
ub1 ok = TRUE;
-
+
for (j=ndim; j>0; --j) {
ub2 fcount = 0; /* count of filled elements of best */
ub2 mydim; /* the current dimension */
@@ -1319,31 +1319,31 @@ ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
/* test every feature of this dimension, trying to make progress */
for (k=0; k<s->dim[mydim]; ++k) {
- ub2 newcount;
- t->f[mydim] = k;
- newcount = count_withouts(t, s->wc[mydim]);
- if (newcount <= count) {
- if (newcount < count) {
- i = 0; /* partial progress! */
- fcount = 0;
- count = newcount;
- }
- best[fcount++] = k;
- }
+ ub2 newcount;
+ t->f[mydim] = k;
+ newcount = count_withouts(t, s->wc[mydim]);
+ if (newcount <= count) {
+ if (newcount < count) {
+ i = 0; /* partial progress! */
+ fcount = 0;
+ count = newcount;
+ }
+ best[fcount++] = k;
+ }
}
/* choose one of the best features for this dimension at random */
if (fcount == 0) {
- printf("jenny: internal error a\n");
+ printf("jenny: internal error a\n");
} else if (fcount == 1) {
- t->f[mydim] = best[0];
+ t->f[mydim] = best[0];
} else {
- temp = (flearand(&s->r) % fcount);
- t->f[mydim] = best[temp];
+ temp = (flearand(&s->r) % fcount);
+ t->f[mydim] = best[temp];
}
if (count > 0)
- ok = FALSE;
+ ok = FALSE;
}
if (ok) { /* no withouts disobeyed */
return TRUE;
@@ -1367,7 +1367,7 @@ count_tuples( state *s, test *t, int d, int f)
}
static ub4
-maximize_coverage(
+maximize_coverage(
state *s, /* global state */
test *t, /* testcase being built, already obeys all restrictions */
ub1 *mut, /* mut[i] = 1 if I can adjust dimension i */
@@ -1409,41 +1409,41 @@ ub1 n) /* size of smallest tuple left to cover */
/* for every feature in mydim, see if using it would improve coverage */
for (f=0; f<s->dim[d]; ++f) {
- t->f[d] = f; /* switch to the new feature */
- if (!count_withouts(t, s->wc[d])) { /* need to obey withouts */
- ub4 new_coverage = count_tuples(s, t, d, f);
- if (s->n[d][f] < best_n) {
- best_n = s->n[d][f];
- progress = TRUE;
- coverage = new_coverage;
- count = 0;
- best[count++] = f;
- } else if (s->n[d][f] == best_n && new_coverage >= coverage) {
- if (new_coverage > coverage) {
- progress = TRUE;
- coverage = new_coverage;
- count = 0;
- }
- best[count++] = f;
- }
- }
+ t->f[d] = f; /* switch to the new feature */
+ if (!count_withouts(t, s->wc[d])) { /* need to obey withouts */
+ ub4 new_coverage = count_tuples(s, t, d, f);
+ if (s->n[d][f] < best_n) {
+ best_n = s->n[d][f];
+ progress = TRUE;
+ coverage = new_coverage;
+ count = 0;
+ best[count++] = f;
+ } else if (s->n[d][f] == best_n && new_coverage >= coverage) {
+ if (new_coverage > coverage) {
+ progress = TRUE;
+ coverage = new_coverage;
+ count = 0;
+ }
+ best[count++] = f;
+ }
+ }
}
- /*
+ /*
* Change this dimension to the best features seen.
* Worst case, everyone was worse than the old value, so best[0] will
* be the old value. Coverage will be the same and still no withouts
* will be hit.
*/
if (count == 0) {
- printf("jenny: internal error b\n");
+ printf("jenny: internal error b\n");
} else if (count == 1) {
- t->f[d] = best[0];
+ t->f[d] = best[0];
} else {
- t->f[d] = best[flearand(&s->r) % count];
+ t->f[d] = best[flearand(&s->r) % count];
}
if (s->n[d][t->f[d]] == n)
- total += coverage;
+ total += coverage;
}
} while (progress);
@@ -1452,7 +1452,7 @@ ub1 n) /* size of smallest tuple left to cover */
/*
- * Generate one test that obeys all the restrictions and covers at
+ * Generate one test that obeys all the restrictions and covers at
* least one tuple. Do not add it to the list of tests yet. Return FALSE
* if we couldn't satisfy the withouts while covering this tuple.
*/
@@ -1467,13 +1467,13 @@ generate_test( state *s, test *t, feature *tuple, ub1 n)
/* mut[i] = 1 if I can modify dimension i */
for (i=0; i<s->ndim; ++i) mut[i] = 1;
for (i=0; i<n; ++i) mut[tuple[i].d] = 0;
-
+
for (iter=0; iter<MAX_ITERS; ++iter) {
/* Produce a totally random testcase */
for (i=0; i<s->ndim; ++i) {
t->f[i] = flearand(&s->r) % (s->dim[i]);
}
-
+
/* Plug in the chosen new tuple */
for (i=0; i<n; ++i){
t->f[tuple[i].d] = tuple[i].f;
@@ -1482,7 +1482,7 @@ generate_test( state *s, test *t, feature *tuple, ub1 n)
/* If we can get all the withouts obeyed, break, success */
if (!s->wc2 || obey_withouts(s, t, mut)) {
if (count_withouts(t, s->wc2)) {
- printf("internal error without %p\n", s->wc2);
+ printf("internal error without %p\n", s->wc2);
}
break;
}
@@ -1526,27 +1526,27 @@ cover_tuples( state *s)
for (d=0; d<s->ndim; ++d) {
ub2 f;
for (f=0; f<s->dim[d]; ++f) {
- build_tuples(s, d, f);
- if (s->n[d][f] < tuple_n) {
- tuple_n = s->n[d][f];
- tuple_count = s->tc[d][f];
- tuple = s->tu[d][f]->fe;
- tuple_f = f;
- tuple_d = d;
- } else if (s->n[d][f] == tuple_n && s->tc[d][f] > tuple_count) {
- tuple_count = s->tc[d][f];
- tuple = s->tu[d][f]->fe;
- tuple_f = f;
- tuple_d = d;
- }
+ build_tuples(s, d, f);
+ if (s->n[d][f] < tuple_n) {
+ tuple_n = s->n[d][f];
+ tuple_count = s->tc[d][f];
+ tuple = s->tu[d][f]->fe;
+ tuple_f = f;
+ tuple_d = d;
+ } else if (s->n[d][f] == tuple_n && s->tc[d][f] > tuple_count) {
+ tuple_count = s->tc[d][f];
+ tuple = s->tu[d][f]->fe;
+ tuple_f = f;
+ tuple_d = d;
+ }
}
}
if (tuple_count == 0) {
if (tuple_n == s->n_final)
- break; /* no more tuples to cover, done! */
+ break; /* no more tuples to cover, done! */
else
- continue;
+ continue;
}
@@ -1560,17 +1560,17 @@ cover_tuples( state *s)
/* generate a test that covers the first tuple */
if (!(this_count = generate_test(s, curr_test, tuple, tuple_n))) {
- continue;
+ continue;
}
covered = TRUE;
/* see how many tuples are covered altogether */
if (this_count > best_count) {
- test *temp = best_test;
- best_test = curr_test;
- curr_test = temp;
+ test *temp = best_test;
+ best_test = curr_test;
+ curr_test = temp;
- best_count = this_count;
+ best_count = this_count;
}
}
@@ -1581,8 +1581,8 @@ cover_tuples( state *s)
/* make a copy of tuple, because we'll be deleting it */
for (i=0; i<tuple_n; ++i) {
- extra[i].d = tuple[i].d;
- extra[i].f = tuple[i].f;
+ extra[i].d = tuple[i].d;
+ extra[i].f = tuple[i].f;
}
printf("Could not cover tuple ");
@@ -1596,56 +1596,56 @@ cover_tuples( state *s)
w->len = tuple_n;
w->fe = (feature *)my_alloc( s, sizeof(feature)*tuple_n);
for (i=0; i<tuple_n; ++i) {
- w->fe[i].d = extra[i].d;
- w->fe[i].f = extra[i].f;
+ w->fe[i].d = extra[i].d;
+ w->fe[i].f = extra[i].f;
}
-
+
for (d=0; d<s->ndim; ++d) {
- ub2 f;
- tu_iter ctx;
- for (f=0; f<s->dim[d]; ++f) {
- ub1 n = s->n[d][f];
- feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
-
- /* remove all the tuples covered by it */
- while (this) {
- if (subset_tuple(extra, tuple_n, this, n)) {
- this = delete_tuple(&ctx);
- } else {
- this = next_tuple(&ctx);
- }
- }
- }
+ ub2 f;
+ tu_iter ctx;
+ for (f=0; f<s->dim[d]; ++f) {
+ ub1 n = s->n[d][f];
+ feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
+
+ /* remove all the tuples covered by it */
+ while (this) {
+ if (subset_tuple(extra, tuple_n, this, n)) {
+ this = delete_tuple(&ctx);
+ } else {
+ this = next_tuple(&ctx);
+ }
+ }
+ }
}
my_free((char *)best_test->f);
my_free((char *)best_test);
} else {
ub2 d;
for (d=0; d<s->ndim; ++d) {
- tu_iter ctx;
- ub2 f = best_test->f[d];
- ub1 n = s->n[d][f];
- feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
-
- /* remove all the tuples covered by it */
- while (this) {
- if (test_tuple(best_test->f, this, n)) {
- this = delete_tuple(&ctx);
- } else {
- this = next_tuple(&ctx);
- }
- }
+ tu_iter ctx;
+ ub2 f = best_test->f[d];
+ ub1 n = s->n[d][f];
+ feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
+
+ /* remove all the tuples covered by it */
+ while (this) {
+ if (test_tuple(best_test->f, this, n)) {
+ this = delete_tuple(&ctx);
+ } else {
+ this = next_tuple(&ctx);
+ }
+ }
}
/* add it to the list of tests */
if (!add_test(s, best_test)) {
- printf("jenny: exceeded maximum number of tests\n");
- my_free((char *)curr_test->f);
- my_free((char *)curr_test);
- my_free((char *)best_test->f);
- my_free((char *)best_test);
- cleanup(s);
- exit(0);
+ printf("jenny: exceeded maximum number of tests\n");
+ my_free((char *)curr_test->f);
+ my_free((char *)curr_test);
+ my_free((char *)best_test->f);
+ my_free((char *)best_test);
+ cleanup(s);
+ exit(0);
}
}
}
@@ -1655,7 +1655,7 @@ cover_tuples( state *s)
}
static void
-prepare_reduce( state *s)
+prepare_reduce( state *s)
{
feature tuple[MAX_N];
ub1 n = s->n_final;
@@ -1678,16 +1678,16 @@ prepare_reduce( state *s)
s->tuple_tester->f[tuple[i].d] = tuple[i].f;
}
if (count_withouts(s->tuple_tester, s->wc2) ||
- count_withouts(s->tuple_tester, s->wc3))
+ count_withouts(s->tuple_tester, s->wc3))
goto make_next_tuple;
for (i=0; i<s->ntests; ++i) {
ub1 j;
for (j=0; j<n; ++j)
- if (s->t[i]->f[tuple[j].d] != tuple[j].f)
- break;
+ if (s->t[i]->f[tuple[j].d] != tuple[j].f)
+ break;
if (j == n)
- break; /* this test contains this tuple */
+ break; /* this test contains this tuple */
}
/* no tests cover this tuple */
@@ -1696,21 +1696,21 @@ prepare_reduce( state *s)
} else {
thistest = i;
for (++i; i<s->ntests; ++i) {
- ub1 j;
- for (j=0; j<n; ++j)
- if (s->t[i]->f[tuple[j].d] != tuple[j].f)
- break;
- if (j == n)
- break; /* this test contains this tuple */
+ ub1 j;
+ for (j=0; j<n; ++j)
+ if (s->t[i]->f[tuple[j].d] != tuple[j].f)
+ break;
+ if (j == n)
+ break; /* this test contains this tuple */
}
if (i == s->ntests) {
- ub1 j;
- for (j=0; j<n; ++j) {
- tu_iter ctx;
- (void)start_tuple(&ctx, &s->one[thistest][tuple[j].d], n,
- &s->onec[thistest][tuple[j].d]);
- (void)insert_tuple(s, &ctx, tuple);
- }
+ ub1 j;
+ for (j=0; j<n; ++j) {
+ tu_iter ctx;
+ (void)start_tuple(&ctx, &s->one[thistest][tuple[j].d], n,
+ &s->onec[thistest][tuple[j].d]);
+ (void)insert_tuple(s, &ctx, tuple);
+ }
}
}
@@ -1744,7 +1744,7 @@ which_test( state *s)
}
static void
-reduce_tests( state *s)
+reduce_tests( state *s)
{
ub4 t;
prepare_reduce( s);
@@ -1769,19 +1769,19 @@ confirm( state *s)
s->tuple_tester->f[offset[i].d] = offset[i].f;
}
if (count_withouts(s->tuple_tester, s->wc2) ||
- count_withouts(s->tuple_tester, s->wc3))
+ count_withouts(s->tuple_tester, s->wc3))
goto make_next_tuple;
/* is this tuple covered by the existing tests? */
for (j=0; j<s->ntests; ++j) {
test *t = s->t[j];
for (i=0; i<n; ++i) {
- if (t->f[offset[i].d] != offset[i].f) {
- break;
- }
+ if (t->f[offset[i].d] != offset[i].f) {
+ break;
+ }
}
if (i == n) {
- goto make_next_tuple;
+ goto make_next_tuple;
}
}
@@ -1794,24 +1794,24 @@ confirm( state *s)
}
i=n;
while (i-- &&
- offset[i].d == s->ndim-n+i &&
- offset[i].f == s->dim[offset[i].d]-1)
+ offset[i].d == s->ndim-n+i &&
+ offset[i].f == s->dim[offset[i].d]-1)
;
if (i == -1)
break; /* done */
else if (offset[i].f < s->dim[offset[i].d]-1) {
++offset[i].f; /* increment feature */
for (i; i<n-1; ++i) { /* reset all less significant positions */
- offset[i+1].d = offset[i].d+1;
- offset[i+1].f = 0;
+ offset[i+1].d = offset[i].d+1;
+ offset[i+1].f = 0;
}
}
else {
++offset[i].d; /* increment least significant non-maxed-out position */
offset[i].f = (ub2)0; /* reset its feature */
for (i; i<n-1; ++i) { /* reset all less significant positions */
- offset[i+1].d = offset[i].d+1;
- offset[i+1].f = 0;
+ offset[i+1].d = offset[i].d+1;
+ offset[i+1].f = 0;
}
}
}
commit 40680369f6899a41f283594e0b0c0d4c7bc9194f
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 12:47:54 2018 -0700
Fix up jenny so that it complies with std=C11.
diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index 721b021..652dfd7 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -105,7 +105,8 @@ typedef struct flearandctx {
} flearandctx;
/* Pseudorandom numbers, courtesy of FLEA */
-void flearand_batch( flearandctx *x) {
+static void
+flearand_batch( flearandctx *x) {
ub4 a, b=x->b, c=x->c+(++x->z), d=x->d, i, *m=x->m, *r=x->r;
for (i=0; i<FLEARAND_SIZE; ++i) {
a = m[b % FLEARAND_SIZE];
@@ -118,7 +119,8 @@ void flearand_batch( flearandctx *x) {
x->b=b; x->c=c; x->d=d;
}
-ub4 flearand( flearandctx *x) {
+static ub4
+flearand( flearandctx *x) {
if (!x->q--) {
x->q = FLEARAND_SIZE-1;
flearand_batch(x);
@@ -126,7 +128,8 @@ ub4 flearand( flearandctx *x) {
return x->r[x->q];
}
-void flearand_init( flearandctx *x, ub4 seed) {
+static void
+flearand_init( flearandctx *x, ub4 seed) {
ub4 i;
x->b = x->c = x->d = x->z = seed;
@@ -210,7 +213,8 @@ typedef struct wchain {
/* Return a count of how many withouts are disobeyed. */
/* Also set a pointer to a randomly chosen violated without */
-int count_withouts(
+static int
+count_withouts(
test *t, /* test to check */
wchain *wc) /* restrictions */
{
@@ -276,13 +280,15 @@ typedef struct state {
} state;
-void my_free( char *x)
+static void
+my_free( char *x)
{
free(x);
}
/* zero out a list of tuples */
-void truncate_tuple( tu_arr **tu, ub4 *count)
+static void
+truncate_tuple( tu_arr **tu, ub4 *count)
{
while (*tu) {
tu_arr *tu2 = *tu;
@@ -293,7 +299,8 @@ void truncate_tuple( tu_arr **tu, ub4 *count)
}
/* delete the i-th test */
-void delete_test( state *s, ub4 i)
+static void
+delete_test( state *s, ub4 i)
{
test *t = s->t[i];
@@ -312,7 +319,8 @@ void delete_test( state *s, ub4 i)
}
}
-void cleanup(state *s)
+static void
+cleanup(state *s)
{
if (s->tu) {
ub2 d,f;
@@ -416,7 +424,8 @@ void cleanup(state *s)
}
-char *my_alloc( state *s, size_t len)
+static char*
+my_alloc( state *s, size_t len)
{
char *rsl;
if (!(rsl = (char *)malloc(len+sizeof(size_t)))) {
@@ -429,7 +438,8 @@ char *my_alloc( state *s, size_t len)
}
/* insert a tuple into a tuple array */
-int insert_tuple( state *s, tu_iter *ctx, feature *tuple)
+static int
+insert_tuple( state *s, tu_iter *ctx, feature *tuple)
{
ub4 i;
feature *fe;
@@ -457,7 +467,8 @@ int insert_tuple( state *s, tu_iter *ctx, feature *tuple)
}
/* print out a single tuple */
-void show_tuple( feature *fe, ub2 len)
+static void
+show_tuple( feature *fe, ub2 len)
{
ub4 i;
for (i=0; i<len; ++i) {
@@ -467,7 +478,8 @@ void show_tuple( feature *fe, ub2 len)
}
/* delete a tuple from a tuple array */
-feature *delete_tuple( tu_iter *ctx)
+static feature*
+delete_tuple( tu_iter *ctx)
{
feature *fe;
ub4 i;
@@ -501,7 +513,8 @@ feature *delete_tuple( tu_iter *ctx)
}
/* start a tuple iterator */
-feature *start_tuple( tu_iter *ctx, tu_arr **tu, ub4 n, ub4 *count)
+static feature*
+start_tuple( tu_iter *ctx, tu_arr **tu, ub4 n, ub4 *count)
{
ctx->tu = tu;
ctx->offset = 0;
@@ -517,7 +530,8 @@ feature *start_tuple( tu_iter *ctx, tu_arr **tu, ub4 n, ub4 *count)
}
/* get the next tuple from a tuple iterator (0 if no more tuples) */
-static feature *next_tuple( tu_iter *ctx)
+static feature*
+next_tuple( tu_iter *ctx)
{
if (++ctx->offset < (*ctx->tu)->len) {
ctx->fe += ctx->n;
@@ -535,7 +549,8 @@ static feature *next_tuple( tu_iter *ctx)
/* test if this test covers this tuple */
-static int test_tuple( ub2 *test, feature *tuple, ub2 n)
+static int
+test_tuple( ub2 *test, feature *tuple, ub2 n)
{
sb4 i;
for (i=0; i<n; ++i) {
@@ -547,7 +562,8 @@ static int test_tuple( ub2 *test, feature *tuple, ub2 n)
}
/* test if first tuple (t1, n1) is a subset of second tuple (t2, n2) */
-int subset_tuple( feature *t1, ub1 n1, feature *t2, ub1 n2)
+static int
+subset_tuple( feature *t1, ub1 n1, feature *t2, ub1 n2)
{
sb4 i, j;
if (n2 < n1)
@@ -564,7 +580,8 @@ int subset_tuple( feature *t1, ub1 n1, feature *t2, ub1 n2)
return TRUE;
}
-void initialize( state *s)
+static void
+initialize( state *s)
{
/* make all freeable pointers start out zero */
s->dim = (ub2 *)0;
@@ -590,7 +607,8 @@ void initialize( state *s)
/* add one test to the list of tests */
-int add_test( state *s, test *t)
+static int
+add_test( state *s, test *t)
{
ub4 i;
if (s->ntests == MAX_TESTS) {
@@ -613,7 +631,8 @@ int add_test( state *s, test *t)
* Place the token value in *rsl
* Return the token type
*/
-token_type parse_token(char *inp, ub4 inl, ub4 *curr, ub4 *rsl)
+static token_type
+parse_token(char *inp, ub4 inl, ub4 *curr, ub4 *rsl)
{
char mychar;
ub4 i;
@@ -664,7 +683,8 @@ token_type parse_token(char *inp, ub4 inl, ub4 *curr, ub4 *rsl)
#define BUFSIZE (MAX_DIMENSIONS*7+2)
/* load old tests before generating new ones */
-int load( state *s, char *testfile)
+static int
+load( state *s, char *testfile)
{
char buf[BUFSIZE]; /* buffer holding a line read from the file */
FILE *f;
@@ -703,7 +723,7 @@ int load( state *s, char *testfile)
goto failure;
}
if (value-1 != i) {
- printf("jenny: -o, number %d found out-of-place\n", value);
+ printf("jenny: -o, number %lu found out-of-place\n", value);
goto failure;
}
if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_FEATURE) {
@@ -711,7 +731,7 @@ int load( state *s, char *testfile)
goto failure;
}
if (value >= s->dim[i]) {
- printf("jenny: -o, feature %c does not exist in dimension %d\n",
+ printf("jenny: -o, feature %c does not exist in dimension %lu\n",
feature_name[value], i+1);
goto failure;
}
@@ -773,7 +793,8 @@ static const sb1 *jenny_doc[] = {
/* parse -n, the tuple size */
-int parse_n( state *s, char *myarg)
+static int
+parse_n( state *s, char *myarg)
{
ub4 curr = 0;
ub4 temp = UB4MAXVAL;
@@ -805,7 +826,8 @@ int parse_n( state *s, char *myarg)
/* parse -w, a without */
-int parse_w( state *s, sb1 *myarg)
+static int
+parse_w( state *s, sb1 *myarg)
{
without *w;
wchain *wc;
@@ -835,7 +857,7 @@ int parse_w( state *s, sb1 *myarg)
return FALSE;
}
if (used[dimension_number]) {
- printf("jenny: -w, dimension %d was given twice in a single without\n",
+ printf("jenny: -w, dimension %lu was given twice in a single without\n",
dimension_number+1);
return FALSE;
}
@@ -855,7 +877,7 @@ int parse_w( state *s, sb1 *myarg)
feature:
if (value >= s->dim[dimension_number]) {
- printf("jenny: -w, there is no feature '%c' in dimension %d\n",
+ printf("jenny: -w, there is no feature '%c' in dimension %lu\n",
feature_name[value], dimension_number+1);
return FALSE;
}
@@ -913,7 +935,8 @@ int parse_w( state *s, sb1 *myarg)
}
/* parse -s, a seed for the random number generator */
-int parse_s( state *s, sb1 *myarg)
+static int
+parse_s( state *s, sb1 *myarg)
{
ub4 seed = 0;
ub4 dummy = 0;
@@ -930,7 +953,8 @@ int parse_s( state *s, sb1 *myarg)
return TRUE;
}
-void preliminary( state *s)
+static void
+preliminary( state *s)
{
wchain *wc;
ub4 d;
@@ -989,7 +1013,8 @@ void preliminary( state *s)
}
/* parse the inputs */
-int parse( int argc, char *argv[], state *s)
+static int
+parse( int argc, char *argv[], state *s)
{
int i, j;
ub4 temp;
@@ -997,7 +1022,7 @@ int parse( int argc, char *argv[], state *s)
/* internal check: we have MAX_FEATURES names for features */
if (strlen(feature_name) != MAX_FEATURES) {
- printf("feature_name length is wrong, %d\n", strlen(feature_name));
+ printf("feature_name length is wrong, %lu\n", strlen(feature_name));
return FALSE;
}
@@ -1008,7 +1033,7 @@ int parse( int argc, char *argv[], state *s)
}
}
if (temp > MAX_DIMENSIONS) {
- printf("jenny: maximum number of dimensions is %ld. %ld is too many.\n",
+ printf("jenny: maximum number of dimensions is %d. %ld is too many.\n",
MAX_DIMENSIONS, temp);
return FALSE;
}
@@ -1033,7 +1058,7 @@ int parse( int argc, char *argv[], state *s)
return FALSE;
}
if (temp < 2) {
- printf("jenny: a dimension must have at least 2 features, not %d\n",
+ printf("jenny: a dimension must have at least 2 features, not %lu\n",
temp);
return FALSE;
}
@@ -1041,7 +1066,7 @@ int parse( int argc, char *argv[], state *s)
} else if (argv[i][1] == 'h') {
int i;
for (i=0; i<(sizeof(jenny_doc)/sizeof(ub1 *)); ++i) {
- printf(jenny_doc[i]);
+ printf("%s", jenny_doc[i]);
}
return FALSE;
}
@@ -1073,7 +1098,7 @@ int parse( int argc, char *argv[], state *s)
} /* for (each argument) if '-' */
if (s->n_final > s->ndim) {
- printf("jenny: %ld-tuples are impossible with only %d dimensions\n",
+ printf("jenny: %hhu-tuples are impossible with only %hu dimensions\n",
s->n_final, s->ndim);
return FALSE;
}
@@ -1091,17 +1116,19 @@ int parse( int argc, char *argv[], state *s)
}
/* print out a single test */
-void report( test *t, ub2 len)
+static void
+report( test *t, ub2 len)
{
ub4 i;
for (i=0; i<len; ++i) {
- printf(" %d%c", i+1, feature_name[t->f[i]]);
+ printf(" %lu%c", i+1, feature_name[t->f[i]]);
}
printf(" \n");
}
/* print out all the tests */
-void report_all( state *s)
+static void
+report_all( state *s)
{
ub4 i;
for (i=0; i<s->ntests; ++i) {
@@ -1110,7 +1137,8 @@ void report_all( state *s)
}
-void start_builder( state *s, feature *tuple, ub1 n)
+static void
+start_builder( state *s, feature *tuple, ub1 n)
{
ub1 i;
for (i=0; i<n; ++i) {
@@ -1119,7 +1147,8 @@ void start_builder( state *s, feature *tuple, ub1 n)
}
}
-int next_builder( state *s, feature *tuple, ub1 n)
+static int
+next_builder( state *s, feature *tuple, ub1 n)
{
sb4 i = n;
@@ -1148,7 +1177,8 @@ int next_builder( state *s, feature *tuple, ub1 n)
}
-void build_tuples( state *s, ub2 d, ub2 f)
+static void
+build_tuples( state *s, ub2 d, ub2 f)
{
feature offset[MAX_N]; /* n-1-tuples */
feature tuple[MAX_N]; /* n-tuples that include (d,f) */
@@ -1243,7 +1273,8 @@ void build_tuples( state *s, ub2 d, ub2 f)
* in any disobeyed without.
*/
#define MAX_NO_PROGRESS 2
-int obey_withouts(
+static int
+obey_withouts(
state *s, /* global state */
test *t, /* test being built */
ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
@@ -1321,7 +1352,8 @@ ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
return FALSE; /* failure, could not satisfy all the withouts */
}
-ub4 count_tuples( state *s, test *t, int d, int f)
+static ub4
+count_tuples( state *s, test *t, int d, int f)
{
ub4 count = 0;
ub1 n = s->n[d][f];
@@ -1334,7 +1366,8 @@ ub4 count_tuples( state *s, test *t, int d, int f)
return count;
}
-ub4 maximize_coverage(
+static ub4
+maximize_coverage(
state *s, /* global state */
test *t, /* testcase being built, already obeys all restrictions */
ub1 *mut, /* mut[i] = 1 if I can adjust dimension i */
@@ -1424,7 +1457,8 @@ ub1 n) /* size of smallest tuple left to cover */
* if we couldn't satisfy the withouts while covering this tuple.
*/
#define MAX_ITERS 10
-ub4 generate_test( state *s, test *t, feature *tuple, ub1 n)
+static ub4
+generate_test( state *s, test *t, feature *tuple, ub1 n)
{
int iter, i;
ub1 mut[MAX_DIMENSIONS]; /* mut[i] = 1 if I can adjust dimension i */
@@ -1448,7 +1482,7 @@ ub4 generate_test( state *s, test *t, feature *tuple, ub1 n)
/* If we can get all the withouts obeyed, break, success */
if (!s->wc2 || obey_withouts(s, t, mut)) {
if (count_withouts(t, s->wc2)) {
- printf("internal error without %d\n", s->wc2);
+ printf("internal error without %p\n", s->wc2);
}
break;
}
@@ -1470,7 +1504,8 @@ ub4 generate_test( state *s, test *t, feature *tuple, ub1 n)
}
#define GROUP_SIZE 5
-void cover_tuples( state *s)
+static void
+cover_tuples( state *s)
{
test *curr_test;
curr_test = (test *)my_alloc( s, sizeof(test));
@@ -1619,7 +1654,8 @@ void cover_tuples( state *s)
my_free((char *)curr_test);
}
-void prepare_reduce( state *s)
+static void
+prepare_reduce( state *s)
{
feature tuple[MAX_N];
ub1 n = s->n_final;
@@ -1688,7 +1724,8 @@ void prepare_reduce( state *s)
}
/* find a test to try to eliminate */
-int which_test( state *s)
+static int
+which_test( state *s)
{
ub4 t;
ub4 mincount = ~0;
@@ -1706,7 +1743,8 @@ int which_test( state *s)
return mint;
}
-void reduce_tests( state *s)
+static void
+reduce_tests( state *s)
{
ub4 t;
prepare_reduce( s);
@@ -1714,7 +1752,8 @@ void reduce_tests( state *s)
}
/* Confirm that every tuple is covered by either a testcase or a without */
-int confirm( state *s)
+static int
+confirm( state *s)
{
feature offset[MAX_N];
sb4 i, j, n = s->n_final;
@@ -1781,7 +1820,8 @@ int confirm( state *s)
}
-void driver( int argc, char *argv[])
+static void
+driver( int argc, char *argv[])
{
state s; /* internal state */
@@ -1798,9 +1838,9 @@ void driver( int argc, char *argv[])
cleanup(&s); /* deallocate everything */
}
-int main( int argc, char *argv[])
+int
+main( int argc, char *argv[])
{
driver(argc, argv);
return 0;
}
-
commit 827c43d935b3bf88cfa7d52ea58a3d389299c05d
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 12:47:25 2018 -0700
Add jenny to the dist and compile it.
diff --git a/borrowed/CMakeLists.txt b/borrowed/CMakeLists.txt
index 421d1fe..b849ca5 100644
--- a/borrowed/CMakeLists.txt
+++ b/borrowed/CMakeLists.txt
@@ -5,5 +5,5 @@ if (WITH_GNUCASH)
add_subdirectory(gwengui-gtk3)
endif (WITH_GNUCASH)
-set_local_dist(borrowed_DIST_local CMakeLists.txt README)
+set_local_dist(borrowed_DIST_local jenny/jenny.c CMakeLists.txt README)
set(borrowed_DIST ${borrowed_DIST_local} ${libc_DIST} ${guile-json_DIST} ${goffice_DIST} ${gwengui_gtk3_DIST} PARENT_SCOPE)
diff --git a/common/test-core/CMakeLists.txt b/common/test-core/CMakeLists.txt
index b57ab5c..9a757ad 100644
--- a/common/test-core/CMakeLists.txt
+++ b/common/test-core/CMakeLists.txt
@@ -90,3 +90,5 @@ if(NOT GMOCK_SHARED_LIB)
${GTEST_INCLUDE_DIR} ${GTEST_SRC_DIR}
${GMOCK_INCLUDE_DIR} ${GMOCK_SRC_DIR})
endif()
+
+add_executable(jenny ${CMAKE_SOURCE_DIR}/borrowed/jenny/jenny.c)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 3e5dfbf..80cf8c0 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -33,6 +33,7 @@ borrowed/gwengui-gtk3/w_textedit.c
borrowed/gwengui-gtk3/w_vlayout.c
borrowed/gwengui-gtk3/w_vline.c
borrowed/gwengui-gtk3/w_vspacer.c
+borrowed/jenny/jenny.c
borrowed/libc/libc-missing-noop.c
borrowed/libc/setenv.c
borrowed/libc/strfmon.c
commit 6d605762ddcc99c93b58450634495d9c178498db
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 12:00:54 2018 -0700
Delete the last vestiges of timepair.
diff --git a/libgnucash/engine/engine-helpers-guile.h b/libgnucash/engine/engine-helpers-guile.h
index ad97e9c..41fda9a 100644
--- a/libgnucash/engine/engine-helpers-guile.h
+++ b/libgnucash/engine/engine-helpers-guile.h
@@ -32,10 +32,7 @@
/* Helpers for various conversions to and from guile */
-SCM gnc_timespec2timepair(Timespec t);
-Timespec gnc_timepair2timespec(SCM x);
GDate gnc_time64_to_GDate(SCM x);
-int gnc_timepair_p(SCM x);
SCM gnc_guid2scm(GncGUID guid);
GncGUID gnc_scm2guid(SCM guid_scm);
diff --git a/libgnucash/engine/engine-helpers.c b/libgnucash/engine/engine-helpers.c
index f646113..f589346 100644
--- a/libgnucash/engine/engine-helpers.c
+++ b/libgnucash/engine/engine-helpers.c
@@ -284,28 +284,6 @@ gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data)
}
}
-SCM
-gnc_timespec2timepair(Timespec t)
-{
- SCM secs;
- SCM nsecs;
-
- secs = scm_from_int64(t.tv_sec);
- nsecs = scm_from_long (t.tv_nsec);
- return(scm_cons(secs, nsecs));
-}
-
-Timespec
-gnc_timepair2timespec(SCM x)
-{
- Timespec result = {0, 0};
- if (gnc_timepair_p (x))
- {
- result.tv_sec = scm_to_int64(SCM_CAR(x));
- result.tv_nsec = scm_to_long(SCM_CDR(x));
- }
- return(result);
-}
GDate gnc_time64_to_GDate(SCM x)
{
@@ -313,14 +291,6 @@ GDate gnc_time64_to_GDate(SCM x)
return time64_to_gdate(time);
}
-int
-gnc_timepair_p(SCM x)
-{
- return(scm_is_pair(x) &&
- (scm_is_signed_integer(SCM_CAR(x), INT64_MIN, INT64_MAX) &&
- scm_is_signed_integer(SCM_CDR(x), INT64_MIN, INT64_MAX)));
-}
-
SCM
gnc_guid2scm(GncGUID guid)
{
@@ -390,8 +360,6 @@ gnc_guid_p(SCM guid_scm)
* Each OR term is a list of AND terms.
* Each AND term is a list of one of the following forms:
*
- * ('pd-date pr-type sense-bool use-start-bool start-timepair
- * use-end-bool use-end-timepair)
* ('pd-amount pr-type sense-bool amt-match-how amt-match-sign amount)
* ('pd-account pr-type sense-bool acct-match-how list-of-account-guids)
* ('pd-string pr-type sense-bool case-sense-bool use-regexp-bool string)
diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h
index f940817..2b34ae3 100644
--- a/libgnucash/engine/gnc-date.h
+++ b/libgnucash/engine/gnc-date.h
@@ -329,8 +329,8 @@ Timespec timespec_diff(const Timespec *ta, const Timespec *tb);
/** absolute value, also normalized */
Timespec timespec_abs(const Timespec *t);
-/** convert a timepair on a certain day (localtime) to
- * the timepair representing midday on that day. Watch out - this is *not* the
+/** convert a timespec on a certain day (localtime) to
+ * the timespec representing midday on that day. Watch out - this is *not* the
* first second of the day, which is returned by various other functions
* returning a Timespec. */
Timespec timespecCanonicalDayTime(Timespec t);
diff --git a/libgnucash/engine/kvp-scm.cpp b/libgnucash/engine/kvp-scm.cpp
index 07a7859..ba7e785 100644
--- a/libgnucash/engine/kvp-scm.cpp
+++ b/libgnucash/engine/kvp-scm.cpp
@@ -56,11 +56,6 @@ gnc_scm_to_kvp_value_ptr(SCM val)
auto tmpguid = guid_copy(&guid);
return new KvpValue{tmpguid};
}
- else if (gnc_timepair_p(val))
- {
- Timespec ts = gnc_timepair2timespec(val);
- return new KvpValue{ts};
- }
else if (scm_is_string(val))
{
return new KvpValue{gnc_scm_to_utf8_string(val)};
@@ -106,10 +101,6 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val)
return gnc_guid2scm(*tempguid);
}
break;
- case KvpValue::Type::TIMESPEC:
- return gnc_timespec2timepair(val->get<Timespec>());
- break;
-
case KvpValue::Type::FRAME:
{
auto frame = val->get<KvpFrame*>();
@@ -117,10 +108,6 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val)
return SWIG_NewPointerObj(frame, SWIG_TypeQuery("_p_KvpFrame"), 0);
}
break;
- case KvpValue::Type::GDATE:
- return gnc_timespec2timepair(gdate_to_timespec(val->get<GDate>()));
-
- /* FIXME: handle types below */
case KvpValue::Type::GLIST:
default:
break;
commit 773b070345bf479afba3b907ed48c1fd47fb589e
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 23 12:00:12 2018 -0700
Don't set transaction properties via scheme in C code.
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index f534f28..9e3beac 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -1386,7 +1386,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
time64 time;
cell = gnc_table_layout_get_cell (reg->table->layout, DATE_CELL);
gnc_date_cell_get_date ((DateCell *) cell, &time);
- gnc_trans_scm_set_date(trans_scm, time);
+ xaccTransSetDatePostedSecsNormalized(trans, time);
}
if (gnc_table_layout_get_cell_changed (reg->table->layout, NUM_CELL, TRUE))
@@ -1395,7 +1395,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
value = gnc_table_layout_get_cell_value (reg->table->layout, NUM_CELL);
if (reg->use_tran_num_for_num_field)
- gnc_trans_scm_set_num (trans_scm, value);
+ xaccTransSetNum (trans, value);
/* else this contains the same as ACTN_CELL which is already handled below *
* and the TNUM_CELL contains transaction number which is handled in next *
* if statement. */
@@ -1407,7 +1407,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
value = gnc_table_layout_get_cell_value (reg->table->layout, TNUM_CELL);
if (!reg->use_tran_num_for_num_field)
- gnc_trans_scm_set_num (trans_scm, value);
+ xaccTransSetNum (trans, value);
/* else this cell is not used */
}
@@ -1416,7 +1416,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
const char *value;
value = gnc_table_layout_get_cell_value (reg->table->layout, DESC_CELL);
- gnc_trans_scm_set_description (trans_scm, value);
+ xaccTransSetDescription (trans, value);
}
if (gnc_table_layout_get_cell_changed (reg->table->layout, NOTES_CELL, TRUE))
@@ -1424,7 +1424,7 @@ gnc_split_register_save_to_scm (SplitRegister *reg,
const char *value;
value = gnc_table_layout_get_cell_value (reg->table->layout, NOTES_CELL);
- gnc_trans_scm_set_notes (trans_scm, value);
+ xaccTransSetNotes (trans, value);
}
if (gnc_table_layout_get_cell_changed (reg->table->layout, RECN_CELL, TRUE))
diff --git a/libgnucash/app-utils/guile-util.c b/libgnucash/app-utils/guile-util.c
index 1d2b00a..2628919 100644
--- a/libgnucash/app-utils/guile-util.c
+++ b/libgnucash/app-utils/guile-util.c
@@ -700,105 +700,6 @@ gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
}
/********************************************************************\
- * gnc_trans_scm_set_date *
- * set the date of a scheme transaction. *
- * *
- * Args: trans_scm - the scheme transaction *
- * ts - the time to set *
- * Returns: Nothing *
-\********************************************************************/
-void
-gnc_trans_scm_set_date(SCM trans_scm, time64 time)
-{
- SCM arg;
- Timespec ts = {time, 0};
- initialize_scm_functions();
- if (!gnc_is_trans_scm(trans_scm))
- return;
- arg = gnc_timespec2timepair(ts);
- scm_call_2(setters.trans_scm_date, trans_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_trans_scm_set_num *
- * set the num of a scheme transaction. *
- * *
- * Args: trans_scm - the scheme transaction *
- * num - the num to set *
- * Returns: Nothing *
-\********************************************************************/
-void
-gnc_trans_scm_set_num(SCM trans_scm, const char *num)
-{
- SCM arg;
-
- initialize_scm_functions();
-
- if (!gnc_is_trans_scm(trans_scm))
- return;
- if (num == NULL)
- return;
-
- arg = scm_from_utf8_string(num);
-
- scm_call_2(setters.trans_scm_num, trans_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_trans_scm_set_description *
- * set the description of a scheme transaction. *
- * *
- * Args: trans_scm - the scheme transaction *
- * description - the description to set *
- * Returns: Nothing *
-\********************************************************************/
-void
-gnc_trans_scm_set_description(SCM trans_scm, const char *description)
-{
- SCM arg;
-
- initialize_scm_functions();
-
- if (!gnc_is_trans_scm(trans_scm))
- return;
- if (description == NULL)
- return;
-
- arg = scm_from_utf8_string(description);
-
- scm_call_2(setters.trans_scm_description, trans_scm, arg);
-}
-
-
-/********************************************************************\
- * gnc_trans_scm_set_notes *
- * set the notes of a scheme transaction. *
- * *
- * Args: trans_scm - the scheme transaction *
- * notes - the notes to set *
- * Returns: Nothing *
-\********************************************************************/
-void
-gnc_trans_scm_set_notes(SCM trans_scm, const char *notes)
-{
- SCM arg;
-
- initialize_scm_functions();
-
- if (!gnc_is_trans_scm(trans_scm))
- return;
- if (notes == NULL)
- return;
-
- arg = scm_from_utf8_string(notes);
-
- scm_call_2(setters.trans_scm_notes, trans_scm, arg);
-}
-
-
-/********************************************************************\
* gnc_trans_scm_append_split_scm *
* append the scheme split onto the scheme transaction *
* *
diff --git a/libgnucash/app-utils/guile-util.h b/libgnucash/app-utils/guile-util.h
index 9623172..f95d38e 100644
--- a/libgnucash/app-utils/guile-util.h
+++ b/libgnucash/app-utils/guile-util.h
@@ -68,10 +68,6 @@ void gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
gboolean do_commit,
QofBook *book);
-void gnc_trans_scm_set_date(SCM trans_scm, time64 time);
-void gnc_trans_scm_set_num(SCM trans_scm, const char *num);
-void gnc_trans_scm_set_description(SCM trans_scm, const char *description);
-void gnc_trans_scm_set_notes(SCM trans_scm, const char *notes);
void gnc_trans_scm_append_split_scm(SCM trans_scm, SCM split_scm);
SCM gnc_trans_scm_get_split_scm(SCM trans_scm, int index);
commit 64778fcad50815ba86a56c780b23173d03ce6bfb
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 22 12:55:55 2018 +0100
Fix error when options dialogue is open when app closed
With the options dialogue open when Gnucash is closed this error is
logged in the trace file, gnc_close_gui_component() component not found.
This is fixed by reversing the components list found for session so the
options dialogue is closed before the report window.
diff --git a/libgnucash/app-utils/gnc-component-manager.c b/libgnucash/app-utils/gnc-component-manager.c
index c32be01..2d909dc 100644
--- a/libgnucash/app-utils/gnc-component-manager.c
+++ b/libgnucash/app-utils/gnc-component-manager.c
@@ -827,6 +827,9 @@ gnc_close_gui_component_by_session (gpointer session)
list = find_components_by_session (session);
+ // reverse the list so class like dialog-options close before window-report
+ list = g_list_reverse (list);
+
for (node = list; node; node = node->next)
{
ComponentInfo *ci = node->data;
commit 5c90f677e556d08b82628a1b72c130a67b535fa1
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 22 12:39:44 2018 +0100
Remove some white space and tabs from dialog-options.c
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index 6a78c40..e41b4bb 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -67,7 +67,7 @@
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
-#define DIALOG_OPTIONS_CM_CLASS "dialog-options"
+#define DIALOG_OPTIONS_CM_CLASS "dialog-options"
#define DIALOG_BOOK_OPTIONS_CM_CLASS "dialog-book-options"
#define GNC_PREFS_GROUP "dialogs.options"
@@ -105,7 +105,7 @@ struct gnc_option_win
gpointer close_cb_data;
/* Hold onto this for a complete reset */
- GNCOptionDB * option_db;
+ GNCOptionDB *option_db;
/* Hold on to this to unregister the right class */
const char *component_class;
@@ -696,8 +696,7 @@ gnc_set_default_gain_loss_account_widget(gnc_commodity *commodity)
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(
book_currency_data->default_gain_loss_account_widget),
TRUE);
- col =
- gnc_tree_view_add_text_column(GNC_TREE_VIEW(
+ col = gnc_tree_view_add_text_column(GNC_TREE_VIEW(
book_currency_data->default_gain_loss_account_widget),
_("Currency"), /* title */
"commodity", /* pref name */
@@ -713,8 +712,7 @@ gnc_set_default_gain_loss_account_widget(gnc_commodity *commodity)
gnc_tree_view_account_column_add_color (GNC_TREE_VIEW_ACCOUNT(
book_currency_data->default_gain_loss_account_widget), col);
- col =
- gnc_tree_view_add_toggle_column(GNC_TREE_VIEW(
+ col = gnc_tree_view_add_toggle_column(GNC_TREE_VIEW(
book_currency_data->default_gain_loss_account_widget),
_("Placeholder"),
/* Translators: This string has a context prefix; the
@@ -1918,7 +1916,7 @@ gnc_options_dialog_build_contents (GNCOptionWin *propertybox,
}
/********************************************************************\
- * gnc_options_dialog_build_contents_full *
+ * gnc_options_dialog_build_contents_full *
* builds an options dialog given a property box and an options *
* database and make the dialog visible depending on the *
* show_dialog flag *
@@ -2121,10 +2119,10 @@ gnc_options_register_stocks (void)
GtkStockItem items[] =
{
- { GTK_STOCK_APPLY , "gnc_option_apply_button", 0, 0, NULL },
- { GTK_STOCK_HELP , "gnc_options_dialog_help", 0, 0, NULL },
- { GTK_STOCK_OK , "gnc_options_dialog_ok", 0, 0, NULL },
- { GTK_STOCK_CANCEL , "gnc_options_dialog_cancel", 0, 0, NULL },
+ { GTK_STOCK_APPLY , "gnc_option_apply_button", 0, 0, NULL },
+ { GTK_STOCK_HELP , "gnc_options_dialog_help", 0, 0, NULL },
+ { GTK_STOCK_OK , "gnc_options_dialog_ok", 0, 0, NULL },
+ { GTK_STOCK_CANCEL , "gnc_options_dialog_cancel", 0, 0, NULL },
};
if (done)
@@ -3585,7 +3583,7 @@ gnc_option_set_ui_value_radiobutton (GNCOption *option, gboolean use_default,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
// g_object_set_data(G_OBJECT(widget), "gnc_radiobutton_index",
- // GINT_TO_POINTER(index));
+ // GINT_TO_POINTER(index));
return FALSE;
}
}
@@ -4322,8 +4320,8 @@ void gnc_options_ui_initialize (void)
struct scm_cb
{
- SCM apply_cb;
- SCM close_cb;
+ SCM apply_cb;
+ SCM close_cb;
};
static void
commit 5ad584ca3b67236c563f5da25f935ee9f188592e
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 22 12:36:35 2018 +0100
Change the Options dialogue to use GtkWindow
Change the report / book options dialogue from a GtkDialog to GtkWindow.
This removes the need for setting the transient parent which allows the
dialogue to be placed behind the main application when changing values
making it easier to see the result.
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index f981c5b..6a78c40 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -70,6 +70,8 @@ static QofLogModule log_module = GNC_MOD_GUI;
#define DIALOG_OPTIONS_CM_CLASS "dialog-options"
#define DIALOG_BOOK_OPTIONS_CM_CLASS "dialog-book-options"
+#define GNC_PREFS_GROUP "dialogs.options"
+
/*
* Point where preferences switch control method from a set of
* notebook tabs to a list.
@@ -86,7 +88,7 @@ static int gain_loss_accounts_in_filter = 0;
struct gnc_option_win
{
- GtkWidget * dialog;
+ GtkWidget * window;
GtkWidget * notebook;
GtkWidget * page_list_view;
GtkWidget * page_list;
@@ -107,6 +109,9 @@ struct gnc_option_win
/* Hold on to this to unregister the right class */
const char *component_class;
+
+ /* widget being destroyed */
+ gboolean destroyed;
};
typedef enum
@@ -150,8 +155,6 @@ static currency_accounting_data *book_currency_data = NULL;
static GNCOptionWinCallback global_help_cb = NULL;
gpointer global_help_cb_data = NULL;
-void gnc_options_dialog_response_cb(GtkDialog *dialog, gint response,
- GNCOptionWin *window);
static void gnc_options_dialog_reset_cb(GtkWidget * w, gpointer data);
void gnc_options_dialog_list_select_cb (GtkTreeSelection *selection,
gpointer data);
@@ -172,16 +175,42 @@ gnc_option_get_gtk_widget (GNCOption *option)
static void
gnc_options_dialog_changed_internal (GtkWidget *widget, gboolean sensitive)
{
- GtkDialog *dialog;
-
- while (widget && !GTK_IS_DIALOG(widget))
+ while (widget && !GTK_IS_WINDOW(widget))
widget = gtk_widget_get_parent(widget);
if (widget == NULL)
return;
- dialog = GTK_DIALOG(widget);
- gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, sensitive);
- gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_APPLY, sensitive);
+ /* find the ok and cancel buttons, we know where they will be so do it
+ this way as opposed to using gtk_container_foreach, much less iteration */
+ if (GTK_IS_CONTAINER(widget))
+ {
+ GList *children = gtk_container_get_children(GTK_CONTAINER(widget));
+ for (GList *it = children; it; it = it->next)
+ {
+ if (GTK_IS_BOX (GTK_WIDGET(it->data)))
+ {
+ GList *children = gtk_container_get_children(GTK_CONTAINER(it->data));
+ for (GList *it = children; it; it = it->next)
+ {
+ if (GTK_IS_BUTTON_BOX (GTK_WIDGET(it->data)))
+ {
+ GList *children = gtk_container_get_children(GTK_CONTAINER(it->data));
+ for (GList *it = children; it; it = it->next)
+ {
+ if (g_strcmp0 (gtk_widget_get_name(GTK_WIDGET(it->data)), "ok_button") == 0)
+ gtk_widget_set_sensitive (GTK_WIDGET(it->data), sensitive);
+
+ if (g_strcmp0 (gtk_widget_get_name(GTK_WIDGET(it->data)), "apply_button") == 0)
+ gtk_widget_set_sensitive (GTK_WIDGET(it->data), sensitive);
+ }
+ g_list_free (children);
+ }
+ }
+ g_list_free (children);
+ }
+ }
+ g_list_free (children);
+ }
}
void
@@ -189,7 +218,7 @@ gnc_options_dialog_changed (GNCOptionWin *win)
{
if (!win) return;
- gnc_options_dialog_changed_internal (win->dialog, TRUE);
+ gnc_options_dialog_changed_internal (win->window, TRUE);
}
void
@@ -1968,15 +1997,15 @@ gnc_options_dialog_build_contents_full (GNCOptionWin *propertybox,
gtk_tree_selection_select_iter (selection, &iter);
gtk_notebook_set_current_page(GTK_NOTEBOOK(propertybox->notebook), default_page);
}
- gnc_options_dialog_changed_internal(propertybox->dialog, FALSE);
+ gnc_options_dialog_changed_internal(propertybox->window, FALSE);
if (show_dialog)
- gtk_widget_show(propertybox->dialog);
+ gtk_widget_show(propertybox->window);
}
GtkWidget *
gnc_options_dialog_widget(GNCOptionWin * win)
{
- return win->dialog;
+ return win->window;
}
GtkWidget *
@@ -1991,42 +2020,62 @@ gnc_options_dialog_notebook(GNCOptionWin * win)
return win->notebook;
}
-void
-gnc_options_dialog_response_cb(GtkDialog *dialog, gint response, GNCOptionWin *window)
+static void
+gnc_options_dialog_help_button_cb(GtkWidget * widget, GNCOptionWin *win)
{
- GNCOptionWinCallback close_cb;
+ if (win->help_cb)
+ (win->help_cb)(win, win->help_cb_data);
+}
- switch (response)
- {
- case GTK_RESPONSE_HELP:
- if (window->help_cb)
- (window->help_cb)(window, window->help_cb_data);
- break;
-
- case GTK_RESPONSE_OK:
- case GTK_RESPONSE_APPLY:
- close_cb = window->close_cb;
- window->close_cb = NULL;
- if (window->apply_cb)
- window->apply_cb (window, window->apply_cb_data);
- window->close_cb = close_cb;
- if (response == GTK_RESPONSE_APPLY)
- {
- gnc_options_dialog_changed_internal (window->dialog, FALSE);
- break;
- }
- /* fall through */
+static void
+gnc_options_dialog_cancel_button_cb(GtkWidget * widget, GNCOptionWin *win)
+{
+ if (win->close_cb)
+ (win->close_cb)(win, win->close_cb_data);
+ else
+ gtk_widget_hide(win->window);
+}
- default:
- if (window->close_cb)
- {
- (window->close_cb)(window, window->close_cb_data);
- }
- else
- {
- gtk_widget_hide(window->dialog);
- }
- break;
+static void
+gnc_options_dialog_apply_button_cb(GtkWidget * widget, GNCOptionWin *win)
+{
+ GNCOptionWinCallback close_cb = win->close_cb;
+
+ win->close_cb = NULL;
+ if (win->apply_cb)
+ win->apply_cb (win, win->apply_cb_data);
+ win->close_cb = close_cb;
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(win->window));
+ gnc_options_dialog_changed_internal (win->window, FALSE);
+}
+
+static void
+gnc_options_dialog_ok_button_cb(GtkWidget * widget, GNCOptionWin *win)
+{
+ GNCOptionWinCallback close_cb = win->close_cb;
+
+ win->close_cb = NULL;
+ if (win->apply_cb)
+ win->apply_cb (win, win->apply_cb_data);
+ win->close_cb = close_cb;
+
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(win->window));
+
+ if (win->close_cb)
+ (win->close_cb)(win, win->close_cb_data);
+ else
+ gtk_widget_hide(win->window);
+}
+
+static void
+gnc_options_dialog_destroy_cb (GtkWidget *object, GNCOptionWin *win)
+{
+ if (!win) return;
+
+ if (win->destroyed == FALSE)
+ {
+ if (win->close_cb)
+ (win->close_cb)(win, win->close_cb_data);
}
}
@@ -2043,7 +2092,7 @@ gnc_options_dialog_reset_cb(GtkWidget * w, gpointer data)
section = (GNCOptionSection*)val;
gnc_option_db_section_reset_widgets (section);
- gnc_options_dialog_changed_internal (win->dialog, TRUE);
+ gnc_options_dialog_changed_internal (win->window, TRUE);
}
void
@@ -2091,8 +2140,8 @@ gnc_options_register_stocks (void)
static void
component_close_handler (gpointer data)
{
- GNCOptionWin *window = data;
- gtk_dialog_response(GTK_DIALOG(window->dialog), GTK_RESPONSE_CANCEL);
+ GNCOptionWin *win = data;
+ gnc_options_dialog_cancel_button_cb (NULL, win);
}
static void
@@ -2152,16 +2201,17 @@ gnc_options_dialog_new_modal(gboolean modal, gchar *title,
GtkBuilder *builder;
GtkWidget *hbox;
gint component_id;
+ GtkWidget *button;
retval = g_new0(GNCOptionWin, 1);
builder = gtk_builder_new();
- gnc_builder_add_from_file (builder, "dialog-options.glade", "gnucash_options_dialog");
- retval->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_options_dialog"));
+ gnc_builder_add_from_file (builder, "dialog-options.glade", "gnucash_options_window");
+ retval->window = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_options_window"));
retval->page_list = GTK_WIDGET(gtk_builder_get_object (builder, "page_list_scroll"));
// Set the style context for this dialog so it can be easily manipulated with css
- gnc_widget_set_style_context (GTK_WIDGET(retval->dialog), "GncOptionsDialog");
- gtk_window_set_transient_for (GTK_WINDOW (retval->dialog), parent);
+ gnc_widget_set_style_context (GTK_WIDGET(retval->window), "GncOptionsDialog");
+
/* Page List */
{
GtkTreeView *view;
@@ -2189,13 +2239,23 @@ gnc_options_dialog_new_modal(gboolean modal, gchar *title,
gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
g_signal_connect (selection, "changed",
G_CALLBACK (gnc_options_dialog_list_select_cb), retval);
-
}
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "helpbutton"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_options_dialog_help_button_cb), retval);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "cancelbutton"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_options_dialog_cancel_button_cb), retval);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "applybutton"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_options_dialog_apply_button_cb), retval);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "okbutton"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_options_dialog_ok_button_cb), retval);
+
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, retval);
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(retval->window));
+
if (title)
- gtk_window_set_title(GTK_WINDOW(retval->dialog), title);
+ gtk_window_set_title(GTK_WINDOW(retval->window), title);
/* modal */
if (modal == TRUE)
@@ -2229,20 +2289,25 @@ gnc_options_dialog_new_modal(gboolean modal, gchar *title,
GNC_ID_ACCOUNT,
QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
}
+
+ g_signal_connect (retval->window, "destroy",
+ G_CALLBACK(gnc_options_dialog_destroy_cb), retval);
+
g_object_unref(G_OBJECT(builder));
+ retval->destroyed = FALSE;
return retval;
}
/* Creates a new GNCOptionWin structure, but assumes you have your own
dialog widget you want to plugin */
GNCOptionWin *
-gnc_options_dialog_new_w_dialog(gchar *title, GtkWidget *dialog)
+gnc_options_dialog_new_w_dialog(gchar *title, GtkWidget *window)
{
GNCOptionWin * retval;
retval = g_new0(GNCOptionWin, 1);
- retval->dialog = dialog;
+ retval->window = window;
return retval;
}
@@ -2286,9 +2351,10 @@ gnc_options_dialog_destroy(GNCOptionWin * win)
gnc_unregister_gui_component_by_data(win->component_class, win);
- gtk_widget_destroy(win->dialog);
+ win->destroyed = TRUE;
+ gtk_widget_destroy(win->window);
- win->dialog = NULL;
+ win->window = NULL;
win->notebook = NULL;
win->apply_cb = NULL;
win->help_cb = NULL;
diff --git a/gnucash/gschemas/org.gnucash.dialogs.gschema.xml.in b/gnucash/gschemas/org.gnucash.dialogs.gschema.xml.in
index 3d96700..7736671 100644
--- a/gnucash/gschemas/org.gnucash.dialogs.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.dialogs.gschema.xml.in
@@ -21,6 +21,7 @@
<child name="search" schema="org.gnucash.dialogs.search"/>
<child name="transfer" schema="org.gnucash.dialogs.transfer"/>
<child name="trans-assoc" schema="org.gnucash.dialogs.trans-assoc"/>
+ <child name="options" schema="org.gnucash.dialogs.options"/>
</schema>
<schema id="org.gnucash.dialogs.account" path="/org/gnucash/dialogs/account/">
@@ -245,4 +246,14 @@
followed by the width and height of the window.</description>
</key>
</schema>
+
+ <schema id="org.gnucash.dialogs.options" path="/org/gnucash/dialogs/options/">
+ <key name="last-geometry" type="(iiii)">
+ <default>(-1,-1,-1,-1)</default>
+ <summary>Last window position and size</summary>
+ <description>This setting describes the size and position of the window when it was last closed.
+ The numbers are the X and Y coordinates of the top left corner of the window
+ followed by the width and height of the window.</description>
+ </key>
+ </schema>
</schemalist>
diff --git a/gnucash/gtkbuilder/dialog-options.glade b/gnucash/gtkbuilder/dialog-options.glade
index ae7435e..a30f3fc 100644
--- a/gnucash/gtkbuilder/dialog-options.glade
+++ b/gnucash/gtkbuilder/dialog-options.glade
@@ -1,27 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
- <object class="GtkDialog" id="gnucash_options_dialog">
+ <object class="GtkWindow" id="gnucash_options_window">
<property name="can_focus">False</property>
- <property name="title" translatable="yes">GnuCash Options</property>
<property name="default_width">640</property>
<property name="default_height">480</property>
- <property name="type_hint">dialog</property>
- <signal name="response" handler="gnc_options_dialog_response_cb" swapped="no"/>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
+ <child>
+ <object class="GtkBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <child>
+ <object class="GtkButtonBox" id="buttonbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="helpbutton1">
+ <object class="GtkButton" id="helpbutton">
<property name="label" translatable="yes">_Help</property>
+ <property name="name">help_button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
@@ -32,11 +30,13 @@
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
+ <property name="secondary">True</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="cancelbutton1">
+ <object class="GtkButton" id="cancelbutton">
<property name="label" translatable="yes">_Cancel</property>
+ <property name="name">cancel_button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
@@ -53,6 +53,7 @@
<child>
<object class="GtkButton" id="applybutton">
<property name="label" translatable="yes">_Apply</property>
+ <property name="name">apply_button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
@@ -67,8 +68,9 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="okbutton1">
+ <object class="GtkButton" id="okbutton">
<property name="label" translatable="yes">_OK</property>
+ <property name="name">ok_button</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
@@ -91,7 +93,7 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="hbox1">
+ <object class="GtkBox" id="hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -105,7 +107,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
+ <object class="GtkTreeSelection" id="treeview-selection"/>
</child>
</object>
</child>
@@ -139,11 +141,8 @@
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-11">helpbutton1</action-widget>
- <action-widget response="-6">cancelbutton1</action-widget>
- <action-widget response="-10">applybutton</action-widget>
- <action-widget response="-5">okbutton1</action-widget>
- </action-widgets>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
</object>
</interface>
commit 8edf447808c2c4bc21ea63c44c3b92befaa10f95
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 19 16:44:00 2018 +0100
Drop the tree model before updating transaction association tree view
To avoid delays with large transaction associations trees, drop the
model from the transaction association tree view while it is being
updated and then reconnect it after the model has been updated.
diff --git a/gnucash/gnome/dialog-trans-assoc.c b/gnucash/gnome/dialog-trans-assoc.c
index ef2c50f..9429a32 100644
--- a/gnucash/gnome/dialog-trans-assoc.c
+++ b/gnucash/gnome/dialog-trans-assoc.c
@@ -165,7 +165,10 @@ assoc_dialog_update (AssocDialog *assoc_dialog)
GtkTreeIter iter;
gboolean valid;
+ /* disconnect the model from the treeview */
model = gtk_tree_view_get_model (GTK_TREE_VIEW(assoc_dialog->view));
+ g_object_ref (G_OBJECT(model));
+ gtk_tree_view_set_model (GTK_TREE_VIEW(assoc_dialog->view), NULL);
/* Get first row in list store */
valid = gtk_tree_model_get_iter_first (model, &iter);
@@ -205,6 +208,9 @@ assoc_dialog_update (AssocDialog *assoc_dialog)
g_free (filename);
valid = gtk_tree_model_iter_next (model, &iter);
}
+ /* reconnect the model to the treeview */
+ gtk_tree_view_set_model (GTK_TREE_VIEW(assoc_dialog->view), model);
+ g_object_unref(G_OBJECT(model));
}
static void
@@ -299,7 +305,10 @@ get_trans_info (AssocDialog *assoc_dialog)
/* Get list of Accounts */
accts = gnc_account_get_descendants_sorted (root);
+ /* disconnect the model from the treeview */
model = gtk_tree_view_get_model (GTK_TREE_VIEW(assoc_dialog->view));
+ g_object_ref (G_OBJECT(model));
+ gtk_tree_view_set_model (GTK_TREE_VIEW(assoc_dialog->view), NULL);
/* Go through list of accounts */
for (ptr = accts; ptr; ptr = g_list_next (ptr))
@@ -352,6 +361,11 @@ get_trans_info (AssocDialog *assoc_dialog)
qof_query_destroy (query);
g_list_free (splits);
}
+
+ /* reconnect the model to the treeview */
+ gtk_tree_view_set_model (GTK_TREE_VIEW(assoc_dialog->view), model);
+ g_object_unref(G_OBJECT(model));
+
g_list_free (accts);
g_list_free (trans_list);
}
commit d34393410182e5e4c2b2f2a6f1e99dc32fc76227
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 19 15:53:09 2018 +0100
Change the transaction association dialogue
Change the transaction association dialogue from a GtkDialog to
GtkWindow. This removes the need for setting the transient parent which
allows the dialogue to be placed behind the main application when
jumping to the transaction while the dialogue is still open.
diff --git a/gnucash/gnome/dialog-trans-assoc.c b/gnucash/gnome/dialog-trans-assoc.c
index e83f119..ef2c50f 100644
--- a/gnucash/gnome/dialog-trans-assoc.c
+++ b/gnucash/gnome/dialog-trans-assoc.c
@@ -48,7 +48,7 @@ enum GncAssocColumn {DATE_TRANS, DESC_TRANS, URI_U, AVAILABLE, URI_SPLIT, URI, U
typedef struct
{
- GtkWidget *dialog;
+ GtkWidget *window;
GtkWidget *view;
const gchar *path_head;
gboolean valid_path_head;
@@ -57,38 +57,22 @@ typedef struct
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
-void gnc_assoc_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data);
-void gnc_assoc_dialog_close_cb (GtkDialog *dialog, gpointer user_data);
-void gnc_assoc_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data);
-
-
-void
+static void
gnc_assoc_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data)
{
AssocDialog *assoc_dialog = user_data;
ENTER(" ");
gnc_unregister_gui_component_by_data (DIALOG_ASSOC_CM_CLASS, assoc_dialog);
-
- if (assoc_dialog->dialog)
+ if (assoc_dialog->window)
{
- gtk_widget_destroy (assoc_dialog->dialog);
- assoc_dialog->dialog = NULL;
+ gtk_widget_destroy (assoc_dialog->window);
+ assoc_dialog->window = NULL;
}
g_free (assoc_dialog);
LEAVE(" ");
}
-void
-gnc_assoc_dialog_close_cb (GtkDialog *dialog, gpointer user_data)
-{
- AssocDialog *assoc_dialog = user_data;
-
- ENTER(" ");
- gnc_close_gui_component_by_data (DIALOG_ASSOC_CM_CLASS, assoc_dialog);
- LEAVE(" ");
-}
-
static gint
sort_iter_compare_func (GtkTreeModel *model,
GtkTreeIter *a,
@@ -182,7 +166,7 @@ assoc_dialog_update (AssocDialog *assoc_dialog)
gboolean valid;
model = gtk_tree_view_get_model (GTK_TREE_VIEW(assoc_dialog->view));
-
+
/* Get first row in list store */
valid = gtk_tree_model_get_iter_first (model, &iter);
@@ -223,26 +207,25 @@ assoc_dialog_update (AssocDialog *assoc_dialog)
}
}
-void
-gnc_assoc_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
+static void
+gnc_assoc_dialog_sort_button_cb (GtkWidget * widget, gpointer user_data)
{
- AssocDialog *assoc_dialog = user_data;
-
- switch (response_id)
- {
- case GTK_RESPONSE_APPLY:
- assoc_dialog_update (assoc_dialog);
- return;
+ AssocDialog *assoc_dialog = user_data;
+ assoc_dialog_sort (assoc_dialog);
+}
- case -8:
- assoc_dialog_sort (assoc_dialog);
- return;
+static void
+gnc_assoc_dialog_check_button_cb (GtkWidget * widget, gpointer user_data)
+{
+ AssocDialog *assoc_dialog = user_data;
+ assoc_dialog_update (assoc_dialog);
+}
- case GTK_RESPONSE_CLOSE:
- default:
- gnc_close_gui_component_by_data (DIALOG_ASSOC_CM_CLASS, assoc_dialog);
- return;
- }
+static void
+gnc_assoc_dialog_close_button_cb (GtkWidget * widget, gpointer user_data)
+{
+ AssocDialog *assoc_dialog = user_data;
+ gnc_close_gui_component_by_data (DIALOG_ASSOC_CM_CLASS, assoc_dialog);
}
static void
@@ -374,30 +357,35 @@ get_trans_info (AssocDialog *assoc_dialog)
}
static void
-gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
+gnc_assoc_dialog_create (AssocDialog *assoc_dialog)
{
- GtkWidget *dialog;
+ GtkWidget *window;
GtkBuilder *builder;
GtkTreeSelection *selection;
GtkWidget *path_head;
GtkTreeViewColumn *tree_column;
GtkCellRenderer *cr;
+ GtkWidget *button;
ENTER(" ");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "dialog-trans-assoc.glade", "list-store");
+ gnc_builder_add_from_file (builder, "dialog-trans-assoc.glade", "transaction_association_window");
- gnc_builder_add_from_file (builder, "dialog-trans-assoc.glade", "transaction_association_dialog");
+ window = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_association_window"));
+ assoc_dialog->window = window;
- dialog = GTK_WIDGET(gtk_builder_get_object (builder, "transaction_association_dialog"));
- assoc_dialog->dialog = dialog;
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "sort_button"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_assoc_dialog_sort_button_cb), assoc_dialog);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "check_button"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_assoc_dialog_check_button_cb), assoc_dialog);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "close_button"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_assoc_dialog_close_button_cb), assoc_dialog);
- // Set the style context for this dialog so it can be easily manipulated with css
- gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncTransAssocDialog");
+ gtk_window_set_title (GTK_WINDOW(assoc_dialog->window), _("Transaction Associations"));
- /* parent */
- if (parent != NULL)
- gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent));
+ // Set the style context for this dialog so it can be easily manipulated with css
+ gnc_widget_set_style_context (GTK_WIDGET(window), "GncTransAssocDialog");
assoc_dialog->view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview"));
path_head = GTK_WIDGET(gtk_builder_get_object (builder, "path-head"));
@@ -444,18 +432,19 @@ gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
// Set grid lines option to preference
gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(assoc_dialog->view), gnc_tree_view_get_grid_lines_pref ());
- /* default to 'close' button */
- gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE);
-
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(assoc_dialog->view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
+ g_signal_connect (assoc_dialog->window, "destroy",
+ G_CALLBACK(gnc_assoc_dialog_window_destroy_cb), assoc_dialog);
+
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, assoc_dialog);
g_object_unref (G_OBJECT(builder));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(assoc_dialog->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(assoc_dialog->window));
get_trans_info (assoc_dialog);
+ gtk_widget_show_all (GTK_WIDGET(window));
LEAVE(" ");
}
@@ -466,8 +455,8 @@ close_handler (gpointer user_data)
AssocDialog *assoc_dialog = user_data;
ENTER(" ");
- gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(assoc_dialog->dialog));
- gtk_widget_destroy (GTK_WIDGET(assoc_dialog->dialog));
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(assoc_dialog->window));
+ gtk_widget_destroy (GTK_WIDGET(assoc_dialog->window));
LEAVE(" ");
}
@@ -490,7 +479,7 @@ show_handler (const char *klass, gint component_id,
LEAVE("No data strucure");
return(FALSE);
}
- gtk_window_present (GTK_WINDOW(assoc_dialog->dialog));
+ gtk_window_present (GTK_WINDOW(assoc_dialog->window));
LEAVE(" ");
return(TRUE);
}
@@ -503,7 +492,7 @@ show_handler (const char *klass, gint component_id,
* Return: nothing *
\********************************************************************/
void
-gnc_trans_assoc_dialog (GtkWindow *parent)
+gnc_trans_assoc_dialog (void)
{
AssocDialog *assoc_dialog;
@@ -515,12 +504,12 @@ gnc_trans_assoc_dialog (GtkWindow *parent)
}
assoc_dialog = g_new0 (AssocDialog, 1);
- gnc_assoc_dialog_create (parent, assoc_dialog);
+ gnc_assoc_dialog_create (assoc_dialog);
gnc_register_gui_component (DIALOG_ASSOC_CM_CLASS,
refresh_handler, close_handler,
assoc_dialog);
- gtk_widget_show (assoc_dialog->dialog);
+// gtk_widget_show (assoc_dialog->window);
LEAVE(" ");
}
diff --git a/gnucash/gnome/dialog-trans-assoc.h b/gnucash/gnome/dialog-trans-assoc.h
index c95c5b7..fa82fcb 100644
--- a/gnucash/gnome/dialog-trans-assoc.h
+++ b/gnucash/gnome/dialog-trans-assoc.h
@@ -23,6 +23,6 @@
#ifndef DIALOG_TRANS_ASSOC_H
#define DIALOG_TRANS_ASSOC_H
-void gnc_trans_assoc_dialog (GtkWindow *parent);
+void gnc_trans_assoc_dialog (void);
#endif
diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c
index 5e50f6b..c019a72 100644
--- a/gnucash/gnome/gnc-plugin-basic-commands.c
+++ b/gnucash/gnome/gnc-plugin-basic-commands.c
@@ -624,7 +624,7 @@ static void
gnc_main_window_cmd_tools_trans_assoc (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor (NULL, TRUE);
- gnc_trans_assoc_dialog (GTK_WINDOW (data->window));
+ gnc_trans_assoc_dialog ();
gnc_unset_busy_cursor (NULL);
}
diff --git a/gnucash/gtkbuilder/dialog-trans-assoc.glade b/gnucash/gtkbuilder/dialog-trans-assoc.glade
index 57e92b7..f10e9b9 100644
--- a/gnucash/gtkbuilder/dialog-trans-assoc.glade
+++ b/gnucash/gtkbuilder/dialog-trans-assoc.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkListStore" id="list-store">
@@ -20,28 +20,31 @@
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkDialog" id="transaction_association_dialog">
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="can_default">True</property>
- <property name="border_width">6</property>
- <property name="title" translatable="yes">Transaction Association Dialog</property>
- <property name="default_width">600</property>
- <property name="default_height">400</property>
- <property name="destroy_with_parent">True</property>
- <property name="type_hint">normal</property>
- <signal name="destroy" handler="gnc_assoc_dialog_window_destroy_cb" swapped="no"/>
- <signal name="response" handler="gnc_assoc_dialog_response_cb" swapped="no"/>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox2">
+ <object class="GtkWindow" id="transaction_association_window">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="dialog-vbox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">All Transaction Associations</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">2</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="buttonbox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="sort">
+ <object class="GtkButton" id="sort_button">
<property name="label" translatable="yes">_Sort Association</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -55,7 +58,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="Check">
+ <object class="GtkButton" id="check_button">
<property name="label" translatable="yes">_Locate Association</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -93,19 +96,6 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">All Transaction Associations</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="padding">2</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkLabel" id="path-head">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -118,7 +108,7 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
@@ -126,8 +116,9 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">list-store</property>
+ <property name="search_column">0</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
+ <object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="trans-date">
@@ -193,7 +184,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes"> To jump to the Transaction, double click on the entry in the
@@ -208,10 +199,8 @@ Description column or Association column to open the Association</property>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-8">sort</action-widget>
- <action-widget response="-10">Check</action-widget>
- <action-widget response="-6">close_button</action-widget>
- </action-widgets>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
</object>
</interface>
commit 1ea4310f8cceae81070965f3f3ccb484ddadf183
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 19 15:22:40 2018 +0100
Add a column for Tax related to find account dialogue
diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index 9bde1e3..a25044b 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -40,7 +40,7 @@
#define GNC_PREFS_GROUP "dialogs.find-account"
/** Enumeration for the tree-store */
-enum GncFindAccountColumn {ACC_FULL_NAME, ACCOUNT, PLACE_HOLDER, HIDDEN, NOT_USED, BAL_ZERO};
+enum GncFindAccountColumn {ACC_FULL_NAME, ACCOUNT, PLACE_HOLDER, HIDDEN, NOT_USED, BAL_ZERO, TAX};
typedef struct
{
@@ -172,7 +172,8 @@ fill_model (GtkTreeModel *model, Account *account)
PLACE_HOLDER, (xaccAccountGetPlaceholder (account) == TRUE ? "emblem-default" : NULL),
HIDDEN, (xaccAccountGetHidden (account) == TRUE ? "emblem-default" : NULL),
NOT_USED, (splits == 0 ? "emblem-default" : NULL),
- BAL_ZERO, (gnc_numeric_zero_p (total) == TRUE ? "emblem-default" : NULL), -1);
+ BAL_ZERO, (gnc_numeric_zero_p (total) == TRUE ? "emblem-default" : NULL),
+ TAX, (xaccAccountGetTaxRelated (account) == TRUE ? "emblem-default" : NULL), -1);
g_free (fullname);
}
@@ -339,6 +340,16 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
gtk_tree_view_column_set_attributes (tree_column, cr, "icon-name", BAL_ZERO, NULL);
gtk_cell_renderer_set_alignment (cr, 0.5, 0.5);
+ tree_column = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title (tree_column, _("Tax related"));
+ gtk_tree_view_append_column (GTK_TREE_VIEW(facc_dialog->view), tree_column);
+ gtk_tree_view_column_set_alignment (tree_column, 0.5);
+ gtk_tree_view_column_set_expand (tree_column, TRUE);
+ cr = gtk_cell_renderer_pixbuf_new();
+ gtk_tree_view_column_pack_start (tree_column, cr, TRUE);
+ // connect 'active' and set 'xalign' property of the cell renderer
+ gtk_tree_view_column_set_attributes (tree_column, cr, "icon-name", TAX, NULL);
+ gtk_cell_renderer_set_alignment (cr, 0.5, 0.5);
g_signal_connect (facc_dialog->window, "destroy",
G_CALLBACK(gnc_find_account_dialog_window_destroy_cb), facc_dialog);
diff --git a/gnucash/gtkbuilder/dialog-find-account.glade b/gnucash/gtkbuilder/dialog-find-account.glade
index d630dd1..4ed0b75 100644
--- a/gnucash/gtkbuilder/dialog-find-account.glade
+++ b/gnucash/gtkbuilder/dialog-find-account.glade
@@ -16,6 +16,8 @@
<column type="gchararray"/>
<!-- column-name bal_zero -->
<column type="gchararray"/>
+ <!-- column-name tax -->
+ <column type="gchararray"/>
</columns>
</object>
<object class="GtkWindow" id="find_account_window">
commit 85bb778610bfc1d4a111432fae247d9918a65ee4
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 19 11:00:11 2018 +0100
Drop the tree model before update find account tree view
To avoid delays with large account trees, drop the model from the find
account tree view while it is being updated and then reconnect it after
the model has been updated.
diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index 7138263..9bde1e3 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -156,9 +156,8 @@ gnc_find_account_dialog_close_button_cb (GtkWidget * widget, gpointer user_data)
}
static void
-fill_model (FindAccountDialog *facc_dialog, Account *account)
+fill_model (GtkTreeModel *model, Account *account)
{
- GtkTreeModel *model;
GtkTreeIter iter;
gchar *fullname = gnc_account_get_full_name (account);
gint splits = xaccAccountCountSplits (account, TRUE);
@@ -166,8 +165,6 @@ fill_model (FindAccountDialog *facc_dialog, Account *account)
PINFO("Add to Store: Account '%s'", fullname);
- model = gtk_tree_view_get_model (GTK_TREE_VIEW(facc_dialog->view));
-
gtk_list_store_append (GTK_LIST_STORE(model), &iter);
gtk_list_store_set (GTK_LIST_STORE(model), &iter,
@@ -187,6 +184,7 @@ get_account_info (FindAccountDialog *facc_dialog)
GList *ptr;
gchar *filter_text;
gboolean radio_root;
+ GtkTreeModel *model;
/* Get the state of the root radio button */
radio_root = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(facc_dialog->radio_root));
@@ -201,6 +199,14 @@ get_account_info (FindAccountDialog *facc_dialog)
filter_text = g_ascii_strdown (gtk_entry_get_text (GTK_ENTRY(facc_dialog->filter_text_entry)), -1);
+ /* disconnect the model from the treeview */
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW(facc_dialog->view));
+ g_object_ref (G_OBJECT(model));
+ gtk_tree_view_set_model (GTK_TREE_VIEW(facc_dialog->view), NULL);
+
+ // Clear the list store
+ gtk_list_store_clear (GTK_LIST_STORE(model));
+
/* Go through list of accounts */
for (ptr = accts; ptr; ptr = g_list_next (ptr))
{
@@ -209,7 +215,7 @@ get_account_info (FindAccountDialog *facc_dialog)
gchar *match_string = g_ascii_strdown (full_name, -1);
if ((g_strcmp0 (filter_text, "") == 0) || (g_strrstr (match_string, filter_text) != NULL))
- fill_model (facc_dialog, acc);
+ fill_model (model, acc);
g_free (match_string);
g_free (full_name);
@@ -217,17 +223,16 @@ get_account_info (FindAccountDialog *facc_dialog)
g_free (filter_text);
g_list_free (accts);
+ /* reconnect the model to the treeview */
+ gtk_tree_view_set_model (GTK_TREE_VIEW(facc_dialog->view), model);
+ g_object_unref(G_OBJECT(model));
+
gtk_tree_view_columns_autosize (GTK_TREE_VIEW(facc_dialog->view));
}
static void
filter_button_cb (GtkButton *button, FindAccountDialog *facc_dialog)
{
- 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));
-
get_account_info (facc_dialog);
// Clear the filter
commit 193176cc251281b1287e67a05e8a2039c7a4f407
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 19 10:16:04 2018 +0100
Change find-account from GtkDialog to GtkWindow
Change the find account dialogue from a GtkDialog to GtkWindow. This
removes the need for setting the transient parent which allows the
dialogue to be placed behind the main application when jumping to the
account if the the tick box to keep the dialogue open is used.
diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index 98e7fe4..7138263 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -44,7 +44,7 @@ enum GncFindAccountColumn {ACC_FULL_NAME, ACCOUNT, PLACE_HOLDER, HIDDEN, NOT_USE
typedef struct
{
- GtkWidget *dialog;
+ GtkWidget *window;
GtkWidget *parent;
QofSession *session;
Account *account;
@@ -65,11 +65,7 @@ typedef struct
/* This static indicates the debugging module that this .o belongs to. */
static QofLogModule log_module = GNC_MOD_GUI;
-void gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data);
-void gnc_find_account_dialog_close_cb (GtkDialog *dialog, gpointer user_data);
-void gnc_find_account_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data);
-
-void
+static void
gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data)
{
FindAccountDialog *facc_dialog = user_data;
@@ -77,25 +73,15 @@ gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data
ENTER(" ");
gnc_unregister_gui_component_by_data (DIALOG_FIND_ACCOUNT_CM_CLASS, facc_dialog);
- if (facc_dialog->dialog)
+ if (facc_dialog->window)
{
- gtk_widget_destroy (facc_dialog->dialog);
- facc_dialog->dialog = NULL;
+ gtk_widget_destroy (facc_dialog->window);
+ facc_dialog->window = NULL;
}
g_free (facc_dialog);
LEAVE(" ");
}
-void
-gnc_find_account_dialog_close_cb (GtkDialog *dialog, gpointer user_data)
-{
- FindAccountDialog *facc_dialog = user_data;
-
- ENTER(" ");
- gnc_close_gui_component_by_data (DIALOG_FIND_ACCOUNT_CM_CLASS, facc_dialog);
- LEAVE(" ");
-}
-
static void
jump_to_account (FindAccountDialog *facc_dialog, Account *jump_account)
{
@@ -103,7 +89,7 @@ jump_to_account (FindAccountDialog *facc_dialog, Account *jump_account)
gnc_plugin_page_account_tree_open (jump_account, GTK_WINDOW(facc_dialog->parent));
if (facc_dialog->jump_close == TRUE)
- gnc_find_account_dialog_close_cb (GTK_DIALOG(facc_dialog->dialog), facc_dialog);
+ gnc_close_gui_component_by_data (DIALOG_FIND_ACCOUNT_CM_CLASS, facc_dialog);
}
static void
@@ -148,26 +134,25 @@ row_double_clicked (GtkTreeView *treeview, GtkTreePath *path,
jump_to_account (facc_dialog, jump_account);
}
-void
-gnc_find_account_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
+static void
+gnc_find_account_dialog_jump_button_cb (GtkWidget * widget, gpointer user_data)
{
FindAccountDialog *facc_dialog = user_data;
+ gnc_find_account_dialog_jump_to (facc_dialog);
+}
- switch (response_id)
- {
- case GTK_RESPONSE_APPLY:
- gnc_find_account_dialog_jump_to (facc_dialog);
- return;
-
- case GTK_RESPONSE_YES:
- gnc_find_account_dialog_jump_set (facc_dialog);
- return;
+static void
+gnc_find_account_dialog_check_button_cb (GtkWidget * widget, gpointer user_data)
+{
+ FindAccountDialog *facc_dialog = user_data;
+ gnc_find_account_dialog_jump_set (facc_dialog);
+}
- case GTK_RESPONSE_CLOSE:
- default:
- gnc_close_gui_component_by_data (DIALOG_FIND_ACCOUNT_CM_CLASS, facc_dialog);
- return;
- }
+static void
+gnc_find_account_dialog_close_button_cb (GtkWidget * widget, gpointer user_data)
+{
+ FindAccountDialog *facc_dialog = user_data;
+ gnc_close_gui_component_by_data (DIALOG_FIND_ACCOUNT_CM_CLASS, facc_dialog);
}
static void
@@ -252,34 +237,29 @@ filter_button_cb (GtkButton *button, FindAccountDialog *facc_dialog)
static void
gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialog)
{
- GtkWidget *dialog;
+ GtkWidget *window;
GtkBuilder *builder;
GtkTreeSelection *selection;
GtkTreeViewColumn *tree_column;
GtkCellRenderer *cr;
+ GtkWidget *button;
ENTER(" ");
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "dialog-find-account.glade", "list-store");
- gnc_builder_add_from_file (builder, "dialog-find-account.glade", "find_account_dialog");
+ gnc_builder_add_from_file (builder, "dialog-find-account.glade", "find_account_window");
- dialog = GTK_WIDGET(gtk_builder_get_object (builder, "find_account_dialog"));
- facc_dialog->dialog = dialog;
+ window = GTK_WIDGET(gtk_builder_get_object (builder, "find_account_window"));
+ facc_dialog->window = window;
// Set the style context for this dialog so it can be easily manipulated with css
- gnc_widget_set_style_context (GTK_WIDGET(dialog), "GncFindAccountDialog");
+ gnc_widget_set_style_context (GTK_WIDGET(window), "GncFindAccountDialog");
facc_dialog->session = gnc_get_current_session();
+ facc_dialog->parent = parent;
- /* parent */
- if (parent != NULL)
- {
- facc_dialog->parent = parent;
- gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent));
- }
- else
- facc_dialog->parent = NULL;
+ gtk_window_set_title (GTK_WINDOW(facc_dialog->window), _("Find Account"));
/* Connect the radio buttons...*/
facc_dialog->radio_root = GTK_WIDGET(gtk_builder_get_object (builder, "radio-root"));
@@ -292,6 +272,13 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
g_signal_connect (facc_dialog->filter_button, "clicked",
G_CALLBACK(filter_button_cb), (gpointer)facc_dialog);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "jumpto_button"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_jump_button_cb), facc_dialog);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "check_button"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_check_button_cb), facc_dialog);
+ button = GTK_WIDGET(gtk_builder_get_object (builder, "close_button"));
+ g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_close_button_cb), facc_dialog);
+
facc_dialog->view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview"));
g_signal_connect (facc_dialog->view, "row-activated",
G_CALLBACK(row_double_clicked), (gpointer)facc_dialog);
@@ -299,9 +286,6 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
// Set grid lines option to preference
gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(facc_dialog->view), gnc_tree_view_get_grid_lines_pref ());
- /* default to 'close' button */
- gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE);
-
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(facc_dialog->view));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
@@ -350,11 +334,17 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
gtk_tree_view_column_set_attributes (tree_column, cr, "icon-name", BAL_ZERO, NULL);
gtk_cell_renderer_set_alignment (cr, 0.5, 0.5);
+
+ g_signal_connect (facc_dialog->window, "destroy",
+ G_CALLBACK(gnc_find_account_dialog_window_destroy_cb), facc_dialog);
+
gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, facc_dialog);
g_object_unref (G_OBJECT(builder));
- gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->dialog));
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window));
+
+ gtk_widget_show_all (GTK_WIDGET(facc_dialog->window));
if (facc_dialog->account != NULL)
{
@@ -368,7 +358,6 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
g_free (sub_label);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(facc_dialog->radio_subroot), TRUE);
- gtk_widget_show_all (facc_dialog->radio_hbox);
}
else
gtk_widget_hide (facc_dialog->radio_hbox);
@@ -377,7 +366,6 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo
gtk_entry_set_text (GTK_ENTRY(facc_dialog->filter_text_entry), "");
get_account_info (facc_dialog);
-
LEAVE(" ");
}
@@ -387,8 +375,8 @@ close_handler (gpointer user_data)
FindAccountDialog *facc_dialog = user_data;
ENTER(" ");
- gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->dialog));
- gtk_widget_destroy (GTK_WIDGET(facc_dialog->dialog));
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window));
+ gtk_widget_destroy (GTK_WIDGET(facc_dialog->window));
LEAVE(" ");
}
@@ -411,7 +399,7 @@ show_handler (const char *klass, gint component_id,
LEAVE("No data strucure");
return(FALSE);
}
- gtk_window_present (GTK_WINDOW(facc_dialog->dialog));
+ gtk_window_present (GTK_WINDOW(facc_dialog->window));
LEAVE(" ");
return(TRUE);
}
@@ -447,7 +435,5 @@ gnc_find_account_dialog (GtkWidget *parent, Account *account)
facc_dialog);
gnc_gui_component_set_session (component_id, facc_dialog->session);
-
- gtk_widget_show (facc_dialog->dialog);
LEAVE(" ");
}
diff --git a/gnucash/gtkbuilder/dialog-find-account.glade b/gnucash/gtkbuilder/dialog-find-account.glade
index 27e0de3..d630dd1 100644
--- a/gnucash/gtkbuilder/dialog-find-account.glade
+++ b/gnucash/gtkbuilder/dialog-find-account.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkListStore" id="list-store">
@@ -18,21 +18,30 @@
<column type="gchararray"/>
</columns>
</object>
- <object class="GtkDialog" id="find_account_dialog">
+ <object class="GtkWindow" id="find_account_window">
<property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="title" translatable="yes">Find Account Dialog</property>
<property name="default_width">600</property>
<property name="default_height">400</property>
- <property name="type_hint">dialog</property>
- <signal name="destroy" handler="gnc_find_account_dialog_window_destroy_cb" swapped="no"/>
- <signal name="response" handler="gnc_find_account_dialog_response_cb" swapped="no"/>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox2">
+ <child>
+ <object class="GtkBox" id="dialog-vbox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_bottom">6</property>
+ <property name="label" translatable="yes"><b>Search the Account List</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButtonBox" id="buttonbox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
@@ -90,20 +99,6 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_bottom">6</property>
- <property name="label" translatable="yes"><b>Search the Account List</b></property>
- <property name="use_markup">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkBox" id="hbox-radio">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -130,7 +125,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">radio-root</property>
</object>
@@ -148,7 +142,7 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="scrollwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
@@ -156,15 +150,16 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="model">list-store</property>
+ <property name="search_column">0</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="treeview-selection1"/>
+ <object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="account_full_name">
<property name="resizable">True</property>
<property name="title" translatable="yes">Account Full Name</property>
<child>
- <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <object class="GtkCellRendererText" id="cellrenderertext"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
@@ -194,11 +189,11 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="hbox2">
+ <object class="GtkBox" id="hbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="label3">
+ <object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -237,7 +232,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label4">
+ <object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -255,7 +250,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Select a row and then press 'jump to' to jump to account in the Account Tree,
@@ -273,10 +268,8 @@ if account should not be shown, this will be temporarily overridden.</property>
</child>
</object>
</child>
- <action-widgets>
- <action-widget response="-8">check_button</action-widget>
- <action-widget response="-10">jumpto_button</action-widget>
- <action-widget response="-6">close_button</action-widget>
- </action-widgets>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
</object>
</interface>
commit 93030c61f110e5fee8a4b1bf792c7a0107fb28f5
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Thu Jul 19 10:10:02 2018 +0100
Bug 796762 - Scrollbar partially hides the delete button in
the Saved Report Configurations window
The vertical scrollbar obscures the delete button in the tree view so
add a dummy blank column to the end and set it to the width of the
vertical scrollbar.
diff --git a/gnucash/gtkbuilder/dialog-custom-report.glade b/gnucash/gtkbuilder/dialog-custom-report.glade
index c7b0411..c5877f1 100644
--- a/gnucash/gtkbuilder/dialog-custom-report.glade
+++ b/gnucash/gtkbuilder/dialog-custom-report.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkDialog" id="custom_report_dialog">
@@ -66,7 +66,7 @@
</packing>
</child>
<child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <object class="GtkScrolledWindow" id="custom_report_sw">
<property name="width_request">300</property>
<property name="height_request">150</property>
<property name="visible">True</property>
@@ -124,5 +124,8 @@ the Reports menu or tool bar.</property>
<action-widgets>
<action-widget response="0">close_report_button</action-widget>
</action-widgets>
+ <child>
+ <placeholder/>
+ </child>
</object>
</interface>
diff --git a/gnucash/report/report-gnome/dialog-custom-report.c b/gnucash/report/report-gnome/dialog-custom-report.c
index d201982..be18149 100644
--- a/gnucash/report/report-gnome/dialog-custom-report.c
+++ b/gnucash/report/report-gnome/dialog-custom-report.c
@@ -73,6 +73,7 @@ typedef struct _CustomReportDialog
GtkTreeViewColumn *runcol;
GtkTreeViewColumn *editcol;
GtkTreeViewColumn *delcol;
+ GtkTreeViewColumn *dummycol;
/* data */
SCM reportlist;
@@ -195,6 +196,7 @@ set_reports_view_and_model(CustomReportDialog *crd)
{
GtkCellRenderer *renderer;
GtkTreeModel *model;
+ gint number_of_columns;
crd->namerenderer = gtk_cell_renderer_text_new();
g_signal_connect (G_OBJECT (crd->namerenderer), "edited",
@@ -227,6 +229,14 @@ set_reports_view_and_model(CustomReportDialog *crd)
NULL);
crd->delcol = gtk_tree_view_get_column (GTK_TREE_VIEW (crd->reportview), VIEW_COL_DELETE);
+ // this is a dummy column which will be set the same width of the vertical scrollbar
+ renderer = gtk_cell_renderer_text_new();
+ number_of_columns = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (crd->reportview), -1,
+ "", renderer,
+ NULL);
+
+ crd->dummycol = gtk_tree_view_get_column (GTK_TREE_VIEW (crd->reportview), number_of_columns -1);
+
model = create_and_fill_report_list(crd);
gtk_tree_view_set_model (GTK_TREE_VIEW (crd->reportview), model);
@@ -495,6 +505,9 @@ gnc_ui_custom_report_internal(GncMainWindow * window)
GtkTreeIter iter;
GtkTreeModel *model;
GtkWidget *no_report_notification;
+ GtkWidget *scroll_window;
+ GtkWidget *vscroll;
+ GtkRequisition nat_sb;
crd = g_new0(CustomReportDialog, 1);
@@ -503,10 +516,18 @@ gnc_ui_custom_report_internal(GncMainWindow * window)
crd->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "custom_report_dialog"));
crd->reportview = GTK_WIDGET(gtk_builder_get_object (builder, "custom_report_list_view"));
+ scroll_window = GTK_WIDGET(gtk_builder_get_object (builder, "custom_report_sw"));
no_report_notification = GTK_WIDGET(gtk_builder_get_object (builder, "label2"));
set_reports_view_and_model(crd);
crd->window = window;
+ // get the vertical scroll bar width
+ vscroll = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (scroll_window));
+ gtk_widget_get_preferred_size (vscroll, NULL, &nat_sb);
+
+ // set the width of the dummy column to that of the scrollbar
+ gtk_tree_view_column_set_fixed_width (crd->dummycol, nat_sb.width);
+
gtk_window_set_transient_for (GTK_WINDOW (crd->dialog), GTK_WINDOW(window));
// Set the style context for this dialog so it can be easily manipulated with css
commit 697d2a166fb83823dd723d5565940e5cf08ed269
Author: Di Mang <DiMan at users.noreply.github.com>
Date: Wed Jul 18 22:08:11 2018 +0200
unify appearance in preferences dialog
The reports and other windows based on GtkNotebooks have currently max. 6 tabs in preferences dialog.
Changing the value MAX_TAB_COUNT to 6 will unify appearance in all such dialogs. But to consider future changes, it would be useful to add a few extra places for new tabs: MAX_TAB_COUNT = 8.
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index 88c3a6f..d224a52 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -74,7 +74,7 @@ static QofLogModule log_module = GNC_MOD_GUI;
* Point where preferences switch control method from a set of
* notebook tabs to a list.
*/
-#define MAX_TAB_COUNT 5
+#define MAX_TAB_COUNT 8
/* A pointer to the last selected filename */
#define LAST_SELECTION "last-selection"
commit fa1b4c685f53c6da1090a9e0a6dee3ff6790d3b7
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 16 14:08:24 2018 -0700
Add jenny to sources for combinatorics testing.
diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
new file mode 100644
index 0000000..721b021
--- /dev/null
+++ b/borrowed/jenny/jenny.c
@@ -0,0 +1,1806 @@
+/*
+-------------------------------------------------------------------------------
+By Bob Jenkins, March 2003. Public domain.
+
+jenny.c -- jennyrate tests from m dimensions of features that cover all
+ n-tuples of features, n <= m, with each feature chosen from a different
+ dimension. For example, given 10 dimensions (m=10) with 2 to 8 features
+ apiece, cover all feature triplets (n=3). A lower bound on the number
+ of tests required is the product of the sizes of the largest n dimensions.
+ Already-written tests can be piped in to be reused.
+
+Arguments
+ Arguments without a leading '-' : an integer in 2..52. Represents a
+ dimension. Dimensions are implicitly numbered 1..65535, in the
+ order they appear. Features in dimensions are always implicitly
+ given 1-character names, which are in order a..z, A..Z . It's a
+ good idea to pass the output of jenny through a postprocessor that
+ expands these names into something intelligible.
+
+ -o : old. -ofoo.txt reads existing tests from the file foo.txt, includes
+ those tests in the output, and adds whatever other tests are needed to
+ complete coverage. An error is reported if the input tests are of the
+ wrong shape or contain disallowed feature interactions. If you have
+ added new dimensions since those tests were written, be sure to include
+ a do-nothing feature in each new dimension, then pad the existing tests
+ with do-nothing out to the correct number of dimensions.
+
+ -h : help. Print out instructions for using jenny.
+
+ -n : an integer. Cover all n-tuples of features, one from each dimension.
+ Default is 2 (pairs). 3 (triplets) may be reasonable. 4 (quadruplets)
+ is definitely overkill. n > 4 is highly discouraged.
+
+ -s : seed. An integer. Seed the random number generator.
+
+ -w : without this combination of features. A feature is given by a dimension
+ number followed by a one-character feature name. A single -w can
+ disallow multiple features in a dimension. For example, -w1a2cd4ac
+ disallows the combinations (1a,2c,4a),(1a,2c,4c),(1a,2d,4a),(1a,2d,4c)
+ where 1a represents the first dimension's first feature, 2c is the
+ second dimension's third feature, and 4a is the fourth dimension's
+ first feature.
+
+Example: 10 dimensions of 2, 3, 8, 3, 2, 2, 5, 3, 2, 2 features apiece,
+with some restrictions, asking for all triplets of features to be covered.
+This will produce at least 8*5*3=120 tests. Splitting the 8 features in the
+third dimension into three dimensions each of length 2 would reduce the
+number of testcases required to at least 5*3*3=45.
+
+ jenny -n3 2 3 8 -w1a2bc3b -w1b3a 3 -w1a4b 2 2 5 3 2 2 -w9a10b -w3a4b -s3
+-------------------------------------------------------------------------------
+*/
+
+#include <stdio.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+-------------------------------------------------------------------------------
+Implementation:
+
+Internally, there can be 64K dimensions with 64K features apiece. Externally,
+the number of features per dimensions is limited to just 52, and are implicitly
+named a..z, A..Z. Other printable characters, like |, caused trouble in the
+shell when I tried to give them during a without.
+
+The program first finds tests for all features, then adds tests to cover
+all pairs of features, then all triples of features, and so forth up to
+the tuples size the user asked for.
+-------------------------------------------------------------------------------
+*/
+
+/*
+-------------------------------------------------------------------------------
+Structures
+-------------------------------------------------------------------------------
+*/
+
+typedef unsigned char ub1;
+typedef char sb1;
+typedef unsigned short ub2;
+typedef signed short sb2;
+typedef unsigned long ub4;
+typedef signed long sb4;
+typedef unsigned long long ub8;
+typedef signed long long sb8;
+#define TRUE 1
+#define FALSE 0
+#define UB4MAXVAL 0xffffffff
+#define UB2MAXVAL 0xffff
+
+/*
+-------------------------------------------------------------------------------
+Random number stuff
+-------------------------------------------------------------------------------
+*/
+
+#define FLEARAND_SIZE 256
+typedef struct flearandctx {
+ ub4 b,c,d,z; /* special memory */
+ ub4 m[FLEARAND_SIZE]; /* big random pool of memory */
+ ub4 r[FLEARAND_SIZE]; /* results */
+ ub4 q; /* counter, which result of r was last reported */
+} flearandctx;
+
+/* Pseudorandom numbers, courtesy of FLEA */
+void flearand_batch( flearandctx *x) {
+ ub4 a, b=x->b, c=x->c+(++x->z), d=x->d, i, *m=x->m, *r=x->r;
+ for (i=0; i<FLEARAND_SIZE; ++i) {
+ a = m[b % FLEARAND_SIZE];
+ m[b % FLEARAND_SIZE] = d;
+ d = (c<<19) + (c>>13) + b;
+ c = b ^ m[i];
+ b = a + d;
+ r[i] = c;
+ }
+ x->b=b; x->c=c; x->d=d;
+}
+
+ub4 flearand( flearandctx *x) {
+ if (!x->q--) {
+ x->q = FLEARAND_SIZE-1;
+ flearand_batch(x);
+ }
+ return x->r[x->q];
+}
+
+void flearand_init( flearandctx *x, ub4 seed) {
+ ub4 i;
+
+ x->b = x->c = x->d = x->z = seed;
+ for (i = 0; i<FLEARAND_SIZE; ++i) {
+ x->m[i] = seed;
+ }
+ for (i=0; i<10; ++i) {
+ flearand_batch(x);
+ }
+ x->q = 0;
+}
+
+
+
+
+/*
+------------------------------------------------------------------------------
+Other helper routines
+------------------------------------------------------------------------------
+*/
+
+#define TUPLE_ARRAY 5040 /* tuple array size, multiple of 1,2,3,4,5,6 */
+
+/* An arbitrary feature, prefix fe */
+typedef struct feature {
+ ub2 d; /* Dimension name */
+ ub2 f; /* Feature name */
+} feature;
+
+/* a tuple array, prefix tu */
+typedef struct tu_arr {
+ struct tu_arr *next; /* next tuple array */
+ ub2 len; /* length of this array */
+ feature fe[TUPLE_ARRAY]; /* array of tuples */
+} tu_arr;
+
+/* an iterator over a tuple array, prefix tu */
+typedef struct tu_iter {
+ struct tu_arr **tu; /* current tuple array */
+ ub2 offset; /* offset of current tuple */
+ ub2 n; /* number of features per tuple */
+ ub4 *count; /* number of tuples in list */
+ feature *fe; /* current tuple */
+} tu_iter;
+
+/* names of features, for output */
+static const char feature_name[] =
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+
+
+/*
+------------------------------------------------------------------------------
+Stuff specific to jenny
+------------------------------------------------------------------------------
+*/
+
+#define MAX_FEATURES 52 /* can't name more than 52 features */
+#define MAX_TESTS 65534 /* arbitrary limit on number of testcases */
+#define MAX_N 32 /* never can do complete coverage of 33-tuples */
+#define MAX_WITHOUT (MAX_FEATURES*MAX_N) /* max features in a without */
+#define MAX_DIMENSIONS (((ub2)~0)-1) /* More than 64K dimensions needs a ub4 */
+
+/* A "test", which is a combination of features. Prefix t. */
+typedef struct test {
+ ub2 *f; /* features in this test */
+} test;
+
+/* representation of a restriction, prefix w */
+typedef struct without {
+ ub2 len; /* length of feature array */
+ struct feature *fe; /* feature array */
+} without;
+
+/* without chain */
+typedef struct wchain {
+ without *w;
+ struct wchain *next;
+} wchain;
+
+
+/* Return a count of how many withouts are disobeyed. */
+/* Also set a pointer to a randomly chosen violated without */
+int count_withouts(
+test *t, /* test to check */
+wchain *wc) /* restrictions */
+{
+ ub4 count; /* count of disobeyed withouts */
+
+ for (count = 0; wc; wc = wc->next) {
+ without *w = wc->w;
+ ub4 i = 0;
+ int match = TRUE; /* match the entire restriction */
+ while (i<w->len) {
+ int dimension_match = FALSE; /* match in this dimension */
+ do {
+ if (t->f[w->fe[i].d] == w->fe[i].f) {
+ dimension_match = TRUE;
+ }
+ ++i;
+ } while (i<w->len && (w->fe[i].d == w->fe[i-1].d));
+ if (!dimension_match) {
+ match = FALSE;
+ break;
+ }
+ }
+ if (match) {
+ ++count;
+ }
+ }
+ return count;
+}
+
+
+/* token definitions */
+typedef enum token_type {
+ TOKEN_ERROR = 0, /* TOKEN_ERROR has to be 0 */
+ TOKEN_END,
+ TOKEN_NUMBER,
+ TOKEN_FEATURE,
+ TOKEN_SPACE
+} token_type;
+
+
+/* whole current state, prefix s */
+typedef struct state {
+ ub1 n_final; /* The n in the user's n-tuples, default is 2 */
+ ub2 ndim; /* number of dimensions */
+ ub2 ntests; /* number of testcases in t */
+ ub1 **n; /* n[d][f] is current n-tuple size for dimension d feature f */
+ test **t; /* all the tests generated so far */
+ ub2 *dim; /* number of features in each dimension */
+ wchain **wc; /* s->wc[d] lists withouts for dimension d */
+ wchain *wc2; /* a list of all the original withouts */
+ wchain *wc3; /* additional, deduced withouts */
+ tu_arr ***tu; /* tu[d][f] lists untested tuples for dimension d feature f */
+ tu_arr ***one;
+ /* one[testcase][d] lists tuples with d covered only by this testcase */
+ ub4 **onec; /* onec[testcase][d] is count of one[testcase][d] */
+ ub4 **used;
+ /* used[testcase][d] = pass# if this pass has already explored test[t][d] */
+ ub4 **tc; /* tc[d][f] is # untested tulpes for dimension d feature f */
+ test *tuple_tester; /* an all -1 test used to test individual tuples */
+ ub2 *dimord; /* order in which to choose dimensions */
+ ub2 *featord; /* order in which to choose features */
+ flearandctx r; /* random number context */
+} state;
+
+
+void my_free( char *x)
+{
+ free(x);
+}
+
+/* zero out a list of tuples */
+void truncate_tuple( tu_arr **tu, ub4 *count)
+{
+ while (*tu) {
+ tu_arr *tu2 = *tu;
+ *tu = ((*tu)->next);
+ my_free((char *)tu2);
+ }
+ *count = 0;
+}
+
+/* delete the i-th test */
+void delete_test( state *s, ub4 i)
+{
+ test *t = s->t[i];
+
+ s->t[i] = s->t[--s->ntests];
+ my_free((char *)t->f);
+ my_free((char *)t);
+ if (s->one[s->ntests]) {
+ ub2 d;
+ for (d=0; d<s->ndim; ++d) {
+ truncate_tuple(&s->one[s->ntests][d], &s->onec[s->ntests][d]);
+ }
+ my_free((char *)s->one[s->ntests]);
+ my_free((char *)s->onec[s->ntests]);
+ s->one[s->ntests] = (tu_arr **)0;
+ s->onec[s->ntests] = (ub4 *)0;
+ }
+}
+
+void cleanup(state *s)
+{
+ if (s->tu) {
+ ub2 d,f;
+ for (d=0; d<s->ndim; ++d) {
+ if (s->tu[d]) {
+ for (f=0; f<s->dim[d]; ++f) {
+ truncate_tuple(&s->tu[d][f], &s->tc[d][f]);
+ }
+ my_free((char *)s->tu[d]);
+ }
+ }
+ my_free((char *)s->tu);
+ }
+
+ /* free n, the tuple lengths */
+ if (s->n) {
+ ub2 d;
+ for (d=0; d<s->ndim; ++d) {
+ if (s->n[d]) {
+ my_free((char *)s->n[d]);
+ }
+ }
+ my_free((char *)s->n);
+ }
+
+ /* free tc, count of uncovered tuples */
+ if (s->tc) {
+ ub2 d;
+ for (d=0; d<s->ndim; ++d) {
+ if (s->tc[d]) {
+ my_free((char *)s->tc[d]);
+ }
+ }
+ my_free((char *)s->tc);
+ }
+
+ /* free the secondary chains of restrictions */
+ if (s->wc) {
+ ub2 i;
+ for (i=0; i<s->ndim; ++i) {
+ while (s->wc[i]) {
+ wchain *wc = s->wc[i];
+ s->wc[i] = s->wc[i]->next;
+ my_free((char *)wc);
+ }
+ }
+ my_free((char *)s->wc);
+ }
+
+ /* free all the actual restrictions */
+ while (s->wc2) {
+ wchain *wc = s->wc2;
+ without *w = wc->w;
+ s->wc2 = s->wc2->next;
+ if (w->fe) my_free((char *)w->fe);
+ my_free((char *)w);
+ my_free((char *)wc);
+ }
+
+ while (s->wc3) {
+ wchain *wc = s->wc3;
+ without *w = wc->w;
+ s->wc3 = s->wc3->next;
+ if (w->fe) my_free((char *)w->fe);
+ my_free((char *)w);
+ my_free((char *)wc);
+ }
+
+ if (s->t) {
+ while (s->ntests) {
+ delete_test(s, 0);
+ }
+ my_free((char *)s->t);
+ }
+
+ if (s->one) {
+ my_free((char *)s->one);
+ }
+
+ if (s->onec) {
+ my_free((char *)s->onec);
+ }
+
+ if (s->tuple_tester) {
+ if (s->tuple_tester->f) {
+ my_free((char *)s->tuple_tester->f);
+ }
+ my_free((char *)s->tuple_tester);
+ }
+
+ if (s->dimord) {
+ my_free((char *)s->dimord);
+ }
+
+ if (s->featord) {
+ my_free((char *)s->featord);
+ }
+
+ /* free the array of dimension lengths */
+ if (s->dim) my_free((char *)s->dim);
+}
+
+
+char *my_alloc( state *s, size_t len)
+{
+ char *rsl;
+ if (!(rsl = (char *)malloc(len+sizeof(size_t)))) {
+ printf("jenny: could not allocate space\n");
+ cleanup(s);
+ exit(0);
+ }
+ memset(rsl, 0x00, len);
+ return rsl;
+}
+
+/* insert a tuple into a tuple array */
+int insert_tuple( state *s, tu_iter *ctx, feature *tuple)
+{
+ ub4 i;
+ feature *fe;
+ ub1 n = ctx->n;
+ ub4 lim = TUPLE_ARRAY / n;
+
+ while (*ctx->tu && (*ctx->tu)->len == lim) {
+ ctx->tu = &((*ctx->tu)->next);
+ }
+ if (!*ctx->tu) {
+ if (!((*ctx->tu) = (tu_arr *)my_alloc(s, sizeof(tu_arr)))) {
+ return FALSE;
+ }
+ (*ctx->tu)->len = 0;
+ (*ctx->tu)->next = (tu_arr *)0;
+ }
+ fe = &(*ctx->tu)->fe[(*ctx->tu)->len*n];
+ for (i=0; i<n; ++i) {
+ fe[i].d = tuple[i].d;
+ fe[i].f = tuple[i].f;
+ }
+ ++(*ctx->tu)->len;
+ ++*ctx->count;
+ return TRUE;
+}
+
+/* print out a single tuple */
+void show_tuple( feature *fe, ub2 len)
+{
+ ub4 i;
+ for (i=0; i<len; ++i) {
+ printf(" %d%c", fe[i].d+1, feature_name[fe[i].f]);
+ }
+ printf(" \n");
+}
+
+/* delete a tuple from a tuple array */
+feature *delete_tuple( tu_iter *ctx)
+{
+ feature *fe;
+ ub4 i;
+ feature *tuple = ctx->fe;
+ ub1 n = ctx->n;
+
+ --(*ctx->tu)->len;
+ --*ctx->count;
+ fe = &(*ctx->tu)->fe[(*ctx->tu)->len * n];
+ for (i=0; i<n; ++i) {
+ tuple[i].d = fe[i].d;
+ tuple[i].f = fe[i].f;
+ }
+ if (!(*ctx->tu)->len) {
+ tu_arr *tu2 = *ctx->tu;
+ *ctx->tu = ((*ctx->tu)->next);
+ my_free((char *)tu2);
+ }
+
+ if (!*ctx->tu) { /* freed the last block */
+ ctx->offset = 0;
+ ctx->fe = (feature *)0;
+ return ctx->fe;
+ } else if (tuple == fe) {
+ ctx->offset = 0;
+ ctx->fe = &(*ctx->tu)->fe[0]; /* freed this block, move to next */
+ return ctx->fe;
+ } else {
+ return tuple; /* moved a new tuple into the old location */
+ }
+}
+
+/* start a tuple iterator */
+feature *start_tuple( tu_iter *ctx, tu_arr **tu, ub4 n, ub4 *count)
+{
+ ctx->tu = tu;
+ ctx->offset = 0;
+ ctx->n = n;
+ ctx->count = count;
+
+ if (*tu) {
+ ctx->fe = (*tu)->fe;
+ } else {
+ ctx->fe = (feature *)0;
+ }
+ return ctx->fe;
+}
+
+/* get the next tuple from a tuple iterator (0 if no more tuples) */
+static feature *next_tuple( tu_iter *ctx)
+{
+ if (++ctx->offset < (*ctx->tu)->len) {
+ ctx->fe += ctx->n;
+ } else {
+ ctx->tu = &(*ctx->tu)->next;
+ ctx->offset = 0;
+ if (*ctx->tu && (*ctx->tu)->len) {
+ ctx->fe = (*ctx->tu)->fe;
+ } else {
+ ctx->fe = (feature *)0;
+ }
+ }
+ return ctx->fe;
+}
+
+
+/* test if this test covers this tuple */
+static int test_tuple( ub2 *test, feature *tuple, ub2 n)
+{
+ sb4 i;
+ for (i=0; i<n; ++i) {
+ if (tuple[i].f != test[tuple[i].d]) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+/* test if first tuple (t1, n1) is a subset of second tuple (t2, n2) */
+int subset_tuple( feature *t1, ub1 n1, feature *t2, ub1 n2)
+{
+ sb4 i, j;
+ if (n2 < n1)
+ return FALSE;
+ for (i=0, j=0; i<n1; ++i) {
+ while (t1[i].d > t2[j].d) {
+ if (++j == n2)
+ return FALSE;
+ }
+ if (t1[i].d != t2[j].d || t1[i].f != t2[j].f) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+void initialize( state *s)
+{
+ /* make all freeable pointers start out zero */
+ s->dim = (ub2 *)0;
+ s->wc = (wchain **)0;
+ s->wc2 = (wchain *)0;
+ s->wc3 = (wchain *)0;
+ s->tu = (tu_arr ***)0;
+ s->one = (tu_arr ***)0;
+ s->onec = (ub4 **)0;
+ s->n = (ub1 **)0;
+ s->tc = (ub4 **)0;
+ s->t = (test **)0;
+ s->tuple_tester = (test *)0;
+ s->dimord = (ub2 *)0;
+ s->featord = (ub2 *)0;
+
+ /* fill in default values */
+ s->ndim = (ub2)0;
+ s->n_final = 2; /* guarantees that all pairs of dimensions are covered */
+ s->ntests = 0;
+ flearand_init(&s->r, 0); /* initialize random number generator */
+}
+
+
+/* add one test to the list of tests */
+int add_test( state *s, test *t)
+{
+ ub4 i;
+ if (s->ntests == MAX_TESTS) {
+ return FALSE;
+ }
+ s->one[s->ntests] = (tu_arr **)my_alloc(s, sizeof(tu_arr *)*s->ndim);
+ s->onec[s->ntests] = (ub4 *)my_alloc(s, sizeof(ub4)*s->ndim);
+ for (i=0; i<s->ndim; ++i) {
+ s->one[s->ntests][i] = (tu_arr *)0;
+ s->onec[s->ntests][i] = 0;
+ }
+ s->t[s->ntests++] = t;
+ return TRUE;
+}
+
+/*
+ * parse a token
+ * Start at *curr in string *inp of length inl
+ * Adjust *curr to be after the just-parsed token
+ * Place the token value in *rsl
+ * Return the token type
+ */
+token_type parse_token(char *inp, ub4 inl, ub4 *curr, ub4 *rsl)
+{
+ char mychar;
+ ub4 i;
+
+ if (*curr == inl)
+ return TOKEN_END;
+ mychar = inp[*curr];
+
+ if (mychar == '\0') {
+ return TOKEN_END;
+ } else if (mychar == ' ' || mychar == '\t' || mychar == '\n') {
+ /*--------------------------------------------------------- parse spaces */
+ for (i=*curr+1; i < inl; ++i) {
+ mychar = inp[i];
+ if (!(mychar == ' ' || mychar == '\t' || mychar == '\n'))
+ break;
+ }
+ *curr = i;
+ return TOKEN_SPACE;
+ } else if (mychar >= '0' && mychar <= '9') {
+ /*------------------------------------------------------- parse a number */
+ ub4 i, number = 0;
+ for (i=*curr; i < inl && inp[i] >= '0' && inp[i] <= '9'; ++i) {
+ number = number*10 + (inp[i] - '0');
+ }
+ *curr = i;
+ *rsl = number;
+ return TOKEN_NUMBER;
+ } else if ((mychar >= 'a' && mychar <= 'z') ||
+ (mychar >= 'A' && mychar <= 'Z')) {
+ /*------------------------------------------------- parse a feature name */
+ ub4 i;
+ for (i=0; i<MAX_FEATURES; ++i)
+ if (feature_name[i] == mychar)
+ break;
+ if (i == MAX_FEATURES) {
+ printf("jenny: the name '%c' is not used for any feature\n",
+ mychar);
+ return TOKEN_ERROR;
+ }
+ *rsl = i;
+ ++*curr;
+ return TOKEN_FEATURE;
+ } else {
+ return TOKEN_ERROR;
+ }
+}
+
+#define BUFSIZE (MAX_DIMENSIONS*7+2)
+/* load old tests before generating new ones */
+int load( state *s, char *testfile)
+{
+ char buf[BUFSIZE]; /* buffer holding a line read from the file */
+ FILE *f;
+
+ if (testfile[0] == '\0') {
+ f = stdin;
+ } else {
+ f = fopen(testfile, "r");
+ }
+
+ if (!f) {
+ printf("jenny: file %s could not be opened\n", testfile);
+ return FALSE;
+ }
+
+ while (fgets(buf, BUFSIZE, f) && (buf[0] != '.')) {
+ ub4 curr = 0; /* current offset into buf */
+ ub4 value; /* token value */
+ token_type token; /* token type */
+ ub4 i;
+ test *t;
+
+ t = (test *)my_alloc( s, sizeof(test));
+ t->f = (ub2 *)my_alloc( s, sizeof(ub2)*s->ndim);
+ if (!add_test(s, t)) {
+ goto failure;
+ }
+
+ for (i=0; i<s->ndim; ++i) {
+ if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_SPACE) {
+ printf("jenny: -o, non-space found where space expected\n");
+ goto failure;
+ }
+ if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_NUMBER) {
+ printf("jenny: -o, non-number found where number expected\n");
+ goto failure;
+ }
+ if (value-1 != i) {
+ printf("jenny: -o, number %d found out-of-place\n", value);
+ goto failure;
+ }
+ if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_FEATURE) {
+ printf("jenny: -o, non-feature found where feature expected\n");
+ goto failure;
+ }
+ if (value >= s->dim[i]) {
+ printf("jenny: -o, feature %c does not exist in dimension %d\n",
+ feature_name[value], i+1);
+ goto failure;
+ }
+ t->f[i] = value;
+ }
+ if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_SPACE) {
+ printf("jenny: -o, non-space found where trailing space expected\n");
+ goto failure;
+ }
+ if (parse_token(buf, UB4MAXVAL, &curr, &value) != TOKEN_END) {
+ printf("jenny: -o, testcase not properly terminated\n");
+ goto failure;
+ }
+
+ /* make sure the testcase obeys all the withouts */
+ if (count_withouts(t, s->wc2)) {
+ printf("jenny: -o, old testcase contains some without\n");
+ goto failure;
+ }
+ }
+
+ (void)fclose(f);
+ return TRUE;
+
+ failure:
+ while (fgets(buf, BUFSIZE, f) && (buf[0] != '.'))
+ ; /* finish reading the input */
+ (void)fclose(f); /* close the file */
+ return FALSE;
+}
+
+static const sb1 *jenny_doc[] = {
+ "jenny:\n",
+ " Given a set of feature dimensions and withouts, produce tests\n",
+ " covering all n-tuples of features where all features come from\n",
+ " different dimensions. For example (=, <, >, <=, >=, !=) is a\n",
+ " dimension with 6 features. The type of the left-hand argument is\n",
+ " another dimension. Dimensions are numbered 1..65535, in the order\n",
+ " they are listed. Features are implicitly named a..z, A..Z.\n",
+ " 3 Dimensions are given by the number of features in that dimension.\n",
+ " -h prints out these instructions.\n",
+ " -n specifies the n in n-tuple. The default is 2 (meaning pairs).\n",
+ " -w gives withouts. -w1b4ab says that combining the second feature\n",
+ " of the first dimension with the first or second feature of the\n",
+ " fourth dimension is disallowed.\n",
+ " -ofoo.txt reads old jenny testcases from file foo.txt and extends them.",
+ "\n\n",
+ " The output is a testcase per line, one feature per dimension per\n",
+ " testcase, followed by the list of all allowed tuples that jenny could\n",
+ " not reach.\n",
+ "\n",
+ " Example: jenny -n3 3 2 2 -w2b3b 5 3 -w1c3b4ace5ac 8 2 2 3 2\n",
+ " This gives ten dimensions, asks that for any three dimensions all\n",
+ " combinations of features (one feature per dimension) be covered,\n",
+ " plus it asks that certain combinations of features\n",
+ " (like (1c,3b,4c,5c)) not be covered.\n",
+ "\n"
+};
+
+
+/* parse -n, the tuple size */
+int parse_n( state *s, char *myarg)
+{
+ ub4 curr = 0;
+ ub4 temp = UB4MAXVAL;
+ token_type token;
+ ub4 dummy;
+
+ if ((token=parse_token(myarg, UB4MAXVAL, &curr, &temp)) != TOKEN_NUMBER) {
+ printf("jenny: -n should give an integer in 1..32, for example, -n2.\n");
+ return FALSE;
+ }
+ if ((token=parse_token(myarg, UB4MAXVAL, &curr, &dummy)) != TOKEN_END) {
+ printf("jenny: -n should be followed by just an integer\n");
+ return FALSE;
+ }
+
+ if ((temp < 1) || (temp > 32)) {
+ printf("jenny: -n says all n-tuples should be covered.\n");
+ return FALSE;
+ }
+ if (temp > s->ndim) {
+ printf("jenny: -n, %ld-tuples are impossible with only %d dimensions\n",
+ temp, s->ndim);
+ return FALSE;
+ }
+ s->n_final = (ub2)temp;
+ return TRUE;
+}
+
+
+
+/* parse -w, a without */
+int parse_w( state *s, sb1 *myarg)
+{
+ without *w;
+ wchain *wc;
+ feature fe[MAX_WITHOUT];
+ ub1 used[MAX_DIMENSIONS];
+ ub4 dimension_number;
+ ub4 curr = 0;
+ ub4 fe_len, value;
+ ub4 i, j, k;
+ size_t len = strlen(myarg);
+ token_type t = parse_token(myarg, len, &curr, &value);
+
+ for (i=0; i<s->ndim; ++i)
+ used[i] = FALSE;
+ if (t != TOKEN_NUMBER) {
+ printf("jenny: -w is <number><features><number><features>...\n");
+ printf("jenny: -w must start with an integer (1 to #dimensions)\n");
+ return FALSE;
+ }
+ fe_len=0;
+
+ number:
+ dimension_number = --value;
+ if (dimension_number >= s->ndim) {
+ printf("jenny: -w, dimension %ld does not exist, ", dimension_number+1);
+ printf("you gave only %d dimensions\n", s->ndim);
+ return FALSE;
+ }
+ if (used[dimension_number]) {
+ printf("jenny: -w, dimension %d was given twice in a single without\n",
+ dimension_number+1);
+ return FALSE;
+ }
+ used[dimension_number] = TRUE;
+
+
+ switch (parse_token(myarg, len, &curr, &value)) {
+ case TOKEN_FEATURE: goto feature;
+ case TOKEN_END:
+ printf("jenny: -w, withouts must follow numbers with features\n");
+ return FALSE;
+ default:
+ printf("jenny: -w, unexpected without syntax\n");
+ printf("jenny: proper withouts look like -w2a1bc99a\n");
+ return FALSE;
+ }
+
+ feature:
+ if (value >= s->dim[dimension_number]) {
+ printf("jenny: -w, there is no feature '%c' in dimension %d\n",
+ feature_name[value], dimension_number+1);
+ return FALSE;
+ }
+ fe[fe_len].d = dimension_number;
+ fe[fe_len].f = value;
+ if (++fe_len >= MAX_WITHOUT) {
+ printf("jenny: -w, at most %d features in a single without\n",
+ MAX_WITHOUT);
+ return FALSE;
+ }
+
+
+ switch (parse_token(myarg, len, &curr, &value)) {
+ case TOKEN_FEATURE: goto feature;
+ case TOKEN_NUMBER: goto number;
+ case TOKEN_END: goto end;
+ default:
+ printf("jenny: -w, unexpected without syntax\n");
+ printf("jenny: proper withouts look like -w2a1bc99a\n");
+ return FALSE;
+ }
+
+ end:
+
+ /* sort the dimensions and features in this restriction */
+ for (i=0; i<fe_len; ++i) {
+ for (j=i+1; j<fe_len; ++j) {
+ if ((fe[i].d > fe[j].d) ||
+ ((fe[i].d == fe[j].d) && (fe[i].f > fe[j].f))) {
+ ub2 fe_temp;
+ fe_temp = fe[i].d;
+ fe[i].d = fe[j].d;
+ fe[j].d = fe_temp;
+ fe_temp = fe[i].f;
+ fe[i].f = fe[j].f;
+ fe[j].f = fe_temp;
+ }
+ }
+ }
+
+ /* allocate a without */
+ w = (without *)my_alloc( s, sizeof(without));
+ wc = (wchain *)my_alloc( s, sizeof(wchain));
+ wc->next = s->wc2;
+ wc->w = w;
+ w->len = fe_len;
+ w->fe = (feature *)my_alloc( s, sizeof(feature)*fe_len);
+ for (i=0; i<fe_len; ++i) {
+ w->fe[i].d = fe[i].d;
+ w->fe[i].f = fe[i].f;
+ }
+ s->wc2 = wc;
+
+ return TRUE;
+}
+
+/* parse -s, a seed for the random number generator */
+int parse_s( state *s, sb1 *myarg)
+{
+ ub4 seed = 0;
+ ub4 dummy = 0;
+ ub4 curr = 0;
+ if (parse_token( myarg, UB4MAXVAL, &curr, &seed) != TOKEN_NUMBER) {
+ printf("jenny: -s must be followed by a positive integer\n");
+ return FALSE;
+ }
+ if (parse_token( myarg, UB4MAXVAL, &curr, &dummy) != TOKEN_END) {
+ printf("jenny: -s should give just an integer, example -s123\n");
+ return FALSE;
+ }
+ flearand_init(&s->r, seed); /* initialize random number generator */
+ return TRUE;
+}
+
+void preliminary( state *s)
+{
+ wchain *wc;
+ ub4 d;
+
+ s->tuple_tester = (test *)my_alloc( s, sizeof(test));
+ s->tuple_tester->f = (ub2 *)my_alloc( s, sizeof(ub2)*s->ndim);
+ s->dimord = (ub2 *)my_alloc( s, sizeof(ub2)*s->ndim);
+ s->wc = (wchain **)my_alloc( s, sizeof(wchain *)*s->ndim);
+ s->tu = (tu_arr ***)my_alloc( s, sizeof(tu_arr **)*s->ndim);
+ s->one = (tu_arr ***)my_alloc( s, sizeof(tu_arr **)*MAX_TESTS);
+ s->n = (ub1 **)my_alloc( s, sizeof(ub1 *)*s->ndim);
+ s->onec = (ub4 **)my_alloc( s, sizeof(ub4 *)*MAX_TESTS);
+ s->tc = (ub4 **)my_alloc( s, sizeof(ub4 *)*s->ndim);
+ s->t = (test **)my_alloc( s, sizeof(test *)*MAX_TESTS);
+
+ /* initialize to safe values before doing further allocations */
+ for (d=0; d<s->ndim; ++d) {
+ s->tuple_tester->f[d] = (ub2)~0;
+ s->dimord[d] = (ub2)d;
+ s->wc[d] = (wchain *)0;
+ s->tu[d] = (tu_arr **)0;
+ s->n[d] = (ub1 *)0;
+ s->tc[d] = (ub4 *)0;
+ }
+
+ s->featord = (ub2 *)my_alloc( s, sizeof(ub2)*MAX_FEATURES);
+
+ /* allocate roots for feature-specific lists of uncovered tuples */
+ for (d=0; d<s->ndim; ++d) {
+ ub2 f;
+ s->tu[d] = (tu_arr **)my_alloc( s, sizeof(tu_arr *)*s->dim[d]);
+ s->n[d] = (ub1 *)my_alloc(s, sizeof(ub1)*s->dim[d]);
+ s->tc[d] = (ub4 *)my_alloc(s, sizeof(ub4)*s->dim[d]);
+ for (f=0; f<s->dim[d]; ++f) {
+ s->tu[d][f] = (tu_arr *)0;
+ s->n[d][f] = 0;
+ s->tc[d][f] = 0;
+ }
+ }
+
+ /* make dimension-specific lists of withouts */
+ for (wc=s->wc2; wc; wc=wc->next) {
+ without *w = wc->w;
+ int old = -1;
+ int i;
+ for (i=0; i<w->len; ++i) {
+ if (w->fe[i].d != old) {
+ wchain *wcx = (wchain *)my_alloc( s, sizeof(wchain));
+ wcx->w = w;
+ wcx->next = s->wc[w->fe[i].d];
+ s->wc[w->fe[i].d] = wcx;
+ old = w->fe[i].d;
+ }
+ }
+ }
+}
+
+/* parse the inputs */
+int parse( int argc, char *argv[], state *s)
+{
+ int i, j;
+ ub4 temp;
+ char *testfile = (char *)0;
+
+ /* internal check: we have MAX_FEATURES names for features */
+ if (strlen(feature_name) != MAX_FEATURES) {
+ printf("feature_name length is wrong, %d\n", strlen(feature_name));
+ return FALSE;
+ }
+
+ /* How many dimensions are there? Set ndim, allocate space for dim. */
+ for (temp=0, i=1; i<argc; ++i) {
+ if (argv[i][0] >= '0' && argv[i][0] <= '9') {
+ ++temp;
+ }
+ }
+ if (temp > MAX_DIMENSIONS) {
+ printf("jenny: maximum number of dimensions is %ld. %ld is too many.\n",
+ MAX_DIMENSIONS, temp);
+ return FALSE;
+ }
+ s->ndim = (ub2)temp;
+ s->dim = (ub2 *)my_alloc( s, sizeof(ub2)*(s->ndim));
+
+ /* Read the lengths of all the dimensions */
+ for (i=1, j=0; i<argc; ++i) {
+ if (argv[i][0] >= '0' && argv[i][0] <= '9') { /* dimension length */
+ sb1 *myarg = argv[i];
+ ub4 dummy;
+ ub4 curr = 0;
+
+ (void)parse_token(myarg, UB4MAXVAL, &curr, &temp);
+ if (parse_token(myarg, UB4MAXVAL, &curr, &dummy) != TOKEN_END) {
+ printf("jenny: something was trailing a dimension number\n");
+ return FALSE;
+ }
+ if (temp > MAX_FEATURES) {
+ printf("jenny: dimensions must be smaller than %d. %ld is too big.\n",
+ MAX_FEATURES, temp);
+ return FALSE;
+ }
+ if (temp < 2) {
+ printf("jenny: a dimension must have at least 2 features, not %d\n",
+ temp);
+ return FALSE;
+ }
+ s->dim[j++] = (ub2)temp;
+ } else if (argv[i][1] == 'h') {
+ int i;
+ for (i=0; i<(sizeof(jenny_doc)/sizeof(ub1 *)); ++i) {
+ printf(jenny_doc[i]);
+ }
+ return FALSE;
+ }
+ }
+
+ /* Read the rest of the arguments */
+ for (i=1; i<argc; ++i) if (argv[i][0] == '-') { /* dimension length */
+ switch(argv[i][1]) {
+ case '\0':
+ printf("jenny: '-' by itself isn't a proper argument.\n");
+ return FALSE;
+ case 'o': /* -o, file containing old tests */
+ testfile = &argv[i][2];
+ break;
+ case 'n': /* -n, get the n of "cover all n-tuples" */
+ if (!parse_n( s, &argv[i][2])) return FALSE;
+ break;
+ case 'w': /* -w, "without", a restriction */
+ if (!parse_w( s, &argv[i][2])) return FALSE;
+ break;
+ case 's': /* -s, "random", change the behavior */
+ if (!parse_s( s, &argv[i][2])) return FALSE;
+ break;
+ default:
+ printf("jenny: legal arguments are numbers, -n, -s, -w, -h, not -%c\n",
+ argv[i][1]);
+ return FALSE;
+ }
+ } /* for (each argument) if '-' */
+
+ if (s->n_final > s->ndim) {
+ printf("jenny: %ld-tuples are impossible with only %d dimensions\n",
+ s->n_final, s->ndim);
+ return FALSE;
+ }
+
+ preliminary(s); /* allocate structures, do preliminary analysis */
+
+ /* read in any old tests so we can build from that base */
+ if (testfile) {
+ if (!load( s, testfile)) {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/* print out a single test */
+void report( test *t, ub2 len)
+{
+ ub4 i;
+ for (i=0; i<len; ++i) {
+ printf(" %d%c", i+1, feature_name[t->f[i]]);
+ }
+ printf(" \n");
+}
+
+/* print out all the tests */
+void report_all( state *s)
+{
+ ub4 i;
+ for (i=0; i<s->ntests; ++i) {
+ report(s->t[i], s->ndim);
+ }
+}
+
+
+void start_builder( state *s, feature *tuple, ub1 n)
+{
+ ub1 i;
+ for (i=0; i<n; ++i) {
+ tuple[i].d = i;
+ tuple[i].f = 0;
+ }
+}
+
+int next_builder( state *s, feature *tuple, ub1 n)
+{
+ sb4 i = n;
+
+ while (i-- &&
+ tuple[i].d == s->ndim-n+i &&
+ tuple[i].f == s->dim[tuple[i].d]-1)
+ ;
+ if (i == -1)
+ return FALSE;
+ else if (tuple[i].f < s->dim[tuple[i].d]-1) {
+ ++tuple[i].f; /* increment feature */
+ for (i; i<n-1; ++i) { /* reset all less significant positions */
+ tuple[i+1].d = tuple[i].d+1;
+ tuple[i+1].f = 0;
+ }
+ }
+ else {
+ ++tuple[i].d; /* increment least significant non-maxed-out position */
+ tuple[i].f = (ub2)0; /* reset its feature */
+ for (i; i<n-1; ++i) { /* reset all less significant positions */
+ tuple[i+1].d = tuple[i].d+1;
+ tuple[i+1].f = 0;
+ }
+ }
+ return TRUE;
+}
+
+
+void build_tuples( state *s, ub2 d, ub2 f)
+{
+ feature offset[MAX_N]; /* n-1-tuples */
+ feature tuple[MAX_N]; /* n-tuples that include (d,f) */
+ sb4 i, j, n = s->n[d][f];
+ ub8 count = 0;
+ test *t;
+ tu_iter ctx;
+
+ if (s->tc[d][f] > 0 || s->n[d][f] == s->n_final) {
+ return; /* no need to generate more tuples */
+ }
+
+ n = ++s->n[d][f]; /* move up to a bigger tuple size */
+
+ /* get ready to insert tuples into the tuple list for (d,f) */
+ start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
+ for (i=0; i<n; ++i) {
+ tuple[i].d = 0;
+ tuple[i].f = 0;
+ }
+
+ /* Offset iterates through all n-1-tuples. Inject (d,f) into each. */
+ start_builder( s, offset, n-1);
+ for (;;) {
+ for (i=0; (i<n-1) && (offset[i].d < d); ++i) {
+ tuple[i].d = offset[i].d;
+ tuple[i].f = offset[i].f;
+ }
+ /* can't inject (d,f) into a tuple that already has d */
+ if ((i<n-1) && (offset[i].d == d))
+ goto make_next_tuple;
+ tuple[i].d = d;
+ tuple[i].f = f;
+ for (++i; i<n; ++i) {
+ tuple[i].d = offset[i-1].d;
+ tuple[i].f = offset[i-1].f;
+ }
+
+ for (i=0; i<n; ++i) {
+ s->tuple_tester->f[tuple[i].d] = tuple[i].f;
+ }
+ if (count_withouts(s->tuple_tester, s->wc2) ||
+ count_withouts(s->tuple_tester, s->wc3))
+ goto make_next_tuple;
+
+ /* is this tuple covered by the existing tests? */
+ for (j=0; j<s->ntests; ++j) {
+ test *t = s->t[j];
+ for (i=0; i<n; ++i) {
+ if (t->f[tuple[i].d] != tuple[i].f) {
+ break;
+ }
+ }
+ if (i == n) {
+ goto make_next_tuple;
+ }
+ }
+
+ /* add it to the list of uncovered tuples */
+ if (!insert_tuple(s, &ctx, tuple)) {
+ printf("jenny: could not insert tuple\n");
+ return;
+ }
+ ++count;
+
+ /* next tuple */
+ make_next_tuple:
+ for (i=0; i<n; ++i) {
+ s->tuple_tester->f[tuple[i].d] = (ub2)~0;
+ }
+ if (!next_builder(s, offset, n-1))
+ break;
+ }
+}
+
+/*
+ * Tweak the test, other than entries in tuple, so that all withouts are
+ * obeyed.
+ *
+ * Algorithm: loop through all the dimensions touched by any without, changing
+ * features in those dimensions so that the total number of withouts disobeyed
+ * decreases or stays the same. Succeed if all withouts are obeyed. Give up
+ * after MAX_NO_PROGRESS consecutive loops that fail to decrease the number of
+ * withouts disobeyed.
+ *
+ * Would it be better to find some disobeyed without, and change one of its
+ * dimensions at random? No. Consider
+ * jenny 2 2 2 -w1a2a -w1b3a -w1b3a -w2b3a -w2b3a
+ * and tentative testcase
+ * 1a 2a 3a
+ * Progress is impossible unless you change a dimension that is not currently
+ * in any disobeyed without.
+ */
+#define MAX_NO_PROGRESS 2
+int obey_withouts(
+state *s, /* global state */
+test *t, /* test being built */
+ub1 *mut) /* mut[i] = 1 if I am allowed to adjust dimension i */
+{
+ ub4 i;
+ without *w; /* one of the disobeyed withouts */
+ ub4 count; /* number of withouts currently hit */
+ ub2 ndim; /* size of dimord[] */
+ ub2 temp;
+
+ /* how many withouts are currently disobeyed? */
+ if (!count_withouts(t, s->wc2))
+ return TRUE;
+
+ /* fill dimord[] with all dimensions that can and should be tweaked */
+ for (ndim=0, i=0; i<s->ndim; ++i) {
+ if (mut[i] && s->wc[i]) {
+ s->dimord[ndim++] = i;
+ }
+ }
+
+ /* hillclimbing, with sidestepping, minimize number of withouts hit */
+ for (i=0; i<MAX_NO_PROGRESS; ++i) {
+ ub4 j;
+ ub2 best[MAX_FEATURES]; /* best features so far */
+ ub1 ok = TRUE;
+
+ for (j=ndim; j>0; --j) {
+ ub2 fcount = 0; /* count of filled elements of best */
+ ub2 mydim; /* the current dimension */
+ ub2 k;
+
+ /* walk the dimensions in a random order, no replacement */
+ mydim = flearand(&s->r) % j;
+ temp = s->dimord[mydim];
+ s->dimord[mydim] = s->dimord[j-1];
+ s->dimord[j-1] = temp;
+ mydim = s->dimord[j-1];
+
+ /* see how many withouts this dimension is disobeying */
+ count = count_withouts(t, s->wc[mydim]);
+
+ /* test every feature of this dimension, trying to make progress */
+ for (k=0; k<s->dim[mydim]; ++k) {
+ ub2 newcount;
+ t->f[mydim] = k;
+ newcount = count_withouts(t, s->wc[mydim]);
+ if (newcount <= count) {
+ if (newcount < count) {
+ i = 0; /* partial progress! */
+ fcount = 0;
+ count = newcount;
+ }
+ best[fcount++] = k;
+ }
+ }
+
+ /* choose one of the best features for this dimension at random */
+ if (fcount == 0) {
+ printf("jenny: internal error a\n");
+ } else if (fcount == 1) {
+ t->f[mydim] = best[0];
+ } else {
+ temp = (flearand(&s->r) % fcount);
+ t->f[mydim] = best[temp];
+ }
+
+ if (count > 0)
+ ok = FALSE;
+ }
+ if (ok) { /* no withouts disobeyed */
+ return TRUE;
+ }
+ }
+ return FALSE; /* failure, could not satisfy all the withouts */
+}
+
+ub4 count_tuples( state *s, test *t, int d, int f)
+{
+ ub4 count = 0;
+ ub1 n = s->n[d][f];
+ tu_iter ctx;
+ feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
+ while (this) {
+ count += test_tuple(t->f, this, n);
+ this = next_tuple(&ctx);
+ }
+ return count;
+}
+
+ub4 maximize_coverage(
+state *s, /* global state */
+test *t, /* testcase being built, already obeys all restrictions */
+ub1 *mut, /* mut[i] = 1 if I can adjust dimension i */
+ub1 n) /* size of smallest tuple left to cover */
+{
+ ub1 progress;
+ ub2 ndim;
+ ub2 i;
+ ub4 total;
+
+ /* build a list of all the dimensions that we can modify */
+ for (ndim=0, i=0; i<s->ndim; ++i) {
+ if (mut[i]) {
+ s->dimord[ndim++] = i;
+ }
+ }
+
+ /* repeatedly loop through all dimensions, maximizing tuple coverage */
+ do {
+ progress = FALSE; /* assume no improvement in tuple coverage */
+ total = 1; /* one, for the one fixed tuple we are guaranteed to cover */
+
+ /* scramble the array of dimensions; */
+ for (i=ndim; i>1; --i) {
+ ub2 j = flearand(&s->r) % i;
+ ub2 temp = s->dimord[i-1];
+ s->dimord[i-1] = s->dimord[j];
+ s->dimord[j] = temp;
+ }
+
+ /* for every dimension that we can adjust */
+ for (i=0; i<ndim; ++i) {
+ ub2 best[MAX_FEATURES]; /* list of features with the best coverage */
+ ub2 count = 0; /* size of best[] */
+ ub2 d = s->dimord[i];
+ ub1 best_n = s->n[d][t->f[d]];
+ ub4 coverage = count_tuples(s, t, d, t->f[d]);
+ ub4 f;
+
+ /* for every feature in mydim, see if using it would improve coverage */
+ for (f=0; f<s->dim[d]; ++f) {
+ t->f[d] = f; /* switch to the new feature */
+ if (!count_withouts(t, s->wc[d])) { /* need to obey withouts */
+ ub4 new_coverage = count_tuples(s, t, d, f);
+ if (s->n[d][f] < best_n) {
+ best_n = s->n[d][f];
+ progress = TRUE;
+ coverage = new_coverage;
+ count = 0;
+ best[count++] = f;
+ } else if (s->n[d][f] == best_n && new_coverage >= coverage) {
+ if (new_coverage > coverage) {
+ progress = TRUE;
+ coverage = new_coverage;
+ count = 0;
+ }
+ best[count++] = f;
+ }
+ }
+ }
+
+ /*
+ * Change this dimension to the best features seen.
+ * Worst case, everyone was worse than the old value, so best[0] will
+ * be the old value. Coverage will be the same and still no withouts
+ * will be hit.
+ */
+ if (count == 0) {
+ printf("jenny: internal error b\n");
+ } else if (count == 1) {
+ t->f[d] = best[0];
+ } else {
+ t->f[d] = best[flearand(&s->r) % count];
+ }
+ if (s->n[d][t->f[d]] == n)
+ total += coverage;
+ }
+
+ } while (progress);
+ return total;
+}
+
+
+/*
+ * Generate one test that obeys all the restrictions and covers at
+ * least one tuple. Do not add it to the list of tests yet. Return FALSE
+ * if we couldn't satisfy the withouts while covering this tuple.
+ */
+#define MAX_ITERS 10
+ub4 generate_test( state *s, test *t, feature *tuple, ub1 n)
+{
+ int iter, i;
+ ub1 mut[MAX_DIMENSIONS]; /* mut[i] = 1 if I can adjust dimension i */
+ ub4 coverage = 0;
+
+ /* mut[i] = 1 if I can modify dimension i */
+ for (i=0; i<s->ndim; ++i) mut[i] = 1;
+ for (i=0; i<n; ++i) mut[tuple[i].d] = 0;
+
+ for (iter=0; iter<MAX_ITERS; ++iter) {
+ /* Produce a totally random testcase */
+ for (i=0; i<s->ndim; ++i) {
+ t->f[i] = flearand(&s->r) % (s->dim[i]);
+ }
+
+ /* Plug in the chosen new tuple */
+ for (i=0; i<n; ++i){
+ t->f[tuple[i].d] = tuple[i].f;
+ }
+
+ /* If we can get all the withouts obeyed, break, success */
+ if (!s->wc2 || obey_withouts(s, t, mut)) {
+ if (count_withouts(t, s->wc2)) {
+ printf("internal error without %d\n", s->wc2);
+ }
+ break;
+ }
+ }
+
+ /* quit if we were unable to satisfy the withouts */
+ if (iter == MAX_ITERS) {
+ goto done;
+ }
+
+ /*
+ * We now have a test that covers the new tuple and satisfies withouts.
+ * Do hillclimbing to cover as many new tuples as possible.
+ */
+ coverage = maximize_coverage(s, t, mut, n);
+
+ done:
+ return coverage;
+}
+
+#define GROUP_SIZE 5
+void cover_tuples( state *s)
+{
+ test *curr_test;
+ curr_test = (test *)my_alloc( s, sizeof(test));
+ curr_test->f = (ub2 *)my_alloc( s, sizeof(ub2)*s->ndim);
+
+ while (TRUE) {
+ ub4 i;
+ ub2 d;
+ test *best_test;
+ sb4 best_count = -1;
+ ub1 tuple_n = MAX_N;
+ ub4 tuple_count = 0;
+ ub1 covered = FALSE;
+ feature *tuple = (feature *)0;
+ ub4 tuple_f, tuple_d;
+
+ /* extend lists of tuples and choose one tuple to cover */
+ for (d=0; d<s->ndim; ++d) {
+ ub2 f;
+ for (f=0; f<s->dim[d]; ++f) {
+ build_tuples(s, d, f);
+ if (s->n[d][f] < tuple_n) {
+ tuple_n = s->n[d][f];
+ tuple_count = s->tc[d][f];
+ tuple = s->tu[d][f]->fe;
+ tuple_f = f;
+ tuple_d = d;
+ } else if (s->n[d][f] == tuple_n && s->tc[d][f] > tuple_count) {
+ tuple_count = s->tc[d][f];
+ tuple = s->tu[d][f]->fe;
+ tuple_f = f;
+ tuple_d = d;
+ }
+ }
+ }
+
+ if (tuple_count == 0) {
+ if (tuple_n == s->n_final)
+ break; /* no more tuples to cover, done! */
+ else
+ continue;
+ }
+
+
+ best_test = (test *)my_alloc( s, sizeof(test));
+ best_test->f = (ub2 *)my_alloc( s, sizeof(ub2)*s->ndim);
+
+ /* find a good test */
+ for (i=0; i<GROUP_SIZE; ++i) {
+ tu_iter ctx;
+ sb4 this_count;
+
+ /* generate a test that covers the first tuple */
+ if (!(this_count = generate_test(s, curr_test, tuple, tuple_n))) {
+ continue;
+ }
+ covered = TRUE;
+
+ /* see how many tuples are covered altogether */
+ if (this_count > best_count) {
+ test *temp = best_test;
+ best_test = curr_test;
+ curr_test = temp;
+
+ best_count = this_count;
+ }
+ }
+
+ if (!covered) {
+ wchain *wc = (wchain *)my_alloc( s, sizeof(wchain));
+ without *w = (without *)my_alloc( s, sizeof(without));
+ feature extra[MAX_N];
+
+ /* make a copy of tuple, because we'll be deleting it */
+ for (i=0; i<tuple_n; ++i) {
+ extra[i].d = tuple[i].d;
+ extra[i].f = tuple[i].f;
+ }
+
+ printf("Could not cover tuple ");
+ show_tuple(tuple, tuple_n);
+
+ /* add this tuple to the list of restrictions */
+ wc->w = w;
+ wc->next = s->wc3;
+ s->wc3 = wc;
+ w->fe = (feature *)0;
+ w->len = tuple_n;
+ w->fe = (feature *)my_alloc( s, sizeof(feature)*tuple_n);
+ for (i=0; i<tuple_n; ++i) {
+ w->fe[i].d = extra[i].d;
+ w->fe[i].f = extra[i].f;
+ }
+
+ for (d=0; d<s->ndim; ++d) {
+ ub2 f;
+ tu_iter ctx;
+ for (f=0; f<s->dim[d]; ++f) {
+ ub1 n = s->n[d][f];
+ feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
+
+ /* remove all the tuples covered by it */
+ while (this) {
+ if (subset_tuple(extra, tuple_n, this, n)) {
+ this = delete_tuple(&ctx);
+ } else {
+ this = next_tuple(&ctx);
+ }
+ }
+ }
+ }
+ my_free((char *)best_test->f);
+ my_free((char *)best_test);
+ } else {
+ ub2 d;
+ for (d=0; d<s->ndim; ++d) {
+ tu_iter ctx;
+ ub2 f = best_test->f[d];
+ ub1 n = s->n[d][f];
+ feature *this = start_tuple(&ctx, &s->tu[d][f], n, &s->tc[d][f]);
+
+ /* remove all the tuples covered by it */
+ while (this) {
+ if (test_tuple(best_test->f, this, n)) {
+ this = delete_tuple(&ctx);
+ } else {
+ this = next_tuple(&ctx);
+ }
+ }
+ }
+
+ /* add it to the list of tests */
+ if (!add_test(s, best_test)) {
+ printf("jenny: exceeded maximum number of tests\n");
+ my_free((char *)curr_test->f);
+ my_free((char *)curr_test);
+ my_free((char *)best_test->f);
+ my_free((char *)best_test);
+ cleanup(s);
+ exit(0);
+ }
+ }
+ }
+
+ my_free((char *)curr_test->f);
+ my_free((char *)curr_test);
+}
+
+void prepare_reduce( state *s)
+{
+ feature tuple[MAX_N];
+ ub1 n = s->n_final;
+ ub4 t, d;
+
+ for (t=0; t<s->ntests; ++t) {
+ for (d=0; d<s->ndim; ++d) {
+ s->onec[t][d] = 0;
+ }
+ }
+
+ /* Iterate through all the tuples */
+ start_builder( s, tuple, n);
+
+ for (;;) {
+ sb4 i;
+ ub2 thistest;
+
+ for (i=0; i<n; ++i) {
+ s->tuple_tester->f[tuple[i].d] = tuple[i].f;
+ }
+ if (count_withouts(s->tuple_tester, s->wc2) ||
+ count_withouts(s->tuple_tester, s->wc3))
+ goto make_next_tuple;
+
+ for (i=0; i<s->ntests; ++i) {
+ ub1 j;
+ for (j=0; j<n; ++j)
+ if (s->t[i]->f[tuple[j].d] != tuple[j].f)
+ break;
+ if (j == n)
+ break; /* this test contains this tuple */
+ }
+
+ /* no tests cover this tuple */
+ if (i==s->ntests) {
+ printf("error: some tuple not covered at all\n");
+ } else {
+ thistest = i;
+ for (++i; i<s->ntests; ++i) {
+ ub1 j;
+ for (j=0; j<n; ++j)
+ if (s->t[i]->f[tuple[j].d] != tuple[j].f)
+ break;
+ if (j == n)
+ break; /* this test contains this tuple */
+ }
+ if (i == s->ntests) {
+ ub1 j;
+ for (j=0; j<n; ++j) {
+ tu_iter ctx;
+ (void)start_tuple(&ctx, &s->one[thistest][tuple[j].d], n,
+ &s->onec[thistest][tuple[j].d]);
+ (void)insert_tuple(s, &ctx, tuple);
+ }
+ }
+ }
+
+ make_next_tuple:
+ for (i=0; i<n; ++i) {
+ s->tuple_tester->f[tuple[i].d] = (ub2)~0;
+ }
+ if (!next_builder( s, tuple, n))
+ break;
+ }
+}
+
+/* find a test to try to eliminate */
+int which_test( state *s)
+{
+ ub4 t;
+ ub4 mincount = ~0;
+ ub4 mint = 0; /* test with the fewest once-covered tuples */
+ for (t=0; t<s->ntests; ++t) {
+ ub4 i, j=0;
+ for (i=0; i<s->ndim; ++i) {
+ j += s->onec[t][i];
+ }
+ if (j <= mincount) {
+ mincount = j;
+ mint = t;
+ }
+ }
+ return mint;
+}
+
+void reduce_tests( state *s)
+{
+ ub4 t;
+ prepare_reduce( s);
+ t = which_test( s);
+}
+
+/* Confirm that every tuple is covered by either a testcase or a without */
+int confirm( state *s)
+{
+ feature offset[MAX_N];
+ sb4 i, j, n = s->n_final;
+
+ /* Make a list of allowed but uncovered tuples */
+ for (i=0; i<n; ++i) {
+ offset[i].d = i;
+ offset[i].f = 0;
+ }
+
+ for (;;) {
+ for (i=0; i<n; ++i) {
+ s->tuple_tester->f[offset[i].d] = offset[i].f;
+ }
+ if (count_withouts(s->tuple_tester, s->wc2) ||
+ count_withouts(s->tuple_tester, s->wc3))
+ goto make_next_tuple;
+
+ /* is this tuple covered by the existing tests? */
+ for (j=0; j<s->ntests; ++j) {
+ test *t = s->t[j];
+ for (i=0; i<n; ++i) {
+ if (t->f[offset[i].d] != offset[i].f) {
+ break;
+ }
+ }
+ if (i == n) {
+ goto make_next_tuple;
+ }
+ }
+
+ printf("problem with %d%c\n", offset[0].d+1, feature_name[offset[0].f]);
+ return FALSE; /* found a tuple that is not covered */
+
+ make_next_tuple:
+ for (i=0; i<n; ++i) {
+ s->tuple_tester->f[offset[i].d] = (ub2)~0;
+ }
+ i=n;
+ while (i-- &&
+ offset[i].d == s->ndim-n+i &&
+ offset[i].f == s->dim[offset[i].d]-1)
+ ;
+ if (i == -1)
+ break; /* done */
+ else if (offset[i].f < s->dim[offset[i].d]-1) {
+ ++offset[i].f; /* increment feature */
+ for (i; i<n-1; ++i) { /* reset all less significant positions */
+ offset[i+1].d = offset[i].d+1;
+ offset[i+1].f = 0;
+ }
+ }
+ else {
+ ++offset[i].d; /* increment least significant non-maxed-out position */
+ offset[i].f = (ub2)0; /* reset its feature */
+ for (i; i<n-1; ++i) { /* reset all less significant positions */
+ offset[i+1].d = offset[i].d+1;
+ offset[i+1].f = 0;
+ }
+ }
+ }
+
+ return TRUE; /* all tuples are covered by a test or a without */
+}
+
+
+void driver( int argc, char *argv[])
+{
+ state s; /* internal state */
+
+ initialize(&s);
+
+ if (parse(argc, argv, &s)) { /* read the user's instructions */
+ cover_tuples(&s); /* generate testcases until all tuples are covered */
+ /* reduce_tests(&s); */ /* try to reduce the number of testcases */
+ if (confirm(&s)) /* doublecheck that all tuples really are covered */
+ report_all(&s); /* report the results */
+ else
+ printf("jenny: internal error, some tuples not covered\n");
+ }
+ cleanup(&s); /* deallocate everything */
+}
+
+int main( int argc, char *argv[])
+{
+ driver(argc, argv);
+ return 0;
+}
+
commit 6f1c63dbda40526817ffb2212367766e1cd63e99
Merge: c444729 294e113
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 16 12:52:01 2018 -0700
Merge Chris Lam's 'maint-stress-tests' into maint.
commit c444729db5dd966e5bf29581a52c2403ee8bdab3
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jul 16 10:09:34 2018 -0700
Bug 796755 - buggy window handling at startup
Defer showing the main window until after its size and location are
restored from the state file.
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 11e8095..8089191 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -721,7 +721,6 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
DEBUG("first window %p.", active_windows->data);
window = gnc_main_window_new();
}
- gtk_widget_show(GTK_WIDGET(window));
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
@@ -906,6 +905,7 @@ cleanup:
if (error)
g_error_free(error);
g_free(window_group);
+ gtk_widget_show(GTK_WIDGET(window));
}
void
commit 294e113fec9ef22e752ad6922971b84f79614f2c
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Jul 16 07:14:44 2018 +0800
Small typo fix
Fixes typo in a51be5157c383b15a3bddf314b61293cff19c3dd
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index 6859da3..8d924c0 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -68,7 +68,7 @@
<key name='force-price-decimal' type="b">
<default>false</default>
<summary>Force prices to display as decimals even if they must be rounded.</summary>
- <description>If active, GnuCash will round prices as necessary to display them as decimals instead of displaying the exact fraction if the fractional part cannont be exactly represented as a decimal.</description>
+ <description>If active, GnuCash will round prices as necessary to display them as decimals instead of displaying the exact fraction if the fractional part cannot be exactly represented as a decimal.</description>
</key>
<key name="migrate-prefs-done" type="b">
<default>false</default>
diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade
index 1514105..58dfc66 100644
--- a/gnucash/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gtkbuilder/dialog-preferences.glade
@@ -1405,7 +1405,7 @@ many months before the current month:</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup">Force prices to display as decimals even if they must be rounded.</property>
- <property name="tooltip_text" translatable="yes">If active, GnuCash will round prices as necessary to display them as decimals instead of displaying the exact fraction if the fractional part cannont be exactly represented as a decimal.</property>
+ <property name="tooltip_text" translatable="yes">If active, GnuCash will round prices as necessary to display them as decimals instead of displaying the exact fraction if the fractional part cannot be exactly represented as a decimal.</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="use_underline">True</property>
commit 414ab99aa07c550882ffb0c65f8d415dfb1d7008
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Jul 16 00:18:58 2018 +0800
[test-stress-options] Set COMBINATORICS to full path to jenny
Setting COMBINATORICS to the full path name to jenny will enable
pairwise testing.
e.g. COMBINATORICS=/home/user/jenny/jenny ninja check
diff --git a/gnucash/report/standard-reports/test/test-stress-options.scm b/gnucash/report/standard-reports/test/test-stress-options.scm
index da2ffb6..4265273 100644
--- a/gnucash/report/standard-reports/test/test-stress-options.scm
+++ b/gnucash/report/standard-reports/test/test-stress-options.scm
@@ -17,6 +17,15 @@
(use-modules (sxml simple))
(use-modules (sxml xpath))
+;; NOTE
+;; ----
+;; SIMPLE stress tests by default
+;;
+;; PAIRWISE COMBINATORICS are enabled by setting environment variable COMBINATORICS
+;; to the fullpath for the compiled jenny from http://burtleburtle.net/bob/math/jenny.html
+;;
+;; e.g. COMBINATORICS=/home/user/jenny/jenny ninja check
+
(load "test-stress-optionslist.scm")
;; The above optionslist was generated programmatically. It was
;; generated by running a sentinel function in the middle of an
@@ -81,6 +90,18 @@
(tests)
(test-end "stress options"))
+(define jennypath
+ (get-environment-variable "COMBINATORICS"))
+
+(define jenny-exists?
+ ;; this is a simple test for presence of jenny - will check
+ ;; COMBINATORICS env exists, and running it produces exit-code of
+ ;; zero, and tests the first few letters of its output.
+ (and (string? jennypath)
+ (zero? (system jennypath))
+ (string=? (string-take (get-string-all (open-input-pipe jennypath)) 6)
+ "jenny:")))
+
(define (set-option! options section name value)
(let ((option (gnc:lookup-option options section name)))
(if option
@@ -175,8 +196,8 @@
;; the following is the n-tuple
2
(length report-options)))
- (cmdline (format #f "/home/chris/sources/jenny/jenny -n~a ~a"
- n-tuple jennyargs))
+ (cmdline (format #f "~a -n~a ~a"
+ jennypath n-tuple jennyargs))
(jennyout (get-string-all (open-input-pipe cmdline)))
(test-cases (string-split jennyout #\newline)))
(for-each
@@ -221,7 +242,7 @@
;; what strategy are we using here? simple stress test (ie tests as
;; many times as the maximum number of options) or combinatorial
;; tests (using jenny)
- (if (get-environment-variable "COMBINATORICS")
+ (if jenny-exists?
combinatorial-stress-test
simple-stress-test))
commit b8ce2b545ac83ff6e5d059a1c15c33b4789d024d
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 10 23:33:40 2018 +0800
[stress-test] run tests on empty book and populated book
Refactor (tests) into call (create-test-data) which will add sample
txns in the environment.
As a result we can run tests twice - once before and once
after (create-test-data) which helps dislodge a few more report bugs.
diff --git a/gnucash/report/standard-reports/test/test-stress-options.scm b/gnucash/report/standard-reports/test/test-stress-options.scm
index 028d049..da2ffb6 100644
--- a/gnucash/report/standard-reports/test/test-stress-options.scm
+++ b/gnucash/report/standard-reports/test/test-stress-options.scm
@@ -225,7 +225,7 @@
combinatorial-stress-test
simple-stress-test))
-(define (tests)
+(define (create-test-data)
(let* ((env (create-test-env))
(account-alist (env-create-account-structure-alist env structure))
(bank (cdr (assoc "Bank" account-alist)))
@@ -280,33 +280,39 @@
(iota 12))
(let ((mid (floor (/ (+ (gnc-accounting-period-fiscal-start)
(gnc-accounting-period-fiscal-end)) 2))))
- (env-create-transaction env mid bank income 200))
+ (env-create-transaction env mid bank income 200))))
- (for-each
- (lambda (option-set)
- (let ((report-name (assq-ref option-set 'report-name))
- (report-guid (assq-ref option-set 'report-id))
- (report-options (assq-ref option-set 'options)))
- (if (member report-name
- ;; these reports seem to cause problems when running...
- '("Income Statement"
- "Tax Invoice"
- "Net Worth Linechart"
- "Tax Schedule Report/TXF Export"
- "Receipt"
- "Future Scheduled Transactions Summary"
- "Welcome to GnuCash"
- "Hello, World"
- "Budget Income Statement"
- "Multicolumn View"
- "General Journal"
- "Australian Tax Invoice"
- "Balance Sheet (eguile)"
- ;; "Budget Flow"
- "networth"
- ))
- (format #t "\nSkipping ~a...\n" report-name)
- (begin
- (format #t "\nTesting ~a...\n" report-name)
- (test report-name report-guid report-options)))))
- optionslist)))
+(define (run-tests prefix)
+ (for-each
+ (lambda (option-set)
+ (let ((report-name (assq-ref option-set 'report-name))
+ (report-guid (assq-ref option-set 'report-id))
+ (report-options (assq-ref option-set 'options)))
+ (if (member report-name
+ ;; these reports seem to cause problems when running...
+ '(
+ ;; eguile-based reports
+ "Tax Invoice"
+ "Receipt"
+ "Australian Tax Invoice"
+ "Balance Sheet (eguile)"
+
+ ;; tax-schedule - locale-dependent?
+ "Tax Schedule Report/TXF Export"
+
+ ;; unusual reports
+ "Welcome to GnuCash"
+ "Hello, World"
+ "Multicolumn View"
+ "General Journal"
+ ))
+ (format #t "\nSkipping ~a ~a...\n" report-name prefix)
+ (begin
+ (format #t "\nTesting ~a ~a...\n" report-name prefix)
+ (test report-name report-guid report-options)))))
+ optionslist))
+
+(define (tests)
+ (run-tests "with empty book")
+ (create-test-data)
+ (run-tests "on a populated book"))
commit aa4da810c1cc9b00c829ef77bc4ff8a8792c92a2
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jul 8 14:59:30 2018 +0800
[test-stress-options] introduce combinatorial testing
This is enabled if the environment variable COMBINATORICS exists.
I guess it can be run via:
COMBINATORICS=bla ninja check
diff --git a/gnucash/report/standard-reports/test/test-stress-options.scm b/gnucash/report/standard-reports/test/test-stress-options.scm
index 92d6aaf..028d049 100644
--- a/gnucash/report/standard-reports/test/test-stress-options.scm
+++ b/gnucash/report/standard-reports/test/test-stress-options.scm
@@ -1,3 +1,5 @@
+(use-modules (ice-9 textual-ports))
+(use-modules (ice-9 popen))
(use-modules (gnucash utilities))
(use-modules (gnucash gnc-module))
(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
@@ -10,6 +12,7 @@
(use-modules (gnucash report report-system))
(use-modules (gnucash report report-system test test-extras))
(use-modules (srfi srfi-64))
+(use-modules (srfi srfi-98))
(use-modules (gnucash engine test srfi64-extras))
(use-modules (sxml simple))
(use-modules (sxml xpath))
@@ -103,7 +106,7 @@
(list "Equity" (list (cons 'type ACCT-TYPE-EQUITY)))
))
-(define (test report-name uuid report-options)
+(define (simple-stress-test report-name uuid report-options)
(let ((options (gnc:make-report-options uuid)))
(test-assert (format #f "basic test ~a" report-name)
(gnc:options->render uuid options (string-append "stress-" report-name) "test"))
@@ -146,6 +149,82 @@
report-options)))
)))
+(define (combinatorial-stress-test report-name uuid report-options)
+ (let* ((options (gnc:make-report-options uuid))
+ (render #f))
+ (test-assert (format #f "basic test ~a" report-name)
+ (set! render
+ (gnc:options->render
+ uuid options (string-append "stress-" report-name) "test")))
+ (if render
+ (begin
+ (format #t "Testing n-tuple combinatorics for:\n~a" report-name)
+ (for-each
+ (lambda (option)
+ (format #t ",~a/~a"
+ (vector-ref option 0)
+ (vector-ref option 1)))
+ report-options)
+ (newline)
+ ;; generate combinatorics
+ (let* ((option-lengths (map (lambda (report-option)
+ (length (vector-ref report-option 3)))
+ report-options))
+ (jennyargs (string-join (map number->string option-lengths) " "))
+ (n-tuple (min
+ ;; the following is the n-tuple
+ 2
+ (length report-options)))
+ (cmdline (format #f "/home/chris/sources/jenny/jenny -n~a ~a"
+ n-tuple jennyargs))
+ (jennyout (get-string-all (open-input-pipe cmdline)))
+ (test-cases (string-split jennyout #\newline)))
+ (for-each
+ (lambda (case)
+ (unless (string-null? case)
+ (let* ((choices-str (string-filter char-alphabetic? case))
+ (choices-alpha (map char->integer (string->list choices-str)))
+ (choices (map (lambda (n)
+ (- n (if (> n 96) 97 39))) ; a-z -> 0-25, and A-Z -> 26-51
+ choices-alpha)))
+ (let loop ((option-idx (1- (length report-options)))
+ (option-summary '()))
+ (if (negative? option-idx)
+ (catch #t
+ (lambda ()
+ (gnc:options->render uuid options "stress-test" "test")
+ (format #t "[pass] ~a:~a \n"
+ report-name
+ (string-join option-summary ",")))
+ (lambda (k . args)
+ (format #t "[fail]... error (~s . ~s) options-list are:\n~a"
+ k args
+ (gnc:html-render-options-changed options #t))
+ (test-assert "logging test failure as above..."
+ #f)))
+ (let* ((option (list-ref report-options option-idx))
+ (section (vector-ref option 0))
+ (name (vector-ref option 1))
+ (value (list-ref (vector-ref option 3)
+ (list-ref choices option-idx))))
+ (set-option! options section name value)
+ (loop (1- option-idx)
+ (cons (format #f "~a"
+ (cond
+ ((boolean? value) (if value 't 'f))
+ (else value)))
+ option-summary))))))))
+ test-cases)))
+ (display "...aborted due to basic test failure"))))
+
+(define test
+ ;; what strategy are we using here? simple stress test (ie tests as
+ ;; many times as the maximum number of options) or combinatorial
+ ;; tests (using jenny)
+ (if (get-environment-variable "COMBINATORICS")
+ combinatorial-stress-test
+ simple-stress-test))
+
(define (tests)
(let* ((env (create-test-env))
(account-alist (env-create-account-structure-alist env structure))
@@ -223,8 +302,11 @@
"General Journal"
"Australian Tax Invoice"
"Balance Sheet (eguile)"
+ ;; "Budget Flow"
"networth"
))
- (format #t "Skipping ~a...\n" report-name)
- (test report-name report-guid report-options))))
+ (format #t "\nSkipping ~a...\n" report-name)
+ (begin
+ (format #t "\nTesting ~a...\n" report-name)
+ (test report-name report-guid report-options)))))
optionslist)))
commit dfe1f34573fcae11b8447f4f2c83d5418d9eac53
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jul 1 14:12:39 2018 +0800
[stress-test] stress test options!
diff --git a/gnucash/report/standard-reports/test/CMakeLists.txt b/gnucash/report/standard-reports/test/CMakeLists.txt
index 0eed778..ed24291 100644
--- a/gnucash/report/standard-reports/test/CMakeLists.txt
+++ b/gnucash/report/standard-reports/test/CMakeLists.txt
@@ -10,6 +10,7 @@ set(scm_test_with_srfi64_SOURCES
test-charts.scm
test-transaction.scm
test-balance-sheet.scm
+ test-stress-options.scm
test-income-gst.scm
)
diff --git a/gnucash/report/standard-reports/test/test-stress-options.scm b/gnucash/report/standard-reports/test/test-stress-options.scm
new file mode 100644
index 0000000..92d6aaf
--- /dev/null
+++ b/gnucash/report/standard-reports/test/test-stress-options.scm
@@ -0,0 +1,230 @@
+(use-modules (gnucash utilities))
+(use-modules (gnucash gnc-module))
+(gnc:module-begin-syntax (gnc:module-load "gnucash/app-utils" 0))
+(use-modules (gnucash engine test test-extras))
+(use-modules (gnucash report standard-reports))
+(use-modules (gnucash report business-reports))
+(use-modules (gnucash report view-column))
+(use-modules (gnucash report stylesheets))
+(use-modules (gnucash report taxinvoice))
+(use-modules (gnucash report report-system))
+(use-modules (gnucash report report-system test test-extras))
+(use-modules (srfi srfi-64))
+(use-modules (gnucash engine test srfi64-extras))
+(use-modules (sxml simple))
+(use-modules (sxml xpath))
+
+(load "test-stress-optionslist.scm")
+;; The above optionslist was generated programmatically. It was
+;; generated by running a sentinel function in the middle of an
+;; existing report renderer. The sentinel function is defined as
+;; follows, then was cleaned up using emacs' indenting. No other
+;; processing was done. Only the multichoice and boolean options for
+;; most reports were dumped. Although this cannot provide whole
+;; coverage for option permutations, it can catch many errors while
+;; refactoring inner functions.
+
+;; (define (mydump)
+;; (with-output-to-file "test-stress-optionslist.scm"
+;; (lambda ()
+;; (display "(define optionslist\n (list \n")
+;; (gnc:report-templates-for-each
+;; (lambda (report-id template)
+;; (let* ((options-generator (gnc:report-template-options-generator template))
+;; (name (gnc:report-template-name template))
+;; (options (and (not (string=? name "General Journal"))
+;; (options-generator))))
+;; (define (disp d)
+;; (define (try proc)
+;; (catch 'wrong-type-arg
+;; (lambda () (proc d))
+;; (const #f)))
+;; (or (and (symbol? d) (string-append "'" (symbol->string d)))
+;; (and (list? d) (string-append "(list " (string-join (map disp d) " ") ")"))
+;; (and (pair? d) (format #f "(cons ~a . ~a)"
+;; (disp (car d))
+;; (disp (cdr d))))
+;; (try gnc-commodity-get-mnemonic)
+;; (try xaccAccountGetName)
+;; (try gnc-budget-get-name)
+;; (format #f "~s" d)))
+;; (format #t "(list (cons 'report-id ~s)\n (cons 'report-name ~s)\n (cons 'options\n (list\n"
+;; report-id (gnc:report-template-name template))
+;; (if options
+;; (gnc:options-for-each
+;; (lambda (option)
+;; (if (memq (gnc:option-type option) '(multichoice boolean))
+;; (format #t " (vector ~s ~s '~s '~s)\n"
+;; (gnc:option-section option)
+;; (gnc:option-name option)
+;; (gnc:option-type option)
+;; (case (gnc:option-type option)
+;; ((multichoice) (map (lambda (d) (vector-ref d 0)) (gnc:option-data option)))
+;; ((boolean) (list #t #f))
+;; ;; (else "\"\"")
+;; (else (disp (gnc:option-value option)))))))
+;; options)
+;; )
+;; (display ")))\n"))))
+;; (display "))\n"))))
+
+
+;; Explicitly set locale to make the report output predictable
+(setlocale LC_ALL "C")
+
+(define (run-test)
+ (test-runner-factory gnc:test-runner)
+ (test-begin "stress options")
+ (tests)
+ (test-end "stress options"))
+
+(define (set-option! options section name value)
+ (let ((option (gnc:lookup-option options section name)))
+ (if option
+ (gnc:option-set-value option value))))
+
+(define (mnemonic->commodity sym)
+ (gnc-commodity-table-lookup
+ (gnc-commodity-table-get-table (gnc-get-current-book))
+ (gnc-commodity-get-namespace (gnc-default-report-currency))
+ sym))
+
+(define structure
+ (list "Root" (list (cons 'type ACCT-TYPE-ASSET))
+ (list "Asset"
+ (list "Bank")
+ (list "GBP Bank" (list (cons 'commodity (mnemonic->commodity "GBP"))))
+ (list "Wallet"))
+ (list "Income" (list (cons 'type ACCT-TYPE-INCOME)))
+ (list "Income-GBP" (list (cons 'type ACCT-TYPE-INCOME)
+ (cons 'commodity (mnemonic->commodity "GBP"))))
+ (list "Expenses" (list (cons 'type ACCT-TYPE-EXPENSE)))
+ (list "Liabilities" (list (cons 'type ACCT-TYPE-LIABILITY)))
+ (list "Equity" (list (cons 'type ACCT-TYPE-EQUITY)))
+ ))
+
+(define (test report-name uuid report-options)
+ (let ((options (gnc:make-report-options uuid)))
+ (test-assert (format #f "basic test ~a" report-name)
+ (gnc:options->render uuid options (string-append "stress-" report-name) "test"))
+ (format #t "Testing SIMPLE combinations for:\n~a" report-name)
+ (for-each
+ (lambda (option)
+ (format #t ",~a/~a"
+ (vector-ref option 0)
+ (vector-ref option 1)))
+ report-options)
+ (newline)
+ (for-each
+ (lambda (idx)
+ (display report-name)
+ (for-each
+ (lambda (option)
+ (let* ((section (vector-ref option 0))
+ (name (vector-ref option 1))
+ (value (list-ref (vector-ref option 3)
+ (modulo idx (length (vector-ref option 3))))))
+ (set-option! options section name value)
+ (format #t ",~a"
+ (cond
+ ((boolean? value) (if value 't 'f))
+ (else value)))))
+ report-options)
+ (catch #t
+ (lambda ()
+ (gnc:options->render uuid options "stress-test" "test")
+ (display "[pass]\n"))
+ (lambda (k . args)
+ (format #t "[fail]... error: (~s . ~s) options-list are:\n~a"
+ k args
+ (gnc:html-render-options-changed options #t))
+ (test-assert "logging test failure as above..."
+ #f))))
+ (iota
+ (apply max
+ (map (lambda (opt) (length (vector-ref opt 3)))
+ report-options)))
+ )))
+
+(define (tests)
+ (let* ((env (create-test-env))
+ (account-alist (env-create-account-structure-alist env structure))
+ (bank (cdr (assoc "Bank" account-alist)))
+ (gbp-bank (cdr (assoc "GBP Bank" account-alist)))
+ (wallet (cdr (assoc "Wallet" account-alist)))
+ (income (cdr (assoc "Income" account-alist)))
+ (gbp-income (cdr (assoc "Income-GBP" account-alist)))
+ (expense (cdr (assoc "Expenses" account-alist)))
+ (liability (cdr (assoc "Liabilities" account-alist)))
+ (equity (cdr (assoc "Equity" account-alist))))
+ ;; populate datafile with old transactions
+ (env-transfer env 01 01 1970 bank expense 5 #:description "desc-1" #:num "trn1" #:memo "memo-3")
+ (env-transfer env 31 12 1969 income bank 10 #:description "desc-2" #:num "trn2" #:void-reason "void" #:notes "notes3")
+ (env-transfer env 31 12 1969 income bank 29 #:description "desc-3" #:num "trn3"
+ #:reconcile (cons #\c (gnc-dmy2time64 01 03 1970)))
+ (env-transfer env 01 02 1970 bank expense 15 #:description "desc-4" #:num "trn4" #:notes "notes2" #:memo "memo-1")
+ (env-transfer env 10 01 1970 liability expense 10 #:description "desc-5" #:num "trn5" #:void-reason "any")
+ (env-transfer env 10 01 1970 liability expense 11 #:description "desc-6" #:num "trn6" #:notes "notes1")
+ (env-transfer env 10 02 1970 bank liability 8 #:description "desc-7" #:num "trn7" #:notes "notes1" #:memo "memo-2"
+ #:reconcile (cons #\y (gnc-dmy2time64 01 03 1970)))
+ (let ((txn (xaccMallocTransaction (gnc-get-current-book)))
+ (split-1 (xaccMallocSplit (gnc-get-current-book)))
+ (split-2 (xaccMallocSplit (gnc-get-current-book)))
+ (split-3 (xaccMallocSplit (gnc-get-current-book))))
+ (xaccTransBeginEdit txn)
+ (xaccTransSetDescription txn "$100bank -> $80expenses + $20wallet")
+ (xaccTransSetCurrency txn (xaccAccountGetCommodity bank))
+ (xaccTransSetDate txn 14 02 1971)
+ (xaccSplitSetParent split-1 txn)
+ (xaccSplitSetParent split-2 txn)
+ (xaccSplitSetParent split-3 txn)
+ (xaccSplitSetAccount split-1 bank)
+ (xaccSplitSetAccount split-2 expense)
+ (xaccSplitSetAccount split-3 wallet)
+ (xaccSplitSetValue split-1 -100)
+ (xaccSplitSetValue split-2 80)
+ (xaccSplitSetValue split-3 20)
+ (xaccSplitSetAmount split-1 -100)
+ (xaccSplitSetAmount split-2 80)
+ (xaccSplitSetAmount split-3 20)
+ (xaccTransSetNotes txn "multisplit")
+ (xaccTransCommitEdit txn))
+ (let ((closing-txn (env-transfer env 31 12 1977 expense equity 111 #:description "Closing")))
+ (xaccTransSetIsClosingTxn closing-txn #t))
+ (env-transfer-foreign env 15 01 2000 gbp-bank bank 10 14 #:description "GBP 10 to USD 14")
+ (env-transfer-foreign env 15 02 2000 bank gbp-bank 9 6 #:description "USD 9 to GBP 6")
+ (for-each (lambda (m)
+ (env-transfer env 08 (1+ m) 1978 gbp-income gbp-bank 51 #:description "#51 income")
+ (env-transfer env 03 (1+ m) 1978 income bank 103 #:description "$103 income")
+ (env-transfer env 15 (1+ m) 1978 bank expense 22 #:description "$22 expense")
+ (env-transfer env 09 (1+ m) 1978 income bank 109 #:description "$109 income"))
+ (iota 12))
+ (let ((mid (floor (/ (+ (gnc-accounting-period-fiscal-start)
+ (gnc-accounting-period-fiscal-end)) 2))))
+ (env-create-transaction env mid bank income 200))
+
+ (for-each
+ (lambda (option-set)
+ (let ((report-name (assq-ref option-set 'report-name))
+ (report-guid (assq-ref option-set 'report-id))
+ (report-options (assq-ref option-set 'options)))
+ (if (member report-name
+ ;; these reports seem to cause problems when running...
+ '("Income Statement"
+ "Tax Invoice"
+ "Net Worth Linechart"
+ "Tax Schedule Report/TXF Export"
+ "Receipt"
+ "Future Scheduled Transactions Summary"
+ "Welcome to GnuCash"
+ "Hello, World"
+ "Budget Income Statement"
+ "Multicolumn View"
+ "General Journal"
+ "Australian Tax Invoice"
+ "Balance Sheet (eguile)"
+ "networth"
+ ))
+ (format #t "Skipping ~a...\n" report-name)
+ (test report-name report-guid report-options))))
+ optionslist)))
diff --git a/gnucash/report/standard-reports/test/test-stress-optionslist.scm b/gnucash/report/standard-reports/test/test-stress-optionslist.scm
new file mode 100644
index 0000000..b9c0220
--- /dev/null
+++ b/gnucash/report/standard-reports/test/test-stress-optionslist.scm
@@ -0,0 +1,972 @@
+(define optionslist
+ (list
+ (list (cons 'report-id "e9cf815f79db44bcb637d0295093ae3d")
+ (cons 'report-name "Assets Over Time")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
+ (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show long account names" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "e45218c6d76f11e7b5ef0800277ef320")
+ (cons 'report-name "Reconciliation Report")
+ (cons 'options
+ (list
+ (vector "Accounts" "Filter Type" 'multichoice '(none include exclude))
+ (vector "Display" "Sign Reverses" 'multichoice '(global none income-expense credit-accounts))
+ (vector "Display" "Description" 'boolean '(#t #f))
+ (vector "Display" "Amount" 'multichoice '(none single double))
+ (vector "Display" "Num" 'boolean '(#t #f))
+ (vector "Display" "Shares" 'boolean '(#t #f))
+ (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
+ (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Detail Level" 'multichoice '(multi-line single))
+ (vector "Display" "Account Code" 'boolean '(#t #f))
+ (vector "Display" "Memo" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Account Name" 'boolean '(#t #f))
+ (vector "Display" "Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Price" 'boolean '(#t #f))
+ (vector "Display" "Other Account Code" 'boolean '(#t #f))
+ (vector "Display" "Reconciled Date" 'boolean '(#t #f))
+ (vector "Display" "Subtotal Table" 'boolean '(#t #f))
+ (vector "Display" "Notes" 'boolean '(#t #f))
+ (vector "Display" "Date" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Show Informal Debit/Credit Headers" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
+ (vector "Filter" "Closing transactions" 'multichoice '(exclude-closing include-both closing-only))
+ (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
+ (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
+ (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
+ (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
+ (vector "General" "Show original currency amount" 'boolean '(#t #f))
+ (vector "General" "Table for Exporting" 'boolean '(#t #f))
+ (vector "General" "Add options summary" 'multichoice '(no-match always never))
+ (vector "General" "Common Currency" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "583c313fcc484efc974c4c844404f454")
+ (cons 'report-name "Budget Income Statement")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Display" "Display as a two column report" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Label the revenue section" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Include expense total" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Include revenue total" 'boolean '(#t #f))
+ (vector "Display" "Label the expense section" 'boolean '(#t #f))
+ (vector "General" "Report for range of budget periods" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "4166a20981985fd2b07ff8cb3b7d384e")
+ (cons 'report-name "Customer Summary")
+ (cons 'options
+ (list
+ (vector "Display" "Sort Order" 'multichoice '(ascend descend))
+ (vector "Display" "Show Inactive Customers" 'boolean '(#t #f))
+ (vector "Display" "Show Lines with All Zeros" 'boolean '(#t #f))
+ (vector "Display" "Show Expense Column" 'boolean '(#t #f))
+ (vector "Display" "Sort Column" 'multichoice '(customername profit markup sales expense))
+ (vector "Display" "Show Company Address" 'boolean '(#t #f))
+ (vector "__reg" "reverse?" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "d8ba4a2e89e8479ca9f6eccdeb164588")
+ (cons 'report-name "Multicolumn View")
+ (cons 'options
+ (list
+ )))
+ (list (cons 'report-id "216cd0cf6931453ebcce85415aba7082")
+ (cons 'report-name "Trial Balance")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Entries" "Adjusting Entries Pattern is regular expression" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
+ (vector "Entries" "Adjusting Entries pattern is case-sensitive" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "General" "Report variation" 'multichoice '(current pre-adj work-sheet))
+ )))
+ (list (cons 'report-id "47f45d7d6d57b68518481c1fc8d4e4ba")
+ (cons 'report-name "Future Scheduled Transactions Summary")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Depth limit behavior" 'multichoice '(summarize flatten truncate))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Account Description" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Account Code" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Account Notes" 'boolean '(#t #f))
+ (vector "Display" "Account Type" 'boolean '(#t #f))
+ (vector "Display" "Account Balance" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "c2a996c8970f43448654ca84f17dda24")
+ (cons 'report-name "Equity Statement")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "3dbbc2584da64e7a8674355bc3fbfe3d")
+ (cons 'report-name "Australian Tax Invoice")
+ (cons 'options
+ (list
+ (vector "Display" "table-border-collapse" 'boolean '(#t #f))
+ (vector "Elements" "Show net price" 'boolean '(#t #f))
+ (vector "Elements" "column: Units" 'boolean '(#t #f))
+ (vector "Elements" "Show Job number" 'boolean '(#t #f))
+ (vector "Elements" "row: Address" 'boolean '(#t #f))
+ (vector "Elements" "column: Date" 'boolean '(#t #f))
+ (vector "Elements" "column: Tax Rate" 'boolean '(#t #f))
+ (vector "Elements" "Invoice number next to title" 'boolean '(#t #f))
+ (vector "Elements" "row: Company Name" 'boolean '(#t #f))
+ (vector "Elements" "row: Invoice Number" 'boolean '(#t #f))
+ (vector "Elements" "Show Job name" 'boolean '(#t #f))
+ (vector "Elements" "row: Contact" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "2e3751edeb7544e8a20fd19e9d08bb65")
+ (cons 'report-name "Balance Sheet (eguile)")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Accounts" "Exclude accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Negative amount format" 'multichoice '(negsign negbrackets))
+ (vector "Display" "1- or 2-column report" 'multichoice '(autocols onecol twocols))
+ )))
+ (list (cons 'report-id "e9418ff64f2c11e5b61d1c7508d793ed")
+ (cons 'report-name "Securities")
+ (cons 'options
+ (list
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "Display" "Show long names" 'boolean '(#t #f))
+ (vector "Display" "Show Percents" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "e1bd09b8a1dd49dd85760db9d82b045c")
+ (cons 'report-name "Income Accounts")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "Display" "Show long names" 'boolean '(#t #f))
+ (vector "Display" "Show Percents" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "General" "Show Average" 'multichoice '(None YearDelta MonthDelta WeekDelta))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "2e22929e5c5b4b769f615a815ef0c20f")
+ (cons 'report-name "General Ledger")
+ (cons 'options
+ (list
+ (vector "Accounts" "Filter Type" 'multichoice '(none include exclude))
+ (vector "Display" "Sign Reverses" 'multichoice '(global none income-expense credit-accounts))
+ (vector "Display" "Description" 'boolean '(#t #f))
+ (vector "Display" "Amount" 'multichoice '(none single double))
+ (vector "Display" "Num" 'boolean '(#t #f))
+ (vector "Display" "Running Balance" 'boolean '(#t #f))
+ (vector "Display" "Shares" 'boolean '(#t #f))
+ (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
+ (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Detail Level" 'multichoice '(multi-line single))
+ (vector "Display" "Account Code" 'boolean '(#t #f))
+ (vector "Display" "Memo" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Account Name" 'boolean '(#t #f))
+ (vector "Display" "Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Price" 'boolean '(#t #f))
+ (vector "Display" "Other Account Code" 'boolean '(#t #f))
+ (vector "Display" "Reconciled Date" 'boolean '(#t #f))
+ (vector "Display" "Subtotal Table" 'boolean '(#t #f))
+ (vector "Display" "Notes" 'boolean '(#t #f))
+ (vector "Display" "Date" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Show Informal Debit/Credit Headers" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
+ (vector "Filter" "Closing transactions" 'multichoice '(exclude-closing include-both closing-only))
+ (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
+ (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
+ (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
+ (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
+ (vector "General" "Stylesheet" 'multichoice '(Default Easy Footer #{Head or Tail}# Technicolor))
+ (vector "General" "Show original currency amount" 'boolean '(#t #f))
+ (vector "General" "Table for Exporting" 'boolean '(#t #f))
+ (vector "General" "Add options summary" 'multichoice '(no-match always never))
+ (vector "General" "Common Currency" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "9cf76bed17f14401b8e3e22d0079cb98")
+ (cons 'report-name "Receivable Aging")
+ (cons 'options
+ (list
+ (vector "Display" "Address Name" 'boolean '(#t #f))
+ (vector "Display" "Address 1" 'boolean '(#t #f))
+ (vector "Display" "Active" 'boolean '(#t #f))
+ (vector "Display" "Address 2" 'boolean '(#t #f))
+ (vector "Display" "Address 3" 'boolean '(#t #f))
+ (vector "Display" "Address Source" 'multichoice '(billing shipping))
+ (vector "Display" "Address Email" 'boolean '(#t #f))
+ (vector "Display" "Address Phone" 'boolean '(#t #f))
+ (vector "Display" "Address 4" 'boolean '(#t #f))
+ (vector "Display" "Address Fax" 'boolean '(#t #f))
+ (vector "General" "Sort By" 'multichoice '(name total oldest-bracket))
+ (vector "General" "Show zero balance items" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Sort Order" 'multichoice '(increasing decreasing))
+ (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
+ (vector "General" "Show Multi-currency Totals" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "3ce293441e894423a2425d7a22dd1ac6")
+ (cons 'report-name "Fancy Invoice")
+ (cons 'options
+ (list
+ (vector "Display" "Payable to" 'boolean '(#t #f))
+ (vector "Display" "Individual Taxes" 'boolean '(#t #f))
+ (vector "Display" "Billing Terms" 'boolean '(#t #f))
+ (vector "Display" "References" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Invoice Notes" 'boolean '(#t #f))
+ (vector "Display" "Billing ID" 'boolean '(#t #f))
+ (vector "Display" "Payments" 'boolean '(#t #f))
+ (vector "Display" "Company contact" 'boolean '(#t #f))
+ (vector "Display Columns" "Tax Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Discount" 'boolean '(#t #f))
+ (vector "Display Columns" "Total" 'boolean '(#t #f))
+ (vector "Display Columns" "Action" 'boolean '(#t #f))
+ (vector "Display Columns" "Taxable" 'boolean '(#t #f))
+ (vector "Display Columns" "Quantity" 'boolean '(#t #f))
+ (vector "Display Columns" "Price" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "08ae9c2e884b4f9787144f47eacd7f44")
+ (cons 'report-name "Employee Report")
+ (cons 'options
+ (list
+ (vector "Display Columns" "Tax" 'boolean '(#t #f))
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Debits" 'boolean '(#t #f))
+ (vector "Display Columns" "Type" 'boolean '(#t #f))
+ (vector "Display Columns" "Due Date" 'boolean '(#t #f))
+ (vector "Display Columns" "Sale" 'boolean '(#t #f))
+ (vector "Display Columns" "Reference" 'boolean '(#t #f))
+ (vector "Display Columns" "Credits" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
+ (vector "__reg" "reverse?" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "8758ba23984c40dea5527f5f0ca2779e")
+ (cons 'report-name "Profit & Loss")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
+ (vector "Display" "Display as a two column report" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Label the revenue section" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Include expense total" 'boolean '(#t #f))
+ (vector "Display" "Include trading accounts total" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Include revenue total" 'boolean '(#t #f))
+ (vector "Display" "Label the expense section" 'boolean '(#t #f))
+ (vector "Display" "Label the trading accounts section" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "c4173ac99b2b448289bf4d11c731af13")
+ (cons 'report-name "Balance Sheet")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Include assets total" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Include liabilities total" 'boolean '(#t #f))
+ (vector "Display" "Label the liabilities section" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Label the assets section" 'boolean '(#t #f))
+ (vector "Display" "Include equity total" 'boolean '(#t #f))
+ (vector "Display" "Label the equity section" 'boolean '(#t #f))
+ (vector "General" "Single column Balance Sheet" 'boolean '(#t #f))
+ (vector "General" "Use standard US layout" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "c146317be32e4948a561ec7fc89d15c1")
+ (cons 'report-name "Customer Report")
+ (cons 'options
+ (list
+ (vector "Display Columns" "Tax" 'boolean '(#t #f))
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Debits" 'boolean '(#t #f))
+ (vector "Display Columns" "Type" 'boolean '(#t #f))
+ (vector "Display Columns" "Due Date" 'boolean '(#t #f))
+ (vector "Display Columns" "Sale" 'boolean '(#t #f))
+ (vector "Display Columns" "Reference" 'boolean '(#t #f))
+ (vector "Display Columns" "Credits" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
+ (vector "__reg" "reverse?" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "2fe3b9833af044abb929a88d5a59620f")
+ (cons 'report-name "Transaction Report")
+ (cons 'options
+ (list
+ (vector "Accounts" "Filter Type" 'multichoice '(none include exclude))
+ (vector "Display" "Sign Reverses" 'multichoice '(global none income-expense credit-accounts))
+ (vector "Display" "Description" 'boolean '(#t #f))
+ (vector "Display" "Amount" 'multichoice '(none single double))
+ (vector "Display" "Num" 'boolean '(#t #f))
+ (vector "Display" "Running Balance" 'boolean '(#t #f))
+ (vector "Display" "Shares" 'boolean '(#t #f))
+ (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
+ (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Detail Level" 'multichoice '(multi-line single))
+ (vector "Display" "Account Code" 'boolean '(#t #f))
+ (vector "Display" "Memo" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Account Name" 'boolean '(#t #f))
+ (vector "Display" "Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Price" 'boolean '(#t #f))
+ (vector "Display" "Other Account Code" 'boolean '(#t #f))
+ (vector "Display" "Reconciled Date" 'boolean '(#t #f))
+ (vector "Display" "Subtotal Table" 'boolean '(#t #f))
+ (vector "Display" "Notes" 'boolean '(#t #f))
+ (vector "Display" "Date" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Show Informal Debit/Credit Headers" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
+ (vector "Filter" "Closing transactions" 'multichoice '(exclude-closing include-both closing-only))
+ (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
+ (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
+ (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
+ (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
+ (vector "General" "Show original currency amount" 'boolean '(#t #f))
+ (vector "General" "Table for Exporting" 'boolean '(#t #f))
+ (vector "General" "Add options summary" 'multichoice '(no-match always never))
+ (vector "General" "Common Currency" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "e57770f2dbca46619d6dac4ac5469b50")
+ (cons 'report-name "Payable Aging")
+ (cons 'options
+ (list
+ (vector "Display" "Address Name" 'boolean '(#t #f))
+ (vector "Display" "Address 1" 'boolean '(#t #f))
+ (vector "Display" "Active" 'boolean '(#t #f))
+ (vector "Display" "Address 2" 'boolean '(#t #f))
+ (vector "Display" "Address 3" 'boolean '(#t #f))
+ (vector "Display" "Address Email" 'boolean '(#t #f))
+ (vector "Display" "Address Phone" 'boolean '(#t #f))
+ (vector "Display" "Address 4" 'boolean '(#t #f))
+ (vector "Display" "Address Fax" 'boolean '(#t #f))
+ (vector "General" "Sort By" 'multichoice '(name total oldest-bracket))
+ (vector "General" "Show zero balance items" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Sort Order" 'multichoice '(increasing decreasing))
+ (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
+ (vector "General" "Show Multi-currency Totals" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "5426e4d987f6444387fe70880e5b28a0")
+ (cons 'report-name "Cash Flow Barchart")
+ (cons 'options
+ (list
+ (vector "Accounts" "Include Trading Accounts in report" 'boolean '(#t #f))
+ (vector "Display" "Show Table" 'boolean '(#t #f))
+ (vector "Display" "Show Money In" 'boolean '(#t #f))
+ (vector "Display" "Show Money Out" 'boolean '(#t #f))
+ (vector "Display" "Show Net Flow" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "0769e242be474010b4acf264a5512e6e")
+ (cons 'report-name "Tax Invoice")
+ (cons 'options
+ (list
+ (vector "Display" "table-border-collapse" 'boolean '(#t #f))
+ (vector "Elements" "Show net price" 'boolean '(#t #f))
+ (vector "Elements" "column: Units" 'boolean '(#t #f))
+ (vector "Elements" "Show Job number" 'boolean '(#t #f))
+ (vector "Elements" "row: Address" 'boolean '(#t #f))
+ (vector "Elements" "column: Date" 'boolean '(#t #f))
+ (vector "Elements" "column: Tax Rate" 'boolean '(#t #f))
+ (vector "Elements" "Invoice number next to title" 'boolean '(#t #f))
+ (vector "Elements" "row: Company Name" 'boolean '(#t #f))
+ (vector "Elements" "row: Invoice Number" 'boolean '(#t #f))
+ (vector "Elements" "Show Job name" 'boolean '(#t #f))
+ (vector "Elements" "row: Contact" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "dde49fed4ca940959ae7d01b72742530")
+ (cons 'report-name "Expenses vs. Day of Week")
+ (cons 'options
+ (list
+ (vector "Accounts" "Include Sub-Accounts" 'boolean '(#t #f))
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "d5adcc61c62e4b8684dd8907448d7900")
+ (cons 'report-name "Average Balance")
+ (cons 'options
+ (list
+ (vector "Accounts" "Include Sub-Accounts" 'boolean '(#t #f))
+ (vector "Accounts" "Exclude transactions between selected accounts" 'boolean '(#t #f))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show plot" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "25455562bd234dd0b048ecc5a8af9e43")
+ (cons 'report-name "General Journal")
+ (cons 'options
+ (list
+ )))
+ (list (cons 'report-id "67112f318bef4fc496bdc27d106bbda4")
+ (cons 'report-name "Easy Invoice")
+ (cons 'options
+ (list
+ (vector "Display" "My Company" 'boolean '(#t #f))
+ (vector "Display" "Subtotal" 'boolean '(#t #f))
+ (vector "Display" "Individual Taxes" 'boolean '(#t #f))
+ (vector "Display" "Billing Terms" 'boolean '(#t #f))
+ (vector "Display" "Due Date" 'boolean '(#t #f))
+ (vector "Display" "References" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "My Company ID" 'boolean '(#t #f))
+ (vector "Display" "Invoice Notes" 'boolean '(#t #f))
+ (vector "Display" "Billing ID" 'boolean '(#t #f))
+ (vector "Display" "Payments" 'boolean '(#t #f))
+ (vector "Display Columns" "Tax Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Discount" 'boolean '(#t #f))
+ (vector "Display Columns" "Total" 'boolean '(#t #f))
+ (vector "Display Columns" "Charge Type" 'boolean '(#t #f))
+ (vector "Display Columns" "Taxable" 'boolean '(#t #f))
+ (vector "Display Columns" "Quantity" 'boolean '(#t #f))
+ (vector "Display Columns" "Price" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "3298541c236b494998b236dfad6ad752")
+ (cons 'report-name "Account Summary")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Depth limit behavior" 'multichoice '(summarize flatten truncate))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Account Description" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Account Code" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Account Notes" 'boolean '(#t #f))
+ (vector "Display" "Account Type" 'boolean '(#t #f))
+ (vector "Display" "Account Balance" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "80769921e87943adade887b9835a7685")
+ (cons 'report-name "Income/Expense Chart")
+ (cons 'options
+ (list
+ (vector "Display" "Show Income/Expense" 'boolean '(#t #f))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show Net Profit" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "f8921f4e5c284d7caca81e239f468a68")
+ (cons 'report-name "Tax Schedule Report/TXF Export")
+ (cons 'options
+ (list
+ (vector "Display" "Do not print transaction detail" 'boolean '(#t #f))
+ (vector "Display" "Do not print Action:Memo data" 'boolean '(#t #f))
+ (vector "Display" "Currency conversion date" 'multichoice '(conv-to-tran-date conv-to-report-date))
+ (vector "Display" "Print TXF export parameters" 'boolean '(#t #f))
+ (vector "Display" "Print all Transfer To/From Accounts" 'boolean '(#t #f))
+ (vector "Display" "Suppress $0.00 values" 'boolean '(#t #f))
+ (vector "Display" "Do not use special date processing" 'boolean '(#t #f))
+ (vector "Display" "Do not print full account names" 'boolean '(#t #f))
+ (vector "General" "Alternate Period" 'multichoice '(from-to #{1st-est}# #{2nd-est}# #{3rd-est}# #{4th-est}# last-year #{1st-last}# #{2nd-last}# #{3rd-last}# #{4th-last}#))
+ )))
+ (list (cons 'report-id "810ed4b25ef0486ea43bbd3dddb32b11")
+ (cons 'report-name "Budget Report")
+ (cons 'options
+ (list
+ (vector "Accounts" "Always show sub-accounts" 'boolean '(#t #f))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Accounts" "Account Display Depth" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Actual" 'boolean '(#t #f))
+ (vector "Display" "Show Budget" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances and budget values" 'boolean '(#t #f))
+ (vector "Display" "Roll up budget amounts to parent" 'boolean '(#t #f))
+ (vector "Display" "Show Column with Totals" 'boolean '(#t #f))
+ (vector "Display" "Show Difference" 'boolean '(#t #f))
+ (vector "General" "Report for range of budget periods" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Range end" 'multichoice '(first previous current next last manual))
+ (vector "General" "Include collapsed periods before selected." 'boolean '(#t #f))
+ (vector "General" "Range start" 'multichoice '(first previous current next last manual))
+ (vector "General" "Include collapsed periods after selected." 'boolean '(#t #f))
+ (vector "General" "Show Full Account Names" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "cbba1696c8c24744848062c7f1cf4a72")
+ (cons 'report-name "Net Worth Barchart")
+ (cons 'options
+ (list
+ (vector "Display" "Show Asset & Liability" 'boolean '(#t #f))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show Net Worth" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "4a6b82e8678c4f3d9e85d9f09634ca89")
+ (cons 'report-name "Investment Portfolio")
+ (cons 'options
+ (list
+ (vector "Accounts" "Include accounts with no shares" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "44f81bee049b4b3ea908f8dac9a9474e")
+ (cons 'report-name "Income Over Time")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
+ (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show long account names" 'boolean '(#t #f))
+ (vector "General" "Show Average" 'multichoice '(None MonthDelta WeekDelta DayDelta))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "5bf27f249a0d11e7abc4cec278b6b50a")
+ (cons 'report-name "Income and GST Statement")
+ (cons 'options
+ (list
+ (vector "Display" "Description" 'boolean '(#t #f))
+ (vector "Display" "Num" 'boolean '(#t #f))
+ (vector "Display" "Tax payable" 'boolean '(#t #f))
+ (vector "Display" "Individual income columns" 'boolean '(#t #f))
+ (vector "Display" "Use Full Account Name" 'boolean '(#t #f))
+ (vector "Display" "Net Income" 'boolean '(#t #f))
+ (vector "Display" "Use Full Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Individual expense columns" 'boolean '(#t #f))
+ (vector "Display" "Account Code" 'boolean '(#t #f))
+ (vector "Display" "Individual tax columns" 'boolean '(#t #f))
+ (vector "Display" "Remittance amount" 'boolean '(#t #f))
+ (vector "Display" "Memo" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Account Name" 'boolean '(#t #f))
+ (vector "Display" "Other Account Name" 'boolean '(#t #f))
+ (vector "Display" "Other Account Code" 'boolean '(#t #f))
+ (vector "Display" "Reconciled Date" 'boolean '(#t #f))
+ (vector "Display" "Subtotal Table" 'boolean '(#t #f))
+ (vector "Display" "Notes" 'boolean '(#t #f))
+ (vector "Display" "Date" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show Full Account Name" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Code" 'boolean '(#t #f))
+ (vector "Sorting" "Show Account Description" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Secondary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Add indenting columns" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Primary Subtotal" 'boolean '(#t #f))
+ (vector "Sorting" "Secondary Subtotal for Date Key" 'multichoice '(none daily weekly monthly quarterly yearly))
+ (vector "Sorting" "Primary Key" 'multichoice '(account-name account-code date reconciled-date reconciled-status register-order corresponding-acc-name corresponding-acc-code amount description number t-number memo notes none))
+ (vector "Sorting" "Primary Sort Order" 'multichoice '(ascend descend))
+ (vector "Sorting" "Show subtotals only (hide transactional data)" 'boolean '(#t #f))
+ (vector "Filter" "Void Transactions" 'multichoice '(non-void-only void-only both))
+ (vector "Filter" "Use regular expressions for transaction filter" 'boolean '(#t #f))
+ (vector "Filter" "Use regular expressions for account name filter" 'boolean '(#t #f))
+ (vector "Filter" "Reconcile Status" 'multichoice '(all unreconciled cleared reconciled))
+ (vector "General" "Table for Exporting" 'boolean '(#t #f))
+ (vector "General" "Add options summary" 'multichoice '(no-match always never))
+ (vector "General" "Common Currency" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "3fe6dce77da24c66bdc8f8efdea7f9ac")
+ (cons 'report-name "Liabilities")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "Display" "Show long names" 'boolean '(#t #f))
+ (vector "Display" "Show Percents" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "5123a759ceb9483abf2182d01c140e8d")
+ (cons 'report-name "Printable Invoice")
+ (cons 'options
+ (list
+ (vector "Display" "Individual Taxes" 'boolean '(#t #f))
+ (vector "Display" "Billing Terms" 'boolean '(#t #f))
+ (vector "Display" "References" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Invoice Notes" 'boolean '(#t #f))
+ (vector "Display" "Billing ID" 'boolean '(#t #f))
+ (vector "Display" "Payments" 'boolean '(#t #f))
+ (vector "Display" "Job Details" 'boolean '(#t #f))
+ (vector "Display Columns" "Tax Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Discount" 'boolean '(#t #f))
+ (vector "Display Columns" "Total" 'boolean '(#t #f))
+ (vector "Display Columns" "Action" 'boolean '(#t #f))
+ (vector "Display Columns" "Taxable" 'boolean '(#t #f))
+ (vector "Display Columns" "Quantity" 'boolean '(#t #f))
+ (vector "Display Columns" "Price" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "21d7cfc59fc74f22887596ebde7e462d")
+ (cons 'report-name "Advanced Portfolio")
+ (cons 'options
+ (list
+ (vector "Accounts" "Include accounts with no shares" 'boolean '(#t #f))
+ (vector "Display" "Show ticker symbols" 'boolean '(#t #f))
+ (vector "Display" "Show number of shares" 'boolean '(#t #f))
+ (vector "Display" "Show prices" 'boolean '(#t #f))
+ (vector "Display" "Show listings" 'boolean '(#t #f))
+ (vector "General" "How to report brokerage fees" 'multichoice '(include-in-basis include-in-gain ignore-brokerage))
+ (vector "General" "Price Source" 'multichoice '(pricedb-latest pricedb-nearest))
+ (vector "General" "Basis calculation method" 'multichoice '(average-basis fifo-basis filo-basis))
+ (vector "General" "Set preference for price list data" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "7eb3df21073d4c33920a0257da15fba5")
+ (cons 'report-name "Receipt")
+ (cons 'options
+ (list
+ )))
+ (list (cons 'report-id "e6e34fa3b6e748debde3cb3bc76d3e53")
+ (cons 'report-name "Budget Flow")
+ (cons 'options
+ (list
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "b1f15b2052c149df93e698fe85a81ea6")
+ (cons 'report-name "Expense Over Time")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
+ (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show long account names" 'boolean '(#t #f))
+ (vector "General" "Show Average" 'multichoice '(None MonthDelta WeekDelta DayDelta))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "898d78ec92854402bf76e20a36d24ade")
+ (cons 'report-name "Hello, World")
+ (cons 'options
+ (list
+ (vector "Hello, World!" "Multi Choice Option" 'multichoice '(first second third fourth))
+ (vector "Hello, World!" "Boolean Option" 'boolean '(#t #f))
+ (vector "Testing" "Crash the report" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "5e2d129f28d14df881c3e47e3053f604")
+ (cons 'report-name "Income vs. Day of Week")
+ (cons 'options
+ (list
+ (vector "Accounts" "Include Sub-Accounts" 'boolean '(#t #f))
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "faf410e8f8da481fbc09e4763da40bcc")
+ (cons 'report-name "Liabilities Over Time")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Chart Type" 'multichoice '(barchart linechart))
+ (vector "Display" "Use Stacked Charts" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show long account names" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "0b81a3bdfd504aff849ec2e8630524bc")
+ (cons 'report-name "Income Statement")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries pattern is case-sensitive" 'boolean '(#t #f))
+ (vector "Entries" "Closing Entries Pattern is regular expression" 'boolean '(#t #f))
+ (vector "Display" "Display as a two column report" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Label the revenue section" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Include expense total" 'boolean '(#t #f))
+ (vector "Display" "Include trading accounts total" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Include revenue total" 'boolean '(#t #f))
+ (vector "Display" "Label the expense section" 'boolean '(#t #f))
+ (vector "Display" "Label the trading accounts section" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "415cd38d39054d9e9c4040455290c2b1")
+ (cons 'report-name "Budget Chart")
+ (cons 'options
+ (list
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Chart Type" 'multichoice '(bars lines))
+ (vector "Display" "Running Sum" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "f8748b813fab4220ba26e743aedf38da")
+ (cons 'report-name "Cash Flow")
+ (cons 'options
+ (list
+ (vector "Accounts" "Always show sub-accounts" 'boolean '(#t #f))
+ (vector "Accounts" "Include Trading Accounts in report" 'boolean '(#t #f))
+ (vector "Accounts" "Account Display Depth" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "General" "Show Full Account Names" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "65135608f2014c6ca8412793a8cdf169")
+ (cons 'report-name "Welcome to GnuCash")
+ (cons 'options
+ (list
+ )))
+ (list (cons 'report-id "d7d1e53505ee4b1b82efad9eacedaea0")
+ (cons 'report-name "Vendor Report")
+ (cons 'options
+ (list
+ (vector "Display Columns" "Tax" 'boolean '(#t #f))
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Debits" 'boolean '(#t #f))
+ (vector "Display Columns" "Type" 'boolean '(#t #f))
+ (vector "Display Columns" "Due Date" 'boolean '(#t #f))
+ (vector "Display Columns" "Sale" 'boolean '(#t #f))
+ (vector "Display Columns" "Reference" 'boolean '(#t #f))
+ (vector "Display Columns" "Credits" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ (vector "General" "Due or Post Date" 'multichoice '(duedate postdate))
+ (vector "__reg" "reverse?" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "5518ac227e474f47a34439f2d4d049de")
+ (cons 'report-name "Job Report")
+ (cons 'options
+ (list
+ (vector "Display Columns" "Description" 'boolean '(#t #f))
+ (vector "Display Columns" "Amount" 'boolean '(#t #f))
+ (vector "Display Columns" "Type" 'boolean '(#t #f))
+ (vector "Display Columns" "Due Date" 'boolean '(#t #f))
+ (vector "Display Columns" "Reference" 'boolean '(#t #f))
+ (vector "Display Columns" "Date" 'boolean '(#t #f))
+ (vector "__reg" "reverse?" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "e5fa5ce805e840ecbeca4dba3fa4ead9")
+ (cons 'report-name "Budget Profit & Loss")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Display" "Display as a two column report" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Display in standard, income first, order" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Label the revenue section" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Include expense total" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Include revenue total" 'boolean '(#t #f))
+ (vector "Display" "Label the expense section" 'boolean '(#t #f))
+ (vector "General" "Report for range of budget periods" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "e533c998186b11e1b2e2001558291366")
+ (cons 'report-name "Income & Expense Linechart")
+ (cons 'options
+ (list
+ (vector "Display" "Grid" 'boolean '(#t #f))
+ (vector "Display" "Data markers?" 'boolean '(#t #f))
+ (vector "Display" "Show Income/Expense" 'boolean '(#t #f))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show Net Profit" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "22104e02654c4adba844ee75a3f8d173")
+ (cons 'report-name "Register")
+ (cons 'options
+ (list
+ (vector "Display" "Description" 'boolean '(#t #f))
+ (vector "Display" "Account" 'boolean '(#t #f))
+ (vector "Display" "Amount" 'multichoice '(single double))
+ (vector "Display" "Num" 'boolean '(#t #f))
+ (vector "Display" "Running Balance" 'boolean '(#t #f))
+ (vector "Display" "Shares" 'boolean '(#t #f))
+ (vector "Display" "Lot" 'boolean '(#t #f))
+ (vector "Display" "Memo" 'boolean '(#t #f))
+ (vector "Display" "Totals" 'boolean '(#t #f))
+ (vector "Display" "Price" 'boolean '(#t #f))
+ (vector "Display" "Date" 'boolean '(#t #f))
+ (vector "Display" "Value" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "d8b63264186b11e19038001558291366")
+ (cons 'report-name "Net Worth Linechart")
+ (cons 'options
+ (list
+ (vector "Display" "Grid" 'boolean '(#t #f))
+ (vector "Display" "Show Asset & Liability" 'boolean '(#t #f))
+ (vector "Display" "Data markers?" 'boolean '(#t #f))
+ (vector "Display" "Show table" 'boolean '(#t #f))
+ (vector "Display" "Show Net Worth" 'boolean '(#t #f))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "1d241609fd4644caad765c95be20ff4c")
+ (cons 'report-name "Price")
+ (cons 'options
+ (list
+ (vector "Display" "Marker" 'multichoice '(diamond circle square cross plus dash filleddiamond filledcircle filledsquare))
+ (vector "Price" "Invert prices" 'boolean '(#t #f))
+ (vector "Price" "Price Source" 'multichoice '(weighted-average actual-transactions pricedb))
+ (vector "General" "Step Size" 'multichoice '(DayDelta WeekDelta TwoWeekDelta MonthDelta QuarterDelta HalfYearDelta YearDelta))
+ )))
+ (list (cons 'report-id "ecc35ea9dbfa4e20ba389fc85d59cb69")
+ (cons 'report-name "Budget Balance Sheet")
+ (cons 'options
+ (list
+ (vector "Commodities" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ (vector "Commodities" "Show Exchange Rates" 'boolean '(#t #f))
+ (vector "Commodities" "Show Foreign Currencies" 'boolean '(#t #f))
+ (vector "Accounts" "Levels of Subaccounts" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Accounts" "Flatten list to depth limit" 'boolean '(#t #f))
+ (vector "Display" "Show accounting-style rules" 'boolean '(#t #f))
+ (vector "Display" "Display accounts as hyperlinks" 'boolean '(#t #f))
+ (vector "Display" "Parent account balances" 'multichoice '(immediate-bal recursive-bal omit-bal))
+ (vector "Display" "Include assets total" 'boolean '(#t #f))
+ (vector "Display" "Include accounts with zero total balances" 'boolean '(#t #f))
+ (vector "Display" "Parent account subtotals" 'multichoice '(t f canonically-tabbed))
+ (vector "Display" "Include liabilities total" 'boolean '(#t #f))
+ (vector "Display" "Label the liabilities section" 'boolean '(#t #f))
+ (vector "Display" "Include new/existing totals" 'boolean '(#t #f))
+ (vector "Display" "Omit zero balance figures" 'boolean '(#t #f))
+ (vector "Display" "Label the assets section" 'boolean '(#t #f))
+ (vector "Display" "Include equity total" 'boolean '(#t #f))
+ (vector "Display" "Label the equity section" 'boolean '(#t #f))
+ (vector "General" "Single column Balance Sheet" 'boolean '(#t #f))
+ )))
+ (list (cons 'report-id "5c7fd8a1fe9a4cd38884ff54214aa88a")
+ (cons 'report-name "Assets")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "Display" "Show long names" 'boolean '(#t #f))
+ (vector "Display" "Show Percents" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ (list (cons 'report-id "9bf1892805cb4336be6320fe48ce5446")
+ (cons 'report-name "Expense Accounts")
+ (cons 'options
+ (list
+ (vector "Accounts" "Show Accounts until level" 'multichoice '(all 1 2 3 4 5 6))
+ (vector "Display" "Show Totals" 'boolean '(#t #f))
+ (vector "Display" "Show long names" 'boolean '(#t #f))
+ (vector "Display" "Show Percents" 'boolean '(#t #f))
+ (vector "Display" "Sort Method" 'multichoice '(acct-code alphabetical amount))
+ (vector "General" "Show Average" 'multichoice '(None YearDelta MonthDelta WeekDelta))
+ (vector "General" "Price Source" 'multichoice '(average-cost weighted-average pricedb-latest pricedb-nearest))
+ )))
+ ))
commit 694d0f06133826ecc036b026fbf0290455206b13
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 10 23:31:36 2018 +0800
[budget-flow] fix report-title not defined
this report uses reportname instead
diff --git a/gnucash/report/standard-reports/budget-flow.scm b/gnucash/report/standard-reports/budget-flow.scm
index f718968..d15b81e 100644
--- a/gnucash/report/standard-reports/budget-flow.scm
+++ b/gnucash/report/standard-reports/budget-flow.scm
@@ -295,7 +295,7 @@
(gnc:html-document-add-object!
doc
(gnc:html-make-no-account-warning
- report-title (gnc:report-id report-obj))))
+ reportname (gnc:report-id report-obj))))
((not budget-valid?)
;; No budget selected.
commit 57c6f175b442988c2135dc250c39b4c7d8e726be
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 10 23:30:55 2018 +0800
[html-chart] num-columns return 0 for empty-table
this commit fixes whereby data is '() indicating no columns
diff --git a/gnucash/report/report-system/html-table.scm b/gnucash/report/report-system/html-table.scm
index 41a615f..97615b6 100644
--- a/gnucash/report/report-system/html-table.scm
+++ b/gnucash/report/report-system/html-table.scm
@@ -326,7 +326,7 @@
(record-modifier <html-table> 'num-rows))
(define (gnc:html-table-num-columns table)
- (apply max (map length (gnc:html-table-data table))))
+ (apply max (cons 0 (map length (gnc:html-table-data table)))))
(define (gnc:html-table-append-row/markup! table markup newrow)
(let ((rownum (gnc:html-table-append-row! table newrow)))
commit e2907844be26d61914385e3932fe1de2ca31b588
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Tue Jul 10 23:30:26 2018 +0800
[customer-summary] prevents crash on empty-book with no accounts
diff --git a/gnucash/report/business-reports/customer-summary.scm b/gnucash/report/business-reports/customer-summary.scm
index b0384be..f6e05c5 100644
--- a/gnucash/report/business-reports/customer-summary.scm
+++ b/gnucash/report/business-reports/customer-summary.scm
@@ -699,7 +699,7 @@
(expense-accounts (opt-val pagename-expenseaccounts optname-expenseaccounts))
(income-accounts (opt-val pagename-incomeaccounts optname-incomeaccounts))
(all-accounts (append income-accounts expense-accounts))
- (book (gnc-account-get-book (car all-accounts)))
+ (book (gnc-get-current-book))
(date-format (gnc:options-fancy-date book))
(type (opt-val "__reg" "owner-type"))
(reverse? (opt-val "__reg" "reverse?"))
commit ff91056ab1227004953ad867413f0707cd839e69
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jul 15 16:55:55 2018 -0700
Resolve ubuntu 14.04 naming conflict.
diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c
index 7aeeda8..7b9b8cb 100644
--- a/libgnucash/app-utils/gnc-ui-util.c
+++ b/libgnucash/app-utils/gnc-ui-util.c
@@ -82,7 +82,7 @@ static gboolean reverse_type[NUM_ACCOUNT_TYPES];
static gchar *user_default_currency = NULL;
static gchar *user_report_currency = NULL;
const static int maximum_decimals = 15;
-static const gint64 pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000,
+static const gint64 pow_10[] = {1, 10, 100, 1000, 10000, 100000, 1000000,
10000000, 100000000, 1000000000, 10000000000,
100000000000, 1000000000000, 10000000000000,
100000000000000, 1000000000000000};
@@ -1398,17 +1398,16 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
value_is_decimal = gnc_numeric_to_decimal(&val, NULL);
if (!value_is_decimal && info->force_fit && info->round)
{
- gint64 denom = pow10[maximum_decimals];
/* if there's a commodity use 100x the commodity's fraction. N.B. This
* assumes that commodity fractions are multiples of 10, a reasonable
* assumption in 2018. Otherwise, if there's a reasonable
* max_decimal_places, use that.
*/
- if (info->commodity)
- denom = gnc_commodity_get_fraction(info->commodity) * 100;
- else if (info->max_decimal_places &&
- info->max_decimal_places <= maximum_decimals)
- denom = pow10[info->max_decimal_places];
+ const gint64 denom = info->commodity ?
+ gnc_commodity_get_fraction(info->commodity) * 100 :
+ (info->max_decimal_places &&
+ info->max_decimal_places <= maximum_decimals) ?
+ pow_10[info->max_decimal_places] : pow_10[maximum_decimals];
val = gnc_numeric_convert(val, denom, GNC_HOW_RND_ROUND_HALF_UP);
value_is_decimal = gnc_numeric_to_decimal(&val, NULL);
}
commit a51be5157c383b15a3bddf314b61293cff19c3dd
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jul 15 14:18:01 2018 -0700
Add preference for forcing prices to decimal display.
Anticipating that some users might prefer to see exact prices,
add a preference to General>Numbers to configure whether prices
are rounded to decimals or are displayed as exact fractions.
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index 44d3126..6859da3 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -65,6 +65,11 @@
<summary>Number of automatic decimal places</summary>
<description>This field specifies the number of automatic decimal places that will be filled in.</description>
</key>
+ <key name='force-price-decimal' type="b">
+ <default>false</default>
+ <summary>Force prices to display as decimals even if they must be rounded.</summary>
+ <description>If active, GnuCash will round prices as necessary to display them as decimals instead of displaying the exact fraction if the fractional part cannont be exactly represented as a decimal.</description>
+ </key>
<key name="migrate-prefs-done" type="b">
<default>false</default>
<summary>Tool to migrate preferences from old backend (CGonf) to new one (GSettings) has run successfully.</summary>
diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade
index 3a6631d..1514105 100644
--- a/gnucash/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gtkbuilder/dialog-preferences.glade
@@ -1338,7 +1338,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">12</property>
+ <property name="top_attach">13</property>
</packing>
</child>
<child>
@@ -1356,7 +1356,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">12</property>
+ <property name="top_attach">13</property>
</packing>
</child>
<child>
@@ -1375,7 +1375,7 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">11</property>
+ <property name="top_attach">12</property>
</packing>
</child>
<child>
@@ -1394,6 +1394,25 @@ many months before the current month:</property>
</object>
<packing>
<property name="left_attach">0</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="pref/general/force-price-decimal">
+ <property name="label" translatable="yes">Force P_rices to display as decimals.</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Force prices to display as decimals even if they must be rounded.</property>
+ <property name="tooltip_text" translatable="yes">If active, GnuCash will round prices as necessary to display them as decimals instead of displaying the exact fraction if the fractional part cannont be exactly represented as a decimal.</property>
+ <property name="halign">start</property>
+ <property name="margin_left">12</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
<property name="top_attach">10</property>
</packing>
</child>
diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c
index 30535c7..7aeeda8 100644
--- a/libgnucash/app-utils/gnc-ui-util.c
+++ b/libgnucash/app-utils/gnc-ui-util.c
@@ -66,6 +66,7 @@
#define GNC_PREF_REVERSED_ACCTS_NONE "reversed-accounts-none"
#define GNC_PREF_REVERSED_ACCTS_CREDIT "reversed-accounts-credit"
#define GNC_PREF_REVERSED_ACCTS_INC_EXP "reversed-accounts-incomeexpense"
+#define GNC_PREF_PRICES_FORCE_DECIMAL "force-price-decimal"
static QofLogModule log_module = GNC_MOD_GUI;
@@ -1325,6 +1326,8 @@ GNCPrintAmountInfo
gnc_default_price_print_info (const gnc_commodity *curr)
{
GNCPrintAmountInfo info;
+ gboolean force = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL,
+ GNC_PREF_PRICES_FORCE_DECIMAL);
info.commodity = curr;
if (info.commodity)
@@ -1345,8 +1348,9 @@ gnc_default_price_print_info (const gnc_commodity *curr)
info.use_symbol = 0;
info.use_locale = 1;
info.monetary = 1;
- info.force_fit = TRUE;
- info.round = TRUE;
+
+ info.force_fit = force;
+ info.round = force;
return info;
}
commit 1fffbaf856921906e195803726375765a2eacaa0
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jul 15 13:20:21 2018 -0700
Bug 794755 - Commodity Register displays fractional prices
When printing numbers convert them to a new decimal denominator with
rounding if the passed-in print info specifies that they should be
forced and rounded.
Make the default price settings forced and rounded.
Pass the price currency to gnc_default_price_print_info and
use the currency's fraction * 100 to determine the round-to
denominator and the number of decimal places to display.
diff --git a/gnucash/gnome-utils/gnc-tree-view-split-reg.c b/gnucash/gnome-utils/gnc-tree-view-split-reg.c
index a309cbe..c10d3af 100644
--- a/gnucash/gnome-utils/gnc-tree-view-split-reg.c
+++ b/gnucash/gnome-utils/gnc-tree-view-split-reg.c
@@ -1805,12 +1805,9 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
}
else
{
- GNCPrintAmountInfo print_info;
-
- print_info = gnc_default_price_print_info();
- print_info.min_decimal_places = 2;
-
- num = gnc_numeric_convert (gnc_tree_util_get_rate_for (view, trans, split, is_blank), 1000000, GNC_HOW_RND_ROUND_HALF_UP);
+ GNCPrintAmountInfo print_info =
+ gnc_default_price_print_info(xaccTransGetCurrency(trans));
+ num = gnc_tree_util_get_rate_for (view, trans, split, is_blank);
if (gnc_numeric_check (num) == GNC_ERROR_OK)
s = xaccPrintAmount (num, print_info);
diff --git a/gnucash/gnome/assistant-loan.c b/gnucash/gnome/assistant-loan.c
index 26370f5..388af79 100644
--- a/gnucash/gnome/assistant-loan.c
+++ b/gnucash/gnome/assistant-loan.c
@@ -2213,7 +2213,7 @@ loan_rev_update_view( LoanAssistantData *ldd, GDate *start, GDate *end )
GtkListStore *store;
GtkTreeIter iter;
- pai = gnc_default_price_print_info();
+ pai = gnc_default_price_print_info(NULL);
pai.min_decimal_places = 2;
store = GTK_LIST_STORE(gtk_tree_view_get_model( ldd->revView ));
@@ -2522,7 +2522,7 @@ ld_setup_repayment_sx( LoanAssistantData *ldd,
TTSplitInfo *fromSplit = NULL;
TTSplitInfo *ttsi;
TTInfo *toTxn = NULL;
- GNCPrintAmountInfo pricePAI = gnc_default_price_print_info();
+ GNCPrintAmountInfo pricePAI = gnc_default_price_print_info(NULL);
#define AMTBUF_LEN 64
gchar amtBuf[AMTBUF_LEN];
gint GNCN_HOW = (GNC_HOW_DENOM_SIGFIGS(2) | GNC_HOW_RND_ROUND_HALF_UP);
diff --git a/gnucash/gnome/assistant-stock-split.c b/gnucash/gnome/assistant-stock-split.c
index c5c4f8e..287a437 100644
--- a/gnucash/gnome/assistant-stock-split.c
+++ b/gnucash/gnome/assistant-stock-split.c
@@ -630,7 +630,7 @@ gnc_stock_split_assistant_create (StockSplitInfo *info)
amount = gnc_amount_edit_new ();
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (amount),
- gnc_default_price_print_info ());
+ gnc_default_price_print_info (gnc_default_currency()));
g_signal_connect (amount, "changed",
G_CALLBACK (gnc_stock_split_details_valid_cb), info);
gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (amount), TRUE);
diff --git a/gnucash/gnome/dialog-price-editor.c b/gnucash/gnome/dialog-price-editor.c
index a787284..5b474c6 100644
--- a/gnucash/gnome/dialog-price-editor.c
+++ b/gnucash/gnome/dialog-price-editor.c
@@ -461,7 +461,7 @@ gnc_price_pedit_dialog_create (GtkWidget *parent,
pedit_dialog->price_edit = w;
gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (w), TRUE);
- print_info = gnc_default_price_print_info ();
+ print_info = gnc_default_price_print_info (gnc_currency_edit_get_currency (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit)));
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (w), print_info);
gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
gtk_widget_show (w);
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index 80fea42..bc65d38 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -1201,6 +1201,7 @@ gnc_split_register_get_rate_entry (VirtualLocation virt_loc,
Split *split, *osplit;
Transaction *txn;
gnc_numeric amount, value, convrate;
+ gnc_commodity *curr;
SRInfo *info = gnc_split_register_get_info (reg);
if (info->rate_reset == RATE_RESET_REQD && info->auto_complete)
@@ -1216,7 +1217,7 @@ gnc_split_register_get_rate_entry (VirtualLocation virt_loc,
*/
osplit = xaccSplitGetOtherSplit (split);
txn = gnc_split_register_get_trans (reg, virt_loc.vcell_loc);
-
+ curr = xaccTransGetCurrency (xaccSplitGetParent (split));
if (!gnc_split_register_current_trans_expanded (reg) && osplit &&
!gnc_split_register_needs_conv_rate(reg, txn,
xaccSplitGetAccount(split)))
@@ -1232,7 +1233,7 @@ gnc_split_register_get_rate_entry (VirtualLocation virt_loc,
convrate = gnc_numeric_div (amount, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE);
- return xaccPrintAmount (convrate, gnc_default_price_print_info ());
+ return xaccPrintAmount (convrate, gnc_default_price_print_info (curr));
}
static const char *
@@ -1361,6 +1362,7 @@ gnc_split_register_get_price_entry (VirtualLocation virt_loc,
{
SplitRegister *reg = user_data;
gnc_numeric price;
+ gnc_commodity *curr;
Split *split;
if (!gnc_split_register_use_security_cells (reg, virt_loc))
@@ -1369,10 +1371,11 @@ gnc_split_register_get_price_entry (VirtualLocation virt_loc,
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
price = xaccSplitGetSharePrice (split);
+ curr = xaccTransGetCurrency (xaccSplitGetParent (split));
if (gnc_numeric_zero_p (price))
return NULL;
- return xaccPrintAmount (price, gnc_default_price_print_info ());
+ return xaccPrintAmount (price, gnc_default_price_print_info (curr));
}
static char *
diff --git a/gnucash/register/ledger-core/split-register.c b/gnucash/register/ledger-core/split-register.c
index 5bbfdd0..f534f28 100644
--- a/gnucash/register/ledger-core/split-register.c
+++ b/gnucash/register/ledger-core/split-register.c
@@ -2648,7 +2648,7 @@ gnc_split_register_config_cells (SplitRegister *reg)
gnc_price_cell_set_print_info
((PriceCell *)
gnc_table_layout_get_cell (reg->table->layout, PRIC_CELL),
- gnc_default_price_print_info ());
+ gnc_default_price_print_info (gnc_default_currency ()));
break;
default:
diff --git a/libgnucash/app-utils/gnc-ui-util.c b/libgnucash/app-utils/gnc-ui-util.c
index 5fa6430..30535c7 100644
--- a/libgnucash/app-utils/gnc-ui-util.c
+++ b/libgnucash/app-utils/gnc-ui-util.c
@@ -80,6 +80,11 @@ static gboolean reverse_type[NUM_ACCOUNT_TYPES];
* as that will change any time the book changes. */
static gchar *user_default_currency = NULL;
static gchar *user_report_currency = NULL;
+const static int maximum_decimals = 15;
+static const gint64 pow10[] = {1, 10, 100, 1000, 10000, 100000, 1000000,
+ 10000000, 100000000, 1000000000, 10000000000,
+ 100000000000, 1000000000000, 10000000000000,
+ 100000000000000, 1000000000000000};
gchar *gnc_normalize_account_separator (const gchar* separator)
{
@@ -1317,17 +1322,31 @@ gnc_share_print_info_places (int decplaces)
}
GNCPrintAmountInfo
-gnc_default_price_print_info (void)
+gnc_default_price_print_info (const gnc_commodity *curr)
{
- static GNCPrintAmountInfo info;
- static gboolean got_it = FALSE;
+ GNCPrintAmountInfo info;
+ info.commodity = curr;
- if (!got_it)
+ if (info.commodity)
{
- info = gnc_default_print_info_helper (6);
- got_it = TRUE;
+ int frac = gnc_commodity_get_fraction (curr);
+ guint8 decplaces = 2;
+ while (frac != 1 && (frac % 10) == 0 && (frac /= 10)) ++decplaces;
+ info.max_decimal_places = decplaces;
+ info.min_decimal_places = decplaces;
+ }
+ else
+ {
+ info.max_decimal_places = 6;
+ info.min_decimal_places = 0;
}
+ info.use_separators = 1;
+ info.use_symbol = 0;
+ info.use_locale = 1;
+ info.monetary = 1;
+ info.force_fit = TRUE;
+ info.round = TRUE;
return info;
}
@@ -1373,7 +1392,22 @@ PrintAmountInternal(char *buf, gnc_numeric val, const GNCPrintAmountInfo *info)
/* Try to print as decimal. */
value_is_decimal = gnc_numeric_to_decimal(&val, NULL);
-
+ if (!value_is_decimal && info->force_fit && info->round)
+ {
+ gint64 denom = pow10[maximum_decimals];
+ /* if there's a commodity use 100x the commodity's fraction. N.B. This
+ * assumes that commodity fractions are multiples of 10, a reasonable
+ * assumption in 2018. Otherwise, if there's a reasonable
+ * max_decimal_places, use that.
+ */
+ if (info->commodity)
+ denom = gnc_commodity_get_fraction(info->commodity) * 100;
+ else if (info->max_decimal_places &&
+ info->max_decimal_places <= maximum_decimals)
+ denom = pow10[info->max_decimal_places];
+ val = gnc_numeric_convert(val, denom, GNC_HOW_RND_ROUND_HALF_UP);
+ value_is_decimal = gnc_numeric_to_decimal(&val, NULL);
+ }
/* Force at least auto_decimal_places zeros */
if (auto_decimal_enabled)
{
diff --git a/libgnucash/app-utils/gnc-ui-util.h b/libgnucash/app-utils/gnc-ui-util.h
index 7161bca..884bdc6 100644
--- a/libgnucash/app-utils/gnc-ui-util.h
+++ b/libgnucash/app-utils/gnc-ui-util.h
@@ -293,7 +293,7 @@ GNCPrintAmountInfo gnc_split_amount_print_info (Split *split,
GNCPrintAmountInfo gnc_share_print_info_places (int decplaces);
GNCPrintAmountInfo gnc_default_share_print_info (void);
-GNCPrintAmountInfo gnc_default_price_print_info (void);
+GNCPrintAmountInfo gnc_default_price_print_info (const gnc_commodity *curr);
GNCPrintAmountInfo gnc_integral_print_info (void);
commit 374477c3604112349bf685afacdf80d8681a64f2
Merge: 8c4a5ad 36dc2ac
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Jul 15 10:47:19 2018 -0700
Merge Bob Fewell's 'color-accounts' into maint.
commit 8c4a5adb43a1ca9a90fdee565625136349771405
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:42:24 2018 +0100
Align the Reconcile totals in the Reconcile Window.
This change aligns the totals with the account column by obtaining the
reconcile column width and adjusting the label padding. This is done at
initial display so it does not track column resizing or the use of the
scrollbar.
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index 713d2de..382807a 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -233,6 +233,18 @@ gnc_reconcile_view_tooltip_cb (GNCQueryView *qview, gint x, gint y,
}
+gint
+gnc_reconcile_view_get_column_width (GNCReconcileView *view, gint column)
+{
+ GNCQueryView *qview = GNC_QUERY_VIEW (view);
+ GtkTreeViewColumn *col;
+
+ //allow for pointer model column at column 0
+ col = gtk_tree_view_get_column (GTK_TREE_VIEW (qview), (column - 1));
+ return gtk_tree_view_column_get_width (col);
+}
+
+
void
gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpadding)
{
diff --git a/gnucash/gnome/reconcile-view.h b/gnucash/gnome/reconcile-view.h
index 13763d2..1265794 100644
--- a/gnucash/gnome/reconcile-view.h
+++ b/gnucash/gnome/reconcile-view.h
@@ -112,6 +112,8 @@ gboolean gnc_reconcile_view_changed (GNCReconcileView *view);
void gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpadding);
+gint gnc_reconcile_view_get_column_width (GNCReconcileView *view, gint column);
+
G_END_DECLS
#endif /* GNC_RECONCILE_VIEW_H */
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index d4b0dd9..1bcf896 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -2001,6 +2001,18 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
gtk_widget_grab_focus (recnData->debit);
+ { // align the Totals value with that of the amount column
+ gint recn_widthc = gnc_reconcile_view_get_column_width (GNC_RECONCILE_VIEW(recnData->credit), REC_RECN);
+ gint recn_widthd = gnc_reconcile_view_get_column_width (GNC_RECONCILE_VIEW(recnData->debit), REC_RECN);
+
+#if GTK_CHECK_VERSION(3,12,0)
+ gtk_widget_set_margin_end (GTK_WIDGET(recnData->total_credit), 10 + recn_widthc);
+ gtk_widget_set_margin_end (GTK_WIDGET(recnData->total_debit), 10 + recn_widthd);
+#else
+ gtk_widget_set_margin_right (GTK_WIDGET(recnData->total_credit), 10 + recn_widthc);
+ gtk_widget_set_margin_right (GTK_WIDGET(recnData->total_debit), 10 + recn_widthd);
+#endif
+ }
return recnData;
}
commit b95981e6af9a47e09c104c08a448553d19dfa53b
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:41:30 2018 +0100
Bug 796751 - reconcile window usability - R column should be...
next to Amount.
With the use of the previous update the original order is possible as
the scrollbar is not hovering over the reconcile tick box
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index e3d2389..713d2de 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -242,6 +242,7 @@ gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpaddi
GtkCellRenderer *cr0;
gint xpad, ypad;
+ //allow for pointer model column at column 0
col = gtk_tree_view_get_column (GTK_TREE_VIEW (qview), (column - 1));
renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (col));
cr0 = g_list_nth_data (renderers, 0);
@@ -328,8 +329,8 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
/* Create the list store with 6 columns and add to treeview,
column 0 will be a pointer to the entry */
- liststore = gtk_list_store_new (6, G_TYPE_POINTER, G_TYPE_BOOLEAN,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING );
+ liststore = gtk_list_store_new (6, G_TYPE_POINTER, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN );
gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (liststore));
g_object_unref (liststore);
@@ -407,6 +408,15 @@ gnc_reconcile_view_init (GNCReconcileView *view)
view->account = NULL;
view->sibling = NULL;
+ param = gnc_search_param_simple_new();
+ gnc_search_param_set_param_fcn (param, QOF_TYPE_BOOLEAN,
+ gnc_reconcile_view_is_reconciled, view);
+ gnc_search_param_set_title ((GNCSearchParam *) param, _("Reconciled:R") + 11);
+ gnc_search_param_set_justify ((GNCSearchParam *) param, GTK_JUSTIFY_CENTER);
+ gnc_search_param_set_passive ((GNCSearchParam *) param, FALSE);
+ gnc_search_param_set_non_resizeable ((GNCSearchParam *) param, TRUE);
+ columns = g_list_prepend (columns, param);
+
columns = gnc_search_param_prepend_with_justify (columns, _("Amount"),
GTK_JUSTIFY_RIGHT,
NULL, GNC_ID_SPLIT,
@@ -426,15 +436,6 @@ gnc_reconcile_view_init (GNCReconcileView *view)
columns = gnc_search_param_prepend (columns, _("Date"), NULL, GNC_ID_SPLIT,
SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
- param = gnc_search_param_simple_new();
- gnc_search_param_set_param_fcn (param, QOF_TYPE_BOOLEAN,
- gnc_reconcile_view_is_reconciled, view);
- gnc_search_param_set_title ((GNCSearchParam *) param, _("Reconciled:R") + 11);
- gnc_search_param_set_justify ((GNCSearchParam *) param, GTK_JUSTIFY_CENTER);
- gnc_search_param_set_passive ((GNCSearchParam *) param, FALSE);
- gnc_search_param_set_non_resizeable ((GNCSearchParam *) param, TRUE);
- columns = g_list_prepend (columns, param);
-
view->column_list = columns;
}
diff --git a/gnucash/gnome/reconcile-view.h b/gnucash/gnome/reconcile-view.h
index 4206935..13763d2 100644
--- a/gnucash/gnome/reconcile-view.h
+++ b/gnucash/gnome/reconcile-view.h
@@ -47,11 +47,11 @@ typedef enum
enum
{
REC_POINTER, //0
- REC_RECN, //1
- REC_DATE, //2
- REC_NUM, //3
- REC_DESC, //4
- REC_AMOUNT //5
+ REC_DATE, //1
+ REC_NUM, //2
+ REC_DESC, //3
+ REC_AMOUNT, //4
+ REC_RECN, //5
};
struct GNCReconcileView
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index cdb4050..d4b0dd9 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1190,8 +1190,8 @@ gnc_reconcile_window_create_view_box(Account *account,
vscroll = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (scrollWin));
gtk_widget_get_preferred_size (vscroll, NULL, &nat_sb);
- // add xpadding to amount column so scrollbar does not cover
- gnc_reconcile_view_add_padding (GNC_RECONCILE_VIEW(view), REC_AMOUNT, nat_sb.width);
+ // add xpadding to recn column so scrollbar does not cover
+ gnc_reconcile_view_add_padding (GNC_RECONCILE_VIEW(view), REC_RECN, nat_sb.width);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
commit aa77b21dfb49c2ba2c86814d0362fc0dca7c5d26
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:40:18 2018 +0100
Reconcile vertical scrollbars hover over tree view data
In the reconcile window the vertical scrollbars when selected obscure
the tree view data so get the width of the scrollbar and add it to the
cell renderer x padding of the last column.
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index 673825e..e3d2389 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -233,6 +233,25 @@ gnc_reconcile_view_tooltip_cb (GNCQueryView *qview, gint x, gint y,
}
+void
+gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpadding)
+{
+ GNCQueryView *qview = GNC_QUERY_VIEW (view);
+ GtkTreeViewColumn *col;
+ GList *renderers;
+ GtkCellRenderer *cr0;
+ gint xpad, ypad;
+
+ col = gtk_tree_view_get_column (GTK_TREE_VIEW (qview), (column - 1));
+ renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (col));
+ cr0 = g_list_nth_data (renderers, 0);
+ g_list_free (renderers);
+
+ gtk_cell_renderer_get_padding (cr0, &xpad, &ypad);
+ gtk_cell_renderer_set_padding (cr0, xpadding, ypad);
+}
+
+
/****************************************************************************\
* gnc_reconcile_view_new *
* creates the account tree *
diff --git a/gnucash/gnome/reconcile-view.h b/gnucash/gnome/reconcile-view.h
index f0d433e..4206935 100644
--- a/gnucash/gnome/reconcile-view.h
+++ b/gnucash/gnome/reconcile-view.h
@@ -110,6 +110,8 @@ void gnc_reconcile_view_unselect_all (GNCReconcileView *view);
gboolean gnc_reconcile_view_changed (GNCReconcileView *view);
+void gnc_reconcile_view_add_padding (GNCReconcileView *view, gint column, gint xpadding);
+
G_END_DECLS
#endif /* GNC_RECONCILE_VIEW_H */
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 6d6f8b7..cdb4050 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1141,6 +1141,8 @@ gnc_reconcile_window_create_view_box(Account *account,
GtkWidget **total_save)
{
GtkWidget *frame, *scrollWin, *view, *vbox, *label, *hbox;
+ GtkWidget *vscroll;
+ GtkRequisition nat_sb;
frame = gtk_frame_new(NULL);
@@ -1184,6 +1186,13 @@ gnc_reconcile_window_create_view_box(Account *account,
gtk_container_add(GTK_CONTAINER(scrollWin), view);
gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+ // get the vertical scroll bar width
+ vscroll = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (scrollWin));
+ gtk_widget_get_preferred_size (vscroll, NULL, &nat_sb);
+
+ // add xpadding to amount column so scrollbar does not cover
+ gnc_reconcile_view_add_padding (GNC_RECONCILE_VIEW(view), REC_AMOUNT, nat_sb.width);
+
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
@@ -1197,9 +1206,9 @@ gnc_reconcile_window_create_view_box(Account *account,
*total_save = label;
#if GTK_CHECK_VERSION(3,12,0)
- gtk_widget_set_margin_end (GTK_WIDGET(label), 10);
+ gtk_widget_set_margin_end (GTK_WIDGET(label), 10 + nat_sb.width);
#else
- gtk_widget_set_margin_right (GTK_WIDGET(label), 10);
+ gtk_widget_set_margin_right (GTK_WIDGET(label), 10 + nat_sb.width);
#endif
return vbox;
commit c513d788460afb9727c0fc82224235387850464c
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:39:18 2018 +0100
Remove white space and tabs from gnc-main-window.c
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index f5b2b58..11e8095 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -1,6 +1,6 @@
/*
* gnc-main-window.c -- GtkWindow which represents the
- * GnuCash main window.
+ * GnuCash main window.
*
* Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
* Copyright (C) 2003,2005,2006 David Hampton <hampton at employees.org>
@@ -1670,9 +1670,8 @@ static gchar *generate_statusbar_lastmodified_message()
last modification. The string is a format string using
boost::date_time's format flags, see the boost docs for an
explanation of the modifiers. */
- char *time_string =
- gnc_print_time64(statbuf.st_mtime,
- _("Last modified on %a, %b %d, %Y at %I:%M %p"));
+ char *time_string = gnc_print_time64(statbuf.st_mtime,
+ _("Last modified on %a, %b %d, %Y at %I:%M %p"));
//g_warning("got time %ld, str=%s\n", mtime, time_string);
/* Translators: This message appears in the status bar after opening the file. */
message = g_strdup_printf(_("File %s opened. %s"),
@@ -2695,7 +2694,7 @@ gnc_main_window_destroy (GtkWidget *widget)
g_list_free (plugins);
}
if (priv->about_dialog)
- g_object_unref (priv->about_dialog);
+ g_object_unref (priv->about_dialog);
GTK_WIDGET_CLASS (parent_class)->destroy (widget);
}
@@ -4481,11 +4480,11 @@ get_file (const gchar *partial)
filename = gnc_filepath_locate_doc_file(partial);
if (filename && g_file_get_contents(filename, &text, &length, NULL))
{
- if (length)
- {
- g_free(filename);
- return text;
- }
+ if (length)
+ {
+ g_free(filename);
+ return text;
+ }
g_free(text);
}
g_free (filename);
@@ -4544,15 +4543,15 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
if (priv->about_dialog == NULL)
{
/* Translators: %s will be replaced with the current year */
- gchar *copyright = g_strdup_printf(_("Copyright © 1997-%s The GnuCash contributors."),
+ gchar *copyright = g_strdup_printf(_("Copyright © 1997-%s The GnuCash contributors."),
GNC_VCS_REV_YEAR);
- gchar **authors = get_file_strsplit("AUTHORS");
- gchar **documenters = get_file_strsplit("DOCUMENTERS");
- gchar *license = get_file("LICENSE");
+ gchar **authors = get_file_strsplit("AUTHORS");
+ gchar **documenters = get_file_strsplit("DOCUMENTERS");
+ gchar *license = get_file("LICENSE");
gchar *version = NULL;
gchar *vcs = NULL;
GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
- GdkPixbuf *logo = gtk_icon_theme_load_icon (icon_theme,
+ GdkPixbuf *logo = gtk_icon_theme_load_icon (icon_theme,
GNC_ICON_APP,
128,
GTK_ICON_LOOKUP_USE_BUILTIN,
@@ -4574,41 +4573,44 @@ gnc_main_window_cmd_help_about (GtkAction *action, GncMainWindow *window)
version = g_strdup_printf ("%s: %s\n%s: %s%s (%s)\nFinance::Quote: %s", _("Version"), VERSION,
_("Build ID"), vcs, GNC_VCS_REV, GNC_VCS_REV_DATE,
gnc_quote_source_fq_version () ? gnc_quote_source_fq_version () : "-");
- priv->about_dialog = gtk_about_dialog_new ();
- g_object_set (priv->about_dialog,
- "authors", authors,
- "documenters", documenters,
- "comments", _("Accounting for personal and small business finance."),
- "copyright", copyright,
- "license", license,
- "logo", logo,
- "name", "GnuCash",
- /* Translators: the following string will be shown in Help->About->Credits
- * Enter your name or that of your team and an email contact for feedback.
- * The string can have multiple rows, so you can also add a list of
- * contributors. */
- "translator-credits", _("translator_credits"),
- "version", version,
- "website", "http://www.gnucash.org",
- "website_label", _("Visit the GnuCash website."),
- NULL);
+ priv->about_dialog = gtk_about_dialog_new ();
+ g_object_set (priv->about_dialog,
+ "authors", authors,
+ "documenters", documenters,
+ "comments", _("Accounting for personal and small business finance."),
+ "copyright", copyright,
+ "license", license,
+ "logo", logo,
+ "name", "GnuCash",
+ /* Translators: the following string will be shown in Help->About->Credits
+ * Enter your name or that of your team and an email contact for feedback.
+ * The string can have multiple rows, so you can also add a list of
+ * contributors. */
+ "translator-credits", _("translator_credits"),
+ "version", version,
+ "website", "http://www.gnucash.org",
+ "website_label", _("Visit the GnuCash website."),
+ NULL);
g_free(version);
- g_free(copyright);
- if (license) g_free(license);
- if (documenters) g_strfreev(documenters);
- if (authors) g_strfreev(authors);
- g_object_unref (logo);
- g_signal_connect (priv->about_dialog, "activate-link",
- G_CALLBACK (url_signal_cb), NULL);
- g_signal_connect (priv->about_dialog, "response",
- G_CALLBACK (gtk_widget_hide), NULL);
+ g_free(copyright);
+ if (license)
+ g_free(license);
+ if (documenters)
+ g_strfreev(documenters);
+ if (authors)
+ g_strfreev(authors);
+ g_object_unref (logo);
+ g_signal_connect (priv->about_dialog, "activate-link",
+ G_CALLBACK (url_signal_cb), NULL);
+ g_signal_connect (priv->about_dialog, "response",
+ G_CALLBACK (gtk_widget_hide), NULL);
/* Set dialog to resize. */
gtk_window_set_resizable(GTK_WINDOW(priv->about_dialog), TRUE);
- gtk_window_set_transient_for (GTK_WINDOW (priv->about_dialog),
- GTK_WINDOW (window));
+ gtk_window_set_transient_for (GTK_WINDOW (priv->about_dialog),
+ GTK_WINDOW (window));
}
gtk_dialog_run (GTK_DIALOG (priv->about_dialog));
}
commit 0199fef5847fc60f5ed36e1dcf9cc4ed0717dedc
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:38:29 2018 +0100
Add the toolbar preference changes to window-reconcile.
Fixes Bug 796739 - Toolbar buttons have no labels, part 3 of 3.
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 3836bfd..6d6f8b7 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -81,6 +81,8 @@ struct _RecnWindow
GtkUIManager *ui_merge;
GtkActionGroup *action_group;
+ GtkWidget *dock;
+ GtkWidget *toolbar;
GtkWidget *starting; /* The starting balance */
GtkWidget *ending; /* The ending balance */
@@ -1670,13 +1672,44 @@ recnWindow (GtkWidget *parent, Account *account)
static void
recnWindow_add_widget (GtkUIManager *merge,
GtkWidget *widget,
- GtkBox *dock)
+ RecnWindow *recnData)
{
- gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
+
+ if (GTK_IS_TOOLBAR (widget))
+ {
+ recnData->toolbar = widget;
+
+ gtk_toolbar_set_style (GTK_TOOLBAR(widget),
+ gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
+
+ // prefs has only small and large icons so add 2 to get right enum
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR(widget),
+ (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
+ }
+
+ gtk_box_pack_start (GTK_BOX (recnData->dock), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
}
+static void
+recn_window_update_toolbar (gpointer prefs, gchar *pref, RecnWindow *recnData)
+{
+ GtkToolbar *tb;
+ gint selection;
+
+ tb = GTK_TOOLBAR(recnData->toolbar);
+
+ selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
+ if (gtk_toolbar_get_style (tb) != selection)
+ gtk_toolbar_set_style (tb, selection);
+
+ selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
+ // prefs has only small and large icons so add 2 to get right enum
+ if (gtk_toolbar_get_icon_size (tb) != selection + 2)
+ gtk_toolbar_set_icon_size (tb, selection + 2);
+}
+
/********************************************************************\
* recnWindowWithBalance
*
@@ -1743,8 +1776,9 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
GError *error = NULL;
recnData->ui_merge = gtk_ui_manager_new ();
+ recnData->dock = dock;
g_signal_connect (recnData->ui_merge, "add_widget",
- G_CALLBACK (recnWindow_add_widget), dock);
+ G_CALLBACK (recnWindow_add_widget), recnData);
action_group = gtk_action_group_new ("ReconcileWindowActions");
recnData->action_group = action_group;
@@ -1922,6 +1956,13 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
recnRefresh (recnData);
}
+ /* track toolbar preference changes */
+ gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
+ recn_window_update_toolbar, recnData);
+
+ gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
+ recn_window_update_toolbar, recnData);
+
/* Allow resize */
gtk_window_set_resizable(GTK_WINDOW(recnData->window), TRUE);
gtk_widget_show_all(recnData->window);
@@ -1993,6 +2034,12 @@ recn_destroy_cb (GtkWidget *w, gpointer data)
if (recnData->delete_refresh)
gnc_resume_gui_refresh ();
+ gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
+ recn_window_update_toolbar, recnData);
+
+ gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
+ recn_window_update_toolbar, recnData);
+
g_free (recnData);
}
commit a75eb4c8ec2668e4e79895b2923ca6a816c90fe1
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:37:50 2018 +0100
Add toolbar preference changes to embedded-window.
Fixes Bug 796739 - Toolbar buttons have no labels, part 2 of 3.
diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index 605d7dd..c32d1de 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -1,6 +1,6 @@
/*
* gnc-main-window.c -- GtkWindow which represents the
- * GnuCash main window.
+ * GnuCash main window.
*
* Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
* Copyright (C) 2003 David Hampton <hampton at employees.org>
@@ -38,6 +38,7 @@
#include "gnc-plugin-manager.h"
#include "gnc-ui.h"
#include "gnc-window.h"
+#include "gnc-prefs.h"
#include "dialog-utils.h"
/* Static Globals *******************************************************/
@@ -308,6 +309,13 @@ gnc_embedded_window_add_widget (GtkUIManager *merge,
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
+
+ gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
+ gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
+
+ // prefs has only small and large icons so add 2 to get right enum
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
+ (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
commit 3b0931310730a4ae5d028a1e2120d2a619ae975a
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:36:56 2018 +0100
Add preference to control toolbar appearance
Add preferences to select icon size and item layout on the toolbar.
Fixes Bug 796739 - Toolbar buttons have no labels, part 1 of 3.
diff --git a/gnucash/gnome-utils/dialog-preferences.c b/gnucash/gnome-utils/dialog-preferences.c
index 815587e..f17b2d9 100644
--- a/gnucash/gnome-utils/dialog-preferences.c
+++ b/gnucash/gnome-utils/dialog-preferences.c
@@ -1229,6 +1229,8 @@ gnc_preferences_dialog_create(GtkWindow *parent)
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "retain_days_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "tab_width_adj");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_formats");
+ gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-styles");
+ gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-icon-sizes");
gnc_builder_add_from_file (builder, "dialog-preferences.glade", "gnucash_preferences_dialog");
dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_preferences_dialog"));
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 51a0f49..f5b2b58 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -3341,6 +3341,28 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
LEAVE ("");
}
+static void
+gnc_main_window_update_toolbar (gpointer prefs, gchar *pref, gpointer user_data)
+{
+ GncMainWindow *window;
+ GtkToolbar *tb;
+ GncMainWindowPrivate *priv;
+ gint selection;
+
+ window = GNC_MAIN_WINDOW(user_data);
+ priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
+ tb = GTK_TOOLBAR(priv->toolbar);
+
+ selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
+ if (gtk_toolbar_get_style (tb) != selection)
+ gtk_toolbar_set_style (tb, selection);
+
+ selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
+ // prefs has only small and large icons so add 2 to get right enum
+ if (gtk_toolbar_get_icon_size (tb) != selection + 2)
+ gtk_toolbar_set_icon_size (tb, selection + 2);
+}
+
/*
* Based on code from Epiphany (src/ephy-window.c)
*/
@@ -3707,6 +3729,13 @@ gnc_main_window_setup_window (GncMainWindow *window)
GNC_PREF_TAB_POSITION_RIGHT,
gnc_main_window_update_tab_position,
window);
+
+ gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
+ gnc_main_window_update_toolbar, window);
+
+ gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
+ gnc_main_window_update_toolbar, window);
+
gnc_main_window_update_tab_position(NULL, NULL, window);
gnc_main_window_init_menu_updaters(window);
@@ -3839,6 +3868,13 @@ gnc_main_window_add_widget (GtkUIManager *merge,
if (GTK_IS_TOOLBAR (widget))
{
priv->toolbar = widget;
+
+ gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
+ gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
+
+ // prefs has only small and large icons so add 2 to get right enum
+ gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
+ (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
}
gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index f2b21ac..44d3126 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -205,6 +205,16 @@
<summary>Display the notebook tabs at the right of the window.</summary>
<description>This setting determines the edge at which the tabs for switching pages in notebooks are drawn. Possible values are "top", "left", "bottom" and "right". It defaults to "top".</description>
</key>
+ <key name="toolbar-style" type="i">
+ <default>3</default>
+ <summary>Toolbar Style choice</summary>
+ <description>This setting controls how the toolbar icons are displayed.</description>
+ </key>
+ <key name="toolbar-icon-size" type="i">
+ <default>1</default>
+ <summary>Toolbar Icon Size</summary>
+ <description>This setting controls the size of the toolbar icons.</description>
+ </key>
<key name="summarybar-position-top" type="b">
<default>false</default>
<summary>Display the summary bar at the top of the page.</summary>
@@ -336,7 +346,7 @@
<description>This sets the number of characters before auto complete starts for description, notes and memo fields.</description>
</key>
</schema>
-
+
<schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">
<key name="use-new-window" type="b">
<default>false</default>
diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade
index 092f822..3a6631d 100644
--- a/gnucash/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gtkbuilder/dialog-preferences.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.2 -->
+<!-- Generated with glade 3.20.4 -->
<interface>
<requires lib="gtk+" version="3.10"/>
<object class="GtkAdjustment" id="auto_decimal_places_adj">
@@ -97,6 +97,40 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
+ <object class="GtkListStore" id="toolbar-icon-sizes">
+ <columns>
+ <!-- column-name sizes-text -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Small Icons</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Large Icons</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="toolbar-styles">
+ <columns>
+ <!-- column-name styles-text -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Icons</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Text</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Icons and Text</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Icons and Important Text</col>
+ </row>
+ </data>
+ </object>
<object class="GtkDialog" id="gnucash_preferences_dialog">
<property name="can_focus">False</property>
<property name="title" translatable="yes">GnuCash Preferences</property>
@@ -3222,6 +3256,114 @@ many months before the current month:</property>
</packing>
</child>
<child>
+ <object class="GtkComboBox" id="pref/general/toolbar-icon-size">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Specify the icon size for the toolbars.</property>
+ <property name="tooltip_text" translatable="yes">Specify the icon size for the toolbars.</property>
+ <property name="halign">start</property>
+ <property name="margin_left">12</property>
+ <property name="model">toolbar-icon-sizes</property>
+ <property name="active">1</property>
+ <property name="id_column">0</property>
+ <child>
+ <object class="GtkCellRendererText" id="toolbar-icon-renderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">15</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="pref/general/toolbar-style">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Change the way the toolbar items are displayed.</property>
+ <property name="tooltip_text" translatable="yes">Change the way the toolbar items are displayed.</property>
+ <property name="halign">start</property>
+ <property name="margin_left">12</property>
+ <property name="model">toolbar-styles</property>
+ <property name="active">3</property>
+ <property name="id_column">0</property>
+ <child>
+ <object class="GtkCellRendererText" id="toolbar-style-renderer"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">18</property>
+ <property name="width">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes"><b>Toolbar Icon Size</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">14</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes"><b>Toolbar Style</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">17</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label24">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">13</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label25">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">16</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
<placeholder/>
</child>
<child>
diff --git a/libgnucash/core-utils/gnc-prefs.h b/libgnucash/core-utils/gnc-prefs.h
index 41c241d..4c9137c 100644
--- a/libgnucash/core-utils/gnc-prefs.h
+++ b/libgnucash/core-utils/gnc-prefs.h
@@ -71,6 +71,8 @@
#define GNC_PREF_DATE_BACKMONTHS "date-backmonths"
#define GNC_PREF_SHOW_LEAF_ACCT_NAMES "show-leaf-account-names"
#define GNC_PREF_ENTER_MOVES_TO_END "enter-moves-to-end"
+#define GNC_PREF_TOOLBAR_STYLE "toolbar-style"
+#define GNC_PREF_TOOLBAR_ICON_SIZE "toolbar-icon-size"
/* Register preferences */
#define GNC_PREF_DRAW_HOR_LINES "draw-horizontal-lines"
#define GNC_PREF_DRAW_VERT_LINES "draw-vertical-lines"
commit 3e37b879977c94e1e1a2fd23e50ef5f031a2a0c2
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:35:33 2018 +0100
Bug 796669 - Dark Theme Text Colors Hard to Read
Only add the register-foreground class when using Gnucash built in
colours. When this setting not used, the foreground colour by default
will be what ever the theme has set and will be down to the user to
over ride along with the other register colours.
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 3b54bb4..d3f68ac 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -2451,8 +2451,11 @@ gnucash_get_style_classes (GnucashSheet *sheet, GtkStyleContext *stylectxt,
field_type -= COLOR_NEGATIVE;
}
else
- gtk_style_context_add_class (stylectxt, "register-foreground");
-
+ {
+ if (sheet->use_gnc_color_theme) // only add this class if builtin colors used
+ gtk_style_context_add_class (stylectxt, "register-foreground");
+ }
+
switch (field_type)
{
default:
commit 36dc2acd4a6313f599c39a567ef8866892a750dd
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:45:41 2018 +0100
Remove some white space and replace tabs with spaces.
diff --git a/gnucash/gnome-utils/dialog-account.c b/gnucash/gnome-utils/dialog-account.c
index 5eb2cf7..d6bbf9a 100644
--- a/gnucash/gnome-utils/dialog-account.c
+++ b/gnucash/gnome-utils/dialog-account.c
@@ -1866,7 +1866,7 @@ gnc_ui_edit_account_window(GtkWindow *parent, Account *account)
parent_acct = gnc_account_get_parent (account);
if (parent_acct == NULL)
- parent_acct = account; /* must be at the root */
+ parent_acct = account; /* must be at the root */
gtk_tree_view_collapse_all (aw->parent_tree);
gnc_tree_view_account_set_selected_account (
@@ -1951,23 +1951,23 @@ gnc_account_renumber_update_examples (RenumberDialog *data)
prefix = gtk_editable_get_chars(GTK_EDITABLE(data->prefix), 0, -1);
interval = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(data->interval));
if (interval <= 0)
- interval = 10;
+ interval = 10;
num_digits = (unsigned int)log10((double)(data->num_children * interval)) + 1;
if (strlen (prefix))
- str = g_strdup_printf("%s-%0*d", prefix, num_digits, interval);
+ str = g_strdup_printf("%s-%0*d", prefix, num_digits, interval);
else
- str = g_strdup_printf("%0*d", num_digits, interval);
+ str = g_strdup_printf("%0*d", num_digits, interval);
gtk_label_set_text(GTK_LABEL(data->example1), str);
g_free(str);
if (strlen (prefix))
- str = g_strdup_printf("%s-%0*d", prefix, num_digits,
- interval * data->num_children);
+ str = g_strdup_printf("%s-%0*d", prefix, num_digits,
+ interval * data->num_children);
else
- str = g_strdup_printf("%0*d", num_digits,
- interval * data->num_children);
+ str = g_strdup_printf("%0*d", num_digits,
+ interval * data->num_children);
gtk_label_set_text(GTK_LABEL(data->example2), str);
g_free(str);
@@ -2004,27 +2004,28 @@ gnc_account_renumber_response_cb (GtkDialog *dialog,
{
gtk_widget_hide(data->dialog);
children = gnc_account_get_children_sorted(data->parent);
- if (children == NULL)
- {
- PWARN ("Can't renumber children of an account with no children!");
- g_free (data);
- return;
- }
+ if (children == NULL)
+ {
+ PWARN ("Can't renumber children of an account with no children!");
+ g_free (data);
+ return;
+ }
prefix = gtk_editable_get_chars(GTK_EDITABLE(data->prefix), 0, -1);
- interval =
- gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(data->interval));
- if (interval <= 0)
- interval = 10;
+ interval = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(data->interval));
+
+ if (interval <= 0)
+ interval = 10;
+
num_digits = (unsigned int)log10 ((double)(data->num_children * interval) + 1);
gnc_set_busy_cursor (NULL, TRUE);
for (tmp = children, i = 1; tmp; tmp = g_list_next(tmp), i += 1)
{
- if (strlen (prefix))
- str = g_strdup_printf("%s-%0*d", prefix,
- num_digits, interval * i);
- else
- str = g_strdup_printf("%0*d", num_digits, interval * i);
+ if (strlen (prefix))
+ str = g_strdup_printf("%s-%0*d", prefix,
+ num_digits, interval * i);
+ else
+ str = g_strdup_printf("%0*d", num_digits, interval * i);
xaccAccountSetCode(tmp->data, str);
g_free(str);
}
@@ -2058,7 +2059,7 @@ gnc_account_renumber_create_dialog (GtkWidget *window, Account *account)
data->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "account_renumber_dialog"));
gtk_window_set_transient_for(GTK_WINDOW(data->dialog), GTK_WINDOW(window));
g_object_set_data_full(G_OBJECT(data->dialog), "builder", builder,
- g_object_unref);
+ g_object_unref);
widget = GTK_WIDGET(gtk_builder_get_object (builder, "header_label"));
string = g_strdup_printf(_( "Renumber the immediate sub-accounts of %s? "
diff --git a/gnucash/ui/gnc-plugin-page-account-tree-ui.xml b/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
index 1970817..c07f440 100644
--- a/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
+++ b/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
@@ -3,10 +3,10 @@
<menu name="Edit" action="EditAction">
<placeholder name="EditSelectedPlaceholder">
<menuitem name="EditEditAccount" action="EditEditAccountAction"/>
- <menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
+ <menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
<menuitem name="EditAccountFindAccount" action="EditFindAccountAction"/>
- <menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
<menuitem name="AccountColorCascade" action="ColorCascadeAccountAction"/>
+ <menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
<separator name="EditSep2"/>
<menuitem name="FileOpenAccount" action="FileOpenAccountAction"/>
<menuitem name="FileOpenSubaccounts" action="FileOpenSubaccountsAction"/>
@@ -14,29 +14,29 @@
</menu>
<menu name="Actions" action="ActionsAction">
<placeholder name="ActionsPlaceholder">
- <separator name="ActionsSep1"/>
- <menuitem name="FileNewAccount" action="FileNewAccountAction"/>
- <menuitem name="FileAddAccountHierarchyAssistant" action="FileAddAccountHierarchyAssistantAction"/>
- <separator name="ActionsSep2"/>
- <menuitem name="ActionsTransfer" action="ActionsTransferAction"/>
- <menuitem name="ActionsReconcile" action="ActionsReconcileAction"/>
- <menuitem name="ActionsAutoClear" action="ActionsAutoClearAction"/>
- <menuitem name="ActionsStockSplit" action="ActionsStockSplitAction"/>
- <menuitem name="ActionLots" action="ActionsLotsAction"/>
- <separator name="ActionsSep3"/>
- <menu name="ScrubMenu" action="ScrubMenuAction">
- <menuitem name="Scrub" action="ScrubAction"/>
- <menuitem name="ScrubSub" action="ScrubSubAction"/>
- <menuitem name="ScrubAll" action="ScrubAllAction"/>
- </menu>
+ <separator name="ActionsSep1"/>
+ <menuitem name="FileNewAccount" action="FileNewAccountAction"/>
+ <menuitem name="FileAddAccountHierarchyAssistant" action="FileAddAccountHierarchyAssistantAction"/>
+ <separator name="ActionsSep2"/>
+ <menuitem name="ActionsTransfer" action="ActionsTransferAction"/>
+ <menuitem name="ActionsReconcile" action="ActionsReconcileAction"/>
+ <menuitem name="ActionsAutoClear" action="ActionsAutoClearAction"/>
+ <menuitem name="ActionsStockSplit" action="ActionsStockSplitAction"/>
+ <menuitem name="ActionLots" action="ActionsLotsAction"/>
+ <separator name="ActionsSep3"/>
+ <menu name="ScrubMenu" action="ScrubMenuAction">
+ <menuitem name="Scrub" action="ScrubAction"/>
+ <menuitem name="ScrubSub" action="ScrubSubAction"/>
+ <menuitem name="ScrubAll" action="ScrubAllAction"/>
+ </menu>
</placeholder>
</menu>
<menu name="Extensions" action="ExtensionsAction">
<placeholder name="ExtensionsPlaceholder">
- <menu name="Register2Test" action="Register2TestAction">
- <menuitem name="Register2TestAccount" action="Register2TestAccountAction"/>
- <menuitem name="Register2TestSubAccount" action="Register2TestSubAccountAction"/>
- </menu>
+ <menu name="Register2Test" action="Register2TestAction">
+ <menuitem name="Register2TestAccount" action="Register2TestAccountAction"/>
+ <menuitem name="Register2TestSubAccount" action="Register2TestSubAccountAction"/>
+ </menu>
</placeholder>
</menu>
</menubar>
commit 0e4898fe0a5dd6108ca9fa281789c4e27157aa9a
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Sun Jul 15 16:44:50 2018 +0100
Add the ability to cascade account colours in account tree
Add the ability to select an account that has sub-accounts and use that
accounts colour on all sub accounts. By default only sub accounts that
do not have a colour set are updated but there is an option to over ride
this.
diff --git a/gnucash/gnome-utils/dialog-account.c b/gnucash/gnome-utils/dialog-account.c
index ae697c3..5eb2cf7 100644
--- a/gnucash/gnome-utils/dialog-account.c
+++ b/gnucash/gnome-utils/dialog-account.c
@@ -2080,3 +2080,119 @@ gnc_account_renumber_create_dialog (GtkWidget *window, Account *account)
gtk_widget_show_all(data->dialog);
}
+
+static void
+default_color_button_cb (GtkButton *button, gpointer user_data)
+{
+ GdkRGBA color;
+
+ if (gdk_rgba_parse (&color, DEFAULT_COLOR))
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(user_data), &color);
+}
+
+static void
+update_account_color (Account *acc, const gchar *old_color, const gchar *new_color, gboolean replace)
+{
+ // check to see if the color has been changed
+ if (g_strcmp0 (new_color, old_color) != 0)
+ {
+ if ((old_color == NULL) || (g_strcmp0 (old_color, "Not Set") == 0) || (replace == TRUE))
+ {
+ xaccAccountBeginEdit (acc);
+ xaccAccountSetColor (acc, new_color);
+ xaccAccountCommitEdit (acc);
+ }
+ }
+}
+
+void
+gnc_account_cascade_color_dialog (GtkWidget *window, Account *account)
+{
+ GtkWidget *dialog;
+ GtkBuilder *builder;
+ GtkWidget *color_label, *color_button, *over_write, *color_button_default;
+ gchar *string;
+ const char *color_string;
+ gchar *old_color_string;
+ GdkRGBA color;
+ gint response;
+
+ // check if we actualy do have sub accounts
+ g_return_if_fail (gnc_account_n_children (account) > 0);
+
+ builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder, "dialog-account.glade", "account_cascade_color_dialog");
+ dialog = GTK_WIDGET(gtk_builder_get_object (builder, "account_cascade_color_dialog"));
+ gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(window));
+
+ color_label = GTK_WIDGET(gtk_builder_get_object (builder, "color_label"));
+ over_write = GTK_WIDGET(gtk_builder_get_object (builder, "replace_check"));
+ color_button = GTK_WIDGET(gtk_builder_get_object (builder, "color_button"));
+ color_button_default = GTK_WIDGET(gtk_builder_get_object (builder, "color_button_default"));
+
+ gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER(color_button), FALSE);
+
+ g_signal_connect (G_OBJECT(color_button_default), "clicked",
+ G_CALLBACK(default_color_button_cb), (gpointer)color_button);
+
+ string = g_strdup_printf(_( "Set the account color for account '%s' "
+ "including all sub-accounts to the selected color:"),
+ gnc_account_get_full_name(account));
+ gtk_label_set_text (GTK_LABEL(color_label), string);
+ g_free (string);
+
+ color_string = xaccAccountGetColor (account); // get existing account color
+
+ old_color_string = g_strdup (color_string); // save the old color string
+
+ if ((color_string == NULL) || (g_strcmp0 (color_string, "Not Set") == 0))
+ color_string = DEFAULT_COLOR;
+
+ // set the color chooser to account color
+ if (gdk_rgba_parse (&color, color_string))
+ gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER(color_button), &color);
+
+ /* default to cancel */
+ gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
+
+ gtk_builder_connect_signals (builder, dialog);
+ g_object_unref (G_OBJECT(builder));
+
+ gtk_widget_show_all (dialog);
+
+ response = gtk_dialog_run (GTK_DIALOG(dialog));
+
+ if (response == GTK_RESPONSE_OK)
+ {
+ GList *accounts = gnc_account_get_descendants (account);
+ gboolean replace = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(over_write));
+ GList *acct;
+ GdkRGBA new_color;
+ const gchar *new_color_string;
+
+ gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER(color_button), &new_color);
+ new_color_string = gdk_rgba_to_string (&new_color);
+
+ if (g_strcmp0 (new_color_string, DEFAULT_COLOR) == 0)
+ new_color_string = "Not Set";
+
+ // check/update selected account
+ update_account_color (account, old_color_string, new_color_string, replace);
+
+ if (accounts != NULL)
+ {
+ for (acct = accounts; acct; acct = g_list_next(acct))
+ {
+ const char *string = xaccAccountGetColor (acct->data);
+
+ // check/update sub-account
+ update_account_color (acct->data, string, new_color_string, replace);
+ }
+ g_list_free (accounts);
+ }
+ }
+ if (old_color_string)
+ g_free (old_color_string);
+
+ gtk_widget_destroy (dialog);
+}
diff --git a/gnucash/gnome-utils/dialog-account.h b/gnucash/gnome-utils/dialog-account.h
index ffdb44b..099f1a3 100644
--- a/gnucash/gnome-utils/dialog-account.h
+++ b/gnucash/gnome-utils/dialog-account.h
@@ -161,6 +161,8 @@ void gnc_ui_register_account_destroy_callback (void (*cb)(Account *));
void gnc_account_renumber_create_dialog (GtkWidget *window, Account *account);
+void gnc_account_cascade_color_dialog (GtkWidget *window, Account *account);
+
/** @} */
/** @} */
diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.c b/gnucash/gnome/gnc-plugin-page-account-tree.c
index 5913b75..80478f5 100644
--- a/gnucash/gnome/gnc-plugin-page-account-tree.c
+++ b/gnucash/gnome/gnc-plugin-page-account-tree.c
@@ -153,6 +153,7 @@ static void gnc_plugin_page_account_tree_cmd_lots (GtkAction *action, GncPluginP
static void gnc_plugin_page_account_tree_cmd_scrub (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_scrub_sub (GtkAction *action, GncPluginPageAccountTree *page);
static void gnc_plugin_page_account_tree_cmd_scrub_all (GtkAction *action, GncPluginPageAccountTree *page);
+static void gnc_plugin_page_account_tree_cmd_cascade_color_account (GtkAction *action, GncPluginPageAccountTree *page);
/* Command callback for new Register Test */
static void gnc_plugin_page_account_tree_cmd_open2_account (GtkAction *action, GncPluginPageAccountTree *page);
@@ -227,6 +228,11 @@ static GtkActionEntry gnc_plugin_page_account_tree_actions [] =
G_CALLBACK (gnc_plugin_page_account_tree_cmd_delete_account)
},
{
+ "ColorCascadeAccountAction", NULL, N_("_Cascade Account Color..."), NULL,
+ N_("Cascade selected account color"),
+ G_CALLBACK (gnc_plugin_page_account_tree_cmd_cascade_color_account)
+ },
+ {
"EditFindAccountAction", "edit-find", N_("F_ind Account"), "<primary>i",
N_("Find an account"),
G_CALLBACK (gnc_plugin_page_account_tree_cmd_find_account)
@@ -1179,6 +1185,24 @@ gnc_plugin_page_account_tree_cmd_find_account_popup (GtkAction *action, GncPlugi
LEAVE(" ");
}
+static void
+gnc_plugin_page_account_tree_cmd_cascade_color_account (GtkAction *action, GncPluginPageAccountTree *page)
+{
+ Account *account = NULL;
+ GtkWidget *window;
+
+ ENTER("action %p, page %p", action, page);
+
+ account = gnc_plugin_page_account_tree_get_current_account (page);
+
+ window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
+
+ if (account != NULL)
+ gnc_account_cascade_color_dialog (window, account);
+
+ LEAVE(" ");
+}
+
/********************************************************************
* delete_account_helper
* See if this account has any splits present. Set the user data
diff --git a/gnucash/gtkbuilder/dialog-account.glade b/gnucash/gtkbuilder/dialog-account.glade
index 399febe..998d380 100644
--- a/gnucash/gtkbuilder/dialog-account.glade
+++ b/gnucash/gtkbuilder/dialog-account.glade
@@ -2,6 +2,156 @@
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.10"/>
+ <object class="GtkDialog" id="account_cascade_color_dialog">
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Cascade Account Color</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancelbutton3">
+ <property name="label" translatable="yes">_Cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="okbutton3">
+ <property name="label">_OK</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="color_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">center</property>
+ <child>
+ <object class="GtkColorButton" id="color_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="color_button_default">
+ <property name="label" translatable="yes">Default</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="sub_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">If any account has an existing color it will not be replaced unless the following is ticked.</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="replace_check">
+ <property name="label" translatable="yes">Replace any existing account colors</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">center</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancelbutton3</action-widget>
+ <action-widget response="-5">okbutton3</action-widget>
+ </action-widgets>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
<object class="GtkDialog" id="account_delete_dialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
diff --git a/gnucash/ui/gnc-plugin-page-account-tree-ui.xml b/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
index a1165b3..1970817 100644
--- a/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
+++ b/gnucash/ui/gnc-plugin-page-account-tree-ui.xml
@@ -6,6 +6,7 @@
<menuitem name="EditDeleteAccount" action="EditDeleteAccountAction"/>
<menuitem name="EditAccountFindAccount" action="EditFindAccountAction"/>
<menuitem name="EditRenumberSubaccounts" action="EditRenumberSubaccountsAction"/>
+ <menuitem name="AccountColorCascade" action="ColorCascadeAccountAction"/>
<separator name="EditSep2"/>
<menuitem name="FileOpenAccount" action="FileOpenAccountAction"/>
<menuitem name="FileOpenSubaccounts" action="FileOpenSubaccountsAction"/>
@@ -45,6 +46,7 @@
<menuitem name="AccountOpenAccount" action="FileOpenAccountAction"/>
<menuitem name="AccountOpenSubaccounts" action="FileOpenSubaccountsAction"/>
<menuitem name="AccountEditAccount" action="EditEditAccountAction"/>
+ <menuitem name="AccountColorCascade" action="ColorCascadeAccountAction"/>
<menuitem name="AccountFindAccountPopup" action="EditFindAccountPopupAction"/>
<separator name="AccountSep1"/>
<menuitem name="AccountReconcile" action="ActionsReconcileAction"/>
commit 43af50bd8aea764eb526b775a63b1df0488eda16
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Jul 14 17:09:22 2018 -0700
Bug 796759 - --add-price-quotes <sql file> leaves a lock on the file.
First, save isn't necessary if the book is dirty, so don't... but that
means that the book has to be marked dirty after a session swap. No more
laziness.
Second, regardless of the outcome of inner_main_add_price_quotes the
session must be destroyed to remove the lock.
A couple of cleanups in QofSessionImpl::save as well: Rewrote the
descriptive comment to reflect how it really works when the backend has
gotten disconnected and removed the superfluous qof_book_set_backend
with the backend that we'd *just gotten from the book*.
diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c
index 0f19e5f..72dddbe 100644
--- a/gnucash/gnome-utils/gnc-file.c
+++ b/gnucash/gnome-utils/gnc-file.c
@@ -1536,11 +1536,7 @@ gnc_file_do_save_as (GtkWindow *parent, const char* filename)
/* if we got to here, then we've successfully gotten a new session */
/* close up the old file session (if any) */
qof_session_swap_data (session, new_session);
-
- /* XXX At this point, we should really mark the data in the new session
- * as being 'dirty', since we haven't saved it at all under the new
- * session. But I'm lazy...
- */
+ qof_book_mark_session_dirty (qof_session_get_book (new_session));
qof_event_resume();
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index 441fa2a..2514e49 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -585,8 +585,13 @@ inner_main_add_price_quotes(void *closure, int argc, char **argv)
gnc_shutdown(0);
return;
fail:
- if (session && qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
- g_warning("Session Error: %s", qof_session_get_error_message(session));
+ if (session)
+ {
+ if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
+ g_warning("Session Error: %s",
+ qof_session_get_error_message(session));
+ qof_session_destroy(session);
+ }
qof_event_resume();
gnc_shutdown(1);
}
diff --git a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
index 7fb08a9..1447f39 100644
--- a/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+++ b/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
@@ -401,6 +401,7 @@ test_dbi_store_and_reload (Fixture* fixture, gconstpointer pData)
g_assert (session_2 != NULL);
g_assert_cmpint (qof_session_get_error (session_2), == , ERR_BACKEND_NO_ERR);
qof_session_swap_data (fixture->session, session_2);
+ qof_book_mark_session_dirty (qof_session_get_book (session_2));
qof_session_save (session_2, NULL);
g_assert (session_2 != NULL);
g_assert_cmpint (qof_session_get_error (session_2), == , ERR_BACKEND_NO_ERR);
@@ -459,6 +460,7 @@ test_dbi_safe_save (Fixture* fixture, gconstpointer pData)
goto cleanup;
}
qof_session_swap_data (fixture->session, session_1);
+ qof_book_mark_session_dirty (qof_session_get_book (session_1));
qof_session_save (session_1, NULL);
/* Do a safe save */
qof_session_safe_save (session_1, NULL);
@@ -532,6 +534,7 @@ test_dbi_version_control (Fixture* fixture, gconstpointer pData)
goto cleanup;
}
qof_session_swap_data (fixture->session, sess);
+ qof_book_mark_session_dirty (qof_session_get_book (sess));
qof_session_save (sess, NULL);
sql_be = reinterpret_cast<decltype(sql_be)>(qof_session_get_backend (sess));
book = qof_session_get_book (sess);
@@ -587,6 +590,7 @@ test_dbi_business_store_and_reload (Fixture* fixture, gconstpointer pData)
session_2 = qof_session_new ();
qof_session_begin (session_2, url, FALSE, TRUE, TRUE);
qof_session_swap_data (fixture->session, session_2);
+ qof_book_mark_session_dirty (qof_session_get_book (session_2));
qof_session_save (session_2, NULL);
// Reload the session data
diff --git a/libgnucash/engine/qofsession.cpp b/libgnucash/engine/qofsession.cpp
index 0c57736..2898d5d 100644
--- a/libgnucash/engine/qofsession.cpp
+++ b/libgnucash/engine/qofsession.cpp
@@ -451,23 +451,21 @@ QofSessionImpl::is_saving () const noexcept
void
QofSessionImpl::save (QofPercentageFunc percentage_func) noexcept
{
+ if (!qof_book_session_not_saved (m_book)) //Clean book, nothing to do.
+ return;
m_saving = true;
ENTER ("sess=%p book_id=%s", this, m_book_id.c_str ());
- /* If there is a backend, and the backend is reachable
- * (i.e. we can communicate with it), then synchronize with
- * the backend. If we cannot contact the backend (e.g.
- * because we've gone offline, the network has crashed, etc.)
- * then give the user the option to save to the local disk.
- *
- * hack alert -- FIXME -- XXX the code below no longer
- * does what the words above say. This needs fixing.
- */
+ /* If there is a backend, the book is dirty, and the backend is reachable
+ * (i.e. we can communicate with it), then synchronize with the backend. If
+ * we cannot contact the backend (e.g. because we've gone offline, the
+ * network has crashed, etc.) then raise an error so that the controlling
+ * dialog can offer the user a chance to save in a different way.
+ */
auto backend = qof_book_get_backend (m_book);
if (backend)
{
- /* if invoked as SaveAs(), then backend not yet set */
- qof_book_set_backend (m_book, backend);
+
backend->set_percentage(percentage_func);
backend->sync(m_book);
auto err = backend->get_error();
diff --git a/libgnucash/engine/test/test-qofsession.cpp b/libgnucash/engine/test/test-qofsession.cpp
index 38a7cc6..595eb62 100644
--- a/libgnucash/engine/test/test-qofsession.cpp
+++ b/libgnucash/engine/test/test-qofsession.cpp
@@ -192,6 +192,7 @@ TEST (QofSessionTest, save)
qof_backend_register_provider (get_provider ());
QofSession s;
s.begin ("book1", false, false, false);
+ qof_book_mark_session_dirty (s.get_book ());
s.save (nullptr);
EXPECT_EQ (sync_called, true);
qof_backend_unregister_all_providers ();
commit 4c8f822c12ee57208d735da4a366251b86793309
Author: Di Mang <dimang.freenet at gmail.com>
Date: Sat Jul 14 21:45:28 2018 +0200
Increase of MAX_TAB_COUNT to change appearance of dialog "Book Options" in german language.
The dialog "Book Options" looks in german different, because it has 5 tabs: four standard tabs and additionaly one tab for tax settings, which appears only for german language. The 1 to 4 tabs appearance on top (horizontal mode). The appearance switchs to vertical mode (with tabs on the left side) for 5 and more tabs. Here the setting MAX_TAB_COUNT is increased to 5. This change should make the dialog similar in german and other languages.
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index f981c5b..88c3a6f 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -74,7 +74,7 @@ static QofLogModule log_module = GNC_MOD_GUI;
* Point where preferences switch control method from a set of
* notebook tabs to a list.
*/
-#define MAX_TAB_COUNT 4
+#define MAX_TAB_COUNT 5
/* A pointer to the last selected filename */
#define LAST_SELECTION "last-selection"
commit de927d535d38fc584659fdea3935ea9834dab34b
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 13 16:34:42 2018 -0700
Fix test-backend-dbi for Postgress and MySQL.
Pass MySQL database exists errors and skip creating the database
if it exists.
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index c67e567..b3d9d2a 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -531,6 +531,12 @@ error_handler<DbType::DBI_MYSQL> (dbi_conn conn, void* user_data)
dbi_be->set_dbi_error (ERR_BACKEND_CANT_CONNECT, 1, true);
dbi_be->retry_connection (msg);
}
+ else if (err_num == 1007) //Database exists
+ {
+ dbi_be->set_exists(true);
+ return;
+ }
+
else // Any other error
{
PERR ("DBI error: %s\n", msg);
@@ -700,7 +706,8 @@ GncDbiBackend<Type>::session_begin (QofSession* session, const char* book_id,
if (create)
{
- if (!create_database(conn, uri.quote_dbname(Type).c_str()))
+ if (!m_exists &&
+ !create_database(conn, uri.quote_dbname(Type).c_str()))
{
dbi_conn_close(conn);
LEAVE("Error");
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c7924e8..3e5dfbf 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -344,7 +344,6 @@ gnucash/import-export/log-replay/gncmod-log-replay.c
gnucash/import-export/log-replay/gnc-plugin-log-replay.c
gnucash/import-export/ofx/gncmod-ofx-import.c
gnucash/import-export/ofx/gnc-ofx-import.c
-gnucash/import-export/ofx/gnc-ofx-kvp.c
gnucash/import-export/ofx/gnc-plugin-ofx.c
gnucash/import-export/ofx/gschemas/org.gnucash.dialogs.import.ofx.gschema.xml.in
gnucash/import-export/qif-imp/assistant-qif-import.c
commit c2972c75d075b286b630e8954a4bc7b4968e984e
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 13 12:18:25 2018 -0700
Fix missing prototype error.
diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index d7c927b..cd4df57 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -90,8 +90,9 @@ get_associated_income_account(const Account* investment_account)
gnc_account_get_book(investment_account));
}
-void set_associated_income_account(Account* investment_account,
- const Account *income_account)
+static void
+set_associated_income_account(Account* investment_account,
+ const Account *income_account)
{
const GncGUID * income_acc_guid;
commit 9db7d89474ce8133bf8459b514297ab081881c7b
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 13 11:46:50 2018 -0700
Bug 796756 - OFX import fails to recognize associated income accounts.
Because qof_instance_set and qof_instance_get were being called with the
KVP key instead of the property name.
Since we don't really want references to KVP outside of engine and since
the two functions are called exactly once each in qof-ofx-import.c move
them inside qof-ofx-import.c and get rid of gnc-ofx-kvp.[ch] as well as
fix the bug.
diff --git a/gnucash/import-export/ofx/CMakeLists.txt b/gnucash/import-export/ofx/CMakeLists.txt
index ffabfd1..0d1ea93 100644
--- a/gnucash/import-export/ofx/CMakeLists.txt
+++ b/gnucash/import-export/ofx/CMakeLists.txt
@@ -3,7 +3,6 @@ add_subdirectory(test)
set(ofx_SOURCES
gnc-ofx-import.c
- gnc-ofx-kvp.c
gncmod-ofx-import.c
gnc-plugin-ofx.c
)
@@ -13,7 +12,6 @@ set_source_files_properties (${ofx_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H
set(ofx_noinst_HEADERS
gnc-ofx-import.h
- gnc-ofx-kvp.h
gnc-plugin-ofx.h
)
diff --git a/gnucash/import-export/ofx/gnc-ofx-import.c b/gnucash/import-export/ofx/gnc-ofx-import.c
index b8df83e..d7c927b 100644
--- a/gnucash/import-export/ofx/gnc-ofx-import.c
+++ b/gnucash/import-export/ofx/gnc-ofx-import.c
@@ -51,8 +51,6 @@
#include "dialog-account.h"
#include "dialog-utils.h"
-#include "gnc-ofx-kvp.h"
-
#define GNC_PREFS_GROUP "dialogs.import.ofx"
#define GNC_PREF_AUTO_COMMODITY "auto-create-commodity"
@@ -78,6 +76,36 @@ int ofx_proc_status_cb(struct OfxStatusData data)
}
*/
+static const char *PROP_OFX_INCOME_ACCOUNT = "ofx-income-account";
+
+static Account*
+get_associated_income_account(const Account* investment_account)
+{
+ GncGUID *income_guid= NULL;
+ g_assert(investment_account);
+ qof_instance_get (QOF_INSTANCE (investment_account),
+ PROP_OFX_INCOME_ACCOUNT, &income_guid,
+ NULL);
+ return xaccAccountLookup(income_guid,
+ gnc_account_get_book(investment_account));
+}
+
+void set_associated_income_account(Account* investment_account,
+ const Account *income_account)
+{
+ const GncGUID * income_acc_guid;
+
+ g_assert(investment_account);
+ g_assert(income_account);
+
+ income_acc_guid = xaccAccountGetGUID(income_account);
+ xaccAccountBeginEdit(investment_account);
+ qof_instance_set (QOF_INSTANCE (investment_account),
+ PROP_OFX_INCOME_ACCOUNT, income_acc_guid,
+ NULL);
+ xaccAccountCommitEdit(investment_account);
+}
+
int ofx_proc_security_cb(const struct OfxSecurityData data, void * security_user_data);
int ofx_proc_transaction_cb (struct OfxTransactionData data, void *user_data);
int ofx_proc_account_cb(struct OfxAccountData data, void * account_user_data);
@@ -756,7 +784,8 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
{
DEBUG("Now let's find an account for the destination split");
- income_account = gnc_ofx_kvp_get_assoc_account(investment_account);
+ income_account =
+ get_associated_income_account(investment_account);
if (income_account == NULL)
{
@@ -778,7 +807,7 @@ int ofx_proc_transaction_cb(struct OfxTransactionData data, void *user_data)
NULL);
if (income_account != NULL)
{
- gnc_ofx_kvp_set_assoc_account(investment_account,
+ set_associated_income_account(investment_account,
income_account);
DEBUG("KVP written");
}
diff --git a/gnucash/import-export/ofx/gnc-ofx-kvp.c b/gnucash/import-export/ofx/gnc-ofx-kvp.c
deleted file mode 100644
index 0eb456d..0000000
--- a/gnucash/import-export/ofx/gnc-ofx-kvp.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************\
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-/*
- * gnc-ofx-kvp.c
- *
- * Created on: 13.03.2011
- * Author: cs
- */
-
-#include <config.h>
-#include "gnc-ofx-kvp.h"
-
-static const char *KEY_ASSOC_INCOME_ACCOUNT = "ofx/associated-income-account";
-
-
-Account *gnc_ofx_kvp_get_assoc_account(const Account* investment_account)
-{
- GncGUID *income_guid= NULL;
- g_assert(investment_account);
- qof_instance_get (QOF_INSTANCE (investment_account),
- KEY_ASSOC_INCOME_ACCOUNT, &income_guid,
- NULL);
- return xaccAccountLookup(income_guid,
- gnc_account_get_book(investment_account));
-}
-
-void gnc_ofx_kvp_set_assoc_account(Account* investment_account,
- const Account *income_account)
-{
- const GncGUID * income_acc_guid;
-
- g_assert(investment_account);
- g_assert(income_account);
-
- income_acc_guid = xaccAccountGetGUID(income_account);
- xaccAccountBeginEdit(investment_account);
- qof_instance_set (QOF_INSTANCE (investment_account),
- KEY_ASSOC_INCOME_ACCOUNT, income_acc_guid,
- NULL);
- xaccAccountCommitEdit(investment_account);
-}
diff --git a/gnucash/import-export/ofx/gnc-ofx-kvp.h b/gnucash/import-export/ofx/gnc-ofx-kvp.h
deleted file mode 100644
index 58cd36a..0000000
--- a/gnucash/import-export/ofx/gnc-ofx-kvp.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************\
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-/*
- * gnc-ofx-kvp.h
- *
- * Created on: 13.03.2011
- * Author: cs
- */
-
-#ifndef GNC_OFX_KVP_H_
-#define GNC_OFX_KVP_H_
-
-#include <glib.h>
-#include <Account.h>
-
-Account *gnc_ofx_kvp_get_assoc_account(const Account* investment_account);
-
-void gnc_ofx_kvp_set_assoc_account(Account* investment_account,
- const Account *associated_income_accout);
-
-
-#endif /* GNC_OFX_CONVERSIONS_H_ */
commit 983c7ce0bcc310f030d39c7735b9ff743f0b0a3a
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 13 10:41:33 2018 -0700
Bug 796579 - Cannot go forward with empty duplicates screen
Set the key name to (default-unspec-acct) for the case where both payee
and memo are blank so that it can be found, then
look for that key in the right hash, qif-memo-map, instead of looking for
cat (already known to be "") in the wrong hash, qif-cat-map.
diff --git a/gnucash/import-export/qif-imp/qif-dialog-utils.scm b/gnucash/import-export/qif-imp/qif-dialog-utils.scm
index bdc9d19..78f9373 100644
--- a/gnucash/import-export/qif-imp/qif-dialog-utils.scm
+++ b/gnucash/import-export/qif-imp/qif-dialog-utils.scm
@@ -586,6 +586,8 @@
(begin
(set! entry (make-qif-map-entry))
(qif-map-entry:set-qif-name! entry key-string)
+ (if (string=? key-string "")
+ (set! key-string (default-unspec-acct)))
(qif-map-entry:set-gnc-name!
entry (default-unspec-acct))
(qif-map-entry:set-allowed-types!
diff --git a/gnucash/import-export/qif-imp/qif-to-gnc.scm b/gnucash/import-export/qif-imp/qif-to-gnc.scm
index f5d0794..df74b48 100644
--- a/gnucash/import-export/qif-imp/qif-to-gnc.scm
+++ b/gnucash/import-export/qif-imp/qif-to-gnc.scm
@@ -587,7 +587,9 @@
(not (string=? memo ""))
(hash-ref qif-memo-map memo))))
(if (not far-acct-info)
- (set! far-acct-info (hash-ref qif-cat-map cat)))))
+ (set! far-acct-info
+ (hash-ref qif-memo-map
+ (default-unspec-acct))))))
(set! far-acct-name (qif-map-entry:gnc-name far-acct-info))
(set! far-acct (hash-ref gnc-acct-hash far-acct-name))
commit 756f444ac37861bad35e9ecd9b505a8d525b95f6
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jul 13 09:49:33 2018 -0700
Update bug tracker URL
Change all instances of bugzilla.gnome.org to bugs.gnucash.org, reflecting
our migration to a self-hosted bug tracker.
Inform the Translation Project Coordinator at release that this affects
translatable strings and that all message catalogs have been updated.
diff --git a/bindings/python/gnucash_core.py b/bindings/python/gnucash_core.py
index 6420a17..43fdabc 100644
--- a/bindings/python/gnucash_core.py
+++ b/bindings/python/gnucash_core.py
@@ -109,7 +109,7 @@ class Session(GnuCashCoreClass):
# New xml file can't be loaded, new sql store
# has to be loaded before it can be altered
# Any existing store obviously has to be loaded
- # More background: https://bugzilla.gnome.org/show_bug.cgi?id=726891
+ # More background: https://bugs.gnucash.org/show_bug.cgi?id=726891
if book_uri[:3] != "xml" or not is_new:
self.load()
except GnuCashBackendException as backend_exception:
diff --git a/data/accounts/sv_SE/README.bas_2012 b/data/accounts/sv_SE/README.bas_2012
index 8aed60e..ccfc4ce 100644
--- a/data/accounts/sv_SE/README.bas_2012
+++ b/data/accounts/sv_SE/README.bas_2012
@@ -2,7 +2,7 @@ Account plan for Sweden
-----------------------
These notes are taken from
-https://bugzilla.gnome.org/show_bug.cgi?id=724427
+https://bugs.gnucash.org/show_bug.cgi?id=724427
and added here in case someone wants to look into some areas the
original author was unsure of.
diff --git a/doc/README-ca.win32-bin.txt b/doc/README-ca.win32-bin.txt
index e5e1fe3..bf2ad5e 100644
--- a/doc/README-ca.win32-bin.txt
+++ b/doc/README-ca.win32-bin.txt
@@ -17,7 +17,7 @@ IRC (Xat): canal #gnucash al servidor irc.gnome.org, vegeu també http://wiki.gn
Si trobeu errors o problemes, no dubteu a informar-los
a la nostra eina de seguiment d'errors "Bugzilla":
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-de.win32-bin.txt b/doc/README-de.win32-bin.txt
index 6bde138..44b9f92 100644
--- a/doc/README-de.win32-bin.txt
+++ b/doc/README-de.win32-bin.txt
@@ -19,7 +19,7 @@ beschrieben auf http://wiki.gnucash.org/wiki/IRC
Sollten Probleme auftreten, bitten die Entwickler darum, diese als
englischsprachigen Fehlerbericht in »Bugzilla« einzutragen:
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-fr.win32-bin.txt b/doc/README-fr.win32-bin.txt
index 29e3b6f..aafa70d 100644
--- a/doc/README-fr.win32-bin.txt
+++ b/doc/README-fr.win32-bin.txt
@@ -20,7 +20,7 @@ Aussi à consulter: http://wiki.gnucash.org/wiki/IRC
N'hésitez pas à rapporter toute erreur ou tout problème rencontré
sur notre outil de suivi des bogues "Bugzilla":
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-it.win32-bin.txt b/doc/README-it.win32-bin.txt
index 96a420c..04f274b 100644
--- a/doc/README-it.win32-bin.txt
+++ b/doc/README-it.win32-bin.txt
@@ -17,7 +17,7 @@ IRC (Chat): canale #gnucash sul server irc.gnome.org; vedere anche http://wik
Se si riscontrassero dei problemi o dei bug utilizzando il programma, è possibile comunicarli nel sistema
di tracciamento dei bug di GnuCash denominato "Bugzilla":
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-lv.win32-bin.txt b/doc/README-lv.win32-bin.txt
index 85a4578..6c2ef6e 100644
--- a/doc/README-lv.win32-bin.txt
+++ b/doc/README-lv.win32-bin.txt
@@ -18,7 +18,7 @@ VÄstkopas: http://wiki.gnucash.org/wiki/Mailing_Lists
IRC (sazÅa): #gnucash on server irc.gnome.org, skatÄ«t arÄ« http://wiki.gnucash.org/wiki/IRC
Ja atklÄjat kļūdas vai problÄmas, nekautrÄjieties tÄs reÄ£istrÄt "Bugzilla" kļūdu apstrÄdes
-sistÄmÄ http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+sistÄmÄ http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-nl.win32-bin.txt b/doc/README-nl.win32-bin.txt
index 6825257..b420c26 100644
--- a/doc/README-nl.win32-bin.txt
+++ b/doc/README-nl.win32-bin.txt
@@ -18,7 +18,7 @@ IRC (Chat): Channel #gnucash on server irc.gnome.org, see also http://wiki.gn
Als je programmafouten (bugs) of problemen ervaart, aarzel niet om deze te melden in ons
bug opvolgsysteem "Bugzilla":
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-zh_CN.win32-bin.txt b/doc/README-zh_CN.win32-bin.txt
index 01f9ea7..230ea93 100644
--- a/doc/README-zh_CN.win32-bin.txt
+++ b/doc/README-zh_CN.win32-bin.txt
@@ -10,7 +10,7 @@
é®ä»¶å表: http://wiki.gnucash.org/wiki/Mailing_Lists
IRC (è天): irc.gnome.org æå¡å¨ç #gnucash é¢éï¼å¦è§ http://wiki.gnucash.org/wiki/IRC
-妿æ¨éå°äºä»»ä½ bug æè
é®é¢ï¼è¯·ä¸è¦ç¹è±«ï¼å°å®ä»¬æ¥å尿们ç bug è·è¸ªå·¥å
·âBugzillaâï¼http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+妿æ¨éå°äºä»»ä½ bug æè
é®é¢ï¼è¯·ä¸è¦ç¹è±«ï¼å°å®ä»¬æ¥å尿们ç bug è·è¸ªå·¥å
·âBugzillaâï¼http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README-zh_TW.win32-bin.txt b/doc/README-zh_TW.win32-bin.txt
index d0f0397..94058cf 100644
--- a/doc/README-zh_TW.win32-bin.txt
+++ b/doc/README-zh_TW.win32-bin.txt
@@ -11,7 +11,7 @@ GnuCash ä¸å
è¨è¨æææ¼ä½¿ç¨ï¼èä¸åè½å¼·å¤§åæå½æ§ãå®å¯ä»¥
IRC (è天): irc.gnome.org 伺æå¨ç #gnucash é »éï¼è¦ http://wiki.gnucash.org/wiki/IRC
妿æ¨éå°äºä»»ä½ bug æåé¡ï¼è«ä¸è¦é²çï¼å°åé¡å ±åå°æåç bug 追蹤系統 "Bugzilla": (è«ç¨è±æ)
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/doc/README.win32-bin.txt b/doc/README.win32-bin.txt
index 5bf8c2b..60431a4 100644
--- a/doc/README.win32-bin.txt
+++ b/doc/README.win32-bin.txt
@@ -17,7 +17,7 @@ IRC (Chat): Channel #gnucash on server irc.gnome.org, see also http://wiki.gn
If you encounter any bugs or problems, do not hesitate to report them
into our bug tracking tool "Bugzilla":
-http://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash
+http://bugs.gnucash.org/enter_bug.cgi?product=GnuCash
-------------------
diff --git a/gnucash/gnome-utils/dialog-options.c b/gnucash/gnome-utils/dialog-options.c
index 208a27a..f981c5b 100644
--- a/gnucash/gnome-utils/dialog-options.c
+++ b/gnucash/gnome-utils/dialog-options.c
@@ -979,7 +979,7 @@ gnc_option_create_date_widget (GNCOption *option)
created a basic one called Combott implemented in gnc-combott.
Have highlighted changes in this file with comments for when
the feature of per-item tooltips is implemented in gtk,
- see http://bugzilla.gnome.org/show_bug.cgi?id=303717 */
+ see http://bugs.gnucash.org/show_bug.cgi?id=303717 */
GtkListStore *store;
GtkTreeIter iter;
@@ -1086,7 +1086,7 @@ gnc_option_create_multichoice_widget(GNCOption *option)
created a basic one called Combott implemented in gnc-combott.
Have highlighted changes in this file with comments for when
the feature of per-item tooltips is implemented in gtk,
- see http://bugzilla.gnome.org/show_bug.cgi?id=303717 */
+ see http://bugs.gnucash.org/show_bug.cgi?id=303717 */
GtkListStore *store;
GtkTreeIter iter;
diff --git a/gnucash/gnome-utils/gnc-file.c b/gnucash/gnome-utils/gnc-file.c
index 2b2af4a..0f19e5f 100644
--- a/gnucash/gnome-utils/gnc-file.c
+++ b/gnucash/gnome-utils/gnc-file.c
@@ -463,7 +463,7 @@ show_session_error (GtkWindow *parent,
"store large numbers. This means GnuCash cannot use SQL databases "
"correctly. Gnucash will not open or save to SQL databases until this is "
"fixed by installing a different version of \"libdbi\". Please see "
- "https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more "
+ "https://bugs.gnucash.org/show_bug.cgi?id=611936 for more "
"information.");
gnc_error_dialog (parent, "%s", fmt);
@@ -474,7 +474,7 @@ show_session_error (GtkWindow *parent,
fmt = _("GnuCash could not complete a critical test for the presence of "
"a bug in the \"libdbi\" library. This may be caused by a "
"permissions misconfiguration of your SQL database. Please see "
- "https://bugzilla.gnome.org/show_bug.cgi?id=645216 for more "
+ "https://bugs.gnucash.org/show_bug.cgi?id=645216 for more "
"information.");
gnc_error_dialog (parent, "%s", fmt);
diff --git a/gnucash/gnome-utils/gnc-keyring.c b/gnucash/gnome-utils/gnc-keyring.c
index d672e34..7906cd1 100644
--- a/gnucash/gnome-utils/gnc-keyring.c
+++ b/gnucash/gnome-utils/gnc-keyring.c
@@ -180,8 +180,8 @@ gboolean gnc_keyring_get_password ( GtkWidget *parent,
*password = NULL;
#ifdef HAVE_LIBSECRET
- /* Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=746873
- * and by extension for https://bugzilla.gnome.org/show_bug.cgi?id=748625
+ /* Workaround for https://bugs.gnucash.org/show_bug.cgi?id=746873
+ * and by extension for https://bugs.gnucash.org/show_bug.cgi?id=748625
* Store a dummy password and delete it again. This forces libsecret
* to open the keychain, where only a call to secret_password_lookup_sync
* sometimes fails to do so. More details can be found in the bug reports
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index d28da6b..51a0f49 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -667,7 +667,7 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
/* Deal with the uncommon case that the state file defines a window
* but no pages. An example to get in such a situation can be found
- * here: https://bugzilla.gnome.org/show_bug.cgi?id=436479#c3
+ * here: https://bugs.gnucash.org/show_bug.cgi?id=436479#c3
* If this happens on the first window, we will open an account hierarchy
* to avoid confusing the user by presenting a completely empty window.
* If it happens on a later window, we'll just skip restoring that window.
@@ -4866,7 +4866,7 @@ dgettext_swapped (const gchar *msgid,
* This is copied into GnuCash from Gtk in order to fix problems when
* empty msgids were passed through gettext().
*
- * See http://bugzilla.gnome.org/show_bug.cgi?id=326200 . If that bug
+ * See http://bugs.gnucash.org/show_bug.cgi?id=326200 . If that bug
* is fixed in the gtk that we can rely open, then
* gnc_gtk_action_group_set_translation_domain can be replaced by
* gtk_action_group_set_translation_domain again.
diff --git a/gnucash/gnome-utils/gnc-main-window.h b/gnucash/gnome-utils/gnc-main-window.h
index 351a487..f6fee7f 100644
--- a/gnucash/gnome-utils/gnc-main-window.h
+++ b/gnucash/gnome-utils/gnc-main-window.h
@@ -369,7 +369,7 @@ void gnc_main_window_restore_default_state(GncMainWindow *window);
* into GnuCash in order to fix problems when empty msgids were passed
* through gettext().
*
- * See http://bugzilla.gnome.org/show_bug.cgi?id=326200 . If that bug
+ * See http://bugs.gnucash.org/show_bug.cgi?id=326200 . If that bug
* is fixed in the gtk that we can rely open, then
* gnc_gtk_action_group_set_translation_domain can be replaced by
* gtk_action_group_set_translation_domain again.
diff --git a/gnucash/gnome-utils/print-session.c b/gnucash/gnome-utils/print-session.c
index f8fc084..ea781f9 100644
--- a/gnucash/gnome-utils/print-session.c
+++ b/gnucash/gnome-utils/print-session.c
@@ -31,7 +31,7 @@
/* Do not treat -Wstrict-aliasing warnings as errors because of problems of the
* G_LOCK* macros as declared by glib. See
- * http://bugzilla.gnome.org/show_bug.cgi?id=316221 for additional information.
+ * http://bugs.gnucash.org/show_bug.cgi?id=316221 for additional information.
*/
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
# pragma GCC diagnostic warning "-Wstrict-aliasing"
diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index 3606e32..f1cb06a 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -825,7 +825,7 @@ gnc_invoice_post(InvoiceWindow *iw, struct post_invoice_params *post_params)
* Note that we can safely ignore the return value; we checked
* the verify_ok earlier, so we know it's ok.
* Additionally make sure the invoice has the owner's currency
- * refer to https://bugzilla.gnome.org/show_bug.cgi?id=728074
+ * refer to https://bugs.gnucash.org/show_bug.cgi?id=728074
*/
gnc_suspend_gui_refresh ();
gncInvoiceBeginEdit (invoice);
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index 305c5fc..ee6d20c 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -913,7 +913,7 @@ gnc_payment_ok_cb (G_GNUC_UNUSED GtkWidget *widget, gpointer data)
* before we close it. This is undesired because the lots may be in
* an inconsistent state until after all events are handled. So
* the gui refresh may result in a crash.
- * See https://bugzilla.gnome.org/show_bug.cgi?id=740471
+ * See https://bugs.gnucash.org/show_bug.cgi?id=740471
*/
gnc_gui_component_clear_watches (pw->component_id);
diff --git a/gnucash/gnome/gnucash.appdata.xml.in b/gnucash/gnome/gnucash.appdata.xml.in
index 4b9dbec..d8f0665 100644
--- a/gnucash/gnome/gnucash.appdata.xml.in
+++ b/gnucash/gnome/gnucash.appdata.xml.in
@@ -39,7 +39,7 @@
</screenshot>
</screenshots>
<url type="homepage">https://www.gnucash.org</url>
- <url type="bugtracker">https://bugzilla.gnome.org</url>
+ <url type="bugtracker">https://bugs.gnucash.org</url>
<url type="faq">https://wiki.gnucash.org/wiki/FAQ</url>
<url type="help">https://gnucash.org/docs.phtml</url>
<url type="donation">https://gnucash.org/donate.phtml</url>
diff --git a/gnucash/gnucash-bin.c b/gnucash/gnucash-bin.c
index e9a8277..441fa2a 100644
--- a/gnucash/gnucash-bin.c
+++ b/gnucash/gnucash-bin.c
@@ -162,7 +162,7 @@ gnc_print_unstable_message(void)
g_print("\n\n%s\n%s\n%s\n%s\n",
_("This is a development version. It may or may not work."),
_("Report bugs and other problems to gnucash-devel at gnucash.org"),
- _("You can also lookup and file bug reports at http://bugzilla.gnome.org"),
+ _("You can also lookup and file bug reports at http://bugs.gnucash.org"),
_("To find the last stable version, please refer to http://www.gnucash.org"));
}
diff --git a/gnucash/import-export/aqb/test/test-aqb.c b/gnucash/import-export/aqb/test/test-aqb.c
index fe6d1f8..656f75a 100644
--- a/gnucash/import-export/aqb/test/test-aqb.c
+++ b/gnucash/import-export/aqb/test/test-aqb.c
@@ -40,7 +40,7 @@ main (int argc,
qof_log_init_filename_special("stderr"); /* Init the log system */
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
qof_log_set_level("gnc", (QofLogLevel)G_LOG_LEVEL_DEBUG);
- g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
+ g_test_bug_base("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
/* Disable the transaction log */
xaccLogDisable();
diff --git a/gnucash/import-export/bi-import/README b/gnucash/import-export/bi-import/README
index a8ab956..0b502c7 100644
--- a/gnucash/import-export/bi-import/README
+++ b/gnucash/import-export/bi-import/README
@@ -17,4 +17,4 @@ strings', date fields get quoted, probably because the actual value that goes
to the file is the result of implicit to_char(date_value) function call.
The importer tries its best to work in all circumstances, by allowing quotes
on all fields, but not requiring them.
-See bug https://bugzilla.gnome.org/show_bug.cgi?id=658738 for more details.
\ No newline at end of file
+See bug https://bugs.gnucash.org/show_bug.cgi?id=658738 for more details.
diff --git a/gnucash/register/ledger-core/gncEntryLedger.c b/gnucash/register/ledger-core/gncEntryLedger.c
index 796667d..a0d192c 100644
--- a/gnucash/register/ledger-core/gncEntryLedger.c
+++ b/gnucash/register/ledger-core/gncEntryLedger.c
@@ -567,7 +567,7 @@ void gnc_entry_ledger_set_default_invoice (GncEntryLedger *ledger,
* adding bills on a day different from the bill's own date.
* Note this is for bills only, because for (customer's) invoices
* it makes more sense to use the current date.
- * Consult https://bugzilla.gnome.org/show_bug.cgi?id=646541
+ * Consult https://bugs.gnucash.org/show_bug.cgi?id=646541
* to understand why.
*/
if (gncInvoiceGetOwnerType (invoice) == GNC_OWNER_VENDOR)
diff --git a/gnucash/register/register-gnome/gnucash-register.c b/gnucash/register/register-gnome/gnucash-register.c
index 5581508..cf36102 100644
--- a/gnucash/register/register-gnome/gnucash-register.c
+++ b/gnucash/register/register-gnome/gnucash-register.c
@@ -511,7 +511,7 @@ gnucash_register_enter_scrollbar (GtkWidget *widget,
// There seems to be a problem with the scrollbar slider not being
// updated as the mouse moves possibly related to the following bug
- // https://bugzilla.gnome.org/show_bug.cgi?id=765410
+ // https://bugs.gnucash.org/show_bug.cgi?id=765410
// If they are hidden and shown it seems to fix it.
gtk_widget_hide (GTK_WIDGET(vscrollbar));
diff --git a/gnucash/report/business-reports/receipt.eguile.scm b/gnucash/report/business-reports/receipt.eguile.scm
index e98e6d4..4735f0c 100644
--- a/gnucash/report/business-reports/receipt.eguile.scm
+++ b/gnucash/report/business-reports/receipt.eguile.scm
@@ -90,7 +90,7 @@
(let ((ttentries (gncTaxTableGetEntries taxtable)))
(if (string-prefix? "#<swig-pointer PriceList" (object->string ttentries))
; error in SWIG binding -- disable display of tax details
- ; (see http://bugzilla.gnome.org/show_bug.cgi?id=573645)
+ ; (see http://bugs.gnucash.org/show_bug.cgi?id=573645)
(set! taxtables? #f))))))) ; hack required until Swig is fixed
; pre-scan invoice splits to see if any payments have been made
diff --git a/libgnucash/app-utils/business-options.scm b/libgnucash/app-utils/business-options.scm
index 7a62e41..8331590 100644
--- a/libgnucash/app-utils/business-options.scm
+++ b/libgnucash/app-utils/business-options.scm
@@ -461,7 +461,7 @@
;; exception as gnc:make-counter-option above.
;; Note this function uses a hack to make sure there never is a default value
;; (default-value is set to #f and value subsequently set to whatever was passed as default-value)
-;; This hack was introduced to fix https://bugzilla.gnome.org/show_bug.cgi?id=687504
+;; This hack was introduced to fix https://bugs.gnucash.org/show_bug.cgi?id=687504
(define (gnc:make-counter-format-option
section
name
diff --git a/libgnucash/app-utils/test/test-app-utils.c b/libgnucash/app-utils/test/test-app-utils.c
index 03ea193..5daca60 100644
--- a/libgnucash/app-utils/test/test-app-utils.c
+++ b/libgnucash/app-utils/test/test-app-utils.c
@@ -51,7 +51,7 @@ main (int argc, char *argv[])
qof_log_init_filename_special ("stderr"); /* Init the log system */
g_test_init (&argc, &argv, NULL); /* initialize test program */
//qof_log_set_level("gnc", G_LOG_LEVEL_DEBUG);
- g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
+ g_test_bug_base("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
g_setenv ("GNC_UNINSTALLED", "1", TRUE);
scm_boot_guile (argc, argv, guile_main, NULL);
return 0;
diff --git a/libgnucash/app-utils/test/test-exp-parser.c b/libgnucash/app-utils/test/test-exp-parser.c
index 6c46c7f..fca5afb 100644
--- a/libgnucash/app-utils/test/test-exp-parser.c
+++ b/libgnucash/app-utils/test/test-exp-parser.c
@@ -155,9 +155,9 @@ test_parser (void)
add_fail_test ("whitespace", " \t\n", 4);
add_fail_test ("bad expression", "\\", 0);
add_fail_test ("bad expression", "1 +", 3);
- /* Bug#334811 - http://bugzilla.gnome.org/show_bug.cgi?id=334811 */
+ /* Bug#334811 - http://bugs.gnucash.org/show_bug.cgi?id=334811 */
add_fail_test ("bad expression", "1 2", 3);
- /* Bug#308554 - http://bugzilla.gnome.org/show_bug.cgi?id=308554 */
+ /* Bug#308554 - http://bugs.gnucash.org/show_bug.cgi?id=308554 */
add_fail_test ("bad expression", "1 ç", 2);
add_fail_test ("bad expression", "ç 1", 0);
add_fail_test ("bad expression", "1 asdf", 6);
diff --git a/libgnucash/backend/dbi/test/test-backend-dbi.cpp b/libgnucash/backend/dbi/test/test-backend-dbi.cpp
index afffc0d..4ba4844 100644
--- a/libgnucash/backend/dbi/test/test-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/test/test-backend-dbi.cpp
@@ -42,7 +42,7 @@ main (int argc,
qof_init (); /* equally initializes gobject system */
qof_log_init_filename_special ("stderr"); /* Init the log system */
g_test_init (&argc, &argv, NULL); /* initialize test program */
- g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
+ g_test_bug_base ("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
cashobjects_register ();
g_assert (qof_load_backend_library (GNC_LIB_REL_PATH_1, GNC_LIB_NAME_1));
g_assert (qof_load_backend_library (GNC_LIB_REL_PATH_2, GNC_LIB_NAME_2));
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
index 112338b..3ded4c4 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.hpp
@@ -548,7 +548,7 @@ void set_parameter(T object, P item, const char* property)
// here. This is needed to reset the infant state of objects
// when loading them initially from sql. Failing to do so
// could prevent future editing of these objects
- // Example of this is https://bugzilla.gnome.org/show_bug.cgi?id=795944
+ // Example of this is https://bugs.gnucash.org/show_bug.cgi?id=795944
qof_begin_edit(QOF_INSTANCE(object));
g_object_set(object, property, item, nullptr);
if (!qof_commit_edit(QOF_INSTANCE(object))) return;
diff --git a/libgnucash/backend/sql/test/test-sqlbe.cpp b/libgnucash/backend/sql/test/test-sqlbe.cpp
index 6245143..644711d 100644
--- a/libgnucash/backend/sql/test/test-sqlbe.cpp
+++ b/libgnucash/backend/sql/test/test-sqlbe.cpp
@@ -35,7 +35,7 @@ main (int argc,
qof_init (); /* Initialize the GObject system */
qof_log_init_filename_special ("stderr"); /* Init the log system */
g_test_init (&argc, &argv, NULL); /* initialize test program */
- g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
+ g_test_bug_base ("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
test_suite_gnc_backend_sql ();
diff --git a/libgnucash/backend/xml/io-gncxml-v2.cpp b/libgnucash/backend/xml/io-gncxml-v2.cpp
index f85d2a3..81a03f0 100644
--- a/libgnucash/backend/xml/io-gncxml-v2.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v2.cpp
@@ -77,7 +77,7 @@ extern "C"
/* Do not treat -Wstrict-aliasing warnings as errors because of problems of the
* G_LOCK* macros as declared by glib. See
- * http://bugzilla.gnome.org/show_bug.cgi?id=316221 for additional information.
+ * http://bugs.gnucash.org/show_bug.cgi?id=316221 for additional information.
*/
#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
# pragma GCC diagnostic warning "-Wstrict-aliasing"
@@ -791,7 +791,7 @@ qof_session_load_from_xml_file_v2_full (
/* Even though libxml2 knows how to decompress zipped files, we
* do it ourself since as of version 2.9.1 it has a bug that
* causes it to fail to decompress certain files. See
- * https://bugzilla.gnome.org/show_bug.cgi?id=712528 for more
+ * https://bugs.gnucash.org/show_bug.cgi?id=712528 for more
* info.
*/
const char* filename = xml_be->get_filename();
diff --git a/libgnucash/doc/sx.rst b/libgnucash/doc/sx.rst
index eaa2b9c..80d56fc 100644
--- a/libgnucash/doc/sx.rst
+++ b/libgnucash/doc/sx.rst
@@ -59,7 +59,7 @@ TODO
- [ ] bugs
- - [?] Expired scheduled transactions never run - <http://bugzilla.gnome.org/show_bug.cgi?id=375892>
+ - [?] Expired scheduled transactions never run - <http://bugs.gnucash.org/show_bug.cgi?id=375892>
- remove
@@ -160,7 +160,7 @@ Notes::
- use Recurrence instead of FreqSpec
- ! [x] load druid
- - ! [x] sx-from-trans, <http://bugzilla.gnome.org/show_bug.cgi?id=412633>
+ - ! [x] sx-from-trans, <http://bugs.gnucash.org/show_bug.cgi?id=412633>
- ! [x] XML migration, handling
- xml:freqSpec -> obj:Recurrence
diff --git a/libgnucash/engine/ScrubBusiness.c b/libgnucash/engine/ScrubBusiness.c
index 2414d0e..a2f421e 100644
--- a/libgnucash/engine/ScrubBusiness.c
+++ b/libgnucash/engine/ScrubBusiness.c
@@ -534,7 +534,7 @@ gncScrubBusinessSplit (Split *split)
GNCLot *lot = xaccSplitGetLot (split);
/* Look for transactions as a result of double posting an invoice or bill
- * Refer to https://bugzilla.gnome.org/show_bug.cgi?id=754209
+ * Refer to https://bugs.gnucash.org/show_bug.cgi?id=754209
* to learn how this could have happened in the past.
* Characteristics of such transaction are:
* - read only
diff --git a/libgnucash/engine/ScrubBusiness.h b/libgnucash/engine/ScrubBusiness.h
index 0cfce50..a6ab5d1 100644
--- a/libgnucash/engine/ScrubBusiness.h
+++ b/libgnucash/engine/ScrubBusiness.h
@@ -62,7 +62,7 @@ gboolean gncScrubBusinessLot (GNCLot *lot);
* * check if the split is
* part of a transaction that was generated as the result of a doubly
* posted invoice/bill/credit note. Refer to
- * https://bugzilla.gnome.org/show_bug.cgi?id=754209 to learn how this
+ * https://bugs.gnucash.org/show_bug.cgi?id=754209 to learn how this
* could have happened in the past.
* If such a transaction is found, its read-only status is removed and
* a warning is written to the trace file. Considering the user may
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 4950204..616ef1b 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -909,7 +909,7 @@ gncInvoiceGetNetAndTaxesInternal (GncInvoice *invoice, gboolean use_value,
if (use_value)
{
// Always use rounded net values to prevent creating imbalanced transactions on posting
- // https://bugzilla.gnome.org/show_bug.cgi?id=628903
+ // https://bugs.gnucash.org/show_bug.cgi?id=628903
value = gncEntryGetDocValue (entry, TRUE, is_cust_doc, is_cn);
if (gnc_numeric_check (value) == GNC_ERROR_OK)
net_total = gnc_numeric_add (net_total, value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
diff --git a/libgnucash/engine/test/test-engine.c b/libgnucash/engine/test/test-engine.c
index 0f01c3f..0cbe188 100644
--- a/libgnucash/engine/test/test-engine.c
+++ b/libgnucash/engine/test/test-engine.c
@@ -43,7 +43,7 @@ main (int argc,
qof_log_init_filename_special("stderr"); /* Init the log system */
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
//qof_log_set_level("gnc", G_LOG_LEVEL_DEBUG);
- g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
+ g_test_bug_base("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
/* Disable the transaction log */
xaccLogDisable();
diff --git a/libgnucash/engine/test/test-numeric.cpp b/libgnucash/engine/test/test-numeric.cpp
index 6d6eb66..cdb64fe 100644
--- a/libgnucash/engine/test/test-numeric.cpp
+++ b/libgnucash/engine/test/test-numeric.cpp
@@ -720,7 +720,7 @@ check_mult_div (void)
a, b, "expected %s got %s = %s * %s for div 100th's");
/* Check for math with 2^63 < num*num < 2^64 which previously failed
- * see http://bugzilla.gnome.org/show_bug.cgi?id=144980
+ * see http://bugs.gnucash.org/show_bug.cgi?id=144980
*/
v = 1000000;
a = gnc_numeric_create(1 * v, v);
diff --git a/libgnucash/engine/test/test-qof.c b/libgnucash/engine/test/test-qof.c
index d38569a..c558c81 100644
--- a/libgnucash/engine/test/test-qof.c
+++ b/libgnucash/engine/test/test-qof.c
@@ -39,7 +39,7 @@ main (int argc,
qof_log_init_filename_special("stderr"); /* Init the log system */
g_test_init ( &argc, &argv, NULL ); /* initialize test program */
// g_log_set_always_fatal (0);
- g_test_bug_base("https://bugzilla.gnome.org/show_bug.cgi?id="); /* init the bugzilla URL */
+ g_test_bug_base("https://bugs.gnucash.org/show_bug.cgi?id="); /* init the bugzilla URL */
test_suite_qofbook();
test_suite_qofinstance();
diff --git a/po/ar.po b/po/ar.po
index 14f7c30..30861b3 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -11417,17 +11417,17 @@ msgstr ""
"اÙÙ
ÙØªØ¨Ø© \"libdbi\" Ù
Ø®Ø²ÙØ© ÙÙ ÙØ¸Ø§Ù
٠بشÙÙ ÙØ§ ÙØÙØ¸ Ù
Ø¨Ø§ÙØº ÙØ¨Ùرة بشÙ٠صØÙØ. ÙØ°Ø§ "
"ÙØ¹ÙÙ Ø£Ù Ø§ÙØ¨Ø±ÙاÙ
ج ÙØ§ ÙØ³ØªØ·Ùع استخداÙ
ÙØ§Ø¹Ø¯Ø© Ø§ÙØ¨ÙØ§ÙØ§Øª. Ø¥Ù Ø§ÙØ¨Ø±ÙاÙ
ج ÙÙ ÙÙÙÙ
Ø¨ÙØªØ "
"Ø£Ù ØÙظ ÙØ§Ø¹Ø¯Ø© Ø§ÙØ¨ÙØ§ÙØ§Øª ØØªÙ ÙØªÙ
تØÙ
ÙÙ Ù
ÙØªØ¨Ø© أخرÙ. Ø£Ø±Ø¬Ù Ø²ÙØ§Ø±Ø© اÙÙ
ÙÙØ¹ Ø§ÙØªØ§ÙÙ "
-"ÙÙ
Ø²ÙØ¯ Ù
٠اÙÙ
عÙÙÙ
ات https://bugzilla.gnome.org/show_bug.cgi?id=611936 "
+"ÙÙ
Ø²ÙØ¯ Ù
٠اÙÙ
عÙÙÙ
ات https://bugs.gnucash.org/show_bug.cgi?id=611936 "
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"Ø§ÙØ¨Ø±ÙاÙ
ج ÙØ§ ÙØ³ØªØ·Ùع Ø¥ÙÙ
ا٠عÙ
ÙÙØ© Ø§ÙØ¥Ø®ØªØ¨Ø§Ø± ÙÙÙ
ÙØªØ¨Ø© \"libdbi\" بسبب ÙØ¬Ùد عط٠"
-"Ø¨ÙØ§. Ø£Ø±Ø¬Ù Ø²ÙØ§Ø±Ø© Ø§ÙØ±Ø§Ø¨Ø· Ø§ÙØªØ§ÙÙ ÙÙ
Ø²ÙØ¯ Ù
٠اÙÙ
عÙÙÙ
ات https://bugzilla.gnome.org/"
+"Ø¨ÙØ§. Ø£Ø±Ø¬Ù Ø²ÙØ§Ø±Ø© Ø§ÙØ±Ø§Ø¨Ø· Ø§ÙØªØ§ÙÙ ÙÙ
Ø²ÙØ¯ Ù
٠اÙÙ
عÙÙÙ
ات https://bugs.gnucash.org/"
"show_bug.cgi?id=645216 "
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15421,8 +15421,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Ø£Ø±Ø³Ù Ø§ÙØ£Ø®Ø·Ø§Ø¡ ÙØºÙØ±ÙØ§ Ù
٠اÙÙ
شاÙÙ Ùgnucash-devel at gnucash.org"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "ÙÙ
ÙÙÙ Ø£ÙØ¶Ø§ Ø¨ØØ« ÙØªÙدÙÙ
Ø§ÙØªÙØ§Ø±ÙØ± Ø§ÙØ£Ø®Ø·Ø§Ø¡ ÙÙ http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "ÙÙ
ÙÙÙ Ø£ÙØ¶Ø§ Ø¨ØØ« ÙØªÙدÙÙ
Ø§ÙØªÙØ§Ø±ÙØ± Ø§ÙØ£Ø®Ø·Ø§Ø¡ ÙÙ http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/as.po b/po/as.po
index 088d911..6c5ae52 100644
--- a/po/as.po
+++ b/po/as.po
@@ -11462,18 +11462,18 @@ msgstr ""
"à¦à§°à¦¿à¦¬ নà§à§±à¦¾à§°à§. à¦à¦à¦à§à§±à§ বà§à¦à¦¾à§ যৠGnuCash à§à§ SQL ডাà¦à¦¾à¦¬à§à¦ সঠিà¦à¦à¦¾à§±à§ বà§à¦¯à§±à¦¹à¦¾à§° à¦à§°à¦¿à¦¬ "
"নà§à§±à¦¾à§°à§. \"libdbi\" à§° বà§à¦²à§à¦ à¦à¦à¦¾ সà¦à¦¸à§à¦à§°à¦£à§° দà§à¦¬à¦¾à§°à¦¾ à¦à¦à¦à§ নিৰà§à¦¦à¦¿à¦·à§à¦ নà¦à§°à¦¾à¦²à§à¦à§ Gnucash "
"à§à§ SQL ডাà¦à¦¾à¦¬à§à¦à¦¤ à¦à§à¦²à¦¿à¦¬ বা à¦à§à¦ à¦à§°à¦¿à¦¬ নà§à§±à¦¾à§°à¦¿à¦¬. à¦
ধিঠতথà§à¦¯à§° বাবৠà¦
নà§à¦à§à§°à¦¹ à¦à§°à¦¿ https://"
-"bugzilla.gnome.org/show_bug.cgi?id=611936 à¦à§ à¦à¦¾à¦à¦."
+"bugs.gnucash.org/show_bug.cgi?id=611936 à¦à§ à¦à¦¾à¦à¦."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"\"libdbi\" লাà¦à¦¬à§à§°à§à§°à§à¦à§à¦¤ বাঠà¦à¦à¦¾à§° à¦à¦ªà¦¸à§à¦¥à¦¿à¦¤à¦¿à§° বাবৠGnuCash à§à§ à¦à¦ িন পৰà§à¦à§à¦·à¦¾ à¦à¦à¦¾ "
"সমà§à¦ªà§à§°à§à¦£ à¦à§°à¦¿à¦¬ নà§à§±à¦¾à§°à¦¿à¦²à§. à¦à¦à¦à§ à¦à¦ªà§à¦¨à¦¾à§° SQL ডাà¦à¦¾à¦¬à§à¦à§° à¦
নà§à¦®à¦¤à¦¿à¦¬à§à§°à§° à¦à§à¦² à§°à§à¦ªà§°à§à¦à¦¾à¦à§°à¦£ à¦à¦à¦¾à§° "
-"দà§à¦¬à¦¾à§°à¦¾ হব পাৰà§. à¦
নà§à¦à§à§°à¦¹ à¦à§°à¦¿ à¦
ধিঠতথà§à¦¯à§° বাবৠhttps://bugzilla.gnome.org/show_bug."
+"দà§à¦¬à¦¾à§°à¦¾ হব পাৰà§. à¦
নà§à¦à§à§°à¦¹ à¦à§°à¦¿ à¦
ধিঠতথà§à¦¯à§° বাবৠhttps://bugs.gnucash.org/show_bug."
"cgi?id=645216 à¦à§ à¦à¦¾à¦à¦."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15491,8 +15491,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org লৠবাà¦à¦¬à§à§° à¦à§°à§ à¦à¦¨ সমসà§à¦¯à¦¾à¦¬à§à§° ৰিপà§à§°à§à¦ à¦à§°à¦"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "à¦à¦ªà§à¦¨à¦¿ http://bugzilla.gnome.org ত বাঠৰিপà§à§°à§à¦à¦¬à§à§° à¦à¦¾à¦¬ à¦à§°à§ ফাà¦à¦² à¦à§°à¦¿à¦¬ পাৰà§"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "à¦à¦ªà§à¦¨à¦¿ http://bugs.gnucash.org ত বাঠৰিপà§à§°à§à¦à¦¬à§à§° à¦à¦¾à¦¬ à¦à§°à§ ফাà¦à¦² à¦à§°à¦¿à¦¬ পাৰà§"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/az.po b/po/az.po
index 25df565..0a37a5e 100644
--- a/po/az.po
+++ b/po/az.po
@@ -11162,7 +11162,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15158,7 +15158,7 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr ""
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/bg.po b/po/bg.po
index acd004b..669a197 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -11639,13 +11639,13 @@ msgstr ""
"големи ÑиÑла. Това ознаÑава, Ñе GnuCash не може да използва пÑавилно бази Ð¾Ñ "
"данни SQL. Gnucash нÑма да оÑваÑÑ Ð¸Ð»Ð¸ запазва в бази Ð¾Ñ Ð´Ð°Ð½Ð½Ð¸ SQL до "
"попÑавÑне ÑÑез използване на дÑÑга веÑÑÐ¸Ñ Ð½Ð° \"libdbi\". Ðа повеÑе "
-"инÑоÑмаÑиÑ, молÑ, поÑеÑеÑе https://bugzilla.gnome.org/show_bug.cgi?id=611936."
+"инÑоÑмаÑиÑ, молÑ, поÑеÑеÑе https://bugs.gnucash.org/show_bug.cgi?id=611936."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15772,7 +15772,7 @@ msgstr "ÐокладвайÑе за гÑеÑки и пÑоблеми на gnucas
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"ÐожеÑе да пÑоÑледÑваÑе и подаваÑе доклади за гÑеÑка на http://bugzilla.gnome."
"org\n"
diff --git a/po/brx.po b/po/brx.po
index 750e091..f63aa9e 100644
--- a/po/brx.po
+++ b/po/brx.po
@@ -11439,19 +11439,19 @@ msgstr ""
"नà¥à¤à¤¥à¤¾à¤à¤¨à¤¿ सिसà¥à¤à¥à¤®à¤à¤µ à¤à¤¨à¤·à¥à¤à¤² à¤à¤¾à¤²à¤¾à¤®à¤à¤¾à¤¨à¤¾à¤¯ लाà¤à¤¬à¥à¤°à¥à¤°à¤¿ \"libdbi\"ठà¤à¥à¤¦à¥à¤° à¤
नà¤à¤¿à¤®à¤¾à¤à¥ à¤à¥à¤¬à¥à¤à¥ दà¥à¤¨à¤¥à¥à¤®à¤¾à¥¤ "
"बà¥à¤¨à¤¿ à¤à¤à¤¥à¤¿à¤¯à¤¾ GnuCash ठSQL डाà¤à¤¾à¤¬à¥à¤¸à¤à¥ à¤à¥à¤¬à¥à¤à¥ बाहायनॠहाया। Gnucash ठSQL डाà¤à¤¾à¤¬à¥à¤¸à¤à¥ "
"à¤à¥à¤µà¤¨à¤¾à¤¯ नà¤à¤¾ à¤à¤¬à¤¾ थिना दà¥à¤¨à¤¨à¤¾à¤¯ नà¤à¤¾ à¤à¥à¤¬à¥à¤²à¤¾à¤¸à¤¿à¤® बà¥à¤¯à¥ \"libdbi\" नि à¤à¥à¤¬à¥à¤¨ बिसानà¤à¥à¤ à¤à¤¨à¤·à¥à¤à¤² "
-"à¤à¤¾à¤²à¤¾à¤®à¤¨à¤¾à¤¨à¥ थि à¤à¤¾à¤²à¤¾à¤®à¤à¤¾à¤¯à¤¾à¥¤ à¤à¥à¤¬à¤¾à¤ मà¥à¤¨à¤¥à¤¿à¤¨à¥ थाà¤à¤¾à¤¯ https://bugzilla.gnome.org/"
+"à¤à¤¾à¤²à¤¾à¤®à¤¨à¤¾à¤¨à¥ थि à¤à¤¾à¤²à¤¾à¤®à¤à¤¾à¤¯à¤¾à¥¤ à¤à¥à¤¬à¤¾à¤ मà¥à¤¨à¤¥à¤¿à¤¨à¥ थाà¤à¤¾à¤¯ https://bugs.gnucash.org/"
"show_bug.cgi?id=611936 à¤à¥ नाय।"
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash ठ\"libdbi\" बिà¤à¤¾à¤¬ बाà¤à¥à¤°à¤¿à¤à¤µ बाà¤à¤¨à¤¿ नà¥à¤à¤¾à¤¨à¤¾à¤¯à¤¨à¤¿ थाà¤à¤¾à¤¯ à¤à¥à¤¬à¥à¤°à¤¾à¤¬ à¤à¤¨à¤à¤¾à¤¦à¤à¥ "
"फà¥à¤à¥à¤¬à¤¨à¥ हायाà¤à¥à¥¤ बà¥à¤¯à¥ नà¥à¤à¤¥à¤¾à¤à¤¨à¤¿ SQL डाà¤à¤¾à¤¬à¥à¤¸à¤¨à¤¿ à¤à¤¨à¤¾à¤¯à¤¥à¤¿ à¤à¤¾à¤à¥à¤°à¤¿ बाà¤à¤à¥à¤®à¤¹à¤°à¤à¥à¤ à¤à¤¾à¤¨à¥ हाà¤à¥à¥¤ "
-"à¤à¥à¤¬à¤¾à¤ मà¥à¤¨à¤¥à¤¿à¤¨à¥ थाà¤à¤¾à¤¯ https://bugzilla.gnome.org/show_bug.cgi?id=645216 à¤à¥ नाय।"
+"à¤à¥à¤¬à¤¾à¤ मà¥à¤¨à¤¥à¤¿à¤¨à¥ थाà¤à¤¾à¤¯ https://bugs.gnucash.org/show_bug.cgi?id=645216 à¤à¥ नाय।"
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15456,9 +15456,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "बाठà¤à¤°à¥ à¤à¥à¤¬à¥à¤¨ à¤à¥à¤à¤¨à¤¾à¤à¥ gnucash-devel at gnucash.org à¤à¤µ रिपरà¥à¤ à¤à¤¾à¤²à¤¾à¤®"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"नà¥à¤à¤¥à¤¾à¤à¤¾ लà¥à¤à¤à¤ª à¤à¤¾à¤²à¤¾à¤®à¤¨à¥ à¤à¤°à¥ बाठरिपरà¥à¤à¤à¥ http://bugzilla.gnome.org à¤à¤µ फाà¤à¤² "
+"नà¥à¤à¤¥à¤¾à¤à¤¾ लà¥à¤à¤à¤ª à¤à¤¾à¤²à¤¾à¤®à¤¨à¥ à¤à¤°à¥ बाठरिपरà¥à¤à¤à¥ http://bugs.gnucash.org à¤à¤µ फाà¤à¤² "
"à¤à¤¾à¤²à¤¾à¤®à¤¨à¥ हायà¥"
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/ca.po b/po/ca.po
index a5d84bd..747453c 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -11658,20 +11658,20 @@ msgstr ""
"correctament nombres grans. Això vol dir que el GnuCash no pot usar bases de "
"dades SQL correctament. El Gnucash no obrirà o desarà a bases de dades SQL "
"fins que això es corregeixi instal·lant una versió diferent de \"libdbi\". "
-"Si us plau mireu https://bugzilla.gnome.org/show_bug.cgi?id=611936 per a "
+"Si us plau mireu https://bugs.gnucash.org/show_bug.cgi?id=611936 per a "
"més informació."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"El GnuCash no ha pogut completar una prova crÃtica sobre la presència\n"
"d'un eror a la llibreria \"libdbi\". Això pot estar provocat per una\n"
"configuració incorrecta dels permisos de la vostra base de dades\n"
-"SQL. Si us plau mireu https://bugzilla.gnome.org/show_bug.cgi?id=645216 \n"
+"SQL. Si us plau mireu https://bugs.gnucash.org/show_bug.cgi?id=645216 \n"
"per a més informació."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15733,9 +15733,9 @@ msgstr ""
"Informeu sobre els errors i altres problemes a gnucash-devel at gnucash.org."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"També podeu consultar i crear informes d'error a http://bugzilla.gnome.org"
+"També podeu consultar i crear informes d'error a http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/cs.po b/po/cs.po
index cfcab51..d845791 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -11464,7 +11464,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15568,7 +15568,7 @@ msgstr "Chyby a jiné problémy hlaste na gnucash-devel at gnucash.org.\n"
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Můžete také vyhledávat a zakládat hlášenà o chybách na http://bugzilla.gnome."
"org\n"
diff --git a/po/da.po b/po/da.po
index 9639c3a..fdf4bc2 100644
--- a/po/da.po
+++ b/po/da.po
@@ -11388,7 +11388,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15441,9 +15441,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Meld fejl og andre problemer til gnucash-devel at gnucash.org."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Du kan også finde og anmelde fejlrapporter på http://bugzilla.gnome.org"
+"Du kan også finde og anmelde fejlrapporter på http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/de.po b/po/de.po
index 39dbd44..e0af340 100644
--- a/po/de.po
+++ b/po/de.po
@@ -15,7 +15,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 2.7.4\n"
-"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
"product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2018-03-26 21:02+0200\n"
"PO-Revision-Date: 2018-03-26 21:20+0200\n"
@@ -7333,19 +7333,19 @@ msgstr ""
"Zahlen nicht korrekt speichern. Dadurch kann GnuCash keine SQL-Datenbank "
"benutzen. GnuCash kann keine SQL-Datenbank öffnen oder dahin speichern, bis "
"eine andere Version von »libdbi« installiert ist. Siehe auch https://"
-"bugzilla.gnome.org/show_bug.cgi?id=611936 "
+"bugs.gnucash.org/show_bug.cgi?id=611936 "
#: gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash konnte eine wichtige Ãberprüfung der Hilfsbibliothek »libdbi« nicht "
"durchführen. Dies könnte durch fehlerhafte Benutzerrechte in Ihrer SQL-"
"Datenbank verursacht sein. Bitte lesen Sie den Fehlerbericht auf <https//"
-"bugzilla.gnome.org/show_bug.cgi?id=645216 und prüfen, ob Sie dort die "
+"bugs.gnucash.org/show_bug.cgi?id=645216 und prüfen, ob Sie dort die "
"passende Korrektur nachlesen können."
#: gnucash/gnome-utils/gnc-file.c:484
@@ -9128,9 +9128,9 @@ msgstr ""
"Fehler und andere Probleme werden auf gnucash-devel at gnucash.org diskutiert."
#: gnucash/gnucash-bin.c:161
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Fehlerberichte können auf http://bugzilla.gnome.org eingesehen und erstellt "
+"Fehlerberichte können auf http://bugs.gnucash.org eingesehen und erstellt "
"werden."
#: gnucash/gnucash-bin.c:162
diff --git a/po/doi.po b/po/doi.po
index c8ae914..85fdaa4 100644
--- a/po/doi.po
+++ b/po/doi.po
@@ -11565,13 +11565,13 @@ msgstr ""
"à¤à¤¨à¥à¤¨à¥ à¤à¤à¤¡à¤¾à¤° नà¥à¤à¤ à¤à¤°à¤¦à¥ .à¤à¤¸à¤¦à¤¾ मतलब ठà¤à¥ Gnucash SQL डà¥à¤à¤¾à¤¬à¥à¤¸à¥à¤ à¤à¥ सà¥à¤¹à¥à¤ तरà¥à¤à¥ à¤à¤¨à¥à¤¨à¥ नà¥à¤à¤ बरतॠ"
"सà¤à¤¦à¤¾.à¤à¤¿à¤¸à¤²à¥ तà¤à¤° \"libdbi\"दा बà¤à¥à¤à¤°à¤¾ सरà¥à¤ª à¤à¤à¤¸à¥à¤à¤¾à¤² à¤à¤°à¤¿à¤¯à¥ à¤à¤¸à¥ ठà¥à¤ नà¥à¤à¤ à¤à¥à¤¤à¤¾ à¤à¤à¤¦à¤¾ à¤à¤¸à¥ तà¤à¤° "
"Gnucash SQL डà¥à¤à¤¾à¤¬à¥à¤¸à¥à¤ ठà¤à¥à¤¹à¥âलà¥à¤ à¤à¤¾à¤ बà¤à¤¾à¤à¤¯à¥ नà¥à¤à¤ रà¤à¥à¤à¥à¤ à¤à¤¾à¤¹à¥âà¤. हà¥à¤° मतॠà¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¤¸à¥à¤¤à¥ à¤à¥à¤ªà¤¾ "
-"à¤à¤°à¤¿à¤¯à¥ https://bugzilla.gnome.org/show_bug.cgi?id=611936 दिà¤à¥à¤à¥. "
+"à¤à¤°à¤¿à¤¯à¥ https://bugs.gnucash.org/show_bug.cgi?id=611936 दिà¤à¥à¤à¥. "
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15682,8 +15682,8 @@ msgstr "बà¤à¥à¤ तॠहà¥à¤° दà¥à¤à¤¯à¥à¤ समसà¥à¤¯à¤¾à¤
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "तà¥à¤¸ http://bugzilla.gnome.org पर बठरिपà¥à¤à¤¾à¤ दिà¤à¥à¤à¥ तॠदरà¥à¤ à¤à¤°à¥ सà¤à¤¦à¥ à¤.\n"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "तà¥à¤¸ http://bugs.gnucash.org पर बठरिपà¥à¤à¤¾à¤ दिà¤à¥à¤à¥ तॠदरà¥à¤ à¤à¤°à¥ सà¤à¤¦à¥ à¤.\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/el.po b/po/el.po
index 09223f2..db240b3 100644
--- a/po/el.po
+++ b/po/el.po
@@ -11431,7 +11431,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15465,10 +15465,10 @@ msgstr ""
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"ÎÏοÏείÏε να ελÎγξεÏε και να καÏαÏÏÏίÏεÏε αναÏοÏÎÏ ÏÏαλμάÏÏν ÏÏο http://"
-"bugzilla.gnome.org\n"
+"bugs.gnucash.org\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/en_GB.po b/po/en_GB.po
index bd4a21d..d316f40 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -11520,7 +11520,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15618,9 +15618,9 @@ msgstr "Report bugs and other problems to gnucash-devel at gnucash.org.\n"
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"You can also lookup and file bug reports at http://bugzilla.gnome.org\n"
+"You can also lookup and file bug reports at http://bugs.gnucash.org\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/es.po b/po/es.po
index 4b153fc..1db8eea 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gnucash 2.7.8\n"
-"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash&component=Translations\n"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2018-03-25 12:40-0700\n"
"PO-Revision-Date: 2018-04-03 23:51+0200\n"
"Last-Translator: Francisco Javier Serrador <fserrador at gmail.com>\n"
@@ -6796,12 +6796,12 @@ msgid "The SQL database is in use by other users, and the upgrade cannot be perf
msgstr "La base de datos SQL está siendo empleada por otros usuarios y la actualización no puede realizarse hasta que salgan. Si no hay otros usuarios, consulte la documentación para saber cómo expulsa sesiones bloqueadas."
#: gnucash/gnome-utils/gnc-file.c:462
-msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more information."
-msgstr "La biblioteca âlibdbiâ instalada en su sistema no almacena correctamente los números largos. Esto significa que Gnucash no puede utilizar bases de datos SQL correctamente. Gnucash no abrirá ni guardará bases de datos SQL hasta que esto sea solucionado instalando un versión distinta de âlibdbâ. Vea https://bugzilla.gnome.org/show_bug.cgi?id=611936 para más información."
+msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugs.gnucash.org/show_bug.cgi?id=611936 for more information."
+msgstr "La biblioteca âlibdbiâ instalada en su sistema no almacena correctamente los números largos. Esto significa que Gnucash no puede utilizar bases de datos SQL correctamente. Gnucash no abrirá ni guardará bases de datos SQL hasta que esto sea solucionado instalando un versión distinta de âlibdbâ. Vea https://bugs.gnucash.org/show_bug.cgi?id=611936 para más información."
#: gnucash/gnome-utils/gnc-file.c:474
-msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?id=645216 for more information."
-msgstr "GnuCash no pudo completar una prueba crÃtica para la presencia de un defecto en la biblioteca \"libdbi\". Esto puede ser causado por una desconfiguración errónea de los permisos de su base de datos SQL. Por favor, vea https://bugzilla.gnome.org/show_bug.cgi?id=645216 para mayor información."
+msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?id=645216 for more information."
+msgstr "GnuCash no pudo completar una prueba crÃtica para la presencia de un defecto en la biblioteca \"libdbi\". Esto puede ser causado por una desconfiguración errónea de los permisos de su base de datos SQL. Por favor, vea https://bugs.gnucash.org/show_bug.cgi?id=645216 para mayor información."
#: gnucash/gnome-utils/gnc-file.c:484
msgid "This file is from an older version of GnuCash and will be upgraded when saved by this version. You will not be able to read the saved file from the older version of Gnucash (it will report an \"error parsing the file\"). If you wish to preserve the old version, exit without saving."
@@ -8448,8 +8448,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Comunique defectos y otros problemas a gnucash-devel at gnucash.org"
#: gnucash/gnucash-bin.c:161
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "También puede ver y enviar boletines de defectos a http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "También puede ver y enviar boletines de defectos a http://bugs.gnucash.org"
#: gnucash/gnucash-bin.c:162
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/es_NI.po b/po/es_NI.po
index e76c84f..8cbd490 100644
--- a/po/es_NI.po
+++ b/po/es_NI.po
@@ -11859,7 +11859,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -16151,7 +16151,7 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr ""
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/eu.po b/po/eu.po
index a449244..1122978 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -11731,7 +11731,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -16000,9 +16000,9 @@ msgstr ""
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Akatsen berriemateak ikusi eta bidaltzeko http://bugzilla.gnome.org ere "
+"Akatsen berriemateak ikusi eta bidaltzeko http://bugs.gnucash.org ere "
"erabil dezakezu.\n"
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/fa.po b/po/fa.po
index 5152552..84316f5 100644
--- a/po/fa.po
+++ b/po/fa.po
@@ -10917,7 +10917,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -14803,7 +14803,7 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr ""
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/fi.po b/po/fi.po
index 8957a5b..0c1d455 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -10997,7 +10997,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -14943,7 +14943,7 @@ msgstr ""
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Voit myös etsiä ja jättää bugiraportteja osoitteessa http://bugzilla.gnome."
"org\n"
diff --git a/po/fr.po b/po/fr.po
index 053d85a..dfd2681 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -12747,13 +12747,13 @@ msgstr ""
"utiliser correctement les bases de données SQL. GnuCash nâouvrir ni ne "
"sauvegardera de base de donnée SQL tant que cela nâaura pas été corrigé par "
"lâinstallation dâune autre version de « libdbi ». Veuillez vous référer à "
-"https://bugzilla.gnome.org/show_bug.cgi?id=611936 pour plus dâinformations."
+"https://bugs.gnucash.org/show_bug.cgi?id=611936 pour plus dâinformations."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -17215,10 +17215,10 @@ msgstr ""
"Rapporter les anomalies ou tout autre problème à gnucash-devel at gnucash.org."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Vous pouvez aussi consulter ou transmettre des rapports d'anomalie sur "
-"http://bugzilla.gnome.org"
+"http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/glossary/ar.po b/po/glossary/ar.po
index d81960f..7a8bf08 100644
--- a/po/glossary/ar.po
+++ b/po/glossary/ar.po
@@ -78,7 +78,7 @@ msgstr ""
msgid "account type: Mutual fund"
msgstr ""
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
msgid "account type: Passive"
msgstr ""
diff --git a/po/glossary/bg.po b/po/glossary/bg.po
index e089bd4..0f5c9f1 100644
--- a/po/glossary/bg.po
+++ b/po/glossary/bg.po
@@ -85,7 +85,7 @@ msgstr "account type: Ñондов пазаÑ"
msgid "account type: Mutual fund"
msgstr "account type: взаимни Ñондове"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "account type: ÐкÑив"
diff --git a/po/glossary/ca.po b/po/glossary/ca.po
index 4d22b47..bc4895b 100644
--- a/po/glossary/ca.po
+++ b/po/glossary/ca.po
@@ -81,7 +81,7 @@ msgstr "mercat monetari"
msgid "account type: Mutual fund"
msgstr "Fons d'inversió"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "Actiu"
diff --git a/po/glossary/da.po b/po/glossary/da.po
index 7c25424..b60571c 100644
--- a/po/glossary/da.po
+++ b/po/glossary/da.po
@@ -83,7 +83,7 @@ msgstr "kontotype: aftaleindskud"
msgid "account type: Mutual fund"
msgstr "kontotype: aktiefond"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "kontotype: Aktiv"
diff --git a/po/glossary/de.po b/po/glossary/de.po
index ad9daf8..fe4dfe4 100644
--- a/po/glossary/de.po
+++ b/po/glossary/de.po
@@ -81,7 +81,7 @@ msgstr "Geldmarktfonds"
msgid "account type: Mutual fund"
msgstr "Investmentfonds"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
msgid "account type: Passive"
msgstr "Passiva"
diff --git a/po/glossary/de_CH.po b/po/glossary/de_CH.po
index ee09aa3..3119334 100644
--- a/po/glossary/de_CH.po
+++ b/po/glossary/de_CH.po
@@ -80,7 +80,7 @@ msgstr "Geldmarktfonds"
msgid "account type: Mutual fund"
msgstr "Investmentfonds"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "Aktiven"
diff --git a/po/glossary/el.po b/po/glossary/el.po
index 0438419..4702ae6 100644
--- a/po/glossary/el.po
+++ b/po/glossary/el.po
@@ -84,7 +84,7 @@ msgstr ""
msgid "account type: Mutual fund"
msgstr ""
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "ÎÎ¯Î´Î¿Ï Î Î±ÏαÏκηνίοÏ
:"
diff --git a/po/glossary/es.po b/po/glossary/es.po
index 34a0f20..0c71918 100644
--- a/po/glossary/es.po
+++ b/po/glossary/es.po
@@ -84,7 +84,7 @@ msgstr "tipo de cuenta: mercado monetario"
msgid "account type: Mutual fund"
msgstr "tipo de cuenta: Fondo de Inversión"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "tipo de cuenta: Activo"
diff --git a/po/glossary/fr.po b/po/glossary/fr.po
index 527dbe9..e0a7d81 100644
--- a/po/glossary/fr.po
+++ b/po/glossary/fr.po
@@ -83,7 +83,7 @@ msgstr "type de compte : marché monétaire"
msgid "account type: Mutual fund"
msgstr "type de compte : fond mutuel"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "type de compte : actif"
diff --git a/po/glossary/gnc-glossary.txt b/po/glossary/gnc-glossary.txt
index 7d7c79f..f8bc491 100644
--- a/po/glossary/gnc-glossary.txt
+++ b/po/glossary/gnc-glossary.txt
@@ -14,7 +14,7 @@
"account type: Liability" "A debt, a financial obligation, but see also 'account type: Passive'"
"account type: money-market" "-"
"account type: Mutual fund" "-"
-"account type: Passive" "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+"account type: Passive" "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
"account type: Profit & Loss" "Group of accounts tracking your success, complement of 'Assets & Liabilities'"
"account type: saving" "1. (US) any type of account that earns interest 2. (Brit) any type of bank account that earns a higher level of interest than a current account or deposit account"
"account type: Stock" "-"
diff --git a/po/glossary/he.po b/po/glossary/he.po
index baa3087..757eecb 100644
--- a/po/glossary/he.po
+++ b/po/glossary/he.po
@@ -81,7 +81,7 @@ msgstr "ש××§ ××××"
msgid "account type: Mutual fund"
msgstr "×§×¨× × ××× ×ת"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "× ×ס"
diff --git a/po/glossary/hu.po b/po/glossary/hu.po
index 723d825..f2d2ad9 100644
--- a/po/glossary/hu.po
+++ b/po/glossary/hu.po
@@ -83,7 +83,7 @@ msgstr "Számla tÃpus: Pénzpiac"
msgid "account type: Mutual fund"
msgstr "Számla tÃpus: Befektetési alap"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "Számla tÃpus:Eszköz"
diff --git a/po/glossary/it.po b/po/glossary/it.po
index 4d06055..77f4d5a 100644
--- a/po/glossary/it.po
+++ b/po/glossary/it.po
@@ -87,7 +87,7 @@ msgstr "tipo conto: mercato monetario"
msgid "account type: Mutual fund"
msgstr "tipo conto: fondi comuni"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "tipo conto: attivo, attività "
diff --git a/po/glossary/lt.po b/po/glossary/lt.po
index 1f8605c..caa3a5d 100644
--- a/po/glossary/lt.po
+++ b/po/glossary/lt.po
@@ -84,7 +84,7 @@ msgstr "sÄ
skaitos tipas: pinigų rinka"
msgid "account type: Mutual fund"
msgstr "sÄ
skaitos tipas: Investicinis fondas"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "sÄ
skaitos tipas: Turtas"
diff --git a/po/glossary/nb.po b/po/glossary/nb.po
index b980d7f..5babe55 100644
--- a/po/glossary/nb.po
+++ b/po/glossary/nb.po
@@ -84,7 +84,7 @@ msgstr "kontotype: pengemarked"
msgid "account type: Mutual fund"
msgstr "kontotype: investeringsfond"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
msgid "account type: Passive"
msgstr "kontotype: Passiva"
diff --git a/po/glossary/nl.po b/po/glossary/nl.po
index 49a91ed..cadae32 100644
--- a/po/glossary/nl.po
+++ b/po/glossary/nl.po
@@ -80,7 +80,7 @@ msgstr "Geldmarktfonds"
msgid "account type: Mutual fund"
msgstr "Investeringsfonds"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "Activa"
diff --git a/po/glossary/pl.po b/po/glossary/pl.po
index 3a45c0b..37df801 100644
--- a/po/glossary/pl.po
+++ b/po/glossary/pl.po
@@ -82,7 +82,7 @@ msgstr "typ konta: rynek walut"
msgid "account type: Mutual fund"
msgstr "typ konta: Fundusz wzajemny"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "typ konta: Aktywa"
diff --git a/po/glossary/pt.po b/po/glossary/pt.po
index 462ffed..9a281d5 100644
--- a/po/glossary/pt.po
+++ b/po/glossary/pt.po
@@ -84,7 +84,7 @@ msgstr "tipo de conta: mercado cambial"
msgid "account type: Mutual fund"
msgstr "tipo de conta: Fundo de investimento"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "tipo de conta: Ativo"
diff --git a/po/glossary/pt_BR.po b/po/glossary/pt_BR.po
index 9f8a01c..73a923f 100644
--- a/po/glossary/pt_BR.po
+++ b/po/glossary/pt_BR.po
@@ -85,7 +85,7 @@ msgstr "mercado monetário"
msgid "account type: Mutual fund"
msgstr "Fundo mútuo"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "Ativo"
diff --git a/po/glossary/ru.po b/po/glossary/ru.po
index 6696569..2262560 100644
--- a/po/glossary/ru.po
+++ b/po/glossary/ru.po
@@ -85,7 +85,7 @@ msgstr "account type: валÑÑнÑй ÑÑнок"
msgid "account type: Mutual fund"
msgstr "account type: ÐзаимнÑй Ñонд"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "account type: ÐкÑив"
diff --git a/po/glossary/rw.po b/po/glossary/rw.po
index 9e15457..78bdfcd 100644
--- a/po/glossary/rw.po
+++ b/po/glossary/rw.po
@@ -104,7 +104,7 @@ msgstr "Aderesi Ubwoko"
msgid "account type: Mutual fund"
msgstr "Aderesi Ubwoko"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "Aderesi Ubwoko"
diff --git a/po/glossary/sk.po b/po/glossary/sk.po
index 653db49..37bcaba 100644
--- a/po/glossary/sk.po
+++ b/po/glossary/sk.po
@@ -84,7 +84,7 @@ msgstr "account type: peÅažný trh"
msgid "account type: Mutual fund"
msgstr "account type: Podielový fond"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "account type: AktÃva"
diff --git a/po/glossary/sv.po b/po/glossary/sv.po
index 49b0c0e..5e486f5 100644
--- a/po/glossary/sv.po
+++ b/po/glossary/sv.po
@@ -84,7 +84,7 @@ msgstr "kontotyp: penningmarknad"
msgid "account type: Mutual fund"
msgstr "kontotyp: aktiefond"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "kontotyp: Tillgång"
diff --git a/po/glossary/vi.po b/po/glossary/vi.po
index ad71276..88c6688 100644
--- a/po/glossary/vi.po
+++ b/po/glossary/vi.po
@@ -83,7 +83,7 @@ msgstr "kiá»u tà i khoản: thá» trưá»ng tiá»n"
msgid "account type: Mutual fund"
msgstr "kiá»u tà i khoản: quỹ lẫn nhau"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "kiá»u tà i khoản: tà i sản"
diff --git a/po/glossary/zh_CN.po b/po/glossary/zh_CN.po
index 5c6bbdf..12a815c 100644
--- a/po/glossary/zh_CN.po
+++ b/po/glossary/zh_CN.po
@@ -90,7 +90,7 @@ msgid "account type: Mutual fund"
msgstr "ç§ç®ç±»åï¼æèµåºé"
# æäººææå
¬å¸ææçæä¸ªäºç©ï¼å
¶æä»·å¼å¹¶ä¸å¯ä»¥è¢«ä½¿ç¨æéå®ä»¥æ¯ä»åºå¡
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "ç§ç®ç±»åï¼èµäº§"
diff --git a/po/glossary/zh_TW.po b/po/glossary/zh_TW.po
index 94c04bc..577d8e8 100644
--- a/po/glossary/zh_TW.po
+++ b/po/glossary/zh_TW.po
@@ -81,7 +81,7 @@ msgstr "ç§ç®é¡åï¼éèå¸å ´"
msgid "account type: Mutual fund"
msgstr "ç§ç®é¡åï¼å
±ååºé"
-#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugzilla.gnome.org/show_bug.cgi?id=421766"
+#. "The right side of the balance sheet in T account form shows the source of funds and contains equity & liability. While not common in english, most languages would translate 'equity & liability' with 'passive'. Complement: Active. See also: Report Form Implementation: https://bugs.gnucash.org/show_bug.cgi?id=421766"
#, fuzzy
msgid "account type: Passive"
msgstr "ç§ç®é¡åï¼è³ç¢"
diff --git a/po/gnucash-pot.cmake b/po/gnucash-pot.cmake
index 1658f54..c6cfcd1 100644
--- a/po/gnucash-pot.cmake
+++ b/po/gnucash-pot.cmake
@@ -29,7 +29,7 @@ execute_process(
--keyword=translate:1c,2,3,4t
--package-name=${PACKAGE_NAME}
--package-version=${PACKAGE_VERSION}
- --msgid-bugs-address=https://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash&component=Translations
+ --msgid-bugs-address=https://bugs.gnucash.org/enter_bug.cgi?product=GnuCash&component=Translations
WORKING_DIRECTORY ${PO_BIN_DIR}
RESULT_VARIABLE GNUCASH_POT_RESULT
)
diff --git a/po/gu.po b/po/gu.po
index b988707..40b7125 100644
--- a/po/gu.po
+++ b/po/gu.po
@@ -11512,13 +11512,13 @@ msgstr ""
"તમારૠસિસà«àªàª®àª®àª¾àª àªàªªàª¯à«àª àªàª°àªµàª¾àª®àª¾àª àªàªµà«àª²à« \"libdbi\" લાàªàª¬à«àª°à«àª°à« વધૠસàªàªà«àª¯àª¾àª®àª¾àª યà«àªà«àª¯ રà«àª¤à« સàªàªà«àª°àª¹àª¿àª¤ "
"àªàª°àª¤à« નથà«. GnuCashનૠàªà«àª¯àª¾àª સà«àª§à« \"libdbi\" માàªà« àª
લઠàªàªµà«àª¤à«àª¤àª¿àª®àª¾àª àªàª¨à«àª¸à«àªà«àª² àªàª°à«àª¨à« તà«àª¨à« ઠà«àª "
"àªàª°àªµàª¾àª®àª¾àª નહà«àª àªàªµà« તà«àª¯àª¾àª સà«àª§à« SQL ડà«àªàª¾àª¬à«àªà«àª®àª¾àª àªà«àª²à« àªà« સà«àªµ àªàª°à« શàªàª¾àª¶à« નહà«àª. વધૠàªàª¾àª£àªàª¾àª°à« માàªà« "
-"àªà«àªªàª¾ àªàª°à«àª¨à« https://bugzilla.gnome.org/show_bug.cgi?id=611936 àªà«àª."
+"àªà«àªªàª¾ àªàª°à«àª¨à« https://bugs.gnucash.org/show_bug.cgi?id=611936 àªà«àª."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15605,9 +15605,9 @@ msgstr "બઠàª
નૠàª
નà«àª¯ મà«àª¶à«àªà«àª²à«àª વિશૠg
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"તમૠબàªàª¨à« àª
હà«àªµàª¾àª² http://bugzilla.gnome.org પર પણ àªà«àª શàªà« àªà« àª
નૠàªàªªà« પણ શàªà« àªà«.\n"
+"તમૠબàªàª¨à« àª
હà«àªµàª¾àª² http://bugs.gnucash.org પર પણ àªà«àª શàªà« àªà« àª
નૠàªàªªà« પણ શàªà« àªà«.\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/he.po b/po/he.po
index 5a991b4..3c9f6ff 100644
--- a/po/he.po
+++ b/po/he.po
@@ -11049,7 +11049,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -14989,8 +14989,8 @@ msgstr "×××× ×¢× ××××× ×××¢××ת ××ר×ת ×- gnucash at devel@gnuca
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "×× × ×××× ×× ××פש ×××××× ×¢× ××××× ×- http://bugzilla.gnome.org\n"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "×× × ×××× ×× ××פש ×××××× ×¢× ××××× ×- http://bugs.gnucash.org\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/hi.po b/po/hi.po
index 91f4b5e..70afaa1 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -11373,18 +11373,18 @@ msgstr ""
"नहà¥à¤ à¤à¤°à¤¤à¥ हà¥. à¤à¤¸à¤à¤¾ मतलब हॠà¤à¤¿ GnuCash सहॠतरà¥à¤à¥ सॠSQL डà¥à¤à¤¾à¤¬à¥à¤¸à¥à¤ à¤à¤¾ à¤à¤ªà¤¯à¥à¤ नहà¥à¤ à¤à¤° "
"सà¤à¤¤à¤¾ हà¥. Gnucash SQL डà¥à¤à¤¾à¤¬à¥à¤¸à¥à¤ मà¥à¤ à¤à¥à¤²à¤¨à¥ या सहà¥à¤à¤¨à¥ à¤à¤¾ à¤à¤¾à¤® नहà¥à¤ à¤à¤°à¥à¤à¤¾ à¤à¤¬ तठà¤à¤¿ \"libdbi"
"\" à¤à¤¾ à¤à¤ à¤
लठसà¤à¤¸à¥à¤à¤°à¤£ à¤à¤à¤¸à¥à¤à¥à¤² à¤à¤°à¤à¥ à¤à¤¸ समसà¥à¤¯à¤¾ à¤à¥ दà¥à¤° नहà¥à¤ à¤à¤¿à¤¯à¤¾ à¤à¤¾à¤¤à¤¾ हà¥. à¤
धिठà¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¥ "
-"लिठà¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥à¤ https://bugzilla.gnome.org/show_bug.cgi?id=611936."
+"लिठà¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥à¤ https://bugs.gnucash.org/show_bug.cgi?id=611936."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash \"libdbi\" लाà¤à¤¬à¥à¤°à¥à¤°à¥ मà¥à¤ बठà¤à¥ मà¥à¤à¥à¤¦à¤à¥ à¤à¥ लिठà¤à¤ महतà¥à¤µà¤ªà¥à¤°à¥à¤£ परà¥à¤à¥à¤·à¤£ पà¥à¤°à¤¾ नहà¥à¤ à¤à¤° "
"सà¤à¤¤à¤¾ हà¥. à¤à¤¸à¤¾ à¤à¤ªà¤à¥ SQL डà¥à¤à¤¾à¤¬à¥à¤¸ मà¥à¤ à¤
नà¥à¤®à¤¤à¤¿ à¤à¥ à¤à¤²à¤¤ à¤à¥à¤¨à¥à¤«à¤¼à¤¿à¤à¤°à¥à¤¶à¤¨ à¤à¥ à¤à¤¾à¤°à¤£ हॠसà¤à¤¤à¤¾ हà¥. à¤
धिठ"
-"à¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¥ लिठà¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥à¤ https://bugzilla.gnome.org/show_bug.cgi?id=645216. "
+"à¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¥ लिठà¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥à¤ https://bugs.gnucash.org/show_bug.cgi?id=645216. "
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15376,8 +15376,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org à¤à¥ लिठबठतथा à¤
नà¥à¤¯ समसà¥à¤¯à¤¾à¤à¤ à¤à¥ सà¥à¤à¤¨à¤¾ दà¥à¤."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "http://bugzilla.gnome.org पर à¤à¥ बठरिपà¥à¤°à¥à¤ दà¥à¤ à¤à¤° दरà¥à¤ à¤à¤° सà¤à¤¤à¥ हà¥à¤"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "http://bugs.gnucash.org पर à¤à¥ बठरिपà¥à¤°à¥à¤ दà¥à¤ à¤à¤° दरà¥à¤ à¤à¤° सà¤à¤¤à¥ हà¥à¤"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/hu.po b/po/hu.po
index 69e8bfa..801fc1d 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -11494,7 +11494,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15545,9 +15545,9 @@ msgstr ""
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Hibajelentéseket megtekinthet vagy leadhat a http://bugzilla.gnome.org "
+"Hibajelentéseket megtekinthet vagy leadhat a http://bugs.gnucash.org "
"lapon.\n"
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/it.po b/po/it.po
index 76e5ca6..ad48883 100644
--- a/po/it.po
+++ b/po/it.po
@@ -11871,13 +11871,13 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash non può completare un test critico per la presenza di un bug nella "
"libreria \"libdbi\". La causa può essere una errata configurazione dei "
"permessi del proprio database SQL. Per maggiori informazioni leggere qui "
-"https://bugzilla.gnome.org/show_bug.cgi?id=645216."
+"https://bugs.gnucash.org/show_bug.cgi?id=645216."
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -16039,10 +16039,10 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Segnalare i problemi a gnucash-devel at gnucash.org"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Ã possibile anche cercare e compilare rapporti d'errore all'indirizzo http://"
-"bugzilla.gnome.org"
+"bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/ja.po b/po/ja.po
index c41cff9..0bdfb3c 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -11336,7 +11336,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15322,9 +15322,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "ãã°ããã®ä»ã®åé¡ã¯ gnucash-devel at gnucash.org ã«å ±åãã¦ãã ããã"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"ã¾ãã http://bugzilla.gnome.org ã§ãã°ãæ¢ãããç»é²ãããã¨ãã§ãã¾ãã"
+"ã¾ãã http://bugs.gnucash.org ã§ãã°ãæ¢ãããç»é²ãããã¨ãã§ãã¾ãã"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/kn.po b/po/kn.po
index 01da709..29e2313 100644
--- a/po/kn.po
+++ b/po/kn.po
@@ -11517,19 +11517,19 @@ msgstr ""
"ನಿಮà³à²® ವà³à²¯à²µà²¸à³à²¥à³à²¯à²²à³à²²à²¿ à²
ನà³à²¸à³à²¥à²¾à²ªà²¿à²¸à²²à²¾à²à²¿à²°à³à²µ \"libdbi\" ಲà³à²¬à³à²°à²°à²¿à²¯à³ ದà³à²¡à³à²¡ ಸà²à²à³à²¯à³à²à²³à²¨à³à²¨à³ ಸರಿಯಾದ "
"ಶà³à²à²°à²¿à²¸à²²à³ ಸಾಧà³à²¯à²µà²¿à²°à³à²µà³à²¦à²¿à²²à³à²². à²à²¦à²°à²°à³à²¥ \"libdbi\" ಯ ಬà³à²°à³à²à²¦à³ à²à²µà³à²¤à³à²¤à²¿à²¯à²¨à³à²¨à³ à²
ನà³à²¸à³à²¥à²¾à²ªà²¿à²¸à²¿ "
"à²à²¦à²¨à³à²¨à³ ಸರಿಡಿಸದ ಹà³à²°à²¤à³ à²à³à²¨à³à²à³à²¯à²¾à²¶à³âನಿà²à²¦ ಯಾವà³à²¦à³ SQL ದತà³à²¤à²¸à²à²à²¯à²à²³à²¨à³à²¨à³ ತà³à²°à³à²¯à²²à³ à²
ಥವ à²à²³à²¿à²¸à²²à³ "
-"ಸಾಧà³à²¯à²µà²¿à²°à³à²µà³à²¦à²¿à²²à³à²². ಹà³à²à³à²à²¿à²¨ ಮಾಹಿತಿà²à²¾à²à²¿ https://bugzilla.gnome.org/show_bug.cgi?"
+"ಸಾಧà³à²¯à²µà²¿à²°à³à²µà³à²¦à²¿à²²à³à²². ಹà³à²à³à²à²¿à²¨ ಮಾಹಿತಿà²à²¾à²à²¿ https://bugs.gnucash.org/show_bug.cgi?"
"id=611936 à²
ನà³à²¨à³ ನà³à²¡à²¿."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"\"libdbi\" ಲà³à²¬à³à²°à²°à²¿à²¯à²²à³à²²à²¿ à²à²°à³à²µ à²à²à²¦à³ ದà³à²·à²à³à²à²¾à²à²¿à²¨ à²à²à²à³à²°à²µà²¾à²¦ ಪರà³à²à³à²·à³à²¯à²¨à³à²¨à³ ಪà³à²°à³à²£à²à³à²³à²¿à²¸à²²à³ "
"à²à³à²¨à³à²à³à²¯à²¾à²¶à³âನಿà²à²¦ ಸಾಧà³à²¯à²µà²¾à²à²¿à²²à³à²². à²à²¦à²à³à²à³ ನಿಮà³à²® SQL ದತà³à²¤à²¸à²à²à²¯à²¦à²²à³à²²à²¿à²¨ à²
ನà³à²®à²¤à²¿à²à²³ ತಪà³à²ªà³ ಸà²à²°à²à²¨à³à²¯à³ "
-"à²à²¾à²°à²£à²µà²¾à²à²¿à²°à²¬à²¹à³à²¦à³. ಹà³à²à³à²à²¿à²¨ ಮಾಹಿತಿà²à²¾à²à²¿ ದಯವಿà²à³à²à³ https://bugzilla.gnome.org/"
+"à²à²¾à²°à²£à²µà²¾à²à²¿à²°à²¬à²¹à³à²¦à³. ಹà³à²à³à²à²¿à²¨ ಮಾಹಿತಿà²à²¾à²à²¿ ದಯವಿà²à³à²à³ https://bugs.gnucash.org/"
"show_bug.cgi?id=645216 à²
ನà³à²¨à³ ನà³à²¡à²¿."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15565,9 +15565,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org à²à³ ದà³à²·à²à²³à²¨à³à²¨à³ ಮತà³à²¤à³ à²à²¤à²°à³ ತà³à²à²¦à²°à³à²à²³à²¨à³à²¨à³ ವರದಿ ಮಾಡಿ"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"ನà³à²µà³ http://bugzilla.gnome.org ನಲà³à²²à²¿ ದà³à²· ವರದಿà²à²³à²¨à³à²¨à³ ಹà³à²¡à³à²à²¬à²¹à³à²¦à³ à²
ಥವ ಸಲà³à²²à²¿à²¸à²¬à²¹à³à²¦à³"
+"ನà³à²µà³ http://bugs.gnucash.org ನಲà³à²²à²¿ ದà³à²· ವರದಿà²à²³à²¨à³à²¨à³ ಹà³à²¡à³à²à²¬à²¹à³à²¦à³ à²
ಥವ ಸಲà³à²²à²¿à²¸à²¬à²¹à³à²¦à³"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/ko.po b/po/ko.po
index 870f017..0c1dab4 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -11117,7 +11117,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15114,9 +15114,9 @@ msgstr "ë²ê·¸ ë° ê¸°í 문ì 를 gnucash-devel at gnucash.orgì ë³´ê³ íì¬
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"http://bugzilla.gnome.orgìì ì°¾ì ì ìê³ , íì¼ ë²ê·¸ ë³´ê³ ë í ì ììµëë¤\n"
+"http://bugs.gnucash.orgìì ì°¾ì ì ìê³ , íì¼ ë²ê·¸ ë³´ê³ ë í ì ììµëë¤\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/kok.po b/po/kok.po
index ccb2b9b..4c23373 100644
--- a/po/kok.po
+++ b/po/kok.po
@@ -11321,18 +11321,18 @@ msgstr ""
"तà¥à¤®à¤à¥à¤¯à¤¾ वà¥à¤¯à¤µà¤¸à¥à¤¥à¥à¤° पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापित à¤à¤¶à¤¿à¤²à¥à¤²à¥ \"libdbi\" लायबà¥à¤°à¤°à¥ वà¥à¤¹à¤¡à¤²à¥ à¤à¥à¤°à¤®à¤¾à¤à¤ सारà¤à¥ साठयना. "
"हाà¤à¥ à¤
रà¥à¤¥ GnuCash SQL डà¥à¤à¤¾à¤¬à¥à¤¸ सारà¤à¥ वापरपाठशà¤à¤¨à¤¾. \"libdbi\" à¤à¥ दà¥à¤¸à¤°à¥ à¤à¤µà¥à¤¤à¥à¤¤à¥ "
"पà¥à¤°à¤¤à¤¿à¤·à¥à¤ ापित à¤à¤°à¤¤à¤¾à¤®à¥à¤°à¥à¤¨ Gnucash SQL डà¥à¤à¤¾à¤¬à¥à¤¸à¥ à¤à¤à¤¡à¤à¥ ना वॠतातà¥à¤¨ à¤à¤¤à¤¨à¤¾à¤¯ à¤à¤°à¤à¥ ना. मातà¥à¤¶à¥ "
-"à¤
दिठमाहितà¥à¤à¤¾à¤¤à¥à¤° https://bugzilla.gnome.org/show_bug.cgi?id=611936 पळयात."
+"à¤
दिठमाहितà¥à¤à¤¾à¤¤à¥à¤° https://bugs.gnucash.org/show_bug.cgi?id=611936 पळयात."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash \"libdbi\" लायबà¥à¤°à¤°à¥à¤¤à¤²à¥à¤¯à¤¾ बà¤à¤¾à¤à¥ पà¥à¤°à¤¾à¤¯à¤¤à¤°à¥à¤¨ नाà¤à¥à¤ à¤à¤¾à¤à¤£à¥ à¤à¤°à¤ªà¤¾à¤ शà¤à¤¨à¤¾. हाà¤à¥ "
"à¤à¤¾à¤°à¤£ तà¥à¤®à¤à¥à¤¯à¤¾ SQL डà¥à¤à¤¾à¤¬à¥à¤¸à¥à¤à¥à¤¯à¤¾ परवानà¤à¥à¤¯à¤¾à¤à¤à¥ à¤à¥à¤à¥à¤à¥ सà¤à¤°à¤à¤¨à¤¾à¤¯ à¤à¤¾à¤µ शà¤à¤¤à¤¾. मातà¥à¤¶à¥ à¤
दिठ"
-"माहितà¥à¤à¤¾à¤¤à¥à¤° https://bugzilla.gnome.org/show_bug.cgi?id=645216 पळयात."
+"माहितà¥à¤à¤¾à¤¤à¥à¤° https://bugs.gnucash.org/show_bug.cgi?id=645216 पळयात."
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15296,9 +15296,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org ठबà¤à¥à¤ à¤à¤£à¤¿ हà¥à¤° à¤à¤¡à¤®à¥à¤³à¤¾à¤à¤à¥ à¤
हवाल दियात."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"तà¥à¤®à¥ http://bugzilla.gnome.org à¤à¥à¤° लà¥à¤à¥à¤¤ पळà¥à¤µà¤ªà¤¾à¤ शà¤à¤¤à¤¾ à¤à¤£à¤¿ बà¤à¤¾à¤à¥ à¤
हवाल दिवपाठ"
+"तà¥à¤®à¥ http://bugs.gnucash.org à¤à¥à¤° लà¥à¤à¥à¤¤ पळà¥à¤µà¤ªà¤¾à¤ शà¤à¤¤à¤¾ à¤à¤£à¤¿ बà¤à¤¾à¤à¥ à¤
हवाल दिवपाठ"
"शà¤à¤¤à¤¾"
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/kok at latin.po b/po/kok at latin.po
index 5117b7d..b3cae58 100644
--- a/po/kok at latin.po
+++ b/po/kok at latin.po
@@ -11497,13 +11497,13 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash ek purnn mhotvachi porikxa korunk xoklina tantunt kompivtorachi chuk "
"\"libdbi\"vachnaloient asa dekhun. Hem ghoddiek SQL mhaitechea porvangechea "
"chukiche ghoddnnek lagun zalam asot. Odik mhaite khatir polle: https://"
-"bugzilla.gnome.org/show_bug.cgi?id=645216"
+"bugs.gnucash.org/show_bug.cgi?id=645216"
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15525,7 +15525,7 @@ msgstr ""
"Kompivttoracheo chuki ani her prosn gnucahs-devel at gnucash.org haka kolloi"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Tujean pollonvkui zata ani kompivttorachea chukiche vake http://bugzilla."
"gnome.org hanga fail korum ietat"
diff --git a/po/ks.po b/po/ks.po
index 5a4b6f6..c59d09a 100644
--- a/po/ks.po
+++ b/po/ks.po
@@ -11444,12 +11444,12 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash हयà¥à¤ नॠमà¥à¤à¤®à¤² à¤à¥à¤°à¤¿à¤¥ à¤
ठà¤à¤¼à¤°à¥à¤°à¥ à¤à¥à¤¸à¤à¥ बठà¤à¥ मà¥à¤à¥à¤¦à¤à¥ बापत \"libdbi\" "
"लायबरॠमनà¤à¤¼. यि हà¥à¤à¥ à¤à¥à¤à¤¼à¤¿à¤¥ तà¥à¤¹à¥à¤¨à¤¦à¤¿à¤¸ SQL डाà¤à¤¾à¤¬à¥à¤¸ à¤à¥à¤¸ à¤à¤à¤¿à¤¸ à¤à¤à¤¾à¤à¤¼à¤¤à¤¸ मनà¤à¤¼ मिसà¤à¤¨à¤«à¤¿à¤à¤°à¥à¤¶à¤¨ "
-"सà¥à¤¤.पिलà¥à¤à¤¼ वà¥à¤à¤¿à¤µ https://bugzilla.gnome.org/show_bug.cgi?id=645216 मà¤à¤¼à¥à¤¦ "
+"सà¥à¤¤.पिलà¥à¤à¤¼ वà¥à¤à¤¿à¤µ https://bugs.gnucash.org/show_bug.cgi?id=645216 मà¤à¤¼à¥à¤¦ "
"à¤à¤¨à¤«à¤¾à¤°à¤®à¥à¤¶à¤¨ बापत."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15468,9 +15468,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "रिपà¥à¤ à¤à¥à¤°à¤¿à¤µ बठतॠबाà¤à¥à¤¯ पराबलिम gnucash-devel at gnucash.org à¤à¥à¤¨"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"तà¥à¤¹à¤¯à¥ हà¥à¤à¤¿à¤µ बà¥à¤¯à¤¿ वà¥à¤à¤¿à¤¥ तॠफायिल à¤à¥à¤°à¤¿à¤¥ बठरिपà¥à¤ http://bugzilla.gnome.org पयà¥à¤ "
+"तà¥à¤¹à¤¯à¥ हà¥à¤à¤¿à¤µ बà¥à¤¯à¤¿ वà¥à¤à¤¿à¤¥ तॠफायिल à¤à¥à¤°à¤¿à¤¥ बठरिपà¥à¤ http://bugs.gnucash.org पयà¥à¤ "
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/lt.po b/po/lt.po
index 4f92aca..1658e19 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -11383,19 +11383,19 @@ msgstr ""
"Biblioteka âlibdbiâ įdiegta sistemoje teisingai neiÅ¡saugo didelių skaiÄių. "
"Tai reiškia, kad GnuCash negali naudoti SQL duomenų bazių teisingai. GnuCash "
"neatvers ir nesaugos į SQL duomenų bazes, kol tai nebus pataisyta įdiegiant "
-"kitÄ
âlibdbiâ versijÄ
. Adresu https://bugzilla.gnome.org/show_bug.cgi?"
+"kitÄ
âlibdbiâ versijÄ
. Adresu https://bugs.gnucash.org/show_bug.cgi?"
"id=611936 rasite daugiau informacijos."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash nepavyko baigti kritinio testo dÄl klaidos buvimo âlibdbiâ "
"bibliotekoje. Tai gali bÅ«ti dÄl neteisingos SQL duomenų bazÄs leidimų "
-"konfigūracijos. Adresu https://bugzilla.gnome.org/show_bug.cgi?id=645216 "
+"konfigūracijos. Adresu https://bugs.gnucash.org/show_bug.cgi?id=645216 "
"rasite daugiau informacijos."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15437,9 +15437,9 @@ msgstr ""
"Apie klaidas ir kitas problemas praneškite adresu gnucash-devel at gnucash.org"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Taip pat galite ieškoti ir pranešti apie klaidas http://bugzilla.gnome.org"
+"Taip pat galite ieškoti ir pranešti apie klaidas http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/lv.po b/po/lv.po
index c476984..15aacd3 100644
--- a/po/lv.po
+++ b/po/lv.po
@@ -11402,19 +11402,19 @@ msgstr ""
"JÅ«su datorÄ uzstÄdÄ«tÄ \"libdbi\" bibliotÄka nepareizi saglabÄ lielus "
"skaitļus. TÄpÄc GnuCash nevar pareizi izmantot SQL datu bÄzi. GnuCash "
"neatvÄrs un nesaglabÄs datus SQL bÄzÄ lÄ«dz jÅ«s neuzstÄdÄ«siet citu \"libdbi\" "
-"versiju. Papildu informÄcijai skatiet https://bugzilla.gnome.org/show_bug."
+"versiju. Papildu informÄcijai skatiet https://bugs.gnucash.org/show_bug."
"cgi?id=611936"
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash neizdevÄs izpildÄ«t kritisku testu \"libdbi\" bibliotÄkas kļūdas "
"noteikÅ¡anai. Iemesls varÄtu bÅ«t nepareizi iestatÄ«tas pieejas tiesÄ«bas jÅ«su "
-"SQL datu bÄzÄ. Papildu informÄcijai skatiet https://bugzilla.gnome.org/"
+"SQL datu bÄzÄ. Papildu informÄcijai skatiet https://bugs.gnucash.org/"
"show_bug.cgi?id=645216"
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15424,8 +15424,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Par defektiem vai citÄm kļudÄm ziÅot gnucash-devel at gnucash.org."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "Varat arÄ« apskatÄ«t un reÄ£istrÄt defektus http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "Varat arÄ« apskatÄ«t un reÄ£istrÄt defektus http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/mai.po b/po/mai.po
index 372a267..d8cd0d5 100644
--- a/po/mai.po
+++ b/po/mai.po
@@ -11396,18 +11396,18 @@ msgstr ""
"नहि à¤à¤°à¥à¤¤ à¤
à¤à¤¿. à¤à¤à¤° मतलब à¤
à¤à¤¿ à¤à¥ GnuCash सहॠतरà¥à¤à¤¾ सठSQL डà¥à¤à¤¾à¤¬à¥à¤¸ à¤à¥à¤° à¤à¤ªà¤¯à¥à¤ नहि à¤à¤ "
"सà¤à¤¤à¤¾ à¤
à¤à¤¿. Gnucash SQL डà¥à¤à¤¾à¤¬à¥à¤¸ मॠà¤à¥à¤²à¤¬ à¤
थवा सहà¥à¤à¤ à¤à¥à¤° à¤à¤¾à¤® नहि à¤à¤°à¤¤à¤¾à¤¹ à¤à¤à¤¨ तठà¤à¥ "
"\"libdbi\" ठà¤à¤à¤à¤¾ à¤
लठसà¤à¤¸à¥à¤à¤°à¤£ à¤à¤à¤¸à¥à¤à¥à¤² à¤à¤à¤ à¤à¤¹à¤¿ समसà¥à¤¯à¤¾ à¤à¥à¤ दà¥à¤° नहि à¤à¤à¤² à¤à¤¾à¤à¤¤ à¤
à¤à¤¿. बà¥à¤¸à¥ "
-"à¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¤²à¥à¤² à¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥ https://bugzilla.gnome.org/show_bug.cgi?id=611936."
+"à¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¤²à¥à¤² à¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥ https://bugs.gnucash.org/show_bug.cgi?id=611936."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash \"libdbi\" लाà¤à¤¬à¥à¤°à¥à¤°à¥ मॠबठà¤à¥à¤° मà¥à¤à¥à¤¦à¤à¥ à¤à¤²à¥à¤² à¤à¤à¤à¤¾ महतà¥à¤µà¤ªà¥à¤°à¥à¤£ परà¥à¤à¥à¤·à¤£ पà¥à¤°à¤¾ नहि à¤à¤ "
"सà¤à¤¤à¤¾ à¤
à¤à¤¿. à¤à¤¹à¤¨ à¤
हाà¤à¤ SQL डà¥à¤à¤¾à¤¬à¥à¤¸ मॠà¤
नà¥à¤®à¤¤à¤¿ à¤à¥à¤° à¤à¤²à¤¤ à¤à¥à¤¨à¥à¥à¤¿à¤à¤°à¥à¤¶à¤¨ à¤à¥à¤° à¤à¤¾à¤°à¤£ ठसà¤à¥à¤¤ à¤
à¤à¤¿. बà¥à¤¸à¥ "
-"à¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¤²à¥à¤² à¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥ https://bugzilla.gnome.org/show_bug.cgi?id=645216. "
+"à¤à¤¾à¤¨à¤à¤¾à¤°à¥ à¤à¤²à¥à¤² à¤à¥à¤ªà¤¯à¤¾ दà¥à¤à¥ https://bugs.gnucash.org/show_bug.cgi?id=645216. "
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15410,8 +15410,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org à¤à¤²à¥à¤² बठतथा à¤à¤¨ समसà¥à¤¯à¤¾ à¤à¥à¤° सà¥à¤à¤¨à¤¾ दिà¤
."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "http://bugzilla.gnome.org सà¥à¤¹à¥ पर बठरिपà¥à¤°à¥à¤ दà¥à¤à¤¿ à¤à¤à¤° दरà¥à¤ à¤à¤ सà¤à¥à¤¤ à¤à¥"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "http://bugs.gnucash.org सà¥à¤¹à¥ पर बठरिपà¥à¤°à¥à¤ दà¥à¤à¤¿ à¤à¤à¤° दरà¥à¤ à¤à¤ सà¤à¥à¤¤ à¤à¥"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/mni.po b/po/mni.po
index 360e62d..ed05259 100644
--- a/po/mni.po
+++ b/po/mni.po
@@ -11362,19 +11362,19 @@ msgstr ""
"ê¯ê¯ê¯£ê¯ê¯ê¯¤ ê¯ê¯¤ê¯ê¯ê¯¦ê¯ê¯ ê¯ê¯ê¯ê¯ê¯£ê¯ ê¯ê¯§ê¯ ê¯ê¯¥ê¯ê¯ê¯ê¯ê¯¦ê¯ê¯¤ \"libdbi\" ê¯ê¯ê¯¤ ê¯ê¯ê¯§ê¯ ê¯
ê¯ê¯ê¯ ê¯ê¯ê¯¥ ê¯ê¯¨ê¯ê¯
ê¯ê¯ê¯ê¯£ê¯ "
"ê¯ê¯§ê¯ê¯ê¯ê¯¦ê¯« ê¯ê¯ê¯¤ê¯
ê¯ê¯¥ê¯ê¯ê¯¤ê¯ê¯ê¯¤ GnuCash ê¯
SQL ê¯ê¯¥ê¯ê¯¥ê¯ê¯¦ê¯ê¯ê¯¤ê¯¡ ê¯ê¯¨ê¯ê¯
ê¯ê¯¤ê¯ê¯¤ê¯ê¯
ê¯ ê¯ê¯ê¯ê¯£ê¯ê¯« \"libdbi\" ê¯ê¯¤ "
"ê¯ê¯£ê¯ê¯¥ê¯ê¯ ê¯ê¯ê¯ê¯ ê¯ê¯ ê¯ê¯ê¯ê¯ê¯£ê¯ ê¯ê¯§ê¯ê¯¨ê¯
ê¯ê¯ê¯ê¯ê¯ê¯ê¯¤ê¯ ê¯ê¯¥ê¯ê¯ Gnucash ê¯ê¯ê¯¤ SQL ê¯ê¯¥ê¯ê¯¥ê¯ê¯¦ê¯ê¯ ê¯ê¯¥ê¯¡ê¯ê¯£ê¯ê¯ê¯£ê¯ ê¯
ê¯ê¯ê¯ê¯ "
-"ê¯ê¯¦ê¯ ê¯ê¯§ê¯ê¯« ê¯ê¯ê¯¨ê¯ê¯ ê¯ê¯ê¯£ê¯ê¯ê¯¤ê¯ê¯ê¯ https://bugzilla.gnome.org/show_bug.cgi?id=611936 ê¯ "
+"ê¯ê¯¦ê¯ ê¯ê¯§ê¯ê¯« ê¯ê¯ê¯¨ê¯ê¯ ê¯ê¯ê¯£ê¯ê¯ê¯¤ê¯ê¯ê¯ https://bugs.gnucash.org/show_bug.cgi?id=611936 ê¯ "
"ê¯ê¯¦ê¯¡ê¯ê¯¤ê¯ê¯¨ê¯«"
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash ê¯
\"libdbi\" ê¯ê¯¥ê¯ê¯ê¯ê¯ê¯¦ê¯ê¯¤ê¯ ê¯ê¯ ê¯ê¯ ê¯ê¯¥ê¯ê¯ê¯ê¯ê¯¥ ê¯ê¯¦ê¯¡ê¯ê¯ê¯¤ ê¯ê¯ê¯¨ê¯ ê¯ê¯¥ê¯¡ê¯ê¯¦ê¯¡ ê¯ê¯ ê¯ê¯£ê¯ê¯ ê¯ê¯ê¯ê¯£ê¯. ê¯ê¯ê¯¤ "
"ê¯ê¯ê¯£ê¯ê¯ê¯¤ SQL ê¯ê¯¥ê¯ê¯¥ê¯ê¯¦ê¯ê¯ê¯¤ ê¯ê¯¤ê¯ê¯ê¯ê¯ê¯¤ê¯ê¯ê¯ê¯¨ê¯ê¯¦ê¯ê¯ ê¯ê¯¥ê¯ê¯ê¯¤ê¯ê¯ ê¯ê¯ê¯
ê¯ê¯£ê¯ê¯ê¯ê¯ ê¯ê¯£ê¯ê¯ ê¯ê¯¥ê¯ê¯« ê¯ê¯ê¯¨ê¯ê¯ ê¯ê¯ê¯£ê¯ê¯ê¯¤ê¯ê¯ê¯ "
-"https://bugzilla.gnome.org/show_bug.cgi?id=645216 ê¯ ê¯ê¯¦ê¯¡ê¯ê¯¤ê¯ê¯¨ê¯«"
+"https://bugs.gnucash.org/show_bug.cgi?id=645216 ê¯ ê¯ê¯¦ê¯¡ê¯ê¯¤ê¯ê¯¨ê¯«"
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15363,8 +15363,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "ê¯ê¯ê¯ê¯¤ê¯¡ ê¯ê¯ê¯ê¯¨ê¯¡ ê¯ê¯ê¯£ê¯ê¯ ê¯ê¯¨ê¯ê¯£ê¯¡ê¯ê¯¥ê¯ê¯ê¯ê¯¤ê¯¡ gnucash-devel at gnucash.org ê¯ ê¯ê¯¤ê¯ê¯£ê¯ê¯ ê¯ê¯§ê¯ê¯£"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "ê¯ê¯ê¯£ê¯ê¯ê¯¨ http://bugzilla.gnome.org ê¯ ê¯ê¯ ê¯ê¯¤ê¯ê¯£ê¯ê¯ ê¯ê¯¤ê¯¡ ê¯ê¯¤ê¯ ê¯ê¯ê¯ê¯¨ê¯¡ ê¯ê¯¥ê¯ê¯ ê¯ê¯§ê¯ ê¯ê¯¥ê¯"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "ê¯ê¯ê¯£ê¯ê¯ê¯¨ http://bugs.gnucash.org ê¯ ê¯ê¯ ê¯ê¯¤ê¯ê¯£ê¯ê¯ ê¯ê¯¤ê¯¡ ê¯ê¯¤ê¯ ê¯ê¯ê¯ê¯¨ê¯¡ ê¯ê¯¥ê¯ê¯ ê¯ê¯§ê¯ ê¯ê¯¥ê¯"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/mni at bengali.po b/po/mni at bengali.po
index 001dcd1..35f784a 100644
--- a/po/mni at bengali.po
+++ b/po/mni at bengali.po
@@ -11499,13 +11499,13 @@ msgstr ""
"থমà¦à¦¿à¦¨à§à¦¦à§à¥¤ মসিà¦à§ à¦
রà§à¦¥à¦¦à¦¿ GnuCashনা SQL দà§à¦¤à¦¾à¦¬à§à¦à¦¸à¦¿à¦ à¦à§à¦®à§à¦¨à¦¾ সিà¦à¦¿à¦¨à§à¦¨à¦¬à¦¾ à¦à¦®à¦¦à§à¥¤ মসি "
"\"libdbi\"à¦à§ তà§à¦à¦¾à¦¨à¦¬à¦¾ à¦à¦°à§à¦¸à¦¨ à¦
মা à¦à¦¨à§à¦¸à¦¤à§à¦² তà§à¦¦à§à¦¨à¦¾ à§à¦¾à¦¹à¦¨à§à¦¦à§à¦°à¦¿à¦¬à¦®à¦à§à¦¦à¦¿ SQL দà§à¦¤à¦¾à¦¬à§à¦à¦¸à¦¿à¦à¦¦à¦¾ "
"GnuCash হাà¦à¦²à§à¦ নতà§à¦¤à§à¦°à¦à¦¾ সà§à¦ তà§à¦°à§à¦à¥¤ à¦à¦¾à¦¨à¦¬à§à¦¦à§à¦¨à¦¾ à¦
হà§à¦¨à¦¬à¦¾ à¦à¦¨à¦«à§à¦°à§à¦®à§à¦¸à¦¨à¦à§à¦¦à¦®à¦ https://"
-"bugzilla.gnome.org/show_bug.cgi?id=611936 à§à§à¦à¦¬à§à§à§à¥¤"
+"bugs.gnucash.org/show_bug.cgi?id=611936 à§à§à¦à¦¬à§à§à§à¥¤"
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCashনা \"libdbi\" লাà¦à¦¬à§à¦°à§à¦°à¦¿à¦¦à¦¾ বঠà¦
মা লà§à¦¬à¦à§ à§à¦¾à¦®à§à¦¨à¦¾ মরà§à¦à¦à¦¬à¦¾ à¦à¦¾à¦à§à§à¦ à¦
মা "
@@ -15543,9 +15543,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "বà¦à¦¸à¦¿à¦ à¦
মসà§à¦ à¦
তà§à¦ªà§à¦ªà¦¾ পà§à¦°à§à¦¬à§à¦²à§à¦®à¦¸à¦¿à¦ gnucash-devel at gnucash.orgদা রিপà§à¦°à§à¦¤ তৠ"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"নহাà¦à§à¦¨à¦¾ http://bugzilla.gnome.orgদা বঠরিপà§à¦°à§à¦¤à¦¸à¦¿à¦ থà§à¦¬à¦¾ à¦
মসà§à¦ ফাà¦à¦² সà§à¦®à§à¦¬à¦¸à§ à§à¦¾à¦"
+"নহাà¦à§à¦¨à¦¾ http://bugs.gnucash.orgদা বঠরিপà§à¦°à§à¦¤à¦¸à¦¿à¦ থà§à¦¬à¦¾ à¦
মসà§à¦ ফাà¦à¦² সà§à¦®à§à¦¬à¦¸à§ à§à¦¾à¦"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/mr.po b/po/mr.po
index a7bc3d6..cd76c86 100644
--- a/po/mr.po
+++ b/po/mr.po
@@ -11376,18 +11376,18 @@ msgstr ""
"नाहà¥. याà¤à¤¾ à¤
रà¥à¤¥ à¤
सा à¤à¥ GnuCash ला SQL माहितॠसà¤à¤à¥à¤°à¤¹à¤¾à¤à¤¾ à¤
à¤à¥à¤à¤ªà¤£à¥ वापर à¤à¤°à¤¤à¤¾ यà¥à¤¤ नाहà¥. "
"हॠधारिà¤à¤¾ \"लिबडà¥à¤¬à¥à¤à¤¯à¤à¥\" वà¥à¤à¤³à¥ à¤à¤µà¥à¤¤à¥à¤¤à¥ सà¥à¤¥à¤¾à¤ªà¤¿à¤¤ à¤à¤°à¥à¤¨ निशà¥à¤à¤¿à¤¤ à¤à¤°à¥à¤ªà¤°à¥à¤¯à¤à¤¤ Gnucash ला SQL "
"माहितॠसाठा à¤à¤à¤¡à¤¤à¤¾ यà¥à¤£à¤¾à¤° नाहॠà¤à¤¿à¤à¤µà¤¾ तà¥à¤¯à¤¾à¤®à¤§à¥à¤¯à¥ सà¤à¤à¥à¤°à¤¹à¤¿à¤¤ à¤à¤°à¤¤à¤¾ यà¥à¤£à¤¾à¤° नाहà¥. à¤à¥à¤ªà¤¯à¤¾ à¤
धिठ"
-"माहितà¥à¤¸à¤¾à¤ ॠhttps://bugzilla.gnome.org/show_bug.cgi?id=611936 पाहा."
+"माहितà¥à¤¸à¤¾à¤ ॠhttps://bugs.gnucash.org/show_bug.cgi?id=611936 पाहा."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash à¤à¤ महतà¥à¤µà¤¾à¤à¥ à¤à¤¾à¤à¤£à¥ पà¥à¤°à¥à¤£ à¤à¤°à¥ शà¤à¤¤ नाहॠà¤à¤¾à¤°à¤£ \"लिबडà¥à¤¬à¥à¤à¤¯\" वाà¤à¤¨à¤¾à¤²à¤¯à¤¾à¤®à¤§à¥à¤¯à¥ दà¥à¤· "
"à¤
सà¥à¤¤à¤¿à¤¤à¥à¤µà¤¾à¤¤ à¤à¤¹à¥. तà¥à¤®à¤à¥à¤¯à¤¾ à¤à¤¸à¤à¥à¤¯à¥à¤à¤² माहितॠसाठà¥à¤¯à¤¾à¤à¥à¤¯à¤¾ परवानà¤à¥à¤à¤à¥à¤¯à¤¾ à¤à¥à¤à¥à¤à¥à¤¯à¤¾ माà¤à¤¡à¤£à¥à¤®à¥à¤³à¥ हॠहà¥à¤ "
-"शà¤à¤¤à¥. à¤à¥à¤ªà¤¯à¤¾ à¤
धिठमाहितà¥à¤¸à¤¾à¤ ॠhttps://bugzilla.gnome.org/show_bug.cgi?id=645216 "
+"शà¤à¤¤à¥. à¤à¥à¤ªà¤¯à¤¾ à¤
धिठमाहितà¥à¤¸à¤¾à¤ ॠhttps://bugs.gnucash.org/show_bug.cgi?id=645216 "
"पाहा."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15383,8 +15383,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "à¤à¤¾à¤¹à¥ दà¥à¤· व à¤à¤¤à¤° समसà¥à¤¯à¤¾ à¤
सलà¥à¤¯à¤¾à¤¸ gnucash-devel at gnucash.org ला à¤à¤³à¤µà¤¾"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "तà¥à¤®à¥à¤¹à¥ http://bugzilla.gnome.org यà¥à¤¥à¥ दà¥à¤·à¤¾à¤¸à¤à¤¬à¤à¤§à¤¿à¤à¥ à¤
हवाल पाहॠशà¤à¤¤à¤¾ व नà¥à¤à¤¦à¤µà¥ शà¤à¤¤à¤¾"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "तà¥à¤®à¥à¤¹à¥ http://bugs.gnucash.org यà¥à¤¥à¥ दà¥à¤·à¤¾à¤¸à¤à¤¬à¤à¤§à¤¿à¤à¥ à¤
हवाल पाहॠशà¤à¤¤à¤¾ व नà¥à¤à¤¦à¤µà¥ शà¤à¤¤à¤¾"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/nb.po b/po/nb.po
index 821e5d5..65c0719 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -11558,7 +11558,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15693,7 +15693,7 @@ msgstr "Rapporter feil og andre problemer til gnucash-devel at gnucash.org.\n"
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Du kan også søke etter og legge inn feilrapporter på http://bugzilla.gnome."
"org\n"
diff --git a/po/ne.po b/po/ne.po
index 40205fd..1040a85 100644
--- a/po/ne.po
+++ b/po/ne.po
@@ -11521,7 +11521,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15621,9 +15621,9 @@ msgstr "gnucash-devel at gnucash.org मा बà¤à¤¹à¤°à¥ र à¤
रॠसमस
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"तपाà¤à¤à¤²à¥ http://bugzilla.gnome.org मा बठपà¥à¤°à¤¤à¤¿à¤µà¥à¤¦à¤¨à¤¹à¤°à¥ फाà¤à¤² à¤à¤°à¥à¤¨ र पतà¥à¤¤à¤¾ लà¤à¤¾à¤à¤¨ पनि "
+"तपाà¤à¤à¤²à¥ http://bugs.gnucash.org मा बठपà¥à¤°à¤¤à¤¿à¤µà¥à¤¦à¤¨à¤¹à¤°à¥ फाà¤à¤² à¤à¤°à¥à¤¨ र पतà¥à¤¤à¤¾ लà¤à¤¾à¤à¤¨ पनि "
"सà¤à¥à¤¨à¥à¤¹à¥à¤¨à¥à¤\n"
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/nl.po b/po/nl.po
index 92aeacb..76d4872 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -11,7 +11,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gnucash-2.7.8\n"
-"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash&component=Translations\n"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2018-03-25 12:40-0700\n"
"PO-Revision-Date: 2018-05-10 14:11+0200\n"
"Last-Translator: Mark Haanen <i18n at haanen.net>\n"
@@ -6730,12 +6730,12 @@ msgid "The SQL database is in use by other users, and the upgrade cannot be perf
msgstr "De SQL databank wordt gebruikt door andere gebruikers; de upgrade kan niet worden uitgevoerd tot deze zijn afgemeld. Als er op dit moment geen andere gebruikers zijn, raadpleeg dan de documentatie om uit te zoeken hoe u problemen met onafgesloten sessies kunt verhelpen."
#: gnucash/gnome-utils/gnc-file.c:462
-msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more information."
-msgstr "De op uw systeem geïnstalleerde bibliotheek âlibdbiâ slaat grote getallen niet juist op. Dit betekent dat GnuCash geen juist gebruik kan maken van SQL-databanken. Gnucash zal geen SQL-databank openen of opslaan tot dit is opgelost door de installatie van een andere versie van âlibdbiâ. Zie https://bugzilla.gnome.org/show_bug.cgi?id=611936 voor meer informatie."
+msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugs.gnucash.org/show_bug.cgi?id=611936 for more information."
+msgstr "De op uw systeem geïnstalleerde bibliotheek âlibdbiâ slaat grote getallen niet juist op. Dit betekent dat GnuCash geen juist gebruik kan maken van SQL-databanken. Gnucash zal geen SQL-databank openen of opslaan tot dit is opgelost door de installatie van een andere versie van âlibdbiâ. Zie https://bugs.gnucash.org/show_bug.cgi?id=611936 voor meer informatie."
#: gnucash/gnome-utils/gnc-file.c:474
-msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?id=645216 for more information."
-msgstr "GnuCash was niet in staat om vast te stellen of er een significante fout in de bibliotheek âlibdbiâ aanwezig was. Dit kan worden veroorzaakt door een verkeerde configuratie van rechten binnen uw SQL-database. Zie https://bugzilla.gnome.org/show_bug.cgi?id=645216 voor meer informatie."
+msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?id=645216 for more information."
+msgstr "GnuCash was niet in staat om vast te stellen of er een significante fout in de bibliotheek âlibdbiâ aanwezig was. Dit kan worden veroorzaakt door een verkeerde configuratie van rechten binnen uw SQL-database. Zie https://bugs.gnucash.org/show_bug.cgi?id=645216 voor meer informatie."
#: gnucash/gnome-utils/gnc-file.c:484
msgid "This file is from an older version of GnuCash and will be upgraded when saved by this version. You will not be able to read the saved file from the older version of Gnucash (it will report an \"error parsing the file\"). If you wish to preserve the old version, exit without saving."
@@ -8392,8 +8392,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Fouten en andere problemen kunt u aan gnucash-devel at gnucash.org rapporteren."
#: gnucash/gnucash-bin.c:161
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "U kunt geconstateerde fouten ook op http://bugzilla.gnome.org melden."
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "U kunt geconstateerde fouten ook op http://bugs.gnucash.org melden."
#: gnucash/gnucash-bin.c:162
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/pl.po b/po/pl.po
index b03fca1..78d6bbb 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -11635,7 +11635,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15745,7 +15745,7 @@ msgstr ""
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Można także przeglÄ
daÄ i zgÅaszaÄ bÅÄdy na stronie http://bugzilla.gnome."
"org\n"
diff --git a/po/pt.po b/po/pt.po
index 25eea2b..f1f311a 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -11525,7 +11525,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"O GnuCash não pôde completar um teste crÃtico sobre a presença de um erro na "
@@ -15561,8 +15561,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Reportar erros e outros problemas a gnucash-devel at gnucash.org."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "Pode também procurar e reportar erros em http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "Pode também procurar e reportar erros em http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 53a22d7..83a9f22 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -11611,14 +11611,14 @@ msgstr ""
"números grandes. Isso significa que o GnuCash não pode usar bases de dados "
"SQL de maneira correta. Gnucash não irá abrir ou salvar em bases SQL até que "
"isso seja corrigido pela instalação de uma versão diferente da \"libdbi\". "
-"Por favor, veja o link https://bugzilla.gnome.org/show_bug.cgi?id=611936 "
+"Por favor, veja o link https://bugs.gnucash.org/show_bug.cgi?id=611936 "
"para mais informações."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash não pode completar um teste crÃtico para detectar a existência de um "
@@ -15706,7 +15706,7 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Relate erros (bugs) e outros problemas para gnucash-devel at gnucash.org."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Você também pode obter informações e relatar erros (bugs) em http://bugzilla."
"gnome.org"
diff --git a/po/ro.po b/po/ro.po
index 2499790..9664b91 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -11657,7 +11657,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15797,8 +15797,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "RaportaÈi buguri Èi alte probleme la gnucash-devel at gnucash.org"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "PuteÈi de asemenea sÄ raportaÈi buguri la http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "PuteÈi de asemenea sÄ raportaÈi buguri la http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/ru.po b/po/ru.po
index ae2160f..9e3f7c2 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -14,7 +14,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 2.7.3\n"
-"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
"product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2018-03-26 21:02+0200\n"
"PO-Revision-Date: 2018-03-26 21:20+0200\n"
@@ -7238,13 +7238,13 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash не Ð¼Ð¾Ð¶ÐµÑ Ð·Ð°Ð²ÐµÑÑиÑÑ Ð²Ð°Ð¶Ð½Ñй ÑеÑÑ Ð´Ð»Ñ Ð¿ÑовеÑки налиÑÐ¸Ñ Ð¾Ñибки в "
"библиоÑеке \"libdbi\". ÐÑо Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ ÑвÑзано Ñ Ð½ÐµÐ¿ÑавилÑно наÑÑÑоеннÑми "
"пÑавами доÑÑÑпа в ваÑей SQL ÐÐ. Ðолее подÑобнÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ ÑмоÑÑиÑе на "
-"ÑÑÑаниÑе https://bugzilla.gnome.org/show_bug.cgi?id=645216."
+"ÑÑÑаниÑе https://bugs.gnucash.org/show_bug.cgi?id=645216."
#: gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -9006,10 +9006,10 @@ msgstr ""
"СообÑайÑе об оÑибкаÑ
и дÑÑгиÑ
пÑоблемаÑ
по адÑеÑÑ: gnucash-devel at gnucash.org"
#: gnucash/gnucash-bin.c:161
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"Также Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе иÑкаÑÑ Ð¸ ÑоздаваÑÑ ÑообÑÐµÐ½Ð¸Ñ Ð¾Ð± оÑибкаÑ
по адÑеÑÑ: http://"
-"bugzilla.gnome.org"
+"bugs.gnucash.org"
#: gnucash/gnucash-bin.c:162
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/rw.po b/po/rw.po
index 66cdbfd..d35f954 100644
--- a/po/rw.po
+++ b/po/rw.po
@@ -12269,7 +12269,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -16606,7 +16606,7 @@ msgstr "org."
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr "GUSHAKISHA Na IDOSIYE Raporo ku HTTP"
#: ../gnucash/gnucash-bin.c:163
diff --git a/po/sk.po b/po/sk.po
index cf05fac..c1e0e08 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gnucash-2.7.8\n"
-"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=GnuCash&component=Translations\n"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2018-03-25 12:40-0700\n"
"PO-Revision-Date: 2018-04-02 13:29+0100\n"
"Last-Translator: Zdenko Podobný <zdenop at gmail.com>\n"
@@ -6995,11 +6995,11 @@ msgid "The SQL database is in use by other users, and the upgrade cannot be perf
msgstr ""
#: gnucash/gnome-utils/gnc-file.c:462
-msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more information."
+msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugs.gnucash.org/show_bug.cgi?id=611936 for more information."
msgstr ""
#: gnucash/gnome-utils/gnc-file.c:474
-msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?id=645216 for more information."
+msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?id=645216 for more information."
msgstr ""
#: gnucash/gnome-utils/gnc-file.c:484
@@ -8739,9 +8739,9 @@ msgstr "Oznámente chyby a ostatné problémy na gnucash-devel at gnucash.org.\n"
#: gnucash/gnucash-bin.c:161
#, fuzzy
-#| msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org\n"
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "Tiež si môžete pozrieť oznámenia o chybách na http://bugzilla.gnome.org\n"
+#| msgid "You can also lookup and file bug reports at http://bugs.gnucash.org\n"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "Tiež si môžete pozrieť oznámenia o chybách na http://bugs.gnucash.org\n"
#: gnucash/gnucash-bin.c:162
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/sr.po b/po/sr.po
index 2921796..97d1ec3 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -11484,19 +11484,19 @@ msgstr ""
"велике бÑоÑеве. То знаÑи да ÐнÑов новÑÐ¸Ñ Ð½Ðµ може пÑавилно да коÑиÑÑиÑи СÐÑÐ "
"Ð±Ð°Ð·Ñ Ð¿Ð¾Ð´Ð°Ñака. ÐнÑов новÑÐ¸Ñ Ð½ÐµÑе оÑваÑаÑи или ÑÑваÑи Ñ Ð¡ÐÑРбазама подаÑака "
"Ñве док Ñе ово не попÑави ÑгÑадÑом дÑÑгаÑиÑег издаÑа библиоÑеке âlibdbiâ. "
-"ÐогледаÑÑе âhttps://bugzilla.gnome.org/show_bug.cgi?id=611936â за виÑе "
+"ÐогледаÑÑе âhttps://bugs.gnucash.org/show_bug.cgi?id=611936â за виÑе "
"инÑоÑмаÑиÑа."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"ÐнÑов новÑÐ¸Ñ Ð½Ð¸Ñе могао да довÑÑи кÑиÑиÑни ÑеÑÑ Ð·Ð° пÑиÑÑÑÑвом гÑеÑке Ñ "
"библиоÑеÑи âlibdbiâ. Ðво може биÑи ÑзÑоковано неиÑпÑавним овлаÑÑеÑима ваÑе "
-"СÐÑРбазе подаÑака. ÐогледаÑÑе âhttps://bugzilla.gnome.org/show_bug.cgi?"
+"СÐÑРбазе подаÑака. ÐогледаÑÑе âhttps://bugs.gnucash.org/show_bug.cgi?"
"id=645216â за виÑе инÑоÑмаÑиÑа."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15518,7 +15518,7 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "ÐÑиÑавиÑе гÑеÑке и дÑÑге пÑоблеме на âgnucash-devel at gnucash.orgâ"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
"ТакоÑе можеÑе поÑÑажиÑи и попÑниÑи извеÑÑаÑе о гÑеÑкама на âhttp://bugzilla."
"gnome.orgâ"
diff --git a/po/sv.po b/po/sv.po
index 69800ee..94813a6 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -10998,7 +10998,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -14900,9 +14900,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Rapportera fel och andra problem till gnucash-devel at gnucash.org"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Du kan också skapa och söka efter felrapporter på http://bugzilla.gnome.org"
+"Du kan också skapa och söka efter felrapporter på http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/ta.po b/po/ta.po
index df3b99b..f62423e 100644
--- a/po/ta.po
+++ b/po/ta.po
@@ -11485,18 +11485,18 @@ msgstr ""
"à®à¯à®®à®¿à®à¯à®à®µà®¿à®²à¯à®²à¯. à®
பà¯à®ªà®à®¿à®¯à¯à®©à®¿à®²à¯ GnuCash à®à®©à®¤à¯ SQL தரவà¯à®¤à¯à®¤à®³à®à¯à®à®³à¯ à®à®°à®¿à®¯à®¾à® பயனà¯à®ªà®à¯à®¤à¯à®¤à®µà®¿à®²à¯à®²à¯ "
"à®à®©à¯à®±à¯ பà¯à®°à¯à®³à®¾à®à¯à®®à¯. Gnucash திறà®à¯à®à®¾à®¤à¯ à®
லà¯à®²à®¤à¯ SQL தரவà¯à®¤à¯à®¤à®³à®à¯à®à®³à¯ à®à®°à¯ வà¯à®±à¯à®ªà®à¯à® பதிபà¯à®ªà¯ "
"\"libdbi\" நிறà¯à®µà¯à®¤à®²à¯ பà¯à®°à¯à®¤à¯à®¤à¯à®®à¯ வர௠à®à¯à®®à®¿à®à¯à®à®¿à®±à®¤à¯. à®®à¯à®²à¯à®®à¯ தà®à®µà®²à¯à®à¯à®à¯ https://"
-"bugzilla.gnome.org/show_bug.cgi?id=611936 -஠பாரà¯à®à¯à®à®µà¯à®®à¯."
+"bugs.gnucash.org/show_bug.cgi?id=611936 -஠பாரà¯à®à¯à®à®µà¯à®®à¯."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"GnuCash-à®à®²à¯ \"libdbi\" நà¯à®²à®à®¤à¯à®¤à®¿à®²à¯ à®à®°à¯ பிழ௠à®à®°à¯à®à¯à®à®¿à®±à®¤à®¾ à®à®©à¯à®± à®à®°à¯ à®®à¯à®à¯à®à®¿à®¯à®®à®¾à®© "
"à®à¯à®¾à®¤à®©à¯à®¯à¯ à®®à¯à®à®¿à®à¯à® à®®à¯à®à®¿à®¯à®µà®¿à®²à¯à®²à¯. à®à®¨à¯à®¤ à®à®à¯à®à®³à¯ SQL தரவà¯à®¤à¯à®¤à®³ à®
னà¯à®®à®¤à®¿à®à®³à®¿à®©à¯ தவறான à®à®à¯à®à®®à¯à®ªà¯à®ªà¯ "
-"à®à®¾à®°à®£à®®à®¾à® à®à®°à¯à®à¯à®à®²à®¾à®®à¯. à®®à¯à®²à¯à®®à¯ தà®à®µà®²à¯à®à¯à®à¯ https://bugzilla.gnome.org/show_bug.cgi?"
+"à®à®¾à®°à®£à®®à®¾à® à®à®°à¯à®à¯à®à®²à®¾à®®à¯. à®®à¯à®²à¯à®®à¯ தà®à®µà®²à¯à®à¯à®à¯ https://bugs.gnucash.org/show_bug.cgi?"
"id=645216-஠பாரà¯à®à¯à®à®µà¯à®®à¯."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15514,8 +15514,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org-à®à®²à¯ பிழà¯à®à®³à¯ மறà¯à®±à¯à®®à¯ பிற பிரà®à¯à®à®¿à®©à¯à®à®³à¯ à®
றிà®à¯à®à¯à®¯à®¿à®à®µà¯à®®à¯"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "நà¯à®à¯à®à®³à¯ http://bugzilla.gnome.org à®à®²à¯à®®à¯ பாரà¯à®¤à¯à®¤à¯ à®à¯à®ªà¯à®ªà®¿à®©à¯ பிழà¯à®à®³à¯ à®
றிà®à¯à®à¯à®¯à®¿à®à®²à®¾à®®à¯"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "நà¯à®à¯à®à®³à¯ http://bugs.gnucash.org à®à®²à¯à®®à¯ பாரà¯à®¤à¯à®¤à¯ à®à¯à®ªà¯à®ªà®¿à®©à¯ பிழà¯à®à®³à¯ à®
றிà®à¯à®à¯à®¯à®¿à®à®²à®¾à®®à¯"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/te.po b/po/te.po
index c9c2860..6ed774d 100644
--- a/po/te.po
+++ b/po/te.po
@@ -11297,18 +11297,18 @@ msgstr ""
"మౠసిసà±à°à°à°²à± à°ªà±à°°à°¤à°¿à°·à±à° ాపిà°à°à°¬à°¡à°¿à°¨ à°²à±à°¬à±à°°à°°à± \"libdbi\" à°ªà±à°¦à±à°¦ à°¸à°à°à±à°¯à°²à°¨à± సరిà°à±à°à°¾ నిలà±à°µ à°à±à°¯à°¦à±. à°
à°à°à± Gnuà°à±à°¯à°¾à°·à± "
"SQL à°¡à±à°à°¾à°¬à±à°¸à±âలనౠసరిà°à±à°à°¾ à°à°ªà°¯à±à°à°¿à°à°à°¦à±. à°à° à°à°¿à°¨à±à°¨à°®à±à°¨ \"libdbi\" à°µà±à°°à±à°·à°¨à±âనౠపà±à°°à°¤à°¿à°·à±à° ాపిà°à°à°¡à° à°¦à±à°µà°¾à°°à°¾ à°¦à±à°¨à°¿à°¨à°¿ సరి "
"à°à±à°¸à± వరà°à± Gnuà°à±à°¯à°¾à°·à± à°¤à±à°°à°µà°¡à° à°à°¾à°¨à± SQL à°¡à±à°à°¾à°¬à±à°¸à±âà°²à°à± à°¸à±à°µà± à°à±à°¯à°¡à° à°à°¾à°¨à± à°à°°à°à°¦à±. మరిà°à°¤ సమాà°à°¾à°°à° à°à±à°¸à° దయà°à±à°¸à°¿ "
-"https://bugzilla.gnome.org/show_bug.cgi?id=611936 నౠà°à±à°¡à°à°²à°°à±. "
+"https://bugs.gnucash.org/show_bug.cgi?id=611936 నౠà°à±à°¡à°à°²à°°à±. "
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"\"libdbi\" à°²à±à°¬à±à°°à°°à±à°²à± à°¦à±à°·à° à°à°¨à°¿à°à°¿ à°à±à°¸à° à°à±à°²à° పరà±à°à±à°·à°¨à± Gnuà°à±à°¯à°¾à°·à± à°ªà±à°°à±à°¤à°¿ à°à±à°¯à°²à±à°à°ªà±à°µà°à±à°à±. మౠSQL à°¡à±à°à°¾à°¬à±à°¸à± "
"à°¯à±à°à±à° à°
à°¨à±à°®à°¤à±à°² తపà±à°ªà±à°¡à± à°à°à±à°¤à±à°à°°à°£ à°¦à±à°µà°¾à°°à°¾ à°à°¦à°¿ à°¸à°à°à°µà°¿à°à°à°µà°à±à°à±. మరిà°à°¤ సమాà°à°¾à°°à° à°à±à°¸à° దయà°à±à°¸à°¿ https://"
-"bugzilla.gnome.org/show_bug.cgi?id=645216 నౠà°à±à°¡à°à°²à°°à±. "
+"bugs.gnucash.org/show_bug.cgi?id=645216 నౠà°à±à°¡à°à°²à°°à±. "
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid ""
@@ -15280,8 +15280,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnuà°à±à°¯à°¾à°·à±-à°¡à±à°µà±âలపà±@gnuà°à±à°¯à°¾à°·à±.à°à°°à±à°à±âà°à± à°¦à±à°·à°¾à°²à°¨à± మరియౠà°à°¤à°° సమసà±à°¯à°²à°¨à± నివà±à°¦à°¿à°à°à±"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "http://bugzilla.gnome.org à°à±à°¡à°¾ à°®à±à°°à± à°¦à±à°· నివà±à°¦à°¿à°à°²à°¨à± à°à±à°¡à°µà°à±à°à± మరియౠఫà±à°²à± à°à±à°¯à°µà°à±à°à±."
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "http://bugs.gnucash.org à°à±à°¡à°¾ à°®à±à°°à± à°¦à±à°· నివà±à°¦à°¿à°à°²à°¨à± à°à±à°¡à°µà°à±à°à± మరియౠఫà±à°²à± à°à±à°¯à°µà°à±à°à±."
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/tr.po b/po/tr.po
index c258d13..30b7534 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -10320,12 +10320,12 @@ msgid "The SQL database is in use by other users, and the upgrade cannot be perf
msgstr "SQL veri tabanı baÅkaları tarafından kullanılıyor, ve oturumları kapatılmadan güncelleme yapılamaz. EÄer baÅka kullanıcılar yoksa, baÅıboÅ oturumları sizin kapatmanız gerekir. Ayrıntılar için ilgili belgelere baÅvurun."
#: ../gnucash/gnome-utils/gnc-file.c:462
-msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more information."
-msgstr "Sisteminizde kurulu olan \"libdbi\" kütüphanesi büyük sayıları doÄru bir Åekilde saklayamıyor. Bu, GnuCash'in SQL veritabanlarını doÄru bir Åekilde kullanamadıÄı anlamına gelir. Gnucash, \"libdbi\"nin farklı bir sürümünü yükleyerek düzeltilinceye kadar SQL veritabanlarını açmaz veya kaydetmez. Daha çok bilgi için lütfen https://bugzilla.gnome.org/show_bug.cgi?id=611936 adresini ziyaret edin."
+msgid "The library \"libdbi\" installed on your system doesn't correctly store large numbers. This means GnuCash cannot use SQL databases correctly. Gnucash will not open or save to SQL databases until this is fixed by installing a different version of \"libdbi\". Please see https://bugs.gnucash.org/show_bug.cgi?id=611936 for more information."
+msgstr "Sisteminizde kurulu olan \"libdbi\" kütüphanesi büyük sayıları doÄru bir Åekilde saklayamıyor. Bu, GnuCash'in SQL veritabanlarını doÄru bir Åekilde kullanamadıÄı anlamına gelir. Gnucash, \"libdbi\"nin farklı bir sürümünü yükleyerek düzeltilinceye kadar SQL veritabanlarını açmaz veya kaydetmez. Daha çok bilgi için lütfen https://bugs.gnucash.org/show_bug.cgi?id=611936 adresini ziyaret edin."
#: ../gnucash/gnome-utils/gnc-file.c:474
-msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?id=645216 for more information."
-msgstr "GnuCash, \"libdbi\" kitaplıÄında bir hata olup olmadıÄı konusunda kritik bir test yapamadı. Bu, SQL veri tabanınızın izinleri yanlıŠyapılandırması nedeniyle oluÅabilir. Daha çok bilgi için lütfen https://bugzilla.gnome.org/show_bug.cgi?id=645216 adresini ziyaret edin."
+msgid "GnuCash could not complete a critical test for the presence of a bug in the \"libdbi\" library. This may be caused by a permissions misconfiguration of your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?id=645216 for more information."
+msgstr "GnuCash, \"libdbi\" kitaplıÄında bir hata olup olmadıÄı konusunda kritik bir test yapamadı. Bu, SQL veri tabanınızın izinleri yanlıŠyapılandırması nedeniyle oluÅabilir. Daha çok bilgi için lütfen https://bugs.gnucash.org/show_bug.cgi?id=645216 adresini ziyaret edin."
#: ../gnucash/gnome-utils/gnc-file.c:484
msgid "This file is from an older version of GnuCash and will be upgraded when saved by this version. You will not be able to read the saved file from the older version of Gnucash (it will report an \"error parsing the file\"). If you wish to preserve the old version, exit without saving."
@@ -13979,8 +13979,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "Hatalar ve diÄer sorunları gnucash-devel at gnucash.org adresine bildirin."
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "Hata bildirimi ve araÅtırması için http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "Hata bildirimi ve araÅtırması için http://bugs.gnucash.org"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/uk.po b/po/uk.po
index a08c31d..66cfb59 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -11315,7 +11315,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15413,9 +15413,9 @@ msgstr ""
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"Ðи можеÑе ÑклаÑÑи звÑÑ Ð¿Ñо Ð¿Ð¾Ð¼Ð¸Ð»ÐºÑ Ð·Ð° адÑеÑÐ¾Ñ http://bugzilla.gnome.org\n"
+"Ðи можеÑе ÑклаÑÑи звÑÑ Ð¿Ñо Ð¿Ð¾Ð¼Ð¸Ð»ÐºÑ Ð·Ð° адÑеÑÐ¾Ñ http://bugs.gnucash.org\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/ur.po b/po/ur.po
index aa60132..8755d80 100644
--- a/po/ur.po
+++ b/po/ur.po
@@ -11493,19 +11493,19 @@ msgstr ""
"ÙØ±ØªÛ ÛÛ. اس ÙØ§ Ù
Ø·ÙØ¨ ÛÛ ÙÛ GnuCash صØÛØ Ø·Ø±ÛÙÛ Ø³Û SQL ÚØ§Ù¹Ø§ Ø¨ÛØ³ کا استعÙ
ا٠ÙÛÛÚº "
"کر سکتا ÛÛÚº. Gnucash Ø§ÛØ³ ÙÛ٠اÛÙ ÚØ§Ù¹Ø§ Ø¨ÛØ³ ÙÚ¾ÙÙ ÛØ§ Ù
ØÙÙØ¸ ÙÛÛÚº ÙØ±ØªØ§ ÛÛ Ø¬Ø¨ ت٠"
"ÛÛ \"libdbi \" کا اÛÚ© Ù
ختÙÙ ÙØ±ÚÙ Ø§ÙØ³Ù¹Ø§Ù کرÙÛ Ú©Û Ø·Ø±Ù Ø³Û Ù
ÙØ±Ø± ÙÛØ§ جاتا ÛÛ "
-"Ù
Ø²ÛØ¯ Ù
عÙÙÙ
ات Ú©Û ÙØ¦Û https://bugzilla.gnome.org/show_bug.cgiØid=611936 Ù
ÙØ§ØØ¸Û "
+"Ù
Ø²ÛØ¯ Ù
عÙÙÙ
ات Ú©Û ÙØ¦Û https://bugs.gnucash.org/show_bug.cgiØid=611936 Ù
ÙØ§ØØ¸Û "
"کرÛÚº."
#: ../gnucash/gnome-utils/gnc-file.c:474
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
"\"libdbi \" ÙØ§Ø¦Ø¨Ø±ÛØ±Û Ù
ÛÚº اÛÚ© خاÙ
Û Ú©Û Ù
ÙØ¬ÙØ¯Ú¯Û Ú©Û ÙØ¦Û اÛÚ© ÙØ±ÛÙ¹ÛÙÙ Ù¹ÛØ³Ù¹ Ù
Ú©Ù
Ù "
"ÙÛÛÚº Û٠سکتا. ÛÛ Ø¢Ù¾ ÙÛ Ø§ÛØ³ Ú©Û٠اÛÙ ÚØ§Ù¹Ø§ Ø¨ÛØ³ Ú©Û Ø§ÛÚ© اجازت Ù
س ÙØ§ÙÙÚ¯Ø±ÛØ´Ù Ú©Û ÙØ¬Û "
-"Ø³Û Û٠سکتا ÛÛ. Ù
Ø²ÛØ¯ Ù
عÙÙÙ
ات Ú©Û ÙØ¦Û https://bugzilla.gnome.org/show_bug.cgiØ"
+"Ø³Û Û٠سکتا ÛÛ. Ù
Ø²ÛØ¯ Ù
عÙÙÙ
ات Ú©Û ÙØ¦Û https://bugs.gnucash.org/show_bug.cgiØ"
"id=645216 Ù
ÙØ§ØØ¸Û کرÛÚº."
#: ../gnucash/gnome-utils/gnc-file.c:484
@@ -15543,9 +15543,9 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "gnucash-devel at gnucash.org پر بگس Ø§ÙØ± دÛگر Ù
Ø³Ø§Ø¦Ù Ú©Û Ø±Ù¾ÙØ±Ù¹ ÙØ±ÛÚº"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
msgstr ""
-"آپ Ø¨Ú¾Û ØªÙØ§Ø´ Ø§ÙØ± http://bugzilla.gnome.org پر بگ Ú©Û Ø±Ù¾ÙØ±Ù¹ درج کرا Ø³Ú©ØªÛ ÛÛÚº"
+"آپ Ø¨Ú¾Û ØªÙØ§Ø´ Ø§ÙØ± http://bugs.gnucash.org پر بگ Ú©Û Ø±Ù¾ÙØ±Ù¹ درج کرا Ø³Ú©ØªÛ ÛÛÚº"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/vi.po b/po/vi.po
index 9661b4d..01af60e 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -11563,7 +11563,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15684,8 +15684,8 @@ msgstr "Hãy thông báo lá»i cho <gnucash-devel at gnucash.org>.\n"
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "CÅ©ng có thá» tra tìm và thông báo lá»i Ỡ« http://bugzilla.gnome.org »\n"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "CÅ©ng có thá» tra tìm và thông báo lá»i Ỡ« http://bugs.gnucash.org »\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index ec2df89..fcd8a1d 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -11324,7 +11324,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15361,8 +15361,8 @@ msgstr "请å°ç¨åºé误æå
¶å®çé®é¢æ¥åç» gnucash-devel at gnucash.org
#: ../gnucash/gnucash-bin.c:162
#, fuzzy
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "æ¨ä¹å¯ä»¥å¨ http://bugzilla.gnome.org æ¥è¯¢åæ¥åé误\n"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "æ¨ä¹å¯ä»¥å¨ http://bugs.gnucash.org æ¥è¯¢åæ¥åé误\n"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 6608263..cddc4b0 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -11128,7 +11128,7 @@ msgstr ""
msgid ""
"GnuCash could not complete a critical test for the presence of a bug in the "
"\"libdbi\" library. This may be caused by a permissions misconfiguration of "
-"your SQL database. Please see https://bugzilla.gnome.org/show_bug.cgi?"
+"your SQL database. Please see https://bugs.gnucash.org/show_bug.cgi?"
"id=645216 for more information."
msgstr ""
@@ -15107,8 +15107,8 @@ msgid "Report bugs and other problems to gnucash-devel at gnucash.org"
msgstr "è«å°ç¨å¼é¯èª¤æå
¶ä»çåé¡åå ±å° gnucash-devel at gnucash.org"
#: ../gnucash/gnucash-bin.c:162
-msgid "You can also lookup and file bug reports at http://bugzilla.gnome.org"
-msgstr "æ¨ä¹å¯ä»¥å¨ http://bugzilla.gnome.org æ¥è©¢ååå ±é¯èª¤"
+msgid "You can also lookup and file bug reports at http://bugs.gnucash.org"
+msgstr "æ¨ä¹å¯ä»¥å¨ http://bugs.gnucash.org æ¥è©¢ååå ±é¯èª¤"
#: ../gnucash/gnucash-bin.c:163
msgid "To find the last stable version, please refer to http://www.gnucash.org"
commit e6ea84ba5830b38121aa927d4373f956b9accfa2
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jul 10 07:12:21 2018 -0700
Fix missing leading dot in sheet specification.
diff --git a/doc/gtk-3.0.css b/doc/gtk-3.0.css
index 4b56b89..139e1dc 100755
--- a/doc/gtk-3.0.css
+++ b/doc/gtk-3.0.css
@@ -20,11 +20,11 @@
*/
/* Register sheet font setting */
-sheet {
+.sheet {
font: 18px arial, sans-serif;
}
-sheet calendar {
+.sheet calendar {
font: 12px arial, sans-serif;
}
commit 38748f20fefad621cfa684bac10698763d77d9ab
Author: Geert Janssens <geert at kobaltwit.be>
Date: Mon Jul 9 11:46:49 2018 +0200
Add favicons for wiki
diff --git a/contrib/art/gnucash-wiki-favicons/android-chrome-192x192.png b/contrib/art/gnucash-wiki-favicons/android-chrome-192x192.png
new file mode 100644
index 0000000..f0229c2
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/android-chrome-192x192.png differ
diff --git a/contrib/art/gnucash-wiki-favicons/android-chrome-512x512.png b/contrib/art/gnucash-wiki-favicons/android-chrome-512x512.png
new file mode 100644
index 0000000..e36fb5b
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/android-chrome-512x512.png differ
diff --git a/contrib/art/gnucash-wiki-favicons/apple-touch-icon.png b/contrib/art/gnucash-wiki-favicons/apple-touch-icon.png
new file mode 100644
index 0000000..ecdc43c
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/apple-touch-icon.png differ
diff --git a/contrib/art/gnucash-wiki-favicons/browserconfig.xml b/contrib/art/gnucash-wiki-favicons/browserconfig.xml
new file mode 100644
index 0000000..eeb397f
--- /dev/null
+++ b/contrib/art/gnucash-wiki-favicons/browserconfig.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<browserconfig>
+ <msapplication>
+ <tile>
+ <square150x150logo src="/mstile-150x150.png"/>
+ <TileColor>#00a300</TileColor>
+ </tile>
+ </msapplication>
+</browserconfig>
diff --git a/contrib/art/gnucash-wiki-favicons/favicon-16x16.png b/contrib/art/gnucash-wiki-favicons/favicon-16x16.png
new file mode 100644
index 0000000..394ac6f
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/favicon-16x16.png differ
diff --git a/contrib/art/gnucash-wiki-favicons/favicon-32x32.png b/contrib/art/gnucash-wiki-favicons/favicon-32x32.png
new file mode 100644
index 0000000..f90d89e
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/favicon-32x32.png differ
diff --git a/contrib/art/gnucash-wiki-favicons/favicon.ico b/contrib/art/gnucash-wiki-favicons/favicon.ico
new file mode 100644
index 0000000..4b54620
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/favicon.ico differ
diff --git a/contrib/art/gnucash-wiki-favicons/mstile-150x150.png b/contrib/art/gnucash-wiki-favicons/mstile-150x150.png
new file mode 100644
index 0000000..2853412
Binary files /dev/null and b/contrib/art/gnucash-wiki-favicons/mstile-150x150.png differ
diff --git a/contrib/art/gnucash-wiki-favicons/safari-pinned-tab.svg b/contrib/art/gnucash-wiki-favicons/safari-pinned-tab.svg
new file mode 100644
index 0000000..a4100d0
--- /dev/null
+++ b/contrib/art/gnucash-wiki-favicons/safari-pinned-tab.svg
@@ -0,0 +1,114 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
+ width="720.000000pt" height="720.000000pt" viewBox="0 0 720.000000 720.000000"
+ preserveAspectRatio="xMidYMid meet">
+<metadata>
+Created by potrace 1.11, written by Peter Selinger 2001-2013
+</metadata>
+<g transform="translate(0.000000,720.000000) scale(0.100000,-0.100000)"
+fill="#000000" stroke="none">
+<path d="M1187 7039 c-105 -25 -210 -110 -256 -209 l-26 -55 -3 -1812 -2
+-1812 -150 -3 -151 -3 -209 -445 c-130 -277 -215 -446 -224 -448 -10 -2 -16
+-14 -16 -32 0 -15 -9 -47 -20 -71 -19 -44 -19 -44 0 -47 20 -3 20 -14 20 -453
+l0 -449 300 0 300 0 0 -154 0 -154 -40 -111 c-22 -61 -36 -111 -32 -111 4 1
+18 7 32 15 14 8 28 14 33 15 4 0 7 -56 7 -125 l0 -125 1875 0 1875 0 0 450 c0
+387 2 450 15 450 12 0 12 6 0 48 -8 26 -15 62 -15 80 0 17 -4 32 -10 32 -7 0
+-50 116 -50 136 0 2 47 4 104 4 l103 0 18 -62 c21 -78 21 -99 1 -168 -18 -60
+-15 -118 11 -181 14 -35 13 -42 -8 -98 -66 -183 70 -366 349 -465 142 -51 261
+-69 452 -70 288 -1 497 54 668 173 91 64 162 172 162 247 0 20 6 23 58 29 373
+41 632 182 683 369 14 52 6 153 -14 193 -16 29 -15 34 4 79 17 38 21 61 17
+118 -3 39 -12 85 -21 103 -16 30 -16 34 4 79 17 38 21 61 17 118 -3 39 -12 85
+-21 102 -15 29 -15 35 4 85 25 64 23 154 -4 210 -17 34 -17 37 4 84 17 39 21
+62 17 119 -3 39 -12 85 -21 103 -16 30 -16 34 4 79 17 38 21 61 17 118 -3 39
+-12 85 -21 102 -15 29 -15 35 3 83 25 65 25 137 0 202 -18 49 -18 53 -2 83 24
+44 24 189 -1 234 -17 30 -17 34 0 65 25 45 25 178 0 233 -18 40 -18 42 -1 75
+30 55 26 170 -8 235 -55 105 -196 205 -364 257 -94 30 -230 57 -284 57 -77 0
+-70 -71 -70 746 l0 733 142 173 c78 95 216 260 305 366 90 105 159 192 154
+192 -9 0 -464 -165 -547 -198 l-51 -21 -5 69 c-10 135 -92 254 -218 314 l-65
+31 -2395 2 c-1370 0 -2411 -3 -2433 -8z m4806 -150 c49 -13 115 -73 138 -124
+13 -28 19 -64 19 -120 l0 -80 -157 -75 c-894 -427 -1859 -1132 -2761 -2014
+l-142 -140 -33 16 c-17 9 -203 111 -412 227 -208 116 -382 211 -386 211 -9 0
+24 52 -454 -705 -83 -132 -185 -292 -226 -355 l-74 -114 -3 72 -3 72 -64 0
+-65 0 -3 1343 -2 1342 -3 -1647 -2 -1648 -155 0 -155 0 0 1788 0 1788 26 52
+c27 55 64 87 123 108 47 17 4733 20 4794 3z m146 -2239 c-6 -4 -45 -10 -87
+-13 -163 -13 -376 -85 -482 -163 -151 -111 -202 -250 -141 -389 17 -38 17 -42
+0 -80 -25 -55 -25 -157 1 -212 19 -42 19 -43 -1 -88 -27 -61 -27 -149 0 -210
+19 -42 19 -49 6 -75 -38 -73 -37 -187 2 -246 12 -18 11 -27 -7 -65 -11 -24
+-20 -58 -20 -76 0 -31 -1 -32 -57 -38 -180 -19 -300 -49 -422 -106 l-84 -39
+-373 0 c-206 0 -374 3 -374 7 0 4 9 16 19 27 10 12 83 104 161 206 133 173
+140 185 118 191 -13 4 -70 17 -128 29 -119 25 -255 68 -350 112 -72 32 -153
+78 -148 83 2 2 60 13 130 24 210 34 432 92 677 175 l156 53 93 144 c50 79 92
+146 92 150 0 3 -53 25 -117 48 -128 45 -284 120 -291 139 -2 8 8 12 27 12 60
+0 403 74 577 125 6 2 56 81 112 177 56 95 113 191 126 214 l25 41 -138 57
+c-135 56 -227 104 -218 112 2 2 60 13 128 24 68 12 184 35 257 52 l132 32 27
+45 c74 128 319 469 507 706 l71 89 3 -634 c1 -448 -1 -636 -9 -640z m-3751
+-89 c48 -27 200 -110 337 -186 138 -76 252 -139 254 -141 2 -2 -52 -63 -120
+-136 -308 -330 -516 -569 -721 -830 l-92 -118 -273 0 -273 0 0 87 0 86 89 141
+c48 78 160 258 248 401 341 554 458 744 461 744 1 1 42 -21 90 -48z m4117 -85
+c255 -57 395 -153 395 -273 0 -57 -18 -90 -80 -146 -161 -145 -597 -199 -935
+-116 -99 24 -219 80 -263 122 -178 170 -7 360 382 423 106 17 404 11 501 -10z
+m-766 -640 c104 -39 170 -56 287 -71 299 -40 609 10 814 131 l55 32 3 -34 c4
+-46 -26 -93 -88 -139 -277 -203 -883 -203 -1160 0 -59 44 -90 91 -90 138 l0
+36 56 -34 c31 -19 86 -45 123 -59z m-53 -276 c163 -77 308 -105 544 -104 260
+0 441 40 602 133 l68 39 0 -35 c0 -49 -32 -96 -97 -142 -279 -200 -878 -198
+-1153 4 -60 44 -90 91 -90 140 l0 37 33 -22 c17 -12 59 -34 93 -50z m-31 -286
+c60 -33 204 -81 302 -101 111 -21 412 -24 523 -4 113 20 277 76 353 120 l67
+40 0 -31 c0 -128 -218 -251 -510 -287 -301 -38 -639 38 -774 172 -44 44 -70
+104 -59 133 5 13 9 12 32 -3 14 -9 44 -27 66 -39z m-56 -271 c2 -2 -5 -3 -17
+-3 -14 0 -22 6 -22 16 0 14 3 15 18 3 9 -7 19 -15 21 -16z m1281 -78 c-64
+-103 -268 -191 -500 -216 l-111 -12 -47 50 c-26 27 -62 61 -80 75 l-34 25 164
+6 c237 9 439 60 569 142 l54 34 3 -35 c2 -22 -4 -47 -18 -69z m-5103 48 c-3
+-10 -8 -36 -12 -58 -13 -83 21 -75 -333 -74 -174 0 -348 4 -387 8 -39 4 -112
+3 -164 -2 -77 -8 -98 -14 -113 -31 -9 -11 -17 -27 -18 -34 0 -18 -119 -254
+-140 -277 -9 -11 -20 -31 -22 -45 -3 -14 -9 -33 -13 -42 -7 -17 8 -18 238 -18
+l246 0 -25 -72 -24 -73 -329 3 -329 3 95 202 c52 111 130 275 173 365 l79 162
+541 0 c511 0 541 -1 537 -17z m3915 -138 c274 -41 458 -155 458 -282 0 -57
+-18 -90 -79 -145 -96 -87 -297 -145 -536 -155 -509 -21 -877 202 -682 414 22
+24 59 55 81 68 60 35 215 84 314 99 117 19 325 19 444 1z m1183 -217 c-51 -76
+-219 -161 -380 -191 -88 -17 -235 -32 -235 -25 0 3 7 19 16 37 9 18 18 50 21
+71 l5 39 67 6 c179 18 359 70 471 138 l55 32 3 -33 c2 -24 -5 -46 -23 -74z
+m-2190 65 c-38 -88 -40 -172 -6 -248 17 -39 17 -42 -2 -84 -25 -57 -25 -145 0
+-202 19 -44 19 -44 0 -89 -25 -56 -26 -159 -3 -214 9 -21 16 -40 16 -42 0 -3
+-68 -3 -152 -2 l-151 3 -89 290 c-48 159 -92 293 -96 297 -4 4 -82 9 -172 10
+l-165 3 -12 80 c-19 128 -19 125 40 172 l52 41 374 1 c352 1 373 0 366 -16z
+m-988 -195 c5 -40 8 -76 6 -80 -2 -5 -35 -8 -74 -8 -54 0 -69 3 -69 15 0 8 9
+19 20 25 31 17 26 56 -11 77 l-31 18 69 11 c37 7 71 12 74 13 3 0 10 -32 16
+-71z m-1337 -68 c0 -14 -7 -20 -22 -20 -20 0 -21 1 -3 20 10 11 20 20 22 20 1
+0 3 -9 3 -20z m4517 -93 c-62 -104 -256 -189 -500 -218 -54 -6 -101 -9 -104
+-6 -3 4 2 24 11 47 9 22 16 53 16 69 0 28 2 29 63 36 206 21 417 87 512 158
+19 15 20 14 23 -14 2 -19 -6 -46 -21 -72z m-1935 -122 c244 -112 597 -135 895
+-60 92 24 274 102 287 124 25 41 36 -31 12 -78 -21 -39 -96 -106 -153 -134
+-217 -109 -553 -135 -827 -66 -171 43 -322 141 -345 224 -15 55 -6 70 30 44
+16 -11 61 -35 101 -54z m-2097 35 c4 -6 40 -180 81 -388 l74 -377 0 -370 c0
+-203 -3 -380 -6 -392 l-6 -23 -294 0 -294 0 0 388 0 388 65 370 c36 203 68
+379 70 392 5 22 8 22 155 22 92 0 151 -4 155 -10z m-1445 -4 c0 -16 -84 -135
+-98 -139 -10 -2 -26 -29 -39 -68 -12 -35 -52 -118 -88 -184 -37 -66 -91 -168
+-121 -227 -50 -100 -56 -108 -83 -108 l-29 0 22 73 c44 140 209 642 213 650 4
+7 223 10 223 3z m974 -28 c-4 -18 -9 -49 -13 -68 l-7 -35 -133 -3 -132 -3 48
+71 48 70 97 0 98 0 -6 -32z m1716 27 c0 -2 50 -165 110 -360 61 -196 110 -358
+110 -361 0 -2 -261 -4 -579 -4 l-579 0 -5 23 c-3 12 -9 43 -12 70 l-7 47 487
+0 c268 0 490 2 492 4 6 6 -124 427 -135 438 -5 5 -218 9 -474 8 l-465 0 -6 45
+c-4 25 -9 56 -13 70 l-6 25 541 0 c298 0 541 -2 541 -5z m2790 -210 c-61 -98
+-259 -187 -475 -214 -49 -6 -102 -11 -117 -11 l-26 0 19 50 c10 28 19 61 19
+74 0 23 5 25 68 31 174 17 371 75 473 140 l54 34 3 -35 c2 -22 -4 -47 -18 -69z
+m-1870 -146 c340 -124 825 -93 1086 70 47 29 49 30 52 10 6 -36 -7 -68 -44
+-109 -192 -212 -769 -265 -1109 -101 -101 49 -158 98 -180 156 -28 72 -16 81
+53 40 32 -19 96 -49 142 -66z m1870 -154 c-63 -102 -265 -190 -495 -216 -58
+-6 -108 -9 -111 -6 -4 3 1 25 10 49 8 24 17 54 18 68 3 24 8 26 122 42 66 10
+153 27 195 38 76 21 219 84 256 113 19 15 20 14 23 -19 2 -22 -4 -47 -18 -69z
+m-1938 -120 c334 -153 850 -135 1148 41 l55 32 3 -29 c5 -42 -36 -107 -92
+-147 -248 -178 -756 -203 -1065 -51 -96 47 -165 110 -180 164 -15 55 -6 70 30
+44 16 -11 61 -35 101 -54z m-2672 25 c0 -10 -5 -42 -11 -70 l-11 -50 -239 0
+-239 0 35 70 35 70 215 0 c207 0 215 -1 215 -20z m4620 -181 c-33 -79 -178
+-168 -340 -208 -91 -22 -268 -46 -277 -37 -3 2 2 24 11 48 8 24 17 54 18 68 3
+23 9 26 68 33 194 25 361 74 470 140 l55 32 3 -23 c2 -13 -2 -37 -8 -53z
+m-1946 -144 c276 -128 698 -138 1007 -26 48 18 111 47 140 66 l54 34 3 -30 c5
+-42 -36 -107 -92 -147 -248 -178 -756 -203 -1065 -51 -96 47 -165 110 -180
+164 -15 55 -6 70 30 44 16 -11 62 -36 103 -54z m0 -300 c187 -87 472 -124 716
+-95 168 21 352 80 445 143 39 27 40 27 43 6 17 -106 -162 -231 -400 -279 -328
+-68 -724 1 -880 153 -46 44 -75 105 -64 133 5 13 10 12 36 -6 16 -12 63 -37
+104 -55z"/>
+</g>
+</svg>
diff --git a/contrib/art/gnucash-wiki-favicons/site.webmanifest b/contrib/art/gnucash-wiki-favicons/site.webmanifest
new file mode 100644
index 0000000..b20abb7
--- /dev/null
+++ b/contrib/art/gnucash-wiki-favicons/site.webmanifest
@@ -0,0 +1,19 @@
+{
+ "name": "",
+ "short_name": "",
+ "icons": [
+ {
+ "src": "/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/android-chrome-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/contrib/art/gnucash-wiki-logo.svg b/contrib/art/gnucash-wiki-logo.svg
new file mode 100644
index 0000000..2a32ddc
--- /dev/null
+++ b/contrib/art/gnucash-wiki-logo.svg
@@ -0,0 +1,613 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="12.700011mm"
+ height="12.170404mm"
+ viewBox="0 0 12.700011 12.170404"
+ version="1.1"
+ id="svg1982"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="gnucash-wiki-7.svg">
+ <defs
+ id="defs1976">
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2707"
+ id="linearGradient2493-2-3-3"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.26458333,0,0,0.22048602,278.494,-5.0521521)"
+ x1="18"
+ y1="39"
+ x2="18"
+ y2="45.780262" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2707">
+ <stop
+ style="stop-color:#eeeeec;stop-opacity:1;"
+ offset="0"
+ id="stop2709" />
+ <stop
+ style="stop-color:#eeeeec;stop-opacity:0;"
+ offset="1"
+ id="stop2711" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2632"
+ id="linearGradient2491-1-5-4"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.26458333,0,0,0.26458333,278.494,-6.7719437)"
+ x1="24.612919"
+ y1="20.159996"
+ x2="29.182333"
+ y2="12.24554" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2632">
+ <stop
+ style="stop-color:#204a87;stop-opacity:1;"
+ offset="0"
+ id="stop2635" />
+ <stop
+ style="stop-color:#204a87;stop-opacity:0;"
+ offset="1"
+ id="stop2637" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.77794643,0,0,0.6438175,265.91661,-13.218924)"
+ r="14.5"
+ fy="18.592903"
+ fx="24.5"
+ cy="18.592903"
+ cx="24.5"
+ id="radialGradient2629-6-2-2-7"
+ xlink:href="#linearGradient2623"
+ inkscape:collect="always" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2623">
+ <stop
+ style="stop-color:#babdb6;stop-opacity:1;"
+ offset="0"
+ id="stop2625" />
+ <stop
+ style="stop-color:#babdb6;stop-opacity:0;"
+ offset="1"
+ id="stop2627" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.87935513,0,0,0.73343875,263.7314,-19.965703)"
+ r="14.986866"
+ fy="31.643599"
+ fx="24.013132"
+ cy="31.643599"
+ cx="24.013132"
+ id="radialGradient2655-1-0-8-1"
+ xlink:href="#linearGradient2649"
+ inkscape:collect="always" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2649">
+ <stop
+ style="stop-color:#d3d7cf;stop-opacity:1;"
+ offset="0"
+ id="stop2651" />
+ <stop
+ style="stop-color:#d3d7cf;stop-opacity:0;"
+ offset="1"
+ id="stop2653" />
+ </linearGradient>
+ <radialGradient
+ r="21.030567"
+ fy="40.604275"
+ fx="17.984474"
+ cy="40.604275"
+ cx="17.984474"
+ gradientTransform="matrix(0.33630811,0,0,0.11910892,278.56774,-1.5487861)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2596-7-2-4-9"
+ xlink:href="#linearGradient2300"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient2300"
+ inkscape:collect="always">
+ <stop
+ id="stop2302"
+ offset="0"
+ style="stop-color:#555753;stop-opacity:1;" />
+ <stop
+ id="stop2304"
+ offset="1"
+ style="stop-color:#555753;stop-opacity:0;" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8616351"
+ inkscape:cx="-82.388894"
+ inkscape:cy="-28.059476"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1141"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata1979">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Laag 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-278.49399,6.5069293)">
+ <ellipse
+ ry="2.2489598"
+ rx="6.3500056"
+ cy="3.4145155"
+ cx="284.84399"
+ style="opacity:0.5;fill:url(#radialGradient2596-7-2-4-9);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2582255;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2290-5-2-5-1" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="3.2830696"
+ cx="289.48096"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#786100;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2773-9-8-9-7" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="3.2830734"
+ cx="289.48035"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2775-9-3-7-8" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="2.7556047"
+ cx="289.48352"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2777-1-8-5-5" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="2.7556086"
+ cx="289.48288"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2779-4-0-3-7" />
+ <rect
+ style="opacity:1;fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect1354-9-4-8-4"
+ width="9.2713051"
+ height="9.259263"
+ x="280.20654"
+ y="-6.3746376"
+ rx="0.52916676"
+ ry="0.52916723" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="2.2264419"
+ cx="289.48352"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2781-1-0-8-1" />
+ <rect
+ style="opacity:1;fill:url(#radialGradient2655-1-0-8-1);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2229-0-9-3-8"
+ width="7.9305501"
+ height="6.6145835"
+ x="280.8822"
+ y="-5.449028"
+ rx="0.42994794"
+ ry="0.42994794" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="2.2264419"
+ cx="289.48288"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2783-7-1-1-5" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:url(#radialGradient2629-6-2-2-7);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 282.20644,-5.4490271 v 1.0583334 h -1.06661 v 0.2645831 h 1.06661 v 1.0583332 h -1.06661 v 0.2645833 h 1.06661 v 1.0583333 h -1.06661 v 0.2645834 h 1.06661 v 1.05833361 h -1.06661 v 0.2645833 h 1.06661 v 1.0583333 h 0.26458 v -1.0583333 h 1.05834 v 1.0583333 h 0.26458 v -1.0583333 h 1.05833 v 1.0583333 h 0.26459 v -1.0583333 h 1.05833 v 1.0583333 h 0.26458 v -1.0583333 h 1.05833 v 1.0583333 h 0.26459 v -1.0583333 h 1.05006 v -0.2645833 h -1.05006 V -1.4802774 h 1.05006 v -0.2645834 h -1.05006 v -1.0583333 h 1.05006 v -0.2645833 h -1.05006 v -1.0583332 h 1.05006 v -0.2645831 h -1.05006 v -1.0583334 h -0.26459 v 1.0583334 h -1.05833 v -1.0583334 h -0.26458 v 1.0583334 h -1.05833 v -1.0583334 h -0.26459 v 1.0583334 h -1.05833 v -1.0583334 h -0.26458 v 1.0583334 h -1.05834 v -1.0583334 z m 0.26458,1.3229165 h 1.05834 v 1.0583332 h -1.05834 z m 1.32292,0 h 1.05833 v 1.0583332 h -1.05833 z m 1.32292,0 h 1.05833 v 1.0583332 h -1.05833 z m 1.32291,0 h 1.05833 v 1.0583332 h -1.05833 z m -3.96875,1.3229165 h 1.05834 v 1.0583333 h -1.05834 z m 1.32292,0 h 1.05833 v 1.0583333 h -1.05833 z m 1.32292,0 h 1.05833 v 1.0583333 h -1.05833 z m 1.32291,0 h 1.05833 v 1.0583333 h -1.05833 z m -3.96875,1.3229167 h 1.05834 v 1.05833361 h -1.05834 z m 1.32292,0 h 1.05833 v 1.05833361 h -1.05833 z m 1.32292,0 h 1.05833 v 1.05833361 h -1.05833 z m 1.32291,0 h 1.05833 v 1.05833361 h -1.05833 z"
+ id="rect2281-5-9-8-9" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="1.6959697"
+ cx="289.48019"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2785-8-6-9-7" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:url(#linearGradient2491-1-5-4);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 286.0429,-3.5969441 -1.29197,2.3328709 -2.278,-1.2692829 -1.58941,2.50828731 0.23151,0.1322916 1.43197,-2.30895811 2.30226,1.26504041 1.42515,-2.52795751 z"
+ id="rect2293-7-2-6-5"
+ sodipodi:nodetypes="ccccccccc" />
+ <rect
+ style="opacity:1;fill:#888a85;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2600-04-5-4-3"
+ width="0.26458332"
+ height="7.9375"
+ x="0.90097249"
+ y="-288.81274"
+ transform="rotate(90)" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="1.695572"
+ cx="289.48288"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2787-8-4-3-8" />
+ <rect
+ style="opacity:1;fill:#888a85;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2231-0-4-3-8"
+ width="0.26458332"
+ height="6.6145835"
+ x="280.8822"
+ y="-5.449028" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:0.2;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 280.87525,-5.4490271 h 7.9375 c -3.2175,1.0345553 -2.99973,4.76249991 -7.9375,4.76249991 z"
+ id="rect2743-9-9-3-3"
+ sodipodi:nodetypes="cccc" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="4.07512"
+ cx="288.15549"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#786100;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2413-5-9-8-1" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="1.1664096"
+ cx="289.48352"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2789-2-3-6-8" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="4.0751219"
+ cx="288.15488"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2415-0-6-0-9" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="3.5476532"
+ cx="288.15805"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2417-8-0-4-6" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="1.1664077"
+ cx="289.48288"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2791-3-5-8-4" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="3.547657"
+ cx="288.15741"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2419-8-0-8-3" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="3.0184903"
+ cx="288.15805"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2421-0-2-8-3" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="0.63854277"
+ cx="289.48352"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2797-4-9-9-3" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="3.0184903"
+ cx="288.15741"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2423-9-4-7-8" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="2.4880195"
+ cx="288.15472"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2425-1-3-7-6" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="2.4876199"
+ cx="288.15741"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2427-9-5-6-0" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="0.10807001"
+ cx="289.48019"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2799-6-1-4-4" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="1.9584581"
+ cx="288.15805"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2429-2-7-3-8" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="1.9584557"
+ cx="288.15741"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2431-5-4-0-8" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="-0.42149007"
+ cx="289.48352"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2801-7-3-3-8" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="-0.95065725"
+ cx="289.48352"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2809-4-1-0-9" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="-1.4807302"
+ cx="289.47842"
+ style="opacity:1;fill:#fce94f;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2793-3-4-9-7" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="1.4292914"
+ cx="288.15295"
+ style="opacity:1;fill:#fce94f;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2761-1-6-2-7" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="1.429289"
+ cx="288.15231"
+ style="opacity:0.5;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2763-4-9-5-6" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="-1.48113"
+ cx="289.47571"
+ style="opacity:0.5;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.265;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2795-6-4-4-4" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#4e9a06;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458326;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 278.89083,2.0887086 h 6.35009 v 1.5941759 h -6.35009 z"
+ id="path2321-4-2-0-3" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#59af05;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 279.63856,0.50428171 h 5.36355 l 0.23877,1.59000319 h -6.35 z"
+ id="path2323-2-2-5-0"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2325-9-6-9-3"
+ width="6.0854168"
+ height="0.26458332"
+ x="279.02319"
+ y="3.0273438" />
+ <rect
+ style="fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2327-6-4-4-0"
+ width="6.0854168"
+ height="0.26458332"
+ x="279.02319"
+ y="2.4981771" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:0.25;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 279.80041,0.78247921 -0.5209,1.04179689 h 5.6472 l -0.15709,-1.04179689 z"
+ id="path2329-1-1-6-9"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2341-0-2-9-2"
+ width="1.3063309"
+ height="1.6164331"
+ x="281.54498"
+ y="2.0847316" />
+ <ellipse
+ ry="0.39687485"
+ rx="1.3229171"
+ cy="1.2978493"
+ cx="282.19815"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14314005;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2746-4-8-2-5" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 281.8013,0.50296221 -0.26459,1.49149889 v 1.6857742 h 1.32292 V 1.9801892 l -0.28939,-1.47722699 z"
+ id="path2715-2-8-2-4"
+ sodipodi:nodetypes="ccccccc" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#4e9a06;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458323;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 279.94695,3.4068596 h 6.35225 V 5.004699 h -6.35225 z"
+ id="rect2271-2-9-4-0" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#57ae06;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458323;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 280.46536,1.828343 h 5.34688 l 0.48681,1.5859051 h -6.34984 z"
+ id="path3816-5-2-7-5"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2441-9-8-7-9"
+ width="6.0854168"
+ height="0.26458332"
+ x="280.08148"
+ y="4.3405552" />
+ <rect
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2443-2-8-5-4"
+ width="6.0854173"
+ height="0.26458332"
+ x="280.08148"
+ y="3.811388" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:0.25;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 280.66855,2.0998661 -0.339,1.0417968 h 5.59759 l -0.32246,-1.0417968 z"
+ id="path2269-0-8-4-6" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.26458266"
+ cy="1.8229223"
+ cx="281.13156"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.03695855;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2267-4-6-8-9" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.26458266"
+ cy="1.8229223"
+ cx="285.10031"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.03695855;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3843-4-8-1-2" />
+ <ellipse
+ ry="0.39687485"
+ rx="1.3229152"
+ cy="2.6207652"
+ cx="283.2565"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14313994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3837-9-3-2-2" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.40100399"
+ cy="2.8812551"
+ cx="281.00339"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0454997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3839-9-8-8-4" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="2.8853488"
+ cx="285.24088"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3841-3-3-9-7" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 282.85963,1.8326522 -0.26458,1.4883379 v 1.6822015 h 1.32291 V 3.3067484 l -0.28939,-1.4740962 z"
+ id="rect1372-6-3-3-7"
+ sodipodi:nodetypes="ccccccc" />
+ <rect
+ style="opacity:1;fill:#888a85;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2721-0-3-6-5"
+ width="1.0583333"
+ height="1.3229166"
+ x="282.72733"
+ y="3.5468054" />
+ <rect
+ style="opacity:1;fill:url(#linearGradient2493-2-3-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2673-5-8-8-4"
+ width="1.0583333"
+ height="1.3229166"
+ x="282.72733"
+ y="3.5468054" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="2.3561821"
+ cx="284.97629"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2691-0-0-0-8" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="2.3561821"
+ cx="281.27213"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2693-2-4-2-1" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.40100399"
+ cy="1.5624329"
+ cx="279.94507"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0454997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2748-4-7-1-2" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="1.5624329"
+ cx="284.44711"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2750-3-6-0-8" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="1.0332662"
+ cx="284.18253"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2752-5-8-5-9" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="1.0332662"
+ cx="280.21378"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2754-1-9-1-3" />
+ <path
+ id="path2300-6"
+ d="m 284.76958,-0.37374199 c 0.64282,0 1.45852,-0.2450936 1.99303,-0.4338119 0.0735,-0.1146242 0.14756,-0.23052541 0.22102,-0.34833011 -0.38315,-0.1215953 -0.73211,-0.3084269 -0.91703,-0.5148749 0.42874,0 0.93097,-0.1102069 1.37936,-0.2381255 0.11843,-0.196336 0.23305,-0.3888624 0.34451,-0.5775786 -0.34135,-0.121598 -0.64471,-0.2938608 -0.81254,-0.481317 0.37239,0 0.80241,-0.083596 1.20266,-0.1893607 0.47244,-0.820145 2.10131,-2.7251397 2.10131,-2.7251397 -3.98034,1.3267896 -9.04936,6.39579581 -10.37614,10.3761491 l 1.29702,-0.6485099 c 0,0 0.64851,-1.6010048 1.29702,-2.2697813 0.48575,-0.5009544 1.76313,-0.1013317 2.59403,-0.3242556 0.20901,-0.055732 0.55921,-0.45345639 0.96579,-1.01710779 -0.51804,-0.096237 -1.04622,-0.3356433 -1.29004,-0.6079561 z"
+ inkscape:connector-curvature="0"
+ style="fill:#235089;fill-opacity:1;stroke:#306fbe;stroke-width:0.265;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ </g>
+</svg>
commit 4d013e091cc6890238b2c5bea2ef73b4aa37f931
Author: David Osguthorpe <david.osguthorpe at gmail.com>
Date: Sat Jul 7 13:33:22 2018 -0700
Bug 796737 - Patch to restore gncmod-python.c.
Restores the gncmod-python module.
It removes the need to link the module to libgncmod-app-utils.dylib or
libgncmod-core-utils.dylib. This was needed previously as the init
function for those modules was called in the c code. However, unless
there was python c code at some point in gncmod-python.c to use
functions in c of either core utils or app utils these are not needed.
Those module init functions would be called when the modules are
imported in eg init.py, which does indeed import _sw_app_utils
successfully.
I have made edits to init.py (and other files) so it loads without
errors with python 3. These edits are NOT tested. I dont actually use
pycons, I update the init.py to simply import my python subsystem init
module. I never set the if False: to if True: to actually activate the
console.
diff --git a/gnucash/python/CMakeLists.txt b/gnucash/python/CMakeLists.txt
index f617858..a6690dd 100644
--- a/gnucash/python/CMakeLists.txt
+++ b/gnucash/python/CMakeLists.txt
@@ -1,3 +1,5 @@
+set(gncmod_python_SOURCES gncmod-python.c)
+
set(pycons_DATA
pycons/__init__.py
pycons/console.py
@@ -9,6 +11,23 @@ set(pycons_DATA
)
if (WITH_PYTHON)
+
+ add_library(gncmod-python ${gncmod_python_SOURCES})
+ # target_link_libraries(gncmod-python gnc-module gnc-core-utils-python gncmod-app-utils-python
+ target_link_libraries(gncmod-python gnc-module gnc-core-utils
+ ${PYTHON_LIBRARIES} ${GLIB_LIBS}) # ${PYTHON_EXTRA_LIBS}
+ target_include_directories(gncmod-python
+ PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/libgnucash/core-utils ${CMAKE_SOURCE_DIR}/gnc-module ${PYTHON_INCLUDE_DIR})
+ target_compile_options(gncmod-python PRIVATE -DG_LOG_DOMAIN=\"gnc.python\")
+if (APPLE)
+ set_target_properties (gncmod-python PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}/gnucash")
+endif()
+ install(TARGETS gncmod-python
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/gnucash
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ )
+
install(FILES ${pycons_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/python/pycons)
install(FILES init.py DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/python)
@@ -17,6 +36,6 @@ if (WITH_PYTHON)
endif(WITH_PYTHON)
set_local_dist(pycons_DIST ${pycons_DATA})
-set_local_dist(python_DIST_local CMakeLists.txt init.py)
+set_local_dist(python_DIST_local CMakeLists.txt gncmod-python.c init.py)
set(python_DIST ${python_DIST_local} ${pycons_DIST} PARENT_SCOPE)
diff --git a/gnucash/python/gncmod-python.c b/gnucash/python/gncmod-python.c
new file mode 100644
index 0000000..15f94ec
--- /dev/null
+++ b/gnucash/python/gncmod-python.c
@@ -0,0 +1,133 @@
+/*********************************************************************
+ * gncmod-python.c
+ * Python in GnuCash?! Sweet.
+ *
+ * Copyright (c) 2011 Andy Clayton
+ *********************************************************************/
+/********************************************************************\
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ * *
+\********************************************************************/
+
+
+#include <Python.h>
+#include <config.h>
+#include <gmodule.h>
+#include <stdio.h>
+
+#include "gnc-module.h"
+#include "gnc-module-api.h"
+#include "gnc-path.h"
+
+GNC_MODULE_API_DECL(libgncmod_python)
+
+/* version of the gnc module system interface we require */
+int libgncmod_python_gnc_module_system_interface = 0;
+
+/* module versioning uses libtool semantics. */
+int libgncmod_python_gnc_module_current = 0;
+int libgncmod_python_gnc_module_revision = 0;
+int libgncmod_python_gnc_module_age = 0;
+
+
+char *
+libgncmod_python_gnc_module_path(void)
+{
+ return g_strdup("gnucash/python");
+}
+
+char *
+libgncmod_python_gnc_module_description(void)
+{
+ return g_strdup("An embedded Python interpreter");
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+//extern PyObject* PyInit__sw_app_utils(void);
+//extern PyObject* PyInit__sw_core_utils(void);
+#else
+//extern void init_sw_app_utils(void);
+//extern void init_sw_core_utils(void);
+#endif
+
+int
+libgncmod_python_gnc_module_init(int refcount)
+{
+ /* There isn't yet a python module to init.
+ PyObject *pName, *pModule;
+ */
+ FILE *fp;
+ gchar *pkgdatadir, *init_filename;
+#if PY_VERSION_HEX >= 0x03000000
+ wchar_t* argv = NULL;
+#else
+ char* argv = "";
+#endif
+ Py_Initialize();
+ PySys_SetArgv(0, &argv);
+ // I dont quite understand why these are loaded here
+ // - these are python modules so should be able to just import them
+ // in init.py
+#if PY_VERSION_HEX >= 0x03000000
+ //PyInit__sw_app_utils();
+ //PyInit__sw_core_utils();
+#else
+ //init_sw_app_utils();
+ //init_sw_core_utils();
+#endif
+
+ /* There isn't yet a python module to init.
+ pName = PyString_FromString("path/to/init.py");
+ pModule = PyImport_Import(pName);
+
+ if (!pModule) {
+ PyErr_Print();
+ return FALSE;
+ }
+
+ Py_DECREF(pName);
+ Py_DECREF(pModule);
+ */
+
+ pkgdatadir = gnc_path_get_pkgdatadir();
+ init_filename = g_build_filename(pkgdatadir, "python/init.py", (char*)NULL);
+ g_debug("Looking for python init script at %s", (init_filename ? init_filename : "<null>"));
+ fp = fopen(init_filename, "r");
+ if (fp)
+ {
+ PyRun_SimpleFile(fp, init_filename);
+ fclose(fp);
+
+ /* PyRun_InteractiveLoop(stdin, "foo"); */
+ }
+ else
+ {
+ g_warning("Unable to initialize Python module (unable to open %s)", init_filename);
+ }
+ g_free(init_filename);
+ g_free(pkgdatadir);
+
+ return TRUE;
+}
+
+int
+libgncmod_python_gnc_module_end(int refcount)
+{
+ Py_Finalize();
+ return TRUE;
+}
diff --git a/gnucash/python/init.py b/gnucash/python/init.py
index 4ec0febd..ca96f12 100644
--- a/gnucash/python/init.py
+++ b/gnucash/python/init.py
@@ -1,7 +1,7 @@
import sys
-import _sw_app_utils
+import gnucash._sw_app_utils as _sw_app_utils
from gnucash import *
-from _sw_core_utils import gnc_prefs_is_extra_enabled
+from gnucash._sw_core_utils import gnc_prefs_is_extra_enabled
from gi import require_version
require_version('Gtk', '3.0')
from gi.repository import Gtk
diff --git a/gnucash/python/pycons/console.py b/gnucash/python/pycons/console.py
index 6a070b8..760c498 100644
--- a/gnucash/python/pycons/console.py
+++ b/gnucash/python/pycons/console.py
@@ -31,12 +31,14 @@ import sys
import re
import tempfile
import readline
+import gi
+gi.require_version('Gtk', '3.0')
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Pango
-from StringIO import StringIO
-import shell
-try: import ishell
+import io
+import pycons.shell as shell
+try: import pycons.ishell as ishell
except: pass
ansi_colors = {'0;30': '#2E3436',
@@ -79,8 +81,8 @@ class ConsoleOut:
def writelines(self, l):
for s in l:
self.console.write (s, self.style)
- def seek(self, a): raise IOError, (29, 'Illegal seek')
- def tell(self): raise IOError, (29, 'Illegal seek')
+ def seek(self, a): raise IOError(29, 'Illegal seek')
+ def tell(self): raise IOError(29, 'Illegal seek')
truncate = tell
@@ -113,8 +115,8 @@ class ConsoleIn:
def readlines(self): return []
def write(self, s): return None
def writelines(self, l): return None
- def seek(self, a): raise IOError, (29, 'Illegal seek')
- def tell(self): raise IOError, (29, 'Illegal seek')
+ def seek(self, a): raise IOError(29, 'Illegal seek')
+ def tell(self): raise IOError(29, 'Illegal seek')
truncate = tell
@@ -179,7 +181,7 @@ class Console (Gtk.ScrolledWindow):
# Console stuff
self.argv = argv
self.history_init(filename, size)
- self.cout = StringIO()
+ self.cout = io.StringIO()
self.cout.truncate(0)
if shelltype=='ipython':
self.shell = ishell.Shell(argv,locals(),globals(),
diff --git a/gnucash/python/pycons/shell.py b/gnucash/python/pycons/shell.py
index d50043e..dfdc0d8 100644
--- a/gnucash/python/pycons/shell.py
+++ b/gnucash/python/pycons/shell.py
@@ -153,9 +153,9 @@ class Shell:
console.write (buf, 'output')
if len(buf) < 256: break
# Command output
- print(`r`)
+ print(repr(r))
except SyntaxError:
- exec self.command in self.globals
+ exec(self.command in self.globals)
except:
if hasattr (sys, 'last_type') and sys.last_type == SystemExit:
console.quit()
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b8cc820..c7924e8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -361,6 +361,7 @@ gnucash/import-export/qif-imp/qif-parse.scm
gnucash/import-export/qif-imp/qif-to-gnc.scm
gnucash/import-export/qif-imp/qif-utils.scm
gnucash/import-export/qif-imp/string.scm
+gnucash/python/gncmod-python.c
gnucash/register/ledger-core/gncEntryLedger.c
gnucash/register/ledger-core/gncEntryLedgerControl.c
gnucash/register/ledger-core/gncEntryLedgerDisplay.c
commit ad7c14a5df22470e8254c00d3851ee0840ac2022
Merge: eb0256e 582265d
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Jul 7 13:05:35 2018 -0700
Partial merge of Chris Lam's maint-stress-tests into maint.
Merges he commits that aren't the stress-test.
commit 582265d0c6b3a499ca50a761633be02ad742c5cd
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Jul 5 19:37:41 2018 +0800
[job-report] Prevent Crash if there is no AR account
I think this crash is triggered because the 'account' variable
defaults to the first available AR account. If there's no AR account
it becomes null, and querying null's default book leads to segfault.
I guess I can fix segfault too by fixing gnc_account_get_book.
diff --git a/gnucash/report/business-reports/job-report.scm b/gnucash/report/business-reports/job-report.scm
index 40b2bbf..e58f5a3 100644
--- a/gnucash/report/business-reports/job-report.scm
+++ b/gnucash/report/business-reports/job-report.scm
@@ -541,7 +541,7 @@
(end-date (gnc:time64-end-day-time
(gnc:date-option-absolute-time
(opt-val gnc:pagename-general (N_ "To")))))
- (book (gnc-account-get-book account))
+ (book (gnc-get-current-book))
(date-format (gnc:options-fancy-date book))
(type (opt-val "__reg" "owner-type"))
(type-str "")
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index a114456..7920660 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -1015,6 +1015,7 @@ xaccInitAccount (Account * acc, QofBook *book)
QofBook *
gnc_account_get_book(const Account *account)
{
+ if (!account) return NULL;
return qof_instance_get_book(QOF_INSTANCE(account));
}
commit 0594beb08112c8fff19d198b505e85ed64bea8e5
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Jul 5 15:43:08 2018 +0800
Bug 779888 - Find Transaction by Value will not always find a split when commodities change
This commit changes the "Shares" find-text to "Amount". Thus, a
transfer from USD for 100USD -> 80GBP will be found if "Amount=80" or
"Amount=100" are chosen. A search for "Value=80" will not find
it. Perhaps the "Value" search option should be removed?
diff --git a/gnucash/gnome/dialog-find-transactions2.c b/gnucash/gnome/dialog-find-transactions2.c
index 93514bd..15b02da 100644
--- a/gnucash/gnome/dialog-find-transactions2.c
+++ b/gnucash/gnome/dialog-find-transactions2.c
@@ -121,7 +121,7 @@ gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
type, SPLIT_RECONCILE, NULL);
params = gnc_search_param_prepend (params, N_("Share Price"), NULL,
type, SPLIT_SHARE_PRICE, NULL);
- params = gnc_search_param_prepend (params, N_("Shares"), NULL,
+ params = gnc_search_param_prepend (params, N_("Amount"), NULL,
type, SPLIT_AMOUNT, NULL);
params = gnc_search_param_prepend (params, N_("Value"), NULL,
type, SPLIT_VALUE, NULL);
commit 5c8af37901bba6e8c8d7a0f0c97f840a25edba75
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Jul 2 08:58:05 2018 +0800
[tests] modify load-path to find the parent directory
Find the parent directory programmatically.
diff --git a/gnucash/report/business-reports/test/test-invoice.scm b/gnucash/report/business-reports/test/test-invoice.scm
index 3db7c4a..52159d6 100644
--- a/gnucash/report/business-reports/test/test-invoice.scm
+++ b/gnucash/report/business-reports/test/test-invoice.scm
@@ -26,7 +26,9 @@
(run-test-proper)))
(define (coverage-test tester)
- (add-to-load-path "/home/chris/sources/gnucash/gnucash/report/business-reports")
+ (let* ((currfile (dirname (current-filename)))
+ (path (string-take currfile (string-rindex currfile #\/))))
+ (add-to-load-path path))
(call-with-values
(lambda()
(with-code-coverage tester))
diff --git a/gnucash/report/standard-reports/test/test-transaction.scm b/gnucash/report/standard-reports/test/test-transaction.scm
index 56f6ffc..08be14d 100644
--- a/gnucash/report/standard-reports/test/test-transaction.scm
+++ b/gnucash/report/standard-reports/test/test-transaction.scm
@@ -50,11 +50,12 @@
(run-test-proper)))
(define (coverage-test)
- (define %test-vm (make-vm))
- (add-to-load-path "/home/chris/sources/gnucash/gnucash/report/standard-reports")
+ (let* ((currfile (dirname (current-filename)))
+ (path (string-take currfile (string-rindex currfile #\/))))
+ (add-to-load-path path))
(call-with-values
(lambda()
- (with-code-coverage %test-vm run-test-proper))
+ (with-code-coverage run-test-proper))
(lambda (data result)
(let ((port (open-output-file "/tmp/lcov.info")))
(coverage-data->lcov data port)
commit d12ee9a4fc50265bfa2aeb6561bff1006f2f134f
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sun Jul 1 15:38:15 2018 +0800
[commodity-utilities] prevent crash if end-date is #f
crash happens when (I think) no valid splits found.
diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 1328f1b..a6b8bbd 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -48,8 +48,9 @@
(xaccQueryAddAccountMatch query
currency-accounts
QOF-GUID-MATCH-ANY QOF-QUERY-AND)
- (xaccQueryAddDateMatchTT
- query #f end-date #t end-date QOF-QUERY-AND)
+ (if end-date
+ (xaccQueryAddDateMatchTT
+ query #f end-date #t end-date QOF-QUERY-AND))
;; Get the query result, i.e. all splits in currency
;; accounts.
commit eb0256e3e7e311cfc2ddb8d09343ebefa0405e44
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Jul 7 12:34:47 2018 -0700
Bug 796474 - Segmentation fault while setting up online banking
Allow only a single instance of the assistant.
diff --git a/gnucash/import-export/aqb/assistant-ab-initial.c b/gnucash/import-export/aqb/assistant-ab-initial.c
index 920a58d..4ce2bc2 100644
--- a/gnucash/import-export/aqb/assistant-ab-initial.c
+++ b/gnucash/import-export/aqb/assistant-ab-initial.c
@@ -90,6 +90,8 @@ void aai_match_page_prepare (GtkAssistant *assistant, gpointer user_data);
static gboolean banking_has_accounts(AB_BANKING *banking);
static void hash_from_kvp_acc_cb(Account *gnc_acc, gpointer user_data);
+static ABInitialInfo *single_info = NULL;
+
#if AQBANKING_VERSION_INT <= 49908
static void child_exit_cb(GPid pid, gint status, gpointer data);
#endif
@@ -178,6 +180,7 @@ void
aai_destroy_cb(GtkWidget *object, gpointer user_data)
{
ABInitialInfo *info = user_data;
+ g_return_if_fail (single_info && info == single_info);
gnc_unregister_gui_component_by_data(ASSISTANT_AB_INITIAL_CM_CLASS, info);
@@ -211,6 +214,7 @@ aai_destroy_cb(GtkWidget *object, gpointer user_data)
info->window = NULL;
g_free(info);
+ single_info = NULL;
}
void
@@ -845,16 +849,15 @@ void aai_on_prepare (GtkAssistant *assistant, GtkWidget *page,
}
}
-void
-gnc_ab_initial_assistant(void)
+static ABInitialInfo *
+gnc_ab_initial_assistant_new(void)
{
- ABInitialInfo *info;
GtkBuilder *builder;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
gint component_id;
- info = g_new0(ABInitialInfo, 1);
+ ABInitialInfo *info = g_new0(ABInitialInfo, 1);
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "assistant-ab-initial.glade", "aqbanking_init_assistant");
@@ -910,6 +913,14 @@ gnc_ab_initial_assistant(void)
NULL, aai_close_handler, info);
gnc_gui_component_set_session(component_id, gnc_get_current_session());
+ return info;
+}
- gtk_widget_show(info->window);
+void
+gnc_ab_initial_assistant(void)
+{
+ if (!single_info)
+ single_info = gnc_ab_initial_assistant_new();
+ gtk_widget_show(single_info->window);
}
+
commit 9d5712ef09f71199dd2c03c8aed92c095e0c8a59
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Jul 6 22:32:01 2018 +0200
Use same 'force' logic sequence for sqlite and other dbs
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index bbb0d97..c67e567 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -405,7 +405,9 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
if (create && file_exists)
{
- if (!force)
+ if (force)
+ g_unlink (filepath.c_str());
+ else
{
set_error (ERR_BACKEND_STORE_EXISTS);
auto msg = "Might clobber, no force";
@@ -413,8 +415,6 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
LEAVE("Error");
return;
}
- else
- g_unlink (filepath.c_str());
}
connect(nullptr);
commit 875781847a39113148f6ed9c3bab5fcc6d9e960b
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Jul 6 22:30:15 2018 +0200
Bug 796724 - Can't overwrite gnucash DB on MariaDB
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index e00c22e..bbb0d97 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -652,64 +652,80 @@ GncDbiBackend<Type>::session_begin (QofSession* session, const char* book_id,
LEAVE("Error");
return;
}
- if (create && !force && save_may_clobber_data (conn,
- uri.quote_dbname(Type)))
+ if (create && save_may_clobber_data (conn, uri.quote_dbname(Type)))
{
- set_error (ERR_BACKEND_STORE_EXISTS);
- PWARN ("Databse already exists, Might clobber it.");
- dbi_conn_close(conn);
- LEAVE("Error");
- return;
+ if (force)
+ {
+ // Drop DB
+ if (Type == DbType::DBI_PGSQL)
+ dbi_conn_select_db (conn, "template1");
+ else if (Type == DbType::DBI_MYSQL)
+ dbi_conn_select_db (conn, "mysql");
+ else
+ PWARN ("Unknown database type, don't know how to connect to a system database. Dropping existing database may fail.");
+
+ if (!dbi_conn_queryf (conn, "DROP DATABASE %s",
+ uri.quote_dbname(Type).c_str()))
+ PWARN ("Failed to drop database %s prior to recreating it. Creation will likely fail.",
+ uri.quote_dbname(Type).c_str());
+ }
+ else
+ {
+ set_error (ERR_BACKEND_STORE_EXISTS);
+ PWARN ("Databse already exists, Might clobber it.");
+ dbi_conn_close(conn);
+ LEAVE("Error");
+ return;
+ }
}
}
- else
+ else if (m_exists)
+ {
+ PERR ("Unable to connect to database '%s'\n", uri.dbname());
+ set_error (ERR_BACKEND_SERVER_ERR);
+ dbi_conn_close(conn);
+ LEAVE("Error");
+ return;
+ }
+ else if (!create)
{
+ PERR ("Database '%s' does not exist\n", uri.dbname());
+ set_error(ERR_BACKEND_NO_SUCH_DB);
+ std::string msg{"Database "};
+ set_message(msg + uri.dbname() + " not found");
+ LEAVE("Error");
+ return;
+ }
- if (m_exists)
+ if (create)
+ {
+ if (!create_database(conn, uri.quote_dbname(Type).c_str()))
{
- PERR ("Unable to connect to database '%s'\n", uri.dbname());
- set_error (ERR_BACKEND_SERVER_ERR);
dbi_conn_close(conn);
LEAVE("Error");
return;
}
-
- if (create)
+ conn = conn_setup(options, uri);
+ result = dbi_conn_connect (conn);
+ if (result < 0)
{
- if (!create_database(conn, uri.quote_dbname(Type).c_str()))
- {
- dbi_conn_close(conn);
- LEAVE("Error");
- return;
- }
- conn = conn_setup(options, uri);
- result = dbi_conn_connect (conn);
- if (result < 0)
- {
- PERR ("Unable to create database '%s'\n", uri.dbname());
- set_error (ERR_BACKEND_SERVER_ERR);
- dbi_conn_close(conn);
- LEAVE("Error");
- return;
- }
- if (Type == DbType::DBI_MYSQL)
- adjust_sql_options (conn);
- if (!conn_test_dbi_library(conn))
- {
- if (Type == DbType::DBI_PGSQL)
- dbi_conn_select_db (conn, "template1");
- dbi_conn_queryf (conn, "DROP DATABASE %s",
- uri.quote_dbname(Type).c_str());
- dbi_conn_close(conn);
- return;
- }
+ PERR ("Unable to create database '%s'\n", uri.dbname());
+ set_error (ERR_BACKEND_SERVER_ERR);
+ dbi_conn_close(conn);
+ LEAVE("Error");
+ return;
}
- else
+ if (Type == DbType::DBI_MYSQL)
+ adjust_sql_options (conn);
+ if (!conn_test_dbi_library(conn))
{
- set_error(ERR_BACKEND_NO_SUCH_DB);
- std::string msg{"Database "};
- set_message(msg + uri.dbname() + " not found");
+ if (Type == DbType::DBI_PGSQL)
+ dbi_conn_select_db (conn, "template1");
+ dbi_conn_queryf (conn, "DROP DATABASE %s",
+ uri.quote_dbname(Type).c_str());
+ dbi_conn_close(conn);
+ return;
}
}
commit f067e8328e7299a3eff81aec646878f0b82852fa
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Jul 6 22:00:08 2018 +0200
Allow saving to xml over an existing sqlite3 file and the other way around
A type check on the pre-existing file was preventing this. The type check however
only makes sense when opening files, not when overwriting.
diff --git a/libgnucash/engine/qofsession.cpp b/libgnucash/engine/qofsession.cpp
index fbebf26..0c57736 100644
--- a/libgnucash/engine/qofsession.cpp
+++ b/libgnucash/engine/qofsession.cpp
@@ -180,7 +180,9 @@ QofSessionImpl::load_backend (std::string access_method) noexcept
continue;
}
PINFO (" Selected provider %s", prov->provider_name);
- if (!prov->type_check (m_book_id.c_str ()))
+ // Only do a type check when trying to open an existing file
+ // When saving over an existing file the contents of the original file don't matter
+ if (!m_creating && !prov->type_check (m_book_id.c_str ()))
{
PINFO("Provider, %s, reported not being usable for book, %s.",
prov->provider_name, m_book_id.c_str ());
@@ -303,6 +305,7 @@ QofSessionImpl::begin (std::string new_book_id, bool ignore_lock,
destroy_backend ();
/* Store the session URL */
m_book_id = new_book_id;
+ m_creating = create;
if (filename)
load_backend ("file");
else /* access method found, load appropriate backend */
@@ -481,7 +484,7 @@ QofSessionImpl::save (QofPercentageFunc percentage_func) noexcept
}
else
{
- push_error (ERR_BACKEND_NO_HANDLER, "failod to load backend");
+ push_error (ERR_BACKEND_NO_HANDLER, "failed to load backend");
LEAVE("error -- No backend!");
}
m_saving = false;
diff --git a/libgnucash/engine/qofsession.hpp b/libgnucash/engine/qofsession.hpp
index 57a2425..7820e08 100644
--- a/libgnucash/engine/qofsession.hpp
+++ b/libgnucash/engine/qofsession.hpp
@@ -95,6 +95,7 @@ private:
std::string m_book_id;
bool m_saving;
+ bool m_creating;
/* If any book subroutine failed, this records the failure reason
* (file not found, etc).
commit 49bd9c41c4fc0f2635a0164f36d5651c645d34fd
Author: Geert Janssens <geert at kobaltwit.be>
Date: Fri Jul 6 21:24:44 2018 +0200
Rename confusing directory
diff --git a/contrib/art/gnucash-bugzilla-favicon/android-chrome-192x192.png b/contrib/art/gnucash-bugzilla-favicons/android-chrome-192x192.png
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/android-chrome-192x192.png
rename to contrib/art/gnucash-bugzilla-favicons/android-chrome-192x192.png
diff --git a/contrib/art/gnucash-bugzilla-favicon/android-chrome-512x512.png b/contrib/art/gnucash-bugzilla-favicons/android-chrome-512x512.png
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/android-chrome-512x512.png
rename to contrib/art/gnucash-bugzilla-favicons/android-chrome-512x512.png
diff --git a/contrib/art/gnucash-bugzilla-favicon/apple-touch-icon.png b/contrib/art/gnucash-bugzilla-favicons/apple-touch-icon.png
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/apple-touch-icon.png
rename to contrib/art/gnucash-bugzilla-favicons/apple-touch-icon.png
diff --git a/contrib/art/gnucash-bugzilla-favicon/browserconfig.xml b/contrib/art/gnucash-bugzilla-favicons/browserconfig.xml
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/browserconfig.xml
rename to contrib/art/gnucash-bugzilla-favicons/browserconfig.xml
diff --git a/contrib/art/gnucash-bugzilla-favicon/favicon-16x16.png b/contrib/art/gnucash-bugzilla-favicons/favicon-16x16.png
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/favicon-16x16.png
rename to contrib/art/gnucash-bugzilla-favicons/favicon-16x16.png
diff --git a/contrib/art/gnucash-bugzilla-favicon/favicon-32x32.png b/contrib/art/gnucash-bugzilla-favicons/favicon-32x32.png
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/favicon-32x32.png
rename to contrib/art/gnucash-bugzilla-favicons/favicon-32x32.png
diff --git a/contrib/art/gnucash-bugzilla-favicon/favicon.ico b/contrib/art/gnucash-bugzilla-favicons/favicon.ico
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/favicon.ico
rename to contrib/art/gnucash-bugzilla-favicons/favicon.ico
diff --git a/contrib/art/gnucash-bugzilla-favicon/mstile-150x150.png b/contrib/art/gnucash-bugzilla-favicons/mstile-150x150.png
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/mstile-150x150.png
rename to contrib/art/gnucash-bugzilla-favicons/mstile-150x150.png
diff --git a/contrib/art/gnucash-bugzilla-favicon/safari-pinned-tab.svg b/contrib/art/gnucash-bugzilla-favicons/safari-pinned-tab.svg
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/safari-pinned-tab.svg
rename to contrib/art/gnucash-bugzilla-favicons/safari-pinned-tab.svg
diff --git a/contrib/art/gnucash-bugzilla-favicon/site.webmanifest b/contrib/art/gnucash-bugzilla-favicons/site.webmanifest
similarity index 100%
rename from contrib/art/gnucash-bugzilla-favicon/site.webmanifest
rename to contrib/art/gnucash-bugzilla-favicons/site.webmanifest
commit 9ab06bc9b3acc71e5e8423a6aa7278c0b83e3991
Author: Geert Janssens <geert at kobaltwit.be>
Date: Thu Jul 5 22:29:16 2018 +0200
Bug 789594 - Unable to overwrite sqlite3 database file
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index b2e4ab6..e00c22e 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -403,13 +403,18 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
return;
}
- if (create && !force && file_exists)
+ if (create && file_exists)
{
- set_error (ERR_BACKEND_STORE_EXISTS);
- auto msg = "Might clobber, no force";
- PWARN ("%s", msg);
- LEAVE("Error");
- return;
+ if (!force)
+ {
+ set_error (ERR_BACKEND_STORE_EXISTS);
+ auto msg = "Might clobber, no force";
+ PWARN ("%s", msg);
+ LEAVE("Error");
+ return;
+ }
+ else
+ g_unlink (filepath.c_str());
}
connect(nullptr);
commit 240c4bd2cff9195a7dbdbcd8dba573bea236b3da
Author: Geert Janssens <geert at kobaltwit.be>
Date: Thu Jul 5 16:01:20 2018 +0200
Whitespace cosmetics
diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index 4017066..b2e4ab6 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -160,16 +160,15 @@ UriStrings::UriStrings(const std::string& uri)
m_host = std::string{host};
m_dbname = std::string{dbname};
if (username)
- m_username = std::string{username};
+ m_username = std::string{username};
if (password)
- m_password = std::string{password};
+ m_password = std::string{password};
m_portnum = portnum;
g_free(protocol);
g_free(host);
g_free(username);
g_free(password);
g_free(dbname);
-
}
std::string
@@ -275,7 +274,7 @@ GncDbiBackend<Type>::conn_setup (PairVec& options, UriStrings& uri)
{
PERR ("Unable to create %s dbi connection", dbstr);
set_error (ERR_BACKEND_BAD_URL);
- return nullptr;
+ return nullptr;
}
dbi_conn_error_handler (conn, error_handler<Type>, this);
@@ -401,7 +400,7 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
set_message (msg + filepath + " not found");
PWARN ("Sqlite3 file %s not found", filepath.c_str());
LEAVE("Error");
- return;
+ return;
}
if (create && !force && file_exists)
@@ -410,7 +409,7 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
auto msg = "Might clobber, no force";
PWARN ("%s", msg);
LEAVE("Error");
- return;
+ return;
}
connect(nullptr);
@@ -438,7 +437,7 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
PERR ("Unable to connect to %s: %d\n", book_id, result);
set_error (ERR_BACKEND_BAD_URL);
LEAVE("Error");
- return;
+ return;
}
if (!conn_test_dbi_library(conn))
@@ -570,10 +569,10 @@ adjust_sql_options (dbi_conn connection)
{
const char* errmsg;
int err = dbi_conn_error(connection, &errmsg);
- if (err)
- PERR("Unable to get sql_mode %d : %s", err, errmsg);
- else
- PINFO("Sql_mode isn't set.");
+ if (err)
+ PERR("Unable to get sql_mode %d : %s", err, errmsg);
+ else
+ PINFO("Sql_mode isn't set.");
return;
}
PINFO("Initial sql_mode: %s", str.c_str());
commit 04424b62b8d87c8139b7c7318602ce807e91bda8
Author: Geert Janssens <geert at kobaltwit.be>
Date: Thu Jul 5 22:38:42 2018 +0200
Add logo and favicon for gnucash bugzilla site
The logo is a blend of the gnucash tango icon with bugzilla's mascotte Buggie.
The favicon and assorted files has been generated from the logo via
https://realfavicongenerator.net
That site offers a more complete solution than just a simple favicon, when time
permits we may want to implement a more complete favicon handling on our websites
based on recommendations found there.
diff --git a/contrib/art/gnucash-bugzilla-favicon/android-chrome-192x192.png b/contrib/art/gnucash-bugzilla-favicon/android-chrome-192x192.png
new file mode 100644
index 0000000..300162a
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/android-chrome-192x192.png differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/android-chrome-512x512.png b/contrib/art/gnucash-bugzilla-favicon/android-chrome-512x512.png
new file mode 100644
index 0000000..a74a0ab
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/android-chrome-512x512.png differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/apple-touch-icon.png b/contrib/art/gnucash-bugzilla-favicon/apple-touch-icon.png
new file mode 100644
index 0000000..bad01b8
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/apple-touch-icon.png differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/browserconfig.xml b/contrib/art/gnucash-bugzilla-favicon/browserconfig.xml
new file mode 100644
index 0000000..eeb397f
--- /dev/null
+++ b/contrib/art/gnucash-bugzilla-favicon/browserconfig.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<browserconfig>
+ <msapplication>
+ <tile>
+ <square150x150logo src="/mstile-150x150.png"/>
+ <TileColor>#00a300</TileColor>
+ </tile>
+ </msapplication>
+</browserconfig>
diff --git a/contrib/art/gnucash-bugzilla-favicon/favicon-16x16.png b/contrib/art/gnucash-bugzilla-favicon/favicon-16x16.png
new file mode 100644
index 0000000..39cccff
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/favicon-16x16.png differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/favicon-32x32.png b/contrib/art/gnucash-bugzilla-favicon/favicon-32x32.png
new file mode 100644
index 0000000..f71bf5d
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/favicon-32x32.png differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/favicon.ico b/contrib/art/gnucash-bugzilla-favicon/favicon.ico
new file mode 100644
index 0000000..6c7f35f
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/favicon.ico differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/mstile-150x150.png b/contrib/art/gnucash-bugzilla-favicon/mstile-150x150.png
new file mode 100644
index 0000000..48b4437
Binary files /dev/null and b/contrib/art/gnucash-bugzilla-favicon/mstile-150x150.png differ
diff --git a/contrib/art/gnucash-bugzilla-favicon/safari-pinned-tab.svg b/contrib/art/gnucash-bugzilla-favicon/safari-pinned-tab.svg
new file mode 100644
index 0000000..57f0894
--- /dev/null
+++ b/contrib/art/gnucash-bugzilla-favicon/safari-pinned-tab.svg
@@ -0,0 +1,116 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
+ width="736.000000pt" height="736.000000pt" viewBox="0 0 736.000000 736.000000"
+ preserveAspectRatio="xMidYMid meet">
+<metadata>
+Created by potrace 1.11, written by Peter Selinger 2001-2013
+</metadata>
+<g transform="translate(0.000000,736.000000) scale(0.100000,-0.100000)"
+fill="#000000" stroke="none">
+<path d="M2327 7350 c-208 -37 -443 -161 -643 -338 l-89 -78 -100 -17 c-253
+-42 -452 -126 -628 -266 -220 -175 -378 -463 -418 -758 -18 -139 -7 -232 56
+-463 168 -615 261 -1084 310 -1570 22 -210 45 -595 45 -742 l0 -127 -81 -3
+-82 -3 -210 -447 c-123 -261 -216 -448 -224 -448 -8 0 -13 -12 -13 -30 0 -17
+-9 -48 -20 -70 -25 -48 -25 -50 0 -50 20 0 20 -7 20 -450 l0 -450 295 0 295 0
+0 -197 c0 -109 3 -275 7 -369 l6 -171 981 -5 c540 -3 1378 -3 1864 0 l882 5 0
+444 c0 387 2 443 15 443 19 0 19 7 0 60 -8 23 -15 55 -15 70 0 16 -4 30 -9 32
+-5 2 -18 33 -29 71 l-20 67 102 0 101 0 19 -62 c23 -79 23 -102 1 -158 -20
+-53 -16 -130 10 -181 17 -31 17 -35 -5 -96 -28 -79 -23 -147 15 -223 159 -314
+892 -426 1342 -205 149 73 239 170 263 281 l11 52 82 7 c117 10 295 57 393
+105 101 49 201 138 238 213 32 62 35 157 7 227 -16 43 -16 47 1 88 26 58 25
+148 -1 206 l-20 46 21 46 c27 62 27 147 -1 209 -20 45 -20 48 -3 78 24 45 24
+189 0 234 -17 30 -17 33 3 78 27 60 27 149 1 209 -13 28 -17 48 -11 57 35 54
+40 177 10 244 -20 45 -20 46 -1 88 12 26 20 64 20 102 0 38 -8 76 -20 102 -19
+42 -19 43 1 88 30 67 25 190 -10 244 -6 9 -2 29 10 57 30 66 26 170 -7 236
+-12 23 -11 32 6 70 23 51 25 135 6 191 -58 162 -290 298 -577 337 -46 6 -99
+14 -116 16 l-33 5 0 1002 c0 608 -4 1026 -10 1062 -22 134 -111 250 -230 298
+l-55 22 -1117 3 -1118 2 -60 90 c-78 116 -169 213 -227 241 -44 21 -47 21
+-124 6 -98 -19 -168 -51 -238 -108 -29 -24 -59 -48 -67 -53 -9 -7 -33 9 -86
+60 -117 111 -258 193 -393 229 -70 19 -259 28 -328 15z m306 -97 c230 -56 436
+-239 659 -583 143 -220 258 -446 365 -715 30 -77 59 -144 64 -149 11 -13 -37
+161 -81 289 -21 60 -37 111 -35 113 8 8 541 -313 790 -476 339 -222 575 -423
+713 -611 71 -95 154 -258 178 -346 30 -111 14 -273 -39 -405 -119 -294 -424
+-511 -891 -634 -117 -31 -277 -61 -441 -82 -151 -20 -557 -24 -994 -11 l-275
+9 -65 33 c-219 109 -502 156 -815 135 -81 -5 -156 -15 -167 -20 -10 -6 -19
+-21 -19 -33 l0 -23 263 1 c239 0 271 -2 366 -23 112 -25 271 -79 271 -92 0 -4
+-21 -10 -47 -13 -85 -10 -226 -56 -323 -104 -232 -116 -355 -323 -349 -592 2
+-110 0 -112 -108 -163 -89 -42 -214 -49 -333 -19 -100 25 -248 95 -307 146
+l-43 37 0 141 c0 299 -37 787 -86 1121 -60 418 -113 660 -299 1365 -50 190
+-47 317 11 508 90 298 307 542 591 662 71 31 233 81 260 81 8 0 -20 -40 -64
+-91 -97 -113 -213 -261 -213 -273 0 -5 75 65 168 155 273 267 418 391 573 492
+261 169 499 226 722 170z m949 -202 c107 -110 270 -384 372 -624 50 -117 109
+-281 121 -336 l7 -35 -28 19 c-16 11 -139 83 -273 162 l-244 142 -87 168 c-80
+157 -153 276 -223 366 -29 37 -29 38 -11 58 39 43 121 95 184 116 102 35 115
+32 182 -36z m2993 -2745 c191 -42 308 -101 363 -181 81 -119 9 -238 -189 -315
+-162 -62 -377 -89 -570 -70 -410 39 -633 203 -520 381 57 91 222 165 446 199
+89 13 387 5 470 -14z m-766 -637 c182 -69 418 -99 614 -80 181 17 318 53 442
+115 l105 53 0 -29 c0 -98 -138 -196 -355 -255 -92 -24 -116 -26 -300 -27 -206
+-1 -257 5 -385 46 -151 48 -270 134 -290 210 -6 21 -8 43 -5 47 3 5 31 -6 62
+-25 31 -19 82 -43 112 -55z m-39 -280 c154 -70 327 -102 535 -102 238 0 415
+39 583 128 l82 44 0 -33 c0 -98 -162 -208 -378 -257 -115 -26 -331 -35 -456
+-20 -252 32 -447 129 -492 246 -23 60 -12 71 39 39 23 -14 62 -34 87 -45z
+m-49 -273 c166 -87 347 -127 585 -127 234 0 419 40 582 126 l82 44 0 -33 c0
+-45 -45 -104 -111 -148 -251 -165 -729 -185 -1035 -44 -113 53 -194 139 -194
+206 0 11 2 20 4 20 2 0 41 -20 87 -44z m-51 -272 c0 -2 -9 -4 -21 -4 -11 0
+-18 4 -14 10 5 8 35 3 35 -6z m1300 -14 c0 -127 -228 -250 -521 -281 l-111
+-13 -35 43 c-20 23 -56 57 -81 76 l-45 35 134 0 c243 0 476 57 614 149 41 27
+45 26 45 -9z m-4576 -277 c31 -159 56 -294 56 -300 0 -10 -59 -13 -260 -13
+-201 0 -260 3 -260 13 0 25 98 566 105 576 4 7 61 11 154 11 l149 0 56 -287z
+m-1433 225 c35 -25 75 -51 87 -57 13 -7 21 -15 18 -18 -3 -4 -47 -9 -98 -12
+l-91 -6 -81 -162 c-45 -88 -87 -168 -94 -176 -7 -8 -15 -24 -17 -35 -2 -12 -9
+-30 -15 -42 -6 -12 -9 -24 -6 -27 3 -3 113 -6 245 -6 l239 0 -10 -31 c-5 -17
+-14 -48 -20 -68 l-10 -38 -324 0 c-178 0 -324 2 -324 4 0 5 174 379 277 596
+l59 125 51 -1 c43 -1 61 -8 114 -46z m2744 17 c3 -16 21 -133 40 -260 19 -126
+37 -242 40 -257 l5 -28 -70 0 c-73 0 -84 6 -50 28 37 23 17 77 -37 97 -1 0
+-12 68 -24 150 -12 83 -25 154 -29 159 -5 4 -242 8 -529 7 l-521 -1 -5 22 c-3
+13 -9 43 -13 68 l-8 45 598 0 598 0 5 -30z m-1859 -90 c-3 -9 -19 -15 -38 -15
+l-32 0 34 25 c34 25 48 21 36 -10z m3991 -44 c200 -43 322 -112 369 -207 25
+-51 26 -58 14 -96 -25 -85 -94 -144 -225 -193 -220 -83 -520 -96 -775 -34
+-429 105 -456 382 -50 504 67 20 121 30 255 49 70 10 324 -5 412 -23z m1133
+-134 c0 -91 -147 -196 -347 -246 -82 -21 -271 -46 -280 -38 -2 3 0 14 6 25 6
+11 16 42 21 69 l11 49 102 12 c171 20 378 87 452 145 29 24 35 21 35 -16z m0
+-292 c0 -36 -22 -74 -67 -116 -94 -88 -250 -145 -467 -169 -50 -5 -91 -8 -93
+-7 -1 2 6 27 17 55 11 29 20 60 20 71 0 15 14 20 98 30 171 21 333 70 432 132
+55 35 60 35 60 4z m-750 -175 c-55 -205 -584 -327 -982 -226 -201 51 -348 157
+-348 251 0 15 3 25 8 23 198 -101 311 -138 485 -157 288 -32 593 20 778 133
+30 18 58 30 62 26 5 -4 3 -26 -3 -50z m-3212 -335 l74 -360 5 -235 c3 -129 2
+-293 -2 -365 l-7 -130 -291 5 -292 5 -3 328 -2 328 60 342 c33 188 65 366 71
+395 l11 53 151 -3 152 -3 73 -360z m-550 308 c-6 -27 -11 -57 -13 -68 -4 -20
+-12 -20 -537 -20 l-532 0 -72 -220 c-39 -121 -70 -223 -67 -227 2 -5 256 -8
+564 -8 529 0 560 -1 556 -17 -3 -10 -8 -39 -12 -65 l-6 -48 -645 0 c-354 0
+-644 3 -644 8 0 4 14 50 31 102 60 188 190 585 194 598 3 9 132 12 598 12
+l594 0 -9 -47z m1734 -40 c33 -111 83 -273 146 -475 l50 -158 -572 0 -573 0
+-11 51 c-7 28 -12 57 -12 65 0 12 71 14 486 13 267 0 488 2 491 5 3 3 -25 106
+-63 228 l-70 223 -214 2 c-118 1 -330 2 -471 2 l-256 1 -7 43 c-3 23 -9 52
+-12 65 l-6 22 534 0 534 0 26 -87z m2752 -134 c-71 -103 -281 -189 -507 -207
+-86 -7 -97 -6 -91 8 4 8 14 41 22 72 l15 57 46 6 c227 27 420 86 516 158 19
+15 20 14 23 -20 2 -25 -4 -46 -24 -74z m-1857 -139 c338 -123 812 -95 1076 64
+l57 35 0 -30 c0 -115 -186 -229 -444 -274 -166 -28 -436 -15 -576 29 -171 53
+-288 135 -311 219 -5 20 -7 42 -4 47 3 5 31 -7 63 -26 32 -18 95 -47 139 -64z
+m1883 -91 c0 -36 -6 -47 -57 -98 -97 -96 -281 -165 -480 -178 l-92 -6 19 52
+c11 28 20 60 20 70 0 16 9 21 48 25 229 28 424 88 517 160 11 8 21 16 23 16 1
+0 2 -18 2 -41z m-1855 -218 c341 -114 798 -80 1051 78 27 16 53 26 57 22 5 -5
+4 -26 -2 -48 -21 -76 -139 -162 -288 -211 -186 -61 -493 -69 -688 -18 -217 57
+-355 156 -355 255 l0 29 68 -38 c37 -22 108 -53 157 -69z m1828 -145 c-77
+-109 -280 -192 -520 -212 l-82 -7 19 52 c11 28 20 60 20 70 0 23 19 31 72 31
+111 0 354 71 458 133 l55 33 3 -29 c2 -21 -6 -43 -25 -71z m-1932 -112 c240
+-116 622 -142 918 -63 89 24 197 69 248 103 20 14 41 22 45 18 17 -17 -6 -75
+-48 -121 -105 -117 -346 -191 -620 -191 -351 0 -664 137 -664 290 l0 32 36
+-22 c19 -13 58 -33 85 -46z m127 -348 c124 -39 259 -57 418 -58 162 0 199 4
+347 39 74 17 139 41 212 77 l105 53 0 -30 c0 -123 -227 -243 -521 -278 -382
+-44 -809 104 -809 280 l0 30 83 -44 c45 -24 120 -55 165 -69z"/>
+<path d="M2326 6911 c-12 -19 18 -38 80 -51 235 -49 472 -293 675 -696 109
+-216 179 -440 179 -569 0 -161 -133 -300 -360 -375 -128 -43 -204 -53 -364
+-48 -133 4 -148 7 -258 45 -65 22 -118 36 -118 32 0 -5 -7 -9 -15 -9 -55 0 33
+-56 147 -94 258 -87 602 -41 828 109 213 142 249 310 139 650 -41 127 -147
+354 -219 470 -205 329 -440 530 -635 543 -48 3 -75 1 -79 -7z"/>
+<path d="M2425 6791 c-95 -24 -196 -116 -255 -233 -50 -101 -64 -169 -58 -293
+6 -109 25 -172 80 -258 69 -108 189 -146 300 -95 115 54 221 203 254 359 47
+220 -63 478 -221 518 -48 12 -56 12 -100 2z m68 -169 c24 -21 23 -114 -2 -167
+-22 -47 -64 -89 -105 -105 -25 -9 -34 -8 -55 8 -21 16 -27 29 -29 73 -4 66 18
+125 62 168 33 32 82 53 101 43 6 -3 18 -12 28 -20z m-33 -507 c17 -21 6 -43
+-26 -51 -31 -8 -57 5 -62 31 -7 34 63 50 88 20z"/>
+</g>
+</svg>
diff --git a/contrib/art/gnucash-bugzilla-favicon/site.webmanifest b/contrib/art/gnucash-bugzilla-favicon/site.webmanifest
new file mode 100644
index 0000000..b20abb7
--- /dev/null
+++ b/contrib/art/gnucash-bugzilla-favicon/site.webmanifest
@@ -0,0 +1,19 @@
+{
+ "name": "",
+ "short_name": "",
+ "icons": [
+ {
+ "src": "/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/android-chrome-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/contrib/art/gnucash-bugzilla-logo.svg b/contrib/art/gnucash-bugzilla-logo.svg
new file mode 100644
index 0000000..096c663
--- /dev/null
+++ b/contrib/art/gnucash-bugzilla-logo.svg
@@ -0,0 +1,650 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="12.700011mm"
+ height="13.039525mm"
+ viewBox="0 0 12.700011 13.039525"
+ version="1.1"
+ id="svg13834"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="gnucash-bz-13.svg">
+ <defs
+ id="defs13828">
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3642"
+ id="linearGradient13722"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.5370421,0,0,0.5370421,169.41495,47.978788)"
+ x1="41.975975"
+ y1="88.198303"
+ x2="34.957966"
+ y2="96.023994" />
+ <linearGradient
+ id="linearGradient3642">
+ <stop
+ offset="0"
+ style="stop-color:#f6daaa;stop-opacity:1"
+ id="stop3644" />
+ <stop
+ offset="1"
+ style="stop-color:#e4bc98;stop-opacity:1"
+ id="stop3646" />
+ </linearGradient>
+ <radialGradient
+ gradientTransform="matrix(-0.84668765,0,0,0.84668765,194.10708,26.04381)"
+ gradientUnits="userSpaceOnUse"
+ xlink:href="#linearGradient2630"
+ id="radialGradient3919-58-3-3-6"
+ fy="69.120766"
+ fx="79.978813"
+ r="5.2966104"
+ cy="69.120766"
+ cx="79.978813" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2630">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop2632" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop2634" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3666"
+ id="linearGradient13724"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(-0.5370421,0,0,0.5370421,169.41495,47.978788)"
+ x1="53.223339"
+ y1="51.557507"
+ x2="50.293129"
+ y2="51.232285" />
+ <linearGradient
+ id="linearGradient3666">
+ <stop
+ offset="0"
+ style="stop-color:#363433;stop-opacity:1"
+ id="stop3668" />
+ <stop
+ offset="1"
+ style="stop-color:#363433;stop-opacity:0"
+ id="stop3670" />
+ </linearGradient>
+ <radialGradient
+ gradientTransform="matrix(-0.31499451,0.1576395,0.64123279,1.2813083,119.13845,-12.289775)"
+ gradientUnits="userSpaceOnUse"
+ xlink:href="#linearGradient3703"
+ id="radialGradient3711-0-9-7-8"
+ fy="66.878647"
+ fx="31.249113"
+ r="9.7896147"
+ cy="66.878647"
+ cx="31.249113" />
+ <linearGradient
+ id="linearGradient3703">
+ <stop
+ offset="0"
+ style="stop-color:#e4bc98;stop-opacity:1"
+ id="stop3705" />
+ <stop
+ offset="1"
+ style="stop-color:#f6daaa;stop-opacity:0"
+ id="stop3707" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2707"
+ id="linearGradient2493"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.26458333,0,0,0.22048602,-144.68929,144.63747)"
+ x1="18"
+ y1="39"
+ x2="18"
+ y2="45.780262" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient2707">
+ <stop
+ style="stop-color:#eeeeec;stop-opacity:1;"
+ offset="0"
+ id="stop2709" />
+ <stop
+ style="stop-color:#eeeeec;stop-opacity:0;"
+ offset="1"
+ id="stop2711" />
+ </linearGradient>
+ <radialGradient
+ r="21.030567"
+ fy="40.604275"
+ fx="17.984474"
+ cy="40.604275"
+ cx="17.984474"
+ gradientTransform="matrix(0.33630811,0,0,0.11910892,-144.61555,148.14083)"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient2596-7"
+ xlink:href="#linearGradient2300"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient2300"
+ inkscape:collect="always">
+ <stop
+ id="stop2302"
+ offset="0"
+ style="stop-color:#555753;stop-opacity:1;" />
+ <stop
+ id="stop2304"
+ offset="1"
+ style="stop-color:#555753;stop-opacity:0;" />
+ </linearGradient>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="23.999997"
+ inkscape:cy="24.641642"
+ inkscape:document-units="mm"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:window-width="1920"
+ inkscape:window-height="1141"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata13831">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Laag 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(144.68928,-142.31358)">
+ <ellipse
+ ry="2.2489598"
+ rx="6.3500056"
+ cy="153.10414"
+ cx="-138.33928"
+ style="opacity:0.5;fill:url(#radialGradient2596-7);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.2582255;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2290-5" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="152.97269"
+ cx="-133.70232"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#786100;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2773-9" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="152.97269"
+ cx="-133.70296"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2775-9" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="152.44522"
+ cx="-133.69977"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2777-1" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="152.44522"
+ cx="-133.70039"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2779-4" />
+ <rect
+ style="opacity:1;fill:#bd9dca;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect1354-9"
+ width="9.2713051"
+ height="9.259263"
+ x="-142.97673"
+ y="143.31499"
+ rx="0.52916676"
+ ry="0.52916723" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="151.91606"
+ cx="-133.69977"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2781-1" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="151.91606"
+ cx="-133.70039"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2783-7" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="151.38559"
+ cx="-133.70309"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2785-8" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="151.38519"
+ cx="-133.70039"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2787-8" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="153.76474"
+ cx="-135.02779"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#786100;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2413-5" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="150.85603"
+ cx="-133.69977"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2789-2" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="153.76474"
+ cx="-135.02841"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2415-0" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="153.23727"
+ cx="-135.02524"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2417-8" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="150.85603"
+ cx="-133.70039"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2791-3" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="153.23727"
+ cx="-135.02586"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2419-8" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="152.70811"
+ cx="-135.02524"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2421-0" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="150.32816"
+ cx="-133.69977"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2797-4" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="152.70811"
+ cx="-135.02586"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2423-9" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="152.17764"
+ cx="-135.02856"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2425-1" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="152.17725"
+ cx="-135.02586"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2427-9" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="149.79768"
+ cx="-133.70309"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2799-6" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="151.64807"
+ cx="-135.02524"
+ style="opacity:1;fill:#ecd300;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2429-2" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="151.64807"
+ cx="-135.02586"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2431-5" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="149.26813"
+ cx="-133.69977"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2801-7" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="148.73897"
+ cx="-133.69977"
+ style="opacity:1;fill:#edd400;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2809-4" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="148.20889"
+ cx="-133.70486"
+ style="opacity:1;fill:#fce94f;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2793-3" />
+ <ellipse
+ ry="0.66100538"
+ rx="1.323804"
+ cy="151.11891"
+ cx="-135.03033"
+ style="opacity:1;fill:#fce94f;fill-opacity:1;fill-rule:evenodd;stroke:#8c7200;stroke-width:0.2645835;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2761-1" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="151.11891"
+ cx="-135.03096"
+ style="opacity:0.5;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2763-4" />
+ <ellipse
+ ry="0.39602426"
+ rx="1.0593644"
+ cy="148.20848"
+ cx="-133.70757"
+ style="opacity:0.5;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458344;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2795-6" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#4e9a06;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458326;stroke-miterlimit:4;stroke-opacity:1"
+ d="m -144.29246,151.77833 h 6.35009 v 1.59417 h -6.35009 z"
+ id="path2321-4" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#59af05;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m -143.54473,150.1939 h 5.36355 l 0.23876,1.59 h -6.35 z"
+ id="path2323-2"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2325-9"
+ width="6.0854168"
+ height="0.26458332"
+ x="-144.1601"
+ y="152.71696" />
+ <rect
+ style="fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2327-6"
+ width="6.0854168"
+ height="0.26458332"
+ x="-144.1601"
+ y="152.18779" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:0.25;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m -143.38288,150.4721 -0.5209,1.04179 h 5.6472 l -0.1571,-1.04179 z"
+ id="path2329-1"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="fill:#eeeeec;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2341-0"
+ width="1.3063309"
+ height="1.6164331"
+ x="-141.63829"
+ y="151.77435" />
+ <ellipse
+ ry="0.39687485"
+ rx="1.3229171"
+ cy="150.98747"
+ cx="-140.98512"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14314005;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2746-4" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m -141.382,150.19258 -0.26458,1.4915 v 1.68577 h 1.32291 v -1.70004 l -0.28938,-1.47723 z"
+ id="path2715-2"
+ sodipodi:nodetypes="ccccccc" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="150.72289"
+ cx="-139.00075"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2752-5" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="151.25204"
+ cx="-138.73616"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2750-3" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#4e9a06;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458323;stroke-miterlimit:4;stroke-opacity:1"
+ d="m -143.23634,153.09648 h 6.35225 v 1.59784 h -6.35225 z"
+ id="rect2271-2" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#57ae06;fill-opacity:1;fill-rule:evenodd;stroke:#2e5c02;stroke-width:0.26458323;stroke-miterlimit:4;stroke-opacity:1"
+ d="m -142.71793,151.51796 h 5.34688 l 0.4868,1.58591 h -6.34984 z"
+ id="path3816-5"
+ sodipodi:nodetypes="ccccc" />
+ <rect
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2441-9"
+ width="6.0854168"
+ height="0.26458332"
+ x="-143.10179"
+ y="154.03017" />
+ <rect
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2443-2"
+ width="6.0854173"
+ height="0.26458332"
+ x="-143.10179"
+ y="153.50101" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:0.25;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332;stroke-miterlimit:4;stroke-opacity:1"
+ d="m -142.51475,151.78948 -0.33899,1.0418 h 5.59759 l -0.32246,-1.0418 z"
+ id="path2269-0" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.26458266"
+ cy="151.51254"
+ cx="-142.05171"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.03695855;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2267-4" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.26458266"
+ cy="151.51254"
+ cx="-138.08296"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.03695855;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3843-4" />
+ <ellipse
+ ry="0.39687485"
+ rx="1.3229152"
+ cy="152.31038"
+ cx="-139.92679"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14313994;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3837-9" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.40100399"
+ cy="152.57088"
+ cx="-142.17989"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0454997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3839-9" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="152.57497"
+ cx="-137.94241"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3841-3" />
+ <path
+ inkscape:connector-curvature="0"
+ style="opacity:1;fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:0.26458338;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m -140.32367,151.52227 -0.26458,1.48834 v 1.6822 h 1.32292 v -1.69644 l -0.28939,-1.4741 z"
+ id="rect1372-6"
+ sodipodi:nodetypes="ccccccc" />
+ <rect
+ style="opacity:1;fill:#888a85;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2721-0"
+ width="1.0583333"
+ height="1.3229166"
+ x="-140.45596"
+ y="153.23642" />
+ <rect
+ style="opacity:1;fill:url(#linearGradient2493);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect2673-5"
+ width="1.0583333"
+ height="1.3229166"
+ x="-140.45596"
+ y="153.23642" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="152.04581"
+ cx="-138.207"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2691-0" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="152.04581"
+ cx="-141.91116"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2693-2" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.40100399"
+ cy="151.25204"
+ cx="-143.23822"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.0454997;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2748-4" />
+ <ellipse
+ ry="0.13229162"
+ rx="0.39687493"
+ cy="150.72289"
+ cx="-142.9695"
+ style="opacity:1;fill:#2e5c02;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.04526485;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2754-1" />
+ <g
+ id="g4143-0-8"
+ transform="matrix(-0.26458333,0,0,0.26458333,-103.28483,123.84249)">
+ <ellipse
+ transform="scale(-1,1)"
+ ry="1.8320673"
+ rx="7.3947349"
+ cy="91.328331"
+ cx="-133.12331"
+ id="path3781-3-8-3-4"
+ style="opacity:0.6;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.23187578;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <path
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#f6daaa;fill-opacity:1;fill-rule:nonzero;stroke:#363433;stroke-width:0.69815475;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+ id="path3606-38-9-5-4"
+ d="m 129.27191,79.197206 c -0.10999,6.514195 7.97163,-2.833386 6.93347,-6.755695 -0.68411,-0.671363 -1.37333,-1.254698 -2.55524,-1.330958 -0.97249,0.09121 -3.57874,4.358913 -4.37823,8.086653 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient13722);fill-opacity:1;fill-rule:nonzero;stroke:#363433;stroke-width:0.69815475;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+ id="path3610-47-2-9-8"
+ d="m 146.71226,73.063746 c 6.45453,0.80753 7.57081,6.433347 7.02236,8.480172 -1.81494,6.447541 -2.66672,10.828031 -2.72449,18.184818 -1.10023,1.164674 -4.16628,2.480534 -6.0579,0.588904 0.58003,-4.379145 -3.07141,-5.632893 -8.60463,-5.226776 -6.5821,0.483102 -15.07586,-1.075135 -15.07586,-7.324594 0.5185,-3.938257 5.06535,-6.858688 12.1247,-10.915779"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#f6daaa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.53704214;marker:none;enable-background:accumulate"
+ id="path3608-8-7-4-2"
+ d="m 149.43232,76.139364 c -6.67663,-8.222635 -12.77056,-9.252259 -17.28036,4.373424"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:url(#radialGradient3919-58-3-3-6);fill-opacity:1;stroke:none;stroke-width:0.53704214"
+ id="path3917-9-6-8-4"
+ d="m 127.96201,80.369141 c 1.70012,0.639826 2.90339,2.271754 2.90339,4.195641 0,2.47676 -1.9874,4.480944 -4.46417,4.480944 -2.03172,0 -3.7457,-1.353191 -4.29633,-3.20547 0.59795,-1.142458 1.57255,-2.235227 2.90338,-3.33973 0.8458,-0.701958 1.84178,-1.40447 2.95373,-2.131385 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:ALPHA-Demo;-inkscape-font-specification:ALPHA-Demo;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#363433;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.26852107;marker:none;enable-background:accumulate"
+ id="path3660-0-5-4-2"
+ d="m 146.25501,93.593803 c 0.2692,0 0.57987,0.493036 0.10068,0.453128 -2.41802,-0.201372 -4.75037,-0.1515 -6.76338,1.258692 l -0.1846,-0.03357 -0.25175,-0.318868 -0.0543,-0.08485 c 2.20316,-1.403632 4.63387,-1.528602 7.15327,-1.274544 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient13724);stroke-width:0.40278158;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+ id="path3664-6-7-6-7"
+ d="m 143.36775,83.555729 c 0.48839,-0.488391 3.27657,-9.170776 -1.50853,-10.534536 -3.06591,-0.873785 -6.73809,5.864793 -6.73809,8.674022 0,2.80923 5.73363,4.155115 8.24662,1.860514 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#343231;fill-opacity:1;stroke:none;stroke-width:0.89742911"
+ id="path3674-8-1-9-7"
+ d="m 138.75726,77.030462 a 3.0652039,2.1560805 80.500082 1 0 4.23866,-0.795049 3.0652039,2.1560805 80.500082 1 0 -4.23866,0.795049 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.61131048"
+ id="path3676-7-3-2-9"
+ d="m 140.47132,75.889891 a 1.0927898,0.65248162 64.210608 1 0 1.17499,-0.567739 1.0927898,0.65248162 64.210608 1 0 -1.17499,0.567739 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.274905"
+ id="path3678-9-3-9-9"
+ d="m 141.30268,78.382006 a 0.29360382,0.39021788 75.394846 1 1 -0.66639,-0.22532 0.29360382,0.39021788 75.394846 1 1 0.66639,0.22532 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#radialGradient3711-0-9-7-8);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.40278158;marker:none;enable-background:accumulate"
+ id="path3680-0-3-0-39"
+ d="m 146.38926,73.37081 0.16783,0.01678 c 0.29772,0.25472 0.31449,0.158749 0.28531,0.03356 0.0571,0.008 0.11168,0.02478 0.16782,0.03357 0.0577,0.06571 0.12437,0.136272 0.21818,0.251737 l 0.16782,0.201393 0.16783,0.06712 -0.16783,-0.20139 c -0.13438,-0.165531 -0.18292,-0.239114 -0.20139,-0.285304 0.045,0.0079 0.0898,0.0083 0.13424,0.01678 0.16691,0.112089 0.30768,0.232359 0.11746,0.03357 2.65134,0.531263 4.21579,1.938162 5.1019,3.473991 0.96538,1.673198 1.08998,3.536997 0.85592,4.430597 -0.001,0.0039 0.001,0.01297 0,0.01678 -1.79862,6.39184 -2.66363,10.81877 -2.73556,18.074823 -0.50241,0.499373 -1.44288,1.078443 -2.46704,1.292263 -0.67565,0.14105 -1.3548,0.12973 -1.98035,-0.11749 -0.37336,-0.38143 -0.63377,-0.947238 -0.90626,-1.577565 -0.10195,-1.631275 -0.89557,-2.82652 -2.21528,-3.52434 -0.006,-0.0034 -0.01,-0.0134 -0.0168,-0.01678 z"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:ALPHA-Demo;-inkscape-font-specification:ALPHA-Demo;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#363433;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.53704214;marker:none;enable-background:accumulate"
+ id="path3953-2-1-3-8"
+ d="m 132.14926,80.520183 c 0.8733,-3.466461 2.11054,-6.025693 3.44881,-7.753546 1.33829,-1.727851 2.80349,-2.682621 4.34669,-2.903383 1.54321,-0.220762 3.13368,0.279564 4.74947,1.342605 1.6158,1.063042 3.65683,3.376895 4.74107,4.934075 -1.79254,-1.782141 -3.48083,-3.464119 -5.02637,-4.480945 -1.54555,-1.016827 -3.01846,-1.455906 -4.39703,-1.258693 -1.37859,0.197212 -2.69612,1.030851 -3.97747,2.68521 -1.28136,1.654361 -2.67979,4.079906 -3.88517,7.434677 z"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+</svg>
commit 00ef7f3ab3b1fee23a6b77831b0fdadb01fa124c
Author: Geert Janssens <info at kobaltwit.be>
Date: Mon Dec 17 14:50:04 2012 +0100
Guile 2: stop suppressing guile deprecated messages
All known deprecations have been dealt with and if new uses
of deprecated methods appear we want know this.
diff --git a/common/cmake_modules/GncAddTest.cmake b/common/cmake_modules/GncAddTest.cmake
index ea126a7..2d5efbb 100644
--- a/common/cmake_modules/GncAddTest.cmake
+++ b/common/cmake_modules/GncAddTest.cmake
@@ -8,7 +8,6 @@ function(get_guile_env)
set(env "")
list(APPEND env "GNC_UNINSTALLED=yes")
list(APPEND env "GNC_BUILDDIR=${CMAKE_BINARY_DIR}")
- list(APPEND env "GUILE_WARN_DEPRECATED=no")
if (APPLE)
list(APPEND env "DYLD_LIBRARY_PATH=${_GNC_MODULE_PATH}")
endif()
diff --git a/gnucash/environment.in b/gnucash/environment.in
index 9218d6a..4404423 100644
--- a/gnucash/environment.in
+++ b/gnucash/environment.in
@@ -51,9 +51,6 @@ PATH={GNC_BIN};{PATH}
# Tell GnuCash where to look for GnuCash modules
GNC_MODULE_PATH={GNC_LIB};{GNC_MODULE_PATH}
-# Prevent embedded guile from issuing deprecation warnings
-GUILE_WARN_DEPRECATED=no
-
# Tell Guile where to find GnuCash specific guile modules GUILE_LIBS
# can be used to override the path to Guile's own modules; likewise,
# GUILE_COMPILED_LIBS overrides the path to Guile's precompiled
diff --git a/gnucash/generate-gnc-script b/gnucash/generate-gnc-script
index ecac9c3..0ef0862 100755
--- a/gnucash/generate-gnc-script
+++ b/gnucash/generate-gnc-script
@@ -12,9 +12,6 @@ cat > ${TARGET_SCRIPT}.tmp <<EOF
PATH="${GNC_OVERRIDES_DIR}:\${PATH}"
export PATH
-GUILE_WARN_DEPRECATED="no"
-export GUILE_WARN_DEPRECATED
-
exec "${TARGET_SCRIPT}" "\$@"
EOF
commit 463b551db984aa3ada81f2dc20631cf8f4ed92a1
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Jul 4 17:58:53 2018 +0200
Bug 771667 - Different warnings when changing reconciled splits vs. splits linked to reconciled splits
This is the final bit that ensures a warning is only presented if a previous warning
didn't already include the change we're about to warn about.
This should prevent two warnings popping up when only one is sufficient. For example
when the user first edits a protection field the warning will notify the user all
reconciled splits will be unreconciled. If the user then continues to edit a
(previously) a protected split field before leaving the transaction, no extra warning
is needed.
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index b579548..80fea42 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -2060,6 +2060,24 @@ xaccTransWarnReadOnly (GtkWidget *parent, const Transaction *trans)
return FALSE;
}
+static gboolean reg_trans_has_reconciled_splits (SplitRegister *reg, Transaction *trans)
+{
+ GList *node;
+
+ for (node = xaccTransGetSplitList (trans); node; node = node->next)
+ {
+ Split *split = node->data;
+
+ if (!xaccTransStillHasSplit(trans, split))
+ continue;
+
+ if ((xaccSplitGetReconcile (split) == YREC) &&
+ (g_list_index (reg->unrecn_splits, split) == -1))
+ return TRUE;
+ }
+
+ return FALSE;
+}
static gboolean
gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
@@ -2087,12 +2105,14 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
if (xaccTransWarnReadOnly(gnc_split_register_get_parent(reg), trans))
return FALSE;
- if (!xaccTransHasReconciledSplits (trans))
+ if (!reg_trans_has_reconciled_splits (reg, trans))
return TRUE;
if (gnc_table_layout_get_cell_changed (reg->table->layout, RECN_CELL, FALSE))
recn = gnc_recn_cell_get_flag
((RecnCell *) gnc_table_layout_get_cell (reg->table->layout, RECN_CELL));
+ else if (g_list_index (reg->unrecn_splits, split) != -1)
+ recn = NREC; /* A previous run of this function marked this split for unreconciling */
else
recn = xaccSplitGetReconcile (split);
@@ -2186,7 +2206,12 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
if (recn == YREC && protected_split_cell)
{
if (g_list_index (reg->unrecn_splits, split) == -1)
+ {
reg->unrecn_splits = g_list_append (reg->unrecn_splits, split);
+ gnc_recn_cell_set_flag
+ ((RecnCell *) gnc_table_layout_get_cell (reg->table->layout, RECN_CELL),
+ NREC);
+ }
}
if (protected_trans_cell)
commit 3d4201f172ea3e4c87872d6f710ce85edb31b6aa
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Jul 4 17:50:50 2018 +0200
Adjust icon installation regex a bit more
This will only exclude apps and actions if they are directories.
diff --git a/data/pixmaps/CMakeLists.txt b/data/pixmaps/CMakeLists.txt
index 57a66a2..e44e9b4 100644
--- a/data/pixmaps/CMakeLists.txt
+++ b/data/pixmaps/CMakeLists.txt
@@ -16,22 +16,22 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/icons
- REGEX "hicolor/.*/apps.*" EXCLUDE
+ REGEX "hicolor/.*/apps/.*" EXCLUDE
)
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor
DESTINATION ${DATADIR_BUILD}/gnucash/icons
- REGEX "hicolor/.*/apps.*" EXCLUDE
+ REGEX "hicolor/.*/apps/.*" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons
- REGEX "hicolor/.*/actions.*" EXCLUDE
+ REGEX "hicolor/.*/actions/.*" EXCLUDE
)
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor
DESTINATION ${DATADIR_BUILD}/icons
- REGEX "hicolor/.*/actions.*" EXCLUDE
+ REGEX "hicolor/.*/actions/.*" EXCLUDE
)
set(gncpixmap_DATA
commit b79c9d150f1be1f4544e64a1b08ff3977fb1476f
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed Jul 4 11:30:58 2018 +0200
Use a more specific regex to install icons
The generic regex could exclude too much if the source directory
is a descendant of a directory called actions or apps.
Discoverd by Colin Law.
diff --git a/data/pixmaps/CMakeLists.txt b/data/pixmaps/CMakeLists.txt
index de7ca0d..57a66a2 100644
--- a/data/pixmaps/CMakeLists.txt
+++ b/data/pixmaps/CMakeLists.txt
@@ -16,22 +16,22 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/gnucash/icons
- REGEX ".*/apps.*" EXCLUDE
+ REGEX "hicolor/.*/apps.*" EXCLUDE
)
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor
DESTINATION ${DATADIR_BUILD}/gnucash/icons
- REGEX ".*/apps.*" EXCLUDE
+ REGEX "hicolor/.*/apps.*" EXCLUDE
)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons
- REGEX ".*/actions.*" EXCLUDE
+ REGEX "hicolor/.*/actions.*" EXCLUDE
)
file(
COPY ${CMAKE_CURRENT_SOURCE_DIR}/hicolor
DESTINATION ${DATADIR_BUILD}/icons
- REGEX ".*/actions.*" EXCLUDE
+ REGEX "hicolor/.*/actions.*" EXCLUDE
)
set(gncpixmap_DATA
commit d865b149580df44c15c19819a227c25dd1172562
Author: Geert Janssens <geert at kobaltwit.be>
Date: Thu Jun 28 13:20:34 2018 +0200
Revert "html-utilities.scm: simplify"
This reverts commit 4c55141d963452a2381a5bd5b3d4fe31bde2cd2c.
and should fix the regression it caused as reported in
https://bugzilla.gnome.org/show_bug.cgi?id=796696
diff --git a/gnucash/report/report-system/html-utilities.scm b/gnucash/report/report-system/html-utilities.scm
index f67a9a5..a701ff2 100644
--- a/gnucash/report/report-system/html-utilities.scm
+++ b/gnucash/report/report-system/html-utilities.scm
@@ -27,7 +27,9 @@
;; returns a list with n #f (empty cell) values
(define (gnc:html-make-empty-cell) #f)
(define (gnc:html-make-empty-cells n)
- (make-list n #f))
+ (if (> n 0)
+ (cons #f (gnc:html-make-empty-cells (- n 1)))
+ (list)))
(define (gnc:register-guid type guid)
(gnc-build-url URL-TYPE-REGISTER (string-append type guid) ""))
@@ -814,8 +816,8 @@
(gnc:html-markup-p
(gnc:html-markup-anchor
(gnc-build-url URL-TYPE-OPTIONS
- (format #f "report-id=~a" report-id)
- "")
+ (string-append "report-id=" (format #f "~a" report-id))
+ "")
(_ "Edit report options")))))
(define* (gnc:html-render-options-changed options #:optional plaintext?)
commit f7ed46a35b15b84190b8f0f456a7c27dddd3b2a1
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jun 26 15:04:23 2018 -0700
Bug 796248 - Editing Scheduled Transaction, take 2.
In addition to not begining to edit already-loaded transactions,
don't try to load splits that are already loaded. It shouldn't
be possible to load a transaction without also loading its splits.
diff --git a/libgnucash/backend/sql/gnc-transaction-sql.cpp b/libgnucash/backend/sql/gnc-transaction-sql.cpp
index f2e2b1f..df1c950 100644
--- a/libgnucash/backend/sql/gnc-transaction-sql.cpp
+++ b/libgnucash/backend/sql/gnc-transaction-sql.cpp
@@ -225,16 +225,11 @@ load_single_split (GncSqlBackend* sql_be, GncSqlRow& row)
pSplit = xaccSplitLookup (&split_guid, sql_be->book());
}
- if (pSplit == NULL)
- {
- pSplit = xaccMallocSplit (sql_be->book());
- }
+ if (pSplit)
+ return pSplit; //Already loaded, nothing to do.
- /* If the split is dirty, don't overwrite it */
- if (!qof_instance_is_dirty (QOF_INSTANCE (pSplit)))
- {
- gnc_sql_load_object (sql_be, row, GNC_ID_SPLIT, pSplit, split_col_table);
- }
+ pSplit = xaccMallocSplit (sql_be->book());
+ gnc_sql_load_object (sql_be, row, GNC_ID_SPLIT, pSplit, split_col_table);
/*# -ifempty */
if (pSplit != xaccSplitLookup (&split_guid, sql_be->book()))
@@ -272,7 +267,7 @@ load_splits_for_transactions (GncSqlBackend* sql_be, std::string selector)
auto result = sql_be->execute_select_statement (stmt);
for (auto row : *result)
- Split* s = load_single_split (sql_be, row);
+ load_single_split (sql_be, row);
sql = "SELECT DISTINCT ";
sql += spkey + " FROM " SPLIT_TABLE " WHERE " + sskey + " IN " + selector;
gnc_sql_slots_load_for_sql_subquery(sql_be, sql,
@@ -292,14 +287,9 @@ load_single_tx (GncSqlBackend* sql_be, GncSqlRow& row)
if (guid == NULL) return NULL;
tx_guid = *guid;
- // Don't overwrite the transaction if it's already been loaded (and possibly modified).
- // However increase the edit level, it may be modified while loading its splits
pTx = xaccTransLookup (&tx_guid, sql_be->book());
- if (pTx != NULL)
- {
- xaccTransBeginEdit (pTx);
- return NULL;
- }
+ if (pTx)
+ return nullptr; // Nothing to do.
pTx = xaccMallocTransaction (sql_be->book());
xaccTransBeginEdit (pTx);
commit 4e04f6e51df0dc9f09366f3371def090a26fa5f0
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jun 26 15:00:51 2018 -0700
Don't warn about an invalid date if it's just an empty column.
diff --git a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
index 63a4f7a..6daed1d 100644
--- a/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
+++ b/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp
@@ -399,10 +399,14 @@ GncSqlColumnTableEntryImpl<CT_TIMESPEC>::load (const GncSqlBackend* sql_be,
GncDateTime time(val);
ts.tv_sec = static_cast<time64>(time);
}
- catch (std::invalid_argument&)
+ catch (const std::invalid_argument& err)
{
- PWARN("An invalid date was found in your database."
- "It has been set to 1 January 1970.");
+ if (strcmp(err.what(), "Column empty.") != 0)
+ {
+ auto val = row.get_string_at_col(m_col_name);
+ PWARN("An invalid date %s was found in your database."
+ "It has been set to 1 January 1970.", val.c_str());
+ }
ts.tv_sec = 0;
}
}
commit 8de1625db8e46a5c38f25f80ee69c68a16919e76
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jun 26 10:19:53 2018 -0700
Remove duplicate declaration.
diff --git a/gnucash/gnome/gnc-split-reg.h b/gnucash/gnome/gnc-split-reg.h
index 37bea97..018836f 100644
--- a/gnucash/gnome/gnc-split-reg.h
+++ b/gnucash/gnome/gnc-split-reg.h
@@ -249,7 +249,6 @@ void gnc_split_reg_focus_on_sheet (GNCSplitReg *gsr);
void gnc_split_reg_balancing_entry (GNCSplitReg *gsr, Account *account,
time64 statement_date, gnc_numeric balancing_amount);
-void gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data );
void gsr_default_associate_handler (GNCSplitReg *gsr, gboolean uri_is_file);
void gsr_default_execassociated_handler( GNCSplitReg *gsr, gpointer data );
void gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction );
commit 6011749151793399727371db335a0e3dd9723d81
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Jun 25 13:42:45 2018 -0700
Bug 796665 - Backspace Key Inoperable After Ctrl+V
Remove the gtk_editable_set_editable toggles in
gnc_item_edit_cut_keyboard and gnc_item_edit_paste_keyboard. These were
added as a work-around to gnucash_sheet_key_press_event_internal leaving
the sheet not-editable after a regular key event. That was removed to
fix input-method key handling.
The original addition of that enable/disable toggle was apparently a
hack to fix the date-field accelerators and the use of the account
separator in the transfer field. Both seem to work fine with the
protection removed.
diff --git a/gnucash/register/register-gnome/gnucash-item-edit.c b/gnucash/register/register-gnome/gnucash-item-edit.c
index d62e4f2..f4cabb7 100644
--- a/gnucash/register/register-gnome/gnucash-item-edit.c
+++ b/gnucash/register/register-gnome/gnucash-item-edit.c
@@ -371,9 +371,7 @@ gnc_item_edit_configure (GncItemEdit *item_edit)
void
gnc_item_edit_cut_clipboard (GncItemEdit *item_edit)
{
- gtk_editable_set_editable(GTK_EDITABLE(item_edit->editor), TRUE);
gtk_editable_cut_clipboard(GTK_EDITABLE(item_edit->editor));
- gtk_editable_set_editable(GTK_EDITABLE(item_edit->editor), FALSE);
}
void
@@ -385,9 +383,7 @@ gnc_item_edit_copy_clipboard (GncItemEdit *item_edit)
void
gnc_item_edit_paste_clipboard (GncItemEdit *item_edit)
{
- gtk_editable_set_editable(GTK_EDITABLE(item_edit->editor), TRUE);
gtk_editable_paste_clipboard(GTK_EDITABLE(item_edit->editor));
- gtk_editable_set_editable(GTK_EDITABLE(item_edit->editor), FALSE);
}
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index bb32e93..3b54bb4 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -1810,7 +1810,6 @@ gnucash_sheet_key_press_event_internal (GtkWidget *widget, GdkEventKey *event)
if (pass_on)
{
gboolean result = FALSE;
-
// If sheet is readonly, entry is not realized
if (gtk_widget_get_realized (GTK_WIDGET(sheet->entry)))
result = gtk_widget_event (sheet->entry, (GdkEvent *) event);
commit 246257de563404fca6d01aefe5527bc7a0e1ecb5
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sun Jun 24 22:19:48 2018 +0200
Bug 796509 - Saved reports don't respect *some* 'Edit report options'
This was due to some leftovers of the fix for bug 734168. That fix initially
went too far but for some reason the reversal of these parts never got
committed.
diff --git a/gnucash/report/business-reports/taxinvoice.eguile.scm b/gnucash/report/business-reports/taxinvoice.eguile.scm
index e6fde67..4a81bec 100644
--- a/gnucash/report/business-reports/taxinvoice.eguile.scm
+++ b/gnucash/report/business-reports/taxinvoice.eguile.scm
@@ -450,23 +450,7 @@
(let* ((owner (gncInvoiceGetOwner opt-invoice))
(endowner (gncOwnerGetEndOwner owner))
(ownertype (gncOwnerGetType endowner)))
- (if (not (eqv? ownertype GNC-OWNER-CUSTOMER))
- (begin
- (set! opt-report-title "Vendor Bill")
- (set! opt-extra-notes "")
- (set! opt-payment-recd-heading "Payment")
- (set! opt-invoice-number-text "Bill number")
- (display-report opt-invoice owner endowner ownertype)
- )
- (begin
- (set! opt-report-title "Customer Invoice")
- (set! opt-extra-notes "")
- (set! opt-payment-recd-heading "Payment")
- (set! opt-invoice-number-text "Invoice number")
- (display-report opt-invoice owner endowner ownertype)
- )
- )
- ))
+ (display-report opt-invoice owner endowner ownertype)))
?>
</div>
commit 5f46553f1fa3133fc1094d138ac669f788f6481d
Author: Christian Stimming <christian at cstimming.de>
Date: Wed Jun 20 23:03:02 2018 +0200
Minor KVP performance cleanup
Change some plain string literals to std::string constants, which helps
avoiding typos and also saves some string constructors/destructors
in the KVP lookup. Nevertheless the functions in Account.cpp do not
contribute that much to the overall UI speed, but whatever.
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index f02344f..a114456 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -51,12 +51,17 @@ static QofLogModule log_module = GNC_MOD_ACCOUNT;
static gchar account_separator[8] = ".";
static gunichar account_uc_separator = ':';
/* Predefined KVP paths */
-static const char *KEY_ASSOC_INCOME_ACCOUNT = "ofx/associated-income-account";
-#define AB_KEY "hbci"
-#define AB_ACCOUNT_ID "account-id"
-#define AB_ACCOUNT_UID "account-uid"
-#define AB_BANK_CODE "bank-code"
-#define AB_TRANS_RETRIEVAL "trans-retrieval"
+static const std::string KEY_ASSOC_INCOME_ACCOUNT("ofx/associated-income-account");
+static const std::string KEY_RECONCILE_INFO("reconcile-info");
+static const std::string KEY_INCLUDE_CHILDREN("include-children");
+static const std::string KEY_POSTPONE("postpone");
+static const std::string KEY_LOT_MGMT("lot-mgmt");
+static const std::string KEY_ONLINE_ID("online_id");
+static const std::string AB_KEY("hbci");
+static const std::string AB_ACCOUNT_ID("account-id");
+static const std::string AB_ACCOUNT_UID("account-uid");
+static const std::string AB_BANK_CODE("bank-code");
+static const std::string AB_TRANS_RETRIEVAL("trans-retrieval");
using FinalProbabilityVec=std::vector<std::pair<std::string, int32_t>>;
using ProbabilityVec=std::vector<std::pair<std::string, struct AccountProbability>>;
@@ -413,10 +418,10 @@ gnc_account_get_property (GObject *object,
case PROP_LOT_NEXT_ID:
/* Pre-set the value in case the frame is empty */
g_value_set_int64 (value, 0);
- qof_instance_get_path_kvp (QOF_INSTANCE (account), value, {"lot-mgmt", "next-id"});
+ qof_instance_get_path_kvp (QOF_INSTANCE (account), value, {KEY_LOT_MGMT, "next-id"});
break;
case PROP_ONLINE_ACCOUNT:
- qof_instance_get_path_kvp (QOF_INSTANCE (account), value, {"online_id"});
+ qof_instance_get_path_kvp (QOF_INSTANCE (account), value, {KEY_ONLINE_ID});
break;
case PROP_OFX_INCOME_ACCOUNT:
qof_instance_get_path_kvp (QOF_INSTANCE (account), value, {KEY_ASSOC_INCOME_ACCOUNT});
@@ -536,10 +541,10 @@ gnc_account_set_property (GObject *object,
xaccAccountSetSortReversed(account, g_value_get_boolean(value));
break;
case PROP_LOT_NEXT_ID:
- qof_instance_set_path_kvp (QOF_INSTANCE (account), value, {"lot-mgmt", "next-id"});
+ qof_instance_set_path_kvp (QOF_INSTANCE (account), value, {KEY_LOT_MGMT, "next-id"});
break;
case PROP_ONLINE_ACCOUNT:
- qof_instance_set_path_kvp (QOF_INSTANCE (account), value, {"online_id"});
+ qof_instance_set_path_kvp (QOF_INSTANCE (account), value, {KEY_ONLINE_ID});
break;
case PROP_OFX_INCOME_ACCOUNT:
qof_instance_set_path_kvp (QOF_INSTANCE (account), value, {KEY_ASSOC_INCOME_ACCOUNT});
@@ -4295,7 +4300,7 @@ xaccAccountGetReconcileLastDate (const Account *acc, time64 *last_date)
gint64 date = 0;
GValue v = G_VALUE_INIT;
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
- qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {"reconcile-info", "last-date"});
+ qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v, {KEY_RECONCILE_INFO, "last-date"});
if (G_VALUE_HOLDS_INT64 (&v))
date = g_value_get_int64 (&v);
@@ -4320,7 +4325,7 @@ xaccAccountSetReconcileLastDate (Account *acc, time64 last_date)
g_value_init (&v, G_TYPE_INT64);
g_value_set_int64 (&v, last_date);
xaccAccountBeginEdit (acc);
- qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {"reconcile-info", "last-date"});
+ qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v, {KEY_RECONCILE_INFO, "last-date"});
mark_account (acc);
xaccAccountCommitEdit (acc);
}
@@ -4338,9 +4343,9 @@ xaccAccountGetReconcileLastInterval (const Account *acc,
if (!acc) return FALSE;
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v1,
- {"reconcile-info", "last-interval", "months"});
+ {KEY_RECONCILE_INFO, "last-interval", "months"});
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v2,
- {"reconcile-info", "last-interval", "days"});
+ {KEY_RECONCILE_INFO, "last-interval", "days"});
if (G_VALUE_HOLDS_INT64 (&v1))
m = g_value_get_int64 (&v1);
if (G_VALUE_HOLDS_INT64 (&v2))
@@ -4371,9 +4376,9 @@ xaccAccountSetReconcileLastInterval (Account *acc, int months, int days)
g_value_set_int64 (&v2, days);
xaccAccountBeginEdit (acc);
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v1,
- {"reconcile-info", "last-interval", "months"});
+ {KEY_RECONCILE_INFO, "last-interval", "months"});
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v2,
- {"reconcile-info", "last-interval", "days"});
+ {KEY_RECONCILE_INFO, "last-interval", "days"});
mark_account (acc);
xaccAccountCommitEdit (acc);
}
@@ -4388,7 +4393,7 @@ xaccAccountGetReconcilePostponeDate (const Account *acc, time64 *postpone_date)
GValue v = G_VALUE_INIT;
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v,
- {"reconcile-info", "postpone", "date"});
+ {KEY_RECONCILE_INFO, KEY_POSTPONE, "date"});
if (G_VALUE_HOLDS_INT64 (&v))
date = g_value_get_int64 (&v);
@@ -4414,7 +4419,7 @@ xaccAccountSetReconcilePostponeDate (Account *acc, time64 postpone_date)
g_value_set_int64 (&v, postpone_date);
xaccAccountBeginEdit (acc);
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v,
- {"reconcile-info", "postpone", "date"});
+ {KEY_RECONCILE_INFO, KEY_POSTPONE, "date"});
mark_account (acc);
xaccAccountCommitEdit (acc);
}
@@ -4430,7 +4435,7 @@ xaccAccountGetReconcilePostponeBalance (const Account *acc,
GValue v = G_VALUE_INIT;
g_return_val_if_fail(GNC_IS_ACCOUNT(acc), FALSE);
qof_instance_get_path_kvp (QOF_INSTANCE(acc), &v,
- {"reconcile-info", "postpone", "balance"});
+ {KEY_RECONCILE_INFO, KEY_POSTPONE, "balance"});
if (!G_VALUE_HOLDS_INT64 (&v))
return FALSE;
@@ -4457,7 +4462,7 @@ xaccAccountSetReconcilePostponeBalance (Account *acc, gnc_numeric balance)
g_value_set_boxed (&v, &balance);
xaccAccountBeginEdit (acc);
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v,
- {"reconcile-info", "postpone", "balance"});
+ {KEY_RECONCILE_INFO, KEY_POSTPONE, "balance"});
mark_account (acc);
xaccAccountCommitEdit (acc);
}
@@ -4472,7 +4477,7 @@ xaccAccountClearReconcilePostpone (Account *acc)
if (!acc) return;
xaccAccountBeginEdit (acc);
- qof_instance_set_path_kvp (QOF_INSTANCE(acc), nullptr, {"reconcile-info", "postpone"});
+ qof_instance_set_path_kvp (QOF_INSTANCE(acc), nullptr, {KEY_RECONCILE_INFO, KEY_POSTPONE});
mark_account (acc);
xaccAccountCommitEdit (acc);
}
@@ -4487,7 +4492,7 @@ xaccAccountClearReconcilePostpone (Account *acc)
gboolean
xaccAccountGetAutoInterestXfer (const Account *acc, gboolean default_value)
{
- return boolean_from_key (acc, {"reconcile-info", "auto-interest-transfer"});
+ return boolean_from_key (acc, {KEY_RECONCILE_INFO, "auto-interest-transfer"});
}
/********************************************************************\
@@ -4496,7 +4501,7 @@ xaccAccountGetAutoInterestXfer (const Account *acc, gboolean default_value)
void
xaccAccountSetAutoInterestXfer (Account *acc, gboolean option)
{
- set_boolean_key (acc, {"reconcile-info", "auto-interest-transfer"}, option);
+ set_boolean_key (acc, {KEY_RECONCILE_INFO, "auto-interest-transfer"}, option);
}
/********************************************************************\
@@ -4577,7 +4582,7 @@ Account *
xaccAccountGainsAccount (Account *acc, gnc_commodity *curr)
{
GValue v = G_VALUE_INIT;
- std::vector<std::string> path {"lot-mgmt", "gains-acct",
+ std::vector<std::string> path {KEY_LOT_MGMT, "gains-acct",
gnc_commodity_get_unique_name (curr)};
GncGUID *guid = NULL;
Account *gains_account;
@@ -4696,7 +4701,7 @@ xaccAccountSetReconcileChildrenStatus(Account *acc, gboolean status)
g_value_init (&v, G_TYPE_INT64);
g_value_set_int64 (&v, status);
qof_instance_set_path_kvp (QOF_INSTANCE (acc), &v,
- {"reconcile-info", "include-children"});
+ {KEY_RECONCILE_INFO, KEY_INCLUDE_CHILDREN});
mark_account(acc);
xaccAccountCommitEdit (acc);
}
@@ -4714,7 +4719,7 @@ xaccAccountGetReconcileChildrenStatus(const Account *acc)
GValue v = G_VALUE_INIT;
if (!acc) return FALSE;
qof_instance_get_path_kvp (QOF_INSTANCE (acc), &v,
- {"reconcile-info", "include-children"});
+ {KEY_RECONCILE_INFO, KEY_INCLUDE_CHILDREN});
return G_VALUE_HOLDS_INT64 (&v) ? g_value_get_int64 (&v) : FALSE;
}
Summary of changes:
CMakeLists.txt | 17 +-
bindings/python/gnucash_core.py | 8 +-
borrowed/CMakeLists.txt | 2 +-
borrowed/jenny/jenny.c | 1848 ++++++++++++++++++++
borrowed/libc/CMakeLists.txt | 6 +-
borrowed/libc/strfmon.c | 619 -------
borrowed/libc/strfmon.h | 40 -
common/cmake_modules/GncAddTest.cmake | 1 -
common/config.h.cmake.in | 3 -
common/test-core/CMakeLists.txt | 2 +
.../android-chrome-192x192.png | Bin 0 -> 35735 bytes
.../android-chrome-512x512.png | Bin 0 -> 125084 bytes
.../gnucash-bugzilla-favicons/apple-touch-icon.png | Bin 0 -> 24844 bytes
.../gnucash-bugzilla-favicons/browserconfig.xml | 9 +
.../gnucash-bugzilla-favicons/favicon-16x16.png | Bin 0 -> 1516 bytes
.../gnucash-bugzilla-favicons/favicon-32x32.png | Bin 0 -> 3259 bytes
contrib/art/gnucash-bugzilla-favicons/favicon.ico | Bin 0 -> 15086 bytes
.../gnucash-bugzilla-favicons/mstile-150x150.png | Bin 0 -> 22701 bytes
.../safari-pinned-tab.svg | 116 ++
.../art/gnucash-bugzilla-favicons/site.webmanifest | 19 +
contrib/art/gnucash-bugzilla-logo.svg | 650 +++++++
.../android-chrome-192x192.png | Bin 0 -> 35484 bytes
.../android-chrome-512x512.png | Bin 0 -> 114785 bytes
.../art/gnucash-wiki-favicons/apple-touch-icon.png | Bin 0 -> 25009 bytes
.../art/gnucash-wiki-favicons/browserconfig.xml | 9 +
.../art/gnucash-wiki-favicons/favicon-16x16.png | Bin 0 -> 1495 bytes
.../art/gnucash-wiki-favicons/favicon-32x32.png | Bin 0 -> 3092 bytes
contrib/art/gnucash-wiki-favicons/favicon.ico | Bin 0 -> 15086 bytes
.../art/gnucash-wiki-favicons/mstile-150x150.png | Bin 0 -> 22618 bytes
.../gnucash-wiki-favicons/safari-pinned-tab.svg | 114 ++
contrib/art/gnucash-wiki-favicons/site.webmanifest | 19 +
contrib/art/gnucash-wiki-logo.svg | 613 +++++++
data/accounts/sv_SE/README.bas_2012 | 2 +-
data/pixmaps/CMakeLists.txt | 8 +-
doc/README-ca.win32-bin.txt | 2 +-
doc/README-de.win32-bin.txt | 2 +-
doc/README-fr.win32-bin.txt | 2 +-
doc/README-it.win32-bin.txt | 2 +-
doc/README-lv.win32-bin.txt | 2 +-
doc/README-nl.win32-bin.txt | 2 +-
doc/README-zh_CN.win32-bin.txt | 2 +-
doc/README-zh_TW.win32-bin.txt | 2 +-
doc/README.win32-bin.txt | 2 +-
doc/gtk-3.0.css | 4 +-
doc/guile-hackers.txt | 26 +-
gnucash/CMakeLists.txt | 2 +-
gnucash/environment.in | 3 -
gnucash/generate-gnc-script | 3 -
gnucash/gnome-search/dialog-search.c | 6 +-
gnucash/gnome-search/search-account.c | 21 +-
gnucash/gnome-search/search-boolean.c | 16 +
gnucash/gnome-search/search-core-type.c | 6 +
gnucash/gnome-search/search-core-type.h | 2 +
gnucash/gnome-search/search-date.c | 62 +-
gnucash/gnome-search/search-double.c | 16 +
gnucash/gnome-search/search-int64.c | 16 +
gnucash/gnome-search/search-numeric.c | 16 +
gnucash/gnome-search/search-reconciled.c | 16 +
gnucash/gnome-search/search-string.c | 23 +-
gnucash/gnome-utils/dialog-account.c | 167 +-
gnucash/gnome-utils/dialog-account.h | 2 +
gnucash/gnome-utils/dialog-book-close.c | 6 +-
gnucash/gnome-utils/dialog-book-close.h | 3 +-
gnucash/gnome-utils/dialog-dup-trans.c | 4 +-
gnucash/gnome-utils/dialog-file-access.c | 6 +-
gnucash/gnome-utils/dialog-options.c | 239 ++-
gnucash/gnome-utils/dialog-preferences.c | 2 +-
gnucash/gnome-utils/dialog-reset-warnings.c | 2 +-
gnucash/gnome-utils/dialog-tax-table.c | 2 +-
gnucash/gnome-utils/dialog-totd.c | 2 +-
gnucash/gnome-utils/dialog-transfer.c | 37 +-
gnucash/gnome-utils/dialog-utils.c | 156 +-
gnucash/gnome-utils/dialog-utils.h | 10 +-
gnucash/gnome-utils/gnc-date-edit.c | 39 +-
gnucash/gnome-utils/gnc-date-edit.h | 11 +-
gnucash/gnome-utils/gnc-embedded-window.c | 4 +
gnucash/gnome-utils/gnc-file.c | 56 +-
gnucash/gnome-utils/gnc-keyring.c | 4 +-
gnucash/gnome-utils/gnc-main-window.c | 124 +-
gnucash/gnome-utils/gnc-main-window.h | 2 +-
gnucash/gnome-utils/gnc-tree-control-split-reg.c | 10 +-
gnucash/gnome-utils/gnc-tree-model-price.c | 6 +-
gnucash/gnome-utils/gnc-tree-model-split-reg.c | 7 +-
gnucash/gnome-utils/gnc-tree-view-price.c | 16 +-
gnucash/gnome-utils/gnc-tree-view-split-reg.c | 54 +-
gnucash/gnome-utils/print-session.c | 2 +-
gnucash/gnome-utils/window-main-summarybar.c | 28 +-
gnucash/gnome/CMakeLists.txt | 6 +-
gnucash/gnome/assistant-acct-period.c | 3 -
gnucash/gnome/assistant-hierarchy.c | 3 +-
.../gnome/{assistant-loan.c => assistant-loan.cpp} | 236 ++-
gnucash/gnome/assistant-stock-split.c | 9 +-
gnucash/gnome/dialog-commodities.c | 2 +-
gnucash/gnome/dialog-date-close.c | 42 +-
gnucash/gnome/dialog-date-close.h | 6 +-
gnucash/gnome/dialog-fincalc.c | 2 +-
gnucash/gnome/dialog-find-account.c | 153 +-
gnucash/gnome/dialog-find-transactions2.c | 2 +-
gnucash/gnome/dialog-imap-editor.c | 2 +-
gnucash/gnome/dialog-invoice.c | 40 +-
gnucash/gnome/dialog-lot-viewer.c | 13 +-
gnucash/gnome/dialog-lot-viewer.h | 2 +-
gnucash/gnome/dialog-order.c | 6 +-
gnucash/gnome/dialog-payment.c | 12 +-
gnucash/gnome/dialog-price-edit-db.c | 68 +-
gnucash/gnome/dialog-price-editor.c | 20 +-
gnucash/gnome/dialog-print-check.c | 2 +-
gnucash/gnome/dialog-sx-editor.c | 2 +-
gnucash/gnome/dialog-sx-editor2.c | 2 +-
gnucash/gnome/dialog-sx-since-last-run.c | 2 +-
gnucash/gnome/dialog-tax-info.c | 3 +-
gnucash/gnome/dialog-trans-assoc.c | 134 +-
gnucash/gnome/gnc-budget-view.c | 2 +-
gnucash/gnome/gnc-plugin-basic-commands.c | 2 +-
gnucash/gnome/gnc-plugin-page-account-tree.c | 31 +-
gnucash/gnome/gnc-plugin-page-register.c | 696 +++++++-
gnucash/gnome/gnc-plugin-page-register2.c | 4 +-
gnucash/gnome/gnc-split-reg.c | 219 ++-
gnucash/gnome/gnc-split-reg.h | 15 +-
gnucash/gnome/gnucash.appdata.xml.in | 2 +-
gnucash/gnome/reconcile-view.c | 54 +-
gnucash/gnome/reconcile-view.h | 14 +-
gnucash/gnome/window-reconcile.c | 42 +-
gnucash/gnome/window-reconcile.h | 5 +-
gnucash/gnome/window-reconcile2.c | 3 +-
gnucash/gnucash-bin.c | 11 +-
.../gschemas/org.gnucash.dialogs.gschema.xml.in | 11 +
gnucash/gschemas/org.gnucash.gschema.xml.in | 9 +-
gnucash/gtkbuilder/dialog-account.glade | 150 ++
gnucash/gtkbuilder/dialog-custom-report.glade | 7 +-
gnucash/gtkbuilder/dialog-find-account.glade | 71 +-
gnucash/gtkbuilder/dialog-options.glade | 39 +-
gnucash/gtkbuilder/dialog-preferences.glade | 27 +-
gnucash/gtkbuilder/dialog-report.glade | 33 +-
gnucash/gtkbuilder/dialog-trans-assoc.glade | 69 +-
gnucash/gtkbuilder/gnc-plugin-page-register.glade | 61 +-
gnucash/import-export/aqb/assistant-ab-initial.c | 24 +-
gnucash/import-export/aqb/dialog-ab-daterange.c | 14 +-
gnucash/import-export/aqb/dialog-ab-daterange.h | 4 +-
gnucash/import-export/aqb/gnc-ab-gettrans.c | 29 +-
gnucash/import-export/aqb/gnc-ab-kvp.c | 11 +-
gnucash/import-export/aqb/gnc-ab-kvp.h | 4 +-
gnucash/import-export/aqb/gnc-ab-utils.c | 2 +-
gnucash/import-export/aqb/gnc-file-aqb-import.c | 2 +-
gnucash/import-export/aqb/gnc-gwen-gui.c | 3 +-
gnucash/import-export/aqb/test/test-aqb.c | 2 +-
gnucash/import-export/aqb/test/test-kvp.c | 32 +-
gnucash/import-export/bi-import/README | 2 +-
.../import-export/csv-exp/assistant-csv-export.c | 5 +-
.../csv-exp/csv-transactions-export.c | 8 +-
.../csv-imp/assistant-csv-account-import.c | 3 +-
.../csv-imp/assistant-csv-price-import.cpp | 3 +-
.../csv-imp/assistant-csv-trans-import.cpp | 3 +-
.../import-export/csv-imp/gnc-imp-props-price.cpp | 21 +-
gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp | 7 +-
gnucash/import-export/csv-imp/gnc-tokenizer.cpp | 6 +
gnucash/import-export/import-main-matcher.c | 2 +-
gnucash/import-export/import-match-picker.c | 2 +-
gnucash/import-export/import-parse.c | 4 +-
gnucash/import-export/import-parse.h | 2 +-
gnucash/import-export/log-replay/gnc-log-replay.c | 34 +-
gnucash/import-export/ofx/CMakeLists.txt | 2 -
gnucash/import-export/ofx/gnc-ofx-import.c | 43 +-
gnucash/import-export/ofx/gnc-ofx-kvp.c | 57 -
gnucash/import-export/ofx/gnc-ofx-kvp.h | 38 -
.../import-export/qif-imp/assistant-qif-import.c | 20 +-
gnucash/import-export/qif-imp/qif-dialog-utils.scm | 2 +
gnucash/import-export/qif-imp/qif-to-gnc.scm | 4 +-
gnucash/import-export/test/test-import-parse.c | 8 +-
gnucash/python/CMakeLists.txt | 21 +-
gnucash/python/gncmod-python.c | 133 ++
gnucash/python/init.py | 4 +-
gnucash/python/pycons/console.py | 18 +-
gnucash/python/pycons/shell.py | 4 +-
gnucash/register/ledger-core/gncEntryLedger.c | 12 +-
gnucash/register/ledger-core/gncEntryLedgerModel.c | 34 +-
.../register/ledger-core/split-register-control.c | 32 +-
gnucash/register/ledger-core/split-register-load.c | 2 +-
.../ledger-core/split-register-model-save.c | 14 +-
.../register/ledger-core/split-register-model.c | 67 +-
gnucash/register/ledger-core/split-register.c | 25 +-
gnucash/register/register-core/datecell.h | 11 +-
gnucash/register/register-gnome/datecell-gnome.c | 22 +-
.../register/register-gnome/gnucash-item-edit.c | 4 -
gnucash/register/register-gnome/gnucash-register.c | 2 +-
gnucash/register/register-gnome/gnucash-sheet.c | 30 +-
gnucash/register/register-gnome/gnucash-sheetP.h | 1 +
.../report/business-reports/customer-summary.scm | 2 +-
gnucash/report/business-reports/job-report.scm | 2 +-
gnucash/report/business-reports/receipt.eguile.scm | 2 +-
gnucash/report/business-reports/receipt.scm | 4 +-
.../report/business-reports/taxinvoice.eguile.scm | 18 +-
gnucash/report/business-reports/taxinvoice.scm | 2 +-
.../report/business-reports/test/test-invoice.scm | 4 +-
gnucash/report/jqplot/jquery.jqplot.js | 2 +-
.../report/jqplot/plugins/jqplot.barRenderer.js | 2 +-
.../report/jqplot/plugins/jqplot.bubbleRenderer.js | 2 +-
gnucash/report/locale-specific/us/taxtxf.scm | 7 +-
gnucash/report/report-gnome/dialog-custom-report.c | 24 +-
.../report-gnome/dialog-report-column-view.c | 214 ++-
.../report/report-system/commodity-utilities.scm | 476 +++--
gnucash/report/report-system/eguile-utilities.scm | 2 +-
gnucash/report/report-system/html-table.scm | 2 +-
gnucash/report/report-system/html-utilities.scm | 8 +-
gnucash/report/report-system/report-utilities.scm | 43 +-
gnucash/report/report-system/test/CMakeLists.txt | 1 +
.../report-system/test/test-commodity-utils.scm | 590 +++++++
.../report/standard-reports/budget-barchart.scm | 4 +-
gnucash/report/standard-reports/budget-flow.scm | 2 +-
gnucash/report/standard-reports/budget.scm | 2 +-
.../report/standard-reports/test/CMakeLists.txt | 9 +-
.../standard-reports/test/test-balance-sheet.scm | 140 --
.../standard-reports/test/test-balsheet-pnl.scm | 456 +++++
.../standard-reports/test/test-stress-options.scm | 315 ++++
.../standard-reports/test/test-transaction.scm | 7 +-
gnucash/ui/gnc-plugin-page-account-tree-ui.xml | 44 +-
libgnucash/app-utils/business-options.scm | 2 +-
libgnucash/app-utils/calculation/fin.c | 2 +-
libgnucash/app-utils/gnc-component-manager.c | 3 +
libgnucash/app-utils/gnc-ui-util.c | 51 +-
libgnucash/app-utils/gnc-ui-util.h | 2 +-
libgnucash/app-utils/guile-util.c | 99 --
libgnucash/app-utils/guile-util.h | 6 +-
libgnucash/app-utils/test/test-app-utils.c | 2 +-
libgnucash/app-utils/test/test-exp-parser.c | 4 +-
libgnucash/backend/dbi/gnc-backend-dbi.cpp | 147 +-
libgnucash/backend/dbi/gnc-dbisqlconnection.cpp | 2 +-
libgnucash/backend/dbi/gnc-dbisqlconnection.hpp | 2 +-
libgnucash/backend/dbi/gnc-dbisqlresult.hpp | 4 +-
.../backend/dbi/test/test-backend-dbi-basic.cpp | 6 +-
libgnucash/backend/dbi/test/test-backend-dbi.cpp | 2 +-
libgnucash/backend/sql/gnc-entry-sql.cpp | 4 +-
libgnucash/backend/sql/gnc-invoice-sql.cpp | 4 +-
libgnucash/backend/sql/gnc-order-sql.cpp | 4 +-
libgnucash/backend/sql/gnc-price-sql.cpp | 2 +-
libgnucash/backend/sql/gnc-slots-sql.cpp | 31 +-
libgnucash/backend/sql/gnc-sql-backend.hpp | 6 +-
.../backend/sql/gnc-sql-column-table-entry.cpp | 150 +-
.../backend/sql/gnc-sql-column-table-entry.hpp | 11 +-
libgnucash/backend/sql/gnc-sql-object-backend.hpp | 6 +-
libgnucash/backend/sql/gnc-transaction-sql.cpp | 32 +-
libgnucash/backend/sql/test/test-sqlbe.cpp | 2 +-
.../backend/sql/test/utest-gnc-backend-sql.cpp | 27 -
libgnucash/backend/xml/gnc-pricedb-xml-v2.cpp | 9 +-
libgnucash/backend/xml/gnc-transaction-xml-v2.cpp | 18 +-
libgnucash/backend/xml/gnc-xml-backend.hpp | 2 +-
libgnucash/backend/xml/io-gncxml-v1.cpp | 3 +-
libgnucash/backend/xml/io-gncxml-v2.cpp | 4 +-
libgnucash/backend/xml/sixtp-dom-generators.cpp | 19 +-
libgnucash/backend/xml/sixtp-dom-generators.h | 1 -
libgnucash/backend/xml/sixtp-dom-parsers.cpp | 44 +-
libgnucash/backend/xml/sixtp-utils.cpp | 15 +-
libgnucash/backend/xml/sixtp-utils.h | 6 -
libgnucash/backend/xml/test/CMakeLists.txt | 3 +-
.../backend/xml/test/test-date-converting.cpp | 67 -
.../backend/xml/test/test-dom-converters1.cpp | 2 +-
libgnucash/doc/design/engine.texi | 4 +-
libgnucash/doc/sx.rst | 4 +-
libgnucash/engine/Account.cpp | 76 +-
libgnucash/engine/CMakeLists.txt | 4 +-
libgnucash/engine/Recurrence.c | 8 +-
libgnucash/engine/ScrubBusiness.c | 28 +-
libgnucash/engine/ScrubBusiness.h | 2 +-
libgnucash/engine/Split.c | 66 +-
libgnucash/engine/Split.h | 9 -
libgnucash/engine/SplitP.h | 26 +-
libgnucash/engine/TransLog.c | 5 +-
libgnucash/engine/Transaction.c | 89 +-
libgnucash/engine/cap-gains.c | 34 +-
libgnucash/engine/engine-deprecated.c | 208 +++
libgnucash/engine/engine-deprecated.h | 90 +
libgnucash/engine/engine-helpers-guile.h | 3 -
libgnucash/engine/engine-helpers.c | 60 -
libgnucash/engine/engine-helpers.h | 7 -
libgnucash/engine/engine.i | 7 +-
libgnucash/engine/gnc-date-p.h | 1 -
libgnucash/engine/gnc-date.cpp | 256 +--
libgnucash/engine/gnc-date.h | 130 +-
libgnucash/engine/gnc-features.c | 41 +-
libgnucash/engine/gnc-features.h | 1 +
libgnucash/engine/gnc-pricedb-p.h | 4 +-
libgnucash/engine/gnc-pricedb.c | 323 ++--
libgnucash/engine/gnc-pricedb.h | 67 +-
libgnucash/engine/gnc-timezone.cpp | 4 +-
libgnucash/engine/gncBillTerm.c | 22 +-
libgnucash/engine/gncEntry.c | 12 +-
libgnucash/engine/gncInvoice.c | 16 +-
libgnucash/engine/gncInvoice.h | 4 +-
libgnucash/engine/gncOrder.c | 4 +-
libgnucash/engine/gncOwner.c | 24 +-
libgnucash/engine/gncOwner.h | 16 +-
libgnucash/engine/gncTaxTable.c | 9 +-
libgnucash/engine/gncTaxTable.h | 4 +-
libgnucash/engine/kvp-frame.cpp | 12 +-
libgnucash/engine/kvp-scm.cpp | 13 -
libgnucash/engine/kvp-value.cpp | 16 +-
libgnucash/engine/kvp-value.hpp | 4 +-
libgnucash/engine/kvp_doc.txt | 12 +-
libgnucash/engine/qofbook.cpp | 146 +-
libgnucash/engine/qofbook.h | 21 +-
libgnucash/engine/qofinstance-p.h | 4 +-
libgnucash/engine/qofinstance.cpp | 27 +-
libgnucash/engine/qofquery.cpp | 5 +-
libgnucash/engine/qofquerycore.cpp | 2 +-
libgnucash/engine/qofsession.cpp | 27 +-
libgnucash/engine/qofsession.hpp | 1 +
libgnucash/engine/test-core/test-engine-stuff.cpp | 56 +-
libgnucash/engine/test-core/test-engine-stuff.h | 4 +-
libgnucash/engine/test/CMakeLists.txt | 2 -
libgnucash/engine/test/test-date.cpp | 417 -----
.../engine/test/test-engine-kvp-properties.c | 6 +-
libgnucash/engine/test/test-engine.c | 2 +-
libgnucash/engine/test/test-extras.scm | 17 +-
libgnucash/engine/test/test-gnc-date.c | 671 ++-----
libgnucash/engine/test/test-kvp-frame.cpp | 4 +-
libgnucash/engine/test/test-kvp-value.cpp | 4 +-
libgnucash/engine/test/test-numeric.cpp | 2 +-
libgnucash/engine/test/test-qof.c | 2 +-
libgnucash/engine/test/test-qofinstance.cpp | 53 +-
libgnucash/engine/test/test-qofsession.cpp | 1 +
libgnucash/engine/test/utest-Account.cpp | 2 +-
libgnucash/engine/test/utest-Budget.c | 2 +-
libgnucash/engine/test/utest-Invoice.c | 156 +-
libgnucash/engine/test/utest-Split.cpp | 23 +-
libgnucash/engine/test/utest-Transaction.cpp | 18 +-
libgnucash/engine/test/utest-gnc-pricedb.c | 256 +--
po/POTFILES.in | 7 +-
po/ar.po | 10 +-
po/as.po | 10 +-
po/az.po | 4 +-
po/bg.po | 6 +-
po/brx.po | 10 +-
po/ca.po | 10 +-
po/cs.po | 4 +-
po/da.po | 6 +-
po/de.po | 12 +-
po/doi.po | 8 +-
po/el.po | 6 +-
po/en_GB.po | 6 +-
po/es.po | 14 +-
po/es_NI.po | 4 +-
po/eu.po | 6 +-
po/fa.po | 4 +-
po/fi.po | 4 +-
po/fr.po | 8 +-
po/glossary/ar.po | 2 +-
po/glossary/bg.po | 2 +-
po/glossary/ca.po | 2 +-
po/glossary/da.po | 2 +-
po/glossary/de.po | 2 +-
po/glossary/de_CH.po | 2 +-
po/glossary/el.po | 2 +-
po/glossary/es.po | 2 +-
po/glossary/fr.po | 2 +-
po/glossary/gnc-glossary.txt | 2 +-
po/glossary/he.po | 2 +-
po/glossary/hu.po | 2 +-
po/glossary/it.po | 2 +-
po/glossary/lt.po | 2 +-
po/glossary/nb.po | 2 +-
po/glossary/nl.po | 2 +-
po/glossary/pl.po | 2 +-
po/glossary/pt.po | 2 +-
po/glossary/pt_BR.po | 2 +-
po/glossary/ru.po | 2 +-
po/glossary/rw.po | 2 +-
po/glossary/sk.po | 2 +-
po/glossary/sv.po | 2 +-
po/glossary/vi.po | 2 +-
po/glossary/zh_CN.po | 2 +-
po/glossary/zh_TW.po | 2 +-
po/gnucash-pot.cmake | 2 +-
po/gu.po | 8 +-
po/he.po | 6 +-
po/hi.po | 10 +-
po/hu.po | 6 +-
po/it.po | 8 +-
po/ja.po | 6 +-
po/kn.po | 10 +-
po/ko.po | 6 +-
po/kok.po | 10 +-
po/kok at latin.po | 6 +-
po/ks.po | 8 +-
po/lt.po | 10 +-
po/lv.po | 10 +-
po/mai.po | 10 +-
po/mni.po | 10 +-
po/mni at bengali.po | 8 +-
po/mr.po | 10 +-
po/nb.po | 4 +-
po/ne.po | 6 +-
po/nl.po | 14 +-
po/pl.po | 4 +-
po/pt.po | 6 +-
po/pt_BR.po | 6 +-
po/ro.po | 6 +-
po/ru.po | 10 +-
po/rw.po | 4 +-
po/sk.po | 12 +-
po/sr.po | 8 +-
po/sv.po | 6 +-
po/ta.po | 10 +-
po/te.po | 10 +-
po/tr.po | 12 +-
po/uk.po | 6 +-
po/ur.po | 10 +-
po/vi.po | 6 +-
po/zh_CN.po | 6 +-
po/zh_TW.po | 6 +-
409 files changed, 10276 insertions(+), 5609 deletions(-)
create mode 100644 borrowed/jenny/jenny.c
delete mode 100644 borrowed/libc/strfmon.c
delete mode 100644 borrowed/libc/strfmon.h
create mode 100644 contrib/art/gnucash-bugzilla-favicons/android-chrome-192x192.png
create mode 100644 contrib/art/gnucash-bugzilla-favicons/android-chrome-512x512.png
create mode 100644 contrib/art/gnucash-bugzilla-favicons/apple-touch-icon.png
create mode 100644 contrib/art/gnucash-bugzilla-favicons/browserconfig.xml
create mode 100644 contrib/art/gnucash-bugzilla-favicons/favicon-16x16.png
create mode 100644 contrib/art/gnucash-bugzilla-favicons/favicon-32x32.png
create mode 100644 contrib/art/gnucash-bugzilla-favicons/favicon.ico
create mode 100644 contrib/art/gnucash-bugzilla-favicons/mstile-150x150.png
create mode 100644 contrib/art/gnucash-bugzilla-favicons/safari-pinned-tab.svg
create mode 100644 contrib/art/gnucash-bugzilla-favicons/site.webmanifest
create mode 100644 contrib/art/gnucash-bugzilla-logo.svg
create mode 100644 contrib/art/gnucash-wiki-favicons/android-chrome-192x192.png
create mode 100644 contrib/art/gnucash-wiki-favicons/android-chrome-512x512.png
create mode 100644 contrib/art/gnucash-wiki-favicons/apple-touch-icon.png
create mode 100644 contrib/art/gnucash-wiki-favicons/browserconfig.xml
create mode 100644 contrib/art/gnucash-wiki-favicons/favicon-16x16.png
create mode 100644 contrib/art/gnucash-wiki-favicons/favicon-32x32.png
create mode 100644 contrib/art/gnucash-wiki-favicons/favicon.ico
create mode 100644 contrib/art/gnucash-wiki-favicons/mstile-150x150.png
create mode 100644 contrib/art/gnucash-wiki-favicons/safari-pinned-tab.svg
create mode 100644 contrib/art/gnucash-wiki-favicons/site.webmanifest
create mode 100644 contrib/art/gnucash-wiki-logo.svg
rename gnucash/gnome/{assistant-loan.c => assistant-loan.cpp} (92%)
delete mode 100644 gnucash/import-export/ofx/gnc-ofx-kvp.c
delete mode 100644 gnucash/import-export/ofx/gnc-ofx-kvp.h
create mode 100644 gnucash/python/gncmod-python.c
create mode 100644 gnucash/report/report-system/test/test-commodity-utils.scm
delete mode 100644 gnucash/report/standard-reports/test/test-balance-sheet.scm
create mode 100644 gnucash/report/standard-reports/test/test-balsheet-pnl.scm
create mode 100644 gnucash/report/standard-reports/test/test-stress-options.scm
delete mode 100644 libgnucash/backend/xml/test/test-date-converting.cpp
create mode 100644 libgnucash/engine/engine-deprecated.c
create mode 100644 libgnucash/engine/engine-deprecated.h
delete mode 100644 libgnucash/engine/test/test-date.cpp
More information about the gnucash-changes
mailing list