[epiphany] Revert "Make clear all functionality asynchronous."
- From: Priit Laes <plaes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [epiphany] Revert "Make clear all functionality asynchronous."
- Date: Wed, 29 Jul 2009 10:14:27 +0000 (UTC)
commit d614cb33983cac3070dff987729eae9b64ee7584
Author: Priit Laes <plaes plaes org>
Date: Wed Jul 29 13:07:43 2009 +0300
Revert "Make clear all functionality asynchronous."
This reverts commit a75e0d2fc04d9f599edccf572afe78f2e48e2e44.
src/pdm-dialog.c | 75 +++++++++++++++--------------------------------------
1 files changed, 21 insertions(+), 54 deletions(-)
---
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index 575aab9..20612b7 100644
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -216,58 +216,6 @@ clear_all_cookies (SoupCookieJar *jar)
}
static void
-clear_all_passwords_async_cb (GnomeKeyringResult result,
- gpointer data)
-{
- GtkTreeRowReference *rowref = (GtkTreeRowReference *)data;
-
- if (result == GNOME_KEYRING_RESULT_OK) {
- GtkTreeIter iter;
- GtkTreePath *path;
- GtkTreeModel *model;
-
- if (!gtk_tree_row_reference_valid (rowref))
- return;
-
- path = gtk_tree_row_reference_get_path (rowref);
- model = gtk_tree_row_reference_get_model (rowref);
-
- if (path != NULL && gtk_tree_model_get_iter (model, &iter, path)) {
- /* FIXME! Do we have to drop the data too? */
- gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
-
- gtk_tree_path_free (path);
- }
- }
-}
-
-static gboolean
-clear_all_passwords (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- GtkTreeRowReference *row;
- EphyPasswordInfo *info;
- GValue val = { 0, };
-
- row = gtk_tree_row_reference_new (model, path);
-
- gtk_tree_model_get_value (model, iter,
- COL_PASSWORDS_DATA, &val);
- info = g_value_get_boxed (&val);
-
- gnome_keyring_item_delete (GNOME_KEYRING_DEFAULT,
- info->keyring_id,
- (GnomeKeyringOperationDoneCallback) clear_all_passwords_async_cb,
- row,
- (GDestroyNotify) gtk_tree_row_reference_free);
- g_value_unset (&val);
-
- return FALSE;
-}
-
-static void
clear_all_dialog_response_cb (GtkDialog *dialog,
int response,
PdmClearAllDialogButtons *checkbuttons)
@@ -306,8 +254,27 @@ clear_all_dialog_response_cb (GtkDialog *dialog,
{
PdmDialog *pdialog = EPHY_PDM_DIALOG (checkbuttons->dialog);
PdmActionInfo *pinfo = pdialog->priv->passwords;
-
- gtk_tree_model_foreach (pinfo->model, (GtkTreeModelForeachFunc) clear_all_passwords, NULL);
+ GtkTreeModel *model = pinfo->model;
+ GtkTreeIter iter;
+ gboolean valid;
+
+ valid = gtk_tree_model_get_iter_first (model, &iter);
+
+ while (valid) {
+ GValue val = { 0, };
+ gboolean result;
+
+ gtk_tree_model_get_value (model, &iter,
+ COL_PASSWORDS_DATA, &val);
+ result = pdm_dialog_password_remove(pinfo,
+ g_value_get_boxed (&val));
+ g_value_unset (&val);
+
+ if (result)
+ valid = gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+ else
+ valid = gtk_tree_model_iter_next (model, &iter);
+ }
}
if (gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (checkbuttons->checkbutton_cache)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]