diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-25 22:15:32 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-25 22:15:32 +0800 |
commit | 96538878911586a9e9ca26b81e1916c04e538980 (patch) | |
tree | ffcfe184bab289d6917a65d850bc4ba310be0447 /modules | |
parent | 3e1b34841d3a699f77848f5de019f18ccb2d1ca1 (diff) | |
download | gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.tar gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.tar.gz gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.tar.bz2 gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.tar.lz gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.tar.xz gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.tar.zst gsoc2013-evolution-96538878911586a9e9ca26b81e1916c04e538980.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/calendar/e-cal-shell-content.c | 8 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 8 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 2 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view-private.c | 23 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view.c | 12 | ||||
-rw-r--r-- | modules/connman/evolution-connman.c | 6 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-sidebar.c | 46 | ||||
-rw-r--r-- | modules/windows-sens/evolution-windows-sens.c | 42 |
8 files changed, 74 insertions, 73 deletions
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index bf812f521f..99fb717c90 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)) @@ -348,7 +348,7 @@ cal_shell_content_constructed (GObject *object) 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 +356,7 @@ cal_shell_content_constructed (GObject *object) /* Build content widgets. */ container = GTK_WIDGET (object); - + if (!e_shell_get_express_mode (shell)) { widget = e_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_container_add (GTK_CONTAINER (container), widget); @@ -556,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 546d21b3c3..4545c88c3a 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -560,10 +560,10 @@ cal_shell_sidebar_finalize (GObject *object) } static void -new_calendar_clicked (GtkButton *button, +new_calendar_clicked (GtkButton *button, EShellSidebar *shell_sidebar) { - EShellView *shell_view; + EShellView *shell_view; EShellWindow *shell_window; EShellBackend *shell_backend; @@ -571,7 +571,7 @@ new_calendar_clicked (GtkButton *button, shell_backend = e_shell_view_get_shell_backend (shell_view); shell_window = e_shell_view_get_shell_window (shell_view); - calendar_setup_new_calendar (GTK_WINDOW (shell_window)); + calendar_setup_new_calendar (GTK_WINDOW (shell_window)); } static void @@ -621,7 +621,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(e_shell_get_default())) { gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE); } else { GtkWidget *button; diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 83f6101d0a..9510f066ef 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -1715,7 +1715,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 a958a9f05e..43b8ae61cd 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -436,7 +436,6 @@ e_cal_shell_view_private_init (ECalShellView *cal_shell_view, G_CALLBACK (cal_shell_view_notify_view_id_cb), NULL); } - static void system_timezone_monitor_changed (GFileMonitor *handle, GFile *file, @@ -453,12 +452,12 @@ system_timezone_monitor_changed (GFileMonitor *handle, EShell *shell; ECalModel *model; const gchar *location; - - if (event != G_FILE_MONITOR_EVENT_CHANGED && - event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT && - event != G_FILE_MONITOR_EVENT_DELETED && - event != G_FILE_MONITOR_EVENT_CREATED) - return; + + if (event != G_FILE_MONITOR_EVENT_CHANGED && + event != G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT && + event != G_FILE_MONITOR_EVENT_DELETED && + event != G_FILE_MONITOR_EVENT_CREATED) + return; cal_shell_content = priv->cal_shell_content; model = e_cal_shell_content_get_model (cal_shell_content); @@ -474,7 +473,7 @@ system_timezone_monitor_changed (GFileMonitor *handle, location = icaltimezone_get_location (timezone); if (location == NULL) location = "UTC"; - + g_object_set (settings, "cal-timezone-string", location, NULL); g_object_set (settings, "cal-timezone", timezone, NULL); } @@ -496,7 +495,7 @@ init_timezone_monitors (ECalShellView *view) if (priv->monitors[i]) g_signal_connect (G_OBJECT (priv->monitors[i]), - "changed", + "changed", G_CALLBACK (system_timezone_monitor_changed), view); } @@ -621,7 +620,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), @@ -650,7 +649,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", @@ -1081,7 +1080,7 @@ e_cal_shell_view_update_timezone (ECalShellView *cal_shell_view) cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar; clients = e_cal_shell_sidebar_get_clients (cal_shell_sidebar); - + for (iter = clients; iter != NULL; iter = iter->next) { ECal *client = iter->data; diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 1f719e82c5..c4f52de83a 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -304,25 +304,25 @@ 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; - /* 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"); if (item) - gtk_widget_hide(item); + gtk_widget_hide(item); } cal_shell_content = priv->cal_shell_content; calendar = e_cal_shell_content_get_calendar (cal_shell_content); @@ -497,7 +497,7 @@ 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; -} +} static void cal_shell_view_init (ECalShellView *cal_shell_view, diff --git a/modules/connman/evolution-connman.c b/modules/connman/evolution-connman.c index abf532f295..6a302889a4 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; @@ -103,7 +103,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 ebe72bf629..9b3c2fedd0 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,7 +192,7 @@ 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); @@ -201,11 +201,12 @@ guess_screen_width (EMailShellSidebar *sidebar) #else if (toplevel && GTK_WIDGET_REALIZED (toplevel)) #endif - 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 - * first monitor. + * will put us. So we will just use the geometry of + * the first monitor. */ monitor = 0; } @@ -221,34 +222,38 @@ guess_screen_width (EMailShellSidebar *sidebar) } static void -mail_shell_sidebar_size_request (GtkWidget *widget, GtkRequisition *requisition) +mail_shell_sidebar_size_request (GtkWidget *widget, + GtkRequisition *requisition) { /* We override the normal size-request handler so that we can - * spit out a treeview with a suitable width. We measure the length - * of a typical string and use that as the requisition's width. + * spit out a treeview with a suitable width. We measure the + * length of a typical string and use that as the requisition's + * width. * - * EMFolderTreeClass, our parent class, is based on GtkTreeView, which - * doesn't really have a good way of figuring out a minimum width for - * the tree. This is really GTK+'s fault at large, as it only has - * "minimum size / allocated size", instead of "minimum size / preferred - * size / allocated size". Hopefully the extended-layout branch of GTK+ - * will get merged soon and then we can remove this crap. + * EMFolderTreeClass, our parent class, is based on GtkTreeView, + * which doesn't really have a good way of figuring out a minimum + * width for the tree. This is really GTK+'s fault at large, as + * it only has "minimum size / allocated size", instead of + * "minimum size / preferred size / allocated size". Hopefully + * the extended-layout branch of GTK+ will get merged soon and + * then we can remove this crap. */ EMailShellSidebar *sidebar; 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); @@ -256,7 +261,8 @@ 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. |