void
config_update_proxy(void)
{
-GConfClient *gconf_client = gconf_client_get_default();
-
if (_http_proxy_host)
g_free(_http_proxy_host);
_http_proxy_host = NULL;
_http_proxy_port = 0;
}
-g_object_unref(gconf_client);
}
static void
gboolean
config_save_repo(void)
{
-GConfClient *gconf_client = gconf_client_get_default();
GList *curr = _repo_list;
GSList *temp_list = NULL;
gint curr_repo_index = 0;
-if (!gconf_client)
- return FALSE;
-
/* Save the repositories. */
for (curr = _repo_list; curr != NULL; curr = curr->next) {
/* Build from each part of a repo, delimited by newline characters:
rd->double_size, rd->nextable);
temp_list = g_slist_append(temp_list, g_strdup(buffer));
if (rd == _curr_repo)
- gconf_client_set_int(gconf_client,
- GCONF_KEY_CURRREPO, curr_repo_index, NULL);
+ gconf_client_set_int(gconf_client, GCONF_KEY_CURRREPO, curr_repo_index, NULL);
curr_repo_index++;
}
-gconf_client_set_list(gconf_client,
- GCONF_KEY_REPOSITORIES,
- GCONF_VALUE_STRING, temp_list, NULL);
+gconf_client_set_list(gconf_client, GCONF_KEY_REPOSITORIES, GCONF_VALUE_STRING, temp_list, NULL);
g_slist_free(temp_list);
{
/* We have no repositories - create a default one. */
RepoData *repo = g_new(RepoData, 1);
-GConfClient *gconf_client = gconf_client_get_default();
-
-if (!gconf_client)
- return;
/* 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);
{
GSList *list, *curr;
GConfValue *value;
-GConfClient *gconf_client = gconf_client_get_default();
-
-if (!gconf_client)
- return FALSE;
guint curr_repo_index = gconf_client_get_int(gconf_client, GCONF_KEY_CURRREPO, NULL);
list = gconf_client_get_list(gconf_client, GCONF_KEY_REPOSITORIES, GCONF_VALUE_STRING, NULL);
gboolean
config_save_home(void)
{
-GConfClient *gconf_client = gconf_client_get_default();
-
if (!gconf_client)
return FALSE;
gboolean
config_save_filter(void)
{
-GConfClient *gconf_client = gconf_client_get_default();
-
-if (!gconf_client)
- return FALSE;
-
/* Filtering */
gconf_client_set_bool(gconf_client, GCONF_KEY_GPS_FILTER, _gps_filter, NULL);
gconf_client_set_float(gconf_client, GCONF_KEY_GPS_FILTER_HDOP, _filter_hdop, NULL);
config_save(void)
{
gchar *config_dir;
-GConfClient *gconf_client = gconf_client_get_default();
gchar buffer[16];
gfloat center_lat, center_lon;
gint i;
-if (!gconf_client)
- return FALSE;
-
/* Initialize config_dir. */
config_dir = gnome_vfs_expand_initial_tilde(CONFIG_DIR_NAME);
g_mkdir_with_parents(config_dir, 0700);
#endif
gconf_client_clear_cache(gconf_client);
-g_object_unref(gconf_client);
g_free(config_dir);
return TRUE;
}
void config_init(void)
{
GConfValue *value;
-GConfClient *gconf_client = gconf_client_get_default();
gchar *config_dir;
gchar *str;
gint i;
+gconf_client=gconf_client_get_default();
if (!gconf_client) {
popup_error(_window, _("Failed to initialize GConf. Quitting."));
exit(1);
}
+gconf_client_add_dir (gconf_client, GCONF_KEY_PREFIX, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
CenterMode _center_mode = CENTER_LEAD;
UnitType _units = UNITS_KM;
guint _degformat = DDPDDDDD;
mapper_db_connect(&_db, _mapper_db);
gconf_client_clear_cache(gconf_client);
-g_object_unref(gconf_client);
g_free(config_dir);
}