r22185 - gnucash/trunk/src/html - Replace deprecated g_basename() by recommend g_path_get_basename()

Phil Longstaff plongstaff at code.gnucash.org
Sun May 20 17:24:14 EDT 2012


Author: plongstaff
Date: 2012-05-20 17:24:14 -0400 (Sun, 20 May 2012)
New Revision: 22185
Trac: http://svn.gnucash.org/trac/changeset/22185

Modified:
   gnucash/trunk/src/html/gnc-html-webkit.c
Log:
Replace deprecated g_basename() by recommend g_path_get_basename()


Modified: gnucash/trunk/src/html/gnc-html-webkit.c
===================================================================
--- gnucash/trunk/src/html/gnc-html-webkit.c	2012-05-20 21:23:07 UTC (rev 22184)
+++ gnucash/trunk/src/html/gnc-html-webkit.c	2012-05-20 21:24:14 UTC (rev 22185)
@@ -1114,6 +1114,7 @@
         GtkWidget *dialog;
         gint result;
         gchar *export_dirname = NULL;
+        gchar* basename;
 
         // Before we save the PDF file, we always as the user for the export
         // file name. We will store the chosen directory in the gtk print settings
@@ -1127,7 +1128,8 @@
         gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
 
         // Does the jobname look like a valid full file path?
-        if (g_basename(jobname) != jobname)
+        basename = g_path_get_basename(jobname);
+        if (strcmp(basename, jobname) != 0)
         {
             gchar *tmp_basename;
             gchar *tmp_dirname = g_path_get_dirname(jobname);
@@ -1147,6 +1149,7 @@
             }
             g_free(tmp_dirname);
         }
+        g_free(basename);
 
         // Set the output file name from the given jobname
         gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(dialog), export_filename);



More information about the gnucash-changes mailing list