}
static void
-track_save(const gchar *config_dir, const gchar *file)
+path_save(Path *path, const gchar *config_dir, const gchar *file)
{
GnomeVFSHandle *handle;
gchar *tfile;
tfile=gnome_vfs_uri_make_full_from_relative(config_dir, file);
if (GNOME_VFS_OK == gnome_vfs_create(&handle, tfile, GNOME_VFS_OPEN_WRITE, FALSE, 0600)) {
- write_gpx(&_track, handle);
+ write_gpx(path, handle);
gnome_vfs_close(handle);
}
g_free(tfile);
return TRUE;
}
-static void
-config_load_saved_route(gchar *config_dir)
-{
-gchar *route_file;
-gchar *bytes;
-gint size;
-
-route_file = gnome_vfs_uri_make_full_from_relative(config_dir, CONFIG_FILE_ROUTE);
-if (GNOME_VFS_OK == gnome_vfs_read_entire_file(route_file, &size, &bytes))
- parse_gpx(&_route, bytes, size, 0); /* 0 to replace route. */
-g_free(route_file);
-}
-
-static void
-config_load_saved_track(gchar *config_dir)
+static void
+path_load(Path *path, const gchar *config_dir, const gchar *file)
{
-gchar *track_file;
+gchar *pfile;
gchar *bytes;
gint size;
-track_file = gnome_vfs_uri_make_full_from_relative(config_dir, CONFIG_FILE_TRACK);
-if (GNOME_VFS_OK == gnome_vfs_read_entire_file(track_file, &size, &bytes))
- parse_gpx(&_track, bytes, size, 0); /* 0 to replace track. */
-g_free(track_file);
+pfile = gnome_vfs_uri_make_full_from_relative(config_dir, file);
+if (GNOME_VFS_OK == gnome_vfs_read_entire_file(pfile, &size, &bytes))
+ parse_gpx(path, bytes, size, 0); /* 0 to replace track. */
+g_free(pfile);
}
-
/**
* Initialize all configuration from GCONF. This should not be called more
* than once during execution.