mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove static current_session variable of libqof - we keep one in gnc-session.c already.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18780 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -53,9 +53,6 @@
|
||||
#include "qofobject-p.h"
|
||||
#include "qofla-dir.h" /* for QOF_LIB_DIR */
|
||||
|
||||
/** \deprecated should not be static */
|
||||
static QofSession * current_session = NULL;
|
||||
|
||||
static GHookList * session_closed_hooks = NULL;
|
||||
static QofLogModule log_module = QOF_MOD_SESSION;
|
||||
static GSList *provider_list = NULL;
|
||||
@@ -234,29 +231,6 @@ qof_session_new (void)
|
||||
return session;
|
||||
}
|
||||
|
||||
/** \deprecated Each application should keep
|
||||
their \b own session context. */
|
||||
QofSession *
|
||||
qof_session_get_current_session (void)
|
||||
{
|
||||
if (!current_session)
|
||||
{
|
||||
qof_event_suspend ();
|
||||
current_session = qof_session_new ();
|
||||
qof_event_resume ();
|
||||
}
|
||||
|
||||
return current_session;
|
||||
}
|
||||
|
||||
/** \deprecated Each application should keep
|
||||
their \b own session context. */
|
||||
void
|
||||
qof_session_set_current_session (QofSession *session)
|
||||
{
|
||||
current_session = session;
|
||||
}
|
||||
|
||||
QofBook *
|
||||
qof_session_get_book (const QofSession *session)
|
||||
{
|
||||
@@ -1602,8 +1576,6 @@ qof_session_destroy (QofSession *session)
|
||||
}
|
||||
|
||||
session->books = NULL;
|
||||
if (session == current_session)
|
||||
current_session = NULL;
|
||||
|
||||
g_free (session);
|
||||
|
||||
|
||||
@@ -111,8 +111,6 @@ typedef struct _QofSession QofSession;
|
||||
|
||||
QofSession * qof_session_new (void);
|
||||
void qof_session_destroy (QofSession *session);
|
||||
QofSession * qof_session_get_current_session (void);
|
||||
void qof_session_set_current_session (QofSession *session);
|
||||
|
||||
/** The qof_session_swap_data () method swaps the book of
|
||||
* the two given sessions. It is useful
|
||||
|
||||
Reference in New Issue
Block a user