[Gnucash-changes] r13480 - gnucash/trunk - Fix duplicate account
name checking bug that prevented editing account
David Hampton
hampton at cvs.gnucash.org
Sat Mar 4 18:00:53 EST 2006
Author: hampton
Date: 2006-03-04 18:00:53 -0500 (Sat, 04 Mar 2006)
New Revision: 13480
Trac: http://svn.gnucash.org/trac/changeset/13480
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/gnome-utils/dialog-account.c
Log:
Fix duplicate account name checking bug that prevented editing account
info.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-03-04 21:44:42 UTC (rev 13479)
+++ gnucash/trunk/ChangeLog 2006-03-04 23:00:53 UTC (rev 13480)
@@ -1,3 +1,8 @@
+2006-03-04 David Hampton <hampton at employees.org>
+
+ * src/gnome-utils/dialog-account.c: Fix duplicate account name
+ checking bug that prevented editing account info.
+
2006-03-04 Andreas Köhler <andi5.py at gmx.net>
* src/gnome/glade/account.glade: set automatic policy on some
Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c 2006-03-04 21:44:42 UTC (rev 13479)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c 2006-03-04 23:00:53 UTC (rev 13480)
@@ -752,7 +752,8 @@
g_free(fullname_parent);
g_free(fullname);
}
- if (account != NULL) {
+ if ((account != NULL) &&
+ !guid_equal(&aw->account, xaccAccountGetGUID (account))) {
const char *message = _("There is already an account with that name.");
gnc_error_dialog(aw->dialog, message);
LEAVE("duplicate name");
@@ -1359,7 +1360,6 @@
{
char *fullname;
char *title;
- gint length;
if (!aw || !aw->parent_tree)
return;
@@ -1368,12 +1368,12 @@
if (aw->dialog_type == EDIT_ACCOUNT)
title = g_strconcat(_("Edit Account"), " - ", fullname, NULL);
- else if ((length = g_strv_length (aw->next_name)) > 0)
+ else if (aw->next_name && (g_strv_length(aw->next_name) > 0))
{
const char *format = _("(%d) New Accounts");
char *prefix;
- prefix = g_strdup_printf (format, length + 1);
+ prefix = g_strdup_printf (format, g_strv_length(aw->next_name) + 1);
title = g_strconcat (prefix, " - ", fullname, " ...", NULL);
More information about the gnucash-changes
mailing list