Skip to content

Commit

Permalink
Replace deprecated g_basename() by recommend g_path_get_basename()
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22185 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
Phil Longstaff committed May 20, 2012
1 parent 18d6031 commit aeef9d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/html/gnc-html-webkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ impl_webkit_print( GncHtml* self, const gchar* jobname, gboolean export_pdf )
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
Expand All @@ -1127,7 +1128,8 @@ impl_webkit_print( GncHtml* self, const gchar* jobname, gboolean export_pdf )
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);
Expand All @@ -1147,6 +1149,7 @@ impl_webkit_print( GncHtml* self, const gchar* jobname, gboolean export_pdf )
}
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);
Expand Down

0 comments on commit aeef9d3

Please sign in to comment.