[Gnucash-changes] r13379 - gnucash/trunk - Make gchar argument const because it is only used as a const.

Christian Stimming cstim at cvs.gnucash.org
Fri Feb 24 16:43:39 EST 2006


Author: cstim
Date: 2006-02-24 16:43:37 -0500 (Fri, 24 Feb 2006)
New Revision: 13379
Trac: http://svn.gnucash.org/trac/changeset/13379

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/import-export/import-account-matcher.c
   gnucash/trunk/src/import-export/import-account-matcher.h
Log:
Make gchar argument const because it is only used as a const.



Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-02-24 05:53:35 UTC (rev 13378)
+++ gnucash/trunk/ChangeLog	2006-02-24 21:43:37 UTC (rev 13379)
@@ -1,3 +1,8 @@
+2006-02-24  Christian Stimming  <stimming at tuhh.de>
+
+	* src/import-export/import-account-matcher.h: Make gchar argument
+	const because it is only used as a const.
+
 2006-02-23  David Hampton  <hampton at employees.org>
 
 	* src/report/report-system/html-utilities.scm: Andrew

Modified: gnucash/trunk/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.c	2006-02-24 05:53:35 UTC (rev 13378)
+++ gnucash/trunk/src/import-export/import-account-matcher.c	2006-02-24 21:43:37 UTC (rev 13379)
@@ -52,7 +52,7 @@
   GncTreeViewAccount *account_tree;
   GtkWidget       * account_tree_sw;
   const gchar * account_human_description;
-  gchar * account_online_id_value;
+  const gchar * account_online_id_value;
   gnc_commodity * new_account_default_commodity;
   GNCAccountType new_account_default_type;
 };
@@ -121,9 +121,9 @@
     }
 }
 
-Account * gnc_import_select_account(char * account_online_id_value,
+Account * gnc_import_select_account(const gchar * account_online_id_value,
 				    gboolean auto_create,
-				    const char * account_human_description,
+				    const gchar * account_human_description,
 				    gnc_commodity * new_account_default_commodity,
 				    GNCAccountType new_account_default_type,
 				    Account * default_selection,
@@ -152,7 +152,9 @@
     {
       retval = xaccGroupForEachAccount(gnc_get_current_group (),
 				       test_acct_online_id_match,
-				       account_online_id_value,
+				       /* This argument will only be
+					  used as a "const char*" */
+				       (void*)account_online_id_value,
 				       TRUE);
     }
   if(retval==NULL && auto_create != 0)

Modified: gnucash/trunk/src/import-export/import-account-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.h	2006-02-24 05:53:35 UTC (rev 13378)
+++ gnucash/trunk/src/import-export/import-account-matcher.h	2006-02-24 21:43:37 UTC (rev 13379)
@@ -38,8 +38,7 @@
 
     @param account_online_id_value The string containing your unique
     account_id coming from some string of your module.  This is the
-    normal mode of operation. (FIXME: is this string still owned by
-    the caller or does this function take ownership?)
+    normal mode of operation. Can be NULL.
 
     If account_online_id_value==NULL, you basically end up with an account
     selector that allows you to select an account whose GUID will be 
@@ -68,9 +67,13 @@
     function will also warn the user if the found or created account's
     commodity doesn't match.
 
-    @param auto_create If 0, if the account_online_id_value in unknown,
-    the function returns NULL, otherwise, the user will be asked to 
-    create a new account.
+    @param auto_create 
+         Only active if no account with the
+    account_online_id_value could be found in gnucash, or if online-id
+    was NULL. In that case, if auto_create is TRUE (nonzero), the user
+    will be asked to create a new account. If auto_create is FALSE
+    (zero), this function will simply return NULL but will neither
+    select nor create any account.
 
     @param default_selection If not NULL, that account will be 
     pre-selected by default.
@@ -83,9 +86,9 @@
   @return A pointer to the found or created Account, or NULL if no
   account was found or created.
 */
-Account * gnc_import_select_account(char * account_online_id_value,
+Account * gnc_import_select_account(const gchar * account_online_id_value,
 				    gboolean auto_create,
-				    const char * account_human_description,
+				    const gchar * account_human_description,
 				    gnc_commodity * new_account_default_commodity,
 				    GNCAccountType new_account_default_type,
 				    Account * default_selection,



More information about the gnucash-changes mailing list