]> err.no Git - mapper/commitdiff
Set default filename properly. Use correct return code.
authorKaj-Michael Lang <milang@onion.tal.org>
Tue, 15 Jan 2008 15:55:59 +0000 (17:55 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Tue, 15 Jan 2008 15:55:59 +0000 (17:55 +0200)
src/file.c

index 5eaa4f99d92ed1ebab3660d4e8cd3980e84e2a76..6a46073c5d6e95c818981588e38fecf271461cdb 100644 (file)
@@ -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);