/* Get Map Cache Dir. Default is REPO_DEFAULT_CACHE_DIR. */
repo->cache_dir = gconf_client_get_string(gconf_client,
- GCONF_KEY_MAP_DIR_NAME,
- NULL);
+ GCONF_KEY_MAP_DIR_NAME, NULL);
if (!repo->cache_dir)
repo->cache_dir = gnome_vfs_expand_initial_tilde(REPO_DEFAULT_CACHE_DIR);
/* Get Map Download URL Format. Default is "". */
repo->url = gconf_client_get_string(gconf_client,
- GCONF_KEY_MAP_URI_FORMAT,
- NULL);
+ GCONF_KEY_MAP_URI_FORMAT, NULL);
if (!repo->url)
repo->url = g_strdup(REPO_DEFAULT_MAP_URI);
/* Get Map Download Zoom Steps. Default is 2. */
repo->dl_zoom_steps = gconf_client_get_int(gconf_client,
- GCONF_KEY_MAP_ZOOM_STEPS,
- NULL);
+ GCONF_KEY_MAP_ZOOM_STEPS, NULL);
if (!repo->dl_zoom_steps)
repo->dl_zoom_steps = REPO_DEFAULT_DL_ZOOM_STEPS;
printf("%s()\n", __PRETTY_FUNCTION__);
if (!gconf_client) {
- popup_error(_window,
- _("Failed to initialize GConf. Quitting."));
+ popup_error(_window, _("Failed to initialize GConf. Quitting."));
exit(1);
}
if (!_center_ratio)
_center_ratio = 7;
+ /* Invalidate destination */
+ _dest.valid=FALSE;
+
/* Get Lead Ratio - Default is 5. */
_lead_ratio = gconf_client_get_int(gconf_client,
GCONF_KEY_LEAD_AMOUNT, NULL);
if (_gps.lon==0.0) _gps.lon=22.0;
/* Home */
- _home.lat = gconf_client_get_float(gconf_client, GCONF_KEY_HOME_LAT, NULL);
- _home.lon = gconf_client_get_float(gconf_client, GCONF_KEY_HOME_LON, NULL);
- if (_home.lat==0.0) _home.lat=64.0;
- if (_home.lon==0.0) _home.lon=22.0;
+ _home.valid=TRUE;
+ value = gconf_client_get(gconf_client, GCONF_KEY_HOME_LAT, NULL);
+ if (value) {
+ _home.lat = gconf_value_get_float(value);
+ gconf_value_free(value);
+ } else {
+ _home.valid=FALSE;
+ }
+
+ value = gconf_client_get(gconf_client, GCONF_KEY_HOME_LON, NULL);
+ if (value) {
+ _home.lon = gconf_value_get_float(value);
+ gconf_value_free(value);
+ } else {
+ _home.valid=FALSE;
+ }
+
+ /* Turku is default */
+ if (_home.valid==FALSE) {
+ _home.lat=64.0;
+ _home.lon=22.0;
+ _home.valid=TRUE;
+ }
/* Get last center point. */
{