From 07be31a6a93e8401c2f093f55483eea4b510b955 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 15 Jan 2008 17:55:59 +0200 Subject: [PATCH] Set default filename properly. Use correct return code. --- src/file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/file.c b/src/file.c index 5eaa4f9..6a46073 100644 --- a/src/file.c +++ b/src/file.c @@ -109,10 +109,12 @@ if (dir && *dir) { gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(dialog), g_get_home_dir()); } -if (file && *file) +if (file && *file) { gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(dialog), *file); -else - gtk_file_chooser_set_uri(GTK_FILE_CHOOSER(dialog), "track.gpx"); + if (strlen(*file)==0) + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), "track.gpx"); +} else + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(dialog), "track.gpx"); if (gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK) { gchar *file_uri_str; @@ -149,7 +151,7 @@ GnomeVFSResult vfs_result; if (!file_open(dir, &file_uri_str)) { buffer=NULL; - return TRUE; + return FALSE; } vfs_result=gnome_vfs_read_entire_file(file_uri_str, bytes, buffer); -- 2.39.5