Merge branch 'maint'

Bumping the required cmake to 3.10 and removing GncPkgConfig.cmake as
no longer required.
This commit is contained in:
John Ralls
2019-09-13 09:40:01 -07:00
110 changed files with 4229 additions and 3804 deletions

View File

@@ -1,6 +1,6 @@
# CMakeLists.txt for GnuCash
cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.10)
project (gnucash)
@@ -196,7 +196,7 @@ find_package(PkgConfig REQUIRED)
if (NOT PKG_CONFIG_FOUND)
message (SEND_ERROR "pkg-config not found, but is required")
endif (NOT PKG_CONFIG_FOUND)
endif (NOT PKG_CONFIG_FOUND)
# glib et al.
pkg_check_modules (GLIB2 REQUIRED glib-2.0>=2.40)
@@ -209,31 +209,21 @@ pkg_check_modules (LIBXML2 REQUIRED libxml-2.0>=2.7.0)
pkg_check_modules (LIBXSLT REQUIRED libxslt)
if (WITH_GNUCASH)
if (WIN32 OR APPLE)
pkg_check_modules (WEBKIT1 REQUIRED webkitgtk-3.0)
set(WEBKIT1 1)
set(WEBKIT_CFLAGS ${WEBKIT2_CFLAGS})
set(WEBKIT_INCLUDE_DIRS ${WEBKIT1_INCLUDE_DIRS})
set(WEBKIT_LDFLAGS ${WEBKIT1_LDFLAGS})
set(WEBKIT_LIBRARIES ${WEBKIT1_LIBRARIES})
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkitgtk-3.0)
set(WEBKIT1 1 CACHE INTERNAL "WebKitGtk")
else (WIN32 OR APPLE)
pkg_check_modules (WEBKIT2_4 webkit2gtk-4.0)
if (NOT WEBKIT2_4_FOUND)
pkg_check_modules (WEBKIT2_3 REQUIRED webkit2gtk-3.0)
set(WEBKIT2_3 1)
set(WEBKIT_CFLAGS ${WEBKIT2_3_CFLAGS})
set(WEBKIT_INCLUDE_DIRS ${WEBKIT2_3_INCLUDE_DIRS})
set(WEBKIT_LDFLAGS ${WEBKIT2_3_LDFLAGS})
set(WEBKIT_LIBRARIES ${WEBKIT2_3_LIBRARIES})
else (NOT WEBKIT2_4_FOUND)
set(WEBKIT2_4 1)
set(WEBKIT_CFLAGS ${WEBKIT2_4_CFLAGS})
set(WEBKIT_INCLUDE_DIRS ${WEBKIT2_4_INCLUDE_DIRS})
set(WEBKIT_LDFLAGS ${WEBKIT2_4_LDFLAGS})
set(WEBKIT_LIBRARIES ${WEBKIT2_4_LIBRARIES})
endif (NOT WEBKIT2_4_FOUND)
pkg_check_modules (WEBKIT IMPORTED_TARGET webkit2gtk-4.0)
if (NOT WEBKIT_FOUND)
pkg_check_modules (WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-3.0)
set(WEBKIT2_3 1 CACHE INTERNAL "WebKit2Gtk3")
else (NOT WEBKIT_FOUND)
if (NOT WEBKIT2_3)
set(WEBKIT2_4 1 CACHE INTERNAL "WebKit2Gtk4")
endif(NOT WEBKIT2_3)
endif (NOT WEBKIT_FOUND)
endif (WIN32 OR APPLE)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0>=3.18.0)
pkg_check_modules (GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=3.18.0)
endif (WITH_GNUCASH)
pkg_check_modules (ZLIB REQUIRED zlib)

View File

@@ -195,7 +195,7 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
if (MINGW64)
set(fpath "")
file(TO_CMAKE_PATH "$ENV{PATH}" fpath)
set(LIBRARY_PATH "PATH=\"${BINDIR_BUILD};${fpath}\"")
set(LIBRARY_PATH "PATH=${BINDIR_BUILD};${fpath}")
else (MINGW64)
set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash")
endif (MINGW64)
@@ -226,13 +226,14 @@ function(make_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
COMMAND ${CMAKE_COMMAND} -E env
"${LIBRARY_PATH}"
"GNC_UNINSTALLED=YES"
"GNC_BUILDDIR=\"${CMAKE_BINARY_DIR}\""
"GUILE_LOAD_PATH=\"${_GUILE_LOAD_PATH}\""
"GUILE_LOAD_COMPILED_PATH=\"${_GUILE_LOAD_COMPILED_PATH}\""
"GNC_MODULE_PATH=\"${_GNC_MODULE_PATH}\""
${GUILE_EXECUTABLE} -e '\(@@ \(guild\) main\)' -s ${GUILD_EXECUTABLE} compile -o ${output_file} ${source_file_abs_path}
"GNC_BUILDDIR=${CMAKE_BINARY_DIR}"
"GUILE_LOAD_PATH=${_GUILE_LOAD_PATH}"
"GUILE_LOAD_COMPILED_PATH=${_GUILE_LOAD_COMPILED_PATH}"
"GNC_MODULE_PATH=${_GNC_MODULE_PATH}"
${GUILE_EXECUTABLE} -e "\(@@ \(guild\) main\)" -s ${GUILD_EXECUTABLE} compile -o ${output_file} ${source_file_abs_path}
DEPENDS ${guile_depends}
MAIN_DEPENDENCY ${source_file_abs_path}
VERBATIM
)
endforeach(source_file)
if (__DEBUG)

View File

@@ -1,9 +1,4 @@
if (${CMAKE_VERSION} VERSION_LESS 3.3)
include(CMakeParseArguments)
endif()
function(set_local_dist output)
set(dist_files "")
foreach(file ${ARGN})

View File

@@ -67,7 +67,7 @@ endif (BUILDING_FROM_VCS)
target_link_libraries (gnucash
gncmod-ledger-core gnc-gnome gncmod-gnome-utils gncmod-app-utils
gncmod-engine gnc-module gnc-core-utils gncmod-report
${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK3_LDFLAGS} ${GTK_MAC_LDFLAGS}
PkgConfig::GTK3 ${GUILE_LDFLAGS} ${GLIB2_LDFLAGS} ${GTK_MAC_LDFLAGS}
)
# Get glib executable for generating the gresource file

View File

@@ -46,7 +46,7 @@ add_library (gncmod-gnome-search
${gnome_search_noinst_HEADERS}
)
target_link_libraries(gncmod-gnome-search gncmod-gnome-utils ${GTK3_LDFLAGS})
target_link_libraries(gncmod-gnome-search gncmod-gnome-utils PkgConfig::GTK3)
target_compile_definitions(gncmod-gnome-search PRIVATE -DG_LOG_DOMAIN=\"gnc.gui.search\")

View File

@@ -1094,8 +1094,7 @@ type_label_to_new_button(const gchar* type_label)
else
{
PWARN("No translatable new-button label found for search type \"%s\", please add one into dialog-search.c!", type_label);
/* Translators: This string has a disambiguation prefix. Translate only the part behind '|' */
return Q_("Item represents an unknown object type (in the sense of bill, customer, invoice, transaction, split,...)|New item");
return C_("Item represents an unknown object type (in the sense of bill, customer, invoice, transaction, split,...)!", "New item");
}
}

View File

@@ -78,7 +78,7 @@ struct _GNCGeneralSearchPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCGeneralSearch, gnc_general_search, GTK_TYPE_BOX)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_GENERAL_SEARCH, GNCGeneralSearchPrivate))
((GNCGeneralSearchPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_GENERAL_SEARCH))
static GtkBoxClass *parent_class;
static guint general_search_signals[LAST_SIGNAL];

View File

@@ -61,7 +61,7 @@ struct _GNCSearchAccountPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchAccount, gnc_search_account, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_ACCOUNT, GNCSearchAccountPrivate))
((GNCSearchAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_ACCOUNT))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -56,7 +56,7 @@ struct _GNCSearchBooleanPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchBoolean, gnc_search_boolean, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_BOOLEAN, GNCSearchBooleanPrivate))
((GNCSearchBooleanPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_BOOLEAN))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -58,7 +58,7 @@ struct _GNCSearchCoreTypePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchCoreType, gnc_search_core_type, G_TYPE_OBJECT)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_CORE_TYPE, GNCSearchCoreTypePrivate))
((GNCSearchCoreTypePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_CORE_TYPE))
static GObjectClass *parent_class;

View File

@@ -60,7 +60,7 @@ struct _GNCSearchDatePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDate, gnc_search_date, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_DATE, GNCSearchDatePrivate))
((GNCSearchDatePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_DATE))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -60,7 +60,7 @@ struct _GNCSearchDoublePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchDouble, gnc_search_double, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_DOUBLE, GNCSearchDoublePrivate))
((GNCSearchDoublePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_DOUBLE))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -61,7 +61,7 @@ struct _GNCSearchInt64Private
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchInt64, gnc_search_int64, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_INT64, GNCSearchInt64Private))
((GNCSearchInt64Private*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_INT64))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -61,7 +61,7 @@ struct _GNCSearchNumericPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchNumeric, gnc_search_numeric, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_NUMERIC, GNCSearchNumericPrivate))
((GNCSearchNumericPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_NUMERIC))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -57,7 +57,7 @@ struct _GNCSearchReconciledPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchReconciled, gnc_search_reconciled, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_RECONCILED, GNCSearchReconciledPrivate))
((GNCSearchReconciledPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_RECONCILED))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -60,7 +60,7 @@ struct _GNCSearchStringPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchString, gnc_search_string, GNC_TYPE_SEARCH_CORE_TYPE)
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_STRING, GNCSearchStringPrivate))
((GNCSearchStringPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_STRING))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -211,8 +211,9 @@ add_library (gncmod-gnome-utils
${gnome_utils_noinst_HEADERS}
)
target_link_libraries(gncmod-gnome-utils gncmod-app-utils gncmod-engine gnc-backend-xml-utils
${CMAKE_DL_LIBS} ${GTK3_LDFLAGS} ${LIBSECRET_LDFLAGS} ${GTK_MAC_LDFLAGS})
target_link_libraries(gncmod-gnome-utils gncmod-app-utils gncmod-engine
gnc-backend-xml-utils PkgConfig::GTK3 ${CMAKE_DL_LIBS} ${LIBSECRET_LDFLAGS}
${GTK_MAC_LDFLAGS})
target_compile_options(gncmod-gnome-utils PRIVATE -Wno-deprecated-declarations)
target_compile_definitions(gncmod-gnome-utils PUBLIC ${GTK_MAC_CFLAGS_OTHER}
@@ -229,7 +230,6 @@ endif(MAC_INTEGRATION)
target_include_directories(gncmod-gnome-utils
PUBLIC
${GTK3_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
${GTK_MAC_INCLUDE_DIRS}

View File

@@ -49,7 +49,8 @@ enum
PROP_TIP_COL,
};
#define GNC_COMBOTT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_COMBOTT, GncCombottPrivate))
#define GNC_COMBOTT_GET_PRIVATE(o) \
((GncCombottPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_COMBOTT))
static guint combott_signals[LAST_SIGNAL] = {0,};

View File

@@ -93,7 +93,7 @@ typedef struct _GNCCurrencyEditPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCCurrencyEdit, gnc_currency_edit, GTK_TYPE_COMBO_BOX)
#define GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_CURRENCY_EDIT, GNCCurrencyEditPrivate))
((GNCCurrencyEditPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_CURRENCY_EDIT))
/** @name Basic Object Implementation */
/** @{ */

View File

@@ -558,13 +558,13 @@ fill_time_combo (GtkWidget *widget, GNCDateEdit *gde)
static void
gnc_date_edit_set_time_internal (GNCDateEdit *gde, time64 the_time)
{
char buffer [40];
char buffer [MAX_DATE_LENGTH + 1];
struct tm *mytm = gnc_localtime (&the_time);
g_return_if_fail(mytm != NULL);
/* Update the date text. */
qof_print_date_dmy_buff(buffer, 40,
qof_print_date_dmy_buff(buffer, MAX_DATE_LENGTH,
mytm->tm_mday,
mytm->tm_mon + 1,
1900 + mytm->tm_year);

View File

@@ -76,7 +76,7 @@ struct _GNCDateFormatPrivate
};
#define GNC_DATE_FORMAT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_DATE_FORMAT, GNCDateFormatPrivate))
((GNCDateFormatPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_DATE_FORMAT))
static guint date_format_signals [LAST_SIGNAL] = { 0 };

View File

@@ -91,7 +91,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncEmbeddedWindow, gnc_embedded_window, GTK_TYPE_BOX,
gnc_window_embedded_window_init))
#define GNC_EMBEDDED_WINDOW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_EMBEDDED_WINDOW, GncEmbeddedWindowPrivate))
((GncEmbeddedWindowPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_EMBEDDED_WINDOW))
/* Display a data plugin page in a window. */
void

View File

@@ -237,7 +237,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_WINDOW,
gnc_window_main_window_init))
#define GNC_MAIN_WINDOW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_MAIN_WINDOW, GncMainWindowPrivate))
((GncMainWindowPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_MAIN_WINDOW))
/** This data structure maintains information about one action groups
* that has been installed in this window. */

View File

@@ -112,7 +112,7 @@ struct _GncPeriodSelectPrivate
};
#define GNC_PERIOD_SELECT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PERIOD_SELECT, GncPeriodSelectPrivate))
((GncPeriodSelectPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PERIOD_SELECT))
/************************************************************/
@@ -139,7 +139,7 @@ static void
gnc_period_sample_update_date_label (GncPeriodSelect *period)
{
GncPeriodSelectPrivate *priv;
gchar time_string[MAX_DATE_LENGTH];
gchar time_string[MAX_DATE_LENGTH + 1];
GDate *date;
GncAccountingPeriod which;

View File

@@ -106,7 +106,7 @@ typedef struct GncPluginFileHistoryPrivate
#define GNC_PLUGIN_FILE_HISTORY_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_FILE_HISTORY, GncPluginFileHistoryPrivate))
((GncPluginFileHistoryPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_FILE_HISTORY))
/************************************************************
* Other Functions *

View File

@@ -45,7 +45,7 @@ typedef struct GncPluginManagerPrivate
} GncPluginManagerPrivate;
#define GNC_PLUGIN_MANAGER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_MANAGER, GncPluginManagerPrivate))
((GncPluginManagerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_MANAGER))
enum
{

View File

@@ -70,7 +70,7 @@ typedef struct GncPluginMenuAdditionsPrivate
} GncPluginMenuAdditionsPrivate;
#define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_MENU_ADDITIONS, GncPluginMenuAdditionsPrivate))
((GncPluginMenuAdditionsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_MENU_ADDITIONS))
/** Per-window private data for this plugin. This plugin is unique in

View File

@@ -108,7 +108,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncPluginPage, gnc_plugin_page, G_TYPE_OBJECT,
G_ADD_PRIVATE(GncPluginPage))
#define GNC_PLUGIN_PAGE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE, GncPluginPagePrivate))
((GncPluginPagePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE))
/* Create the display widget that corresponds to this plugin. This
* function will be called by the main/embedded window manipulation

View File

@@ -65,7 +65,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncPlugin, gnc_plugin, G_TYPE_OBJECT,
G_ADD_PRIVATE(GncPlugin))
#define GNC_PLUGIN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN, GncPluginPrivate))
((GncPluginPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN))
/** Initialize the class for the new gnucash plugin object. This will
* set up any function pointers that override functions in the parent

View File

@@ -53,7 +53,7 @@ struct _GNCQueryViewPrivate
};
#define GNC_QUERY_VIEW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_QUERY_VIEW, GNCQueryViewPrivate))
((GNCQueryViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_QUERY_VIEW))
/** Static Globals ****************************************************/
static GtkTreeViewClass *parent_class = NULL;

View File

@@ -56,8 +56,7 @@ typedef struct GncTreeModelAccountTypesPrivate
} GncTreeModelAccountTypesPrivate;
#define GNC_TREE_MODEL_ACCOUNT_TYPES_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_ACCOUNT_TYPES, \
GncTreeModelAccountTypesPrivate))
((GncTreeModelAccountTypesPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_ACCOUNT_TYPES))
static GObjectClass *parent_class = NULL;

View File

@@ -100,7 +100,7 @@ typedef struct GncTreeModelAccountPrivate
} GncTreeModelAccountPrivate;
#define GNC_TREE_MODEL_ACCOUNT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_ACCOUNT, GncTreeModelAccountPrivate))
((GncTreeModelAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_ACCOUNT))
/************************************************************/

View File

@@ -101,7 +101,7 @@ typedef struct GncTreeModelCommodityPrivate
} GncTreeModelCommodityPrivate;
#define GNC_TREE_MODEL_COMMODITY_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_COMMODITY, GncTreeModelCommodityPrivate))
((GncTreeModelCommodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_COMMODITY))
/** A pointer to the parent class of a commodity tree model. */
static GObjectClass *parent_class = NULL;

View File

@@ -99,7 +99,7 @@ typedef struct GncTreeModelOwnerPrivate
} GncTreeModelOwnerPrivate;
#define GNC_TREE_MODEL_OWNER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_OWNER, GncTreeModelOwnerPrivate))
((GncTreeModelOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_OWNER))
/************************************************************/

View File

@@ -132,7 +132,7 @@ typedef struct GncTreeModelPricePrivate
} GncTreeModelPricePrivate;
#define GNC_TREE_MODEL_PRICE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_PRICE, GncTreeModelPricePrivate))
((GncTreeModelPricePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_PRICE))
/** A pointer to the parent class of a price tree model. */
static GObjectClass *parent_class = NULL;
@@ -735,7 +735,7 @@ gnc_tree_model_price_get_value (GtkTreeModel *tree_model,
g_value_set_string (value, gnc_commodity_get_printname (commodity));
break;
case GNC_TREE_MODEL_PRICE_COL_DATE:
qof_print_date_buff (datebuff, sizeof(datebuff),
qof_print_date_buff (datebuff, MAX_DATE_LENGTH,
gnc_price_get_time64 (price));
g_value_init (value, G_TYPE_STRING);
g_value_set_string (value, datebuff);

View File

@@ -97,7 +97,7 @@ typedef struct GncTreeModelSelectionPrivate
} GncTreeModelSelectionPrivate;
#define GNC_TREE_MODEL_SELECTION_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_SELECTION, GncTreeModelSelectionPrivate))
((GncTreeModelSelectionPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_SELECTION))
static GObjectClass *parent_class = NULL;

View File

@@ -220,7 +220,7 @@ gtm_sr_make_iter (GncTreeModelSplitReg *model, gint f, GList *tnode, GList *snod
#define GNC_TREE_MODEL_SPLIT_REG_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitRegPrivate))
((GncTreeModelSplitRegPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL_SPLIT_REG))
/************************************************************/
/* g_object required functions */
@@ -850,7 +850,7 @@ gnc_tree_model_split_reg_get_tooltip (GncTreeModelSplitReg *model, gint position
else
{
time64 t = xaccTransRetDatePosted (trans);
qof_print_date_buff (date_text, sizeof(date_text), t);
qof_print_date_buff (date_text, MAX_DATE_LENGTH, t);
desc_text = xaccTransGetDescription (trans);
model->current_trans = trans;
return g_strconcat (date_text, "\n", desc_text, NULL);
@@ -2851,9 +2851,7 @@ gnc_tree_model_split_reg_update_action_list (GncTreeModelSplitReg *model)
/* broken ! FIXME bg ????????? What is broken */
case SEARCH_LEDGER2:
/* Translators: This string has a context prefix; the translation
must only contain the part after the | character. */
gtk_list_store_insert_with_values (store, &iter, 100, 0, Q_("Action Column|Deposit"), -1);
gtk_list_store_insert_with_values (store, &iter, 100, 0, C_("Action Column", "Deposit"), -1);
gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Withdraw"), -1);
gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Check"), -1);
gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Interest"), -1);
@@ -2952,8 +2950,7 @@ gnc_tree_model_split_reg_update_action_list (GncTreeModelSplitReg *model)
gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Income"), -1);
/* Action: Distribution */
gtk_list_store_insert_with_values (store, &iter, 100, 0, _("Dist"), -1);
/* Translators: This string has a disambiguation prefix */
gtk_list_store_insert_with_values (store, &iter, 100, 0, Q_("Action Column|Split"), -1);
gtk_list_store_insert_with_values (store, &iter, 100, 0, C_("Action Column", "Split"), -1);
break;
default:

View File

@@ -51,7 +51,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncTreeModel, gnc_tree_model, G_TYPE_OBJECT,
G_ADD_PRIVATE(GncTreeModel))
#define GNC_TREE_MODEL_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_MODEL, GncTreeModelPrivate))
((GncTreeModelPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_MODEL))
/************************************************************/

View File

@@ -115,7 +115,7 @@ typedef struct GncTreeViewAccountPrivate
} GncTreeViewAccountPrivate;
#define GNC_TREE_VIEW_ACCOUNT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_ACCOUNT, GncTreeViewAccountPrivate))
((GncTreeViewAccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_ACCOUNT))
/************************************************************/

View File

@@ -58,7 +58,7 @@ typedef struct GncTreeViewCommodityPrivate
} GncTreeViewCommodityPrivate;
#define GNC_TREE_VIEW_COMMODITY_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_COMMODITY, GncTreeViewCommodityPrivate))
((GncTreeViewCommodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_COMMODITY))
/************************************************************/
@@ -404,9 +404,7 @@ gnc_tree_view_commodity_new (QofBook *book,
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
gnc_tree_view_add_toggle_column(
view, _("Get Quotes"),
/* Translators: This string has a context prefix; the translation
must only contain the part after the | character. */
Q_("Column letter for 'Get Quotes'|Q"), "quote_flag",
C_("Column letter for 'Get Quotes'", "Q"), "quote_flag",
GNC_TREE_MODEL_COMMODITY_COL_QUOTE_FLAG,
GNC_TREE_MODEL_COMMODITY_COL_VISIBILITY,
sort_by_quote_flag,

View File

@@ -87,7 +87,7 @@ typedef struct GncTreeViewOwnerPrivate
} GncTreeViewOwnerPrivate;
#define GNC_TREE_VIEW_OWNER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_OWNER, GncTreeViewOwnerPrivate))
((GncTreeViewOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_OWNER))
/************************************************************/
@@ -476,9 +476,7 @@ gnc_tree_view_owner_new (GncOwnerType owner_type)
GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
sort_by_string);
gnc_tree_view_add_toggle_column (view, _("Active"),
/* Translators: This string has a context prefix; the translation
must only contain the part after the | character. */
Q_("Column letter for 'Active'|A"),
C_("Column letter for 'Active'", "A"),
GNC_OWNER_TREE_ACTIVE_COL,
GNC_TREE_MODEL_OWNER_COL_ACTIVE,
GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,

View File

@@ -58,7 +58,7 @@ typedef struct GncTreeViewPricePrivate
} GncTreeViewPricePrivate;
#define GNC_TREE_VIEW_PRICE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_PRICE, GncTreeViewPricePrivate))
((GncTreeViewPricePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_PRICE))
/************************************************************/

View File

@@ -301,7 +301,7 @@ struct GncTreeViewSplitRegPrivate
#define SHOW_SYMBOL FALSE
#define GNC_TREE_VIEW_SPLIT_REG_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitRegPrivate))
((GncTreeViewSplitRegPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_SPLIT_REG))
static GObjectClass *parent_class = NULL;
@@ -1454,7 +1454,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
//date on new transactions
if (t == 0)
t = gnc_time (NULL);
qof_print_date_buff (datebuff, sizeof(datebuff), t);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, t);
editable = TRUE;
}
else if (is_trow2 && show_extra_dates) {
@@ -1465,7 +1465,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
//date on new transactions
if (t == 0)
t = gnc_time (NULL);
qof_print_date_buff (datebuff, sizeof(datebuff), t);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, t);
editable = FALSE;
}
else if (is_split && show_extra_dates) {
@@ -1473,7 +1473,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
if (xaccSplitGetReconcile (split) == YREC)
{
time64 t = xaccSplitGetDateReconciled (split);
qof_print_date_buff (datebuff, sizeof(datebuff), t);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, t);
}
editable = FALSE;
}
@@ -1484,7 +1484,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
/* Is this a template */
if (is_template && is_trow1)
{
strncpy (datebuff, _(" Scheduled "), sizeof(datebuff)-1);
strncpy (datebuff, _(" Scheduled "), MAX_DATE_LENGTH);
editable = FALSE;
}
else if (is_template && is_trow2 && show_extra_dates)
@@ -1514,7 +1514,7 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
if (type == TXN_TYPE_INVOICE)
{
time64 t = xaccTransRetDateDue (trans);
qof_print_date_buff (datebuff, sizeof(datebuff), t);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, t);
editable = FALSE;
}
else {

View File

@@ -59,7 +59,7 @@ typedef struct GncTreeViewSxListPrivate
} GncTreeViewSxListPrivate;
#define GNC_TREE_VIEW_SX_LIST_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW_SX_LIST, GncTreeViewSxListPrivate))
((GncTreeViewSxListPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW_SX_LIST))
static GObjectClass *parent_class = NULL;
@@ -138,9 +138,7 @@ gnc_tree_view_sx_list_new(GncSxInstanceModel *sx_instances)
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
col = gnc_tree_view_add_toggle_column(view, _("Enabled"),
/* Translators: This string has a context prefix; the translation
must only contain the part after the | character. */
Q_("Single-character short column-title form of 'Enabled'|E"),
C_("Single-character short column-title form of 'Enabled'", "E"),
"enabled", SXLTMA_COL_ENABLED,
GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
NULL, NULL);

View File

@@ -131,7 +131,7 @@ GNC_DEFINE_TYPE_WITH_CODE(GncTreeView, gnc_tree_view, GTK_TYPE_TREE_VIEW,
G_ADD_PRIVATE(GncTreeView))
#define GNC_TREE_VIEW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_TREE_VIEW, GncTreeViewPrivate))
((GncTreeViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_TREE_VIEW))
/************************************************************/

View File

@@ -53,7 +53,7 @@ struct _GNCSearchParamPrivate
};
#define GNC_SEARCH_PARAM_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_PARAM, GNCSearchParamPrivate))
((GNCSearchParamPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM))
typedef struct _GNCSearchParamSimplePrivate GNCSearchParamSimplePrivate;
@@ -67,7 +67,7 @@ struct _GNCSearchParamSimplePrivate
};
#define GNC_SEARCH_PARAM_SIMPLE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_PARAM_SIMPLE, GNCSearchParamSimplePrivate))
((GNCSearchParamSimplePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM_SIMPLE))
typedef struct _GNCSearchParamCompoundPrivate GNCSearchParamCompoundPrivate;
@@ -80,7 +80,7 @@ struct _GNCSearchParamCompoundPrivate
};
#define GNC_SEARCH_PARAM_COMPOUND_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_PARAM_COMPOUND, GNCSearchParamCompoundPrivate))
((GNCSearchParamCompoundPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_PARAM_COMPOUND))
static GObjectClass *parent_gobject_class;
static GNCSearchParamClass *parent_search_param_class;

View File

@@ -16,7 +16,6 @@ set(GNOME_UTILS_GUI_TEST_INCLUDE_DIRS
${CMAKE_BINARY_DIR}/common
${CMAKE_SOURCE_DIR}/gnucash/gnome-utils
${CMAKE_SOURCE_DIR}/libgnucash/engine
${GTK3_INCLUDE_DIRS}
)
set(GNOME_UTILS_GUI_TEST_LIBS
${GNOME_UTILS_TEST_LIBS}

View File

@@ -136,8 +136,9 @@ set (gnc_gnome_SOURCES
set_source_files_properties (${gnc_gnome_SOURCES} PROPERTIES OBJECT_DEPENDS ${CONFIG_H})
add_library (gnc-gnome ${gnc_gnome_SOURCES} ${gnc_gnome_noinst_HEADERS} ${SWIG_GNOME_C})
target_link_libraries(gnc-gnome gncmod-gnome-search gncmod-ledger-core gncmod-html gncmod-report
gncmod-register-gnome gncmod-register-core gncmod-gnome-utils gncmod-engine ${GTK3_LDFLAGS} ${GTK_MAC_LDFLAGS})
target_link_libraries(gnc-gnome gncmod-gnome-search gncmod-ledger-core
gncmod-html gncmod-report gncmod-register-gnome gncmod-register-core
gncmod-gnome-utils gncmod-engine PkgConfig::GTK3 ${GTK_MAC_LDFLAGS})
target_compile_definitions (gnc-gnome PRIVATE -DG_LOG_DOMAIN=\"gnc.gui\" ${GTK_MAC_CFLAGS_OTHER})
target_compile_options(gnc-gnome PRIVATE -Wno-deprecated-declarations)

View File

@@ -378,8 +378,8 @@ gnc_stock_split_assistant_finish (GtkAssistant *assistant,
xaccSplitMakeStockSplit (split);
/* Set split-action with gnc_set_num_action which is the same as
* xaccSplitSetAction with these arguments */
/* Translators: This string has a disambiguation prefix */
gnc_set_num_action (NULL, split, NULL, Q_("Action Column|Split"));
gnc_set_num_action (NULL, split, NULL, C_("Action Column", "Split"));
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
if (gnc_numeric_positive_p (amount))

View File

@@ -364,7 +364,7 @@ get_fiscal_end_date (void)
char datebuff[MAX_DATE_LENGTH + 1];
memset (datebuff, 0, sizeof(datebuff));
end = gnc_accounting_period_fiscal_end();
qof_print_date_buff(datebuff, sizeof(datebuff),
qof_print_date_buff(datebuff, MAX_DATE_LENGTH,
gnc_accounting_period_fiscal_end());
PINFO("Fiscal end date is %s", datebuff);

View File

@@ -422,7 +422,7 @@ get_trans_info (AssocDialog *assoc_dialog)
memset (datebuff, 0, sizeof(datebuff));
if (t == 0)
t = gnc_time (NULL);
qof_print_date_buff (datebuff, sizeof(datebuff), t);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, t);
gtk_list_store_append (GTK_LIST_STORE(model), &iter);
if (!scheme) // path is relative

View File

@@ -170,7 +170,7 @@ struct GncBudgetViewPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncBudgetView, gnc_budget_view, GTK_TYPE_BOX)
#define GNC_BUDGET_VIEW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_BUDGET_VIEW, GncBudgetViewPrivate))
((GncBudgetViewPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_BUDGET_VIEW))
/** \brief Create new gnc budget view.
@@ -1227,7 +1227,7 @@ gbv_refresh_col_titles(GncBudgetView *view)
GtkTreeViewColumn *col;
guint titlelen;
gint num_periods_visible;
gchar title[MAX_DATE_LENGTH];
gchar title[MAX_DATE_LENGTH + 1];
GList *col_list;
gint i;
@@ -1420,7 +1420,7 @@ gnc_budget_view_refresh(GncBudgetView *view)
if (priv->total_col == NULL)
{
gchar title[MAX_DATE_LENGTH];
gchar title[MAX_DATE_LENGTH + 1];
guint titlelen;
GDate *date;
GtkCellRenderer* renderer;

View File

@@ -76,7 +76,7 @@ typedef struct GncPluginAccountTreePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_ACCOUNT_TREE, GncPluginAccountTreePrivate))
((GncPluginAccountTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_ACCOUNT_TREE))
/** A pointer to the parent class of a plugin page. */
static GObjectClass *parent_class = NULL;

View File

@@ -270,7 +270,7 @@ typedef struct GncPluginBasicCommandsPrivate
} GncPluginBasicCommandsPrivate;
#define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_BASIC_COMMANDS, GncPluginBasicCommandsPrivate))
((GncPluginBasicCommandsPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BASIC_COMMANDS))
/** A pointer to the parent class of a plugin page. */
static GObjectClass *parent_class = NULL;

View File

@@ -83,7 +83,7 @@ typedef struct GncPluginBudgetPrivate
} GncPluginBudgetPrivate;
#define GNC_PLUGIN_BUDGET_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_BUDGET, GncPluginBudgetPrivate))
((GncPluginBudgetPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BUDGET))
static GObjectClass *parent_class = NULL;

View File

@@ -340,7 +340,7 @@ typedef struct GncPluginBusinessPrivate
} GncPluginBusinessPrivate;
#define GNC_PLUGIN_BUSINESS_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_BUSINESS, GncPluginBusinessPrivate))
((GncPluginBusinessPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_BUSINESS))
static GObjectClass *parent_class = NULL;

View File

@@ -101,7 +101,7 @@ typedef struct GncPluginPageAccountTreePrivate
} GncPluginPageAccountTreePrivate;
#define GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE, GncPluginPageAccountTreePrivate))
((GncPluginPageAccountTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_ACCOUNT_TREE))
static GObjectClass *parent_class = NULL;

View File

@@ -239,7 +239,7 @@ typedef struct GncPluginPageBudgetPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageBudget, gnc_plugin_page_budget, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_BUDGET, GncPluginPageBudgetPrivate))
((GncPluginPageBudgetPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_BUDGET))
static GObjectClass *parent_class = NULL;

View File

@@ -294,7 +294,7 @@ typedef struct GncPluginPageInvoicePrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageInvoice, gnc_plugin_page_invoice, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_INVOICE, GncPluginPageInvoicePrivate))
((GncPluginPageInvoicePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_INVOICE))
static GObjectClass *parent_class = NULL;

View File

@@ -86,7 +86,7 @@ typedef struct GncPluginPageOwnerTreePrivate
} GncPluginPageOwnerTreePrivate;
#define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, GncPluginPageOwnerTreePrivate))
((GncPluginPageOwnerTreePrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_OWNER_TREE))
static GObjectClass *parent_class = NULL;

View File

@@ -597,7 +597,7 @@ typedef struct GncPluginPageRegisterPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageRegister, gnc_plugin_page_register, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterPrivate))
((GncPluginPageRegisterPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REGISTER))
static GObjectClass *parent_class = NULL;

View File

@@ -555,7 +555,7 @@ typedef struct GncPluginPageRegister2Private
} GncPluginPageRegister2Private;
#define GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2Private))
((GncPluginPageRegister2Private*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REGISTER2))
static GObjectClass *parent_class = NULL;

View File

@@ -136,7 +136,7 @@ typedef struct GncPluginPageReportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginPageReport, gnc_plugin_page_report, GNC_TYPE_PLUGIN_PAGE)
#define GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_REPORT, GncPluginPageReportPrivate))
((GncPluginPageReportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_REPORT))
static void gnc_plugin_page_report_class_init( GncPluginPageReportClass *klass );
static void gnc_plugin_page_report_init( GncPluginPageReport *plugin_page );

View File

@@ -98,7 +98,7 @@ typedef struct GncPluginPageSxListPrivate
} GncPluginPageSxListPrivate;
#define GNC_PLUGIN_PAGE_SX_LIST_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_SX_LIST, GncPluginPageSxListPrivate))
((GncPluginPageSxListPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_PAGE_SX_LIST))
static GObjectClass *parent_class = NULL;

View File

@@ -71,7 +71,7 @@ typedef struct GncPluginRegisterPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER, GncPluginRegisterPrivate))
((GncPluginRegisterPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_REGISTER))
static GObjectClass *parent_class = NULL;
static QofLogModule log_module = GNC_MOD_GUI;

View File

@@ -78,7 +78,7 @@ typedef struct GncPluginRegister2Private
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister2, gnc_plugin_register2, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_REGISTER2_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Private))
((GncPluginRegister2Private*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_REGISTER2))
static GObjectClass *parent_class = NULL;
static QofLogModule log_module = GNC_MOD_GUI;

View File

@@ -60,7 +60,7 @@ typedef struct _GNCSearchOwnerPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GNCSearchOwner, gnc_search_owner, GNC_TYPE_SEARCH_CORE_TYPE);
#define _PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_SEARCH_OWNER, GNCSearchOwnerPrivate))
((GNCSearchOwnerPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_SEARCH_OWNER))
static GNCSearchCoreTypeClass *parent_class;

View File

@@ -302,7 +302,7 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>

View File

@@ -40,15 +40,14 @@ add_library (gncmod-html
${html_HEADERS}
)
target_link_libraries(gncmod-html gncmod-engine gnc-module gncmod-gnome-utils ${WEBKIT_LDFLAGS} ${GUILE_LDFLAGS})
target_link_libraries(gncmod-html gncmod-engine gnc-module gncmod-gnome-utils
PkgConfig::GTK3 PkgConfig::WEBKIT ${GUILE_LDFLAGS})
target_compile_definitions(gncmod-html PRIVATE -DG_LOG_DOMAIN=\"gnc.html\")
target_include_directories (gncmod-html
PUBLIC
${GTK3_INCLUDE_DIRS}
${WEBKIT_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@@ -71,8 +71,10 @@ G_DEFINE_ABSTRACT_TYPE(GncHtml, gnc_html, GTK_TYPE_BIN)
static void gnc_html_class_init( GncHtmlClass* klass );
static void gnc_html_dispose( GObject* obj );
static void gnc_html_finalize( GObject* obj );
//#define GNC_HTML_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_HTML, GncHtmlPrivate))
/*
#define GNC_HTML_GET_PRIVATE(o) \
((GncHtmlPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_HTML))
*/
#define GNC_HTML_GET_PRIVATE(o) (GNC_HTML(o)->priv)
#include "gnc-html-p.h"

View File

@@ -51,7 +51,7 @@ add_library (gncmod-generic-import
${generic_import_noinst_HEADERS}
)
target_link_libraries(gncmod-generic-import gncmod-gnome-utils gncmod-engine ${GTK3_LDFLAGS} ${GLIB2_LDFLAGS})
target_link_libraries(gncmod-generic-import gncmod-gnome-utils gncmod-engine PkgConfig::GTK3 ${GLIB2_LDFLAGS})
target_compile_definitions (gncmod-generic-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import\")

View File

@@ -151,7 +151,7 @@ add_reconcile_date (gchar *so_far, Split *split, CsvExportInfo *info)
time64 t = xaccSplitGetDateReconciled (split);
char str_rec_date[MAX_DATE_LENGTH + 1];
memset (str_rec_date, 0, sizeof(str_rec_date));
qof_print_date_buff (str_rec_date, sizeof(str_rec_date), t);
qof_print_date_buff (str_rec_date, MAX_DATE_LENGTH, t);
result = g_strconcat (so_far, str_rec_date, info->mid_sep, NULL);
}
else

View File

@@ -77,7 +77,7 @@ typedef struct GncPluginCsvExportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_CSV_EXPORT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_CSV_EXPORT, GncPluginCsvExportPrivate))
((GncPluginCsvExportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_CSV_EXPORT))
static GObjectClass *parent_class = NULL;

View File

@@ -316,7 +316,7 @@ Result GncImportPrice::create_price (QofBook* book, GNCPriceDB *pdb, bool over)
char date_str [MAX_DATE_LENGTH + 1];
memset (date_str, 0, sizeof(date_str));
qof_print_date_buff (date_str, sizeof(date_str), date);
qof_print_date_buff (date_str, MAX_DATE_LENGTH, date);
DEBUG("Date is %s, Commodity from is '%s', Currency is '%s', "
"Amount is %s", date_str,
gnc_commodity_get_fullname (*m_from_commodity),

View File

@@ -72,7 +72,7 @@ typedef struct GncPluginCsvImportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_CSV_IMPORT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_CSV_IMPORT, GncPluginCsvImportPrivate))
((GncPluginCsvImportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_CSV_IMPORT))
static GObjectClass *parent_class = NULL;

View File

@@ -16,7 +16,7 @@ set(log_replay_noinst_HEADERS
add_library(gncmod-log-replay ${log_replay_SOURCES} ${log_replay_noinst_HEADERS})
target_link_libraries(gncmod-log-replay gncmod-gnome-utils gncmod-app-utils gncmod-engine
gnc-core-utils gnc-module ${GTK3_LDFLAGS})
gnc-core-utils gnc-module PkgConfig::GTK3)
target_compile_definitions(gncmod-log-replay PRIVATE -DG_LOG_DOMAIN=\"gnc.import.log-replay\")

View File

@@ -60,7 +60,7 @@ typedef struct GncPluginLogreplayPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplayPrivate))
((GncPluginLogreplayPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_LOG_REPLAY))
static GObjectClass *parent_class = NULL;

View File

@@ -58,7 +58,7 @@ typedef struct GncPluginOfxPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN)
#define GNC_PLUGIN_OFX_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_OFX, GncPluginOfxPrivate))
((GncPluginOfxPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_OFX))
static GObjectClass *parent_class = NULL;

View File

@@ -1186,7 +1186,7 @@ refresh_old_transactions (QIFImportWindow * wind, int selection)
}
gtk_list_store_append (store, &iter);
qof_print_date_buff (datebuff, sizeof (datebuff),
qof_print_date_buff (datebuff, MAX_DATE_LENGTH,
xaccTransRetDatePosted (gnc_xtn));
gtk_list_store_set
(store, &iter,
@@ -3304,7 +3304,7 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
gdouble amount_gd = 0;
time64 send_time = 0;
char datebuff [MAX_DATE_LENGTH + 1];
memset (datebuff, 0, sizeof (datebuff));
memset (datebuff, 0, MAX_DATE_LENGTH);
current_xtn = SCM_CAAR(duplicates);
#define FUNC_NAME "xaccTransCountSplits"
gnc_xtn = SWIG_MustGetPtr (current_xtn,
@@ -3323,7 +3323,7 @@ gnc_ui_qif_import_duplicates_match_prepare (GtkAssistant *assistant,
}
gtk_list_store_append (store, &iter);
send_time = xaccTransRetDatePosted (gnc_xtn);
qof_print_date_buff (datebuff, sizeof (datebuff), send_time);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, send_time);
gtk_list_store_set
(store, &iter,
QIF_TRANS_COL_INDEX, rownum++,

View File

@@ -59,7 +59,7 @@ typedef struct GncPluginQifImportPrivate
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN);
#define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_QIF_IMPORT, GncPluginQifImportPrivate))
((GncPluginQifImportPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_PLUGIN_QIF_IMPORT))
static GObjectClass *parent_class = NULL;

View File

@@ -43,7 +43,7 @@ set_source_files_properties (${ledger_core_SOURCES} PROPERTIES OBJECT_DEPENDS ${
add_library (gncmod-ledger-core ${ledger_core_SOURCES} ${ledger_core_HEADERS})
target_link_libraries(gncmod-ledger-core gncmod-register-gnome gncmod-register-core gncmod-gnome-utils
gncmod-engine gnc-core-utils ${GTK3_LDFLAGS})
gncmod-engine gnc-core-utils PkgConfig::GTK3)
target_compile_definitions (gncmod-ledger-core PRIVATE -DG_LOG_DOMAIN=\"gnc.register.ledger\")

View File

@@ -526,7 +526,7 @@ gnc_split_register_get_recn_tooltip (VirtualLocation virt_loc,
char datebuff[MAX_DATE_LENGTH + 1];
time64 time = xaccSplitGetDateReconciled (split);
memset (datebuff, 0, sizeof(datebuff));
qof_print_date_buff (datebuff, sizeof(datebuff), time);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, time);
return g_strdup_printf (_("Reconciled on %s"), datebuff);
}
else if (xaccSplitGetReconcile (split) == VREC)

View File

@@ -2574,9 +2574,7 @@ gnc_split_register_config_action (SplitRegister *reg)
case BANK_REGISTER:
/* broken ! FIXME bg */
case SEARCH_LEDGER:
/* Translators: This string has a context prefix; the translation
must only contain the part after the | character. */
gnc_combo_cell_add_menu_item (cell, Q_("Action Column|Deposit"));
gnc_combo_cell_add_menu_item (cell, C_("Action Column", "Deposit"));
gnc_combo_cell_add_menu_item (cell, _("Withdraw"));
gnc_combo_cell_add_menu_item (cell, _("Check"));
gnc_combo_cell_add_menu_item (cell, _("Interest"));
@@ -2675,8 +2673,7 @@ gnc_split_register_config_action (SplitRegister *reg)
gnc_combo_cell_add_menu_item (cell, _("Income"));
/* Action: Distribution */
gnc_combo_cell_add_menu_item (cell, _("Dist"));
/* Translators: This string has a disambiguation prefix */
gnc_combo_cell_add_menu_item (cell, Q_("Action Column|Split"));
gnc_combo_cell_add_menu_item (cell, C_("Action Column", "Split"));
break;
default:

View File

@@ -55,13 +55,13 @@ set_source_files_properties (${register_gnome_SOURCES} PROPERTIES OBJECT_DEPENDS
add_library (gncmod-register-gnome ${register_gnome_SOURCES} ${register_gnome_noinst_HEADERS})
target_link_libraries(gncmod-register-gnome gncmod-register-core ${GTK3_LDFLAGS})
target_link_libraries(gncmod-register-gnome gncmod-register-core PkgConfig::GTK3)
target_compile_definitions(gncmod-register-gnome PRIVATE -DG_LOG_DOMAIN=\"gnc.register.gnome\")
target_include_directories(gncmod-register-gnome
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_SOURCE_DIR}/gnucash/register/ledger-core ${GTK3_INCLUDE_DIRS}
PRIVATE ${CMAKE_SOURCE_DIR}/gnucash/register/ledger-core
)
if (APPLE)

View File

@@ -283,7 +283,7 @@ static guint32 dec_intensity_10percent(guint32 argb)
/* Actual drawing routines */
G_INLINE_FUNC void
static inline void
draw_cell_line (cairo_t *cr, GdkRGBA *bg_color,
double x1, double y1, double x2, double y2,
PhysicalCellBorderLineStyle style);

View File

@@ -103,7 +103,7 @@ gboolean gnucash_sheet_draw_cb (GtkWidget *widget, cairo_t *cr,
/** Implementation *****************************************************/
G_INLINE_FUNC gboolean
static inline gboolean
gnucash_sheet_virt_cell_out_of_bounds (GnucashSheet *sheet,
VirtualCellLocation vcell_loc);
gboolean

View File

@@ -27,10 +27,10 @@ add_library (gncmod-report
target_compile_definitions(gncmod-report PRIVATE -DG_LOG_DOMAIN=\"gnc.report.core\")
target_link_libraries(gncmod-report gnc-module gncmod-app-utils ${GTK3_LDFLAGS} ${GUILE_LDFLAGS})
target_link_libraries(gncmod-report gnc-module gncmod-app-utils PkgConfig::GTK3 ${GUILE_LDFLAGS})
target_include_directories (gncmod-report
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${GTK3_INCLUDE_DIRS}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@@ -495,6 +495,7 @@
;; user. This class simply maps its contents to the html-table.
;;
(use-modules (srfi srfi-2))
(use-modules (srfi srfi-9))
;; this is to work around a bug in the HTML export sytmem
@@ -554,39 +555,28 @@
;; helper for fetching values from the key/val environment alist
(define (get-val alist key)
(let ((lst (assoc-ref alist key)))
(if lst (car lst) lst)))
(and lst (car lst))))
;; helper to plop <env> in the next available env cell
(define (add-row env)
(let* ((html-table (gnc:_html-acct-table-matrix_ acct-table))
(row (gnc:html-table-num-rows html-table)))
(gnc:html-table-set-cell!
html-table
row
0
env)
row
)
)
(gnc:html-table-set-cell! html-table row 0 env)
row))
;; Add more stuff to an existing row
(define (append-to-row row env)
(gnc:html-acct-table-set-row-env! acct-table row
(append (gnc:html-acct-table-get-row-env acct-table row) env)))
(let* ((env (gnc:_html-acct-table-env_ acct-table))
;; establish all input parameters and their defaults
(depth-limit (let ((lim (get-val env 'display-tree-depth)))
(if (or (equal? lim 'unlimited)
(equal? lim 'all))
#f ;; BUG? other code expects integer here
lim)))
(and (number? lim) lim)))
(limit-behavior (or (get-val env 'depth-limit-behavior) 'summarize))
(indent (or (get-val env 'initial-indent) 0))
(less-p (let ((pred (get-val env 'account-less-p)))
(if (equal? pred #t) gnc:account-code-less-p pred)))
(if (eq? pred #t) gnc:account-code-less-p pred)))
(start-date (get-val env 'start-date))
(end-date (or (get-val env 'end-date)
(gnc:get-today)))
@@ -594,18 +584,15 @@
(gnc-default-report-currency)))
;; BUG: other code expects a real function here, maybe
;; someone was thinking price-source?
(exchange-fn (or (get-val env 'exchange-fn)
#f))
(get-balance-fn (or (get-val env 'get-balance-fn) #f))
(exchange-fn (get-val env 'exchange-fn))
(get-balance-fn (get-val env 'get-balance-fn))
(column-header (let ((cell (get-val env 'column-header)))
(if (equal? cell #t)
(if (eq? cell #t)
(gnc:make-html-table-cell "Account name")
cell)))
(subtotal-mode (get-val env 'parent-account-subtotal-mode))
(zero-mode (let ((mode (get-val env 'zero-balance-mode)))
(or (if (equal? mode #t) 'show-leaf-acct mode)
'show-leaf-acct)
))
(if (boolean? mode) 'show-leaf-acct mode)))
(label-mode (or (get-val env 'account-label-mode) 'anchor))
(balance-mode (or (get-val env 'balance-mode) 'post-closing))
(closing-pattern (or (get-val env 'closing-pattern)
@@ -613,16 +600,12 @@
(list 'str (_ "Closing Entries"))
(list 'cased #f)
(list 'regexp #f)
(list 'closing #t)
)
))
(list 'closing #t))))
(adjusting-pattern (or (get-val env 'adjusting-pattern)
(list
(list 'str (_ "Adjusting Entries"))
(list 'cased #f)
(list 'regexp #f)
)
))
(list 'regexp #f))))
(report-budget (or (get-val env 'report-budget) #f))
;; local variables
(toplvl-accts
@@ -637,19 +620,15 @@
;; helper to calculate the balances for all required accounts
(define (calculate-balances accts start-date end-date get-balance-fn)
(define (calculate-balances-helper accts start-date end-date acct-balances)
(if (not (null? accts))
(begin
;; using the existing function that cares about balance-mode
;; maybe this should get replaces at some point.
(hash-set! acct-balances (gncAccountGetGUID (car accts))
(get-balance-fn (car accts) start-date end-date))
(calculate-balances-helper (cdr accts) start-date end-date acct-balances)
)
acct-balances)
)
(define ret-hash (make-hash-table))
(define (calculate-balances-helper)
(for-each
(lambda (acct)
(hash-set! ret-hash (gncAccountGetGUID acct)
(get-balance-fn acct start-date end-date)))
accts))
(define (calculate-balances-simple accts start-date end-date hash-table)
(define (calculate-balances-simple)
(define (merge-splits splits subtract?)
(for-each
(lambda (split)
@@ -657,101 +636,72 @@
(guid (gncAccountGetGUID acct))
(acct-comm (xaccAccountGetCommodity acct))
(shares (xaccSplitGetAmount split))
(hash (hash-ref hash-table guid)))
(if (not hash)
(begin (set! hash (gnc:make-commodity-collector))
(hash-set! hash-table guid hash)))
(hash 'add acct-comm (if subtract?
(gnc-numeric-neg shares)
shares))))
(hash (hash-ref ret-hash guid)))
(unless hash
(set! hash (gnc:make-commodity-collector))
(hash-set! ret-hash guid hash))
(hash 'add acct-comm (if subtract? (- shares) shares))))
splits))
;; If you pass a null account list to gnc:account-get-trans-type-splits-interval
;; it returns splits from all accounts rather than from no accounts. This is
;; probably a bug but we'll work around it for now.
(if (not (null? accts))
(begin
(merge-splits (gnc:account-get-trans-type-splits-interval
accts #f start-date end-date)
#f)
(cond
((equal? balance-mode 'post-closing) #t)
((equal? balance-mode 'pre-closing)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts closing-pattern start-date end-date)
#t))
((equal? balance-mode 'pre-adjusting)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts closing-pattern start-date end-date)
#t)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts adjusting-pattern start-date end-date)
#t))
(else (begin (display "you fail it")
(newline))))))
hash-table
)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts #f start-date end-date)
#f)
(case balance-mode
((post-closing) #f)
;; remove closing entries
((pre-closing)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts closing-pattern start-date end-date) #t))
;; remove closing and adjusting entries
((pre-adjusting)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts closing-pattern start-date end-date) #t)
(merge-splits (gnc:account-get-trans-type-splits-interval
accts adjusting-pattern start-date end-date) #t))
(else
(display "you fail it\n"))))
(if get-balance-fn
(calculate-balances-helper accts start-date end-date
(make-hash-table 23))
(calculate-balances-simple accts start-date end-date
(make-hash-table 23))
)
)
(calculate-balances-helper)
(calculate-balances-simple))
ret-hash)
(define (traverse-accounts! accts acct-depth logi-depth new-balances)
(define (use-acct? acct)
;; BUG? when depth-limit is not integer but boolean?
(and (or (equal? limit-behavior 'flatten) (< logi-depth depth-limit))
(member acct accounts)
)
)
(and (or (eq? limit-behavior 'flatten)
(< logi-depth depth-limit))
(member acct accounts)))
;; helper function to return a cached balance from a list of
;; ( acct . balance ) cells
(define (get-balance acct-balances acct)
(let ((this-collector (gnc:make-commodity-collector)))
(this-collector
'merge
(or (hash-ref acct-balances (gncAccountGetGUID acct))
;; return a zero commodity collector
(gnc:make-commodity-collector))
#f)
this-collector
)
)
(let ((this-collector (gnc:make-commodity-collector))
(acct-coll (hash-ref acct-balances (gncAccountGetGUID acct)
(gnc:make-commodity-collector))))
(this-collector 'merge acct-coll #f)
this-collector))
;; helper function that returns a cached balance from a list of
;; ( acct . balance ) cells for the given account *and* its
;; helper function that returns a cached balance from a list of
;; ( acct . balance) cells for the given account *and* its
;; sub-accounts.
(define (get-balance-sub acct-balances account)
;; its important to make a *new* collector for this, otherwise we're dealing with
;; pointers to the current collectors in our acct-balances hash and that's a
;; problem -- the balances get changed.
(let ((this-collector (gnc:make-commodity-collector)))
;; get the balance of the parent account and stick it on the collector
;; that nice shiny *NEW* collector!!
(this-collector 'merge (get-balance acct-balances account) #f)
(for-each
(lambda (x) (if x (this-collector 'merge x #f)))
(gnc:account-map-descendants
(lambda (a)
(get-balance acct-balances a ))
account))
(let ((this-collector (gnc:make-commodity-collector)))
(for-each
(lambda (acct)
(this-collector 'merge (get-balance acct-balances acct) #f))
(gnc:accounts-and-all-descendants (list account)))
this-collector))
(let ((disp-depth
(if (integer? depth-limit)
(min (- depth-limit 1) logi-depth)
logi-depth))
(row-added? #f)
)
(let ((disp-depth (if (integer? depth-limit)
(min (- depth-limit 1) logi-depth)
logi-depth))
(row-added? #f))
(for-each
(lambda (acct)
@@ -816,11 +766,9 @@
(list 'exchange-fn exchange-fn)
)))
(row-env #f)
(label (or (and (equal? label-mode 'anchor)
account-anchor)
(and (equal? label-mode 'name)
(gnc:make-html-text account-name))
))
(label (case label-mode
((anchor) account-anchor)
((name) (gnc:make-html-text account-name))))
(row #f)
(children-displayed? #f)
)
@@ -1201,38 +1149,32 @@
((not (null? children)) parent-acct-bal-mode)
(else 'immediate-bal)))
(comm-amt
(get-val env (assq-ref '((immediate-bal . account-bal)
(recursive-bal . recursive-bal)
(omit-bal . #f))
bal-method)))
(amt (and comm-amt
(if (gnc-reverse-balance acct)
(gnc:commodity-collector-get-negated comm-amt)
comm-amt)))
(zero-mode (let ((mode (get-val env 'zero-balance-display-mode)))
(if (boolean? mode)
'show-balance
mode)))
(native-comm?
(lambda (amt)
(gnc:uniform-commodity? amt report-commodity)))
(amt (and-let* ((bal-syms '((immediate-bal . account-bal)
(recursive-bal . recursive-bal)
(omit-bal . #f)))
(bal-sym (assq-ref bal-syms bal-method))
(comm-amt (get-val env bal-sym)))
(cond
((and (eq? zero-mode 'omit-balance)
(gnc-commodity-collector-allzero? comm-amt)) #f)
((gnc-reverse-balance acct)
(gnc:commodity-collector-get-negated comm-amt))
(else comm-amt))))
;; amount is either a <gnc:monetary> or #f
(amount (and amt
(not (and (eq? zero-mode 'omit-balance)
(gnc-commodity-collector-allzero? amt)))
(cond
((and (not (native-comm? amt))
(eq? multicommodity-mode 'table)
(eq? row-type 'account-row))
(gnc-commodity-table
amt report-commodity exchange-fn))
(else
(gnc:sum-collector-commodity
amt report-commodity exchange-fn)))))
(amount
(cond
((not amt) #f)
((and (not (gnc:uniform-commodity? amt report-commodity))
(eq? multicommodity-mode 'table)
(eq? row-type 'account-row))
(gnc-commodity-table amt report-commodity exchange-fn))
(else
(gnc:sum-collector-commodity amt report-commodity exchange-fn))))
(indented-depth (get-val env 'indented-depth))
(account-colspan (get-val env 'account-colspan))

View File

@@ -546,7 +546,7 @@ also show overall period profit & loss."))
monetary)))
(loop (cdr accounts)
(if (list? amt)
(append amt result)
(append-reverse amt result)
(cons amt result))))))))
(define (is-not-zero? accts)
@@ -706,12 +706,14 @@ also show overall period profit & loss."))
;; get all options values
(let* ((report-title (get-option gnc:pagename-general gnc:optname-reportname))
(startdate (gnc:date-option-absolute-time
(get-option gnc:pagename-general
optname-startdate)))
(enddate (gnc:date-option-absolute-time
(get-option gnc:pagename-general
optname-enddate)))
(startdate ((if (eq? report-type 'pnl)
gnc:time64-start-day-time
gnc:time64-end-day-time)
(gnc:date-option-absolute-time
(get-option gnc:pagename-general optname-startdate))))
(enddate (gnc:time64-end-day-time
(gnc:date-option-absolute-time
(get-option gnc:pagename-general optname-enddate))))
(disable-account-indent? (get-option gnc:pagename-display
optname-account-full-name))
(incr (get-option gnc:pagename-general optname-period))
@@ -761,15 +763,13 @@ also show overall period profit & loss."))
common-currency)))))
(price-source (and common-currency
(get-option pagename-commodities optname-price-source)))
(report-dates (map (if (eq? report-type 'balsheet)
gnc:time64-end-day-time
gnc:time64-start-day-time)
(if incr
(gnc:make-date-list
startdate enddate (gnc:deltasym-to-delta incr))
(if (eq? report-type 'balsheet)
(list enddate)
(list startdate enddate)))))
(report-dates
(cond
(incr (gnc:make-date-list startdate enddate (gnc:deltasym-to-delta incr)))
((eq? report-type 'pnl) (list startdate enddate))
(else (list enddate))))
(accounts-balances (map
(lambda (acc)
(cons acc
@@ -866,6 +866,10 @@ also show overall period profit & loss."))
(assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
(trading-accounts
(assoc-ref split-up-accounts ACCT-TYPE-TRADING))
(asset-liability (append-reverse asset-accounts liability-accounts))
(income-expense (append-reverse income-accounts expense-accounts))
(doc (gnc:make-html-document))
(multicol-table-left (gnc:make-html-table))
(multicol-table-right (if enable-dual-columns?
@@ -915,8 +919,7 @@ also show overall period profit & loss."))
(let ((asset-liab-balances
(map cdr (filter
(lambda (acc-balances)
(member (car acc-balances)
(append asset-accounts liability-accounts)))
(member (car acc-balances) asset-liability))
accounts-balances))))
(if (null? asset-liab-balances)
(map (const (gnc:make-commodity-collector)) report-dates)
@@ -927,8 +930,7 @@ also show overall period profit & loss."))
(map cdr
(filter
(lambda (acc-balances)
(member (car acc-balances)
(append income-accounts expense-accounts)))
(member (car acc-balances) income-expense))
accounts-balances))))
(if (null? inc-exp-balances)
(map (const (gnc:make-commodity-collector)) report-dates)
@@ -956,7 +958,7 @@ also show overall period profit & loss."))
(list-ref asset-liability-balances col-idx))
(asset-liability-basis
(gnc:accounts-get-comm-total-assets
(append asset-accounts liability-accounts)
asset-liability
(lambda (acc)
(gnc:account-get-comm-value-at-date acc date #f))))
(unrealized (gnc:make-commodity-collector)))
@@ -973,9 +975,7 @@ also show overall period profit & loss."))
(list-ref income-expense-balances col-idx)))
(if (and common-currency
(every has-price?
(map xaccAccountGetCommodity
(append income-accounts
expense-accounts))))
(gnc:accounts-get-commodities income-expense #f)))
(gnc:monetary-neg
(monetaries->exchanged income-expense-balance
common-currency price-source date))
@@ -992,8 +992,7 @@ also show overall period profit & loss."))
(list "General" "Step Size" incr)
(list "General" "Price Source"
(or price-source 'pricedb-nearest))
(list "Accounts" "Accounts"
(append asset-accounts liability-accounts))))))
(list "Accounts" "Accounts" asset-liability)))))
(get-col-header-fn (lambda (accounts col-idx)
(let* ((date (list-ref report-dates col-idx))
(header (qof-print-date date))
@@ -1065,7 +1064,7 @@ also show overall period profit & loss."))
(if (and common-currency show-rates?)
(add-to-table multicol-table-right (_ "Exchange Rates")
(append asset-accounts liability-accounts)
asset-liability
#:get-col-header-fn get-exchange-rates-fn
#:show-accounts? #f
#:show-total? #f))
@@ -1082,14 +1081,17 @@ also show overall period profit & loss."))
(closing-regexp (get-option pagename-entries optname-closing-regexp))
(include-overall-period? (get-option gnc:pagename-general
optname-include-overall-period))
(col-idx->datepair (lambda (idx)
(if (eq? idx 'overall-period)
(cons (car report-dates) (last report-dates))
(cons (list-ref report-dates idx)
(gnc:time64-end-day-time
(decdate
(list-ref report-dates (1+ idx))
DayDelta))))))
(col-idx->datepair
(lambda (idx)
(cond
((eq? idx 'overall-period)
(cons (car report-dates) (last report-dates)))
((= idx (- (length report-dates) 2))
(cons (list-ref report-dates idx) (last report-dates)))
(else
(cons (list-ref report-dates idx)
(decdate (list-ref report-dates (1+ idx)) DayDelta))))))
(col-idx->monetarypair (lambda (balancelist idx)
(if (eq? idx 'overall-period)
(cons (car balancelist) (last balancelist))
@@ -1098,7 +1100,7 @@ also show overall period profit & loss."))
(closing-entries (let ((query (qof-query-create-for-splits)))
(qof-query-set-book query (gnc-get-current-book))
(xaccQueryAddAccountMatch
query (append income-accounts expense-accounts)
query income-expense
QOF-GUID-MATCH-ANY QOF-QUERY-AND)
(if (and closing-str (not (string-null? closing-str)))
(xaccQueryAddDescriptionMatch
@@ -1166,8 +1168,7 @@ also show overall period profit & loss."))
(list "General" "Step Size" (or incr 'MonthDelta))
(list "General" "Price Source"
(or price-source 'pricedb-nearest))
(list "Accounts" "Accounts"
(append income-accounts expense-accounts))))))
(list "Accounts" "Accounts" income-expense)))))
(get-col-header-fn
(lambda (accounts col-idx)
(let* ((datepair (col-idx->datepair col-idx))
@@ -1236,14 +1237,14 @@ also show overall period profit & loss."))
(unless (or (null? income-accounts)
(null? expense-accounts))
(add-to-table multicol-table-left (_ "Net Income")
(append income-accounts expense-accounts)
income-expense
#:show-accounts? #f
#:negate-amounts? #t
#:force-total? #t))
(if (and common-currency show-rates?)
(add-to-table multicol-table-left (_ "Exchange Rates")
(append income-accounts expense-accounts)
income-expense
#:get-col-header-fn get-exchange-rates-fn
#:show-accounts? #f
#:show-total? #f))

View File

@@ -61,14 +61,14 @@
render)))
(define (strip-string s1 s2)
(let loop ((str s1))
(let loop ((str s1)
(res '()))
(let ((startpos (string-contains str (format #f "<~a" s2)))
(endpos (string-contains str (format #f "</~a>" s2))))
(if (and startpos endpos)
(loop (string-append
(string-take str startpos)
(string-drop str (+ endpos (string-length s2) 3))))
str))))
(loop (substring str (+ endpos (string-length s2) 3))
(cons (substring str 0 startpos) res))
(string-concatenate-reverse (cons str res))))))
(export gnc:options->sxml)
(define* (gnc:options->sxml uuid options prefix test-title #:key strip-tag)

View File

@@ -2075,9 +2075,7 @@ typedef enum
#define done_state(state) (((state) == DONE_ST) || ((state) == NO_NUM_ST))
G_INLINE_FUNC long long int multiplier (int num_decimals);
long long int
static inline long long int
multiplier (int num_decimals)
{
switch (num_decimals)

View File

@@ -121,7 +121,7 @@ enum
};
#define GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_ACCOUNT, AccountPrivate))
((AccountPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_ACCOUNT))
/********************************************************************\
* Because I can't use C++ for this project, doesn't mean that I *
@@ -241,7 +241,7 @@ GList *gnc_account_list_name_violations (QofBook *book, const gchar *separator)
/********************************************************************\
\********************************************************************/
G_INLINE_FUNC void mark_account (Account *acc);
static inline void mark_account (Account *acc);
void
mark_account (Account *acc)
{

View File

@@ -656,7 +656,7 @@ xaccSplitDump (const Split *split, const char *tag)
{
char datebuff[MAX_DATE_LENGTH + 1];
memset (datebuff, 0, sizeof(datebuff));
qof_print_date_buff (datebuff, sizeof(datebuff), split->date_reconciled);
qof_print_date_buff (datebuff, MAX_DATE_LENGTH, split->date_reconciled);
printf(" %s Split %p", tag, split);
printf(" Book: %p\n", qof_instance_get_book(split));
printf(" Account: %p (%s)\n", split->acc,
@@ -1609,8 +1609,7 @@ xaccSplitGetCorrAccountCode(const Split *sa)
if (!get_corr_account_split(sa, &other_split))
{
if (!split_const)
/* Translators: This string has a disambiguation prefix */
split_const = Q_("Displayed account code of the other account in a multi-split transaction|Split");
split_const = C_("Displayed account code of the other account in a multi-split transaction", "Split");
return split_const;
}

View File

@@ -228,13 +228,13 @@ xaccTransStillHasSplit(const Transaction *trans, const Split *s)
} \
}
G_INLINE_FUNC void mark_trans (Transaction *trans);
static inline void mark_trans (Transaction *trans);
void mark_trans (Transaction *trans)
{
FOR_EACH_SPLIT(trans, mark_split(s));
}
G_INLINE_FUNC void gen_event_trans (Transaction *trans);
static inline void gen_event_trans (Transaction *trans);
void gen_event_trans (Transaction *trans)
{
GList *node;
@@ -524,13 +524,14 @@ void
xaccTransDump (const Transaction *trans, const char *tag)
{
GList *node;
char datebuff[MAX_DATE_LENGTH + 1];
printf("%s Trans %p", tag, trans);
memset(datebuff, 0, sizeof(datebuff));
qof_print_date_buff(datebuff, sizeof(datebuff), trans->date_entered);
qof_print_date_buff(datebuff, MAX_DATE_LENGTH, trans->date_entered);
printf(" Entered: %s\n", datebuff);
memset(datebuff, 0, sizeof(datebuff));
qof_print_date_buff(datebuff, sizeof(datebuff), trans->date_posted);
qof_print_date_buff(datebuff, MAX_DATE_LENGTH, trans->date_posted);
printf(" Posted: %s\n", datebuff);
printf(" Num: %s\n", trans->num ? trans->num : "(null)");
printf(" Description: %s\n",

View File

@@ -74,7 +74,7 @@ typedef struct GncBudgetPrivate
} GncBudgetPrivate;
#define GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_BUDGET, GncBudgetPrivate))
((GncBudgetPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_BUDGET))
struct _GncBudgetClass
{

View File

@@ -90,7 +90,7 @@ typedef struct gnc_commodityPrivate
} gnc_commodityPrivate;
#define GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_COMMODITY, gnc_commodityPrivate))
((gnc_commodityPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_COMMODITY))
struct _GncCommodityClass
{

View File

@@ -552,9 +552,10 @@ const gchar *qof_date_text_format_get_string(QofDateFormat df)
}
size_t
qof_print_date_dmy_buff (char * buff, size_t len, int day, int month, int year)
qof_print_date_dmy_buff (char * buff, const size_t len, int day, int month, int year)
{
if (!buff) return 0;
try
{
GncDate date(year, month, day);
@@ -577,9 +578,10 @@ qof_print_date_dmy_buff (char * buff, size_t len, int day, int month, int year)
}
size_t
qof_print_date_buff (char * buff, size_t len, time64 t)
qof_print_date_buff (char * buff, const size_t len, time64 t)
{
if (!buff) return 0;
try
{
GncDateTime gncdt(t);
@@ -614,7 +616,7 @@ qof_print_gdate( char *buf, size_t len, const GDate *gd )
char *
qof_print_date (time64 t)
{
char buff[MAX_DATE_LENGTH];
char buff[MAX_DATE_LENGTH + 1];
memset (buff, 0, sizeof (buff));
qof_print_date_buff (buff, MAX_DATE_LENGTH, t);
return g_strdup (buff);

View File

@@ -95,7 +95,7 @@ typedef struct GNCLotPrivate
} GNCLotPrivate;
#define GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_LOT, GNCLotPrivate))
((GNCLotPrivate*)g_type_instance_get_private((GTypeInstance*)o, GNC_TYPE_LOT))
#define gnc_lot_set_guid(L,G) qof_instance_set_guid(QOF_INSTANCE(L),&(G))

View File

@@ -61,7 +61,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
#define _GNC_MOD_NAME GNC_ADDRESS_MODULE_NAME
G_INLINE_FUNC void mark_address (GncAddress *address);
static inline void mark_address (GncAddress *address);
void mark_address (GncAddress *address)
{
address->dirty = TRUE;

View File

@@ -86,7 +86,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
/* ============================================================== */
/* misc inline funcs */
G_INLINE_FUNC void mark_customer (GncCustomer *customer);
static inline void mark_customer (GncCustomer *customer);
void mark_customer (GncCustomer *customer)
{
qof_instance_set_dirty(&customer->inst);

Some files were not shown because too many files have changed in this diff Show More