[evolution] Coding style and whitespace cleanup.



commit 0b1cd2dd5b0b2b35a0c12032b54ac51b97b22110
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed May 26 17:19:41 2010 -0400

    Coding style and whitespace cleanup.

 addressbook/gui/contact-editor/e-contact-editor.c |    8 ++-
 addressbook/gui/widgets/e-addressbook-view.c      |    4 +-
 addressbook/importers/evolution-vcard-importer.c  |   44 +++++++++++++++------
 addressbook/printing/e-contact-print.c            |   26 +++++++-----
 addressbook/printing/e-contact-print.h            |    4 +-
 calendar/gui/dialogs/comp-editor.c                |   21 ++++++----
 calendar/gui/dialogs/event-editor.c               |    9 +++-
 calendar/gui/dialogs/event-page.c                 |    8 +++-
 calendar/gui/e-week-view-event-item.c             |   18 ++++++---
 calendar/importers/icalendar-importer.c           |    8 +++-
 capplet/settings/mail-guess-servers.c             |   13 ++----
 composer/e-composer-autosave.c                    |    4 +-
 mail/e-mail-reader.c                              |    2 +-
 modules/calendar/e-cal-shell-sidebar.c            |    6 ++-
 modules/calendar/e-cal-shell-view-private.c       |    4 +-
 modules/calendar/e-cal-shell-view.c               |    9 +++-
 modules/mail/e-mail-shell-view-actions.c          |    4 +-
 modules/plugin-mono/e-plugin-mono.c               |    2 +-
 plugins/mark-all-read/mark-all-read.c             |    9 ++++-
 shell/e-shell-meego.c                             |    3 +-
 shell/main.c                                      |    4 +-
 widgets/menus/gal-define-views-dialog.c           |    1 -
 widgets/misc/e-import-assistant.c                 |   17 ++++++--
 widgets/misc/e-web-view-preview.h                 |    4 +-
 24 files changed, 153 insertions(+), 79 deletions(-)
---
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 2f885e4..5b2834b 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 88255fc..70c3c23 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 59aba91..1bcd6d6 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 eca6522..7eb955b 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 e16abf2..d87a3e6 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 */
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 010dd1c..7c6454d 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -1590,11 +1590,14 @@ comp_editor_init (CompEditor *editor)
 	GtkWindow *window;
 	GtkWidget *scroll = NULL;
 	EShell *shell;
+	gboolean express_mode;
 	gint n_targets;
 	GError *error = NULL;
 
-	/* FIXME Shell should be passed in. */
+	/* FIXME We already have a 'shell' property.  Move stuff
+	 *       that depends on it to a constructed() method. */
 	shell = e_shell_get_default ();
+	express_mode = e_shell_get_express_mode (shell);
 
 	editor->priv = priv = COMP_EDITOR_GET_PRIVATE (editor);
 
@@ -1619,8 +1622,8 @@ comp_editor_init (CompEditor *editor)
 	priv->is_group_item = FALSE;
 
 	priv->ui_manager = e_ui_manager_new ();
-	e_ui_manager_set_express_mode (E_UI_MANAGER (priv->ui_manager),
-				       e_shell_get_express_mode (shell));
+	e_ui_manager_set_express_mode (
+		E_UI_MANAGER (priv->ui_manager), express_mode);
 
 	gtk_window_add_accel_group (
 		GTK_WINDOW (editor),
@@ -1719,7 +1722,7 @@ comp_editor_init (CompEditor *editor)
 
 	container = widget;
 
-	if (!e_shell_get_express_mode (shell)) {
+	if (!express_mode) {
 		widget = comp_editor_get_managed_widget (editor, "/main-menu");
 		gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
 		gtk_widget_set_visible (widget, !e_shell_get_meego_mode (shell));
@@ -1735,7 +1738,7 @@ comp_editor_init (CompEditor *editor)
 	priv->attachment_view = g_object_ref (widget);
 	gtk_widget_show (widget);
 
-	if (e_shell_get_express_mode (shell)) {
+	if (express_mode) {
 		/*GtkWidget *tmp, *tmp1, *tmp_box, */
 		GtkWidget *cont;
 		GtkWidget *combo;
@@ -1773,7 +1776,7 @@ comp_editor_init (CompEditor *editor)
 	container = e_attachment_paned_get_content_area (
 		E_ATTACHMENT_PANED (priv->attachment_view));
 
-	if (e_shell_get_express_mode (shell)) {
+	if (express_mode) {
 		scroll = gtk_scrolled_window_new (NULL, NULL);
 		gtk_scrolled_window_set_policy ((GtkScrolledWindow *)scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 		gtk_widget_show(scroll);
@@ -1781,14 +1784,14 @@ comp_editor_init (CompEditor *editor)
 	}
 
 	widget = gtk_notebook_new ();
-	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), e_shell_get_express_mode (shell));
-	if (!e_shell_get_express_mode (shell))
+	gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), express_mode);
+	if (!express_mode)
 		gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
 	else
 		gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) scroll, widget);
 	priv->notebook = GTK_NOTEBOOK (widget);
 	gtk_widget_show (widget);
-	if (e_shell_get_express_mode (shell))
+	if (express_mode)
 		gtk_widget_set_size_request (scroll, 300, -1);
 	comp_editor_setup_recent_menu (editor);
 
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 262751f..697dd74 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -287,6 +287,7 @@ event_editor_constructor (GType type,
 	EventEditorPrivate *priv;
 	GtkActionGroup *action_group;
 	GtkWidget *content_area;
+	EShell *shell;
 	ECal *client;
 	gboolean is_meeting;
 	GtkWidget *alarm_page;
@@ -299,6 +300,8 @@ event_editor_constructor (GType type,
 	editor = COMP_EDITOR (object);
 	priv = EVENT_EDITOR_GET_PRIVATE (object);
 
+	shell = comp_editor_get_shell (editor);
+
 	client = comp_editor_get_client (editor);
 	flags = comp_editor_get_flags (editor);
 	action_group = comp_editor_get_action_group (editor, "coordinated");
@@ -327,7 +330,7 @@ event_editor_constructor (GType type,
 
 	priv->recur_page = recurrence_page_new (editor);
 	page = COMP_EDITOR_PAGE (priv->recur_page);
-	if (!e_shell_get_express_mode(e_shell_get_default())) {
+	if (!e_shell_get_express_mode (shell)) {
 		gtk_container_add (
 			GTK_CONTAINER ((GTK_DIALOG (priv->recur_window)->vbox)),
 			comp_editor_page_get_widget (page));
@@ -337,7 +340,7 @@ event_editor_constructor (GType type,
 		comp_editor_append_page (editor, page, _("_Recurrence"), TRUE);
 	}
 
-	if (e_shell_get_express_mode(e_shell_get_default())) {
+	if (e_shell_get_express_mode (shell)) {
 		ENameSelector *name_selector;
 
 		priv->sched_page = schedule_page_new (priv->model, editor);
@@ -372,7 +375,7 @@ event_editor_constructor (GType type,
 		event_page_set_meeting (priv->event_page, TRUE);
 		priv->meeting_shown=TRUE;
 
-		if (e_shell_get_express_mode(e_shell_get_default())) {
+		if (e_shell_get_express_mode (shell)) {
 			attendee_page = event_page_get_attendee_page (priv->event_page);
 			comp_editor_append_widget (editor, attendee_page, _("Attendee_s"), TRUE);
 			g_object_unref(attendee_page);
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 1dfabb7..361451e 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -724,6 +724,7 @@ static void
 sensitize_widgets (EventPage *epage)
 {
 	ECal *client;
+	EShell *shell;
 	CompEditor *editor;
 	CompEditorFlags flags;
 	GtkActionGroup *action_group;
@@ -735,6 +736,7 @@ sensitize_widgets (EventPage *epage)
 	editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
 	client = comp_editor_get_client (editor);
 	flags = comp_editor_get_flags (editor);
+	shell = comp_editor_get_shell (editor);
 
 	priv = epage->priv;
 	if (flags & COMP_EDITOR_MEETING)
@@ -828,7 +830,7 @@ sensitize_widgets (EventPage *epage)
 	} else {
 		gtk_widget_show (priv->calendar_label);
 		gtk_widget_show (priv->list_box);
-		if (!e_shell_get_express_mode(e_shell_get_default()))
+		if (!e_shell_get_express_mode (shell))
 			gtk_widget_show (priv->attendee_box);
 		gtk_widget_show (priv->organizer);
 		gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:"));
@@ -2131,6 +2133,7 @@ event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *ms
 static gboolean
 get_widgets (EventPage *epage)
 {
+	EShell *shell;
 	CompEditor *editor;
 	CompEditorPage *page = COMP_EDITOR_PAGE (epage);
 	GtkEntryCompletion *completion;
@@ -2146,6 +2149,7 @@ get_widgets (EventPage *epage)
 #define GW(name) e_builder_get_widget (priv->builder, name)
 
 	editor = comp_editor_page_get_editor (page);
+	shell = comp_editor_get_shell (editor);
 
 	priv->main = GW ("event-page");
 	if (!priv->main)
@@ -2200,7 +2204,7 @@ get_widgets (EventPage *epage)
 
 	priv->invite = GW ("invite");
 	priv->invite_label = GW ("invite-label");
-	if (e_shell_get_express_mode (e_shell_get_default ()))
+	if (e_shell_get_express_mode (shell))
 		gtk_widget_hide (priv->invite);
 	else
 		gtk_widget_hide (priv->invite_label);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index ba44b7a..ae3fadf 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -195,10 +195,13 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item,
 	if (!is_array_index_in_bounds (week_view->events, event_item->priv->event_num))
 		return FALSE;
 
-	event = &g_array_index (week_view->events, EWeekViewEvent,
-				event_item->priv->event_num);
+	event = &g_array_index (
+		week_view->events, EWeekViewEvent,
+		event_item->priv->event_num);
 
-	if (!is_array_index_in_bounds (week_view->spans, event->spans_index + event_item->priv->span_num))
+	if (!is_array_index_in_bounds (
+		week_view->spans, event->spans_index +
+		event_item->priv->span_num))
 		return FALSE;
 
 	span = &g_array_index (week_view->spans, EWeekViewEventSpan,
@@ -759,11 +762,14 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item,
 		event->spans_index + event_item->priv->span_num <
 		week_view->spans->len);
 
-	if (!is_array_index_in_bounds (week_view->spans, event->spans_index + event_item->priv->span_num))
+	if (!is_array_index_in_bounds (
+		week_view->spans, event->spans_index +
+		event_item->priv->span_num))
 		return;
 
-	span = &g_array_index (week_view->spans, EWeekViewEventSpan,
-			       event->spans_index + event_item->priv->span_num);
+	span = &g_array_index (
+		week_view->spans, EWeekViewEventSpan,
+		event->spans_index + event_item->priv->span_num);
 
 	gc = week_view->main_gc;
 
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index f719c9c..6c673f2 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -1146,10 +1146,16 @@ static icaltimezone *
 get_users_timezone (void)
 {
 	/* more or less copy&paste of calendar_config_get_icaltimezone */
+	EShell *shell;
+	EShellSettings *shell_settings;
 	icaltimezone *zone = NULL;
 	gchar *location;
 
-	if (e_shell_settings_get_boolean (e_shell_get_shell_settings (e_shell_get_default ()), "cal-use-system-timezone")) {
+	/* FIXME Pass this in. */
+	shell = e_shell_get_default ();
+	shell_settings = e_shell_get_shell_settings (shell);
+
+	if (e_shell_settings_get_boolean (shell_settings, "cal-use-system-timezone")) {
 		location = e_cal_util_get_system_timezone_location ();
 	} else {
 		GConfClient *client = gconf_client_get_default ();
diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c
index d6a65e8..33a8699 100644
--- a/capplet/settings/mail-guess-servers.c
+++ b/capplet/settings/mail-guess-servers.c
@@ -226,15 +226,8 @@ is_online (void)
 {
 	EShell *shell;
 
+	/* FIXME Pass this in. */
 	shell = e_shell_get_default ();
-	if (!shell) {
-		 /* FIXME: do we always have a shell?  What do we do if one
-		  * hasn't been created yet?  e_shell_get_default() won't create
-		  * a shell; it will just return one that has been created
-		  * before.
-		  */
-		return FALSE;
-	}
 
 	return e_shell_get_online (shell);
 }
@@ -252,7 +245,9 @@ guess_when_online (EmailProvider *provider)
 	proxy = e_proxy_new ();
 	e_proxy_setup_proxy (proxy);
 
-	url = g_strdup_printf("%s/%s", "http://api.gnome.org/evolution/autoconfig";, provider->domain);
+	url = g_strdup_printf (
+		"%s/%s", "http://api.gnome.org/evolution/autoconfig";,
+		provider->domain);
 	parsed = soup_uri_new (url);
 	soup_uri_free (parsed);
 
diff --git a/composer/e-composer-autosave.c b/composer/e-composer-autosave.c
index 3db7ef2..470157c 100644
--- a/composer/e-composer-autosave.c
+++ b/composer/e-composer-autosave.c
@@ -81,7 +81,9 @@ composer_autosave_state_new (EMsgComposer *composer)
 	state->source_id = 0;
 	state->composer = composer;
 
-	g_signal_connect (composer, "notify::changed", G_CALLBACK (composer_changed_cb), NULL);
+	g_signal_connect (
+		composer, "notify::changed",
+		G_CALLBACK (composer_changed_cb), NULL);
 
 	return state;
 }
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 4b02d69..f86b225 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -2307,7 +2307,7 @@ mail_reader_update_actions (EMailReader *reader)
 		selection_has_not_junk_messages &&
 		!(state & E_MAIL_READER_FOLDER_IS_JUNK);
 	action = e_mail_reader_get_action (reader, action_name);
-	gtk_action_set_sensitive (action, sensitive && !(state & E_MAIL_READER_FOLDER_IS_JUNK));
+	gtk_action_set_sensitive (action, sensitive);
 
 	action_name = "mail-mark-not-junk";
 	sensitive = selection_has_junk_messages;
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 9491d3f..f5f8761 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -637,7 +637,7 @@ cal_shell_sidebar_constructed (GObject *object)
 		GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 	gtk_scrolled_window_set_shadow_type (
 		GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN);
-	if (!e_shell_get_express_mode(e_shell_get_default())) {
+	if (!e_shell_get_express_mode (shell)) {
 		gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
 	} else {
 		GtkWidget *button;
@@ -647,7 +647,9 @@ cal_shell_sidebar_constructed (GObject *object)
 
 		button = gtk_button_new_with_label (_("New Calendar..."));
 		gtk_box_pack_start (GTK_BOX(container), button, FALSE, FALSE, 0);
-		g_signal_connect (button, "clicked", G_CALLBACK(new_calendar_clicked), shell_sidebar);
+		g_signal_connect (
+			button, "clicked",
+			G_CALLBACK (new_calendar_clicked), shell_sidebar);
 
 		gtk_paned_pack1 (GTK_PANED (priv->paned), container, TRUE, TRUE);
 		gtk_widget_show_all (container);
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 11b6ec2..aa10085 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -464,7 +464,9 @@ system_timezone_monitor_changed (GFileMonitor *handle,
 	current_zone = e_cal_model_get_timezone (model);
 	timezone = e_cal_util_get_system_timezone ();
 
-	if (!g_strcmp0 (icaltimezone_get_tzid (timezone), icaltimezone_get_tzid (current_zone)))
+	if (!g_strcmp0 (
+		icaltimezone_get_tzid (timezone),
+		icaltimezone_get_tzid (current_zone)))
 		return;
 
 	shell_backend = e_shell_view_get_shell_backend ((EShellView *) view);
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 218bd7d..8833be7 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -277,6 +277,7 @@ cal_shell_view_update_actions (EShellView *shell_view)
 	ECalShellContent *cal_shell_content;
 	EShellSidebar *shell_sidebar;
 	EShellWindow *shell_window;
+	EShell *shell;
 	GnomeCalendarViewType view_type;
 	GnomeCalendar *calendar;
 	ECalendarView *view;
@@ -303,8 +304,9 @@ cal_shell_view_update_actions (EShellView *shell_view)
 	priv = E_CAL_SHELL_VIEW_GET_PRIVATE (shell_view);
 
 	shell_window = e_shell_view_get_shell_window (shell_view);
+	shell = e_shell_window_get_shell (shell_window);
 
-	if (e_shell_get_express_mode(e_shell_get_default())) {
+	if (e_shell_get_express_mode (shell)) {
 		GtkWidget *widget, *item;
 
 		/* Hack: Get rid of New and Send/Receive in toolbar
@@ -498,7 +500,10 @@ cal_shell_view_class_init (ECalShellViewClass *class,
 	shell_view_class->execute_search = cal_shell_view_execute_search;
 	shell_view_class->update_actions = cal_shell_view_update_actions;
 
-	if (e_shell_get_express_mode(e_shell_get_default()))
+	/* XXX This is an unusual place to need an EShell instance.
+	 *     Would be cleaner to implement a method that either
+	 *     chains up or does nothing based on express mode. */
+	if (e_shell_get_express_mode (e_shell_get_default ()))
 		shell_view_class->construct_searchbar = NULL;
 
 }
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 3ba34e6..2fa6389 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -217,6 +217,7 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
 	EShellView *shell_view;
 	CamelFolder *folder;
 	GtkWindow *parent;
+	MailFolderCache *cache;
 	MessageList *message_list;
 	GPtrArray *uids;
 	const gchar *key;
@@ -232,8 +233,9 @@ action_mail_folder_mark_all_as_read_cb (GtkAction *action,
 	folder = e_mail_reader_get_folder (reader);
 	g_return_if_fail (folder != NULL);
 
+	cache = mail_folder_cache_get_default ();
 	key = "/apps/evolution/mail/prompts/mark_all_read";
-	if (mail_folder_cache_get_folder_has_children (mail_folder_cache_get_default (), folder, NULL))
+	if (mail_folder_cache_get_folder_has_children (cache, folder, NULL))
 		prompt = "mail:ask-mark-all-read-sub";
 	else
 		prompt = "mail:ask-mark-all-read";
diff --git a/modules/plugin-mono/e-plugin-mono.c b/modules/plugin-mono/e-plugin-mono.c
index eb4b60c..68a6233 100644
--- a/modules/plugin-mono/e-plugin-mono.c
+++ b/modules/plugin-mono/e-plugin-mono.c
@@ -125,7 +125,7 @@ plugin_mono_invoke (EPlugin *plugin,
 		mono_config_parse (NULL);
 		domain = mono_jit_init (plugin_mono->location);
 	}
-	
+
 	/* We need to do this every time since we may
 	 * be called from any thread for some uses. */
 	mono_thread_attach (domain);
diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c
index f22b227..e152ec1 100644
--- a/plugins/mark-all-read/mark-all-read.c
+++ b/plugins/mark-all-read/mark-all-read.c
@@ -91,7 +91,14 @@ prompt_user (gboolean has_subfolders)
 	gint response;
 
 	if (!has_subfolders) {
-		return em_utils_prompt_user (e_shell_get_active_window (e_shell_get_default ()), NULL, "mail:ask-mark-all-read", NULL) ?
+		EShell *shell;
+		GtkWindow *parent;
+
+		shell = e_shell_get_default ();
+		parent = e_shell_get_active_window (shell);
+
+		return em_utils_prompt_user (
+			parent, NULL, "mail:ask-mark-all-read", NULL) ?
 			GTK_RESPONSE_NO : GTK_RESPONSE_CANCEL;
 	}
 
diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c
index 0b54250..3d48d55 100644
--- a/shell/e-shell-meego.c
+++ b/shell/e-shell-meego.c
@@ -140,7 +140,8 @@ void e_shell_detect_meego (gboolean *is_meego, gboolean *small_screen)
 #endif
 
 #ifdef TEST_APP
-/* gcc -g -O0 -Wall -I. -DTEST_APP `pkg-config --cflags --libs gtk+-2.0` e-shell-meego.c && ./a.out */
+/* gcc -g -O0 -Wall -I. -DTEST_APP `pkg-config --cflags --libs gtk+-2.0`
+ *     e-shell-meego.c && ./a.out */
 #include <gtk/gtk.h>
 
 gint main (gint argc, gchar **argv)
diff --git a/shell/main.c b/shell/main.c
index 4824cfc..cac04dd 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -482,10 +482,10 @@ main (gint argc, gchar **argv)
 		g_warning ("Could not set PATH for Evolution and its child processes");
 
 	g_free (path);
-	
+
 	_e_win32_register_mailer ();
 	_e_win32_register_addressbook ();
-	
+
 	if (reinstall) {
 		_e_win32_set_default_mailer ();
 		exit (0);
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index ed0902c..a6f52bf 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -108,7 +108,6 @@ gdvd_button_new_dialog_callback (GtkWidget *widget, gint id, GalDefineViewsDialo
 						    COL_GALVIEW_DATA, item,
 						    -1);
 
-
 				if (view && GAL_VIEW_GET_CLASS (view)->edit)
 					gal_view_edit (view, GTK_WINDOW (dialog));
 				g_object_unref (view);
diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c
index 3ca06dc..48c2d22 100644
--- a/widgets/misc/e-import-assistant.c
+++ b/widgets/misc/e-import-assistant.c
@@ -802,12 +802,16 @@ simple_filetype_changed_cb (GtkComboBox *combo_box, GtkAssistant *assistant)
 		gtk_widget_destroy (page->control);
 	page->has_preview = FALSE;
 
-	control = e_import_get_preview_widget (priv->import, (EImportTarget *) page->target, page->importer);
+	control = e_import_get_preview_widget (
+		priv->import, (EImportTarget *)
+		page->target, page->importer);
 	if (control) {
 		page->has_preview = TRUE;
 		gtk_widget_set_size_request (control, 320, 240);
 	} else
-		control = create_importer_control (priv->import, (EImportTarget *)page->target, page->importer);
+		control = create_importer_control (
+			priv->import, (EImportTarget *)
+			page->target, page->importer);
 
 	page->control = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
 	gtk_widget_show (page->control);
@@ -876,12 +880,17 @@ prepare_simple_page (GtkAssistant *assistant, GtkWidget *vbox)
 
 		gtk_widget_hide (page->filetypetable);
 
-		title = g_strconcat (_("Import Data"), " - ", ((EImportImporter *)importers->data)->name, NULL);
+		title = g_strconcat (
+			_("Import Data"), " - ",
+			((EImportImporter *)importers->data)->name, NULL);
 		gtk_assistant_set_page_title (assistant, vbox, title);
 		g_free (title);
 	} else {
 		/* multiple importers found, be able to choose from them */
-		gtk_label_set_text (GTK_LABEL (page->actionlabel), _("Select what type of file you want to import from the list."));
+		gtk_label_set_text (
+			GTK_LABEL (page->actionlabel),
+			_("Select what type of file you "
+			  "want to import from the list."));
 
 		gtk_widget_show (page->filetypetable);
 
diff --git a/widgets/misc/e-web-view-preview.h b/widgets/misc/e-web-view-preview.h
index 319f67e..ae75690 100644
--- a/widgets/misc/e-web-view-preview.h
+++ b/widgets/misc/e-web-view-preview.h
@@ -80,8 +80,8 @@ GtkTreeView *	e_web_view_preview_get_tree_view(EWebViewPreview *preview);
 GtkWidget *	e_web_view_preview_get_preview	(EWebViewPreview *preview);
 void		e_web_view_preview_set_preview  (EWebViewPreview *preview, GtkWidget *preview_widget);
 
-void 		e_web_view_preview_show_tree_view(EWebViewPreview *preview);
-void 		e_web_view_preview_hide_tree_view(EWebViewPreview *preview);
+void		e_web_view_preview_show_tree_view(EWebViewPreview *preview);
+void		e_web_view_preview_hide_tree_view(EWebViewPreview *preview);
 
 void		e_web_view_preview_set_escape_values(EWebViewPreview *preview, gboolean escape);
 gboolean	e_web_view_preview_get_escape_values(EWebViewPreview *preview);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]