aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-03 12:46:23 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-01-04 02:15:01 +0800
commite77ee5d5d38ad95bce550db62bf4105f43cf88c6 (patch)
tree3b4c275b086d3f49360c551e686f62140a8ee4d4 /addressbook
parent3cfd5d640908b6441769341c764de70006262c6e (diff)
downloadgsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar
gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.gz
gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.bz2
gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.lz
gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.xz
gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.zst
gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c52
-rw-r--r--addressbook/importers/evolution-csv-importer.c4
-rw-r--r--addressbook/importers/evolution-ldif-importer.c33
-rw-r--r--addressbook/printing/e-contact-print.c6
-rw-r--r--addressbook/util/addressbook.c7
5 files changed, 71 insertions, 31 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 91fdb16e4b..43df184598 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1264,7 +1264,8 @@ e_addressbook_view_delete_selection(EAddressbookView *view, gboolean is_delete)
widget = gtk_bin_get_child (GTK_BIN (view));
if (GAL_IS_VIEW_MINICARD (gal_view)) {
- card_view = e_minicard_view_widget_get_view (E_MINICARD_VIEW_WIDGET(view->priv->object));
+ card_view = e_minicard_view_widget_get_view (
+ E_MINICARD_VIEW_WIDGET (view->priv->object));
selection_model = e_addressbook_view_get_selection_model (view);
row = e_selection_model_cursor_row (selection_model);
}
@@ -1408,25 +1409,29 @@ e_addressbook_view_stop (EAddressbookView *view)
}
static void
-view_transfer_contacts (EAddressbookView *view, gboolean delete_from_source, gboolean all)
+view_transfer_contacts (EAddressbookView *view,
+ gboolean delete_from_source,
+ gboolean all)
{
EBook *book;
GList *contacts = NULL;
- GtkWindow *parent_window;
+ GtkWindow *parent;
book = e_addressbook_model_get_book (view->priv->model);
if (all) {
- EBookQuery *query = e_book_query_any_field_contains("");
- e_book_get_contacts(book, query, &contacts, NULL);
- e_book_query_unref(query);
- }
- else {
+ EBookQuery *query;
+
+ query = e_book_query_any_field_contains ("");
+ e_book_get_contacts (book, query, &contacts, NULL);
+ e_book_query_unref (query);
+ } else {
contacts = e_addressbook_view_get_selected (view);
}
- parent_window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view)));
- eab_transfer_contacts (book, contacts, delete_from_source, parent_window);
+ parent = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view)));
+ eab_transfer_contacts (book, contacts, delete_from_source, parent);
+
g_object_unref(book);
}
@@ -1443,7 +1448,11 @@ e_addressbook_view_move_to_folder (EAddressbookView *view, gboolean all)
}
void
-e_addressbook_view_set_search (EAddressbookView *view, gint filter_id, gint search_id, const gchar *search_text, EFilterRule *advanced_search)
+e_addressbook_view_set_search (EAddressbookView *view,
+ gint filter_id,
+ gint search_id,
+ const gchar *search_text,
+ EFilterRule *advanced_search)
{
EAddressbookViewPrivate *priv;
@@ -1460,12 +1469,21 @@ e_addressbook_view_set_search (EAddressbookView *view, gint filter_id, gint sear
priv->filter_id = filter_id;
priv->search_id = search_id;
priv->search_text = g_strdup (search_text);
- priv->advanced_search = advanced_search ? e_filter_rule_clone (advanced_search) : NULL;
+
+ if (advanced_search != NULL)
+ priv->advanced_search = e_filter_rule_clone (advanced_search);
+ else
+ priv->advanced_search = NULL;
}
-/* free returned values for search_text and advanced_search, if not NULL, as these are new copies */
+/* Free returned values for search_text and advanced_search,
+ * if not NULL, as these are new copies. */
void
-e_addressbook_view_get_search (EAddressbookView *view, gint *filter_id, gint *search_id, gchar **search_text, EFilterRule **advanced_search)
+e_addressbook_view_get_search (EAddressbookView *view,
+ gint *filter_id,
+ gint *search_id,
+ gchar **search_text,
+ EFilterRule **advanced_search)
{
EAddressbookViewPrivate *priv;
@@ -1481,5 +1499,9 @@ e_addressbook_view_get_search (EAddressbookView *view, gint *filter_id, gint *se
*filter_id = priv->filter_id;
*search_id = priv->search_id;
*search_text = g_strdup (priv->search_text);
- *advanced_search = priv->advanced_search ? e_filter_rule_clone (priv->advanced_search) : NULL;
+
+ if (priv->advanced_search != NULL)
+ *advanced_search = e_filter_rule_clone (priv->advanced_search);
+ else
+ *advanced_search = NULL;
}
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index 231d799957..0fd7d09129 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -696,7 +696,9 @@ csv_getwidget(EImport *ei, EImportTarget *target, EImportImporter *im)
e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (selector), primary);
g_object_unref (source_list);
- g_signal_connect (selector, "primary_selection_changed", G_CALLBACK (primary_selection_changed_cb), target);
+ g_signal_connect (
+ selector, "primary_selection_changed",
+ G_CALLBACK (primary_selection_changed_cb), target);
gtk_widget_show_all (vbox);
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index 1e6461a631..5f5c40ee13 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -306,11 +306,15 @@ parseLine (LDIFImporter *gci, EContact *contact,
/* handle objectclass/dn/member out here */
if (!field_handled) {
if (!g_ascii_strcasecmp (ptr, "dn"))
- g_hash_table_insert (gci->dn_contact_hash, g_strdup(ldif_value->str), contact);
- else if (!g_ascii_strcasecmp (ptr, "objectclass") && !g_ascii_strcasecmp (ldif_value->str, "groupofnames")) {
- e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (TRUE));
- }
- else if (!g_ascii_strcasecmp (ptr, "member")) {
+ g_hash_table_insert (
+ gci->dn_contact_hash,
+ g_strdup (ldif_value->str), contact);
+ else if (!g_ascii_strcasecmp (ptr, "objectclass") &&
+ !g_ascii_strcasecmp (ldif_value->str, "groupofnames")) {
+ e_contact_set (
+ contact, E_CONTACT_IS_LIST,
+ GINT_TO_POINTER (TRUE));
+ } else if (!g_ascii_strcasecmp (ptr, "member")) {
GList *email;
email = e_contact_get (contact, E_CONTACT_EMAIL);
@@ -326,8 +330,8 @@ parseLine (LDIFImporter *gci, EContact *contact,
*colon = ':';
g_string_free (ldif_value, TRUE);
- }
- else {
+
+ } else {
g_warning ("unrecognized entry %s", ptr);
return FALSE;
}
@@ -508,7 +512,9 @@ ldif_import_contacts(gpointer d)
ldif_import_done(gci);
return FALSE;
} else {
- e_import_status(gci->import, gci->target, _("Importing..."), ftell(gci->file) * 100 / gci->size);
+ e_import_status (
+ gci->import, gci->target, _("Importing..."),
+ ftell (gci->file) * 100 / gci->size);
return TRUE;
}
}
@@ -542,12 +548,17 @@ ldif_getwidget(EImport *ei, EImportTarget *target, EImportImporter *im)
if (primary == NULL) {
primary = e_source_list_peek_source_any (source_list);
g_object_ref(primary);
- g_datalist_set_data_full(&target->data, "ldif-source", primary, g_object_unref);
+ g_datalist_set_data_full (
+ &target->data, "ldif-source", primary,
+ (GDestroyNotify) g_object_unref);
}
- e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (selector), primary);
+ e_source_selector_set_primary_selection (
+ E_SOURCE_SELECTOR (selector), primary);
g_object_unref (source_list);
- g_signal_connect (selector, "primary_selection_changed", G_CALLBACK (primary_selection_changed_cb), target);
+ g_signal_connect (
+ selector, "primary_selection_changed",
+ G_CALLBACK (primary_selection_changed_cb), target);
gtk_widget_show_all (vbox);
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index cc55b97769..07b13d2122 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -546,8 +546,10 @@ load_contacts (EContactPrintContext *ctxt)
e_flag_free (book_view_started);
- g_signal_handlers_disconnect_by_func (book_view, G_CALLBACK (contacts_added), ctxt);
- g_signal_handlers_disconnect_by_func (book_view, G_CALLBACK (sequence_complete), book_view_started);
+ g_signal_handlers_disconnect_by_func (
+ book_view, G_CALLBACK (contacts_added), ctxt);
+ g_signal_handlers_disconnect_by_func (
+ book_view, G_CALLBACK (sequence_complete), book_view_started);
}
static void
diff --git a/addressbook/util/addressbook.c b/addressbook/util/addressbook.c
index d49f19bd7a..b394319c0f 100644
--- a/addressbook/util/addressbook.c
+++ b/addressbook/util/addressbook.c
@@ -331,7 +331,10 @@ addressbook_load_default_book (EBookCallback cb, gpointer closure)
book = e_book_new_default_addressbook (NULL);
if (!book)
- load_source_cb (NULL, E_BOOK_ERROR_OTHER_ERROR, load_source_data); /* XXX we should just use a GError and it's error code here */
+ /* XXX We should just use a GError and its error code here. */
+ load_source_cb (
+ NULL, E_BOOK_ERROR_OTHER_ERROR, load_source_data);
else
- e_book_async_open (book, FALSE, default_book_cb, load_source_data);
+ e_book_async_open (
+ book, FALSE, default_book_cb, load_source_data);
}