--- trunk/src/gconf.c 2009/09/01 11:16:30 89 +++ trunk/src/gconf.c 2009/11/04 14:54:52 158 @@ -78,11 +78,11 @@ { "cachelist_items", STORE_INT, OFFSET(cachelist_items) }, { "compass_damping", STORE_INT, OFFSET(compass_damping) }, { "cachelist_hide_found", STORE_BOOL, OFFSET(cachelist_hide_found) }, + { "cachelist_update", STORE_BOOL, OFFSET(cachelist_update) }, #ifdef USE_MAEMO { "mmpoi_dontlaunch", STORE_BOOL, OFFSET(mmpoi_dontlaunch) }, { "cachelist_dss", STORE_BOOL, OFFSET(cachelist_disable_screensaver) }, { "goto_dss", STORE_BOOL, OFFSET(goto_disable_screensaver) }, - { "cachelist_update", STORE_BOOL, OFFSET(cachelist_update) }, #endif #ifdef ENABLE_OSM_GPS_MAP { "map_lat", STORE_FLOAT, OFFSET(map.pos.lat) }, @@ -132,6 +132,19 @@ void gconf_save_state(appdata_t *appdata) { int entries = 0; + /* free proxy settings */ + if(appdata->proxy) { + proxy_t *proxy = appdata->proxy; + + if(proxy->authentication_password) g_free(proxy->authentication_password); + if(proxy->authentication_user) g_free(proxy->authentication_user); + if(proxy->host) g_free(proxy->host); + if(proxy->ignore_hosts) g_free(proxy->ignore_hosts); + + g_free(proxy); + appdata->proxy = NULL; + } + gpx_t *gpx = appdata->gpx; while(gpx) { char str[128]; @@ -207,6 +220,35 @@ appdata->manual_goto.lat = appdata->manual_goto.lon = NAN; appdata->gps.lat = appdata->gps.lon = NAN; + /* ------------- get proxy settings -------------------- */ + if(gconf_client_get_bool(appdata->gconf_client, + PROXY_KEY "use_http_proxy", NULL)) { + proxy_t *proxy = appdata->proxy = g_new0(proxy_t, 1); + + /* get basic settings */ + proxy->host = gconf_client_get_string(appdata->gconf_client, + PROXY_KEY "host", NULL); + proxy->port = gconf_client_get_int(appdata->gconf_client, + PROXY_KEY "port", NULL); + proxy->ignore_hosts = + gconf_client_get_string(appdata->gconf_client, + PROXY_KEY "ignore_hosts", NULL); + + /* check for authentication */ + proxy->use_authentication = + gconf_client_get_bool(appdata->gconf_client, + PROXY_KEY "use_authentication", NULL); + + if(proxy->use_authentication) { + proxy->authentication_user = + gconf_client_get_string(appdata->gconf_client, + PROXY_KEY "authentication_user", NULL); + proxy->authentication_password = + gconf_client_get_string(appdata->gconf_client, + PROXY_KEY "authentication_password", NULL); + } + } + int i, entries = gconf_client_get_int(appdata->gconf_client, GCONF_KEY_CNT, NULL); @@ -217,7 +259,6 @@ char str[128]; snprintf(str, sizeof(str), GCONF_KEY_GPX, i); char *fname = gconf_client_get_string(appdata->gconf_client, str, NULL); - if(fname) { /* check if there's a valid name stored for this file. */ /* if yes it's a "closed" file */ @@ -237,16 +278,21 @@ /* restoring the gpx file failed, mark it as unusable, but save */ /* its presence for later use */ - /* create fake entry to remember this file for next load attempt */ + /* create "closed" entry to remember this file for next */ + /* load attempt */ *gpx = g_new0(gpx_t, 1); (*gpx)->filename = fname; - (*gpx)->failed = TRUE; + char *p = fname; + if(strrchr(fname, '/')) + p = strrchr(fname, '/')+1; + + (*gpx)->name = g_strdup_printf(_("Failed to load: %s"), p); + (*gpx)->closed = TRUE; } else free(fname); } + gpx = &((*gpx)->next); } - - gpx = &((*gpx)->next); } gpx_busy_dialog_destroy(dialog); @@ -320,6 +366,10 @@ appdata->search = SEARCH_NAME | SEARCH_ID; if(!appdata->image_path) { +#ifdef USE_MAEMO + /* update cachelist by default */ + appdata->cachelist_update = TRUE; +#endif /* use gps by default */ appdata->use_gps = TRUE;