]> err.no Git - mapper/blobdiff - src/file.c
Fixes to gstreamer element and caps handlings.
[mapper] / src / file.c
index 3c4f57b5566dcd3cb19781bc3abdd905d6dd291d..68bf5b8f9c747501d7c48a208ca9ac37aee57e33 100644 (file)
@@ -1,4 +1,27 @@
-#define _GNU_SOURCE
+/*
+ * This file is part of mapper
+ *
+ * Copyright (C) 2007 Kaj-Michael Lang
+ * Copyright (C) 2006-2007 John Costigan.
+ *
+ * POI and GPS-Info code originally written by Cezary Jackiewicz.
+ *
+ * Default map data provided by http://www.openstreetmap.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <config.h>
 #include <gtk/gtk.h>
@@ -6,6 +29,7 @@
 
 #include "hildon-mapper.h"
 
+#include "path.h"
 #include "utils.h"
 #include "mapper-types.h"
 #include "settings.h"
@@ -83,10 +107,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;
@@ -123,7 +149,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);