r18780 - gnucash/trunk/src/libqof/qof - Remove static current_session variable of libqof - we keep one in gnc-session.c already.

Christian Stimming cstim at code.gnucash.org
Tue Mar 2 15:21:37 EST 2010


Author: cstim
Date: 2010-03-02 15:21:37 -0500 (Tue, 02 Mar 2010)
New Revision: 18780
Trac: http://svn.gnucash.org/trac/changeset/18780

Modified:
   gnucash/trunk/src/libqof/qof/qofsession.c
   gnucash/trunk/src/libqof/qof/qofsession.h
Log:
Remove static current_session variable of libqof - we keep one in gnc-session.c already.

Modified: gnucash/trunk/src/libqof/qof/qofsession.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession.c	2010-03-02 14:54:34 UTC (rev 18779)
+++ gnucash/trunk/src/libqof/qof/qofsession.c	2010-03-02 20:21:37 UTC (rev 18780)
@@ -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 @@
     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 @@
     }
 
     session->books  = NULL;
-    if (session == current_session)
-        current_session = NULL;
 
     g_free (session);
 

Modified: gnucash/trunk/src/libqof/qof/qofsession.h
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession.h	2010-03-02 14:54:34 UTC (rev 18779)
+++ gnucash/trunk/src/libqof/qof/qofsession.h	2010-03-02 20:21:37 UTC (rev 18780)
@@ -111,8 +111,6 @@
 
 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



More information about the gnucash-changes mailing list