aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-01-29 23:50:53 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:29 +0800
commit6af0c53b697c6981c1470c177b2c37e081635258 (patch)
tree35acd2868077859124e55626ba95f2599f1fdc5c /addressbook/gui
parent5c0b316904b9463623e7d8976e7ef43662b55765 (diff)
downloadgsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar
gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.gz
gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.bz2
gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.lz
gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.xz
gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.zst
gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c41
-rw-r--r--addressbook/gui/widgets/e-addressbook-reflow-adapter.c18
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c17
3 files changed, 49 insertions, 27 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index c0c424cc23..30f0068035 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -169,12 +169,14 @@ quick_add_merge_contact (QuickAdd *qa)
(GAsyncReadyCallback) merge_cb, qa);
}
-/*
- * Raise a contact editor with all fields editable, and hook up all signals accordingly.
- */
+/* Raise a contact editor with all fields editable,
+ * and hook up all signals accordingly. */
static void
-contact_added_cb (EContactEditor *ce, EBookStatus status, EContact *contact, gpointer closure)
+contact_added_cb (EContactEditor *ce,
+ EBookStatus status,
+ EContact *contact,
+ gpointer closure)
{
QuickAdd *qa = (QuickAdd *) g_object_get_data (G_OBJECT (ce), "quick_add");
@@ -228,11 +230,14 @@ ce_have_contact (EBook *book, const GError *error, EContact *contact, gpointer c
"changed", contact != NULL,
NULL);
- /* We pass this via object data, so that we don't get a dangling pointer referenced if both
- the "contact_added" and "editor_closed" get emitted. (Which, based on a backtrace in bugzilla,
- I think can happen and cause a crash. */
- g_object_set_data_full (G_OBJECT (contact_editor), "quick_add", qa,
- (GDestroyNotify) quick_add_unref);
+ /* We pass this via object data, so that we don't get a
+ * dangling pointer referenced if both the "contact_added"
+ * and "editor_closed" get emitted. (Which, based on a
+ * backtrace in bugzilla, I think can happen and cause a
+ * crash. */
+ g_object_set_data_full (
+ G_OBJECT (contact_editor), "quick_add", qa,
+ (GDestroyNotify) quick_add_unref);
g_signal_connect (contact_editor,
"contact_added",
@@ -294,7 +299,8 @@ clicked_cb (GtkWidget *w, gint button, gpointer closure)
QuickAdd *qa = (QuickAdd *) closure;
/* Get data out of entries. */
- if (!qa->vcard && (button == GTK_RESPONSE_OK || button == QUICK_ADD_RESPONSE_EDIT_FULL)) {
+ if (!qa->vcard && (button == GTK_RESPONSE_OK ||
+ button == QUICK_ADD_RESPONSE_EDIT_FULL)) {
gchar *name = NULL;
gchar *email = NULL;
@@ -498,7 +504,8 @@ e_contact_quick_add (const gchar *in_name, const gchar *email,
/* Remove extra whitespace and the quotes some mailers put around names. */
g_strstrip (name);
len = strlen (name);
- if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) {
+ if ((name[0] == '\'' && name[len-1] == '\'') ||
+ (name[0] == '"' && name[len-1] == '"')) {
name[0] = ' ';
name[len-1] = ' ';
}
@@ -520,7 +527,9 @@ e_contact_quick_add (const gchar *in_name, const gchar *email,
}
void
-e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure)
+e_contact_quick_add_free_form (const gchar *text,
+ EContactQuickAddCallback cb,
+ gpointer closure)
{
gchar *name=NULL, *email=NULL;
const gchar *last_at, *s;
@@ -595,7 +604,9 @@ e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, g
}
void
-e_contact_quick_add_email (const gchar *email, EContactQuickAddCallback cb, gpointer closure)
+e_contact_quick_add_email (const gchar *email,
+ EContactQuickAddCallback cb,
+ gpointer closure)
{
gchar *name = NULL;
gchar *addr = NULL;
@@ -622,7 +633,9 @@ e_contact_quick_add_email (const gchar *email, EContactQuickAddCallback cb, gpoi
}
void
-e_contact_quick_add_vcard (const gchar *vcard, EContactQuickAddCallback cb, gpointer closure)
+e_contact_quick_add_vcard (const gchar *vcard,
+ EContactQuickAddCallback cb,
+ gpointer closure)
{
QuickAdd *qa;
GtkWidget *dialog;
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
index f1a7939cb7..cb1adcfe25 100644
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
@@ -197,11 +197,19 @@ addressbook_create_cmp_cache (EReflowModel *erm)
cmp_cache = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
for (ii = 0; ii < count; ii++) {
- EContact *contact = (EContact*) e_addressbook_model_contact_at (priv->model, ii);
- if (contact) {
- const gchar *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS);
- if (file_as)
- g_hash_table_insert (cmp_cache, GINT_TO_POINTER (ii), g_utf8_collate_key (file_as, -1));
+ EContact *contact;
+
+ contact = (EContact *)
+ e_addressbook_model_contact_at (priv->model, ii);
+ if (contact != NULL) {
+ const gchar *file_as;
+
+ file_as = e_contact_get_const (
+ contact, E_CONTACT_FILE_AS);
+ if (file_as != NULL)
+ g_hash_table_insert (
+ cmp_cache, GINT_TO_POINTER (ii),
+ g_utf8_collate_key (file_as, -1));
}
}
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 5879d9970d..f85bcfe6d3 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1471,14 +1471,15 @@ e_addressbook_view_view (EAddressbookView *view)
/* XXX Use e_alert_new(). */
/* XXX Provide a parent window. */
dialog = gtk_message_dialog_new (
- NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
- ngettext (
- /* Translators: This is shown for more than 5 contacts. */
- "Opening %d contacts will open %d new windows as well.\nDo you really want to display all of these contacts?",
- "Opening %d contacts will open %d new windows as well.\nDo you really want to display all of these contacts?",
- length
- ),
- length, length);
+ NULL, 0,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, ngettext (
+ /* Translators: This is shown for > 5 contacts. */
+ "Opening %d contacts will open %d new windows "
+ "as well.\nDo you really want to display all of "
+ "these contacts?",
+ "Opening %d contacts will open %d new windows "
+ "as well.\nDo you really want to display all of "
+ "these contacts?", length), length, length);
gtk_dialog_add_buttons (
GTK_DIALOG (dialog),
_("_Don't Display"), GTK_RESPONSE_NO,