aboutsummaryrefslogtreecommitdiffstats
path: root/smime/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-11-10 11:40:00 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-11-11 04:54:43 +0800
commit2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch)
treec34f0cbb7c500ff70f10fce846631b0a948b341c /smime/gui
parent583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff)
downloadgsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz
gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst
gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'smime/gui')
-rw-r--r--smime/gui/cert-trust-dialog.c44
-rw-r--r--smime/gui/certificate-manager.c98
-rw-r--r--smime/gui/certificate-viewer.c93
-rw-r--r--smime/gui/e-cert-selector.c3
4 files changed, 139 insertions, 99 deletions
diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c
index 3a52b82657..366a79748e 100644
--- a/smime/gui/cert-trust-dialog.c
+++ b/smime/gui/cert-trust-dialog.c
@@ -72,9 +72,10 @@ ctd_response (GtkWidget *w,
icert = e_cert_get_internal_cert (data->cert);
e_cert_trust_init (&trust);
e_cert_trust_set_valid_peer (&trust);
- e_cert_trust_add_peer_trust (&trust, FALSE,
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->trust_button)),
- FALSE);
+ e_cert_trust_add_peer_trust (
+ &trust, FALSE,
+ gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->trust_button)),
+ FALSE);
e_cert_db_change_cert_trust (icert, &trust);
break;
case GTK_RESPONSE_ACCEPT: {
@@ -85,23 +86,26 @@ ctd_response (GtkWidget *w,
g_signal_stop_emission_by_name (w, "response");
- ca_trust_dialog_set_trust (dialog,
- e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE),
- e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE),
- e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE));
+ ca_trust_dialog_set_trust (
+ dialog,
+ e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE),
+ e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE),
+ e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE));
if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
gboolean trust_ssl, trust_email, trust_objsign;
- ca_trust_dialog_get_trust (dialog,
- &trust_ssl, &trust_email, &trust_objsign);
+ ca_trust_dialog_get_trust (
+ dialog,
+ &trust_ssl, &trust_email, &trust_objsign);
e_cert_trust_init (&trust);
e_cert_trust_set_valid_ca (&trust);
- e_cert_trust_add_ca_trust (&trust,
- trust_ssl,
- trust_email,
- trust_objsign);
+ e_cert_trust_add_ca_trust (
+ &trust,
+ trust_ssl,
+ trust_email,
+ trust_objsign);
e_cert_db_change_cert_trust (icert, &trust);
}
@@ -144,13 +148,15 @@ cert_trust_dialog_show (ECert *cert)
icert = e_cert_get_internal_cert (ctd_data->cacert);
if (e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE))
- gtk_label_set_text ((GtkLabel *) ctd_data->label,
- _("Because you trust the certificate authority that issued this certificate, "
- "then you trust the authenticity of this certificate unless otherwise indicated here"));
+ gtk_label_set_text (
+ (GtkLabel *) ctd_data->label,
+ _("Because you trust the certificate authority that issued this certificate, "
+ "then you trust the authenticity of this certificate unless otherwise indicated here"));
else
- gtk_label_set_text ((GtkLabel *) ctd_data->label,
- _("Because you do not trust the certificate authority that issued this certificate, "
- "then you do not trust the authenticity of this certificate unless otherwise indicated here"));
+ gtk_label_set_text (
+ (GtkLabel *) ctd_data->label,
+ _("Because you do not trust the certificate authority that issued this certificate, "
+ "then you do not trust the authenticity of this certificate unless otherwise indicated here"));
return ctd_data->dialog;
}
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index 3f8648feee..acddc8a974 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -297,7 +297,8 @@ load_treeview_state (GtkTreeView *treeview)
}
sortable = GTK_TREE_SORTABLE (gtk_tree_view_get_model (treeview));
- gtk_tree_sortable_set_sort_column_id (sortable,
+ gtk_tree_sortable_set_sort_column_id (
+ sortable,
g_key_file_get_integer (keyfile, tree_name, "sort-column", 0),
g_key_file_get_integer (keyfile, tree_name, "sort-order", GTK_SORT_ASCENDING));
@@ -313,8 +314,10 @@ report_and_free_error (CertPage *cp,
{
g_return_if_fail (cp != NULL);
- e_notice (gtk_widget_get_toplevel (GTK_WIDGET (cp->treeview)),
- GTK_MESSAGE_ERROR, "%s: %s", where, error ? error->message : _("Unknown error"));
+ e_notice (
+ gtk_widget_get_toplevel (GTK_WIDGET (cp->treeview)),
+ GTK_MESSAGE_ERROR, "%s: %s", where,
+ error ? error->message : _("Unknown error"));
if (error)
g_error_free (error);
@@ -342,7 +345,8 @@ header_popup_item_toggled (GtkCheckMenuItem *item,
{
GtkTreeViewColumn *column = user_data;
- gtk_tree_view_column_set_visible (column,
+ gtk_tree_view_column_set_visible (
+ column,
gtk_check_menu_item_get_active (item));
}
@@ -353,7 +357,8 @@ treeview_column_visibility_changed (GtkTreeViewColumn *column,
{
GtkCheckMenuItem *menu_item = user_data;
- gtk_check_menu_item_set_active (menu_item,
+ gtk_check_menu_item_set_active (
+ menu_item,
gtk_tree_view_column_get_visible (column));
}
@@ -369,9 +374,10 @@ treeview_selection_changed (GtkTreeSelection *selection,
if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
ECert *cert;
- gtk_tree_model_get (model, &iter,
- cp->columns_count - 1, &cert,
- -1);
+ gtk_tree_model_get (
+ model, &iter,
+ cp->columns_count - 1, &cert,
+ -1);
if (cert) {
cert_selected = TRUE;
@@ -508,9 +514,10 @@ view_cert (GtkWidget *button,
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (cp->treeview), NULL, &iter)) {
ECert *cert;
- gtk_tree_model_get (GTK_TREE_MODEL (cp->streemodel), &iter,
- cp->columns_count - 1, &cert,
- -1);
+ gtk_tree_model_get (
+ GTK_TREE_MODEL (cp->streemodel), &iter,
+ cp->columns_count - 1, &cert,
+ -1);
if (cert) {
GtkWidget *dialog = certificate_viewer_show (cert);
@@ -532,9 +539,10 @@ edit_cert (GtkWidget *button,
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (cp->treeview), NULL, &iter)) {
ECert *cert;
- gtk_tree_model_get (GTK_TREE_MODEL (cp->streemodel), &iter,
- cp->columns_count - 1, &cert,
- -1);
+ gtk_tree_model_get (
+ GTK_TREE_MODEL (cp->streemodel), &iter,
+ cp->columns_count - 1, &cert,
+ -1);
if (cert) {
GtkWidget *dialog;
@@ -543,10 +551,11 @@ edit_cert (GtkWidget *button,
switch (cp->cert_type) {
case E_CERT_CA:
dialog = ca_trust_dialog_show (cert, FALSE);
- ca_trust_dialog_set_trust (dialog,
- e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE),
- e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE),
- e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE));
+ ca_trust_dialog_set_trust (
+ dialog,
+ e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE),
+ e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE),
+ e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE));
break;
case E_CERT_CONTACT:
dialog = cert_trust_dialog_show (cert);
@@ -561,13 +570,15 @@ edit_cert (GtkWidget *button,
gboolean trust_ssl, trust_email, trust_objsign;
CERTCertTrust trust;
- ca_trust_dialog_get_trust (dialog,
- &trust_ssl, &trust_email, &trust_objsign);
+ ca_trust_dialog_get_trust (
+ dialog,
+ &trust_ssl, &trust_email, &trust_objsign);
e_cert_trust_init (&trust);
e_cert_trust_set_valid_ca (&trust);
- e_cert_trust_add_ca_trust (&trust,
- trust_ssl, trust_email, trust_objsign);
+ e_cert_trust_add_ca_trust (
+ &trust,
+ trust_ssl, trust_email, trust_objsign);
e_cert_db_change_cert_trust (icert, &trust);
}
@@ -586,9 +597,11 @@ import_cert (GtkWidget *button,
GtkFileFilter *filter;
gint i;
- filesel = gtk_file_chooser_dialog_new (_("Select a certificate to import..."),
- NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
+ filesel = gtk_file_chooser_dialog_new (
+ _("Select a certificate to import..."), NULL,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
gtk_dialog_set_default_response (GTK_DIALOG (filesel), GTK_RESPONSE_OK);
filter = gtk_file_filter_new ();
@@ -618,8 +631,9 @@ import_cert (GtkWidget *button,
break;
case E_CERT_CONTACT:
case E_CERT_CA:
- import = e_cert_db_import_certs_from_file (e_cert_db_peek (), filename,
- cp->cert_type, &imported_certs, &error);
+ import = e_cert_db_import_certs_from_file (
+ e_cert_db_peek (), filename,
+ cp->cert_type, &imported_certs, &error);
break;
default:
g_free (filename);
@@ -653,9 +667,10 @@ delete_cert (GtkWidget *button,
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (cp->treeview), NULL, &iter)) {
ECert *cert;
- gtk_tree_model_get (GTK_TREE_MODEL (cp->streemodel), &iter,
- cp->columns_count - 1, &cert,
- -1);
+ gtk_tree_model_get (
+ GTK_TREE_MODEL (cp->streemodel), &iter,
+ cp->columns_count - 1, &cert,
+ -1);
if (cert && e_cert_db_delete_cert (e_cert_db_peek (), cert)) {
GtkTreeIter child_iter, parent_iter;
@@ -699,8 +714,9 @@ add_cert (CertPage *cp,
/* create a new toplevel node */
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
- 0, organization, -1);
+ gtk_tree_store_set (
+ GTK_TREE_STORE (model), &iter,
+ 0, organization, -1);
/* now copy it off into parent_iter and insert it into
* the hashtable */
@@ -722,11 +738,13 @@ add_cert (CertPage *cp,
}
if (cp->columns[i].type == G_TYPE_STRING) {
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
- i, get_cert_data_func (cert), -1);
+ gtk_tree_store_set (
+ GTK_TREE_STORE (model), &iter,
+ i, get_cert_data_func (cert), -1);
} else if (cp->columns[i].type == G_TYPE_OBJECT) {
- gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
- i, cert, -1);
+ gtk_tree_store_set (
+ GTK_TREE_STORE (model), &iter,
+ i, cert, -1);
}
}
}
@@ -757,9 +775,11 @@ unload_certs (CertPage *cp)
if (cp->root_hash)
g_hash_table_destroy (cp->root_hash);
- cp->root_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify) g_free,
- (GDestroyNotify) gtk_tree_iter_free);
+ cp->root_hash = g_hash_table_new_full (
+ (GHashFunc) g_str_hash,
+ (GEqualFunc) g_str_equal,
+ (GDestroyNotify) g_free,
+ (GDestroyNotify) gtk_tree_iter_free);
}
static void
diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c
index 9273ae90e6..af1b3226ce 100644
--- a/smime/gui/certificate-viewer.c
+++ b/smime/gui/certificate-viewer.c
@@ -159,10 +159,11 @@ populate_fields_tree (CertificateViewerData *cvm_data,
/* first insert a node for the current asn1 */
gtk_tree_store_insert (cvm_data->fields_store, &new_iter, root, -1);
- gtk_tree_store_set (cvm_data->fields_store, &new_iter,
- 0, e_asn1_object_get_display_name (asn1),
- 1, asn1,
- -1);
+ gtk_tree_store_set (
+ cvm_data->fields_store, &new_iter,
+ 0, e_asn1_object_get_display_name (asn1),
+ 1, asn1,
+ -1);
if (e_asn1_object_is_valid_container (asn1)) {
GList *children = e_asn1_object_get_children (asn1);
@@ -191,10 +192,11 @@ hierarchy_selection_changed (GtkTreeSelection *selection,
EASN1Object *asn1_object;
ECert *cert;
- gtk_tree_model_get (model,
- &iter,
- 1, &cert,
- -1);
+ gtk_tree_model_get (
+ model,
+ &iter,
+ 1, &cert,
+ -1);
if (!cert)
return;
@@ -204,8 +206,9 @@ hierarchy_selection_changed (GtkTreeSelection *selection,
/* wipe out the old model */
cvm_data->fields_store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
- gtk_tree_view_set_model (GTK_TREE_VIEW (cvm_data->fields_tree),
- GTK_TREE_MODEL (cvm_data->fields_store));
+ gtk_tree_view_set_model (
+ GTK_TREE_VIEW (cvm_data->fields_tree),
+ GTK_TREE_MODEL (cvm_data->fields_store));
/* populate the fields from the newly selected cert */
populate_fields_tree (cvm_data, asn1_object, NULL);
@@ -213,8 +216,9 @@ hierarchy_selection_changed (GtkTreeSelection *selection,
g_object_unref (asn1_object);
/* and blow away the field value */
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
- "", 0);
+ gtk_text_buffer_set_text (
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
+ "", 0);
}
}
@@ -231,26 +235,30 @@ fields_selection_changed (GtkTreeSelection *selection,
EASN1Object *asn1_object;
const gchar *value;
- gtk_tree_model_get (model,
- &iter,
- 1, &asn1_object,
- -1);
+ gtk_tree_model_get (
+ model,
+ &iter,
+ 1, &asn1_object,
+ -1);
value = e_asn1_object_get_display_value (asn1_object);
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
- "", 0);
+ gtk_text_buffer_set_text (
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
+ "", 0);
if (value) {
GtkTextIter text_iter;
- gtk_text_buffer_get_start_iter (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
- &text_iter);
+ gtk_text_buffer_get_start_iter (
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
+ &text_iter);
- gtk_text_buffer_insert_with_tags (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
- &text_iter,
- value, strlen (value),
- cvm_data->text_tag, NULL);
+ gtk_text_buffer_insert_with_tags (
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
+ &text_iter,
+ value, strlen (value),
+ cvm_data->text_tag, NULL);
}
}
}
@@ -266,12 +274,14 @@ fill_in_details (CertificateViewerData *cvm_data,
/* hook up all the hierarchy tree foo */
cvm_data->hierarchy_store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_OBJECT);
cvm_data->hierarchy_tree = e_builder_get_widget (cvm_data->builder, "cert-hierarchy-treeview");
- gtk_tree_view_set_model (GTK_TREE_VIEW (cvm_data->hierarchy_tree),
- GTK_TREE_MODEL (cvm_data->hierarchy_store));
+ gtk_tree_view_set_model (
+ GTK_TREE_VIEW (cvm_data->hierarchy_tree),
+ GTK_TREE_MODEL (cvm_data->hierarchy_store));
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cvm_data->hierarchy_tree),
- -1, "Cert", gtk_cell_renderer_text_new (),
- "text", 0, NULL);
+ gtk_tree_view_insert_column_with_attributes (
+ GTK_TREE_VIEW (cvm_data->hierarchy_tree),
+ -1, "Cert", gtk_cell_renderer_text_new (),
+ "text", 0, NULL);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->hierarchy_tree));
g_signal_connect (
@@ -281,9 +291,10 @@ fill_in_details (CertificateViewerData *cvm_data,
/* hook up all the fields tree foo */
cvm_data->fields_tree = e_builder_get_widget (cvm_data->builder, "cert-fields-treeview");
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (cvm_data->fields_tree),
- -1, "Field", gtk_cell_renderer_text_new (),
- "text", 0, NULL);
+ gtk_tree_view_insert_column_with_attributes (
+ GTK_TREE_VIEW (cvm_data->fields_tree),
+ -1, "Field", gtk_cell_renderer_text_new (),
+ "text", 0, NULL);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cvm_data->fields_tree));
g_signal_connect (
@@ -295,10 +306,11 @@ fill_in_details (CertificateViewerData *cvm_data,
/* set the font of the field value viewer to be some fixed
* width font to the hex display doesn't look like ass. */
- cvm_data->text_tag = gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
- "mono",
- "font", "Mono",
- NULL);
+ cvm_data->text_tag = gtk_text_buffer_create_tag (
+ gtk_text_view_get_buffer (GTK_TEXT_VIEW (cvm_data->field_text)),
+ "mono",
+ "font", "Mono",
+ NULL);
/* initially populate the hierarchy from the cert's chain */
cvm_data->cert_chain = e_cert_get_chain (cert);
@@ -313,10 +325,11 @@ fill_in_details (CertificateViewerData *cvm_data,
str = e_cert_get_subject_name (c);
gtk_tree_store_insert (cvm_data->hierarchy_store, &new_iter, root, -1);
- gtk_tree_store_set (cvm_data->hierarchy_store, &new_iter,
- 0, str,
- 1, c,
- -1);
+ gtk_tree_store_set (
+ cvm_data->hierarchy_store, &new_iter,
+ 0, str,
+ 1, c,
+ -1);
root = &new_iter;
}
diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c
index 71f3545770..2928b550ab 100644
--- a/smime/gui/e-cert-selector.c
+++ b/smime/gui/e-cert-selector.c
@@ -195,7 +195,8 @@ e_cert_selector_new (gint type,
while (!CERT_LIST_END (node, certlist)) {
if (node->cert->nickname || node->cert->emailAddr) {
gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
+ gtk_list_store_set (
+ store, &iter,
0, node->cert->nickname ? node->cert->nickname : node->cert->emailAddr,
-1);