Skip to content

Commit

Permalink
Remove gnc-option-db business convenience functions.
Browse files Browse the repository at this point in the history
gnc_option_db_lookup_invoice_option used only once, so moved its
guts there. The others weren't used at all.
  • Loading branch information
jralls committed Jul 11, 2021
1 parent ade7fc8 commit d2655d3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 176 deletions.
2 changes: 1 addition & 1 deletion gnucash/gnome/business-options-gnome.h
@@ -1,5 +1,5 @@
/*
* business-options.h -- Initialize the Business Options
* business-options-gnome.h -- Initialize the Business Options
*
* Written By: Derek Atkins <warlord@MIT.EDU>
* Copyright (C) 2002 Derek Atkins
Expand Down
15 changes: 10 additions & 5 deletions gnucash/gnome/gnc-plugin-page-report.c
Expand Up @@ -72,7 +72,6 @@
#include "window-report.h"
#include "swig-runtime.h"
#include "guile-mappings.h"
#include "business-options.h"
#include "gnc-icons.h"
#include "print-session.h"

Expand Down Expand Up @@ -1785,11 +1784,17 @@ gnc_plugin_page_report_options_cb( GtkAction *action, GncPluginPageReport *repor
gnc_plugin_page_report_add_edited_report(priv, priv->cur_report);
}

static GncInvoice *lookup_invoice(GncPluginPageReportPrivate *priv)
static GncInvoice*
lookup_invoice(GncPluginPageReportPrivate *priv)
{
g_assert(priv);
return gnc_option_db_lookup_invoice_option(priv->cur_odb, "General",
"Invoice Number", NULL);
SCM opt_val = gnc_option_db_lookup_option(priv->cur_odb, "General",
"Invoice Number", NULL);
if (opt_val == SCM_UNDEFINED)
return NULL;

#define FUNC_NAME G_STRFUNC
return SWIG_MustGetPtr(opt_val, SWIG_TypeQuery("_p__gncInvoice"), 1, 0);
#undef FUNC_NAME
}

#define GNC_PREFS_GROUP_REPORT_PDFEXPORT GNC_PREFS_GROUP_GENERAL_REPORT ".pdf-export"
Expand Down
2 changes: 0 additions & 2 deletions libgnucash/app-utils/CMakeLists.txt
Expand Up @@ -15,7 +15,6 @@ set (app_utils_noinst_HEADERS

set (app_utils_HEADERS
QuickFill.h
business-options.h
file-utils.h
gfec.h
gnc-basic-gobject.h
Expand Down Expand Up @@ -52,7 +51,6 @@ gnc_add_swig_python_command (swig-app-utils-python
set (app_utils_SOURCES
calculation/expression_parser.c
calculation/fin.c
business-options.c
QuickFill.c
file-utils.c
gfec.c
Expand Down
92 changes: 0 additions & 92 deletions libgnucash/app-utils/business-options.c

This file was deleted.

56 changes: 0 additions & 56 deletions libgnucash/app-utils/business-options.h

This file was deleted.

19 changes: 0 additions & 19 deletions libgnucash/app-utils/gnc-optiondb.cpp
Expand Up @@ -137,25 +137,6 @@ GncOptionDB::set_selectable(const char* section, const char* name)
void
GncOptionDB::commit()
{
std::for_each(
m_sections.begin(), m_sections.end(),
[](GncOptionSection section)
{
std::for_each(
section.second.begin(), section.second.end(),
[](GncOptionWrapperPtr option)
{
/* FIXME, not implemented.
if (option->m_option.is_dirty())
{
option->m_option.commit();
* FIXME, no Gtk in gtk_widget_set_value(option->m_widget,
* libgnucash! option->m_option.get_value());
}
*/
});
});
}

GncOptionDB*
Expand Down
1 change: 0 additions & 1 deletion po/POTFILES.in
Expand Up @@ -509,7 +509,6 @@ gnucash/report/stylesheets/head-or-tail.scm
gnucash/report/stylesheets/plain.scm
gnucash/report/trep-engine.scm
libgnucash/app-utils/app-utils.scm
libgnucash/app-utils/business-options.c
libgnucash/app-utils/business-options.scm
libgnucash/app-utils/business-prefs.scm
libgnucash/app-utils/calculation/expression_parser.c
Expand Down

0 comments on commit d2655d3

Please sign in to comment.