The actual change to configure.ac (at line 1106) to enable -Wunused -- or rather to un-disable it -- is not included in order to not break the build for folks with buggy versions of swig.
(For example, https://sourceforge.net/tracker/?func=detail&aid=3530021&group_id=1645&atid=101645)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22203 57a11ea4-9604-0410-9ed3-97b8803252fd
In the new string cache (split out from qofutil.c/.h), the GHashTable has the
string as key and a small heap-allocated guint refcount as data. The value is
allocated rather than being used by value because there is no way to just
modify the data field of an existing key. The key would need to be changed at
the same time, which would free the old key value and invalidate all gchar
pointers of objects which have refs to the key.
Unit tests added as well.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22190 57a11ea4-9604-0410-9ed3-97b8803252fd
The windows build has been failing for several days due to this.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22146 57a11ea4-9604-0410-9ed3-97b8803252fd
I'd originally put the functions supporting log detection, qof event handling, and mock-counting in test-stuff along with the functions that support the older "make check" integration tests. There are now more unit test support functions than there are of the older functions, so it's time for them to move out on their own.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22132 57a11ea4-9604-0410-9ed3-97b8803252fd
(Initially I thought there were a relation to the "freeze" state of a
transaction, but this turned out to be not the case.)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22118 57a11ea4-9604-0410-9ed3-97b8803252fd
The number of days for this read-only threshold can be chosen.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22107 57a11ea4-9604-0410-9ed3-97b8803252fd
As usual, re-indentation was done using astyle-1.24 using the following options:
astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22089 57a11ea4-9604-0410-9ed3-97b8803252fd
To my surprise, this apparently also fixes a memory leak, but I don't know why.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22074 57a11ea4-9604-0410-9ed3-97b8803252fd
The strspn() call was added in r8500 but the usage of its return value
was removed in r10315, so it isn't neccesary anyway.
The macro GNC_DEPRECATED is defined nowhere and used nowhere else, so
we can remove that block altogether.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22071 57a11ea4-9604-0410-9ed3-97b8803252fd
Separate the two uses of QofBook::dirty -- indicating that the book object
itself has been edited and indicating that some object in the dataset has
been changed -- into two separate variables with separate getters & setters.
The latter purpose, indicating that some object has been changed, is moved
to a new member variable of QofBook, session_dirty. Its new setter
qof_book_mark_session_dirty() and canceler qof_book_mark_session_saved()
are called only from the xml backend or gnc-autosave(). Its tester,
qof_book_session_not_saved() is used to check for the need to autosave
and to activate FileSaveAction.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21832 57a11ea4-9604-0410-9ed3-97b8803252fd
As usual, re-indentation was done using astyle-1.24 using the following options:
astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21816 57a11ea4-9604-0410-9ed3-97b8803252fd
Otherwise the temporary new session during "Save As" is read-only where in reality
it shouldn't be (but the old session should).
This makes "Save As" work correctly, but many UI elements don't get updated
to reflect the fact we've now got a read-write book again. (E.g., all open registers.)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21795 57a11ea4-9604-0410-9ed3-97b8803252fd
Compile test-core/test-stuff.c into test-qof, then recompile test-core as a module for dealing with noise from Guile and Python tests.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21736 57a11ea4-9604-0410-9ed3-97b8803252fd
analysis.
As a result, some unused functions and function prototypes are removed.
It did expose one real bug in Transaction.c so far.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21687 57a11ea4-9604-0410-9ed3-97b8803252fd
Fix some errors in r21570 which cause "make distcheck" to fail, and a couple of others besides.
While this gets distcheck to work on the Mac, there are still some problems with the standard-reports test on Linux related to trying to load reports from the installation directory (make install is run *after* make check during make distcheck). This test passes on the Mac, fails on Linux.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21645 57a11ea4-9604-0410-9ed3-97b8803252fd
In particular, glib doesn't offer a function for easily accessing
the "today" date as a GDate. What a pity. It's added now as gnc_g_date_new_today().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21559 57a11ea4-9604-0410-9ed3-97b8803252fd
No more, no less. This object isn't used in any other way in gnucash, so
we better get rid of the extra potential complexity here.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21548 57a11ea4-9604-0410-9ed3-97b8803252fd
Subsequently, the QofBook pointer in QofSession can be changed from
a GList to a QofBook*.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21526 57a11ea4-9604-0410-9ed3-97b8803252fd
The file chooser dialog would return a directory if the user selected
one and clicked "Open"; then, or if the users specified a directory on
the command line, Gnucash would present the rather misleading error "No
backend found".
So, first, if the user selects a directory and clicks open, the chooser
will now open the directory for browsing, just as if she had
double-clicked on the directory name in the tree view.
Next, if a directory is presented to qof_session_begin it will detect
that and set ERR_BACKEND_BAD_URL, which gnc_post_file_open will detect
and re-present the file chooser, open to that directory. (To prevent
confusion, gnc_post_file_open will put up the error dialog for BAD_URL;
the new file chooser dialog will open after that's dismissed. Since
there are other possible causes of a BAD_URL, if the filename isn't a
directory the chooser will open to the registered default directory from
GConf.)
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21459 57a11ea4-9604-0410-9ed3-97b8803252fd
Author: John W. O'Brien <john@saltant.com>
In gnc-backend-dbi.c, accept enumerated result from conn_test_dbi_library(),
then throw ERR_SQL_DBI_UNTESTABLE if the test setup failed, or ERR_SQL_BAD_DBI
if at least one test case failed.
Define ERR_SQL_DBI_UNTESTABLE error code and message.
Define GncDbiTestResult enumerated type.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21269 57a11ea4-9604-0410-9ed3-97b8803252fd
variables which have leaked in over the years.
Emacs users should add the following to their .emacs files:
(c-add-style "gnucash"
'("k&r"
(c-basic-offset . 4)
(c-offsets-alist . ((case-label . +)) )
(c-hanging-braces-alist . ((substatement-open before after)
(block-close before after)) )
))
Users with Emacs version 23 and later can add this as well:
(dir-locals-set-class-variables 'gnucash-project
'((indent-tabs-mode . nil)
(fill-column . 80)
(c-mode . ((c-file-style . "gnucash")))
(c++-mode . ((c-file-style . "gnucash")))))
(dir-locals-set-directory-class "/path/to/gnucash-svn" 'gnucash-project)
Users with earlier versions should at least add
(setq indent-tabs-mode nil)
and should consider adding
(c-default-style ('((c-mode . "gnucash"))))
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21221 57a11ea4-9604-0410-9ed3-97b8803252fd
As usual, re-indentation was done using astyle-1.24 using the following options:
astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21205 57a11ea4-9604-0410-9ed3-97b8803252fd
Note: The qofmath128 functions are used mostly here and almost
nowhere else. Hence, we inline the C code directly into here so
that the compiler can potentially inline the code as-is and speed
up the gnc-numeric.c functions.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21127 57a11ea4-9604-0410-9ed3-97b8803252fd