r19429 - gnucash/trunk/src/report/report-gnome - Bug #616613: Automatically append the extension if user forgot append them.

Christian Stimming cstim at code.gnucash.org
Sat Aug 14 16:47:53 EDT 2010


Author: cstim
Date: 2010-08-14 16:47:53 -0400 (Sat, 14 Aug 2010)
New Revision: 19429
Trac: http://svn.gnucash.org/trac/changeset/19429

Modified:
   gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
Log:
Bug #616613: Automatically append the extension if user forgot append them.

Patch by "Bob":

The enclosed patch simply tests for a period in the file name,
if one exists it leaves it alone,
if not, it adds one plus a default extension.

Modified: gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c	2010-08-14 20:14:37 UTC (rev 19428)
+++ gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c	2010-08-14 20:47:53 UTC (rev 19429)
@@ -1406,6 +1406,10 @@
 
     filepath = gnc_file_dialog (title, NULL, default_dir, GNC_FILE_DIALOG_EXPORT);
 
+    /* Try to test for extension on file name, add if missing */
+    if (g_strrstr(filepath,".") == NULL)
+	filepath = g_strconcat(filepath,".",g_ascii_strdown(type,strlen(type)),NULL);
+
     g_free (title);
     g_free (default_dir);
 



More information about the gnucash-changes mailing list