mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-10-25 23:50:06 -05:00
g_free qof_print_date which returns a new char*
This commit is contained in:
1 parent
d099d39afd
commit
c9db551693
3 files changed
+18
-10
No files matched your search
@@ -260,6 +260,7 @@ gtk_cell_editable_key_press_event (GtkEntry *entry,
|
||||
|
||||
if (qof_scan_date (date_string, &day, &month, &year))
|
||||
{
|
||||
gchar *datestr;
|
||||
when.tm_year = year - 1900;
|
||||
when.tm_mon = month - 1;
|
||||
when.tm_mday = day;
|
||||
@@ -267,7 +268,10 @@ gtk_cell_editable_key_press_event (GtkEntry *entry,
|
||||
if (!gnc_handle_date_accelerator (key_event, &when, date_string))
|
||||
return FALSE;
|
||||
|
||||
gtk_entry_set_text (entry, qof_print_date (gnc_mktime (&when)));
|
||||
datestr = qof_print_date (gnc_mktime (&when));
|
||||
gtk_entry_set_text (entry, datestr);
|
||||
g_free (datestr);
|
||||
|
||||
gtk_widget_grab_focus (GTK_WIDGET(entry));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -262,6 +262,7 @@ recnRecalculateBalance (RecnWindow *recnData)
|
||||
gnc_numeric ending;
|
||||
gnc_numeric reconciled;
|
||||
gnc_numeric diff;
|
||||
gchar *datestr;
|
||||
GNCPrintAmountInfo print_info;
|
||||
gboolean reverse_balance, include_children;
|
||||
GtkAction *action;
|
||||
@@ -289,8 +290,9 @@ recnRecalculateBalance (RecnWindow *recnData)
|
||||
|
||||
diff = gnc_numeric_sub_fixed (ending, reconciled);
|
||||
|
||||
gtk_label_set_text(GTK_LABEL(recnData->recn_date),
|
||||
qof_print_date(recnData->statement_date));
|
||||
datestr = qof_print_date (recnData->statement_date);
|
||||
gtk_label_set_text (GTK_LABEL(recnData->recn_date), datestr);
|
||||
g_free (datestr);
|
||||
|
||||
gnc_add_colorized_amount (recnData->starting, starting, print_info, FALSE);
|
||||
gnc_add_colorized_amount (recnData->ending, ending, print_info, reverse_balance);
|
||||
@@ -1866,13 +1868,16 @@ recnWindowWithBalance (GtkWidget *parent, Account *account, gnc_numeric new_endi
|
||||
{
|
||||
Split* split = n->data;
|
||||
time64 recn_date = xaccSplitGetDateReconciled (split);
|
||||
gchar *datestr, *recnstr;
|
||||
if ((xaccSplitGetReconcile (split) != YREC) ||
|
||||
(recn_date <= statement_date))
|
||||
continue;
|
||||
|
||||
PWARN ("split posting_date=%s, recn_date=%s",
|
||||
qof_print_date (xaccTransGetDate (xaccSplitGetParent (split))),
|
||||
qof_print_date (recn_date));
|
||||
datestr = qof_print_date (xaccTransGetDate (xaccSplitGetParent (split)));
|
||||
recnstr = qof_print_date (recn_date);
|
||||
PWARN ("split posting_date=%s, recn_date=%s", datestr, recnstr);
|
||||
g_free (datestr);
|
||||
g_free (recnstr);
|
||||
|
||||
gtk_statusbar_push (bar, context, _("WARNING! Account contains \
|
||||
splits whose reconcile date is after statement date. Reconciliation may be \
|
||||
|
||||
@@ -656,6 +656,7 @@ GncSqlTransBackend::commit (GncSqlBackend* sql_be, QofInstance* inst)
|
||||
{
|
||||
Split* split = xaccTransGetSplit (pTx, 0);
|
||||
Account* acc = xaccSplitGetAccount (split);
|
||||
gchar *datestr = qof_print_date (xaccTransGetDate (pTx));
|
||||
/* FIXME: This needs to be implemented
|
||||
const char *message1 = "Transaction %s dated %s in account %s not saved due to %s.%s";
|
||||
const char *message2 = "\nDatabase may be corrupted, check your data carefully.";
|
||||
@@ -668,10 +669,8 @@ GncSqlTransBackend::commit (GncSqlBackend* sql_be, QofInstance* inst)
|
||||
message2 );
|
||||
*/
|
||||
PERR ("Transaction %s dated %s in account %s not saved due to %s.\n",
|
||||
xaccTransGetDescription (pTx),
|
||||
qof_print_date (xaccTransGetDate (pTx)),
|
||||
xaccAccountGetName (acc),
|
||||
err);
|
||||
xaccTransGetDescription (pTx), datestr, xaccAccountGetName (acc), err);
|
||||
g_free (datestr);
|
||||
}
|
||||
return is_ok;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user