r21547 - gnucash/trunk/src/libqof/qof - Revert r21517 "Add is_readonly attribute to QofSession class."
Christian Stimming
cstim at code.gnucash.org
Wed Nov 9 16:45:00 EST 2011
Author: cstim
Date: 2011-11-09 16:44:58 -0500 (Wed, 09 Nov 2011)
New Revision: 21547
Trac: http://svn.gnucash.org/trac/changeset/21547
Modified:
gnucash/trunk/src/libqof/qof/qofsession-p.h
gnucash/trunk/src/libqof/qof/qofsession.c
gnucash/trunk/src/libqof/qof/qofsession.h
Log:
Revert r21517 "Add is_readonly attribute to QofSession class."
This is not needed. See
http://lists.gnucash.org/pipermail/gnucash-devel/2011-November/032793.html
and thread.
Modified: gnucash/trunk/src/libqof/qof/qofsession-p.h
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession-p.h 2011-11-09 15:22:38 UTC (rev 21546)
+++ gnucash/trunk/src/libqof/qof/qofsession-p.h 2011-11-09 21:44:58 UTC (rev 21547)
@@ -64,7 +64,6 @@
* between the persistant store and the local engine. */
QofBackend *backend;
gint lock;
- gboolean is_readonly;
};
Modified: gnucash/trunk/src/libqof/qof/qofsession.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession.c 2011-11-09 15:22:38 UTC (rev 21546)
+++ gnucash/trunk/src/libqof/qof/qofsession.c 2011-11-09 21:44:58 UTC (rev 21547)
@@ -218,7 +218,6 @@
session->book_id = NULL;
session->backend = NULL;
session->lock = 1;
- session->is_readonly = FALSE;
qof_session_clear_error (session);
}
@@ -252,18 +251,6 @@
return session->backend;
}
-gboolean qof_session_is_readonly(const QofSession * session)
-{
- g_assert(session);
- return session->is_readonly;
-}
-
-void qof_session_set_readonly(QofSession* session, gboolean is_readonly)
-{
- g_assert(session);
- session->is_readonly = is_readonly;
-}
-
const char *
qof_session_get_file_path (const QofSession *session)
{
@@ -628,15 +615,6 @@
session, session->book_id ? session->book_id : "(null)");
/* Partial book handling. */
book = qof_session_get_book(session);
-
- if (qof_session_is_readonly(session) || qof_book_is_readonly(book))
- {
- // Well, we are read-only, so saving is not allowed.
- msg = g_strdup_printf("session is marked as read-only");
- qof_session_push_error(session, ERR_BACKEND_READONLY, msg);
- goto leave;
- }
-
partial = (gboolean)GPOINTER_TO_INT(qof_book_get_data(book, PARTIAL_QOFBOOK));
change_backend = FALSE;
msg = g_strdup_printf(" ");
@@ -788,13 +766,6 @@
char *msg = NULL;
g_return_if_fail( be != NULL );
g_return_if_fail( be->safe_sync != NULL );
- if (qof_session_is_readonly(session))
- {
- // Well, we are read-only, so saving is not allowed.
- qof_session_push_error(session, ERR_BACKEND_READONLY, "session is marked as read-only");
- return;
- }
-
be->percentage = percentage_func;
(be->safe_sync)( be, qof_session_get_book( session ));
err = qof_backend_get_error(session->backend);
Modified: gnucash/trunk/src/libqof/qof/qofsession.h
===================================================================
--- gnucash/trunk/src/libqof/qof/qofsession.h 2011-11-09 15:22:38 UTC (rev 21546)
+++ gnucash/trunk/src/libqof/qof/qofsession.h 2011-11-09 21:44:58 UTC (rev 21547)
@@ -212,12 +212,6 @@
const char * qof_session_get_url (const QofSession *session);
-/** Returns TRUE if this session is marked as read-only, otherwise FALSE. */
-gboolean qof_session_is_readonly(const QofSession * session);
-
-/** Sets the is_readonly value to the given value. */
-void qof_session_set_readonly(QofSession* session, gboolean is_readonly);
-
/**
* The qof_session_not_saved() subroutine will return TRUE
* if any data in the session hasn't been saved to long-term storage.
More information about the gnucash-changes
mailing list