Commit Graph

12788 Commits

Author SHA1 Message Date
Phil Longstaff
f1cabaa310 Fix bug 611885 - Crash when opening postgresql file
Previous work setting Timespec values via gobject properties missed the case where the timespec loaded from the database was NULL.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18848 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-06 10:40:53 +00:00
Christian Stimming
d6a0ecd174 Cutecash: Remove QSharedPointer because manual delete is sufficient.
Also, the QSharedPointer cannot be used for bookkeeping of a C pointer
to any gnucash object because it refuses to work if it doesn't know the
actual struct definition, which in gnucash is always private. The
boost::shared_ptr would work without (by the custom deleter argument in the
constructor), but QSharedPointer doesn't (the custom deleter is accepted
only in addition to the known storage size, not alternatively), so it is
pointless here.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18847 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 20:46:35 +00:00
Christian Stimming
650b6ffa10 Cutecash: Add version check for guile and define HAVE_GUILE18 if appropriate.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18846 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 20:41:40 +00:00
Christian Stimming
18f663de25 Adapt cutecash to r18842.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18845 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 20:32:13 +00:00
Christian Stimming
c6e43486f8 Cutecash: Fix extern "C" usage: Must not enclose system includes, supposedly.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18844 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 20:31:51 +00:00
Christian Stimming
57f38d14ea Cutecash: Allow older glib versions as well.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18843 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 20:31:31 +00:00
Geert Janssens
6a6fe1690e Use a normalized uri format internally to refer to data stores.
Data stores for GC can be a file (xml or sqlite3) or a database
one some server (mysql or postgres).
Wherever it makes sense internally, data stores will be referred to
via a normalized uri:
protocol://user:password@host:port/path
Depending on the context and story type some of these parts are optional or unused.

To achieve this, a new utility interface has been setup:
gnc_uri_<xxx>_<yyy>
that can be used to manipulate the uris or convert from non-normalized
formats to normalized and back.
For example, when the user selects a file in the Open or Save As dialog,
gnc_uri_get_normalized_uri will convert the file into a normalized uri.
Or when the actual filename is needed this can be extracted with
gnc_uri_get_path.
You can also test if a uri defines a file or something else with
gnc_uri_is_file_uri.

For the complete documentation, see src/core-utils/gnc-uri-uitls.h

This commit installs gnc-uri-utils and modifies the source where it makes
sense to use its convenience functions. This concerns all functions that
had to deal with file access in some way or another, the history module
and the functions that generate the history menu list and the window titles.

Note that gnc-uri-utils replaces xaccResolveFilePath and xaccResolveUrl in all cases.
xaccResolveUrl has been removed, because gnc-uri-utils fully replaces its functionality.
xaccResolveFilePath is used internally in gnc-uri-utils to ensure an absolute path
is always returned (in case of a file uri, not for db uris). But it has been renamed to
gnc_resolve_file_path to be more consistent with the other functions.

Lastly, this commit also adds a first implementation to work with a keyring to
store and retrieve passwords, althoug

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18842 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 20:15:31 +00:00
Christian Stimming
a007db0301 Make business backend initialization functions accessible when statically linking
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18841 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 19:57:25 +00:00
Christian Stimming
8b646bb485 MSVC compatibility: Disable "C99 designated initializers" by a compiler-dependent macro
Same as r18755.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18840 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 19:57:04 +00:00
Christian Stimming
249a8c5612 Cutecash: Add business-core including business-core/xml into the executable.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18839 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 19:56:43 +00:00
Christian Stimming
52af11d179 Make the backend initialization functions accessible when statically linking
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18838 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 19:56:12 +00:00
Geert Janssens
7934771fe6 Change the definition of QOF_STDOUT
The old definition file: conflicts with normal uris that can
start with file: as well.
I have chosen > instead, which is never a valid filename and
on unixlike systems associated with standard out operations.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18837 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 19:55:20 +00:00
Phil Longstaff
5fefa33c7b Use proper qof CFLAGS/LDFLAGS since core-utils now uses qof
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18836 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 17:57:08 +00:00
Phil Longstaff
e822188f65 The webkit used on win32 has webkit_web_frame_print_full() defined in include files, so we don't need a potentially conflicting extern declaration.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18835 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 17:56:02 +00:00
Phil Longstaff
be4fce5ed5 If gmtime_r is defined as a macro, undef it
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18834 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 17:55:01 +00:00
Geert Janssens
8a66cc528b Add svn:ignore to src/core-utils/test
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18833 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 17:01:38 +00:00
Geert Janssens
ab9a4060c2 Remove invalid target (got copied from src/engine/test)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18832 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-05 16:56:19 +00:00
Geert Janssens
23361112f1 Build test-core before core-utils
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18831 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:49:43 +00:00
Geert Janssens
65e51d1592 Add the core-utils tests in the automake system
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18830 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:48:38 +00:00
Geert Janssens
2b2f1ac001 Move filepath related tests to core-utils/test
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18829 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:13:58 +00:00
Phil Longstaff
78d8fba84e Undefine localtime_r as a macro (new mingw pthreads package defines it)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18828 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:06:23 +00:00
Phil Longstaff
210472586c Add braces to make if-if-then-else structure clear and avoid GCC 4.4.0 error message
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18827 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:04:23 +00:00
Geert Janssens
98bfef5845 Remove gncmod-test from test-core
It's not used and prevents test-core from being included in core-utils tests

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18826 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 22:03:42 +00:00
Christian Stimming
3aac125c18 Add copyright notices in cutecash source code files.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18825 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 21:44:38 +00:00
Phil Longstaff
4ebca1d785 Add missing NULL sentinel at end of g_strconcat() function call
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18824 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 21:39:47 +00:00
John Ralls
5cedef8da8 Removed erroneously re-created src/engine/gnc-filepath-utils.c
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18823 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 21:20:28 +00:00
Christian Stimming
c804244c17 Cutecash: Copy some more icons into the program. Add a clickable hyperlink.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18822 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 21:05:58 +00:00
Geert Janssens
fbf05a2522 Move binreloc library include
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18821 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 20:53:21 +00:00
Christian Stimming
f5f17c227e Note the moved files in POTFILES.in.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18820 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 20:28:17 +00:00
Christian Stimming
0df2d5f8d5 Remove C executable from cmake as it is no longer necessary.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18819 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 20:04:35 +00:00
Christian Stimming
1bf6bd2e38 Add missing link library after r18811.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18818 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 20:04:15 +00:00
Christian Stimming
2d045b67ae Adapt cmake to the file move in r18811.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18817 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 19:50:45 +00:00
John Ralls
870aed7740 Add src/engine/test/test-resolve-url
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18816 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 19:21:52 +00:00
Christian Stimming
dffacfefc7 Finish cmake build system for the C++ experiment.
To build this:

mkdir build-cpp
cd build-cpp
cmake ..
make
./src/gnc/cutecash

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18815 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 17:48:36 +00:00
Christian Stimming
6087cfd688 C++ experiment: Extend the AccountModel into a table with name and description.
Use QString everywhere as well.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18814 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 17:48:12 +00:00
Christian Stimming
4708f169ea Win32: Add download of cmake, disabled by default.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18813 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 17:47:51 +00:00
Christian Stimming
d84edc52d8 MSVC compatibility: strftime() doesn't know "%T" here. Also, g_fopen doesn't work, but fopen does.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18812 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 17:47:28 +00:00
Geert Janssens
58680c35b8 Move gnc-filepath-utils and dependencies from engine to core-utils
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18811 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 16:32:54 +00:00
Geert Janssens
2e5c6f1cee Typo fixes, as found by doxygen.log, patch by Jesse Weinstein
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18810 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 10:31:41 +00:00
Geert Janssens
ed33fc5226 Tweak to gnc-svnversion's bzr section, patch by Jesse Weinstein
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18809 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 09:53:57 +00:00
Phil Longstaff
4054482bf8 Use "template-account" property to get/set template account.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18808 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 00:58:28 +00:00
Phil Longstaff
2eaa8345a9 Add "template-account" to schedxaction as a gobject property.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18807 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-04 00:56:41 +00:00
Phil Longstaff
b4172691ea Simplify handling of sx template_acct column.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18806 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 23:37:51 +00:00
Phil Longstaff
c080f3a8bd GDate values weren't being properly fetched from objects to be saved in a database column if they were fetched as a gobject property.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18805 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 23:34:49 +00:00
Christian Stimming
dbb5d0ddda C++ experiment: Add first simple model/view widget for the loaded account list.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18804 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 21:50:49 +00:00
Phil Longstaff
3b4183839c Clean up account column in the lot table to specify that the guid is an account reference. Simplifies the code a bit, and makes future use of foreign keys easier.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18803 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 21:34:01 +00:00
Christian Stimming
91fd0d2f31 Bug #611140: Fix crash on Open Subaccounts (hopefully).
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18802 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 20:59:58 +00:00
Christian Stimming
b71802aefd Some more C++ work. Opening an existing file works, even though nothing is visible so far.
The implementation of a scoped_ptr wrapper around a C object
uses the boost library, though, because writing our own
implementation of a scoped_ptr with custom deletion function
is too non-trivial and I rather re-use the boost::shared_ptr
here instead of making our own mistakes.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18801 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 20:47:31 +00:00
Christian Stimming
b7b34b87c9 Rename GNCBook into QofBook everywhere and remove separate header gnc-book.h.
The former was already #define'd on the latter, so its removal gets
rid of one level of indirection which makes function lookup easier.
Also, the macro (!) qof_book_get_slots was turned into a normal
function again because that's what functions are for (and otherwise
the additional declaration in engine.i would break).

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18800 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 20:47:10 +00:00
Christian Stimming
44b63315df Decrease compiler warnings by removing unused variables.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18799 57a11ea4-9604-0410-9ed3-97b8803252fd
2010-03-03 20:46:41 +00:00