diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-09-11 23:50:51 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-09-12 02:14:04 +0800 |
commit | ebcce86769d174cce6e881740c5e9bcedce28e06 (patch) | |
tree | b2cc2d18ceb0c3bd3e78f5b768c1b6926b69bb4a /plugins | |
parent | 1e3deb31476cf0026011876327be83e9a47847ee (diff) | |
download | gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.gz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.zst gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/attachment-reminder/attachment-reminder.c | 2 | ||||
-rw-r--r-- | plugins/bbdb/gaimbuddies.c | 2 | ||||
-rw-r--r-- | plugins/caldav/caldav-browse-server.c | 6 | ||||
-rw-r--r-- | plugins/calendar-file/calendar-file.c | 4 | ||||
-rw-r--r-- | plugins/calendar-weather/calendar-weather.c | 2 | ||||
-rw-r--r-- | plugins/face/face.c | 2 | ||||
-rw-r--r-- | plugins/groupwise-features/camel-gw-listener.c | 2 | ||||
-rw-r--r-- | plugins/groupwise-features/install-shared.c | 2 | ||||
-rw-r--r-- | plugins/groupwise-features/mail-send-options.c | 2 | ||||
-rw-r--r-- | plugins/groupwise-features/send-options.c | 28 | ||||
-rw-r--r-- | plugins/groupwise-features/share-folder-common.c | 2 | ||||
-rw-r--r-- | plugins/groupwise-features/status-track.c | 2 | ||||
-rw-r--r-- | plugins/pst-import/pst-importer.c | 2 | ||||
-rw-r--r-- | plugins/sa-junk-plugin/em-junk-filter.c | 56 |
14 files changed, 62 insertions, 52 deletions
diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 99f8f080d8..f93467b8de 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -189,7 +189,7 @@ strip_text_msg (gchar *msg) gchar *temp; /* Note : HTML Signatures won't work. Depends on Bug #522784 */ - while (lines [i] && g_strcmp0 (lines[i], SIGNATURE)) { + while (lines[i] && g_strcmp0 (lines[i], SIGNATURE)) { if (!g_str_has_prefix (g_strstrip(lines[i]), ">")) { temp = stripped_msg; diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index df5e4c3695..ebafc85f7a 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -531,7 +531,7 @@ get_buddy_icon_from_setting (xmlNodePtr setting) gchar *icon = NULL; icon = get_node_text (setting); - if (icon [0] != '/') { + if (icon[0] != '/') { gchar *path; path = g_build_path ("/", g_get_home_dir (), ".purple/icons", icon, NULL); diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index 8b2d1ae0e4..e7d6140646 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -271,18 +271,18 @@ add_collection_node_to_tree (GtkTreeStore *store, GtkTreeIter *parent_iter, cons /* pick the last non-empty path part */ gint idx = 0; - while (tmp [idx]) { + while (tmp[idx]) { idx++; } idx--; - while (idx >= 0 && !tmp [idx][0]) { + while (idx >= 0 && !tmp[idx][0]) { idx--; } if (idx >= 0) - path = tmp [idx]; + path = tmp[idx]; } displayname = soup_uri_decode (path); diff --git a/plugins/calendar-file/calendar-file.c b/plugins/calendar-file/calendar-file.c index d46f1a9dc6..7ab2a13259 100644 --- a/plugins/calendar-file/calendar-file.c +++ b/plugins/calendar-file/calendar-file.c @@ -91,7 +91,7 @@ refresh_type_changed (GtkComboBox *refresh_type, ESource *source) gtk_widget_hide (refresh_hbox); } - buff [0] = '0' + active; + buff[0] = '0' + active; e_source_set_property (source, "refresh-type", buff); } @@ -200,7 +200,7 @@ e_calendar_file_customs (EPlugin *epl, EConfigHookItemFactoryData *data) gtk_box_pack_start ((GtkBox *)box2, w2, FALSE, TRUE, 2); value = e_source_get_property (source, "refresh-type"); - gtk_combo_box_set_active ((GtkComboBox *)w2, (value && *value && !value[1] && value [0] >= '0' && value [0] <= '2') ? value [0] - '0' : 0); + gtk_combo_box_set_active ((GtkComboBox *)w2, (value && *value && !value[1] && value[0] >= '0' && value[0] <= '2') ? value[0] - '0' : 0); w1 = w2; w2 = e_plugin_util_add_refresh (NULL, NULL, source, "refresh"); diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c index 61180b7153..970bdf4f8b 100644 --- a/plugins/calendar-weather/calendar-weather.c +++ b/plugins/calendar-weather/calendar-weather.c @@ -69,7 +69,7 @@ e_plugin_lib_enable (EPlugin *epl, gint enable) { NULL, NULL } }; - tmp = _(categories [0].description); + tmp = _(categories[0].description); /* Add the categories icons if we don't have them. */ for (l = e_categories_get_list (); l; l = g_list_next (l)) { diff --git a/plugins/face/face.c b/plugins/face/face.c index 468b9273c9..2013f7dac6 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -75,7 +75,7 @@ get_face_base64 (void) if (g_file_get_contents (filename, &file_contents, &length, NULL)) { if (length > 0) { file_contents = g_realloc (file_contents, length + 1); - file_contents [length] = 0; + file_contents[length] = 0; } else { g_free (file_contents); file_contents = NULL; diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c index 3539d253cd..308ed517c9 100644 --- a/plugins/groupwise-features/camel-gw-listener.c +++ b/plugins/groupwise-features/camel-gw-listener.c @@ -940,7 +940,7 @@ prune_proxies (void) { GError *err = NULL; const gchar *parent_id_name = NULL; gint i; - ECalSourceType types [] = { E_CAL_SOURCE_TYPE_EVENT, + ECalSourceType types[] = { E_CAL_SOURCE_TYPE_EVENT, E_CAL_SOURCE_TYPE_TODO, E_CAL_SOURCE_TYPE_JOURNAL }; diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 55a3fb1664..db906e6952 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -82,7 +82,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) folder_name = (gchar *)path; parent_name = NULL; } else { - while (names [parts]) + while (names[parts]) parts++; folder_name = names[parts -1]; if (parts >= 2) diff --git a/plugins/groupwise-features/mail-send-options.c b/plugins/groupwise-features/mail-send-options.c index fb0a3bda14..63bbbe7c9b 100644 --- a/plugins/groupwise-features/mail-send-options.c +++ b/plugins/groupwise-features/mail-send-options.c @@ -62,7 +62,7 @@ static void feed_input_data(ESendOptionsDialog * dialog, gint state, gpointer data) { EMsgComposer *comp; - gchar value [100]; + gchar value[100]; gchar *temp = NULL; comp = (EMsgComposer *) data; diff --git a/plugins/groupwise-features/send-options.c b/plugins/groupwise-features/send-options.c index 8d9c102b63..a3c08ca90c 100644 --- a/plugins/groupwise-features/send-options.c +++ b/plugins/groupwise-features/send-options.c @@ -102,7 +102,8 @@ get_cnc (GtkWindow *parent_window) } static void -e_send_options_load_general_opts (ESendOptionsGeneral *gopts, EGwSendOptionsGeneral *ggopts) +e_send_options_load_general_opts (ESendOptionsGeneral *gopts, + EGwSendOptionsGeneral *ggopts) { time_t temp; @@ -127,7 +128,8 @@ e_send_options_load_general_opts (ESendOptionsGeneral *gopts, EGwSendOptionsGene } static void -e_send_options_load_status_options (ESendOptionsStatusTracking *sopts, EGwSendOptionsStatusTracking *gsopts) +e_send_options_load_status_options (ESendOptionsStatusTracking *sopts, + EGwSendOptionsStatusTracking *gsopts) { sopts->tracking_enabled = gsopts->tracking_enabled; sopts->track_when = gsopts->track_when; @@ -251,7 +253,8 @@ send_options_finalize (void) } static void -e_send_options_copy_general_opts (ESendOptionsGeneral *gopts, EGwSendOptionsGeneral *ggopts) +e_send_options_copy_general_opts (ESendOptionsGeneral *gopts, + EGwSendOptionsGeneral *ggopts) { ggopts->priority = gopts->priority; @@ -282,7 +285,8 @@ e_send_options_copy_general_opts (ESendOptionsGeneral *gopts, EGwSendOptionsGene } static void -e_send_options_copy_status_options (ESendOptionsStatusTracking *sopts, EGwSendOptionsStatusTracking *gsopts) +e_send_options_copy_status_options (ESendOptionsStatusTracking *sopts, + EGwSendOptionsStatusTracking *gsopts) { gsopts->tracking_enabled = sopts->tracking_enabled; gsopts->track_when = sopts->track_when; @@ -296,7 +300,8 @@ e_send_options_copy_status_options (ESendOptionsStatusTracking *sopts, EGwSendOp } static gboolean -check_status_options_changed (EGwSendOptionsStatusTracking *n_sopts, EGwSendOptionsStatusTracking *o_sopts) +check_status_options_changed (EGwSendOptionsStatusTracking *n_sopts, + EGwSendOptionsStatusTracking *o_sopts) { return (!(n_sopts->tracking_enabled == o_sopts->tracking_enabled && n_sopts->track_when == o_sopts->track_when @@ -309,7 +314,8 @@ check_status_options_changed (EGwSendOptionsStatusTracking *n_sopts, EGwSendOpti } static gboolean -check_general_changed (EGwSendOptionsGeneral *n_gopts, EGwSendOptionsGeneral *o_gopts) +check_general_changed (EGwSendOptionsGeneral *n_gopts, + EGwSendOptionsGeneral *o_gopts) { return (!(n_gopts->priority == o_gopts->priority && n_gopts->delay_enabled == o_gopts->delay_enabled @@ -359,7 +365,7 @@ get_source (ESourceList *list) { GSList *p, *l; gchar **temp = g_strsplit (account->source->url, ";", -1); - gchar *uri = temp [0]; + gchar *uri = temp[0]; l = e_source_list_peek_groups (list); @@ -409,7 +415,9 @@ add_return_value (EGwSendOptionsReturnNotify track, } static void -put_options_in_source (ESource *source, EGwSendOptionsGeneral *gopts, EGwSendOptionsStatusTracking *sopts) +put_options_in_source (ESource *source, + EGwSendOptionsGeneral *gopts, + EGwSendOptionsStatusTracking *sopts) { gchar *value; const gchar *val; @@ -534,7 +542,9 @@ send_options_commit (EPlugin *epl, EConfigHookItemFactoryData *data) status = e_gw_connection_modify_settings (n_cnc, n_opts); if (!changed || status != E_GW_CONNECTION_STATUS_OK) { - g_warning (G_STRLOC "Cannot modify Send Options: %s", e_gw_connection_get_error_message (status)); + g_warning ( + G_STRLOC "Cannot modify Send Options: %s", + e_gw_connection_get_error_message (status)); g_object_unref (n_opts); n_opts = NULL; } else diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 532316599c..2fb7a12b6e 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -469,7 +469,7 @@ get_container_id(EGwConnection *cnc, const gchar *fname) names = g_strsplit (fname, "/", -1); if (names) { - while (names [parts]) + while (names[parts]) parts++; fname = names[i]; } diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c index 83ecf6c1bf..d350ef08ee 100644 --- a/plugins/groupwise-features/status-track.c +++ b/plugins/groupwise-features/status-track.c @@ -50,7 +50,7 @@ format_date (const gchar * value) time = e_gw_connection_get_date_from_string (value); str = ctime (&time); - str [strlen(str)-1] = '\0'; + str[strlen(str)-1] = '\0'; return str; } diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 13a4868fa9..4b913744cc 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -103,7 +103,7 @@ GtkWidget *em_folder_selection_button_new (const gchar *title, const gchar *capt void em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const gchar *uri); const gchar *em_folder_selection_button_get_selection (EMFolderSelectionButton *button); -static guchar pst_signature [] = { '!', 'B', 'D', 'N' }; +static guchar pst_signature[] = { '!', 'B', 'D', 'N' }; struct _PstImporter { MailMsg base; diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index 9918fa0967..0b33453ff3 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -86,7 +86,7 @@ static const gchar *em_junk_sa_spamc_binaries [4] = {"spamc", "/usr/bin/spamc", static const gchar *em_junk_sa_spamd_binaries [4] = {"spamd", "/usr/bin/spamd", "/usr/sbin/spamd", NULL}; #define SPAMD_RESTARTS_SIZE 8 -static time_t em_junk_sa_spamd_restarts [SPAMD_RESTARTS_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0}; +static time_t em_junk_sa_spamd_restarts[SPAMD_RESTARTS_SIZE] = {0, 0, 0, 0, 0, 0, 0, 0}; static gint em_junk_sa_spamd_restarts_count = 0; /* Variables to indicate whether spamd is running with --allow-tell */ @@ -115,7 +115,7 @@ pipe_to_sa_full (CamelMimeMessage *msg, const gchar *in, const gchar **argv, gin camel_debug_end (); } - program = g_find_program_in_path (argv [0]); + program = g_find_program_in_path (argv[0]); if (program == NULL) { d(printf ("program not found, returning %d\n", rv_err)); g_set_error (error, EM_JUNK_ERROR, rv_err, _("SpamAssassin not found, code: %d"), rv_err); @@ -135,8 +135,8 @@ pipe_to_sa_full (CamelMimeMessage *msg, const gchar *in, const gchar **argv, gin errnosav = errno; d(printf ("failed to create a pipe (for use with SpamAssassin: %s\n", g_strerror (errno))); g_set_error (error, EM_JUNK_ERROR, errnosav, _("Failed to create pipe: %s"), g_strerror (errnosav)); - close (fds [0]); - close (fds [1]); + close (fds[0]); + close (fds[1]); errno = errnosav; return rv_err; } @@ -152,9 +152,9 @@ pipe_to_sa_full (CamelMimeMessage *msg, const gchar *in, const gchar **argv, gin (output_buffer == NULL && dup2 (nullfd, STDOUT_FILENO) == -1) || (output_buffer != NULL && dup2 (out_fds[1], STDOUT_FILENO) == -1)) _exit (rv_err & 0377); - close (fds [0]); + close (fds[0]); if (output_buffer) - close (out_fds [1]); + close (out_fds[1]); setsid (); @@ -169,8 +169,8 @@ pipe_to_sa_full (CamelMimeMessage *msg, const gchar *in, const gchar **argv, gin close (fds[0]); close (fds[1]); if (output_buffer) { - close (out_fds [0]); - close (out_fds [1]); + close (out_fds[0]); + close (out_fds[1]); } if (errnosav != 0 && errnosav != -1) g_set_error (error, EM_JUNK_ERROR, errnosav, _("Error after fork: %s"), g_strerror (errnosav)); @@ -181,7 +181,7 @@ pipe_to_sa_full (CamelMimeMessage *msg, const gchar *in, const gchar **argv, gin /* parent process */ close (fds[0]); if (output_buffer) - close (out_fds [1]); + close (out_fds[1]); if (msg) { stream = camel_stream_fs_new_with_fd (fds[1]); @@ -300,7 +300,7 @@ em_junk_sa_test_spamd_running (const gchar *binary, gboolean system) static void em_junk_sa_test_allow_tell (void) { - const gchar *argv [4] = { + const gchar *argv[4] = { "spamc", "-L", "forget", @@ -314,7 +314,7 @@ em_junk_sa_test_allow_tell (void) static void em_junk_sa_test_spamassassin (void) { - const gchar *argv [3] = { + const gchar *argv[3] = { "spamassassin", "--version", NULL, @@ -395,8 +395,8 @@ em_junk_sa_start_own_daemon () em_junk_sa_socket_path = e_mktemp ("spamd-socket-path-XXXXXX"); em_junk_sa_spamd_pidfile = e_mktemp ("spamd-pid-file-XXXXXX"); - for (b = 0; em_junk_sa_spamd_binaries [b]; b++) { - em_junk_sa_use_spamc = em_junk_sa_run_spamd (em_junk_sa_spamd_binaries [b]); + for (b = 0; em_junk_sa_spamd_binaries[b]; b++) { + em_junk_sa_use_spamc = em_junk_sa_run_spamd (em_junk_sa_spamd_binaries[b]); if (em_junk_sa_use_spamc) { em_junk_sa_new_daemon_started = TRUE; break; @@ -411,8 +411,8 @@ em_junk_sa_find_spamc () gint b; em_junk_sa_use_spamc = FALSE; - for (b = 0; em_junk_sa_spamc_binaries [b]; b++) { - em_junk_sa_spamc_binary = em_junk_sa_spamc_binaries [b]; + for (b = 0; em_junk_sa_spamc_binaries[b]; b++) { + em_junk_sa_spamc_binary = em_junk_sa_spamc_binaries[b]; if (em_junk_sa_test_spamd_running (em_junk_sa_spamc_binary, FALSE)) { em_junk_sa_use_spamc = TRUE; break; @@ -429,13 +429,13 @@ em_junk_sa_test_spamd (void) gboolean try_system_spamd = TRUE; if (em_junk_sa_spamc_gconf_binary) { - em_junk_sa_spamc_binaries [0] = em_junk_sa_spamc_gconf_binary; - em_junk_sa_spamc_binaries [1] = NULL; + em_junk_sa_spamc_binaries[0] = em_junk_sa_spamc_gconf_binary; + em_junk_sa_spamc_binaries[1] = NULL; } if (em_junk_sa_spamd_gconf_binary) { - em_junk_sa_spamd_binaries [0] = em_junk_sa_spamd_gconf_binary; - em_junk_sa_spamd_binaries [1] = NULL; + em_junk_sa_spamd_binaries[0] = em_junk_sa_spamd_gconf_binary; + em_junk_sa_spamd_binaries[1] = NULL; try_system_spamd = FALSE; } @@ -456,8 +456,8 @@ em_junk_sa_test_spamd (void) /* try to use sytem spamd first */ if (try_system_spamd) { - for (b = 0; em_junk_sa_spamc_binaries [b]; b++) { - em_junk_sa_spamc_binary = em_junk_sa_spamc_binaries [b]; + for (b = 0; em_junk_sa_spamc_binaries[b]; b++) { + em_junk_sa_spamc_binary = em_junk_sa_spamc_binaries[b]; if (em_junk_sa_test_spamd_running (em_junk_sa_spamc_binary, TRUE)) { em_junk_sa_use_spamc = TRUE; em_junk_sa_system_spamd_available = TRUE; @@ -468,8 +468,8 @@ em_junk_sa_test_spamd (void) /* if there's no system spamd running, try to use user one with user specified socket */ if (!em_junk_sa_use_spamc && em_junk_sa_preferred_socket_path) { - for (b = 0; em_junk_sa_spamc_binaries [b]; b++) { - em_junk_sa_spamc_binary = em_junk_sa_spamc_binaries [b]; + for (b = 0; em_junk_sa_spamc_binaries[b]; b++) { + em_junk_sa_spamc_binary = em_junk_sa_spamc_binaries[b]; if (em_junk_sa_test_spamd_running (em_junk_sa_spamc_binary, FALSE)) { em_junk_sa_use_spamc = TRUE; em_junk_sa_system_spamd_available = FALSE; @@ -527,11 +527,11 @@ em_junk_sa_check_respawn_too_fast () if (em_junk_sa_spamd_restarts_count >= SPAMD_RESTARTS_SIZE) { /* all restarts in last 5 minutes */ - rv = (time_now - em_junk_sa_spamd_restarts [em_junk_sa_spamd_restarts_count % SPAMD_RESTARTS_SIZE] < 5*60); + rv = (time_now - em_junk_sa_spamd_restarts[em_junk_sa_spamd_restarts_count % SPAMD_RESTARTS_SIZE] < 5*60); } else rv = FALSE; - em_junk_sa_spamd_restarts [em_junk_sa_spamd_restarts_count % SPAMD_RESTARTS_SIZE] = time_now; + em_junk_sa_spamd_restarts[em_junk_sa_spamd_restarts_count % SPAMD_RESTARTS_SIZE] = time_now; em_junk_sa_spamd_restarts_count++; G_UNLOCK (spamd_restart); @@ -621,7 +621,7 @@ em_junk_sa_check_junk(EPlugin *ep, EMJunkTarget *target) G_LOCK (socket_path); g_free (to_free); - argv [socket_i] = to_free = g_strdup (em_junk_sa_get_socket_path ()); + argv[socket_i] = to_free = g_strdup (em_junk_sa_get_socket_path ()); G_UNLOCK (socket_path); rv = pipe_to_sa_full (msg, NULL, argv, 0, 1, out, &target->error) != 0; @@ -881,14 +881,14 @@ em_junk_sa_kill_spamd (void) gint fd = open (em_junk_sa_spamd_pidfile, O_RDONLY); if (fd != -1) { - gchar pid_str [16]; + gchar pid_str[16]; gint bytes; bytes = read (fd, pid_str, 15); if (bytes > 0) { gint pid; - pid_str [bytes] = 0; + pid_str[bytes] = 0; pid = atoi (pid_str); if (pid > 0) { |