diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-11-10 11:40:00 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-11-11 04:54:43 +0800 |
commit | 2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch) | |
tree | c34f0cbb7c500ff70f10fce846631b0a948b341c /plugins/publish-calendar | |
parent | 583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff) | |
download | gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'plugins/publish-calendar')
-rw-r--r-- | plugins/publish-calendar/publish-calendar.c | 76 | ||||
-rw-r--r-- | plugins/publish-calendar/url-editor-dialog.c | 13 |
2 files changed, 53 insertions, 36 deletions
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index ab3e36dd6d..9a06c45b38 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -182,9 +182,10 @@ publish_uri_async (EPublishUri *uri) GThread *thread = NULL; GError *error = NULL; - thread = g_thread_try_new (NULL, (GThreadFunc) publish_no_succ_info, uri, &error); - if (!thread) { - g_warning (G_STRLOC ": %s", error ? error->message : "Unknown error"); + thread = g_thread_try_new ( + NULL, (GThreadFunc) publish_no_succ_info, uri, &error); + if (error != NULL) { + g_warning (G_STRLOC ": %s", error->message); g_error_free (error); } else { g_thread_unref (thread); @@ -328,16 +329,21 @@ ask_password (GMountOperation *op, username = soup_uri_get_user (soup_uri); password = e_passwords_get_password (NULL, ms->uri->location); - req_pass = ((username && *username) && !(ms->uri->service_type == TYPE_ANON_FTP && - !strcmp (username, "anonymous"))) ? TRUE : FALSE; + req_pass = + ((username && *username) && + !(ms->uri->service_type == TYPE_ANON_FTP && + !strcmp (username, "anonymous"))); if (!password && req_pass) { gboolean remember = FALSE; - password = e_passwords_ask_password (_("Enter password"), NULL, ms->uri->location, message, - E_PASSWORDS_REMEMBER_FOREVER | E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE, - &remember, - NULL); + password = e_passwords_ask_password ( + _("Enter password"), NULL, + ms->uri->location, message, + E_PASSWORDS_REMEMBER_FOREVER | + E_PASSWORDS_SECRET | + E_PASSWORDS_ONLINE, + &remember, NULL); if (!password) { /* user canceled password dialog */ @@ -379,9 +385,10 @@ ask_question (GMountOperation *op, primary = g_strndup (message, strlen (message) - strlen (primary)); } - dialog = gtk_message_dialog_new (NULL, - 0, GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, "%s", primary); + dialog = gtk_message_dialog_new ( + NULL, + 0, GTK_MESSAGE_QUESTION, + GTK_BUTTONS_NONE, "%s", primary); g_free (primary); if (secondary) { @@ -728,10 +735,11 @@ url_edit_clicked (GtkButton *button, url_editor = url_editor_dialog_new (model, uri); if (url_editor_dialog_run ((UrlEditorDialog *) url_editor)) { - gtk_list_store_set (GTK_LIST_STORE (model), &iter, - URL_LIST_ENABLED_COLUMN, uri->enabled, - URL_LIST_LOCATION_COLUMN, uri->location, - URL_LIST_URL_COLUMN, uri, -1); + gtk_list_store_set ( + GTK_LIST_STORE (model), &iter, + URL_LIST_ENABLED_COLUMN, uri->enabled, + URL_LIST_LOCATION_COLUMN, uri->location, + URL_LIST_URL_COLUMN, uri, -1); id = GPOINTER_TO_UINT (g_hash_table_lookup (uri_timeouts, uri)); if (id) @@ -771,9 +779,10 @@ url_remove_clicked (GtkButton *button, gtk_tree_model_get (model, &iter, URL_LIST_URL_COLUMN, &url, -1); - confirm = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - _("Are you sure you want to remove this location?")); + confirm = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, + _("Are you sure you want to remove this location?")); gtk_dialog_add_button (GTK_DIALOG (confirm), GTK_STOCK_CANCEL, GTK_RESPONSE_NO); gtk_dialog_add_button (GTK_DIALOG (confirm), GTK_STOCK_REMOVE, GTK_RESPONSE_YES); gtk_dialog_set_default_response (GTK_DIALOG (confirm), GTK_RESPONSE_CANCEL); @@ -863,14 +872,16 @@ publish_calendar_locations (EPlugin *epl, renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "activatable", TRUE, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Enabled"), - renderer, "active", URL_LIST_ENABLED_COLUMN, NULL); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (ui->treeview), -1, _("Enabled"), + renderer, "active", URL_LIST_ENABLED_COLUMN, NULL); g_signal_connect ( renderer, "toggled", G_CALLBACK (url_list_enable_toggled), ui); renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ui->treeview), -1, _("Location"), - renderer, "text", URL_LIST_LOCATION_COLUMN, NULL); + gtk_tree_view_insert_column_with_attributes ( + GTK_TREE_VIEW (ui->treeview), -1, _("Location"), + renderer, "text", URL_LIST_LOCATION_COLUMN, NULL); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ui->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); g_signal_connect ( @@ -910,10 +921,11 @@ publish_calendar_locations (EPlugin *epl, EPublishUri *url = (EPublishUri *) l->data; gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, - URL_LIST_ENABLED_COLUMN, url->enabled, - URL_LIST_LOCATION_COLUMN, url->location, - URL_LIST_URL_COLUMN, url, -1); + gtk_list_store_set ( + store, &iter, + URL_LIST_ENABLED_COLUMN, url->enabled, + URL_LIST_LOCATION_COLUMN, url->location, + URL_LIST_URL_COLUMN, url, -1); l = g_slist_next (l); } @@ -995,9 +1007,13 @@ e_plugin_lib_enable (EPlugin *ep, uris = g_settings_get_strv (settings, PC_SETTINGS_URIS); g_object_unref (settings); - thread = g_thread_try_new (NULL, (GThreadFunc) publish_uris_set_timeout, uris, &error); - if (!thread) { - g_warning ("Could create thread to set timeout for publishing uris : %s", error ? error->message : "Unknown error"); + thread = g_thread_try_new ( + NULL, (GThreadFunc) + publish_uris_set_timeout, uris, &error); + if (error != NULL) { + g_warning ( + "Could create thread to set timeout " + "for publishing uris : %s", error->message); g_error_free (error); } else { g_thread_unref (thread); diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 3e97756d03..5f8a68e693 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -87,12 +87,13 @@ create_uri (UrlEditorDialog *dialog) if (uri->location) g_free (uri->location); - uri->location = g_strdup_printf ("%s://%s%s%s%s%s%s%s", - method, - username, (username[0] != '\0') ? "@" : "", - server, - (port[0] != '\0') ? ":" : "", port, - (file[0] != '/') ? "/" : "", file); + uri->location = g_strdup_printf ( + "%s://%s%s%s%s%s%s%s", + method, + username, (username[0] != '\0') ? "@" : "", + server, + (port[0] != '\0') ? ":" : "", port, + (file[0] != '/') ? "/" : "", file); g_free (server); g_free (file); |