tr->view_zoom_steps=1;
tr->icache=image_cache_new(64);
tr->type=REPOTYPE_NONE;
+tr->name=NULL;
+tr->url=NULL;
+tr->cache_dir=NULL;
+tr->dl_zoom_steps=1;
+tr->double_size=0;
+tr->nextable=FALSE;
}
/**
* @str
*
* Create a new Map image tile repository structure by filling in values from given configuration string.
+ * Parses an string with components, delimited by newline characters:
+ * 1. name
+ * 2. url
+ * 3. cache_dir
+ * 4. dl_zoom_steps
+ * 5. view_zoom_steps
*
*/
TileRepo *
gchar *token, *error_check;
TileRepo *tr;
-/* Parse each part of a repo, delimited by newline characters:
- * 1. name
- * 2. url
- * 3. cache_dir
- * 4. dl_zoom_steps
- * 5. view_zoom_steps
- */
-
tr=tile_repo_new();
g_return_val_if_fail(tr, NULL);
+g_debug("REPOSTR: %s", str);
+
/* Parse name. */
token=strsep(&str, "\n\t");
if (token)
/* Parse cache dir. */
token=strsep(&str, "\n\t");
if (token)
- tr->cache_dir=token;
+ tr->cache_dir=g_strdup(token);
/* Parse download zoom steps. */
token=strsep(&str, "\n\t");