From: Pierre-Luc Beaudoin Date: Fri, 12 Jun 2009 03:40:16 +0000 (-0400) Subject: Remove non filename friendly caracters from map ids and use them as directory name X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eb3a42980d7ca6681665aa137fcaa42a0611832;p=libchamplain Remove non filename friendly caracters from map ids and use them as directory name --- diff --git a/champlain/champlain-map-source-factory.c b/champlain/champlain-map-source-factory.c index a1d010d..23ef31d 100644 --- a/champlain/champlain-map-source-factory.c +++ b/champlain/champlain-map-source-factory.c @@ -299,6 +299,9 @@ champlain_map_source_factory_get_list (ChamplainMapSourceFactory *factory) * Returns a ready to use #ChamplainMapSource matching the given name, returns * NULL is none match. * + * The id should not contain any character that can't be in a filename as it + * will be used as the cache directory name for that map source. + * * Since: 0.4 */ ChamplainMapSource * diff --git a/champlain/champlain-map-source-factory.h b/champlain/champlain-map-source-factory.h index 8bd869e..1782c42 100644 --- a/champlain/champlain-map-source-factory.h +++ b/champlain/champlain-map-source-factory.h @@ -69,11 +69,11 @@ champlain_map_source_factory_register (ChamplainMapSourceFactory *factory, ChamplainMapSourceDesc *desc, ChamplainMapSourceConstructor constructor, gpointer user_data); -#define CHAMPLAIN_MAP_SOURCE_OSM_MAPNIK "osm::mapnik" -#define CHAMPLAIN_MAP_SOURCE_OSM_OSMARENDER "osm::osmarender" -#define CHAMPLAIN_MAP_SOURCE_OSM_CYCLE_MAP "osm::cyclemap" +#define CHAMPLAIN_MAP_SOURCE_OSM_MAPNIK "osm-mapnik" +#define CHAMPLAIN_MAP_SOURCE_OSM_OSMARENDER "osm-osmarender" +#define CHAMPLAIN_MAP_SOURCE_OSM_CYCLE_MAP "osm-cyclemap" #define CHAMPLAIN_MAP_SOURCE_OAM "oam" -#define CHAMPLAIN_MAP_SOURCE_MFF_RELIEF "mff::relief" +#define CHAMPLAIN_MAP_SOURCE_MFF_RELIEF "mff-relief" G_END_DECLS diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c index 1860c80..9591cd9 100644 --- a/champlain/champlain-network-map-source.c +++ b/champlain/champlain-network-map-source.c @@ -362,7 +362,7 @@ get_filename (ChamplainNetworkMapSource *source, return g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "%d" G_DIR_SEPARATOR_S "%d" G_DIR_SEPARATOR_S "%d.png", g_get_user_cache_dir (), - CACHE_SUBDIR, champlain_map_source_get_name (CHAMPLAIN_MAP_SOURCE (source)), + CACHE_SUBDIR, champlain_map_source_get_id (CHAMPLAIN_MAP_SOURCE (source)), champlain_tile_get_zoom_level (tile), champlain_tile_get_x (tile), champlain_tile_get_y (tile)); }