aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-05-27 05:19:41 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-05-27 05:19:41 +0800
commit0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110 (patch)
treed282033033e0fd8bb3c1632084d4c09f90dbbb2b /addressbook
parent3f213cfbef9142d117fbd9219cf12cbecc39f59e (diff)
downloadgsoc2013-evolution-0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110.tar.gz
gsoc2013-evolution-0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110.tar.zst
gsoc2013-evolution-0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c8
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c4
-rw-r--r--addressbook/importers/evolution-vcard-importer.c44
-rw-r--r--addressbook/printing/e-contact-print.c26
-rw-r--r--addressbook/printing/e-contact-print.h4
5 files changed, 57 insertions, 29 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 2f885e4721..5b2834b46b 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -3508,6 +3508,10 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
GtkWidget *widget, *label;
GtkEntryCompletion *completion;
+ /* FIXME The shell should be obtained
+ * through a constructor property. */
+ shell = e_shell_get_default ();
+
e_contact_editor->name = e_contact_name_new();
e_contact_editor->contact = NULL;
@@ -3518,7 +3522,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
e_contact_editor->target_editable = TRUE;
e_contact_editor->fullname_dialog = NULL;
e_contact_editor->categories_dialog = NULL;
- e_contact_editor->compress_ui = e_shell_get_express_mode (e_shell_get_default ());
+ e_contact_editor->compress_ui = e_shell_get_express_mode (shell);
e_contact_editor->load_source_id = 0;
e_contact_editor->load_book = NULL;
@@ -3587,8 +3591,6 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
/* show window */
gtk_widget_show (e_contact_editor->app);
- /* FIXME Shell should be passed in. */
- shell = e_shell_get_default ();
e_shell_watch_window (shell, GTK_WINDOW (e_contact_editor->app));
}
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 88255fc0a9..70c3c2334e 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1518,7 +1518,9 @@ view_transfer_contacts (EAddressbookView *view,
e_book_query_unref (query);
if (error) {
- e_alert_run_dialog_for_args (parent, "addressbook:search-error", error->message, NULL);
+ e_alert_run_dialog_for_args (
+ parent, "addressbook:search-error",
+ error->message, NULL);
g_error_free (error);
return;
}
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c
index 59aba913d2..1bcd6d6540 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -739,28 +739,40 @@ preview_contact (EWebViewPreview *preview, EContact *contact)
g_date_set_dmy (&gd, dt->day, dt->month, dt->year);
g_date_to_struct_tm (&gd, &tm);
- value = e_datetime_format_format_tm ("addressbook", "table", DTFormatKindDate, &tm);
+ value = e_datetime_format_format_tm (
+ "addressbook", "table",
+ DTFormatKindDate, &tm);
if (value) {
- e_web_view_preview_add_section (preview, e_contact_pretty_name (field), value);
+ e_web_view_preview_add_section (
+ preview,
+ e_contact_pretty_name (field),
+ value);
had_value = TRUE;
}
g_free (value);
e_contact_date_free (dt);
}
- } else if (field == E_CONTACT_IS_LIST || field == E_CONTACT_WANTS_HTML || field == E_CONTACT_LIST_SHOW_ADDRESSES) {
+ } else if (field == E_CONTACT_IS_LIST ||
+ field == E_CONTACT_WANTS_HTML ||
+ field == E_CONTACT_LIST_SHOW_ADDRESSES) {
if (e_contact_get (contact, field)) {
- e_web_view_preview_add_text (preview, e_contact_pretty_name (field));
+ e_web_view_preview_add_text (
+ preview, e_contact_pretty_name (field));
had_value = TRUE;
}
- } else if (field == E_CONTACT_ADDRESS_HOME || field == E_CONTACT_ADDRESS_WORK || field == E_CONTACT_ADDRESS_OTHER) {
+ } else if (field == E_CONTACT_ADDRESS_HOME ||
+ field == E_CONTACT_ADDRESS_WORK ||
+ field == E_CONTACT_ADDRESS_OTHER) {
EContactAddress *addr = e_contact_get (contact, field);
if (addr) {
gboolean have = FALSE;
#define add_it(_what) \
if (addr->_what && *addr->_what) { \
- e_web_view_preview_add_section (preview, have ? NULL : e_contact_pretty_name (field), addr->_what); \
+ e_web_view_preview_add_section ( \
+ preview, have ? NULL : \
+ e_contact_pretty_name (field), addr->_what); \
have = TRUE; \
had_value = TRUE; \
}
@@ -777,10 +789,14 @@ preview_contact (EWebViewPreview *preview, EContact *contact)
e_contact_address_free (addr);
}
- } else if (field == E_CONTACT_IM_AIM || field == E_CONTACT_IM_GROUPWISE ||
- field == E_CONTACT_IM_JABBER || field == E_CONTACT_IM_YAHOO ||
- field == E_CONTACT_IM_MSN || field == E_CONTACT_IM_ICQ ||
- field == E_CONTACT_IM_GADUGADU || field == E_CONTACT_IM_SKYPE ||
+ } else if (field == E_CONTACT_IM_AIM ||
+ field == E_CONTACT_IM_GROUPWISE ||
+ field == E_CONTACT_IM_JABBER ||
+ field == E_CONTACT_IM_YAHOO ||
+ field == E_CONTACT_IM_MSN ||
+ field == E_CONTACT_IM_ICQ ||
+ field == E_CONTACT_IM_GADUGADU ||
+ field == E_CONTACT_IM_SKYPE ||
field == E_CONTACT_EMAIL) {
GList *attrs, *a;
gboolean have = FALSE;
@@ -797,7 +813,9 @@ preview_contact (EWebViewPreview *preview, EContact *contact)
const gchar *str = value->data;
if (str && *str) {
- e_web_view_preview_add_section (preview, have ? NULL : e_contact_pretty_name (field), str);
+ e_web_view_preview_add_section (
+ preview, have ? NULL :
+ e_contact_pretty_name (field), str);
have = TRUE;
had_value = TRUE;
}
@@ -921,7 +939,9 @@ evolution_contact_importer_get_preview_widget (const GList *contacts)
selection = gtk_tree_view_get_selection (tree_view);
gtk_tree_selection_select_iter (selection, &iter);
- g_signal_connect (selection, "changed", G_CALLBACK (preview_selection_changed_cb), preview);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (preview_selection_changed_cb), preview);
preview_selection_changed_cb (selection, E_WEB_VIEW_PREVIEW (preview));
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index eca65221be..7eb955bba7 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -277,7 +277,6 @@ e_contact_get_contact_height (EContact *contact, EContactPrintContext *ctxt)
return cntct_height;
}
-
static void
e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt)
{
@@ -338,10 +337,16 @@ e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt)
ctxt->context, ctxt->style->body_font,
ctxt->x, ctxt->y, ctxt->column_width + 4, text);
- if ( get_font_width (ctxt->context, ctxt->style->body_font, text) > ctxt->column_width)
- wrapped_lines = ( get_font_width (ctxt->context, ctxt->style->body_font, text) / (ctxt->column_width+4)) + 1;
- ctxt->y = ctxt->y + ((wrapped_lines+1) *e_contact_text_height (
- ctxt->context, ctxt->style->body_font, text));
+ if (get_font_width (ctxt->context,
+ ctxt->style->body_font, text) > ctxt->column_width)
+ wrapped_lines =
+ (get_font_width (ctxt->context,
+ ctxt->style->body_font, text) /
+ (ctxt->column_width+4)) + 1;
+ ctxt->y =
+ ctxt->y + ((wrapped_lines + 1) *
+ e_contact_text_height (ctxt->context,
+ ctxt->style->body_font, text));
ctxt->y += .2 * get_font_height (ctxt->style->body_font);
@@ -353,8 +358,6 @@ e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt)
cairo_restore (cr);
}
-
-
static gint
contact_compare (EContact *contact1, EContact *contact2)
{
@@ -651,7 +654,8 @@ contact_draw (EContact *contact, EContactPrintContext *ctxt)
ctxt->first_section = FALSE;
}
- else if (!ctxt->first_contact && (( ctxt->y + e_contact_get_contact_height (contact, ctxt)) > page_height)) {
+ else if (!ctxt->first_contact && ((ctxt->y +
+ e_contact_get_contact_height (contact, ctxt)) > page_height)) {
e_contact_start_new_column (ctxt);
if (ctxt->style->letter_headings)
e_contact_print_letter_heading (ctxt, ctxt->section);
@@ -712,8 +716,8 @@ contact_begin_print (GtkPrintOperation *operation,
}
}
-/* contact_page_draw_footer inserts the
- * page number at the end of each page
+/* contact_page_draw_footer inserts the
+ * page number at the end of each page
* while printing*/
void
contact_page_draw_footer (GtkPrintOperation *operation,
@@ -727,7 +731,7 @@ contact_page_draw_footer (GtkPrintOperation *operation,
gchar *text;
cairo_t *cr;
GtkPageSetup *setup;
-
+
/*Uncomment next if it is successful to get total number if pages in list view
* g_object_get (operation, "n-pages", &n_pages, NULL)*/
text = g_strdup_printf (_("Page %d"), page_nr + 1);
diff --git a/addressbook/printing/e-contact-print.h b/addressbook/printing/e-contact-print.h
index e16abf2435..d87a3e6fcb 100644
--- a/addressbook/printing/e-contact-print.h
+++ b/addressbook/printing/e-contact-print.h
@@ -31,8 +31,8 @@ void e_contact_print (EBook *book,
EBookQuery *query,
GList *contact_list,
GtkPrintOperationAction action);
-void contact_page_draw_footer (GtkPrintOperation *operation,
- GtkPrintContext *context,
+void contact_page_draw_footer (GtkPrintOperation *operation,
+ GtkPrintContext *context,
gint page_nr);
#endif /* E_CONTACT_PRINT_H */