diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-02 11:18:28 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-02 11:18:28 +0800 |
commit | c30d29425eccafea02e95ea6e81679508c878784 (patch) | |
tree | 43881a8ae0b03d55cc6facac3b4e6375524c7c4c /modules | |
parent | 6c7520b73d1360504672804ebeba6c4de18de318 (diff) | |
download | gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.tar gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.tar.gz gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.tar.bz2 gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.tar.lz gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.tar.xz gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.tar.zst gsoc2013-evolution-c30d29425eccafea02e95ea6e81679508c878784.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-cal-shell-content.c | 26 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 36 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 6 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view.c | 28 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-sidebar.c | 36 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-sidebar.c | 36 | ||||
-rw-r--r-- | modules/connman/evolution-connman.c | 6 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-sidebar.c | 22 | ||||
-rw-r--r-- | modules/windows-sens/evolution-windows-sens.c | 42 |
10 files changed, 172 insertions, 70 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index dc409aa0ce..56f692dd6b 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -151,7 +151,7 @@ cal_chell_content_get_pad_state_filename (EShellContent *shell_content, ETable * g_return_val_if_fail (E_IS_SHELL_CONTENT (shell_content), NULL); g_return_val_if_fail (table != NULL, NULL); g_return_val_if_fail (E_IS_TABLE (table), NULL); - + if (E_IS_TASK_TABLE (table)) nick = "TaskPad"; else if (E_IS_MEMO_TABLE (table)) @@ -200,11 +200,15 @@ e_cal_shell_content_save_state (ECalShellContent *cal_shell_content) priv = E_CAL_SHELL_CONTENT_GET_PRIVATE (cal_shell_content); - if (priv->task_table) - cal_shell_content_save_table_state (E_SHELL_CONTENT (cal_shell_content), E_TABLE (priv->task_table)); + if (priv->task_table != NULL) + cal_shell_content_save_table_state ( + E_SHELL_CONTENT (cal_shell_content), + E_TABLE (priv->task_table)); if (priv->memo_table != NULL) - cal_shell_content_save_table_state (E_SHELL_CONTENT (cal_shell_content), E_TABLE (priv->memo_table)); + cal_shell_content_save_table_state ( + E_SHELL_CONTENT (cal_shell_content), + E_TABLE (priv->memo_table)); } static void @@ -344,11 +348,11 @@ cal_shell_content_constructed (GObject *object) /* We borrow the memopad and taskpad models from the memo * and task views, loading the views if necessary. */ - if(!e_shell_get_express_mode(e_shell_get_default())) { + if (!e_shell_get_express_mode(e_shell_get_default())) { foreign_view = e_shell_window_get_shell_view (shell_window, "memos"); foreign_content = e_shell_view_get_shell_content (foreign_view); g_object_get (foreign_content, "model", &memo_model, NULL); - + foreign_view = e_shell_window_get_shell_view (shell_window, "tasks"); foreign_content = e_shell_view_get_shell_content (foreign_view); g_object_get (foreign_content, "model", &task_model, NULL); @@ -356,7 +360,7 @@ cal_shell_content_constructed (GObject *object) /* Build content widgets. */ container = GTK_WIDGET (object); - + if (!e_shell_get_express_mode(e_shell_get_default())) { widget = e_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_container_add (GTK_CONTAINER (container), widget); @@ -369,7 +373,7 @@ cal_shell_content_constructed (GObject *object) widget = gtk_notebook_new (); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (widget), FALSE); gtk_notebook_set_show_border (GTK_NOTEBOOK (widget), FALSE); - if (!e_shell_get_express_mode(e_shell_get_default())) + if (!e_shell_get_express_mode(e_shell_get_default())) gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, FALSE); else gtk_container_add (GTK_CONTAINER (container), widget); @@ -408,7 +412,7 @@ cal_shell_content_constructed (GObject *object) priv->notebook, "page"); container = priv->vpaned; -if(!e_shell_get_express_mode(e_shell_get_default())) { +if (!e_shell_get_express_mode(e_shell_get_default())) { widget = gtk_vbox_new (FALSE, 0); gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE); gtk_widget_show (widget); @@ -501,7 +505,7 @@ if(!e_shell_get_express_mode(e_shell_get_default())) { * The GtkWidget::map() callback below explains why. */ priv->view_instance = view_instance; - if (!e_shell_get_express_mode(e_shell_get_default())) { + if (!e_shell_get_express_mode(e_shell_get_default())) { g_signal_connect_swapped ( shell_view, "notify::view-id", G_CALLBACK (cal_shell_content_notify_view_id_cb), @@ -552,7 +556,7 @@ cal_shell_content_class_init (ECalShellContentClass *class) object_class->get_property = cal_shell_content_get_property; object_class->dispose = cal_shell_content_dispose; object_class->constructed = cal_shell_content_constructed; - + widget_class = GTK_WIDGET_CLASS (class); widget_class->map = cal_shell_content_map; diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index db0d0a072f..20e0a96a67 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -277,9 +277,15 @@ static void cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar, ESource *source) { + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + ECalShellContent *cal_shell_content; ECalSourceType source_type; GHashTable *client_table; + ECalModel *model; ECal *client; + icaltimezone *timezone; const gchar *uid; source_type = E_CAL_SOURCE_TYPE_EVENT; @@ -304,7 +310,17 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar, G_CALLBACK (cal_shell_sidebar_default_opened_cb), cal_shell_sidebar); - e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_cal_shell_content_get_model (E_CAL_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (cal_shell_sidebar)))))), NULL); + /* FIXME Sidebar should not be accessing the EShellContent. + * This probably needs to be moved to ECalShellView. */ + shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + cal_shell_content = E_CAL_SHELL_CONTENT (shell_content); + model = e_cal_shell_content_get_model (cal_shell_content); + timezone = e_cal_model_get_timezone (model); + + e_cal_set_default_timezone (client, timezone, NULL); e_cal_open_async (client, FALSE); } @@ -895,11 +911,17 @@ void e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar, ESource *source) { + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + ECalShellContent *cal_shell_content; ECalSourceType source_type; ESourceSelector *selector; GHashTable *client_table; + ECalModel *model; ECal *default_client; ECal *client; + icaltimezone *timezone; const gchar *uid; const gchar *uri; gchar *message; @@ -958,7 +980,17 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar, G_CALLBACK (cal_shell_sidebar_client_opened_cb), cal_shell_sidebar); - e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_cal_shell_content_get_model (E_CAL_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (cal_shell_sidebar)))))), NULL); + /* FIXME Sidebar should not be accessing the EShellContent. + * This probably needs to be moved to ECalShellView. */ + shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + cal_shell_content = E_CAL_SHELL_CONTENT (shell_content); + model = e_cal_shell_content_get_model (cal_shell_content); + timezone = e_cal_model_get_timezone (model); + + e_cal_set_default_timezone (client, timezone, NULL); e_cal_open_async (client, FALSE); } diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 17afe3bf7a..3251183000 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -1213,7 +1213,7 @@ quit_calendar_cb (GtkAction *action, event->any.send_event = TRUE; gtk_main_do_event (event); gdk_event_free (event); - + } static void @@ -1454,7 +1454,7 @@ static GtkActionEntry calendar_entries[] = { NULL, NULL, /* XXX Add a tooltip! */ G_CALLBACK (quit_calendar_cb) }, - + /*** Menus ***/ { "calendar-actions-menu", @@ -1716,7 +1716,7 @@ e_cal_shell_view_actions_init (ECalShellView *cal_shell_view) cal_shell_content = cal_shell_view->priv->cal_shell_content; searchbar = e_cal_shell_content_get_searchbar (cal_shell_content); - + /* Calendar Actions */ action_group = ACTION_GROUP (CALENDAR); gtk_action_group_add_actions ( diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 1c9c26840c..71db1236c1 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -535,7 +535,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) G_CALLBACK (cal_shell_view_selector_client_removed_cb), cal_shell_view); - if (memo_table) + if (memo_table) g_signal_connect_swapped ( memo_table, "popup-event", G_CALLBACK (cal_shell_view_memopad_popup_event_cb), @@ -564,7 +564,7 @@ e_cal_shell_view_private_constructed (ECalShellView *cal_shell_view) task_table, "status-message", G_CALLBACK (e_cal_shell_view_taskpad_set_status_message), cal_shell_view); - + if (task_table) g_signal_connect_swapped ( task_table, "selection-change", diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 29d8fd08b1..a489fe59a7 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -303,35 +303,37 @@ cal_shell_view_update_actions (EShellView *shell_view) shell_window = e_shell_view_get_shell_window (shell_view); - if(e_shell_get_express_mode(e_shell_get_default())) { + if (e_shell_get_express_mode(e_shell_get_default())) { GtkWidget *widget, *item; GdkScreen *scr; gint monitor; GdkRectangle rect; - /* Hack: Get rid of New and Send/Receive in toolbar + /* Hack: Get rid of New and Send/Receive in toolbar * while in express mode */ widget = e_shell_window_get_managed_widget ( shell_window, "/main-toolbar"); item = (GtkWidget *)gtk_toolbar_get_nth_item ((GtkToolbar *)widget, 0); gtk_widget_hide(item); - + widget = e_shell_window_get_managed_widget ( shell_window, "/main-menu"); gtk_widget_hide(widget); - + item = e_shell_window_get_managed_widget ( shell_window, "/main-toolbar/send-receive"); - gtk_widget_hide(item); + gtk_widget_hide(item); scr = gdk_screen_get_default (); - monitor = gdk_screen_get_monitor_at_window (scr, - gtk_widget_get_window (GTK_WIDGET (shell_window))); + monitor = gdk_screen_get_monitor_at_window ( + scr, gtk_widget_get_window (GTK_WIDGET (shell_window))); gdk_screen_get_monitor_geometry (scr, monitor, &rect); - - gtk_window_set_default_size ((GtkWindow *)shell_window, rect.width, rect.height); - gtk_window_set_decorated ((GtkWindow *)shell_window, FALSE); + + gtk_window_set_default_size ( + GTK_WINDOW (shell_window), rect.width, rect.height); + gtk_window_set_decorated ( + GTK_WINDOW (shell_window), FALSE); } cal_shell_content = priv->cal_shell_content; @@ -503,11 +505,11 @@ cal_shell_view_class_init (ECalShellViewClass *class, shell_view_class->new_shell_sidebar = e_cal_shell_sidebar_new; 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())) + + if (e_shell_get_express_mode(e_shell_get_default())) shell_view_class->construct_searchbar = NULL; -} +} static void cal_shell_view_init (ECalShellView *cal_shell_view, diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index 984294472e..416759213e 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -272,9 +272,15 @@ static void memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar, ESource *source) { + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + EMemoShellContent *memo_shell_content; ECalSourceType source_type; GHashTable *client_table; + ECalModel *model; ECal *client; + icaltimezone *timezone; const gchar *uid; source_type = E_CAL_SOURCE_TYPE_JOURNAL; @@ -299,7 +305,17 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar, G_CALLBACK (memo_shell_sidebar_default_opened_cb), memo_shell_sidebar); - e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_memo_shell_content_get_memo_model (E_MEMO_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (memo_shell_sidebar)))))), NULL); + /* FIXME Sidebar should not be accessing the EShellContent. + * This probably needs to be moved to EMemoShellView. */ + shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content); + model = e_memo_shell_content_get_memo_model (memo_shell_content); + timezone = e_cal_model_get_timezone (model); + + e_cal_set_default_timezone (client, timezone, NULL); e_cal_open_async (client, FALSE); } @@ -813,11 +829,17 @@ void e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar, ESource *source) { + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + EMemoShellContent *memo_shell_content; ECalSourceType source_type; ESourceSelector *selector; GHashTable *client_table; + ECalModel *model; ECal *default_client; ECal *client; + icaltimezone *timezone; const gchar *uid; const gchar *uri; gchar *message; @@ -876,7 +898,17 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar, G_CALLBACK (memo_shell_sidebar_client_opened_cb), memo_shell_sidebar); - e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_memo_shell_content_get_memo_model (E_MEMO_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (memo_shell_sidebar)))))), NULL); + /* FIXME Sidebar should not be accessing the EShellContent. + * This probably needs to be moved to EMemoShellView. */ + shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content); + model = e_memo_shell_content_get_memo_model (memo_shell_content); + timezone = e_cal_model_get_timezone (model); + + e_cal_set_default_timezone (client, timezone, NULL); e_cal_open_async (client, FALSE); } diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index db80a50500..07eb43bdbf 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -272,9 +272,15 @@ static void task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar, ESource *source) { + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + ETaskShellContent *task_shell_content; ECalSourceType source_type; GHashTable *client_table; + ECalModel *model; ECal *client; + icaltimezone *timezone; const gchar *uid; source_type = E_CAL_SOURCE_TYPE_TODO; @@ -299,7 +305,17 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar, G_CALLBACK (task_shell_sidebar_default_opened_cb), task_shell_sidebar); - e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_task_shell_content_get_task_model (E_TASK_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (task_shell_sidebar)))))), NULL); + /* FIXME Sidebar should not be accessing the EShellContent. + * This probably needs to be moved to ETaskShellView. */ + shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + task_shell_content = E_TASK_SHELL_CONTENT (shell_content); + model = e_task_shell_content_get_task_model (task_shell_content); + timezone = e_cal_model_get_timezone (model); + + e_cal_set_default_timezone (client, timezone, NULL); e_cal_open_async (client, FALSE); } @@ -813,11 +829,17 @@ void e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar, ESource *source) { + EShellView *shell_view; + EShellContent *shell_content; + EShellSidebar *shell_sidebar; + ETaskShellContent *task_shell_content; ECalSourceType source_type; ESourceSelector *selector; GHashTable *client_table; + ECalModel *model; ECal *default_client; ECal *client; + icaltimezone *timezone; const gchar *uid; const gchar *uri; gchar *message; @@ -876,7 +898,17 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar, G_CALLBACK (task_shell_sidebar_client_opened_cb), task_shell_sidebar); - e_cal_set_default_timezone (client, e_cal_model_get_timezone (e_task_shell_content_get_task_model (E_TASK_SHELL_CONTENT (e_shell_view_get_shell_content (e_shell_sidebar_get_shell_view (E_SHELL_SIDEBAR (task_shell_sidebar)))))), NULL); + /* FIXME Sidebar should not be accessing the EShellContent. + * This probably needs to be moved to ETaskShellView. */ + shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); + shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); + + task_shell_content = E_TASK_SHELL_CONTENT (shell_content); + model = e_task_shell_content_get_task_model (task_shell_content); + timezone = e_cal_model_get_timezone (model); + + e_cal_set_default_timezone (client, timezone, NULL); e_cal_open_async (client, FALSE); } diff --git a/modules/connman/evolution-connman.c b/modules/connman/evolution-connman.c index c55d09c54a..03be9f74ab 100644 --- a/modules/connman/evolution-connman.c +++ b/modules/connman/evolution-connman.c @@ -51,7 +51,7 @@ static gboolean network_manager_connect (EConnMan *extension); G_DEFINE_DYNAMIC_TYPE (EConnMan, e_connman, E_TYPE_EXTENSION) static void -extension_set_state (EConnMan *extension, const char *state) +extension_set_state (EConnMan *extension, const gchar *state) { EExtensible *extensible; @@ -66,7 +66,7 @@ connman_monitor (DBusConnection *connection G_GNUC_UNUSED, DBusMessage *message, gpointer user_data) { - char *value; + gchar *value; EConnMan *extension = user_data; DBusError error = DBUS_ERROR_INIT; DBusHandlerResult ret = DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -98,7 +98,7 @@ connman_check_initial_state (EConnMan *extension) extension->connection, message, 100, &error); if (response != NULL) { - const char *value; + const gchar *value; if (dbus_message_get_args (message, &error, DBUS_TYPE_STRING, &value, DBUS_TYPE_INVALID)) diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index a5ec67d4c4..491d5068d7 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -178,12 +178,12 @@ mail_shell_sidebar_constructed (GObject *object) shell_sidebar); } -static int +static gint guess_screen_width (EMailShellSidebar *sidebar) { GtkWidget *widget; GdkScreen *screen; - int screen_width; + gint screen_width; widget = GTK_WIDGET (sidebar); @@ -192,12 +192,13 @@ guess_screen_width (EMailShellSidebar *sidebar) screen = gtk_widget_get_screen (widget); if (screen) { GtkWidget *toplevel; - int monitor; + gint monitor; GdkRectangle rect; toplevel = gtk_widget_get_toplevel (widget); if (toplevel && gtk_widget_get_realized (toplevel)) - monitor = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (toplevel)); + monitor = gdk_screen_get_monitor_at_window ( + screen, gtk_widget_get_window (toplevel)); else { /* We don't know in which monitor the window manager * will put us. So we will just use the geometry of the @@ -235,16 +236,17 @@ mail_shell_sidebar_size_request (GtkWidget *widget, GtkRequisition *requisition) PangoLayout *layout; PangoRectangle ink_rect; GtkStyle *style; - int border; - int sidebar_width; - int screen_width; + gint border; + gint sidebar_width; + gint screen_width; sidebar = E_MAIL_SHELL_SIDEBAR (widget); GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition); /* This string is a mockup only; it doesn't need to be translated */ - layout = gtk_widget_create_pango_layout (widget, "typical.account@mailservice.com"); + layout = gtk_widget_create_pango_layout ( + widget, "typical.account@mailservice.com"); pango_layout_get_pixel_extents (layout, &ink_rect, NULL); g_object_unref (layout); @@ -252,7 +254,9 @@ mail_shell_sidebar_size_request (GtkWidget *widget, GtkRequisition *requisition) screen_width = guess_screen_width (sidebar); - border = 2 * style->xthickness + 4; /* Thickness of frame shadow plus some slack for padding */ + /* Thickness of frame shadow plus some slack for padding. */ + border = 2 * style->xthickness + 4; + sidebar_width = ink_rect.width + border; sidebar_width = MIN (sidebar_width, screen_width / 4); requisition->width = MAX (requisition->width, sidebar_width); diff --git a/modules/windows-sens/evolution-windows-sens.c b/modules/windows-sens/evolution-windows-sens.c index d228fc02ac..2c58b938a1 100644 --- a/modules/windows-sens/evolution-windows-sens.c +++ b/modules/windows-sens/evolution-windows-sens.c @@ -39,7 +39,7 @@ typedef struct IEnumEventObject IEnumEventObject; const IID IID_IEnumEventObject; typedef struct IEnumEventObjectVtbl { BEGIN_INTERFACE - HRESULT (WINAPI *QueryInterface)(IEnumEventObject *This,REFIID riid,void **ppvObject); + HRESULT (WINAPI *QueryInterface)(IEnumEventObject *This,REFIID riid,gpointer *ppvObject); ULONG (WINAPI *AddRef)(IEnumEventObject *This); ULONG (WINAPI *Release)(IEnumEventObject *This); HRESULT (WINAPI *Clone)(IEnumEventObject *This,IEnumEventObject **ppInterface); @@ -57,7 +57,7 @@ typedef struct IEventObjectCollection IEventObjectCollection; const IID IID_IEventObjectCollection; typedef struct IEventObjectCollectionVtbl { BEGIN_INTERFACE - HRESULT (WINAPI *QueryInterface)(IEventObjectCollection *This,REFIID riid,void **ppvObject); + HRESULT (WINAPI *QueryInterface)(IEventObjectCollection *This,REFIID riid,gpointer *ppvObject); ULONG (WINAPI *AddRef)(IEventObjectCollection *This); ULONG (WINAPI *Release)(IEventObjectCollection *This); HRESULT (WINAPI *GetTypeInfoCount)(IEventObjectCollection *This,UINT *pctinfo); @@ -76,13 +76,12 @@ struct IEventObjectCollection { CONST_VTBL struct IEventObjectCollectionVtbl *lpVtbl; }; - typedef struct IEventSystem IEventSystem; const IID IID_IEventSystem; typedef struct IEventSystemVtbl { BEGIN_INTERFACE - HRESULT (WINAPI *QueryInterface)(IEventSystem *This,REFIID riid,void **ppvObject); + HRESULT (WINAPI *QueryInterface)(IEventSystem *This,REFIID riid,gpointer *ppvObject); ULONG (WINAPI *AddRef)(IEventSystem *This); ULONG (WINAPI *Release)(IEventSystem *This); HRESULT (WINAPI *GetTypeInfoCount)(IEventSystem *This,UINT *pctinfo); @@ -106,7 +105,7 @@ typedef struct IEventSubscription IEventSubscription; const IID IID_IEventSubscription; typedef struct IEventSubscriptionVtbl { BEGIN_INTERFACE - HRESULT (WINAPI *QueryInterface)(IEventSubscription *This,REFIID riid,void **ppvObject); + HRESULT (WINAPI *QueryInterface)(IEventSubscription *This,REFIID riid,gpointer *ppvObject); ULONG (WINAPI *AddRef)(IEventSubscription *This); ULONG (WINAPI *Release)(IEventSubscription *This); HRESULT (WINAPI *GetTypeInfoCount)(IEventSubscription *This,UINT *pctinfo); @@ -175,7 +174,7 @@ typedef struct ISensNetwork ISensNetwork; const IID IID_ISensNetwork; typedef struct ISensNetworkVtbl { BEGIN_INTERFACE - HRESULT (WINAPI *QueryInterface)(ISensNetwork *This,REFIID riid,void **ppvObject); + HRESULT (WINAPI *QueryInterface)(ISensNetwork *This,REFIID riid,gpointer *ppvObject); ULONG (WINAPI *AddRef)(ISensNetwork *This); ULONG (WINAPI *Release)(ISensNetwork *This); HRESULT (WINAPI *GetTypeInfoCount)(ISensNetwork *This,UINT *pctinfo); @@ -213,7 +212,6 @@ DEFINE_GUID(CLSID_CEventSystem, 0x4E14FBA2, 0x2E22, 0x11D1, 0x99, 0x64, 0x00, 0x /* 7542e960-79c7-11d1-88f9-0080c7d771bf */ DEFINE_GUID(CLSID_CEventSubscription, 0x7542e960, 0x79c7, 0x11d1, 0x88, 0xf9, 0x00, 0x80, 0xc7, 0xd7, 0x71, 0xbf); - /* Standard GObject macros */ #define E_TYPE_WINDOWS_SENS \ (e_windows_sens_get_type ()) @@ -263,7 +261,7 @@ static void e_sens_network_listener_init(ESensNetworkListener**,EWindowsSENS*); /* Functions to implement ISensNetwork interface */ -static HRESULT WINAPI e_sens_network_listener_queryinterface (ISensNetwork*,REFIID,void**); +static HRESULT WINAPI e_sens_network_listener_queryinterface (ISensNetwork*,REFIID,gpointer *); static ULONG WINAPI e_sens_network_listener_addref (ISensNetwork*); static ULONG WINAPI e_sens_network_listener_release (ISensNetwork*); static HRESULT WINAPI e_sens_network_listener_gettypeinfocount (ISensNetwork*, UINT*); @@ -293,7 +291,6 @@ static ISensNetworkVtbl ESensNetworkListenerVtbl = { e_sens_network_listener_destinationreachablenoqocinfo }; - static HRESULT WINAPI e_sens_network_listener_queryinterface (ISensNetwork *This, REFIID iid, @@ -381,7 +378,7 @@ e_sens_network_listener_connectionmade (ISensNetwork *This, } static HRESULT WINAPI -e_sens_network_listener_connectionmadenoqocinfo (ISensNetwork *This, +e_sens_network_listener_connectionmadenoqocinfo (ISensNetwork *This, BSTR bstrConnection, ULONG ulType) { @@ -438,19 +435,18 @@ e_sens_network_listener_init(ESensNetworkListener **esnl_ptr, (*esnl_ptr)->ref = 1; } - static BSTR -_mb2wchar (const char* a) +_mb2wchar (const gchar * a) { static WCHAR b[64]; MultiByteToWideChar (0, 0, a, -1, b, 64); return b; } -static const char* add_curly_braces_to_uuid (const char* string_uuid) +static const gchar * add_curly_braces_to_uuid (const gchar * string_uuid) { - static char curly_braced_uuid_string[64]; - int i; + static gchar curly_braced_uuid_string[64]; + gint i; if (!string_uuid) return NULL; lstrcpy(curly_braced_uuid_string,"{"); @@ -459,8 +455,8 @@ static const char* add_curly_braces_to_uuid (const char* string_uuid) i = strlen(curly_braced_uuid_string); lstrcat(curly_braced_uuid_string+i,"}"); return curly_braced_uuid_string; -} - +} + static void windows_sens_constructed (GObject *object) { @@ -468,22 +464,22 @@ windows_sens_constructed (GObject *object) static IEventSystem *pEventSystem =0; static IEventSubscription* pEventSubscription = 0; static ESensNetworkListener *pESensNetworkListener = 0; - static const char* eventclassid="{D5978620-5B9F-11D1-8DD2-00AA004ABD5E}"; - static const char* methods[]={ + static const gchar * eventclassid="{D5978620-5B9F-11D1-8DD2-00AA004ABD5E}"; + static const gchar * methods[]={ "ConnectionMade", "ConnectionMadeNoQOCInfo", "ConnectionLost", "DestinationReachable", "DestinationReachableNoQOCInfo" }; - static const char* names[]={ + static const gchar * names[]={ "EWS_ConnectionMade", "EWS_ConnectionMadeNoQOCInfo", "EWS_ConnectionLost", "EWS_DestinationReachable", "EWS_DestinationReachableNoQOCInfo" }; - unsigned char* subids[] = { 0, 0, 0, 0, 0 }; + guchar * subids[] = { 0, 0, 0, 0, 0 }; EWindowsSENS *extension = (E_WINDOWS_SENS (object)); e_sens_network_listener_init(&pESensNetworkListener, extension); @@ -504,7 +500,7 @@ windows_sens_constructed (GObject *object) UUID tmp_uuid; UuidCreate(&tmp_uuid); UuidToString(&tmp_uuid, &subids[i]); - res=pEventSubscription->lpVtbl->put_SubscriptionID (pEventSubscription, _mb2wchar (add_curly_braces_to_uuid ((char*)subids[i]))); + res=pEventSubscription->lpVtbl->put_SubscriptionID (pEventSubscription, _mb2wchar (add_curly_braces_to_uuid ((gchar *)subids[i]))); if (res) { RpcStringFree (&subids[i]); break; @@ -540,7 +536,7 @@ windows_sens_constructed (GObject *object) if (pEventSubscription) pEventSubscription->lpVtbl->Release(pEventSubscription); } - + /* Do not try to get initial state when we are sure we will not get system events. * Like that we don't get stuck with Disconnected status if we were disconnected * on start. |