mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
misc cleanup
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6464 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
fe06d38842
commit
72a17bc35d
@ -128,17 +128,24 @@ GNCBook * gnc_book_close_period (GNCBook *, Timespec,
|
||||
*/
|
||||
void gnc_book_partition (GNCBook *dest, GNCBook *src, Query *);
|
||||
|
||||
/* The gnc_book_insert_trans() routine takes an existing transaction
|
||||
* that is located in one book, and moves it to another book.
|
||||
* It moves all of the splits as well. In the course of the
|
||||
* move, the transaction is literally deleted from the first
|
||||
* book as its placed into the second. The transaction and
|
||||
* split GUID's are not changed in the move. This routine
|
||||
* assumes that twin accounts already exist in both books
|
||||
* (and can be located with the standard twining proceedure).
|
||||
/* The gnc_book_insert_trans_clobber() routine takes an existing
|
||||
* transaction that is located in one book, and moves it to
|
||||
* another book. It moves all of the splits as well. In the
|
||||
* course of the move, the transaction is literally deleted
|
||||
* from the first book as its placed into the second. The
|
||||
* transaction and split GUID's are not changed in the move.
|
||||
* This routine assumes that twin accounts already exist in
|
||||
* both books (and can be located with the standard twining
|
||||
* proceedure).
|
||||
*
|
||||
* The gnc_book_insert_trans() routine does the same as the above,
|
||||
* except that it doesn't actually clobber the transaction: it
|
||||
* merely moves the transaction and split GUID's to the new
|
||||
* books' entity tables, and not much else.
|
||||
*/
|
||||
|
||||
void gnc_book_insert_trans (GNCBook *book, Transaction *trans);
|
||||
void gnc_book_insert_trans_clobber (GNCBook *book, Transaction *trans);
|
||||
|
||||
#endif /* XACC_PERIOD_H */
|
||||
|
||||
|
@ -243,11 +243,12 @@ gnc_session_load_backend(GNCSession * session, char * backend_name)
|
||||
LEAVE (" ");
|
||||
}
|
||||
|
||||
gboolean
|
||||
void
|
||||
gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
gboolean ignore_lock, gboolean create_if_nonexistent)
|
||||
{
|
||||
if (!session) return FALSE;
|
||||
if (!session) return;
|
||||
|
||||
ENTER (" sess=%p book=%p ignore_lock=%d, book-id=%s",
|
||||
session, session->book, ignore_lock,
|
||||
book_id ? book_id : "(null)");
|
||||
@ -260,7 +261,7 @@ gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
{
|
||||
gnc_session_push_error (session, ERR_BACKEND_LOCKED, NULL);
|
||||
LEAVE("bad book url");
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
/* seriously invalid */
|
||||
@ -268,7 +269,7 @@ gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
{
|
||||
gnc_session_push_error (session, ERR_BACKEND_NO_BACKEND, NULL);
|
||||
LEAVE("bad book_id");
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
/* Store the sessionid URL */
|
||||
session->book_id = g_strdup (book_id);
|
||||
@ -278,7 +279,7 @@ gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
{
|
||||
gnc_session_push_error (session, ERR_FILEIO_FILE_NOT_FOUND, NULL);
|
||||
LEAVE("bad fullpath");
|
||||
return FALSE; /* ouch */
|
||||
return;
|
||||
}
|
||||
PINFO ("filepath=%s", session->fullpath ? session->fullpath : "(null)");
|
||||
|
||||
@ -341,25 +342,24 @@ gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
session->book_id = NULL;
|
||||
gnc_session_push_error (session, err, NULL);
|
||||
LEAVE("backend error %d", err);
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
LEAVE (" sess=%p book=%p book-id=%s",
|
||||
session, session->book,
|
||||
book_id ? book_id : "(null)");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
gboolean
|
||||
void
|
||||
gnc_session_load (GNCSession *session)
|
||||
{
|
||||
GNCBook *oldbook;
|
||||
Backend *be;
|
||||
|
||||
if (!session) return FALSE;
|
||||
if (!gnc_session_get_url(session)) return FALSE;
|
||||
if (!session) return;
|
||||
if (!gnc_session_get_url(session)) return;
|
||||
|
||||
ENTER ("sess=%p book_id=%s", session, gnc_session_get_url(session)
|
||||
? gnc_session_get_url(session) : "(null)");
|
||||
@ -419,20 +419,20 @@ gnc_session_load (GNCSession *session)
|
||||
{
|
||||
/* ?? should we restore the oldbook here ?? */
|
||||
LEAVE("topgroup NULL");
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gnc_book_get_pricedb (session->book))
|
||||
{
|
||||
/* ?? should we restore the oldbook here ?? */
|
||||
LEAVE("pricedb NULL");
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (gnc_session_get_error(session) != ERR_BACKEND_NO_ERR)
|
||||
{
|
||||
LEAVE("error from backend %d", gnc_session_get_error(session));
|
||||
return FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
xaccLogDisable();
|
||||
@ -442,8 +442,6 @@ gnc_session_load (GNCSession *session)
|
||||
|
||||
LEAVE ("sess = %p, book_id=%s", session, gnc_session_get_url(session)
|
||||
? gnc_session_get_url(session) : "(null)");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -105,33 +105,32 @@ void gnc_session_swap_data (GNCSession *session_1, GNCSession *session_2);
|
||||
* If set to FALSE, then file/database-global locks will be tested and
|
||||
* obeyed.
|
||||
*
|
||||
* If the datastore exists, can be reached (e.g over the net), connected
|
||||
* to, opened and read, and a lock can be obtained then a lock will be
|
||||
* obtained and the function returns TRUE. Note that multi-user
|
||||
* datastores (e.g. the SQL backend) typically will not need to get a
|
||||
* global lock, and thus, the user will not be locked out. That's the
|
||||
* If the datastore exists, can be reached (e.g over the net),
|
||||
* connected to, opened and read, and a lock can be obtained then
|
||||
* a lock will be obtained. Note that multi-user datastores
|
||||
* (e.g. the SQL backend) typically will not need to get a global
|
||||
* lock, and thus, the user will not be locked out. That's the
|
||||
* whole point of 'multi-user'.
|
||||
*
|
||||
* If the file/database doesn't exist, and the create_if_nonexistent
|
||||
* flag is set to TRUE, then the database is created.
|
||||
*
|
||||
* Otherwise the function returns FALSE.
|
||||
* If an error occurs, it will be pushed onto the session error
|
||||
* stack, and that is where it should be examined.
|
||||
*/
|
||||
gboolean gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
void gnc_session_begin (GNCSession *session, const char * book_id,
|
||||
gboolean ignore_lock, gboolean create_if_nonexistent);
|
||||
|
||||
|
||||
/* The gnc_session_load() method causes the GNCBook to be made ready to
|
||||
/*
|
||||
* The gnc_session_load() method causes the GNCBook to be made ready to
|
||||
* to use with this URL/datastore. When the URL points at a file,
|
||||
* then this routine would load the data from the file. With remote
|
||||
* backends, e.g. network or SQL, this would load only enough data
|
||||
* to make teh book actually usable; it would not cause *all* of the
|
||||
* data to be loaded.
|
||||
*
|
||||
* The function returns TRUE on success.
|
||||
* (Hack alert ... what does failure mean ???)
|
||||
*/
|
||||
gboolean gnc_session_load (GNCSession *session);
|
||||
void gnc_session_load (GNCSession *session);
|
||||
|
||||
/* The gnc_session_get_error() routine can be used to obtain the reason
|
||||
* for any failure. Calling this routine returns the current error.
|
||||
|
@ -1584,7 +1584,7 @@ when no longer needed.")
|
||||
(gw:wrap-function
|
||||
mod
|
||||
'gnc:session-begin
|
||||
'<gw:bool>
|
||||
'<gw:void>
|
||||
"gnc_session_begin"
|
||||
'((<gnc:Session*> session)
|
||||
((<gw:m-chars-caller-owned> gw:const) id)
|
||||
@ -1595,7 +1595,7 @@ when no longer needed.")
|
||||
(gw:wrap-function
|
||||
mod
|
||||
'gnc:session-load
|
||||
'<gw:bool>
|
||||
'<gw:void>
|
||||
"gnc_session_load"
|
||||
'((<gnc:Session*> session))
|
||||
"Load the data associated with the given session.")
|
||||
|
@ -1,5 +1,7 @@
|
||||
|
||||
/* test file created by Linas Vepstas <linas@linas.org>
|
||||
/* Test file created by Linas Vepstas <linas@linas.org>
|
||||
* Minimal test to see if a book can be split into two periods
|
||||
* without crashing.
|
||||
* December 2001
|
||||
* License: GPL
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user