-#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>
#include "hildon-mapper.h"
+#include "path.h"
#include "utils.h"
#include "mapper-types.h"
#include "settings.h"
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;
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);