gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Fri Jan 2 14:44:18 EST 2015
Updated via https://github.com/Gnucash/gnucash/commit/ca75bd9a (commit)
via https://github.com/Gnucash/gnucash/commit/94fbf97f (commit)
via https://github.com/Gnucash/gnucash/commit/09e8e245 (commit)
from https://github.com/Gnucash/gnucash/commit/9b1d8d15 (commit)
commit ca75bd9a1714fda52bca4cfca763ff897c096ff2
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jan 2 13:12:39 2015 -0800
Change comment to reflect kvp->properties.
diff --git a/src/engine/SchedXaction.h b/src/engine/SchedXaction.h
index c02183e..bfdc943 100644
--- a/src/engine/SchedXaction.h
+++ b/src/engine/SchedXaction.h
@@ -303,7 +303,7 @@ void gnc_sx_remove_defer_instance( SchedXaction *sx, void *deferStateData );
*/
GList *gnc_sx_get_defer_instances( SchedXaction *sx );
-/* #defines for KvpFrame strings and QOF */
+/* #defines for Properties and GncModule */
#define GNC_SX_SHARES "shares"
#define GNC_SX_FREQ_SPEC "scheduled-frequency"
#define GNC_SX_NAME "sched-xname"
commit 94fbf97f900da7c74a441971aa0951e925c98a55
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jan 2 13:12:08 2015 -0800
Clean out a couple of unused variables left over from direct KVP.
diff --git a/src/engine/gncInvoice.c b/src/engine/gncInvoice.c
index 0198958..1163ac1 100644
--- a/src/engine/gncInvoice.c
+++ b/src/engine/gncInvoice.c
@@ -1186,16 +1186,13 @@ GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot)
static void
gncInvoiceAttachToTxn (GncInvoice *invoice, Transaction *txn)
{
- KvpFrame *kvp;
- KvpValue *value;
-
if (!invoice || !txn)
return;
if (invoice->posted_txn) return; /* Cannot reset invoice's txn */
xaccTransBeginEdit (txn);
- qof_instance_set (QOF_INSTANCE (txn), "invoice",
+ qof_instance_set (QOF_INSTANCE (txn), "invoice", //Prop INVOICE
qof_instance_get_guid (QOF_INSTANCE (invoice)), NULL);
xaccTransSetTxnType (txn, TXN_TYPE_INVOICE);
xaccTransCommitEdit (txn);
commit 09e8e245c451778e5374605e0b09b070d41e74fb
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Dec 30 16:19:21 2014 -0800
Fix a couple of string leaks.
diff --git a/src/libqof/qof/qofsession.cpp b/src/libqof/qof/qofsession.cpp
index 0285fda..b51c3ca 100644
--- a/src/libqof/qof/qofsession.cpp
+++ b/src/libqof/qof/qofsession.cpp
@@ -635,15 +635,13 @@ qof_session_save (QofSession *session,
QofPercentageFunc percentage_func)
{
QofBackend *be;
- char *msg = NULL;
-
if (!session) return;
if (!g_atomic_int_dec_and_test(&session->lock))
goto leave;
ENTER ("sess=%p book_id=%s",
session, session->book_id ? session->book_id : "(null)");
- msg = g_strdup_printf(" ");
+
/* If there is a backend, and the backend is reachable
* (i.e. we can communicate with it), then synchronize with
* the backend. If we cannot contact the backend (e.g.
@@ -677,13 +675,13 @@ qof_session_save (QofSession *session,
{
if (ERR_BACKEND_NO_ERR != qof_session_get_error(session))
{
- msg = g_strdup_printf("failed to load backend");
+ /* push_error strdups, stack const is fine. */
+ const char *msg = "failed to load backend";
qof_session_push_error(session, ERR_BACKEND_NO_HANDLER, msg);
}
}
LEAVE("error -- No backend!");
leave:
- if (msg != NULL) g_free(msg);
g_atomic_int_inc(&session->lock);
return;
}
@@ -705,6 +703,8 @@ qof_session_safe_save(QofSession *session, QofPercentageFunc percentage_func)
g_free(session->book_id);
session->book_id = NULL;
qof_session_push_error (session, err, msg);
+ /* qof_backend_get_message transfers ownership. */
+ g_free(msg);
}
}
Summary of changes:
src/engine/SchedXaction.h | 2 +-
src/engine/gncInvoice.c | 5 +----
src/libqof/qof/qofsession.cpp | 10 +++++-----
3 files changed, 7 insertions(+), 10 deletions(-)
More information about the gnucash-changes
mailing list