From: Kaj-Michael Lang Date: Tue, 12 Aug 2008 16:15:21 +0000 (+0300) Subject: Fixes to repo manager X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=978a3e21f82250209ceaca0831f8b620fcd78bc7;p=mapper Fixes to repo manager --- diff --git a/src/map-repo-manager.c b/src/map-repo-manager.c index f4921f3..20e62bc 100644 --- a/src/map-repo-manager.c +++ b/src/map-repo-manager.c @@ -326,8 +326,7 @@ repoman_reset(GtkWidget * widget, RepoManInfo * rmi) { GtkWidget *confirm; -confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), - _("Replace all repositories with the default repository?")); +confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), _("Replace all repositories with the default repository?")); if (GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm))) { /* First, delete all existing repositories. */ @@ -473,16 +472,14 @@ gtk_widget_show_all(rmi.dialog); while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(rmi.dialog))) { /* Iterate through repos and verify each. */ - gboolean verified = TRUE; + gboolean verified=TRUE; gint i; GList *curr; - gchar *old_curr_repo_name = _curr_repo->name; + gchar *old_curr_repo_name=_curr_repo->name; for (i = 0, curr = rmi.repo_edits; verified && curr; curr = curr->next, i++) { - RepoEditInfo *rei = curr->data; - gchar *expanded = gnome_vfs_expand_initial_tilde(gtk_entry_get_text(GTK_ENTRY(rei->txt_cache_dir))); - verified = tile_repo_make_cache_dir(rei); - g_free(expanded); + RepoEditInfo *rei=curr->data; + /* XXX */ } if (!verified) { gtk_combo_box_set_active(GTK_COMBO_BOX(rmi.cmb_repos), i - 1); @@ -490,23 +487,23 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(rmi.dialog))) { } /* But keep the repo list in memory, in case downloads are using it. */ - _repo_list = NULL; + g_list_foreach(_repo_list, g_object_unref, NULL); + _repo_list=NULL; /* Write new _repo_list. */ - curr_repo_index = gtk_combo_box_get_active(GTK_COMBO_BOX(rmi.cmb_repos)); - _curr_repo = NULL; + curr_repo_index=gtk_combo_box_get_active(GTK_COMBO_BOX(rmi.cmb_repos)); + _curr_repo=NULL; for (i = 0, curr = rmi.repo_edits; curr; curr = curr->next, i++) { RepoEditInfo *rei = curr->data; TileRepo *rd = tile_repo_new(); - rd->name = g_strdup(rei->name); - rd->url = g_strdup(gtk_entry_get_text(GTK_ENTRY(rei->txt_url))); - rd->cache_dir = gnome_vfs_expand_initial_tilde(gtk_entry_get_text(GTK_ENTRY(rei->txt_cache_dir))); - rd->dl_zoom_steps = hildon_controlbar_get_value(HILDON_CONTROLBAR(rei->num_dl_zoom_steps)); - rd->view_zoom_steps = hildon_controlbar_get_value(HILDON_CONTROLBAR(rei->num_view_zoom_steps)); - rd->double_size = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rei->chk_double_size)); - rd->nextable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rei->chk_nextable)); - + rd->name=g_strdup(rei->name); + rd->url=g_strdup(gtk_entry_get_text(GTK_ENTRY(rei->txt_url))); + rd->cache_dir=gnome_vfs_expand_initial_tilde(gtk_entry_get_text(GTK_ENTRY(rei->txt_cache_dir))); + rd->dl_zoom_steps=hildon_controlbar_get_value(HILDON_CONTROLBAR(rei->num_dl_zoom_steps)); + rd->view_zoom_steps=hildon_controlbar_get_value(HILDON_CONTROLBAR(rei->num_view_zoom_steps)); + rd->double_size=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rei->chk_double_size)); + rd->nextable=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(rei->chk_nextable)); tile_repo_set_type(rd); _repo_list = g_list_append(_repo_list, rd);