diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-08-16 23:25:56 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-09-04 19:34:32 +0800 |
commit | fcbbdfbd18e15b4ee8322a0217cf03a689a5e033 (patch) | |
tree | e16cd2a2279558c6a2bfb6ca39fcbaac4c85ba59 /smime/gui | |
parent | f78417c48861759d7b0c4535ecd3febe4638a7d3 (diff) | |
download | gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.gz gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.bz2 gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.lz gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.xz gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.tar.zst gsoc2013-evolution-fcbbdfbd18e15b4ee8322a0217cf03a689a5e033.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'smime/gui')
-rw-r--r-- | smime/gui/ca-trust-dialog.c | 19 | ||||
-rw-r--r-- | smime/gui/ca-trust-dialog.h | 2 | ||||
-rw-r--r-- | smime/gui/cert-trust-dialog.c | 8 | ||||
-rw-r--r-- | smime/gui/cert-trust-dialog.h | 2 | ||||
-rw-r--r-- | smime/gui/certificate-manager.c | 34 | ||||
-rw-r--r-- | smime/gui/certificate-viewer.c | 23 | ||||
-rw-r--r-- | smime/gui/certificate-viewer.h | 2 | ||||
-rw-r--r-- | smime/gui/component.c | 22 | ||||
-rw-r--r-- | smime/gui/e-cert-selector.c | 37 |
9 files changed, 94 insertions, 55 deletions
diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c index 887af30277..df2a1f825a 100644 --- a/smime/gui/ca-trust-dialog.c +++ b/smime/gui/ca-trust-dialog.c @@ -54,7 +54,9 @@ free_data (gpointer data) } static void -catd_response (GtkWidget *w, guint id, CATrustDialogData *data) +catd_response (GtkWidget *w, + guint id, + CATrustDialogData *data) { switch (id) { case GTK_RESPONSE_ACCEPT: { @@ -68,8 +70,9 @@ catd_response (GtkWidget *w, guint id, CATrustDialogData *data) } } -GtkWidget* -ca_trust_dialog_show (ECert *cert, gboolean importing) +GtkWidget * +ca_trust_dialog_show (ECert *cert, + gboolean importing) { CATrustDialogData *ctd_data; GtkDialog *dialog; @@ -113,7 +116,10 @@ ca_trust_dialog_show (ECert *cert, gboolean importing) } void -ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign) +ca_trust_dialog_set_trust (GtkWidget *widget, + gboolean ssl, + gboolean email, + gboolean objsign) { CATrustDialogData *ctd_data; @@ -127,7 +133,10 @@ ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboo } void -ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign) +ca_trust_dialog_get_trust (GtkWidget *widget, + gboolean *ssl, + gboolean *email, + gboolean *objsign) { CATrustDialogData *ctd_data; diff --git a/smime/gui/ca-trust-dialog.h b/smime/gui/ca-trust-dialog.h index ec7979d818..8b7d945c00 100644 --- a/smime/gui/ca-trust-dialog.h +++ b/smime/gui/ca-trust-dialog.h @@ -27,7 +27,7 @@ #include <gtk/gtk.h> #include "e-cert.h" -GtkWidget* ca_trust_dialog_show (ECert *cert, gboolean importing); +GtkWidget * ca_trust_dialog_show (ECert *cert, gboolean importing); void ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign); void ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign); diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c index 7c76b01b88..d4d6648b32 100644 --- a/smime/gui/cert-trust-dialog.c +++ b/smime/gui/cert-trust-dialog.c @@ -60,7 +60,9 @@ free_data (gpointer data) } static void -ctd_response (GtkWidget *w, guint id, CertTrustDialogData *data) +ctd_response (GtkWidget *w, + guint id, + CertTrustDialogData *data) { CERTCertTrust trust; CERTCertificate *icert; @@ -109,7 +111,7 @@ ctd_response (GtkWidget *w, guint id, CertTrustDialogData *data) } } -GtkWidget* +GtkWidget * cert_trust_dialog_show (ECert *cert) { CertTrustDialogData *ctd_data; @@ -128,7 +130,7 @@ cert_trust_dialog_show (ECert *cert) ctd_data->label = e_builder_get_widget(ctd_data->builder, "trust-label"); - g_signal_connect(ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data); + g_signal_connect (ctd_data->dialog, "response", G_CALLBACK(ctd_response), ctd_data); g_object_set_data_full (G_OBJECT (ctd_data->dialog), "CertTrustDialogData", ctd_data, free_data); diff --git a/smime/gui/cert-trust-dialog.h b/smime/gui/cert-trust-dialog.h index c4852aac66..20a076b7e9 100644 --- a/smime/gui/cert-trust-dialog.h +++ b/smime/gui/cert-trust-dialog.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS -GtkWidget* cert_trust_dialog_show (ECert *cert); +GtkWidget * cert_trust_dialog_show (ECert *cert); G_END_DECLS diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 3795c20923..5e23e1d865 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -64,7 +64,7 @@ enum { typedef struct { GType type; const gchar *column_title; - const gchar * (*get_cert_data_func) (ECert *cert); /* Prototype to e_cert_get_* functions */ + const gchar * (*get_cert_data_func) (ECert *cert); /* Prototype to e_cert_get_ * functions */ gboolean visible; /* Default visibility of column */ } CertTreeColumn; @@ -82,7 +82,7 @@ static CertTreeColumn yourcerts_columns[] = { { G_TYPE_STRING, N_("Expires"), e_cert_get_expires_on, TRUE }, { G_TYPE_STRING, N_("SHA1 Fingerprint"), e_cert_get_sha1_fingerprint, FALSE }, { G_TYPE_STRING, N_("MD5 Fingerprint"), e_cert_get_md5_fingerprint, FALSE }, - { G_TYPE_OBJECT, NULL, NULL, FALSE } /* Hidden column for ECert* object */ + { G_TYPE_OBJECT, NULL, NULL, FALSE } /* Hidden column for ECert * object */ }; static const gchar* yourcerts_mime_types[] = { "application/x-x509-user-cert", "application/x-pkcs12", NULL }; @@ -189,7 +189,7 @@ save_treeview_state (GtkTreeView *treeview) tree_name = gtk_widget_get_name (GTK_WIDGET (treeview)); sortable = GTK_TREE_SORTABLE (model); - columns_count = gtk_tree_model_get_n_columns (model) - 1; /* Ignore the last column - the ECert* holder */ + columns_count = gtk_tree_model_get_n_columns (model) - 1; /* Ignore the last column - the ECert * holder */ list = g_new0 (gint, columns_count); for (i = 0; i < columns_count; i++) { @@ -304,7 +304,9 @@ load_treeview_state (GtkTreeView *treeview) } static void -report_and_free_error (CertPage *cp, const gchar *where, GError *error) +report_and_free_error (CertPage *cp, + const gchar *where, + GError *error) { g_return_if_fail (cp != NULL); @@ -409,7 +411,7 @@ treeview_add_column (CertPage *cp, G_CALLBACK (treeview_header_clicked), cp->popup_menu); /* The first column should not be concealable so there's no point in displaying - it in the popup menu */ + * it in the popup menu */ if (column_index == 0) return; @@ -430,7 +432,10 @@ struct find_cert_data { }; static gboolean -find_cert_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) +find_cert_cb (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data) { struct find_cert_data *fcd = data; ECert *cert = NULL; @@ -645,9 +650,9 @@ delete_cert (GtkWidget *button, gtk_tree_store_remove (cp->treemodel, &child_iter); /* we need two unrefs here, one to unref the - gtk_tree_model_get above, and one to unref - the initial ref when we created the cert - and added it to the tree */ + * gtk_tree_model_get above, and one to unref + * the initial ref when we created the cert + * and added it to the tree */ g_object_unref (cert); g_object_unref (cert); } @@ -656,7 +661,8 @@ delete_cert (GtkWidget *button, } static void -add_cert (CertPage *cp, ECert *cert) +add_cert (CertPage *cp, + ECert *cert) { GtkTreeIter iter; GtkTreeIter *parent_iter = NULL; @@ -674,7 +680,7 @@ add_cert (CertPage *cp, ECert *cert) 0, organization, -1); /* now copy it off into parent_iter and insert it into - the hashtable */ + * the hashtable */ parent_iter = gtk_tree_iter_copy (&iter); g_hash_table_insert (cp->root_hash, g_strdup (organization), parent_iter); } @@ -746,7 +752,7 @@ load_certs (CertPage *cp) for (node = CERT_LIST_HEAD (certList); !CERT_LIST_END (node, certList); node = CERT_LIST_NEXT (node)) { - ECert *cert = e_cert_new (CERT_DupCertificate ((CERTCertificate*) node->cert)); + ECert *cert = e_cert_new (CERT_DupCertificate ((CERTCertificate *) node->cert)); ECertType ct = e_cert_get_cert_type (cert); /* show everything else in a contact tab */ @@ -920,7 +926,7 @@ cert_manager_config_set_property (GObject *object, case PROP_PREFERENCES_WINDOW: ecmc->priv->pref_window = g_value_get_object (value); /* When the preferences window is "closed" (= hidden), save - state of all treeviews. */ + * state of all treeviews. */ g_signal_connect_swapped (ecmc->priv->pref_window, "hide", G_CALLBACK (cert_manager_config_window_hide), ecmc); return; @@ -1029,7 +1035,7 @@ e_cert_manager_config_init (ECertManagerConfig *ecmc) g_idle_add ((GSourceFunc) populate_ui, ecmc); /* Disconnect cert-manager-notebook from it's window and attach it - to this ECertManagerConfig */ + * to this ECertManagerConfig */ widget = e_builder_get_widget (priv->builder, "cert-manager-notebook"); parent = gtk_widget_get_parent (widget); gtk_container_remove (GTK_CONTAINER (parent), widget); diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c index 78a160b707..89f7d1fd8d 100644 --- a/smime/gui/certificate-viewer.c +++ b/smime/gui/certificate-viewer.c @@ -45,7 +45,8 @@ typedef struct { } CertificateViewerData; static void -free_data (gpointer data, GObject *where_the_object_was) +free_data (gpointer data, + GObject *where_the_object_was) { CertificateViewerData *cvm = data; @@ -59,7 +60,8 @@ free_data (gpointer data, GObject *where_the_object_was) #define NOT_PART_OF_CERT_MARKUP "<i><Not part of certificate></i>" static void -fill_in_general (CertificateViewerData *cvm_data, ECert *cert) +fill_in_general (CertificateViewerData *cvm_data, + ECert *cert) { GtkWidget *label; const gchar *text; @@ -149,7 +151,9 @@ fill_in_general (CertificateViewerData *cvm_data, ECert *cert) } static void -populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTreeIter *root) +populate_fields_tree (CertificateViewerData *cvm_data, + EASN1Object *asn1, + GtkTreeIter *root) { GtkTreeIter new_iter; @@ -175,7 +179,8 @@ populate_fields_tree (CertificateViewerData *cvm_data, EASN1Object *asn1, GtkTre } static void -hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data) +hierarchy_selection_changed (GtkTreeSelection *selection, + CertificateViewerData *cvm_data) { GtkTreeIter iter; GtkTreeModel *model; @@ -214,7 +219,8 @@ hierarchy_selection_changed (GtkTreeSelection *selection, CertificateViewerData } static void -fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cvm_data) +fields_selection_changed (GtkTreeSelection *selection, + CertificateViewerData *cvm_data) { GtkTreeIter iter; GtkTreeModel *model; @@ -250,7 +256,8 @@ fields_selection_changed (GtkTreeSelection *selection, CertificateViewerData *cv } static void -fill_in_details (CertificateViewerData *cvm_data, ECert *cert) +fill_in_details (CertificateViewerData *cvm_data, + ECert *cert) { GList *l; GtkTreeIter *root = NULL; @@ -283,7 +290,7 @@ fill_in_details (CertificateViewerData *cvm_data, ECert *cert) cvm_data->field_text = e_builder_get_widget (cvm_data->builder, "cert-field-value-textview"); /* set the font of the field value viewer to be some fixed - width font to the hex display doesn't look like ass. */ + * 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", @@ -313,7 +320,7 @@ fill_in_details (CertificateViewerData *cvm_data, ECert *cert) gtk_tree_view_expand_all (GTK_TREE_VIEW (cvm_data->hierarchy_tree)); } -GtkWidget* +GtkWidget * certificate_viewer_show (ECert *cert) { CertificateViewerData *cvm_data; diff --git a/smime/gui/certificate-viewer.h b/smime/gui/certificate-viewer.h index 6cfa7f63ab..d452b76c2c 100644 --- a/smime/gui/certificate-viewer.h +++ b/smime/gui/certificate-viewer.h @@ -26,6 +26,6 @@ #include <gtk/gtk.h> #include "e-cert.h" -GtkWidget* certificate_viewer_show (ECert *cert); +GtkWidget * certificate_viewer_show (ECert *cert); #endif /* _CERTIFICATE_VIEWER_H_ */ diff --git a/smime/gui/component.c b/smime/gui/component.c index fbd6d75a78..091ebeefe8 100644 --- a/smime/gui/component.c +++ b/smime/gui/component.c @@ -36,7 +36,11 @@ #include "pk11func.h" static gboolean -smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **passwd, gpointer arg) +smime_pk11_passwd (ECertDB *db, + PK11SlotInfo *slot, + gboolean retry, + gchar **passwd, + gpointer arg) { gchar *prompt; gchar *slot_name = g_strdup (PK11_GetSlotName (slot)); @@ -48,7 +52,7 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass *passwd = e_passwords_ask_password (_("Enter password"), NULL, "", prompt, - E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, NULL); g_free (prompt); @@ -58,7 +62,10 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass } static gboolean -smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpointer arg) +smime_pk11_change_passwd (ECertDB *db, + gchar **old_passwd, + gchar **passwd, + gpointer arg) { gchar *prompt; @@ -70,7 +77,7 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin *passwd = e_passwords_ask_password (_("Enter new password"), NULL, "", prompt, - E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL, + E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_SECRET, NULL, NULL); } else { @@ -83,7 +90,12 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin } static gboolean -smime_confirm_ca_cert_import (ECertDB *db, ECert *cert, gboolean *trust_ssl, gboolean *trust_email, gboolean *trust_objsign, gpointer arg) +smime_confirm_ca_cert_import (ECertDB *db, + ECert *cert, + gboolean *trust_ssl, + gboolean *trust_email, + gboolean *trust_objsign, + gpointer arg) { GtkWidget *dialog = ca_trust_dialog_show (cert, TRUE); gint response; diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c index c88f044e9b..24cc9b374a 100644 --- a/smime/gui/e-cert-selector.c +++ b/smime/gui/e-cert-selector.c @@ -53,14 +53,14 @@ static guint ecs_signals[ECS_LAST_SIGNAL]; G_DEFINE_TYPE (ECertSelector, e_cert_selector, GTK_TYPE_DIALOG) /* (this is what mozilla shows) -Issued to: - Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU - Serial Number: 03 - Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29 - Purposes: Sign,Encrypt -Issued by: - Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU -*/ + * Issued to: + * Subject: E=notzed@ximian.com, CN=notzed@ximian.com, O=My Company Ltd, L=Adelaide, ST=SA, C=AU + * Serial Number: 03 + * Valid from 23/10/03 06:35:29 to 22/10/04 06:35:29 + * Purposes: Sign,Encrypt + * Issued by: + * Subject: E=notzed@ximian.com, O=company, L=there, ST=Here, C=AU + */ static CERTCertListNode * ecs_find_current (ECertSelector *ecs) @@ -74,7 +74,7 @@ ecs_find_current (ECertSelector *ecs) n = gtk_combo_box_get_active (GTK_COMBO_BOX (p->combobox)); node = CERT_LIST_HEAD (p->certlist); - while (n>0 && !CERT_LIST_END (node, p->certlist)) { + while (n > 0 && !CERT_LIST_END (node, p->certlist)) { n--; node = CERT_LIST_NEXT (node); } @@ -85,7 +85,8 @@ ecs_find_current (ECertSelector *ecs) } static void -e_cert_selector_response (GtkDialog *dialog, gint button) +e_cert_selector_response (GtkDialog *dialog, + gint button) { CERTCertListNode *node; @@ -98,11 +99,12 @@ e_cert_selector_response (GtkDialog *dialog, gint button) break; } - g_signal_emit (dialog, ecs_signals[ECS_SELECTED], 0, node?node->cert->nickname:NULL); + g_signal_emit (dialog, ecs_signals[ECS_SELECTED], 0, node ? node->cert->nickname : NULL); } static void -ecs_cert_changed (GtkWidget *w, ECertSelector *ecs) +ecs_cert_changed (GtkWidget *w, + ECertSelector *ecs) { struct _ECertSelectorPrivate *p = ecs->priv; CERTCertListNode *node; @@ -140,7 +142,8 @@ ecs_cert_changed (GtkWidget *w, ECertSelector *ecs) * Return value: A dialogue to be shown. **/ GtkWidget * -e_cert_selector_new (gint type, const gchar *currentid) +e_cert_selector_new (gint type, + const gchar *currentid) { ECertSelector *ecs; struct _ECertSelectorPrivate *p; @@ -152,7 +155,7 @@ e_cert_selector_new (gint type, const gchar *currentid) GtkWidget *w; GtkListStore *store; GtkTreeIter iter; - gint n=0, active=0; + gint n = 0, active = 0; ecs = g_object_new (e_cert_selector_get_type (), NULL); p = ecs->priv; @@ -189,7 +192,7 @@ e_cert_selector_new (gint type, const gchar *currentid) if (node->cert->nickname || node->cert->emailAddr) { gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, - 0, node->cert->nickname?node->cert->nickname:node->cert->emailAddr, + 0, node->cert->nickname ? node->cert->nickname : node->cert->emailAddr, -1); if (currentid != NULL @@ -226,7 +229,7 @@ e_cert_selector_init (ECertSelector *ecs) } static void -e_cert_selector_finalise (GObject *o) +e_cert_selector_finalize (GObject *o) { ECertSelector *ecs = (ECertSelector *) o; @@ -241,7 +244,7 @@ e_cert_selector_finalise (GObject *o) static void e_cert_selector_class_init (ECertSelectorClass *klass) { - ((GObjectClass *) klass)->finalize = e_cert_selector_finalise; + ((GObjectClass *) klass)->finalize = e_cert_selector_finalize; ((GtkDialogClass *) klass)->response = e_cert_selector_response; ecs_signals[ECS_SELECTED] = |