diff options
Diffstat (limited to 'smime')
-rw-r--r-- | smime/gui/Makefile.am | 3 | ||||
-rw-r--r-- | smime/gui/certificate-manager.c | 27 | ||||
-rw-r--r-- | smime/gui/component.c | 16 | ||||
-rw-r--r-- | smime/lib/Makefile.am | 2 | ||||
-rw-r--r-- | smime/lib/e-asn1-object.c | 1 | ||||
-rw-r--r-- | smime/lib/e-cert-db.c | 2 | ||||
-rw-r--r-- | smime/lib/e-cert.c | 4 | ||||
-rw-r--r-- | smime/lib/e-pkcs12.c | 9 | ||||
-rw-r--r-- | smime/tests/Makefile.am | 3 |
9 files changed, 29 insertions, 38 deletions
diff --git a/smime/gui/Makefile.am b/smime/gui/Makefile.am index 2a28121fc1..c8fe999fc7 100644 --- a/smime/gui/Makefile.am +++ b/smime/gui/Makefile.am @@ -17,8 +17,8 @@ libevolution_smime_la_CPPFLAGS = \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ -DPREFIX=\""$(prefix)"\" \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ $(CERT_UI_CFLAGS) libevolution_smime_la_SOURCES = \ @@ -41,6 +41,7 @@ libevolution_smime_la_LIBADD = \ $(top_builddir)/shell/libeshell.la \ $(top_builddir)/smime/lib/libessmime.la \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ + $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ $(CERT_UI_LIBS) diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 5e23e1d865..274fc32aae 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -127,7 +127,6 @@ static const gchar* authoritycerts_mime_types[] = { "application/x-x509-ca-cert typedef struct { GtkTreeView *treeview; - GtkTreeStore *treemodel; GtkTreeModel *streemodel; GHashTable *root_hash; GtkMenu *popup_menu; @@ -474,6 +473,7 @@ select_certificate (CertPage *cp, fcd.cp = cp; fcd.cert = cert; + fcd.path = NULL; gtk_tree_model_foreach (model, find_cert_cb, &fcd); @@ -483,7 +483,7 @@ select_certificate (CertPage *cp, selection = gtk_tree_view_get_selection (cp->treeview); gtk_tree_selection_select_path (selection, fcd.path); - gtk_tree_view_scroll_to_cell (cp->treeview, fcd.path, NULL, FALSE, 0.0, 0.0); + gtk_tree_view_scroll_to_cell (cp->treeview, fcd.path, NULL, TRUE, 0.5, 0.5); gtk_tree_path_free (fcd.path); } } @@ -644,10 +644,17 @@ delete_cert (GtkWidget *button, -1); if (cert && e_cert_db_delete_cert (e_cert_db_peek (), cert)) { - GtkTreeIter child_iter; + GtkTreeIter child_iter, parent_iter; + gboolean has_parent; + GtkTreeStore *store = GTK_TREE_STORE (gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (cp->streemodel))); gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (cp->streemodel), &child_iter, &iter); - gtk_tree_store_remove (cp->treemodel, &child_iter); + has_parent = gtk_tree_model_iter_parent (GTK_TREE_MODEL (store), &parent_iter, &child_iter); + gtk_tree_store_remove (store, &child_iter); + + /* Remove parent if it became empty */ + if (has_parent && gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), &parent_iter) == 0) + gtk_tree_store_remove (store, &parent_iter); /* we need two unrefs here, one to unref the * gtk_tree_model_get above, and one to unref @@ -861,14 +868,9 @@ cert_page_free (CertPage *cp) if (!cp) return; - /* Free all certificates in treeviews */ - if (cp->treemodel) { - gtk_tree_model_foreach (GTK_TREE_MODEL (cp->treemodel), - (GtkTreeModelForeachFunc) free_cert, cp); - } - - /* Free streemodel */ if (cp->streemodel) { + gtk_tree_model_foreach (GTK_TREE_MODEL (cp->streemodel), + (GtkTreeModelForeachFunc) free_cert, cp); g_object_unref (cp->streemodel); cp->streemodel = NULL; } @@ -978,7 +980,6 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) priv->yourcerts_page = cp; cp->treeview = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "yourcerts-treeview")); cp->streemodel = NULL; - cp->treemodel = NULL; cp->view_button = e_builder_get_widget (priv->builder, "your-view-button"); cp->backup_button = e_builder_get_widget (priv->builder, "your-backup-button"); cp->backup_all_button = e_builder_get_widget (priv->builder, "your-backup-all-button"); @@ -996,7 +997,6 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) priv->contactcerts_page = cp; cp->treeview = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "contactcerts-treeview")); cp->streemodel = NULL; - cp->treemodel = NULL; cp->view_button = e_builder_get_widget (priv->builder, "contact-view-button"); cp->backup_button = NULL; cp->backup_all_button = NULL; @@ -1014,7 +1014,6 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) priv->authoritycerts_page = cp; cp->treeview = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "authoritycerts-treeview")); cp->streemodel = NULL; - cp->treemodel = NULL; cp->view_button = e_builder_get_widget (priv->builder, "authority-view-button"); cp->backup_button = NULL; cp->backup_all_button = NULL; diff --git a/smime/gui/component.c b/smime/gui/component.c index 091ebeefe8..fcbb9faf9f 100644 --- a/smime/gui/component.c +++ b/smime/gui/component.c @@ -50,10 +50,10 @@ smime_pk11_passwd (ECertDB *db, prompt = g_strdup_printf (_("Enter the password for '%s'"), slot_name); g_free (slot_name); - *passwd = e_passwords_ask_password (_("Enter password"), NULL, "", - prompt, - E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, - NULL); + *passwd = e_passwords_ask_password ( + _("Enter password"), NULL, "", prompt, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, + NULL, NULL); g_free (prompt); @@ -75,10 +75,10 @@ smime_pk11_change_passwd (ECertDB *db, /* we're setting the password initially */ prompt = _("Enter new password for certificate database"); - *passwd = e_passwords_ask_password (_("Enter new password"), NULL, "", - prompt, - E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, - NULL); + *passwd = e_passwords_ask_password ( + _("Enter new password"), NULL, "", prompt, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, + NULL, NULL); } else { /* we're changing the password */ diff --git a/smime/lib/Makefile.am b/smime/lib/Makefile.am index d0f4873503..df2fb96208 100644 --- a/smime/lib/Makefile.am +++ b/smime/lib/Makefile.am @@ -14,7 +14,6 @@ libessmime_la_CPPFLAGS = \ -DPREFIX=\""$(prefix)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(CAMEL_CFLAGS) \ $(CERT_UI_CFLAGS) libessmime_la_SOURCES = \ @@ -33,7 +32,6 @@ libessmime_la_LIBADD = \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) \ - $(CAMEL_LIBS) \ $(CERT_UI_LIBS) libessmime_la_LDFLAGS = $(NO_UNDEFINED) diff --git a/smime/lib/e-asn1-object.c b/smime/lib/e-asn1-object.c index 28c3aa7c85..4dd519e2d4 100644 --- a/smime/lib/e-asn1-object.c +++ b/smime/lib/e-asn1-object.c @@ -129,7 +129,6 @@ e_asn1_object_get_type (void) return asn1_object_type; } - /* This function is used to interpret an integer that * was encoded in a DER buffer. This function is used * when converting a DER buffer into a nsIASN1Object diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c index 7fdd20f6e7..6006168e20 100644 --- a/smime/lib/e-cert-db.c +++ b/smime/lib/e-cert-db.c @@ -616,8 +616,6 @@ e_cert_db_get_type (void) return cert_type; } - - GStaticMutex init_mutex = G_STATIC_MUTEX_INIT; static ECertDB *cert_db = NULL; diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c index e7aecc10c8..930dd65474 100644 --- a/smime/lib/e-cert.c +++ b/smime/lib/e-cert.c @@ -194,8 +194,6 @@ e_cert_get_type (void) return cert_type; } - - static void e_cert_populate (ECert *cert) { @@ -286,8 +284,6 @@ e_cert_new_from_der (gchar *data, return e_cert_new (cert); } - - CERTCertificate * e_cert_get_internal_cert (ECert *cert) { diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c index 959924e69d..5f7a73ce65 100644 --- a/smime/lib/e-pkcs12.c +++ b/smime/lib/e-pkcs12.c @@ -143,8 +143,6 @@ e_pkcs12_get_type (void) return pkcs12_type; } - - EPKCS12 * e_pkcs12_new (void) { @@ -205,9 +203,10 @@ prompt_for_password (gchar *title, { gchar *passwd; - passwd = e_passwords_ask_password (title, NULL, "", prompt, - E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, - NULL); + passwd = e_passwords_ask_password ( + title, NULL, "", prompt, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, + NULL, NULL); if (passwd) { gsize len = strlen (passwd); diff --git a/smime/tests/Makefile.am b/smime/tests/Makefile.am index aa726538fd..be4cea34dc 100644 --- a/smime/tests/Makefile.am +++ b/smime/tests/Makefile.am @@ -3,8 +3,8 @@ noinst_PROGRAMS=import-cert TEST_CPPFLAGS= \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/smime/lib \ + $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ - $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ $(CERT_UI_CFLAGS) TEST_LIBS= \ @@ -12,6 +12,7 @@ TEST_LIBS= \ -L/home/toshok/src/mozilla/mozilla/dist/lib \ $(CERT_UI_LIBS) \ $(top_builddir)/e-util/libeutil.la \ + $(EVOLUTION_DATA_SERVER_LIBS) \ $(GNOME_PLATFORM_LIBS) import_cert_LDADD=$(TEST_LIBS) |