Use the full filename and add the extension of the export format.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5579 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2011-03-06 17:13:45 +00:00
parent 65fcc2b0c0
commit 76b49acf4c
2 changed files with 2 additions and 3 deletions

View File

@ -11,6 +11,7 @@
* plugins/export.c:
Add option to insert line numbers (closes #3197150).
Cleanup.
Use the full filename and add the extension of the export format.
2011-03-05 Colomban Wendling <colomban(at)geany(dot)org>

View File

@ -216,7 +216,6 @@ static void create_file_save_as_dialog(const gchar *extension, ExportFunc func,
if (doc->file_name != NULL)
{
gchar *base_name = g_path_get_basename(doc->file_name);
gchar *short_name = utils_remove_ext_from_filename(base_name);
gchar *file_name;
gchar *locale_filename;
gchar *locale_dirname;
@ -225,7 +224,7 @@ static void create_file_save_as_dialog(const gchar *extension, ExportFunc func,
if (g_str_has_suffix(doc->file_name, extension))
suffix = "_export";
file_name = g_strconcat(short_name, suffix, extension, NULL);
file_name = g_strconcat(base_name, suffix, extension, NULL);
locale_filename = utils_get_locale_from_utf8(doc->file_name);
locale_dirname = g_path_get_dirname(locale_filename);
/* set the current name to base_name.html which probably doesn't exist yet so
@ -235,7 +234,6 @@ static void create_file_save_as_dialog(const gchar *extension, ExportFunc func,
gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), file_name);
g_free(locale_dirname);
g_free(locale_filename);
g_free(short_name);
g_free(file_name);
g_free(base_name);
}