From 4c05b9e925764a6035e3d0fcbfc1f0458d36f5d9 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 29 Aug 2010 10:44:16 -0400 Subject: Coding style and whitespace cleanup. --- e-util/e-alert-dialog.c | 72 ++++---- e-util/e-alert-dialog.h | 2 +- e-util/e-alert.c | 164 +++++++++--------- e-util/e-alert.h | 6 +- e-util/e-bit-array.c | 88 +++++----- e-util/e-categories-config.c | 2 +- e-util/e-config.c | 268 ++++++++++++++--------------- e-util/e-config.h | 40 ++--- e-util/e-datetime-format.c | 2 +- e-util/e-event.c | 90 +++++----- e-util/e-icon-factory.h | 2 +- e-util/e-mktemp.c | 40 ++--- e-util/e-non-intrusive-error-dialog.c | 4 +- e-util/e-plugin.c | 176 +++++++++---------- e-util/e-profile-event.c | 32 ++-- e-util/e-profile-event.h | 8 +- e-util/e-selection.h | 6 +- e-util/e-sorter-array.c | 56 +++--- e-util/e-sorter.c | 38 ++-- e-util/e-text-event-processor-emacs-like.c | 4 +- e-util/e-text-event-processor.c | 4 +- e-util/e-unicode.c | 6 +- e-util/e-util.c | 46 ++--- e-util/e-util.h | 3 +- e-util/e-xml-utils.c | 8 +- e-util/gconf-bridge.c | 6 +- 26 files changed, 588 insertions(+), 585 deletions(-) (limited to 'e-util') diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c index cb2dabf74e..ac8df00e0c 100644 --- a/e-util/e-alert-dialog.c +++ b/e-util/e-alert-dialog.c @@ -102,7 +102,7 @@ e_alert_dialog_dispose (GObject *object) } static void -dialog_response_cb(GtkWidget *w, guint button, gpointer user_data) +dialog_response_cb (GtkWidget *w, guint button, gpointer user_data) { EAlertDialogPrivate *priv = ALERT_DIALOG_PRIVATE (w); @@ -138,7 +138,7 @@ e_alert_dialog_constructed (GObject *obj) action_area = gtk_dialog_get_action_area ((GtkDialog*) self); content_area = gtk_dialog_get_content_area ((GtkDialog*) self); - gtk_dialog_set_has_separator((GtkDialog*) self, FALSE); + gtk_dialog_set_has_separator ((GtkDialog*) self, FALSE); gtk_widget_ensure_style ((GtkWidget *)self); gtk_container_set_border_width (GTK_CONTAINER (action_area), 12); @@ -152,17 +152,17 @@ e_alert_dialog_constructed (GObject *obj) "This is no longer legal, please fix it.", G_STRFUNC); if (e_alert_get_flags (alert) & GTK_DIALOG_MODAL) - gtk_window_set_modal((GtkWindow *)self, TRUE); - gtk_window_set_destroy_with_parent((GtkWindow *)self, TRUE); + gtk_window_set_modal ((GtkWindow *)self, TRUE); + gtk_window_set_destroy_with_parent ((GtkWindow *)self, TRUE); if (e_alert_peek_help_uri (alert)) { - gtk_dialog_add_button((GtkDialog*) self, GTK_STOCK_HELP, GTK_RESPONSE_HELP); + gtk_dialog_add_button ((GtkDialog*) self, GTK_STOCK_HELP, GTK_RESPONSE_HELP); g_signal_connect(self, "response", G_CALLBACK(dialog_response_cb), NULL); } b = e_alert_peek_buttons (alert); if (b == NULL) { - gtk_dialog_add_button((GtkDialog*) self, GTK_STOCK_OK, GTK_RESPONSE_OK); + gtk_dialog_add_button ((GtkDialog*) self, GTK_STOCK_OK, GTK_RESPONSE_OK); } else { for (; b; b=b->next) { if (b->stock) { @@ -171,33 +171,33 @@ e_alert_dialog_constructed (GObject *obj) /* FIXME: So although this looks like it will work, it wont. Need to do it the hard way ... it also breaks the default_response stuff */ - w = gtk_button_new_from_stock(b->stock); - gtk_button_set_label((GtkButton *)w, b->label); - gtk_widget_show(w); - gtk_dialog_add_action_widget(self, w, b->response); + w = gtk_button_new_from_stock (b->stock); + gtk_button_set_label ((GtkButton *)w, b->label); + gtk_widget_show (w); + gtk_dialog_add_action_widget (self, w, b->response); #endif - gtk_dialog_add_button((GtkDialog*) self, b->label, b->response); + gtk_dialog_add_button ((GtkDialog*) self, b->label, b->response); } else - gtk_dialog_add_button((GtkDialog*) self, b->stock, b->response); + gtk_dialog_add_button ((GtkDialog*) self, b->stock, b->response); } else - gtk_dialog_add_button((GtkDialog*) self, b->label, b->response); + gtk_dialog_add_button ((GtkDialog*) self, b->label, b->response); } } if (e_alert_get_default_response (alert)) - gtk_dialog_set_default_response((GtkDialog*) self, + gtk_dialog_set_default_response ((GtkDialog*) self, e_alert_get_default_response (alert)); - hbox = gtk_hbox_new(FALSE, 0); - gtk_container_set_border_width((GtkContainer *)hbox, 12); + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width ((GtkContainer *)hbox, 12); w = gtk_image_new_from_stock (e_alert_peek_stock_image (alert), GTK_ICON_SIZE_DIALOG); - gtk_misc_set_alignment((GtkMisc *)w, 0.0, 0.0); - gtk_box_pack_start((GtkBox *)hbox, w, FALSE, FALSE, 12); + gtk_misc_set_alignment ((GtkMisc *)w, 0.0, 0.0); + gtk_box_pack_start ((GtkBox *)hbox, w, FALSE, FALSE, 12); title = e_alert_get_title (alert, FALSE); - gtk_window_set_title((GtkWindow *)self, title); + gtk_window_set_title ((GtkWindow *)self, title); out = g_string_new (""); primary = e_alert_get_primary_text (alert, TRUE); @@ -222,20 +222,20 @@ e_alert_dialog_constructed (GObject *obj) GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); } - w = gtk_label_new(NULL); - gtk_label_set_selectable((GtkLabel *)w, TRUE); - gtk_label_set_line_wrap((GtkLabel *)w, TRUE); - gtk_label_set_markup((GtkLabel *)w, out->str); + w = gtk_label_new (NULL); + gtk_label_set_selectable ((GtkLabel *)w, TRUE); + gtk_label_set_line_wrap ((GtkLabel *)w, TRUE); + gtk_label_set_markup ((GtkLabel *)w, out->str); gtk_widget_set_can_focus (w, FALSE); - g_string_free(out, TRUE); + g_string_free (out, TRUE); if (e_alert_get_scroll (alert)) { gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *)scroll, w); - gtk_box_pack_start((GtkBox *)hbox, scroll, FALSE, FALSE, 0); + gtk_box_pack_start ((GtkBox *)hbox, scroll, FALSE, FALSE, 0); gtk_window_set_default_size ((GtkWindow *)self, 360, 180); } else - gtk_box_pack_start((GtkBox *)hbox, w, TRUE, TRUE, 0); + gtk_box_pack_start ((GtkBox *)hbox, w, TRUE, TRUE, 0); - gtk_widget_show_all(hbox); + gtk_widget_show_all (hbox); gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0); } @@ -288,9 +288,9 @@ e_alert_dialog_new_for_args (GtkWindow *parent, const gchar *tag, ...) EAlert *e; va_list ap; - va_start(ap, tag); - e = e_alert_new_valist(tag, ap); - va_end(ap); + va_start (ap, tag); + e = e_alert_new_valist (tag, ap); + va_end (ap); d = e_alert_dialog_new (parent, e); g_object_unref (e); @@ -299,15 +299,15 @@ e_alert_dialog_new_for_args (GtkWindow *parent, const gchar *tag, ...) } gint -e_alert_run_dialog(GtkWindow *parent, EAlert *alert) +e_alert_run_dialog (GtkWindow *parent, EAlert *alert) { GtkWidget *dialog; gint res; dialog = e_alert_dialog_new (parent, alert); - res = gtk_dialog_run((GtkDialog *)dialog); - gtk_widget_destroy(dialog); + res = gtk_dialog_run ((GtkDialog *)dialog); + gtk_widget_destroy (dialog); return res; } @@ -319,9 +319,9 @@ e_alert_run_dialog_for_args (GtkWindow *parent, const gchar *tag, ...) va_list ap; gint response; - va_start(ap, tag); - e = e_alert_new_valist(tag, ap); - va_end(ap); + va_start (ap, tag); + e = e_alert_new_valist (tag, ap); + va_end (ap); response = e_alert_run_dialog (parent, e); g_object_unref (e); diff --git a/e-util/e-alert-dialog.h b/e-util/e-alert-dialog.h index 2be298e8dc..54235a757b 100644 --- a/e-util/e-alert-dialog.h +++ b/e-util/e-alert-dialog.h @@ -72,7 +72,7 @@ GtkWidget* e_alert_dialog_new (GtkWindow* parent, EAlert *alert); GtkWidget* e_alert_dialog_new_for_args (GtkWindow* parent, const gchar *tag, ...) G_GNUC_NULL_TERMINATED; /* Convenience functions for displaying the alert in a GtkDialog */ -gint e_alert_run_dialog(GtkWindow *parent, EAlert *alert); +gint e_alert_run_dialog (GtkWindow *parent, EAlert *alert); gint e_alert_run_dialog_for_args (GtkWindow *parent, const gchar *tag, ...) G_GNUC_NULL_TERMINATED; guint e_alert_dialog_count_buttons (EAlertDialog *dialog); diff --git a/e-util/e-alert.c b/e-util/e-alert.c index 9ca0c02df3..aebee8326a 100644 --- a/e-util/e-alert.c +++ b/e-util/e-alert.c @@ -101,12 +101,12 @@ static struct { }; static gint -map_response(const gchar *name) +map_response (const gchar *name) { gint i; for (i = 0; i < G_N_ELEMENTS (response_map); i++) - if (!strcmp(name, response_map[i].name)) + if (!strcmp (name, response_map[i].name)) return response_map[i].id; return 0; @@ -123,13 +123,13 @@ static struct { }; static gint -map_type(const gchar *name) +map_type (const gchar *name) { gint i; if (name) { for (i = 0; i < G_N_ELEMENTS (type_map); i++) - if (!strcmp(name, type_map[i].name)) + if (!strcmp (name, type_map[i].name)) return i; } @@ -176,7 +176,7 @@ struct _EAlertPrivate */ static void -e_alert_load(const gchar *path) +e_alert_load (const gchar *path) { xmlDocPtr doc = NULL; xmlNodePtr root, error, scan; @@ -193,38 +193,38 @@ e_alert_load(const gchar *path) return; } - root = xmlDocGetRootElement(doc); + root = xmlDocGetRootElement (doc); if (root == NULL || strcmp((gchar *)root->name, "error-list") != 0 || (tmp = (gchar *)xmlGetProp(root, (const guchar *)"domain")) == NULL) { g_warning("Error file '%s' invalid format", path); - xmlFreeDoc(doc); + xmlFreeDoc (doc); return; } - table = g_hash_table_lookup(alert_table, tmp); + table = g_hash_table_lookup (alert_table, tmp); if (table == NULL) { gchar *tmp2; - table = g_malloc0(sizeof(*table)); - table->domain = g_strdup(tmp); - table->alerts = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(alert_table, (gpointer) table->domain, table); + table = g_malloc0 (sizeof (*table)); + table->domain = g_strdup (tmp); + table->alerts = g_hash_table_new (g_str_hash, g_str_equal); + g_hash_table_insert (alert_table, (gpointer) table->domain, table); tmp2 = (gchar *)xmlGetProp(root, (const guchar *)"translation-domain"); if (tmp2) { - table->translation_domain = g_strdup(tmp2); - xmlFree(tmp2); + table->translation_domain = g_strdup (tmp2); + xmlFree (tmp2); tmp2 = (gchar *)xmlGetProp(root, (const guchar *)"translation-localedir"); if (tmp2) { - bindtextdomain(table->translation_domain, tmp2); - xmlFree(tmp2); + bindtextdomain (table->translation_domain, tmp2); + xmlFree (tmp2); } } } else g_warning("Error file '%s', domain '%s' already used, merging", path, tmp); - xmlFree(tmp); + xmlFree (tmp); for (error = root->children;error;error = error->next) { if (!strcmp((gchar *)error->name, "error")) { @@ -232,89 +232,89 @@ e_alert_load(const gchar *path) if (tmp == NULL) continue; - e = g_malloc0(sizeof(*e)); - e->id = g_strdup(tmp); + e = g_malloc0 (sizeof (*e)); + e->id = g_strdup (tmp); e->scroll = FALSE; - xmlFree(tmp); + xmlFree (tmp); lastbutton = (struct _e_alert_button *)&e->buttons; tmp = (gchar *)xmlGetProp(error, (const guchar *)"modal"); if (tmp) { if (!strcmp(tmp, "true")) e->flags |= GTK_DIALOG_MODAL; - xmlFree(tmp); + xmlFree (tmp); } tmp = (gchar *)xmlGetProp(error, (const guchar *)"type"); - e->type = map_type(tmp); + e->type = map_type (tmp); if (tmp) - xmlFree(tmp); + xmlFree (tmp); tmp = (gchar *)xmlGetProp(error, (const guchar *)"default"); if (tmp) { - e->default_response = map_response(tmp); - xmlFree(tmp); + e->default_response = map_response (tmp); + xmlFree (tmp); } tmp = (gchar *)xmlGetProp(error, (const guchar *)"scroll"); if (tmp) { if (!strcmp(tmp, "yes")) e->scroll = TRUE; - xmlFree(tmp); + xmlFree (tmp); } for (scan = error->children;scan;scan=scan->next) { if (!strcmp((gchar *)scan->name, "primary")) { - if ((tmp = (gchar *)xmlNodeGetContent(scan))) { - e->primary = g_strdup(dgettext(table->translation_domain, tmp)); - xmlFree(tmp); + if ((tmp = (gchar *)xmlNodeGetContent (scan))) { + e->primary = g_strdup (dgettext (table->translation_domain, tmp)); + xmlFree (tmp); } } else if (!strcmp((gchar *)scan->name, "secondary")) { - if ((tmp = (gchar *)xmlNodeGetContent(scan))) { - e->secondary = g_strdup(dgettext(table->translation_domain, tmp)); - xmlFree(tmp); + if ((tmp = (gchar *)xmlNodeGetContent (scan))) { + e->secondary = g_strdup (dgettext (table->translation_domain, tmp)); + xmlFree (tmp); } } else if (!strcmp((gchar *)scan->name, "title")) { - if ((tmp = (gchar *)xmlNodeGetContent(scan))) { - e->title = g_strdup(dgettext(table->translation_domain, tmp)); - xmlFree(tmp); + if ((tmp = (gchar *)xmlNodeGetContent (scan))) { + e->title = g_strdup (dgettext (table->translation_domain, tmp)); + xmlFree (tmp); } } else if (!strcmp((gchar *)scan->name, "help")) { tmp = (gchar *)xmlGetProp(scan, (const guchar *)"uri"); if (tmp) { - e->help_uri = g_strdup(tmp); - xmlFree(tmp); + e->help_uri = g_strdup (tmp); + xmlFree (tmp); } } else if (!strcmp((gchar *)scan->name, "button")) { struct _e_alert_button *b; gchar *label = NULL; gchar *stock = NULL; - b = g_malloc0(sizeof(*b)); + b = g_malloc0 (sizeof (*b)); tmp = (gchar *)xmlGetProp(scan, (const guchar *)"stock"); if (tmp) { - stock = g_strdup(tmp); + stock = g_strdup (tmp); b->stock = stock; - xmlFree(tmp); + xmlFree (tmp); } tmp = (gchar *)xmlGetProp(scan, (const guchar *)"label"); if (tmp) { - label = g_strdup(dgettext(table->translation_domain, tmp)); + label = g_strdup (dgettext (table->translation_domain, tmp)); b->label = label; - xmlFree(tmp); + xmlFree (tmp); } tmp = (gchar *)xmlGetProp(scan, (const guchar *)"response"); if (tmp) { - b->response = map_response(tmp); - xmlFree(tmp); + b->response = map_response (tmp); + xmlFree (tmp); } if (stock == NULL && label == NULL) { g_warning("Error file '%s': missing button details in error '%s'", path, e->id); - g_free(stock); - g_free(label); - g_free(b); + g_free (stock); + g_free (label); + g_free (b); } else { lastbutton->next = b; lastbutton = b; @@ -322,15 +322,15 @@ e_alert_load(const gchar *path) } } - g_hash_table_insert(table->alerts, (gpointer) e->id, e); + g_hash_table_insert (table->alerts, (gpointer) e->id, e); } } - xmlFreeDoc(doc); + xmlFreeDoc (doc); } static void -e_alert_load_tables(void) +e_alert_load_tables (void) { GDir *dir; const gchar *d; @@ -341,38 +341,38 @@ e_alert_load_tables(void) if (alert_table != NULL) return; - alert_table = g_hash_table_new(g_str_hash, g_str_equal); + alert_table = g_hash_table_new (g_str_hash, g_str_equal); /* setup system alert types */ - table = g_malloc0(sizeof(*table)); + table = g_malloc0 (sizeof (*table)); table->domain = "builtin"; - table->alerts = g_hash_table_new(g_str_hash, g_str_equal); + table->alerts = g_hash_table_new (g_str_hash, g_str_equal); for (i = 0; i < G_N_ELEMENTS (default_alerts); i++) g_hash_table_insert ( table->alerts, (gpointer) default_alerts[i].id, &default_alerts[i]); - g_hash_table_insert(alert_table, (gpointer) table->domain, table); + g_hash_table_insert (alert_table, (gpointer) table->domain, table); /* look for installed alert tables */ base = g_build_filename (EVOLUTION_PRIVDATADIR, "errors", NULL); - dir = g_dir_open(base, 0, NULL); + dir = g_dir_open (base, 0, NULL); if (dir == NULL) { g_free (base); return; } - while ((d = g_dir_read_name(dir))) { + while ((d = g_dir_read_name (dir))) { gchar *path; if (d[0] == '.') continue; - path = g_build_filename(base, d, NULL); - e_alert_load(path); - g_free(path); + path = g_build_filename (base, d, NULL); + e_alert_load (path); + g_free (path); } - g_dir_close(dir); + g_dir_close (dir); g_free (base); } @@ -445,18 +445,18 @@ e_alert_constructed (GObject *obj) g_return_if_fail (alert_table); g_return_if_fail (alert->priv->tag); - domain = g_alloca(strlen(alert->priv->tag)+1); - strcpy(domain, alert->priv->tag); - id = strchr(domain, ':'); + domain = g_alloca (strlen (alert->priv->tag)+1); + strcpy (domain, alert->priv->tag); + id = strchr (domain, ':'); if (id) *id++ = 0; - table = g_hash_table_lookup(alert_table, domain); + table = g_hash_table_lookup (alert_table, domain); g_return_if_fail (table); - alert->priv->definition = g_hash_table_lookup(table->alerts, id); + alert->priv->definition = g_hash_table_lookup (table->alerts, id); - g_warn_if_fail(alert->priv->definition); + g_warn_if_fail (alert->priv->definition); } @@ -514,35 +514,35 @@ e_alert_init (EAlert *self) * Returns: a new #EAlert **/ EAlert * -e_alert_new(const gchar *tag, ...) +e_alert_new (const gchar *tag, ...) { EAlert *e; va_list ap; - va_start(ap, tag); - e = e_alert_new_valist(tag, ap); - va_end(ap); + va_start (ap, tag); + e = e_alert_new_valist (tag, ap); + va_end (ap); return e; } EAlert * -e_alert_new_valist(const gchar *tag, va_list ap) +e_alert_new_valist (const gchar *tag, va_list ap) { gchar *tmp; GPtrArray *args = g_ptr_array_new_with_free_func (g_free); tmp = va_arg (ap, gchar *); while (tmp) { - g_ptr_array_add(args, g_strdup (tmp)); - tmp = va_arg(ap, gchar *); + g_ptr_array_add (args, g_strdup (tmp)); + tmp = va_arg (ap, gchar *); } return e_alert_new_array (tag, args); } EAlert * -e_alert_new_array(const gchar *tag, GPtrArray *args) +e_alert_new_array (const gchar *tag, GPtrArray *args) { return g_object_new (E_TYPE_ALERT, "tag", tag, "args", args, NULL); } @@ -568,21 +568,21 @@ e_alert_format_string (GString *out, gint id; while (fmt - && (newstart = strchr(fmt, '{')) - && (end = strchr(newstart+1, '}'))) { - g_string_append_len(out, fmt, newstart-fmt); - id = atoi(newstart+1); + && (newstart = strchr (fmt, '{')) + && (end = strchr (newstart+1, '}'))) { + g_string_append_len (out, fmt, newstart-fmt); + id = atoi (newstart+1); if (id < args->len) { if (escape_args) - e_alert_append_text_escaped(out, args->pdata[id]); + e_alert_append_text_escaped (out, args->pdata[id]); else - g_string_append(out, args->pdata[id]); + g_string_append (out, args->pdata[id]); } else g_warning("Error references argument %d not supplied by caller", id); fmt = end+1; } - g_string_append(out, fmt); + g_string_append (out, fmt); } guint32 @@ -647,7 +647,7 @@ e_alert_get_primary_text (EAlert *alert, g_free (title); } else { - g_string_append_printf( + g_string_append_printf ( formatted, _("Internal error, unknown error '%s' requested"), alert->priv->tag); diff --git a/e-util/e-alert.h b/e-util/e-alert.h index 66a0cb9c23..04b9e120ef 100644 --- a/e-util/e-alert.h +++ b/e-util/e-alert.h @@ -97,9 +97,9 @@ struct _EAlertClass GType e_alert_get_type (void); -EAlert *e_alert_new(const gchar *tag, ...) G_GNUC_NULL_TERMINATED; -EAlert *e_alert_new_valist(const gchar *tag, va_list ap); -EAlert *e_alert_new_array(const gchar *tag, GPtrArray *args); +EAlert *e_alert_new (const gchar *tag, ...) G_GNUC_NULL_TERMINATED; +EAlert *e_alert_new_valist (const gchar *tag, va_list ap); +EAlert *e_alert_new_array (const gchar *tag, GPtrArray *args); guint32 e_alert_get_flags (EAlert *alert); const gchar *e_alert_peek_stock_image (EAlert *alert); diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index 785ee45273..842361d0f2 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -42,19 +42,19 @@ G_DEFINE_TYPE ( G_TYPE_OBJECT) static void -e_bit_array_insert_real(EBitArray *eba, gint row) +e_bit_array_insert_real (EBitArray *eba, gint row) { gint box; gint i; if (eba->bit_count >= 0) { /* Add another word if needed. */ if ((eba->bit_count & 0x1f) == 0) { - eba->data = g_renew(guint32, eba->data, (eba->bit_count >> 5) + 1); + eba->data = g_renew (guint32, eba->data, (eba->bit_count >> 5) + 1); eba->data[eba->bit_count >> 5] = 0; } /* The box is the word that our row is in. */ - box = BOX(row); + box = BOX (row); /* Shift all words to the right of our box right one bit. */ for (i = eba->bit_count >> 5; i > box; i--) { eba->data[i] = (eba->data[i] >> 1) | (eba->data[i - 1] << 31); @@ -62,14 +62,14 @@ e_bit_array_insert_real(EBitArray *eba, gint row) /* Shift right half of box one bit to the right. */ eba->data[box] = - (eba->data[box] & BITMASK_LEFT(row)) | - ((eba->data[box] & BITMASK_RIGHT(row)) >> 1); + (eba->data[box] & BITMASK_LEFT (row)) | + ((eba->data[box] & BITMASK_RIGHT (row)) >> 1); eba->bit_count++; } } static void -e_bit_array_delete_real(EBitArray *eba, gint row, gboolean move_selection_mode) +e_bit_array_delete_real (EBitArray *eba, gint row, gboolean move_selection_mode) { gint box; gint i; @@ -81,12 +81,12 @@ e_bit_array_delete_real(EBitArray *eba, gint row, gboolean move_selection_mode) last = eba->bit_count >> 5; /* Build bitmasks for the left and right half of the box */ - bitmask = BITMASK_RIGHT(row) >> 1; + bitmask = BITMASK_RIGHT (row) >> 1; if (move_selection_mode) - selected = e_bit_array_value_at(eba, row); + selected = e_bit_array_value_at (eba, row); /* Shift right half of box one bit to the left. */ eba->data[box] = - (eba->data[box] & BITMASK_LEFT(row)) | + (eba->data[box] & BITMASK_LEFT (row)) | ((eba->data[box] & bitmask) << 1); /* Shift all words to the right of our box left one bit. */ @@ -102,7 +102,7 @@ e_bit_array_delete_real(EBitArray *eba, gint row, gboolean move_selection_mode) eba->bit_count--; /* Remove the last word if not needed. */ if ((eba->bit_count & 0x1f) == 0) { - eba->data = g_renew(guint32, eba->data, eba->bit_count >> 5); + eba->data = g_renew (guint32, eba->data, eba->bit_count >> 5); } if (move_selection_mode && selected && eba->bit_count > 0) { e_bit_array_select_single_row (eba, row == eba->bit_count ? row - 1 : row); @@ -112,37 +112,37 @@ e_bit_array_delete_real(EBitArray *eba, gint row, gboolean move_selection_mode) /* FIXME : Improve efficiency here. */ void -e_bit_array_delete(EBitArray *eba, gint row, gint count) +e_bit_array_delete (EBitArray *eba, gint row, gint count) { gint i; for (i = 0; i < count; i++) - e_bit_array_delete_real(eba, row, FALSE); + e_bit_array_delete_real (eba, row, FALSE); } /* FIXME : Improve efficiency here. */ void -e_bit_array_delete_single_mode(EBitArray *eba, gint row, gint count) +e_bit_array_delete_single_mode (EBitArray *eba, gint row, gint count) { gint i; for (i = 0; i < count; i++) - e_bit_array_delete_real(eba, row, TRUE); + e_bit_array_delete_real (eba, row, TRUE); } /* FIXME : Improve efficiency here. */ void -e_bit_array_insert(EBitArray *eba, gint row, gint count) +e_bit_array_insert (EBitArray *eba, gint row, gint count) { gint i; for (i = 0; i < count; i++) - e_bit_array_insert_real(eba, row); + e_bit_array_insert_real (eba, row); } /* FIXME: Implement this more efficiently. */ void -e_bit_array_move_row(EBitArray *eba, gint old_row, gint new_row) +e_bit_array_move_row (EBitArray *eba, gint old_row, gint new_row) { - e_bit_array_delete_real(eba, old_row, FALSE); - e_bit_array_insert_real(eba, new_row); + e_bit_array_delete_real (eba, old_row, FALSE); + e_bit_array_insert_real (eba, new_row); } static void @@ -153,7 +153,7 @@ eba_dispose (GObject *object) eba = E_BIT_ARRAY (object); if (eba->data) - g_free(eba->data); + g_free (eba->data); eba->data = NULL; if (G_OBJECT_CLASS (e_bit_array_parent_class)->dispose) @@ -176,7 +176,7 @@ e_bit_array_value_at (EBitArray *eba, if (eba->bit_count < n || eba->bit_count == 0) return 0; else - return (eba->data[BOX(n)] >> OFFSET(n)) & 0x1; + return (eba->data[BOX (n)] >> OFFSET (n)) & 0x1; } /** @@ -201,7 +201,7 @@ e_bit_array_foreach (EBitArray *eba, guint32 value = eba->data[i]; for (j = 0; j < 32; j++) { if (value & 0x80000000) { - callback(i * 32 + j, closure); + callback (i * 32 + j, closure); } value <<= 1; } @@ -232,15 +232,15 @@ e_bit_array_selected_count (EBitArray *eba) count = 0; - last = BOX(eba->bit_count - 1); + last = BOX (eba->bit_count - 1); for (i = 0; i <= last; i++) { gint j; guint32 thiscount = 0; for (j = 0; j < 8; j++) - thiscount += PART(eba->data[i], j); + thiscount += PART (eba->data[i], j); for (j = 0; j < 4; j++) - count += SECTION(thiscount, j); + count += SECTION (thiscount, j); } return count; @@ -309,33 +309,33 @@ e_bit_array_bit_count (EBitArray *eba) (((object)->data[(i)]) &= (mask))) void -e_bit_array_change_one_row(EBitArray *eba, gint row, gboolean grow) +e_bit_array_change_one_row (EBitArray *eba, gint row, gboolean grow) { gint i; - i = BOX(row); + i = BOX (row); - OPERATE(eba, i, ~BITMASK(row), grow); + OPERATE (eba, i, ~BITMASK (row), grow); } void -e_bit_array_change_range(EBitArray *eba, gint start, gint end, gboolean grow) +e_bit_array_change_range (EBitArray *eba, gint start, gint end, gboolean grow) { gint i, last; if (start != end) { - i = BOX(start); - last = BOX(end); + i = BOX (start); + last = BOX (end); if (i == last) { - OPERATE(eba, i, BITMASK_LEFT(start) | BITMASK_RIGHT(end), grow); + OPERATE (eba, i, BITMASK_LEFT (start) | BITMASK_RIGHT (end), grow); } else { - OPERATE(eba, i, BITMASK_LEFT(start), grow); + OPERATE (eba, i, BITMASK_LEFT (start), grow); if (grow) for (i++; i < last; i++) eba->data[i] = ONES; else for (i++; i < last; i++) eba->data[i] = 0; - OPERATE(eba, i, BITMASK_RIGHT(end), grow); + OPERATE (eba, i, BITMASK_RIGHT (end), grow); } } } @@ -345,11 +345,11 @@ e_bit_array_select_single_row (EBitArray *eba, gint row) { gint i; for (i = 0; i < ((eba->bit_count + 31) / 32); i++) { - if (!((i == BOX(row) && eba->data[i] == BITMASK(row)) || - (i != BOX(row) && eba->data[i] == 0))) { - g_free(eba->data); - eba->data = g_new0(guint32, (eba->bit_count + 31) / 32); - eba->data[BOX(row)] = BITMASK(row); + if (!((i == BOX (row) && eba->data[i] == BITMASK (row)) || + (i != BOX (row) && eba->data[i] == 0))) { + g_free (eba->data); + eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32); + eba->data[BOX (row)] = BITMASK (row); break; } @@ -359,10 +359,10 @@ e_bit_array_select_single_row (EBitArray *eba, gint row) void e_bit_array_toggle_single_row (EBitArray *eba, gint row) { - if (eba->data[BOX(row)] & BITMASK(row)) - eba->data[BOX(row)] &= ~BITMASK(row); + if (eba->data[BOX (row)] & BITMASK (row)) + eba->data[BOX (row)] &= ~BITMASK (row); else - eba->data[BOX(row)] |= BITMASK(row); + eba->data[BOX (row)] |= BITMASK (row); } static void @@ -377,7 +377,7 @@ e_bit_array_class_init (EBitArrayClass *klass) { GObjectClass *object_class; - object_class = G_OBJECT_CLASS(klass); + object_class = G_OBJECT_CLASS (klass); object_class->dispose = eba_dispose; } @@ -387,6 +387,6 @@ e_bit_array_new (gint count) { EBitArray *eba = g_object_new (E_BIT_ARRAY_TYPE, NULL); eba->bit_count = count; - eba->data = g_new0(guint32, (eba->bit_count + 31) / 32); + eba->data = g_new0 (guint32, (eba->bit_count + 31) / 32); return eba; } diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c index fb2dc165b8..be169f7284 100644 --- a/e-util/e-categories-config.c +++ b/e-util/e-categories-config.c @@ -118,7 +118,7 @@ e_categories_config_open_dialog_for_entry (GtkEntry *entry) text = gtk_entry_get_text (GTK_ENTRY (entry)); dialog = GTK_DIALOG (e_categories_dialog_new (text)); - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET (entry)))); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (entry)))); /* run the dialog */ result = gtk_dialog_run (dialog); diff --git a/e-util/e-config.c b/e-util/e-config.c index 2b8d948fe5..dd51f8efc7 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -104,7 +104,7 @@ config_finalize (GObject *object) d(printf("finalising EConfig %p\n", object)); - g_free(emp->id); + g_free (emp->id); link = p->menus; while (link != NULL) { @@ -236,11 +236,11 @@ e_config_construct (EConfig *ep, gint type, const gchar *id) * TODO: perhaps commit and abort should just be signals. **/ void -e_config_add_items(EConfig *ec, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, gpointer data) +e_config_add_items (EConfig *ec, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, gpointer data) { struct _menu_node *node; - node = g_malloc(sizeof(*node)); + node = g_malloc (sizeof (*node)); node->menu = items; node->commit = commitfunc; node->abort = abortfunc; @@ -269,12 +269,12 @@ e_config_add_items(EConfig *ec, GSList *items, EConfigItemsFunc commitfunc, ECon * the assistant to continue or the notebook to close. **/ void -e_config_add_page_check(EConfig *ec, const gchar *pageid, EConfigCheckFunc check, gpointer data) +e_config_add_page_check (EConfig *ec, const gchar *pageid, EConfigCheckFunc check, gpointer data) { struct _check_node *cn; - cn = g_malloc0(sizeof(*cn)); - cn->pageid = g_strdup(pageid); + cn = g_malloc0 (sizeof (*cn)); + cn->pageid = g_strdup (pageid); cn->check = check; cn->data = data; @@ -346,12 +346,12 @@ ec_add_static_items (EConfig *config) } static gint -ep_cmp(gconstpointer ap, gconstpointer bp) +ep_cmp (gconstpointer ap, gconstpointer bp) { struct _widget_node *a = *((gpointer *)ap); struct _widget_node *b = *((gpointer *)bp); - return strcmp(a->item->path, b->item->path); + return strcmp (a->item->path, b->item->path); } static GList * @@ -576,18 +576,18 @@ ec_rebuild (EConfig *emp) || item->type == E_CONFIG_SECTION_TABLE)) { if ((sectionnode->empty = (itemno == 0 || n_visible_widgets == 0))) { if (sectionnode->real_frame) - gtk_widget_hide(sectionnode->real_frame); + gtk_widget_hide (sectionnode->real_frame); if (sectionnode->frame) - gtk_widget_hide(sectionnode->frame); + gtk_widget_hide (sectionnode->frame); sectionno--; } else { if (sectionnode->real_frame) - gtk_widget_show(sectionnode->real_frame); + gtk_widget_show (sectionnode->real_frame); if (sectionnode->frame) - gtk_widget_show(sectionnode->frame); + gtk_widget_show (sectionnode->frame); } d(printf("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno)); @@ -601,10 +601,10 @@ ec_rebuild (EConfig *emp) || item->type == E_CONFIG_PAGE_FINISH || item->type == E_CONFIG_PAGE_PROGRESS)) { if ((pagenode->empty = sectionno == 0)) { - gtk_widget_hide(pagenode->frame); + gtk_widget_hide (pagenode->frame); pageno--; } else - gtk_widget_show(pagenode->frame); + gtk_widget_show (pagenode->frame); d(printf("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno)); } @@ -628,14 +628,14 @@ ec_rebuild (EConfig *emp) break; } if (item->factory) { - root = item->factory(emp, item, NULL, wn->widget, wn->context->data); + root = item->factory (emp, item, NULL, wn->widget, wn->context->data); } else if (item->type == E_CONFIG_BOOK) { - root = gtk_notebook_new(); + root = gtk_notebook_new (); gtk_widget_show (root); } else if (item->type == E_CONFIG_ASSISTANT) { root = gtk_assistant_new (); } else - abort(); + abort (); if (item->type == E_CONFIG_ASSISTANT) { g_signal_connect_swapped ( @@ -689,7 +689,7 @@ ec_rebuild (EConfig *emp) if (wn->widget == NULL) { if (item->factory) { - page = item->factory(emp, item, root, wn->frame, wn->context->data); + page = item->factory (emp, item, root, wn->frame, wn->context->data); } else { page = gtk_vbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (page), 12); @@ -757,13 +757,13 @@ ec_rebuild (EConfig *emp) } if (item->factory) { - page = item->factory(emp, item, root, wn->frame, wn->context->data); + page = item->factory (emp, item, root, wn->frame, wn->context->data); if (emp->type == E_CONFIG_ASSISTANT) { wn->frame = page; } else { wn->frame = page; if (page) - gtk_notebook_reorder_child((GtkNotebook *)book, page, pageno); + gtk_notebook_reorder_child ((GtkNotebook *)book, page, pageno); } if (page) sectionno = 1; @@ -786,11 +786,11 @@ ec_rebuild (EConfig *emp) wn->frame = page; } else { w = gtk_label_new_with_mnemonic (translated_label); - gtk_widget_show(w); - page = gtk_vbox_new(FALSE, 12); - gtk_container_set_border_width((GtkContainer *)page, 12); - gtk_widget_show(page); - gtk_notebook_insert_page((GtkNotebook *)book, page, w, pageno); + gtk_widget_show (w); + page = gtk_vbox_new (FALSE, 12); + gtk_container_set_border_width ((GtkContainer *)page, 12); + gtk_widget_show (page); + gtk_notebook_insert_page ((GtkNotebook *)book, page, w, pageno); wn->frame = page; } } else @@ -835,7 +835,7 @@ ec_rebuild (EConfig *emp) */ EConfigItemSectionFactoryFunc factory = (EConfigItemSectionFactoryFunc) item->factory; - section = factory(emp, item, page, wn->widget, wn->context->data, &wn->real_frame); + section = factory (emp, item, page, wn->widget, wn->context->data, &wn->real_frame); wn->frame = section; if (section) itemno = 1; @@ -854,8 +854,8 @@ ec_rebuild (EConfig *emp) } if (section - && ((item->type == E_CONFIG_SECTION && !GTK_IS_BOX(section)) - || (item->type == E_CONFIG_SECTION_TABLE && !GTK_IS_TABLE(section)))) + && ((item->type == E_CONFIG_SECTION && !GTK_IS_BOX (section)) + || (item->type == E_CONFIG_SECTION_TABLE && !GTK_IS_TABLE (section)))) g_warning("EConfig section type is wrong"); } else { GtkWidget *frame; @@ -863,7 +863,7 @@ ec_rebuild (EConfig *emp) if (wn->frame) { d(printf("Item %s, clearing generated section widget\n", wn->item->path)); - gtk_widget_destroy(wn->frame); + gtk_widget_destroy (wn->frame); wn->widget = NULL; wn->frame = NULL; } @@ -871,22 +871,22 @@ ec_rebuild (EConfig *emp) if (translated_label != NULL) { gchar *txt = g_markup_printf_escaped("%s", translated_label); - label = g_object_new(gtk_label_get_type(), + label = g_object_new (gtk_label_get_type (), "label", txt, "use_markup", TRUE, "xalign", 0.0, NULL); - g_free(txt); + g_free (txt); } if (item->type == E_CONFIG_SECTION) - section = gtk_vbox_new(FALSE, 6); + section = gtk_vbox_new (FALSE, 6); else { - section = gtk_table_new(1, 1, FALSE); - gtk_table_set_col_spacings((GtkTable *)section, 6); - gtk_table_set_row_spacings((GtkTable *)section, 6); + section = gtk_table_new (1, 1, FALSE); + gtk_table_set_col_spacings ((GtkTable *)section, 6); + gtk_table_set_row_spacings ((GtkTable *)section, 6); } - frame = g_object_new(gtk_frame_get_type(), + frame = g_object_new (gtk_frame_get_type (), "shadow_type", GTK_SHADOW_NONE, "label_widget", label, "child", g_object_new(gtk_alignment_get_type(), @@ -894,14 +894,14 @@ ec_rebuild (EConfig *emp) "top_padding", 6, "child", section, NULL), NULL); - gtk_widget_show_all(frame); - gtk_box_pack_start((GtkBox *)page, frame, FALSE, FALSE, 0); + gtk_widget_show_all (frame); + gtk_box_pack_start ((GtkBox *)page, frame, FALSE, FALSE, 0); wn->frame = frame; } nopage: if (wn->widget && wn->widget != section) { d(printf("destroy old widget for section '%s'\n", item->path)); - gtk_widget_destroy(wn->widget); + gtk_widget_destroy (wn->widget); } d(printf("Item %s, setting section widget\n", wn->item->path)); @@ -926,11 +926,11 @@ ec_rebuild (EConfig *emp) wn->widget = NULL; wn->frame = NULL; g_warning("EConfig item has no parent section: %s", item->path); - } else if ((item->type == E_CONFIG_ITEM && !GTK_IS_BOX(section)) - || (item->type == E_CONFIG_ITEM_TABLE && !GTK_IS_TABLE(section))) + } else if ((item->type == E_CONFIG_ITEM && !GTK_IS_BOX (section)) + || (item->type == E_CONFIG_ITEM_TABLE && !GTK_IS_TABLE (section))) g_warning("EConfig item parent type is incorrect: %s", item->path); else if (item->factory) - w = item->factory(emp, item, section, wn->widget, wn->context->data); + w = item->factory (emp, item, section, wn->widget, wn->context->data); d(printf("item %d:%s widget %p\n", itemno, item->path, w)); @@ -941,7 +941,7 @@ ec_rebuild (EConfig *emp) if (wn->widget && wn->widget != w) { d(printf("destroy old widget for item '%s'\n", item->path)); - gtk_widget_destroy(wn->widget); + gtk_widget_destroy (wn->widget); } wn->widget = w; @@ -961,18 +961,18 @@ ec_rebuild (EConfig *emp) d(printf ("Section %s - %d visible widgets (frame=%p)\n", sectionnode->item->path, n_visible_widgets, sectionnode->frame)); if ((sectionnode->empty = (itemno == 0 || n_visible_widgets == 0))) { if (sectionnode->real_frame) - gtk_widget_hide(sectionnode->real_frame); + gtk_widget_hide (sectionnode->real_frame); if (sectionnode->frame) - gtk_widget_hide(sectionnode->frame); + gtk_widget_hide (sectionnode->frame); sectionno--; } else { if (sectionnode->real_frame) - gtk_widget_show(sectionnode->real_frame); + gtk_widget_show (sectionnode->real_frame); if (sectionnode->frame) - gtk_widget_show(sectionnode->frame); + gtk_widget_show (sectionnode->frame); } d(printf("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno)); } @@ -980,18 +980,18 @@ ec_rebuild (EConfig *emp) /* If the last page doesn't contain anything, hide it */ if (pagenode != NULL && pagenode->frame != NULL) { if ((pagenode->empty = sectionno == 0)) { - gtk_widget_hide(pagenode->frame); + gtk_widget_hide (pagenode->frame); pageno--; } else - gtk_widget_show(pagenode->frame); + gtk_widget_show (pagenode->frame); d(printf("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno)); } if (book) { /* make this depend on flags?? */ - if (gtk_notebook_get_n_pages((GtkNotebook *)book) == 1) { - gtk_notebook_set_show_tabs((GtkNotebook *)book, FALSE); - gtk_notebook_set_show_border((GtkNotebook *)book, FALSE); + if (gtk_notebook_get_n_pages ((GtkNotebook *)book) == 1) { + gtk_notebook_set_show_tabs ((GtkNotebook *)book, FALSE); + gtk_notebook_set_show_border ((GtkNotebook *)book, FALSE); } } @@ -1019,21 +1019,21 @@ ec_rebuild (EConfig *emp) * initiate a e_config_target_changed() call where appropriate. **/ void -e_config_set_target(EConfig *emp, EConfigTarget *target) +e_config_set_target (EConfig *emp, EConfigTarget *target) { if (emp->target != target) - ((EConfigClass *)G_OBJECT_GET_CLASS(emp))->set_target(emp, target); + ((EConfigClass *)G_OBJECT_GET_CLASS (emp))->set_target (emp, target); } static void -ec_widget_destroy(GtkWidget *w, EConfig *ec) +ec_widget_destroy (GtkWidget *w, EConfig *ec) { if (ec->target) { - e_config_target_free(ec, ec->target); + e_config_target_free (ec, ec->target); ec->target = NULL; } - g_object_unref(ec); + g_object_unref (ec); } /** @@ -1054,10 +1054,10 @@ ec_widget_destroy(GtkWidget *w, EConfig *ec) * Return value: The widget, also available in @emp.widget **/ GtkWidget * -e_config_create_widget(EConfig *emp) +e_config_create_widget (EConfig *emp) { EConfigPrivate *p = emp->priv; - GPtrArray *items = g_ptr_array_new(); + GPtrArray *items = g_ptr_array_new (); GList *link; GSList *l; /*char *domain = NULL;*/ @@ -1065,7 +1065,7 @@ e_config_create_widget(EConfig *emp) g_return_val_if_fail (emp->target != NULL, NULL); - ec_add_static_items(emp); + ec_add_static_items (emp); /* FIXME: need to override old ones with new names */ link = p->menus; @@ -1074,31 +1074,31 @@ e_config_create_widget(EConfig *emp) for (l=mnode->menu; l; l = l->next) { struct _EConfigItem *item = l->data; - struct _widget_node *wn = g_malloc0(sizeof(*wn)); + struct _widget_node *wn = g_malloc0 (sizeof (*wn)); wn->item = item; wn->context = mnode; wn->config = emp; - g_ptr_array_add(items, wn); + g_ptr_array_add (items, wn); } link = g_list_next (link); } - qsort(items->pdata, items->len, sizeof(items->pdata[0]), ep_cmp); + qsort (items->pdata, items->len, sizeof (items->pdata[0]), ep_cmp); for (i=0;ilen;i++) p->widgets = g_list_append (p->widgets, items->pdata[i]); - g_ptr_array_free(items, TRUE); - ec_rebuild(emp); + g_ptr_array_free (items, TRUE); + ec_rebuild (emp); /* auto-unref it */ g_signal_connect(emp->widget, "destroy", G_CALLBACK(ec_widget_destroy), emp); /* FIXME: for some reason ec_rebuild puts the widget on page 1, this is just to override that */ if (emp->type == E_CONFIG_BOOK) - gtk_notebook_set_current_page((GtkNotebook *)emp->widget, 0); + gtk_notebook_set_current_page ((GtkNotebook *)emp->widget, 0); else { gtk_window_set_position (GTK_WINDOW (emp->widget), GTK_WIN_POS_CENTER); gtk_widget_show (emp->widget); @@ -1108,14 +1108,14 @@ e_config_create_widget(EConfig *emp) } static void -ec_dialog_response(GtkWidget *d, gint id, EConfig *ec) +ec_dialog_response (GtkWidget *d, gint id, EConfig *ec) { if (id == GTK_RESPONSE_OK) - e_config_commit(ec); + e_config_commit (ec); else - e_config_abort(ec); + e_config_abort (ec); - gtk_widget_destroy(d); + gtk_widget_destroy (d); } /** @@ -1136,14 +1136,14 @@ ec_dialog_response(GtkWidget *d, gint id, EConfig *ec) * Return value: The window widget. This is also stored in @emp.window. **/ GtkWidget * -e_config_create_window(EConfig *emp, GtkWindow *parent, const gchar *title) +e_config_create_window (EConfig *emp, GtkWindow *parent, const gchar *title) { GtkWidget *w; - e_config_create_widget(emp); + e_config_create_widget (emp); if (emp->type == E_CONFIG_BOOK) { - w = gtk_dialog_new_with_buttons(title, parent, + w = gtk_dialog_new_with_buttons (title, parent, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, @@ -1155,7 +1155,7 @@ e_config_create_window(EConfig *emp, GtkWindow *parent, const gchar *title) gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (w))), 0); gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (w))), 12); - gtk_box_pack_start((GtkBox *)gtk_dialog_get_content_area (((GtkDialog *)w)), emp->widget, TRUE, TRUE, 0); + gtk_box_pack_start ((GtkBox *)gtk_dialog_get_content_area (((GtkDialog *)w)), emp->widget, TRUE, TRUE, 0); } else { /* response is handled directly by the assistant stuff */ w = emp->widget; @@ -1163,7 +1163,7 @@ e_config_create_window(EConfig *emp, GtkWindow *parent, const gchar *title) } emp->window = w; - gtk_widget_show(w); + gtk_widget_show (w); return w; } @@ -1175,10 +1175,10 @@ ec_call_page_check (EConfig *emp) ec_assistant_check_current (emp); } else { if (emp->window) { - if (e_config_page_check(emp, NULL)) { - gtk_dialog_set_response_sensitive((GtkDialog *)emp->window, GTK_RESPONSE_OK, TRUE); + if (e_config_page_check (emp, NULL)) { + gtk_dialog_set_response_sensitive ((GtkDialog *)emp->window, GTK_RESPONSE_OK, TRUE); } else { - gtk_dialog_set_response_sensitive((GtkDialog *)emp->window, GTK_RESPONSE_OK, FALSE); + gtk_dialog_set_response_sensitive ((GtkDialog *)emp->window, GTK_RESPONSE_OK, FALSE); } } } @@ -1209,7 +1209,7 @@ ec_idle_handler_for_rebuild (gpointer data) * button for the Notebook mode. **/ void -e_config_target_changed(EConfig *emp, e_config_target_change_t how) +e_config_target_changed (EConfig *emp, e_config_target_change_t how) { if (how == E_CONFIG_TARGET_CHANGED_REBUILD) { g_idle_add (ec_idle_handler_for_rebuild, emp); @@ -1322,7 +1322,7 @@ e_config_page_check (EConfig *config, const gchar *pageid) * container or the GtkVBox object inside the assistant. **/ GtkWidget * -e_config_page_get(EConfig *ec, const gchar *pageid) +e_config_page_get (EConfig *ec, const gchar *pageid) { GList *link; @@ -1336,7 +1336,7 @@ e_config_page_get(EConfig *ec, const gchar *pageid) || wn->item->type == E_CONFIG_PAGE_START || wn->item->type == E_CONFIG_PAGE_FINISH || wn->item->type == E_CONFIG_PAGE_PROGRESS) - && !strcmp(wn->item->path, pageid)) + && !strcmp (wn->item->path, pageid)) return wn->frame; link = g_list_next (link); @@ -1357,7 +1357,7 @@ e_config_page_get(EConfig *ec, const gchar *pageid) * last configured and visible page. **/ const gchar * -e_config_page_next(EConfig *ec, const gchar *pageid) +e_config_page_next (EConfig *ec, const gchar *pageid) { GList *link; gint found; @@ -1375,7 +1375,7 @@ e_config_page_next(EConfig *ec, const gchar *pageid) || wn->item->type == E_CONFIG_PAGE_PROGRESS)) { if (found) return wn->item->path; - else if (strcmp(wn->item->path, pageid) == 0) + else if (strcmp (wn->item->path, pageid) == 0) found = 1; } @@ -1397,7 +1397,7 @@ e_config_page_next(EConfig *ec, const gchar *pageid) * first configured and visible page. **/ const gchar * -e_config_page_prev(EConfig *ec, const gchar *pageid) +e_config_page_prev (EConfig *ec, const gchar *pageid) { GList *link; gint found; @@ -1415,7 +1415,7 @@ e_config_page_prev(EConfig *ec, const gchar *pageid) || wn->item->type == E_CONFIG_PAGE_PROGRESS)) { if (found) return wn->item->path; - else if (strcmp(wn->item->path, pageid) == 0) + else if (strcmp (wn->item->path, pageid) == 0) found = 1; } @@ -1493,18 +1493,18 @@ e_config_class_remove_factory (EConfigClass *class, * Allocate a new config target suitable for this class. Implementing * classes will define the actual content of the target. **/ -gpointer e_config_target_new(EConfig *ep, gint type, gsize size) +gpointer e_config_target_new (EConfig *ep, gint type, gsize size) { EConfigTarget *t; - if (size < sizeof(EConfigTarget)) { + if (size < sizeof (EConfigTarget)) { g_warning ("Size is less than size of EConfigTarget\n"); size = sizeof (EConfigTarget); } - t = g_malloc0(size); + t = g_malloc0 (size); t->config = ep; - g_object_ref(ep); + g_object_ref (ep); t->type = type; return t; @@ -1519,11 +1519,11 @@ gpointer e_config_target_new(EConfig *ep, gint type, gsize size) * free custom targets. **/ void -e_config_target_free(EConfig *ep, gpointer o) +e_config_target_free (EConfig *ep, gpointer o) { EConfigTarget *t = o; - ((EConfigClass *)G_OBJECT_GET_CLASS(ep))->target_free(ep, t); + ((EConfigClass *)G_OBJECT_GET_CLASS (ep))->target_free (ep, t); } /* ********************************************************************** */ @@ -1575,25 +1575,25 @@ G_DEFINE_TYPE ( E_TYPE_PLUGIN_HOOK) static void -ech_commit(EConfig *ec, GSList *items, gpointer data) +ech_commit (EConfig *ec, GSList *items, gpointer data) { struct _EConfigHookGroup *group = data; if (group->commit && group->hook->hook.plugin->enabled) - e_plugin_invoke(group->hook->hook.plugin, group->commit, ec->target); + e_plugin_invoke (group->hook->hook.plugin, group->commit, ec->target); } static void -ech_abort(EConfig *ec, GSList *items, gpointer data) +ech_abort (EConfig *ec, GSList *items, gpointer data) { struct _EConfigHookGroup *group = data; if (group->abort && group->hook->hook.plugin->enabled) - e_plugin_invoke(group->hook->hook.plugin, group->abort, ec->target); + e_plugin_invoke (group->hook->hook.plugin, group->abort, ec->target); } static gboolean -ech_check(EConfig *ec, const gchar *pageid, gpointer data) +ech_check (EConfig *ec, const gchar *pageid, gpointer data) { struct _EConfigHookGroup *group = data; EConfigHookPageCheckData hdata; @@ -1605,11 +1605,11 @@ ech_check(EConfig *ec, const gchar *pageid, gpointer data) hdata.target = ec->target; hdata.pageid = pageid?pageid:""; - return GPOINTER_TO_INT(e_plugin_invoke(group->hook->hook.plugin, group->check, &hdata)); + return GPOINTER_TO_INT (e_plugin_invoke (group->hook->hook.plugin, group->check, &hdata)); } static void -ech_config_factory(EConfig *emp, gpointer data) +ech_config_factory (EConfig *emp, gpointer data) { struct _EConfigHookGroup *group = data; @@ -1620,29 +1620,29 @@ ech_config_factory(EConfig *emp, gpointer data) return; if (group->items) - e_config_add_items(emp, group->items, ech_commit, ech_abort, NULL, group); + e_config_add_items (emp, group->items, ech_commit, ech_abort, NULL, group); if (group->check) - e_config_add_page_check(emp, NULL, ech_check, group); + e_config_add_page_check (emp, NULL, ech_check, group); } static void -emph_free_item(struct _EConfigItem *item) +emph_free_item (struct _EConfigItem *item) { - g_free(item->path); - g_free(item->label); - g_free(item->user_data); - g_free(item); + g_free (item->path); + g_free (item->label); + g_free (item->user_data); + g_free (item); } static void -emph_free_group(struct _EConfigHookGroup *group) +emph_free_group (struct _EConfigHookGroup *group) { - g_slist_foreach(group->items, (GFunc)emph_free_item, NULL); - g_slist_free(group->items); + g_slist_foreach (group->items, (GFunc)emph_free_item, NULL); + g_slist_free (group->items); - g_free(group->id); - g_free(group); + g_free (group->id); + g_free (group); } static GtkWidget * @@ -1737,12 +1737,12 @@ ech_config_section_factory (EConfig *config, } static struct _EConfigItem * -emph_construct_item(EPluginHook *eph, EConfigHookGroup *menu, xmlNodePtr root, EConfigHookTargetMap *map) +emph_construct_item (EPluginHook *eph, EConfigHookGroup *menu, xmlNodePtr root, EConfigHookTargetMap *map) { struct _EConfigItem *item; d(printf(" loading config item\n")); - item = g_malloc0(sizeof(*item)); + item = g_malloc0 (sizeof (*item)); if ((item->type = e_plugin_hook_id(root, ech_item_types, "type")) == -1) goto error; item->path = e_plugin_xml_prop(root, "path"); @@ -1765,27 +1765,27 @@ emph_construct_item(EPluginHook *eph, EConfigHookGroup *menu, xmlNodePtr root, E return item; error: d(printf("error!\n")); - emph_free_item(item); + emph_free_item (item); return NULL; } static struct _EConfigHookGroup * -emph_construct_menu(EPluginHook *eph, xmlNodePtr root) +emph_construct_menu (EPluginHook *eph, xmlNodePtr root) { struct _EConfigHookGroup *menu; xmlNodePtr node; EConfigHookTargetMap *map; - EConfigHookClass *class = (EConfigHookClass *)G_OBJECT_GET_CLASS(eph); + EConfigHookClass *class = (EConfigHookClass *)G_OBJECT_GET_CLASS (eph); gchar *tmp; d(printf(" loading menu\n")); - menu = g_malloc0(sizeof(*menu)); + menu = g_malloc0 (sizeof (*menu)); tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; - map = g_hash_table_lookup(class->target_map, tmp); - xmlFree(tmp); + map = g_hash_table_lookup (class->target_map, tmp); + xmlFree (tmp); if (map == NULL) goto error; @@ -1793,7 +1793,7 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) menu->id = e_plugin_xml_prop(root, "id"); if (menu->id == NULL) { g_warning("Plugin '%s' missing 'id' field in group for '%s'\n", eph->plugin->name, - ((EPluginHookClass *)G_OBJECT_GET_CLASS(eph))->id); + ((EPluginHookClass *)G_OBJECT_GET_CLASS (eph))->id); goto error; } menu->check = e_plugin_xml_prop(root, "check"); @@ -1805,41 +1805,41 @@ emph_construct_menu(EPluginHook *eph, xmlNodePtr root) if (0 == strcmp((gchar *)node->name, "item")) { struct _EConfigItem *item; - item = emph_construct_item(eph, menu, node, map); + item = emph_construct_item (eph, menu, node, map); if (item) - menu->items = g_slist_append(menu->items, item); + menu->items = g_slist_append (menu->items, item); } node = node->next; } return menu; error: - emph_free_group(menu); + emph_free_group (menu); return NULL; } static gint -emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +emph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) { xmlNodePtr node; EConfigClass *class; d(printf("loading config hook\n")); - if (((EPluginHookClass *)e_config_hook_parent_class)->construct(eph, ep, root) == -1) + if (((EPluginHookClass *)e_config_hook_parent_class)->construct (eph, ep, root) == -1) return -1; - class = ((EConfigHookClass *)G_OBJECT_GET_CLASS(eph))->config_class; + class = ((EConfigHookClass *)G_OBJECT_GET_CLASS (eph))->config_class; node = root->children; while (node) { if (strcmp((gchar *)node->name, "group") == 0) { struct _EConfigHookGroup *group; - group = emph_construct_menu(eph, node); + group = emph_construct_menu (eph, node); if (group) { - e_config_class_add_factory(class, group->id, ech_config_factory, group); - emph->groups = g_slist_append(emph->groups, group); + e_config_class_add_factory (class, group->id, ech_config_factory, group); + emph->groups = g_slist_append (emph->groups, group); } } node = node->next; @@ -1851,14 +1851,14 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) } static void -emph_finalize(GObject *o) +emph_finalize (GObject *o) { EPluginHook *eph = (EPluginHook *)o; - g_slist_foreach(emph->groups, (GFunc)emph_free_group, NULL); - g_slist_free(emph->groups); + g_slist_foreach (emph->groups, (GFunc)emph_free_group, NULL); + g_slist_free (emph->groups); - ((GObjectClass *)e_config_hook_parent_class)->finalize(o); + ((GObjectClass *)e_config_hook_parent_class)->finalize (o); } static void @@ -1877,7 +1877,7 @@ e_config_hook_class_init (EConfigHookClass *class) plugin_hook_class->id = "org.gnome.evolution.config:1.0"; class->target_map = g_hash_table_new (g_str_hash, g_str_equal); - class->config_class = g_type_class_ref (e_config_get_type()); + class->config_class = g_type_class_ref (e_config_get_type ()); } static void @@ -1900,5 +1900,5 @@ void e_config_hook_class_add_target_map (EConfigHookClass *class, const EConfigHookTargetMap *map) { - g_hash_table_insert(class->target_map, (gpointer)map->type, (gpointer)map); + g_hash_table_insert (class->target_map, (gpointer)map->type, (gpointer)map); } diff --git a/e-util/e-config.h b/e-util/e-config.h index 6df90ceb52..7daf83fa07 100644 --- a/e-util/e-config.h +++ b/e-util/e-config.h @@ -241,35 +241,35 @@ struct _EConfigClass { EConfigTarget *target); }; -GType e_config_get_type(void); +GType e_config_get_type (void); /* Static class methods */ -EConfigFactory *e_config_class_add_factory(EConfigClass *klass, const gchar *id, EConfigFactoryFunc func, gpointer user_data); -void e_config_class_remove_factory(EConfigClass *klass, EConfigFactory *f); +EConfigFactory *e_config_class_add_factory (EConfigClass *klass, const gchar *id, EConfigFactoryFunc func, gpointer user_data); +void e_config_class_remove_factory (EConfigClass *klass, EConfigFactory *f); -EConfig *e_config_construct(EConfig *, gint type, const gchar *id); +EConfig *e_config_construct (EConfig *, gint type, const gchar *id); -void e_config_add_items(EConfig *, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, gpointer data); -void e_config_add_page_check(EConfig *, const gchar *pageid, EConfigCheckFunc, gpointer data); +void e_config_add_items (EConfig *, GSList *items, EConfigItemsFunc commitfunc, EConfigItemsFunc abortfunc, EConfigItemsFunc freefunc, gpointer data); +void e_config_add_page_check (EConfig *, const gchar *pageid, EConfigCheckFunc, gpointer data); void e_config_set_page_is_finish (EConfig *ec, const gchar *pageid, gboolean is_finish); -void e_config_set_target(EConfig *emp, EConfigTarget *target); -GtkWidget *e_config_create_widget(EConfig *); -GtkWidget *e_config_create_window(EConfig *emp, GtkWindow *parent, const gchar *title); +void e_config_set_target (EConfig *emp, EConfigTarget *target); +GtkWidget *e_config_create_widget (EConfig *); +GtkWidget *e_config_create_window (EConfig *emp, GtkWindow *parent, const gchar *title); -void e_config_target_changed(EConfig *emp, e_config_target_change_t how); +void e_config_target_changed (EConfig *emp, e_config_target_change_t how); -gboolean e_config_page_check(EConfig *, const gchar *); +gboolean e_config_page_check (EConfig *, const gchar *); -GtkWidget *e_config_page_get(EConfig *ec, const gchar *pageid); -const gchar *e_config_page_next(EConfig *ec, const gchar *pageid); -const gchar *e_config_page_prev(EConfig *ec, const gchar *pageid); +GtkWidget *e_config_page_get (EConfig *ec, const gchar *pageid); +const gchar *e_config_page_next (EConfig *ec, const gchar *pageid); +const gchar *e_config_page_prev (EConfig *ec, const gchar *pageid); -void e_config_abort(EConfig *); -void e_config_commit(EConfig *); +void e_config_abort (EConfig *); +void e_config_commit (EConfig *); -gpointer e_config_target_new(EConfig *, gint type, gsize size); -void e_config_target_free(EConfig *, gpointer ); +gpointer e_config_target_new (EConfig *, gint type, gsize size); +void e_config_target_free (EConfig *, gpointer ); /* ********************************************************************** */ @@ -394,10 +394,10 @@ struct _EConfigHookClass { EConfigClass *config_class; }; -GType e_config_hook_get_type(void); +GType e_config_hook_get_type (void); /* for implementors */ -void e_config_hook_class_add_target_map(EConfigHookClass *klass, const EConfigHookTargetMap *); +void e_config_hook_class_add_target_map (EConfigHookClass *klass, const EConfigHookTargetMap *); G_END_DECLS diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c index f927a275b8..c41fc08c41 100644 --- a/e-util/e-datetime-format.c +++ b/e-util/e-datetime-format.c @@ -229,7 +229,7 @@ format_internal (const gchar *key, DTFormatKind kind, time_t tvalue, struct tm * struct tm today, value; time_t ttoday; - tzset(); + tzset (); if (!tm_value) { localtime_r (&tvalue, &value); tm_value = &value; diff --git a/e-util/e-event.c b/e-util/e-event.c index 9edde9c196..6d0ece99bf 100644 --- a/e-util/e-event.c +++ b/e-util/e-event.c @@ -82,8 +82,8 @@ event_finalize (GObject *object) g_free (node); } - g_slist_foreach(p->sorted, (GFunc)g_free, NULL); - g_slist_free(p->sorted); + g_slist_foreach (p->sorted, (GFunc)g_free, NULL); + g_slist_free (p->sorted); /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (e_event_parent_class)->finalize (object); @@ -127,9 +127,9 @@ e_event_init (EEvent *event) * * Return value: Returns @ep. **/ -EEvent *e_event_construct(EEvent *ep, const gchar *id) +EEvent *e_event_construct (EEvent *ep, const gchar *id) { - ep->id = g_strdup(id); + ep->id = g_strdup (id); return ep; } @@ -153,7 +153,7 @@ e_event_add_items (EEvent *event, { struct _event_node *node; - node = g_malloc(sizeof(*node)); + node = g_malloc (sizeof (*node)); node->events = items; node->freefunc = freefunc; node->data = data; @@ -161,8 +161,8 @@ e_event_add_items (EEvent *event, g_queue_push_tail (&event->priv->events, node); if (event->priv->sorted) { - g_slist_foreach(event->priv->sorted, (GFunc)g_free, NULL); - g_slist_free(event->priv->sorted); + g_slist_foreach (event->priv->sorted, (GFunc)g_free, NULL); + g_slist_free (event->priv->sorted); event->priv->sorted = NULL; } @@ -178,25 +178,25 @@ e_event_add_items (EEvent *event, * added, and may only be removed once. **/ void -e_event_remove_items(EEvent *event, gpointer handle) +e_event_remove_items (EEvent *event, gpointer handle) { struct _event_node *node = handle; g_queue_remove (&event->priv->events, node); if (node->freefunc) - node->freefunc(event, node->events, node->data); - g_free(node); + node->freefunc (event, node->events, node->data); + g_free (node); if (event->priv->sorted) { - g_slist_foreach(event->priv->sorted, (GFunc)g_free, NULL); - g_slist_free(event->priv->sorted); + g_slist_foreach (event->priv->sorted, (GFunc)g_free, NULL); + g_slist_free (event->priv->sorted); event->priv->sorted = NULL; } } static gint -ee_cmp(gconstpointer ap, gconstpointer bp) +ee_cmp (gconstpointer ap, gconstpointer bp) { gint a = ((struct _event_info **)ap)[0]->item->priority; gint b = ((struct _event_info **)bp)[0]->item->priority; @@ -220,7 +220,7 @@ ee_cmp(gconstpointer ap, gconstpointer bp) * emission is complete. **/ void -e_event_emit(EEvent *event, const gchar *id, EEventTarget *target) +e_event_emit (EEvent *event, const gchar *id, EEventTarget *target) { EEventPrivate *p = event->priv; GSList *events; @@ -241,22 +241,22 @@ e_event_emit(EEvent *event, const gchar *id, EEventTarget *target) struct _event_node *node = link->data; GSList *l = node->events; - for (;l;l=g_slist_next(l)) { + for (;l;l=g_slist_next (l)) { struct _event_info *info; - info = g_malloc0(sizeof(*info)); + info = g_malloc0 (sizeof (*info)); info->parent = node; info->item = l->data; - events = g_slist_prepend(events, info); + events = g_slist_prepend (events, info); } link = g_list_next (link); } - p->sorted = events = g_slist_sort(events, ee_cmp); + p->sorted = events = g_slist_sort (events, ee_cmp); } - for (;events;events=g_slist_next(events)) { + for (;events;events=g_slist_next (events)) { struct _event_info *info = events->data; EEventItem *item = info->item; @@ -266,15 +266,15 @@ e_event_emit(EEvent *event, const gchar *id, EEventTarget *target) if (item->enable & target->mask) continue; - if (strcmp(item->id, id) == 0) { - item->handle(event, item, info->parent->data); + if (strcmp (item->id, id) == 0) { + item->handle (event, item, info->parent->data); if (item->type == E_EVENT_SINK) break; } } - e_event_target_free(event, target); + e_event_target_free (event, target); event->target = NULL; } @@ -295,9 +295,9 @@ e_event_target_new (EEvent *event, { EEventTarget *target; - if (size < sizeof(EEventTarget)) { + if (size < sizeof (EEventTarget)) { g_warning ("Size is less than the size of EEventTarget\n"); - size = sizeof(EEventTarget); + size = sizeof (EEventTarget); } target = g_malloc0 (size); @@ -380,7 +380,7 @@ G_DEFINE_TYPE ( E_TYPE_PLUGIN_HOOK) static void -emph_event_handle(EEvent *ee, EEventItem *item, gpointer data) +emph_event_handle (EEvent *ee, EEventItem *item, gpointer data) { EEventHook *hook = data; @@ -388,40 +388,40 @@ emph_event_handle(EEvent *ee, EEventItem *item, gpointer data) if (!hook->hook.plugin->enabled) return; - e_plugin_invoke(hook->hook.plugin, (gchar *)item->user_data, ee->target); + e_plugin_invoke (hook->hook.plugin, (gchar *)item->user_data, ee->target); } static void -emph_free_item(EEventItem *item) +emph_free_item (EEventItem *item) { - g_free((gchar *)item->id); - g_free(item->user_data); - g_free(item); + g_free ((gchar *)item->id); + g_free (item->user_data); + g_free (item); } static void -emph_free_items(EEvent *ee, GSList *items, gpointer data) +emph_free_items (EEvent *ee, GSList *items, gpointer data) { /*EPluginHook *eph = data;*/ - g_slist_foreach(items, (GFunc)emph_free_item, NULL); - g_slist_free(items); + g_slist_foreach (items, (GFunc)emph_free_item, NULL); + g_slist_free (items); } static EEventItem * -emph_construct_item(EPluginHook *eph, xmlNodePtr root, EEventHookClass *class) +emph_construct_item (EPluginHook *eph, xmlNodePtr root, EEventHookClass *class) { EEventItem *item; EEventHookTargetMap *map; gchar *tmp; - item = g_malloc0(sizeof(*item)); + item = g_malloc0 (sizeof (*item)); tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); if (tmp == NULL) goto error; - map = g_hash_table_lookup(class->target_map, tmp); - xmlFree(tmp); + map = g_hash_table_lookup (class->target_map, tmp); + xmlFree (tmp); if (map == NULL) goto error; item->target_type = map->id; @@ -440,34 +440,34 @@ emph_construct_item(EPluginHook *eph, xmlNodePtr root, EEventHookClass *class) return item; error: - emph_free_item(item); + emph_free_item (item); return NULL; } static gint -emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +emph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) { xmlNodePtr node; EEventHookClass *class; GSList *items = NULL; - g_return_val_if_fail(((EEventHookClass *)G_OBJECT_GET_CLASS(eph))->event != NULL, -1); + g_return_val_if_fail (((EEventHookClass *)G_OBJECT_GET_CLASS (eph))->event != NULL, -1); d(printf("loading event hook\n")); - if (((EPluginHookClass *)e_event_hook_parent_class)->construct(eph, ep, root) == -1) + if (((EPluginHookClass *)e_event_hook_parent_class)->construct (eph, ep, root) == -1) return -1; - class = (EEventHookClass *)G_OBJECT_GET_CLASS(eph); + class = (EEventHookClass *)G_OBJECT_GET_CLASS (eph); node = root->children; while (node) { if (strcmp((gchar *)node->name, "event") == 0) { EEventItem *item; - item = emph_construct_item(eph, node, class); + item = emph_construct_item (eph, node, class); if (item) - items = g_slist_prepend(items, item); + items = g_slist_prepend (items, item); } node = node->next; } @@ -475,7 +475,7 @@ emph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) eph->plugin = ep; if (items) - e_event_add_items(class->event, items, emph_free_items, eph); + e_event_add_items (class->event, items, emph_free_items, eph); return 0; } diff --git a/e-util/e-icon-factory.h b/e-util/e-icon-factory.h index 9cec7253bf..89a7d5a6a4 100644 --- a/e-util/e-icon-factory.h +++ b/e-util/e-icon-factory.h @@ -26,7 +26,7 @@ #include -gchar * e_icon_factory_get_icon_filename(const gchar *icon_name, +gchar * e_icon_factory_get_icon_filename (const gchar *icon_name, GtkIconSize icon_size); GdkPixbuf * e_icon_factory_get_icon (const gchar *icon_name, GtkIconSize icon_size); diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 064c01997a..5e4daa81d1 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -50,7 +50,7 @@ #define TEMP_SCAN (60) static gint -expire_dir_rec(const gchar *base, time_t now) +expire_dir_rec (const gchar *base, time_t now) { GDir *dir; const gchar *d; @@ -61,28 +61,28 @@ expire_dir_rec(const gchar *base, time_t now) d(printf("expire dir '%s'\n", base)); - dir = g_dir_open(base, 0, NULL); + dir = g_dir_open (base, 0, NULL); if (dir == NULL) return 0; - path = g_string_new(base); + path = g_string_new (base); len = path->len; - while ((d = g_dir_read_name(dir))) { - g_string_truncate(path, len); + while ((d = g_dir_read_name (dir))) { + g_string_truncate (path, len); g_string_append_printf(path, "/%s", d); d(printf("Checking '%s' for expiry\n", path->str)); - if (g_stat(path->str, &st) == 0 + if (g_stat (path->str, &st) == 0 && st.st_atime + TEMP_EXPIRE < now) { - if (S_ISDIR(st.st_mode)) { - if (expire_dir_rec(path->str, now) == 0) { + if (S_ISDIR (st.st_mode)) { + if (expire_dir_rec (path->str, now) == 0) { d(printf("Removing dir '%s'\n", path->str)); - g_rmdir(path->str); + g_rmdir (path->str); } else { count++; } - } else if (g_unlink(path->str) == -1) { + } else if (g_unlink (path->str) == -1) { d(printf("expiry failed: %s\n", g_strerror(errno))); count++; } else { @@ -92,8 +92,8 @@ expire_dir_rec(const gchar *base, time_t now) count++; } } - g_string_free(path, TRUE); - g_dir_close(dir); + g_string_free (path, TRUE); + g_dir_close (dir); d(printf("expire dir '%s' %d remaining files\n", base, count)); @@ -104,7 +104,7 @@ static GString * get_dir (gboolean make) { GString *path; - time_t now = time(NULL); + time_t now = time (NULL); static time_t last = 0; #ifdef TEMP_HOME @@ -113,12 +113,12 @@ get_dir (gboolean make) user_cache_dir = e_get_user_cache_dir (); tmpdir = g_build_filename (user_cache_dir, "tmp", NULL); - path = g_string_new(tmpdir); - if (make && g_mkdir_with_parents(tmpdir, 0777) == -1) { - g_string_free(path, TRUE); + path = g_string_new (tmpdir); + if (make && g_mkdir_with_parents (tmpdir, 0777) == -1) { + g_string_free (path, TRUE); path = NULL; } - g_free(tmpdir); + g_free (tmpdir); #else path = g_string_new("/tmp/evolution-"); g_string_append_printf (path, "%d", (gint) getuid ()); @@ -158,7 +158,7 @@ get_dir (gboolean make) /* fire off an expiry attempt no more often than TEMP_SCAN seconds */ if (path && (last+TEMP_SCAN) < now) { last = now; - expire_dir_rec(path->str, now); + expire_dir_rec (path->str, now); } return path; @@ -207,7 +207,7 @@ e_mkstemp (const gchar *template) g_string_append (path, "unknown-XXXXXX"); fd = g_mkstemp (path->str); - g_string_free(path, TRUE); + g_string_free (path, TRUE); return fd; } @@ -247,7 +247,7 @@ e_mkdtemp (const gchar *template) tmpdir = NULL; } #endif - g_string_free(path, tmpdir == NULL); + g_string_free (path, tmpdir == NULL); return tmpdir; } diff --git a/e-util/e-non-intrusive-error-dialog.c b/e-util/e-non-intrusive-error-dialog.c index 4e7e8a2d58..fb7f1f3afc 100644 --- a/e-util/e-non-intrusive-error-dialog.c +++ b/e-util/e-non-intrusive-error-dialog.c @@ -262,7 +262,7 @@ eni_show_logger (ELogger *logger, GTK_SCROLLED_WINDOW (container), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (vbox), container, TRUE, TRUE, 0); - widget = gtk_tree_view_new(); + widget = gtk_tree_view_new (); gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (widget), TRUE); gtk_tree_view_set_reorderable (GTK_TREE_VIEW (widget), FALSE); gtk_tree_view_set_model (GTK_TREE_VIEW (widget), GTK_TREE_MODEL (store)); @@ -293,7 +293,7 @@ eni_show_logger (ELogger *logger, column, renderer, eni_render_date, NULL, NULL); renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes( + gtk_tree_view_insert_column_with_attributes ( GTK_TREE_VIEW (widget), -1, _("Messages"), renderer, "markup", COL_DATA, NULL); diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index a1906d7f3f..0da1151d21 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -111,7 +111,7 @@ ep_set_enabled (const gchar *id, gint state) GConfClient *client; /* Bail out if no change to state, when expressed as a boolean: */ - if ((state == 0) == (ep_check_enabled(id) == 0)) + if ((state == 0) == (ep_check_enabled (id) == 0)) return; if (state) { @@ -151,8 +151,8 @@ ep_construct (EPlugin *ep, xmlNodePtr root) g_free (localedir); localedir = mapped_localedir; #endif - bindtextdomain(ep->domain, localedir); - g_free(localedir); + bindtextdomain (ep->domain, localedir); + g_free (localedir); } ep->name = e_plugin_xml_prop_domain(root, "name", ep->domain); @@ -176,32 +176,32 @@ ep_construct (EPlugin *ep, xmlNodePtr root) if (ep->enabled && eph_types != NULL - && (type = g_hash_table_lookup(eph_types, class)) != NULL) { - g_free(class); - hook = g_object_new(G_OBJECT_CLASS_TYPE(type), NULL); - res = type->construct(hook, ep, node); + && (type = g_hash_table_lookup (eph_types, class)) != NULL) { + g_free (class); + hook = g_object_new (G_OBJECT_CLASS_TYPE (type), NULL); + res = type->construct (hook, ep, node); if (res == -1) { g_warning("Plugin '%s' failed to load hook", ep->name); - g_object_unref(hook); + g_object_unref (hook); goto fail; } else { - ep->hooks = g_slist_append(ep->hooks, hook); + ep->hooks = g_slist_append (ep->hooks, hook); } } else { g_free (class); } } else if (strcmp((gchar *)node->name, "description") == 0) { - ep->description = e_plugin_xml_content_domain(node, ep->domain); + ep->description = e_plugin_xml_content_domain (node, ep->domain); } else if (strcmp((gchar *)node->name, "author") == 0) { gchar *name = e_plugin_xml_prop(node, "name"); gchar *email = e_plugin_xml_prop(node, "email"); if (name || email) { - EPluginAuthor *epa = g_malloc0(sizeof(*epa)); + EPluginAuthor *epa = g_malloc0 (sizeof (*epa)); epa->name = name; epa->email = email; - ep->authors = g_slist_append(ep->authors, epa); + ep->authors = g_slist_append (ep->authors, epa); } } node = node->next; @@ -222,7 +222,7 @@ ep_enable (EPlugin *ep, gint state) e_plugin_hook_enable (hook, state); } - ep_set_enabled(ep->id, state); + ep_set_enabled (ep->id, state); } static void @@ -305,19 +305,19 @@ e_plugin_class_init (EPluginClass *class) path = g_strdup(g_getenv("EVOLUTION_PLUGIN_PATH")); if (path == NULL) { /* Add the global path */ - e_plugin_add_load_path(EVOLUTION_PLUGINDIR); + e_plugin_add_load_path (EVOLUTION_PLUGINDIR); path = g_build_filename(g_get_home_dir(), ".eplugins", NULL); } p = path; - while ((col = strchr(p, G_SEARCHPATH_SEPARATOR))) { + while ((col = strchr (p, G_SEARCHPATH_SEPARATOR))) { *col++ = 0; - e_plugin_add_load_path(p); + e_plugin_add_load_path (p); p = col; } - e_plugin_add_load_path(p); - g_free(path); + e_plugin_add_load_path (p); + g_free (path); } static void @@ -327,7 +327,7 @@ e_plugin_init (EPlugin *ep) } static EPlugin * -ep_load_plugin(xmlNodePtr root, struct _plugin_doc *pdoc) +ep_load_plugin (xmlNodePtr root, struct _plugin_doc *pdoc) { gchar *prop, *id; EPluginClass *class; @@ -339,44 +339,44 @@ ep_load_plugin(xmlNodePtr root, struct _plugin_doc *pdoc) return NULL; } - if (g_hash_table_lookup(ep_plugins, id)) { + if (g_hash_table_lookup (ep_plugins, id)) { g_warning("Plugin '%s' already defined", id); - g_free(id); + g_free (id); return NULL; } prop = (gchar *)xmlGetProp(root, (const guchar *)"type"); if (prop == NULL) { - g_free(id); + g_free (id); g_warning("Invalid e-plugin entry in '%s': no type", pdoc->filename); return NULL; } /* If we can't find a plugin, add it to a pending list * which is checked when a new type is registered. */ - class = g_hash_table_lookup(ep_types, prop); + class = g_hash_table_lookup (ep_types, prop); if (class == NULL) { pd(printf("Delaying loading of plugin '%s' unknown type '%s'\n", id, prop)); - g_free(id); - xmlFree(prop); - pdoc->plugins = g_slist_prepend(pdoc->plugins, root); + g_free (id); + xmlFree (prop); + pdoc->plugins = g_slist_prepend (pdoc->plugins, root); return NULL; } - xmlFree(prop); + xmlFree (prop); - ep = g_object_new(G_TYPE_FROM_CLASS(class), NULL); + ep = g_object_new (G_TYPE_FROM_CLASS (class), NULL); ep->id = id; - ep->path = g_strdup(pdoc->filename); - ep->enabled = ep_check_enabled(id); - if (e_plugin_construct(ep, root) == -1) - e_plugin_enable(ep, FALSE); - g_hash_table_insert(ep_plugins, ep->id, ep); + ep->path = g_strdup (pdoc->filename); + ep->enabled = ep_check_enabled (id); + if (e_plugin_construct (ep, root) == -1) + e_plugin_enable (ep, FALSE); + g_hash_table_insert (ep_plugins, ep->id, ep); return ep; } static gint -ep_load(const gchar *filename, gint load_level) +ep_load (const gchar *filename, gint load_level) { xmlDocPtr doc; xmlNodePtr root; @@ -387,16 +387,16 @@ ep_load(const gchar *filename, gint load_level) if (doc == NULL) return -1; - root = xmlDocGetRootElement(doc); + root = xmlDocGetRootElement (doc); if (strcmp((gchar *)root->name, "e-plugin-list") != 0) { g_warning("No root element: %s", filename); - xmlFreeDoc(doc); + xmlFreeDoc (doc); return -1; } - pdoc = g_malloc0(sizeof(*pdoc)); + pdoc = g_malloc0 (sizeof (*pdoc)); pdoc->doc = doc; - pdoc->filename = g_strdup(filename); + pdoc->filename = g_strdup (filename); for (root = root->children; root; root = root->next) { if (strcmp((gchar *)root->name, "e-plugin") == 0) { @@ -406,7 +406,7 @@ ep_load(const gchar *filename, gint load_level) plugin_load_level = e_plugin_xml_prop (root, "load_level"); if (plugin_load_level) { if ((atoi (plugin_load_level) == load_level) ) { - ep = ep_load_plugin(root, pdoc); + ep = ep_load_plugin (root, pdoc); if (ep) { if (load_level == 1) @@ -414,7 +414,7 @@ ep_load(const gchar *filename, gint load_level) } } } else if (load_level == 2) { - ep = ep_load_plugin(root, pdoc); + ep = ep_load_plugin (root, pdoc); } if (ep) { @@ -430,7 +430,7 @@ ep_load(const gchar *filename, gint load_level) ep->flags &= ~E_PLUGIN_FLAGS_SYSTEM_PLUGIN; g_free (is_system_plugin); - pdoc->plugin_hooks = g_slist_prepend(pdoc->plugin_hooks, ep); + pdoc->plugin_hooks = g_slist_prepend (pdoc->plugin_hooks, ep); ep = NULL; } } @@ -458,9 +458,9 @@ ep_load(const gchar *filename, gint load_level) * Plugin definitions are XML files ending in the extension ".eplug". **/ void -e_plugin_add_load_path(const gchar *path) +e_plugin_add_load_path (const gchar *path) { - ep_path = g_slist_append(ep_path, g_strdup(path)); + ep_path = g_slist_append (ep_path, g_strdup (path)); } static void @@ -519,7 +519,7 @@ plugin_hook_load_subclass (GType type, * Return value: Returns -1 if an error occurred. **/ gint -e_plugin_load_plugins(void) +e_plugin_load_plugins (void) { GConfClient *client; GSList *l; @@ -549,29 +549,29 @@ e_plugin_load_plugins(void) g_object_unref (client); for (i=0; i < 3; i++) { - for (l = ep_path;l;l = g_slist_next(l)) { + for (l = ep_path;l;l = g_slist_next (l)) { GDir *dir; const gchar *d; gchar *path = l->data; pd(printf("scanning plugin dir '%s'\n", path)); - dir = g_dir_open(path, 0, NULL); + dir = g_dir_open (path, 0, NULL); if (dir == NULL) { /*g_warning("Could not find plugin path: %s", path);*/ continue; } - while ((d = g_dir_read_name(dir))) { + while ((d = g_dir_read_name (dir))) { if (g_str_has_suffix (d, ".eplug")) { - gchar * name = g_build_filename(path, d, NULL); + gchar * name = g_build_filename (path, d, NULL); - ep_load(name, i); - g_free(name); + ep_load (name, i); + g_free (name); } } - g_dir_close(dir); + g_dir_close (dir); } } @@ -579,7 +579,7 @@ e_plugin_load_plugins(void) } static void -ep_list_plugin(gpointer key, gpointer val, gpointer dat) +ep_list_plugin (gpointer key, gpointer val, gpointer dat) { GSList **l = (GSList **)dat; @@ -596,12 +596,12 @@ ep_list_plugin(gpointer key, gpointer val, gpointer dat) * g_object_unref'd and the list freed. **/ GSList * -e_plugin_list_plugins(void) +e_plugin_list_plugins (void) { GSList *l = NULL; if (ep_plugins) - g_hash_table_foreach(ep_plugins, ep_list_plugin, &l); + g_hash_table_foreach (ep_plugins, ep_list_plugin, &l); return l; } @@ -617,7 +617,7 @@ e_plugin_list_plugins(void) * Return value: The return from the construct virtual method. **/ gint -e_plugin_construct(EPlugin *ep, xmlNodePtr root) +e_plugin_construct (EPlugin *ep, xmlNodePtr root) { EPluginClass *class; @@ -643,7 +643,7 @@ e_plugin_construct(EPlugin *ep, xmlNodePtr root) * Return value: The return of the plugin invocation. **/ gpointer -e_plugin_invoke(EPlugin *ep, const gchar *name, gpointer data) +e_plugin_invoke (EPlugin *ep, const gchar *name, gpointer data) { EPluginClass *class; @@ -670,7 +670,7 @@ e_plugin_invoke(EPlugin *ep, const gchar *name, gpointer data) * Return value: the symbol value, or %NULL if not found **/ gpointer -e_plugin_get_symbol(EPlugin *ep, const gchar *name) +e_plugin_get_symbol (EPlugin *ep, const gchar *name) { EPluginClass *class; @@ -692,7 +692,7 @@ e_plugin_get_symbol(EPlugin *ep, const gchar *name) * THIS IS NOT FULLY IMPLEMENTED YET **/ void -e_plugin_enable(EPlugin *ep, gint state) +e_plugin_enable (EPlugin *ep, gint state) { EPluginClass *class; @@ -744,17 +744,17 @@ e_plugin_get_configure_widget (EPlugin *ep) * such property exists. **/ gchar * -e_plugin_xml_prop(xmlNodePtr node, const gchar *id) +e_plugin_xml_prop (xmlNodePtr node, const gchar *id) { - gchar *p = (gchar *)xmlGetProp(node, (const guchar *)id); + gchar *p = (gchar *)xmlGetProp (node, (const guchar *)id); - if (g_mem_is_system_malloc()) { + if (g_mem_is_system_malloc ()) { return p; } else { - gchar * out = g_strdup(p); + gchar * out = g_strdup (p); if (p) - xmlFree(p); + xmlFree (p); return out; } } @@ -772,16 +772,16 @@ e_plugin_xml_prop(xmlNodePtr node, const gchar *id) * such property exists. **/ gchar * -e_plugin_xml_prop_domain(xmlNodePtr node, const gchar *id, const gchar *domain) +e_plugin_xml_prop_domain (xmlNodePtr node, const gchar *id, const gchar *domain) { gchar *p, *out; - p = (gchar *)xmlGetProp(node, (const guchar *)id); + p = (gchar *)xmlGetProp (node, (const guchar *)id); if (p == NULL) return NULL; - out = g_strdup(dgettext(domain, p)); - xmlFree(p); + out = g_strdup (dgettext (domain, p)); + xmlFree (p); return out; } @@ -800,12 +800,12 @@ e_plugin_xml_prop_domain(xmlNodePtr node, const gchar *id, const gchar *domain) * Return value: The value if set, or @def if not. **/ gint -e_plugin_xml_int(xmlNodePtr node, const gchar *id, gint def) +e_plugin_xml_int (xmlNodePtr node, const gchar *id, gint def) { - gchar *p = (gchar *)xmlGetProp(node, (const guchar *)id); + gchar *p = (gchar *)xmlGetProp (node, (const guchar *)id); if (p) - return atoi(p); + return atoi (p); else return def; } @@ -821,17 +821,17 @@ e_plugin_xml_int(xmlNodePtr node, const gchar *id, gint def) * Return value: The node content, allocated in GLib memory. **/ gchar * -e_plugin_xml_content(xmlNodePtr node) +e_plugin_xml_content (xmlNodePtr node) { - gchar *p = (gchar *)xmlNodeGetContent(node); + gchar *p = (gchar *)xmlNodeGetContent (node); - if (g_mem_is_system_malloc()) { + if (g_mem_is_system_malloc ()) { return p; } else { - gchar * out = g_strdup(p); + gchar * out = g_strdup (p); if (p) - xmlFree(p); + xmlFree (p); return out; } } @@ -848,16 +848,16 @@ e_plugin_xml_content(xmlNodePtr node) * Return value: The node content, allocated in GLib memory. **/ gchar * -e_plugin_xml_content_domain(xmlNodePtr node, const gchar *domain) +e_plugin_xml_content_domain (xmlNodePtr node, const gchar *domain) { gchar *p, *out; - p = (gchar *)xmlNodeGetContent(node); + p = (gchar *)xmlNodeGetContent (node); if (p == NULL) return NULL; - out = g_strdup(dgettext(domain, p)); - xmlFree(p); + out = g_strdup (dgettext (domain, p)); + xmlFree (p); return out; } @@ -870,7 +870,7 @@ G_DEFINE_TYPE ( G_TYPE_OBJECT) static gint -eph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) +eph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) { eph->plugin = ep; @@ -878,7 +878,7 @@ eph_construct(EPluginHook *eph, EPlugin *ep, xmlNodePtr root) } static void -eph_enable(EPluginHook *eph, gint state) +eph_enable (EPluginHook *eph, gint state) { /* NOOP */ } @@ -941,7 +941,7 @@ e_plugin_hook_mask (xmlNodePtr root, gchar *val, *p, *start, c; guint32 mask = 0; - val = (gchar *)xmlGetProp(root, (const guchar *)prop); + val = (gchar *)xmlGetProp (root, (const guchar *)prop); if (val == NULL) return 0; @@ -956,7 +956,7 @@ e_plugin_hook_mask (xmlNodePtr root, gint i; for (i=0;map[i].key;i++) { - if (!strcmp(map[i].key, start)) { + if (!strcmp (map[i].key, start)) { mask |= map[i].value; break; } @@ -965,7 +965,7 @@ e_plugin_hook_mask (xmlNodePtr root, *p++ = c; } while (c); - xmlFree(val); + xmlFree (val); return mask; } @@ -994,18 +994,18 @@ e_plugin_hook_id (xmlNodePtr root, gchar *val; gint i; - val = (gchar *)xmlGetProp(root, (const guchar *)prop); + val = (gchar *)xmlGetProp (root, (const guchar *)prop); if (val == NULL) return ~0; for (i=0;map[i].key;i++) { - if (!strcmp(map[i].key, val)) { - xmlFree(val); + if (!strcmp (map[i].key, val)) { + xmlFree (val); return map[i].value; } } - xmlFree(val); + xmlFree (val); return ~0; } diff --git a/e-util/e-profile-event.c b/e-util/e-profile-event.c index fc2a609b26..2a455b3e45 100644 --- a/e-util/e-profile-event.c +++ b/e-util/e-profile-event.c @@ -39,18 +39,18 @@ G_DEFINE_TYPE ( E_TYPE_EVENT) static void -eme_target_free(EEvent *ep, EEventTarget *t) +eme_target_free (EEvent *ep, EEventTarget *t) { switch (t->type) { case E_PROFILE_EVENT_TARGET: { EProfileEventTarget *s = (EProfileEventTarget *)t; - g_free(s->id); - g_free(s->uid); + g_free (s->id); + g_free (s->uid); break; } } - ((EEventClass *)e_profile_event_parent_class)->target_free(ep, t); + ((EEventClass *)e_profile_event_parent_class)->target_free (ep, t); } static void @@ -65,10 +65,10 @@ e_profile_event_init (EProfileEvent *event) } EProfileEvent * -e_profile_event_peek(void) +e_profile_event_peek (void) { if (e_profile_event == NULL) { - e_profile_event = g_object_new(e_profile_event_get_type(), NULL); + e_profile_event = g_object_new (e_profile_event_get_type (), NULL); e_event_construct(&e_profile_event->popup, "org.gnome.evolution.profile.events"); } @@ -76,13 +76,13 @@ e_profile_event_peek(void) } EProfileEventTarget * -e_profile_event_target_new(EProfileEvent *eme, const gchar *id, const gchar *uid, guint32 flags) +e_profile_event_target_new (EProfileEvent *eme, const gchar *id, const gchar *uid, guint32 flags) { - EProfileEventTarget *t = e_event_target_new(&eme->popup, E_PROFILE_EVENT_TARGET, sizeof(*t)); + EProfileEventTarget *t = e_event_target_new (&eme->popup, E_PROFILE_EVENT_TARGET, sizeof (*t)); GTimeVal tv; - t->id = g_strdup(id); - t->uid = g_strdup(uid); + t->id = g_strdup (id); + t->uid = g_strdup (uid); t->target.mask = ~flags; g_get_current_time (&tv); t->tv.tv_sec = tv.tv_sec; @@ -93,10 +93,10 @@ e_profile_event_target_new(EProfileEvent *eme, const gchar *id, const gchar *uid #ifdef ENABLE_PROFILING void -e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags) +e_profile_event_emit (const gchar *id, const gchar *uid, guint32 flags) { - EProfileEvent *epe = e_profile_event_peek(); - EProfileEventTarget *t = e_profile_event_target_new(epe, id, uid, flags); + EProfileEvent *epe = e_profile_event_peek (); + EProfileEventTarget *t = e_profile_event_target_new (epe, id, uid, flags); e_event_emit((EEvent *)epe, "event", (EEventTarget *)t); } @@ -104,7 +104,7 @@ e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags) /* simply keep macro from header file expand to "nothing". #undef e_profile_event_emit static void -e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags) +e_profile_event_emit (const gchar *id, const gchar *uid, guint32 flags) { }*/ #endif @@ -136,9 +136,9 @@ e_profile_event_hook_class_init (EProfileEventHookClass *class) ((EPluginHookClass *)class)->id = "org.gnome.evolution.profile.events:1.0"; for (i=0;emeh_targets[i].type;i++) - e_event_hook_class_add_target_map((EEventHookClass *)class, &emeh_targets[i]); + e_event_hook_class_add_target_map ((EEventHookClass *)class, &emeh_targets[i]); - ((EEventHookClass *)class)->event = (EEvent *)e_profile_event_peek(); + ((EEventHookClass *)class)->event = (EEvent *)e_profile_event_peek (); } static void diff --git a/e-util/e-profile-event.h b/e-util/e-profile-event.h index 6811526a6f..800ce99008 100644 --- a/e-util/e-profile-event.h +++ b/e-util/e-profile-event.h @@ -69,9 +69,9 @@ struct _EProfileEventClass { EEventClass popup_class; }; -GType e_profile_event_get_type(void); +GType e_profile_event_get_type (void); -EProfileEvent *e_profile_event_peek(void); +EProfileEvent *e_profile_event_peek (void); EProfileEventTarget * e_profile_event_target_new (EProfileEvent *emp, @@ -81,7 +81,7 @@ e_profile_event_target_new (EProfileEvent *emp, /* we don't want ANY rubbish code lying around if we have profiling off */ #ifdef ENABLE_PROFILING -void e_profile_event_emit(const gchar *id, const gchar *uid, guint32 flags); +void e_profile_event_emit (const gchar *id, const gchar *uid, guint32 flags); #else #define e_profile_event_emit(a, b, c) #endif @@ -99,7 +99,7 @@ struct _EProfileEventHookClass { EEventHookClass hook_class; }; -GType e_profile_event_hook_get_type(void); +GType e_profile_event_hook_get_type (void); G_END_DECLS diff --git a/e-util/e-selection.h b/e-util/e-selection.h index 88ac772bae..5d44cd4839 100644 --- a/e-util/e-selection.h +++ b/e-util/e-selection.h @@ -74,7 +74,8 @@ gboolean e_targets_include_html (GdkAtom *targets, /* Clipboard Functions */ -void e_clipboard_set_calendar(GtkClipboard *clipboard, +void e_clipboard_set_calendar + (GtkClipboard *clipboard, const gchar *source, gint length); void e_clipboard_set_directory @@ -92,7 +93,8 @@ void e_clipboard_request_directory (GtkClipboard *clipboard, GtkClipboardTextReceivedFunc callback, gpointer user_data); -void e_clipboard_request_html(GtkClipboard *clipboard, +void e_clipboard_request_html + (GtkClipboard *clipboard, GtkClipboardTextReceivedFunc callback, gpointer user_data); gchar * e_clipboard_wait_for_calendar diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 16971ffbe8..e19084c4d6 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -49,7 +49,7 @@ static gboolean esa_needs_sorting (ESorter *esa); #define ESA_NEEDS_SORTING(esa) (((ESorterArray *) (esa))->compare != NULL) static gint -esort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) +esort_callback (gconstpointer data1, gconstpointer data2, gpointer user_data) { ESorterArray *esa = user_data; gint ret_val; @@ -70,7 +70,7 @@ esort_callback(gconstpointer data1, gconstpointer data2, gpointer user_data) } static void -esa_sort(ESorterArray *esa) +esa_sort (ESorterArray *esa) { gint rows; gint i; @@ -80,29 +80,29 @@ esa_sort(ESorterArray *esa) rows = esa->rows; - esa->sorted = g_new(int, rows); + esa->sorted = g_new (int, rows); for (i = 0; i < rows; i++) esa->sorted[i] = i; if (esa->compare) g_qsort_with_data ( - esa->sorted, rows, sizeof(gint), + esa->sorted, rows, sizeof (gint), esort_callback, esa); } static void -esa_backsort(ESorterArray *esa) +esa_backsort (ESorterArray *esa) { gint i, rows; if (esa->backsorted) return; - esa_sort(esa); + esa_sort (esa); rows = esa->rows; - esa->backsorted = g_new0(int, rows); + esa->backsorted = g_new0 (int, rows); for (i = 0; i < rows; i++) { esa->backsorted[esa->sorted[i]] = i; @@ -112,13 +112,13 @@ esa_backsort(ESorterArray *esa) static gint esa_model_to_sorted (ESorter *es, gint row) { - ESorterArray *esa = E_SORTER_ARRAY(es); + ESorterArray *esa = E_SORTER_ARRAY (es); - g_return_val_if_fail(row >= 0, -1); - g_return_val_if_fail(row < esa->rows, -1); + g_return_val_if_fail (row >= 0, -1); + g_return_val_if_fail (row < esa->rows, -1); - if (ESA_NEEDS_SORTING(es)) - esa_backsort(esa); + if (ESA_NEEDS_SORTING (es)) + esa_backsort (esa); if (esa->backsorted) return esa->backsorted[row]; @@ -131,11 +131,11 @@ esa_sorted_to_model (ESorter *es, gint row) { ESorterArray *esa = (ESorterArray *) es; - g_return_val_if_fail(row >= 0, -1); - g_return_val_if_fail(row < esa->rows, -1); + g_return_val_if_fail (row >= 0, -1); + g_return_val_if_fail (row < esa->rows, -1); - if (ESA_NEEDS_SORTING(es)) - esa_sort(esa); + if (ESA_NEEDS_SORTING (es)) + esa_sort (esa); if (esa->sorted) return esa->sorted[row]; @@ -146,9 +146,9 @@ esa_sorted_to_model (ESorter *es, gint row) static void esa_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { - ESorterArray *esa = E_SORTER_ARRAY(es); + ESorterArray *esa = E_SORTER_ARRAY (es); if (array || count) { - esa_backsort(esa); + esa_backsort (esa); if (array) *array = esa->backsorted; @@ -160,9 +160,9 @@ esa_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) static void esa_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { - ESorterArray *esa = E_SORTER_ARRAY(es); + ESorterArray *esa = E_SORTER_ARRAY (es); if (array || count) { - esa_sort(esa); + esa_sort (esa); if (array) *array = esa->sorted; @@ -172,19 +172,19 @@ esa_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) } static gboolean -esa_needs_sorting(ESorter *es) +esa_needs_sorting (ESorter *es) { - ESorterArray *esa = E_SORTER_ARRAY(es); + ESorterArray *esa = E_SORTER_ARRAY (es); return esa->compare != NULL; } void -e_sorter_array_clean(ESorterArray *esa) +e_sorter_array_clean (ESorterArray *esa) { - g_free(esa->sorted); + g_free (esa->sorted); esa->sorted = NULL; - g_free(esa->backsorted); + g_free (esa->backsorted); esa->backsorted = NULL; } @@ -199,11 +199,11 @@ void e_sorter_array_append (ESorterArray *esa, gint count) { gint i; - g_free(esa->backsorted); + g_free (esa->backsorted); esa->backsorted = NULL; if (esa->sorted) { - esa->sorted = g_renew(int, esa->sorted, esa->rows + count); + esa->sorted = g_renew (int, esa->sorted, esa->rows + count); for (i = 0; i < count; i++) { gint value = esa->rows; gsize pos; @@ -244,7 +244,7 @@ e_sorter_array_new (ECompareRowsFunc compare, gpointer closure) static void e_sorter_array_class_init (ESorterArrayClass *klass) { - ESorterClass *sorter_class = E_SORTER_CLASS(klass); + ESorterClass *sorter_class = E_SORTER_CLASS (klass); sorter_class->model_to_sorted = esa_model_to_sorted; sorter_class->sorted_to_model = esa_sorted_to_model; diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c index a2ff83f53d..74838e340d 100644 --- a/e-util/e-sorter.c +++ b/e-util/e-sorter.c @@ -41,7 +41,7 @@ static gint es_model_to_sorted (ESorter *es, gint row); static gint es_sorted_to_model (ESorter *es, gint row); static void es_get_model_to_sorted_array (ESorter *es, gint **array, gint *count); static void es_get_sorted_to_model_array (ESorter *es, gint **array, gint *count); -static gboolean es_needs_sorting(ESorter *es); +static gboolean es_needs_sorting (ESorter *es); static void e_sorter_class_init (ESorterClass *klass) @@ -89,7 +89,7 @@ es_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) } static gboolean -es_needs_sorting(ESorter *es) +es_needs_sorting (ESorter *es) { return FALSE; } @@ -97,11 +97,11 @@ es_needs_sorting(ESorter *es) gint e_sorter_model_to_sorted (ESorter *es, gint row) { - g_return_val_if_fail(es != NULL, -1); - g_return_val_if_fail(row >= 0, -1); + g_return_val_if_fail (es != NULL, -1); + g_return_val_if_fail (row >= 0, -1); - if (E_SORTER_GET_CLASS(es)->model_to_sorted) - return E_SORTER_GET_CLASS(es)->model_to_sorted (es, row); + if (E_SORTER_GET_CLASS (es)->model_to_sorted) + return E_SORTER_GET_CLASS (es)->model_to_sorted (es, row); else return -1; } @@ -109,11 +109,11 @@ e_sorter_model_to_sorted (ESorter *es, gint row) gint e_sorter_sorted_to_model (ESorter *es, gint row) { - g_return_val_if_fail(es != NULL, -1); - g_return_val_if_fail(row >= 0, -1); + g_return_val_if_fail (es != NULL, -1); + g_return_val_if_fail (row >= 0, -1); - if (E_SORTER_GET_CLASS(es)->sorted_to_model) - return E_SORTER_GET_CLASS(es)->sorted_to_model (es, row); + if (E_SORTER_GET_CLASS (es)->sorted_to_model) + return E_SORTER_GET_CLASS (es)->sorted_to_model (es, row); else return -1; } @@ -121,28 +121,28 @@ e_sorter_sorted_to_model (ESorter *es, gint row) void e_sorter_get_model_to_sorted_array (ESorter *es, gint **array, gint *count) { - g_return_if_fail(es != NULL); + g_return_if_fail (es != NULL); - if (E_SORTER_GET_CLASS(es)->get_model_to_sorted_array) - E_SORTER_GET_CLASS(es)->get_model_to_sorted_array (es, array, count); + if (E_SORTER_GET_CLASS (es)->get_model_to_sorted_array) + E_SORTER_GET_CLASS (es)->get_model_to_sorted_array (es, array, count); } void e_sorter_get_sorted_to_model_array (ESorter *es, gint **array, gint *count) { - g_return_if_fail(es != NULL); + g_return_if_fail (es != NULL); - if (E_SORTER_GET_CLASS(es)->get_sorted_to_model_array) - E_SORTER_GET_CLASS(es)->get_sorted_to_model_array (es, array, count); + if (E_SORTER_GET_CLASS (es)->get_sorted_to_model_array) + E_SORTER_GET_CLASS (es)->get_sorted_to_model_array (es, array, count); } gboolean -e_sorter_needs_sorting(ESorter *es) +e_sorter_needs_sorting (ESorter *es) { g_return_val_if_fail (es != NULL, FALSE); - if (E_SORTER_GET_CLASS(es)->needs_sorting) - return E_SORTER_GET_CLASS(es)->needs_sorting (es); + if (E_SORTER_GET_CLASS (es)->needs_sorting) + return E_SORTER_GET_CLASS (es)->needs_sorting (es); else return FALSE; } diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index bb8f7b6630..b5febfa89d 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -124,7 +124,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event) { ETextEventProcessorCommand command; - ETextEventProcessorEmacsLike *tep_el = E_TEXT_EVENT_PROCESSOR_EMACS_LIKE(tep); + ETextEventProcessorEmacsLike *tep_el = E_TEXT_EVENT_PROCESSOR_EMACS_LIKE (tep); command.action = E_TEP_NOP; /* Warning from the Intel compiler here: * e-text-event-processor-emacs-like.c(136): warning #589: @@ -483,7 +483,7 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, } command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; - command.value = strlen(key.string); + command.value = strlen (key.string); command.string = key.string; } else { diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c index c79033d702..9e2b2d6474 100644 --- a/e-util/e-text-event-processor.c +++ b/e-util/e-text-event-processor.c @@ -96,8 +96,8 @@ gint e_text_event_processor_handle_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event) { - if (E_TEXT_EVENT_PROCESSOR_GET_CLASS(tep)->event) - return E_TEXT_EVENT_PROCESSOR_GET_CLASS(tep)->event(tep, event); + if (E_TEXT_EVENT_PROCESSOR_GET_CLASS (tep)->event) + return E_TEXT_EVENT_PROCESSOR_GET_CLASS (tep)->event (tep, event); else return 0; } diff --git a/e-util/e-unicode.c b/e-util/e-unicode.c index 1d792f15ad..9d610bc5d8 100644 --- a/e-util/e-unicode.c +++ b/e-util/e-unicode.c @@ -190,7 +190,7 @@ e_utf8_to_charset_string_sized (const gchar *charset, const gchar *string, gint ic = camel_iconv_open(charset, "utf-8"); ret = e_utf8_to_iconv_string_sized (ic, string, bytes); - camel_iconv_close(ic); + camel_iconv_close (ic); return ret; } @@ -205,7 +205,7 @@ e_utf8_from_locale_string_sized (const gchar *string, gint bytes) ic = camel_iconv_open("utf-8", camel_iconv_locale_charset()); ret = e_utf8_from_iconv_string_sized (ic, string, bytes); - camel_iconv_close(ic); + camel_iconv_close (ic); return ret; } @@ -332,7 +332,7 @@ e_xml_get_translated_utf8_string_prop_by_name (const xmlNode *parent, ret_val = g_strdup (gettext ((gchar *)prop)); xmlFree (prop); } - g_free(combined_name); + g_free (combined_name); return ret_val; } diff --git a/e-util/e-util.c b/e-util/e-util.c index 3f27c52941..94fa715b44 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -663,7 +663,7 @@ e_format_number (gint number) gchar *value; gchar *value_iterator; - locality = localeconv(); + locality = localeconv (); grouping = locality->grouping; while (number) { gchar *group; @@ -672,7 +672,7 @@ e_format_number (gint number) last_count = *grouping; grouping++; case 0: - divider = epow10(last_count); + divider = epow10 (last_count); if (number >= divider) { group = g_strdup_printf("%0*d", last_count, number % divider); } else { @@ -685,8 +685,8 @@ e_format_number (gint number) number = 0; break; } - char_length += strlen(group); - list = g_list_prepend(list, group); + char_length += strlen (group); + list = g_list_prepend (list, group); group_count++; } @@ -698,14 +698,14 @@ e_format_number (gint number) iterator = list; value_iterator = value; - strcpy(value_iterator, iterator->data); - value_iterator += strlen(iterator->data); + strcpy (value_iterator, iterator->data); + value_iterator += strlen (iterator->data); for (iterator = iterator->next; iterator; iterator = iterator->next) { - strcpy(value_iterator, locality->thousands_sep); - value_iterator += strlen(locality->thousands_sep); + strcpy (value_iterator, locality->thousands_sep); + value_iterator += strlen (locality->thousands_sep); - strcpy(value_iterator, iterator->data); - value_iterator += strlen(iterator->data); + strcpy (value_iterator, iterator->data); + value_iterator += strlen (iterator->data); } g_list_foreach (list, (GFunc) g_free, NULL); g_list_free (list); @@ -812,7 +812,7 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) { /* No AM/PM involved - can use the fmt string directly */ - ret=e_strftime(str, max, fmt, tm); + ret=e_strftime (str, max, fmt, tm); } else { /* Get the AM/PM symbol from the locale */ e_strftime (buf, 10, "%p", tm); @@ -820,11 +820,11 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, if (buf[0]) { /* AM/PM have been defined in the locale * so we can use the fmt string directly. */ - ret=e_strftime(str, max, fmt, tm); + ret=e_strftime (str, max, fmt, tm); } else { /* No AM/PM defined by locale * must change to 24 hour clock. */ - ffmt=g_strdup(fmt); + ffmt=g_strdup (fmt); for (sp=ffmt; (sp=strstr(sp, "%l")); sp++) { /* Maybe this should be 'k', but I have never * seen a 24 clock actually use that format. */ @@ -833,12 +833,12 @@ e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) { sp[1]='H'; } - ret=e_strftime(str, max, ffmt, tm); - g_free(ffmt); + ret=e_strftime (str, max, ffmt, tm); + g_free (ffmt); } } - return(ret); + return (ret); } gsize @@ -848,17 +848,17 @@ e_utf8_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, gsize sz, ret; gchar *locale_fmt, *buf; - locale_fmt = g_locale_from_utf8(fmt, -1, NULL, &sz, NULL); + locale_fmt = g_locale_from_utf8 (fmt, -1, NULL, &sz, NULL); if (!locale_fmt) return 0; - ret = e_strftime_fix_am_pm(str, max, locale_fmt, tm); + ret = e_strftime_fix_am_pm (str, max, locale_fmt, tm); if (!ret) { g_free (locale_fmt); return 0; } - buf = g_locale_to_utf8(str, ret, NULL, &sz, NULL); + buf = g_locale_to_utf8 (str, ret, NULL, &sz, NULL); if (!buf) { g_free (locale_fmt); return 0; @@ -866,16 +866,16 @@ e_utf8_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, if (sz >= max) { gchar *tmp = buf + max - 1; - tmp = g_utf8_find_prev_char(buf, tmp); + tmp = g_utf8_find_prev_char (buf, tmp); if (tmp) sz = tmp - buf; else sz = 0; } - memcpy(str, buf, sz); + memcpy (str, buf, sz); str[sz] = '\0'; - g_free(locale_fmt); - g_free(buf); + g_free (locale_fmt); + g_free (buf); return sz; } diff --git a/e-util/e-util.h b/e-util/e-util.h index e3ce5cb103..42749c1c25 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -141,7 +141,8 @@ gchar * e_util_guess_mime_type (const gchar *filename, GSList * e_util_get_category_filter_options (void); -void e_util_set_source_combo_box_list(GtkWidget *source_combo_box, +void e_util_set_source_combo_box_list + (GtkWidget *source_combo_box, const gchar *source_gconf_path); G_END_DECLS diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c index 22daa3baa3..c83bbabf9d 100644 --- a/e-util/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -78,7 +78,7 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent, xmlChar *this_lang = xmlGetProp (child, (const guchar *)"lang"); if (this_lang == NULL) { C = child; - } else if (xmlStrcmp(this_lang, (xmlChar *)lang) == 0) { + } else if (xmlStrcmp (this_lang, (xmlChar *)lang) == 0) { #ifdef G_OS_WIN32 g_free (freeme); #endif @@ -300,7 +300,7 @@ e_xml_get_bool_prop_by_name_with_default (const xmlNode *parent, } else if (g_ascii_strcasecmp ((gchar *)prop, "false") == 0) { ret_val = FALSE; } - xmlFree(prop); + xmlFree (prop); } return ret_val; } @@ -435,10 +435,10 @@ e_xml_get_translated_string_prop_by_name (const xmlNode *parent, combined_name = g_strdup_printf("_%s", prop_name); prop = xmlGetProp ((xmlNode *) parent, (guchar *)combined_name); if (prop != NULL) { - ret_val = g_strdup (gettext((gchar *)prop)); + ret_val = g_strdup (gettext ((gchar *)prop)); xmlFree (prop); } - g_free(combined_name); + g_free (combined_name); return ret_val; } diff --git a/e-util/gconf-bridge.c b/e-util/gconf-bridge.c index d0f884d8fa..e2e83246a5 100644 --- a/e-util/gconf-bridge.c +++ b/e-util/gconf-bridge.c @@ -451,7 +451,7 @@ prop_binding_object_destroyed (gpointer user_data, binding = (PropBinding *) user_data; binding->object = NULL; /* Don't do anything with the object - at unbind() */ + * at unbind() */ g_hash_table_remove (bridge->bindings, GUINT_TO_POINTER (binding->id)); @@ -757,7 +757,7 @@ window_binding_window_destroyed (gpointer user_data, binding = (WindowBinding *) user_data; binding->window = NULL; /* Don't do anything with the window - at unbind() */ + * at unbind() */ if (binding->sync_timeout_id > 0) g_source_remove (binding->sync_timeout_id); @@ -1060,7 +1060,7 @@ list_store_binding_store_destroyed (gpointer user_data, binding = (ListStoreBinding *) user_data; binding->list_store = NULL; /* Don't do anything with the store - at unbind() */ + * at unbind() */ g_hash_table_remove (bridge->bindings, GUINT_TO_POINTER (binding->id)); -- cgit