From: Kaj-Michael Lang Date: Tue, 15 Jan 2008 15:55:59 +0000 (+0200) Subject: Set default filename properly. Use correct return code. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07be31a6a93e8401c2f093f55483eea4b510b955;p=mapper Set default filename properly. Use correct return code. --- 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);