gnucash unstable: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Tue Feb 20 20:33:15 EST 2018
Updated via https://github.com/Gnucash/gnucash/commit/a4399ee7 (commit)
via https://github.com/Gnucash/gnucash/commit/c58b0024 (commit)
from https://github.com/Gnucash/gnucash/commit/78705dc8 (commit)
commit a4399ee732708fce6e7d7a4fb24c67d4fe48bf53
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Feb 20 17:32:22 2018 -0800
Bug 792157 - Cannot create account with different currency
Restore force-insert logic that had gotten lost in the C++ conversion.
diff --git a/libgnucash/backend/sql/gnc-commodity-sql.cpp b/libgnucash/backend/sql/gnc-commodity-sql.cpp
index dad6877..451b55a 100644
--- a/libgnucash/backend/sql/gnc-commodity-sql.cpp
+++ b/libgnucash/backend/sql/gnc-commodity-sql.cpp
@@ -217,8 +217,8 @@ GncSqlCommodityBackend::commit (GncSqlBackend* sql_be, QofInstance* inst)
g_return_val_if_fail (sql_be != NULL, FALSE);
g_return_val_if_fail (inst != NULL, FALSE);
g_return_val_if_fail (GNC_IS_COMMODITY (inst), FALSE);
-
- return do_commit_commodity (sql_be, inst, FALSE);
+ auto in_be = instance_in_db(sql_be, inst);
+ return do_commit_commodity (sql_be, inst, !in_be);
}
/* ----------------------------------------------------------------- */
diff --git a/libgnucash/backend/sql/gnc-sql-backend.cpp b/libgnucash/backend/sql/gnc-sql-backend.cpp
index 0c7e6af..1a8af92 100644
--- a/libgnucash/backend/sql/gnc-sql-backend.cpp
+++ b/libgnucash/backend/sql/gnc-sql-backend.cpp
@@ -811,6 +811,8 @@ GncSqlBackend::object_in_db (const char* table_name, QofIdTypeConst obj_name,
/* WHERE */
PairVec values{get_object_values(obj_name, pObject, table)};
+ /* We want only the first item in the table, which should be the PK. */
+ values.resize(1);
stmt->add_where_cond(obj_name, values);
auto result = execute_select_statement (stmt);
return (result != nullptr && result->size() > 0);
commit c58b0024c554a75b74f55990e411cbf70a8c3ea3
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Feb 20 12:25:14 2018 -0800
Remove bogus file from POTFILES.in.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b1251f2..24f70dd 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -338,7 +338,6 @@ gnucash/import-export/ofx/gnc-plugin-ofx.c
gnucash/import-export/qif/qif-context.c
gnucash/import-export/qif/qif-file.c
gnucash/import-export/qif/qif-objects.c
-gnucash/import-export/qif-imp/.#string.scm
gnucash/import-export/qif-imp/assistant-qif-import.c
gnucash/import-export/qif-imp/assistant-qif-import.glade
gnucash/import-export/qif-imp/dialog-account-picker.c
Summary of changes:
libgnucash/backend/sql/gnc-commodity-sql.cpp | 4 ++--
libgnucash/backend/sql/gnc-sql-backend.cpp | 2 ++
po/POTFILES.in | 1 -
3 files changed, 4 insertions(+), 3 deletions(-)
More information about the gnucash-changes
mailing list