Merge branch 'maint'

Fixes breakage of Windows master build by not trying to link on Windows.
This commit is contained in:
John Ralls
2016-01-15 10:03:24 -08:00
11 changed files with 132 additions and 42 deletions

View File

@@ -6,7 +6,7 @@
IF (WIN32)
CMAKE_MINIMUM_REQUIRED (VERSION 3.3.2)
ELSE()
CMAKE_MINIMUM_REQUIRED (VERSION 3.1)
CMAKE_MINIMUM_REQUIRED (VERSION 3.0)
ENDIF()
PROJECT (Gnucash)
@@ -476,6 +476,19 @@ SET(gnucash_DOCS
INSTALL(FILES ${gnucash_DOCS} DESTINATION share/doc/gnucash)
# Link COPYING to LICENSE
SET (_CMD create_symlink)
IF (WIN32)
SET(_CMD copy)
ENDIF()
INSTALL(CODE
" EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E ${_CMD} LICENSE COPYING
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/doc/gnucash
)"
)
#For windows, copy in some DLLs from Mingw
IF (WIN32)

View File

@@ -11,13 +11,17 @@ ENDIF(APPLE)
IF (GNC_BUILD_AS_INSTALL)
SET(CMAKE_COMMAND_TMP "")
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
ENDIF()
SET(schema-targets aqb-gschema business-gnome-gschema csv-exp-gschema csv-imp-gschema
generic-import-gschema gnome-gschema gnome-utils-gschema ofx-gschema qif-imp-gschema)
SET(SCHEMA_DIRECTORY ${DATADIR_BUILD}/glib-2.0/schemas)
ADD_CUSTOM_COMMAND(
OUTPUT ${SCHEMA_DIRECTORY}/gschemas.compiled
COMMAND ${CMAKE_COMMAND} -E env ${GLIB_COMPILE_SCHEMAS} ${SCHEMA_DIRECTORY}
COMMAND ${CMAKE_COMMAND_TMP} ${GLIB_COMPILE_SCHEMAS} ${SCHEMA_DIRECTORY}
DEPENDS ${schema-targets}
)

View File

@@ -21,11 +21,19 @@ IF (GNC_BUILD_AS_INSTALL)
FILE(COPY ${doc_DATA} DESTINATION ${DATADIR_BUILD}/doc/gnucash)
ENDIF()
EXECUTE_PROCESS(
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E env date +"%B %Y"
OUTPUT_VARIABLE DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
)
ELSE()
EXECUTE_PROCESS(
COMMAND date +"%B %Y"
OUTPUT_VARIABLE DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ENDIF()
# Generate the tip of the day file.

View File

@@ -11,23 +11,24 @@ SET (ALL_LINGUAS ${TP_LINGUAS} ${GC_LINGUAS} ${NEW_LINGUAS})
SET (CATALOGS "")
SET (BUILD_CATALOGS "")
SET(CMAKE_COMMAND_TMP "")
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
ENDIF()
FOREACH(lingua ${ALL_LINGUAS})
SET(_OUTPUT_FILE ${lingua}.gmo)
LIST(APPEND CATALOGS ${_OUTPUT_FILE})
ADD_CUSTOM_COMMAND(
OUTPUT ${_OUTPUT_FILE}
COMMAND ${CMAKE_COMMAND} -E env ${MSGFMT} -o ${_OUTPUT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${lingua}.po
COMMAND ${CMAKE_COMMAND_TMP} ${MSGFMT} -o ${_OUTPUT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${lingua}.po
)
IF (GNC_BUILD_AS_INSTALL)
SET(_BUILD_FILE_DIR ${DATADIR_BUILD}/locale/${lingua}/LC_MESSAGES)
MAKE_DIRECTORY(${_BUILD_FILE_DIR})
SET(_BUILD_FILE ${_BUILD_FILE_DIR}/gnucash.gmo)
LIST(APPEND BUILD_CATALOGS ${_BUILD_FILE})
#ADD_CUSTOM_COMMAND(
# OUTPUT ${_BUILD_FILE}
# COMMAND ${CMAKE_COMMAND} make_directory ${_BUILD_FILE_DIR}
#
#)
ADD_CUSTOM_COMMAND(
OUTPUT ${_BUILD_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${lingua}.gmo ${_BUILD_FILE}

View File

@@ -7,6 +7,10 @@ MACRO(ADD_GSCHEMA_TARGETS _TARGET _gschema_INPUTS)
IF(WIN32)
SET(INITTOOL_OPTIONS "/tmp")
ENDIF(WIN32)
SET(CMAKE_COMMAND_TMP "")
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
ENDIF()
FOREACH(file ${_gschema_INPUTS})
GNC_CONFIGURE2(${file}.in.in ${file}.in)
STRING(REPLACE ".xml" ".valid" file_no_xml ${file})
@@ -20,7 +24,7 @@ MACRO(ADD_GSCHEMA_TARGETS _TARGET _gschema_INPUTS)
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${_OUTPUT_FILE}
COMMAND ${CMAKE_COMMAND} -E env
COMMAND ${CMAKE_COMMAND_TMP}
LC_ALL=C
${PERL_EXECUTABLE} ${INTLTOOL_MERGE} -x -u ${INITTOOL_OPTIONS} ${CMAKE_CURRENT_BINARY_DIR}/${file}.in ${CMAKE_CURRENT_BINARY_DIR}/${file}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${file}.in
@@ -35,14 +39,14 @@ MACRO(ADD_GSCHEMA_TARGETS _TARGET _gschema_INPUTS)
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${_VALID_FILE}
COMMAND ${CMAKE_COMMAND} -E env
${GLIB_COMPILE_SCHEMAS} --strict --dry-run --schema-file=${_OUTPUT_FILE}
COMMAND ${CMAKE_COMMAND_TMP}
${GLIB_COMPILE_SCHEMAS} --strict --dry-run --schema-file=${_OUTPUT_FILE}
COMMAND ${CMAKE_COMMAND} -E touch ${_VALID_FILE}
DEPENDS ${_OUTPUT_FILE}
)
ENDFOREACH(file)
ADD_CUSTOM_TARGET(${_TARGET} DEPENDS "${_gschema_OUTPUTS};${_gschema_VALIDS};${_gschema_BUILDS}")
ADD_CUSTOM_TARGET(${_TARGET} DEPENDS ${_gschema_OUTPUTS} ${_gschema_VALIDS} ${_gschema_BUILDS})
INSTALL(FILES ${_gschema_OUTPUTS} DESTINATION share/glib-2.0/schemas)

View File

@@ -39,9 +39,9 @@ MACRO(GNC_ADD_SCHEME_TARGETS _TARGET _SOURCE_FILES _OUTPUT_DIR_IN _GUILE_MODULES
ENDIF()
ENDFOREACH(scheme_file)
IF(HAVE_GUILE1)
ADD_CUSTOM_TARGET(${_TARGET} ALL DEPENDS "${_SCHEME_LINKS}")
ADD_CUSTOM_TARGET(${_TARGET} ALL DEPENDS ${_SCHEME_LINKS})
ELSE()
ADD_CUSTOM_TARGET(${_TARGET}-links ALL DEPENDS "${_SCHEME_LINKS}")
ADD_CUSTOM_TARGET(${_TARGET}-links ALL DEPENDS ${_SCHEME_LINKS})
ENDIF()
ENDIF(HAVE_GUILE1 OR MAKE_LINKS)
@@ -114,9 +114,13 @@ MACRO(GNC_ADD_SCHEME_TARGETS _TARGET _SOURCE_FILES _OUTPUT_DIR_IN _GUILE_MODULES
IF (__DEBUG)
MESSAGE("ADD_CUSTOM_COMMAND: output = ${output_file}")
ENDIF()
SET(CMAKE_COMMMAND_TMP "")
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT ${output_file}
COMMAND ${CMAKE_COMMAND} -E env
COMMAND ${CMAKE_COMMAND_TMP}
GNC_UNINSTALLED=${_GNC_UNINSTALLED}
GNC_BUILDDIR=${CMAKE_BINARY_DIR}
#DYLD_FALLBACK_LIBRARY_PATH=${Boost_LIBRARY_DIRS} # this is hack for OS X

View File

@@ -1,3 +1,5 @@
if(${CMAKE_VERSION} VERSION_GREATER 3.1)
function (pkg_get_variable result pkg variable)
_pkgconfig_invoke("${pkg}" "prefix" "result" "" "--variable=${variable}")
set("${result}"
@@ -222,7 +224,7 @@ macro(_gnc_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no
if(NOT "${_extra_paths}" STREQUAL "")
# Restore the environment variable
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path})
set(ENV{PKG_CONFIG_PATH} ${_pkgconfig_path_old})
endif()
unset(_extra_paths)
@@ -234,15 +236,23 @@ macro(_gnc_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no
endif()
endmacro()
macro(gnc_pkg_check_modules _prefix _module0)
# check cached value
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
_pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path "${_module0}" ${ARGN})
_gnc_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
endif()
endmacro()
else()
macro(gnc_pkg_check_modules _prefix _module0)
if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
_pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
_pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules})
_pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
endif()
endmacro()
endif()

View File

@@ -119,9 +119,14 @@ INSTALL(TARGETS gnc-gnome
# FIXME: where does LC_ALL=C come from?
SET(CMAKE_COMMAND_TMP "")
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
ENDIF()
ADD_CUSTOM_COMMAND(
OUTPUT gnucash.appdata.xml
COMMAND ${CMAKE_COMMAND} -E env
COMMAND ${CMAKE_COMMAND_TMP}
LC_ALL=C
${PERL_EXECUTABLE} ${INTLTOOL_MERGE} -x -u -c ${CMAKE_SOURCE_DIR}/po/.intltool-merge-cache ${CMAKE_SOURCE_DIR}/po
${CMAKE_CURRENT_SOURCE_DIR}/gnucash.appdata.xml.in gnucash.appdata.xml
@@ -139,7 +144,7 @@ CONFIGURE_FILE(gnucash.desktop.in.in gnucash.desktop.in)
ADD_CUSTOM_COMMAND(
OUTPUT gnucash.desktop
COMMAND ${CMAKE_COMMAND} -E env
COMMAND ${CMAKE_COMMAND_TMP}
LC_ALL=C
${PERL_EXECUTABLE} ${INTLTOOL_MERGE} -d -u -c ${CMAKE_SOURCE_DIR}/po/.intltool-merge-cache ${CMAKE_SOURCE_DIR}/po
gnucash.desktop.in gnucash.desktop

View File

@@ -284,7 +284,7 @@ void gnc_bi_import_gui_filenameChanged_cb (GtkWidget *widget, gpointer data)
// generate preview
gtk_list_store_clear (gui->store);
gnc_bi_import_read_file (filename, gui->regexp->str, gui->store, 10, NULL);
gnc_bi_import_read_file (filename, gui->regexp->str, gui->store, 100, NULL);
g_free( filename );
}
@@ -315,7 +315,7 @@ void gnc_bi_import_gui_option3_cb (GtkWidget *widget, gpointer data)
BillImportGui *gui = data;
if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
return;
g_string_assign (gui->regexp, "^((?<id>[^\";]*)|\"(?<id>[^\"]*)\");((?<date_opened>[^\";]*)|\"(?<date_opened>[^\"]*)\");((?<owner_id>[^\";]*)|\"(?<owner_id>[^\"]*)\");((?<billing_id>[^\";]*)|\"(?<billing_id>[^\"]*)\");((?<notes>[^\";]*)|\"(?<notes>[^\"]*)\");((?<date>[^\";]*)|\"(?<date>[^\"]*)\");((?<desc>[^\";]*)|\"(?<desc>[^\"]*)\");((?<action>[^\";]*)|\"(?<action>[^\"]*)\");((?<account>[^\";]*)|\"(?<account>[^\"]*)\");((?<quantity>[^\";]*)|\"(?<quantity>[^\"]*)\");((?<price>[^\";]*)|\"(?<price>[^\"]*)\");((?<disc_type>[^\";]*)|\"(?<disc_type>[^\"]*)\");((?<disc_how>[^\";]*)|\"(?<disc_how>[^\"]*)\");((?<discount>[^\";]*)|\"(?<discount>[^\"]*)\");((?<taxable>[^\";]*)|\"(?<taxable>[^\"]*)\");((?<taxincluded>[^\";]*)|\"(?<taxincluded>[^\"]*)\");((?<tax_table>[^\";]*)|\"(?<tax_table>[^\"]*)\");((?<date_posted>[^\";]*)|\"(?<date_posted>[^\"]*)\");((?<due_date>[^\";]*)|\"(?<due_date>[^\"]*)\");((?<account_posted>[^\";]*)|\"(?<account_posted>[^\"]*)\");((?<memo_posted>[^\";]*)|\"(?<memo_posted>[^\"]*)\");((?<accu_splits>[^\";]*)|\"(?<accu_splits>[^\"]*)\")$");
g_string_assign (gui->regexp, "^((?<id>[^\";]*)|\"(?<id>[^\"]*)\");((?<date_opened>[^\";]*)|\"(?<date_opened>[^\"]*)\");((?<owner_id>[^\";]*)|\"(?<owner_id>[^\"]*)\");((?<billing_id>[^\";]*)|\"(?<billing_id>[^\"]*)\");((?<notes>[^\";]*)|\"(?<notes>([^\"]|\"\")*)\");((?<date>[^\";]*)|\"(?<date>[^\"]*)\");((?<desc>[^\";]*)|\"(?<desc>([^\"]|\"\")*)\");((?<action>[^\";]*)|\"(?<action>[^\"]*)\");((?<account>[^\";]*)|\"(?<account>[^\"]*)\");((?<quantity>[^\";]*)|\"(?<quantity>[^\"]*)\");((?<price>[^\";]*)|\"(?<price>[^\"]*)\");((?<disc_type>[^\";]*)|\"(?<disc_type>[^\"]*)\");((?<disc_how>[^\";]*)|\"(?<disc_how>[^\"]*)\");((?<discount>[^\";]*)|\"(?<discount>[^\"]*)\");((?<taxable>[^\";]*)|\"(?<taxable>[^\"]*)\");((?<taxincluded>[^\";]*)|\"(?<taxincluded>[^\"]*)\");((?<tax_table>[^\";]*)|\"(?<tax_table>[^\"]*)\");((?<date_posted>[^\";]*)|\"(?<date_posted>[^\"]*)\");((?<due_date>[^\";]*)|\"(?<due_date>[^\"]*)\");((?<account_posted>[^\";]*)|\"(?<account_posted>[^\"]*)\");((?<memo_posted>[^\";]*)|\"(?<memo_posted>[^\"]*)\");((?<accu_splits>[^\";]*)|\"(?<accu_splits>[^\"]*)\")$");
gnc_bi_import_gui_filenameChanged_cb (gui->entryFilename, gui);
}
@@ -325,7 +325,7 @@ void gnc_bi_import_gui_option4_cb (GtkWidget *widget, gpointer data)
BillImportGui *gui = data;
if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
return;
g_string_assign (gui->regexp, "^((?<id>[^\",]*)|\"(?<id>[^\"]*)\"),((?<date_opened>[^\",]*)|\"(?<date_opened>[^\"]*)\"),((?<owner_id>[^\",]*)|\"(?<owner_id>[^\"]*)\"),((?<billing_id>[^\",]*)|\"(?<billing_id>[^\"]*)\"),((?<notes>[^\",]*)|\"(?<notes>[^\"]*)\"),((?<date>[^\",]*)|\"(?<date>[^\"]*)\"),((?<desc>[^\",]*)|\"(?<desc>[^\"]*)\"),((?<action>[^\",]*)|\"(?<action>[^\"]*)\"),((?<account>[^\",]*)|\"(?<account>[^\"]*)\"),((?<quantity>[^\",]*)|\"(?<quantity>[^\"]*)\"),((?<price>[^\",]*)|\"(?<price>[^\"]*)\"),((?<disc_type>[^\",]*)|\"(?<disc_type>[^\"]*)\"),((?<disc_how>[^\",]*)|\"(?<disc_how>[^\"]*)\"),((?<discount>[^\",]*)|\"(?<discount>[^\"]*)\"),((?<taxable>[^\",]*)|\"(?<taxable>[^\"]*)\"),((?<taxincluded>[^\",]*)|\"(?<taxincluded>[^\"]*)\"),((?<tax_table>[^\",]*)|\"(?<tax_table>[^\"]*)\"),((?<date_posted>[^\",]*)|\"(?<date_posted>[^\"]*)\"),((?<due_date>[^\",]*)|\"(?<due_date>[^\"]*)\"),((?<account_posted>[^\",]*)|\"(?<account_posted>[^\"]*)\"),((?<memo_posted>[^\",]*)|\"(?<memo_posted>[^\"]*)\"),((?<accu_splits>[^\",]*)|\"(?<accu_splits>[^\"]*)\")$");
g_string_assign (gui->regexp, "^((?<id>[^\",]*)|\"(?<id>[^\"]*)\"),((?<date_opened>[^\",]*)|\"(?<date_opened>[^\"]*)\"),((?<owner_id>[^\",]*)|\"(?<owner_id>[^\"]*)\"),((?<billing_id>[^\",]*)|\"(?<billing_id>[^\"]*)\"),((?<notes>[^\",]*)|\"(?<notes>([^\"]|\"\")*)\"),((?<date>[^\",]*)|\"(?<date>[^\"]*)\"),((?<desc>[^\",]*)|\"(?<desc>([^\"]|\"\")*)\"),((?<action>[^\",]*)|\"(?<action>[^\"]*)\"),((?<account>[^\",]*)|\"(?<account>[^\"]*)\"),((?<quantity>[^\",]*)|\"(?<quantity>[^\"]*)\"),((?<price>[^\",]*)|\"(?<price>[^\"]*)\"),((?<disc_type>[^\",]*)|\"(?<disc_type>[^\"]*)\"),((?<disc_how>[^\",]*)|\"(?<disc_how>[^\"]*)\"),((?<discount>[^\",]*)|\"(?<discount>[^\"]*)\"),((?<taxable>[^\",]*)|\"(?<taxable>[^\"]*)\"),((?<taxincluded>[^\",]*)|\"(?<taxincluded>[^\"]*)\"),((?<tax_table>[^\",]*)|\"(?<tax_table>[^\"]*)\"),((?<date_posted>[^\",]*)|\"(?<date_posted>[^\"]*)\"),((?<due_date>[^\",]*)|\"(?<due_date>[^\"]*)\"),((?<account_posted>[^\",]*)|\"(?<account_posted>[^\"]*)\"),((?<memo_posted>[^\",]*)|\"(?<memo_posted>[^\"]*)\"),((?<accu_splits>[^\",]*)|\"(?<accu_splits>[^\"]*)\")$");
gnc_bi_import_gui_filenameChanged_cb (gui->entryFilename, gui);
}

View File

@@ -79,7 +79,7 @@
}
static QofLogModule log_module = G_LOG_DOMAIN; //G_LOG_BUSINESS;
static char * un_escape(char *str);
bi_import_result
gnc_bi_import_read_file (const gchar * filename, const gchar * parser_regexp,
GtkListStore * store, guint max_rows,
@@ -240,9 +240,9 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * fixed, guint * deleted,
guint dummy;
gint row = 1;
const gchar* date_format_string = qof_date_format_get_string (qof_date_format_get()); // Get the user set date format string
//date_format_string = qof_date_format_get_string (qof_date_format_get());
//date_format_string = qof_date_format_get_string (qof_date_format_get());
DEBUG("date_format_string: %s",date_format_string);
// allow the call to this function with only GtkListeStore* specified
@@ -298,7 +298,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * fixed, guint * deleted,
row, id);
}
else
{ // TODO: If id is empty get the next one in the series. Bug 731105
{ // TODO: If id is empty get the next one in the series. Bug 731105
if (strlen (id) == 0)
{
// no invoice id specified
@@ -386,9 +386,9 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * fixed, guint * deleted,
gtk_list_store_set (store, &iter, DUE_DATE,
date_posted, -1);
row_fixed = TRUE;
}
// due_date is valid
*/
if (strlen (quantity) == 0)
@@ -397,7 +397,7 @@ gnc_bi_import_fix_bis (GtkListStore * store, guint * fixed, guint * deleted,
gtk_list_store_set (store, &iter, QUANTITY, "1", -1);
row_fixed = TRUE;
}
// quantity is valid
@@ -533,7 +533,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
gchar *new_id = NULL;
gint64 denom = 0;
gnc_commodity *currency;
// these arguments are needed
g_return_if_fail (store && book);
// logic of this function only works for bills or invoices
@@ -626,6 +626,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
gncInvoiceSetDateOpened (invoice, now_timespec);
}
gncInvoiceSetBillingID (invoice, billing_id ? billing_id : "");
notes = un_escape(notes);
gncInvoiceSetNotes (invoice, notes ? notes : "");
gncInvoiceSetActive (invoice, TRUE);
//if (g_ascii_strcasecmp(type,"INVOICE"))gncInvoiceSetBillTo( invoice, billto );
@@ -710,6 +711,9 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
}
timespecFromTime64 (&today, gnc_time (NULL)); // set today to the current date
gncEntrySetDateEntered (entry, today);
// Remove escaped quotes
desc = un_escape(desc);
notes = un_escape(notes);
gncEntrySetDescription (entry, desc);
gncEntrySetAction (entry, action);
value = gnc_numeric_zero();
@@ -717,7 +721,7 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
gncEntrySetQuantity (entry, value);
acc = gnc_account_lookup_for_register (gnc_get_current_root_account (),
account);
if (g_ascii_strcasecmp (type, "BILL") == 0)
{
gncEntrySetBillAccount (entry, acc);
@@ -751,8 +755,8 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter);
// handle auto posting of invoices
if (valid)
gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, ID, &new_id, -1);
if (g_strcmp0 (id, new_id) != 0)
@@ -782,8 +786,8 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
}
}
}
// cleanup
g_free (new_id);
@@ -809,5 +813,36 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
g_free (account_posted);
g_free (memo_posted);
g_free (accumulatesplits);
}
/* Change any escaped quotes ("") to (")
* @param char* String to be modified
* @return char* Modified string.
*/
static char * un_escape(char *str)
{
gchar quote = '"';
gchar *newStr = NULL;
int n = 0;
newStr = g_malloc(strlen(str)+1); // This must be freed in the calling code.
while(*str != '\0')
{
if(*str == quote)
{
str++;
if(*str == quote)
{
newStr[n] = quote;
}
}
else
{
newStr[n] = *str;
}
str++;
n++;
}
newStr[n] = '\0'; //ending the character array
return newStr;
}

View File

@@ -26,6 +26,12 @@ FOREACH(file gnc-fq-check.in gnc-fq-helper.in gnc-fq-update.in gnc-fq-dump)
ENDIF()
ENDFOREACH(file)
SET(CMAKE_COMMAND_TMP "")
IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
SET(CMAKE_COMMAND_TMP ${CMAKE_COMMAND} -E env)
ENDIF()
SET(_MAN_FILES "")
FOREACH(file gnc-fq-dump gnc-fq-helper)
SET(_POD_INPUT ${CMAKE_CURRENT_BINARY_DIR}/${file})
@@ -34,7 +40,7 @@ FOREACH(file gnc-fq-dump gnc-fq-helper)
ADD_CUSTOM_COMMAND(
OUTPUT ${_MAN_OUTPUT}
COMMAND
${CMAKE_COMMAND} -E env ${PERL_EXECUTABLE} ${POD2MAN_EXECUTABLE} ${_POD_INPUT} ${_MAN_OUTPUT}
${CMAKE_COMMAND_TMP} ${PERL_EXECUTABLE} ${POD2MAN_EXECUTABLE} ${_POD_INPUT} ${_MAN_OUTPUT}
DEPENDS ${_POD_INPUT}
)
ENDFOREACH(file)