[grisbi-cvs] [SCM] grisbi branch, grisbi-0.8.x, updated. upstream_version_0_8_9-27-g362e154

Pierre Biava nobody at users.sourceforge.net
Wed Apr 25 23:11:14 CEST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, grisbi-0.8.x has been updated
       via  362e15420ade76f6925a1859aaf983f30332b666 (commit)
      from  67dd40c5e4f1a73aac317e58226d367b75f86b79 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 362e15420ade76f6925a1859aaf983f30332b666
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Apr 25 23:10:08 2012 +0200

    displays a warning message if the transaction date does not exist

-----------------------------------------------------------------------

Changes:
diff --git a/src/gsb_form.c b/src/gsb_form.c
index dcd5bba..6f3229c 100644
--- a/src/gsb_form.c
+++ b/src/gsb_form.c
@@ -2793,8 +2793,11 @@ gboolean gsb_form_validate_form_transaction ( gint transaction_number,
 
     /* work with value date */
     widget = gsb_form_widget_get_widget ( TRANSACTION_FORM_VALUE_DATE );
-
-    if ( widget && ! gsb_form_widget_check_empty ( widget ) )
+    if ( widget
+     &&
+     !gsb_form_widget_check_empty ( widget )
+     &&
+     strlen ( gtk_entry_get_text ( GTK_ENTRY ( widget ) ) ) > 0 )
     {
         if ( !gsb_date_check_entry ( widget ) )
         {
diff --git a/src/utils_dates.c b/src/utils_dates.c
index bc6f197..5251846 100644
--- a/src/utils_dates.c
+++ b/src/utils_dates.c
@@ -266,28 +266,25 @@ gboolean gsb_date_check_and_complete_entry ( GtkWidget *entry,
 gboolean gsb_date_check_entry ( GtkWidget *entry )
 {
     const gchar *string;
+    GDate *date;
 
-    if (!entry)
-    return FALSE;
+    if ( !entry )
+        return FALSE;
     
-    string = gtk_entry_get_text ( GTK_ENTRY (entry));
-    if (!string)
-    return FALSE;
+    string = gtk_entry_get_text ( GTK_ENTRY ( entry ) );
 
-    if ( strlen (string))
-    {
-        GDate *date;
+    if ( !string || strlen ( string ) == 0 )
+        return FALSE;
 
-        date = gsb_date_get_last_entry_date ( string );
-        if (!date)
-            return FALSE;
-        else
-        {
-            if ( buffer_entry_date == NULL )
-                buffer_entry_date = g_malloc0 ( sizeof (struct struct_last_entry_date) );
-            buffer_entry_date -> date_string = g_strdup ( string );
-            buffer_entry_date -> last_entry_date = date;
-        }
+    date = gsb_date_get_last_entry_date ( string );
+    if ( !date )
+        return FALSE;
+    else
+    {
+        if ( buffer_entry_date == NULL )
+            buffer_entry_date = g_malloc0 ( sizeof ( struct struct_last_entry_date ) );
+        buffer_entry_date -> date_string = g_strdup ( string );
+        buffer_entry_date -> last_entry_date = date;
     }
     return ( TRUE );
 }


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list