gnucash future: gncquerycore.cpp: Change gnc-glib-utils.h to gnc-string-utils.h, its name in the future branch.
John Ralls
jralls at code.gnucash.org
Sat Sep 26 14:54:12 EDT 2026
Updated via https://github.com/Gnucash/gnucash/commit/670f239e (commit)
from https://github.com/Gnucash/gnucash/commit/e4006dac (commit)
commit 670f239e35167f8942d0d13c1c9c9fa7ae23dca5
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 26 11:54:02 2026 -0700
gncquerycore.cpp: Change gnc-glib-utils.h to gnc-string-utils.h, its name in the future branch.
diff --git a/gnucash/gnucash-commands.cpp b/gnucash/gnucash-commands.cpp
index c827265307..1667580b99 100644
--- a/gnucash/gnucash-commands.cpp
+++ b/gnucash/gnucash-commands.cpp
@@ -350,38 +350,41 @@ Gnucash::add_quotes (const bo_str& uri)
if (!session)
return 1;
- qof_session_begin(session, uri->c_str(), SESSION_NORMAL_OPEN);
- if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
- return cleanup_and_exit_with_failure (session);
-
- qof_session_load(session, NULL);
- if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
- return cleanup_and_exit_with_failure (session);
-
try
{
GncQuotes quotes;
std::cout << bl::format (bl::translate ("Found Finance::Quote version {1}.")) % quotes.version() << std::endl;
auto quote_sources = quotes.sources();
gnc_quote_source_set_fq_installed (quotes.version().c_str(), quote_sources);
+
+ qof_session_begin(session, uri->c_str(), SESSION_NORMAL_OPEN);
+ if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
+ return cleanup_and_exit_with_failure (session);
+
+ qof_session_load(session, NULL);
+ if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
+ return cleanup_and_exit_with_failure (session);
+
quotes.fetch(qof_session_get_book(session));
if (quotes.had_failures())
{
std::cerr << quotes.report_failures() << std::endl;
rv = 2;
}
+
+ qof_session_save(session, NULL);
+ if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
+ return cleanup_and_exit_with_failure (session);
+
+ qof_session_destroy(session);
+ qof_event_resume();
+ return rv;
}
catch (const GncQuoteException& err)
{
std::cerr << bl::translate("Price retrieval failed: ") << err.what() << std::endl;
+ return cleanup_and_exit_with_failure(session);
}
- qof_session_save(session, NULL);
- if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
- return cleanup_and_exit_with_failure (session);
-
- qof_session_destroy(session);
- qof_event_resume();
- return rv;
}
int
diff --git a/libgnucash/engine/qofquerycore.cpp b/libgnucash/engine/qofquerycore.cpp
index e572720b35..084f6402d2 100644
--- a/libgnucash/engine/qofquerycore.cpp
+++ b/libgnucash/engine/qofquerycore.cpp
@@ -27,7 +27,7 @@
#include <glib.h>
#include <stdlib.h>
-#include "gnc-glib-utils.h"
+#include "gnc-string-utils.h"
#include "qof.h"
#include "qofquerycore-p.h"
Summary of changes:
gnucash/gnucash-commands.cpp | 33 ++++++++++++++++++---------------
libgnucash/engine/qofquerycore.cpp | 2 +-
2 files changed, 19 insertions(+), 16 deletions(-)
More information about the gnucash-changes
mailing list