diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-07-12 20:02:18 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-20 02:17:55 +0800 |
commit | c85109fc322137596bf34cffc5445d568223c60d (patch) | |
tree | 711e6d5b2eb3d6c7780d1d01e20d980c67a77f9e /e-util | |
parent | 7d1751cc26a75166019917ec8c3b35e1083d27d6 (diff) | |
download | gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.gz gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.tar.zst gsoc2013-evolution-c85109fc322137596bf34cffc5445d568223c60d.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-config.c | 127 | ||||
-rw-r--r-- | e-util/e-dialog-utils.c | 9 | ||||
-rw-r--r-- | e-util/e-event.c | 21 | ||||
-rw-r--r-- | e-util/e-file-request.c | 13 | ||||
-rw-r--r-- | e-util/e-html-utils.c | 51 | ||||
-rw-r--r-- | e-util/e-import.c | 4 | ||||
-rw-r--r-- | e-util/e-mktemp.c | 18 | ||||
-rw-r--r-- | e-util/e-plugin-ui.c | 6 | ||||
-rw-r--r-- | e-util/e-plugin.c | 45 | ||||
-rw-r--r-- | e-util/e-stock-request.c | 20 | ||||
-rw-r--r-- | e-util/e-text-event-processor.c | 36 | ||||
-rw-r--r-- | e-util/e-unicode.c | 6 | ||||
-rw-r--r-- | e-util/e-util.c | 20 |
13 files changed, 192 insertions, 184 deletions
diff --git a/e-util/e-config.c b/e-util/e-config.c index 7da480ab56..2baadca6f0 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -132,7 +132,7 @@ config_finalize (GObject *object) priv = E_CONFIG_GET_PRIVATE (object); - d(printf("finalising EConfig %p\n", object)); + d (printf ("finalising EConfig %p\n", object)); g_free (E_CONFIG (object)->id); @@ -650,7 +650,7 @@ ec_rebuild (EConfig *emp) gboolean is_assistant; GList *link; - d(printf("target changed, rebuilding:\n")); + d (printf ("target changed, rebuilding:\n")); /* TODO: This code is pretty complex, and will probably just * become more complex with time. It could possibly be split @@ -683,7 +683,7 @@ ec_rebuild (EConfig *emp) const gchar *translated_label = NULL; GtkWidget *w; - d(printf(" '%s'\n", item->path)); + d (printf (" '%s'\n", item->path)); if (item->label != NULL) translated_label = gettext (item->label); @@ -713,7 +713,7 @@ ec_rebuild (EConfig *emp) gtk_widget_show (sectionnode->frame); } - d(printf("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno)); + d (printf ("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno)); } /* If the last page doesn't contain anything, hide it */ @@ -728,7 +728,7 @@ ec_rebuild (EConfig *emp) pageno--; } else gtk_widget_show (pagenode->frame); - d(printf("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno)); + d (printf ("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno)); } /* Now process the item */ @@ -741,13 +741,13 @@ ec_rebuild (EConfig *emp) * cross-checked with the code's defined * type. */ if (root != NULL) { - g_warning("EConfig book/assistant redefined at: %s", item->path); + g_warning ("EConfig book/assistant redefined at: %s", item->path); break; } if (wn->widget == NULL) { if (item->type != emp->type) { - g_warning("EConfig book/assistant type mismatch"); + g_warning ("EConfig book/assistant type mismatch"); break; } if (item->factory) { @@ -804,11 +804,11 @@ ec_rebuild (EConfig *emp) case E_CONFIG_PAGE_START: case E_CONFIG_PAGE_FINISH: if (root == NULL) { - g_warning("EConfig page defined before container widget: %s", item->path); + g_warning ("EConfig page defined before container widget: %s", item->path); break; } if (emp->type != E_CONFIG_ASSISTANT) { - g_warning("EConfig assistant start/finish pages can't be used on E_CONFIG_BOOKs"); + g_warning ("EConfig assistant start/finish pages can't be used on E_CONFIG_BOOKs"); break; } @@ -874,12 +874,12 @@ ec_rebuild (EConfig *emp) any sections automatically added inside it. */ sectionno = 0; if (root == NULL) { - g_warning("EConfig page defined before container widget: %s", item->path); + g_warning ("EConfig page defined before container widget: %s", item->path); break; } if (item->type == E_CONFIG_PAGE_PROGRESS && emp->type != E_CONFIG_ASSISTANT) { - g_warning("EConfig assistant progress pages can't be used on E_CONFIG_BOOKs"); + g_warning ("EConfig assistant progress pages can't be used on E_CONFIG_BOOKs"); break; } @@ -927,10 +927,10 @@ ec_rebuild (EConfig *emp) } else page = wn->widget; - d(printf("page %d:%s widget %p\n", pageno, item->path, page)); + d (printf ("page %d:%s widget %p\n", pageno, item->path, page)); if (wn->widget && wn->widget != page) { - d(printf("destroy old widget for page '%s' (%p)\n", item->path, wn->widget)); + d (printf ("destroy old widget for page '%s' (%p)\n", item->path, wn->widget)); gtk_widget_destroy (wn->widget); } @@ -959,7 +959,7 @@ ec_rebuild (EConfig *emp) itemno = 0; n_visible_widgets = 0; - d(printf("Building section %s - '%s' - %s factory\n", item->path, item->label, item->factory ? "with" : "without")); + d (printf ("Building section %s - '%s' - %s factory\n", item->path, item->label, item->factory ? "with" : "without")); if (item->factory) { /* For sections, we pass an extra argument to the usual EConfigItemFactoryFunc. @@ -985,31 +985,32 @@ ec_rebuild (EConfig *emp) * see emph_construct_item(). */ n_visible_widgets++; - d(printf (" n_visible_widgets++ because there is a section factory -> frame=%p\n", section)); + d (printf (" n_visible_widgets++ because there is a section factory -> frame=%p\n", section)); } if (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"); + g_warning ("EConfig section type is wrong"); } else { GtkWidget *frame; GtkWidget *label = NULL; if (wn->frame) { - d(printf("Item %s, clearing generated section widget\n", wn->item->path)); + d (printf ("Item %s, clearing generated section widget\n", wn->item->path)); gtk_widget_destroy (wn->frame); wn->widget = NULL; wn->frame = NULL; } if (translated_label != NULL) { - gchar *txt = g_markup_printf_escaped("<span weight=\"bold\">%s</span>", translated_label); + gchar *txt = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>", translated_label); - label = g_object_new (gtk_label_get_type (), - "label", txt, - "use_markup", TRUE, - "xalign", 0.0, NULL); + label = g_object_new ( + gtk_label_get_type (), + "label", txt, + "use_markup", TRUE, + "xalign", 0.0, NULL); g_free (txt); } @@ -1021,25 +1022,26 @@ ec_rebuild (EConfig *emp) gtk_table_set_row_spacings ((GtkTable *) section, 6); } - frame = g_object_new (gtk_frame_get_type (), - "shadow_type", GTK_SHADOW_NONE, - "label_widget", label, - "child", g_object_new(gtk_alignment_get_type(), - "left_padding", 12, - "top_padding", 6, - "child", section, NULL), - NULL); + frame = g_object_new ( + gtk_frame_get_type (), + "shadow_type", GTK_SHADOW_NONE, + "label_widget", label, + "child", g_object_new (gtk_alignment_get_type (), + "left_padding", 12, + "top_padding", 6, + "child", section, NULL), + NULL); 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)); + d (printf ("destroy old widget for section '%s'\n", item->path)); gtk_widget_destroy (wn->widget); } - d(printf("Item %s, setting section widget\n", wn->item->path)); + d (printf ("Item %s, setting section widget\n", wn->item->path)); sectionno++; wn->widget = section; @@ -1062,24 +1064,17 @@ ec_rebuild (EConfig *emp) if (section == NULL) { wn->widget = NULL; wn->frame = NULL; - g_warning("EConfig item has no parent section: %s", item->path); + 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))) - g_warning("EConfig item parent type is incorrect: %s", item->path); + g_warning ("EConfig item parent type is incorrect: %s", item->path); else if (item->factory) w = item->factory ( emp, item, section, wn->widget, 0, wn->context->data); - d(printf("item %d:%s widget %p\n", itemno, item->path, w)); - - d(printf (" item %s: (%s - %s)\n", - item->path, - g_type_name_from_instance ((GTypeInstance *) w), - gtk_widget_get_visible (w) ? "visible" : "invisible")); - if (wn->widget && wn->widget != w) { - d(printf("destroy old widget for item '%s'\n", item->path)); + d (printf ("destroy old widget for item '%s'\n", item->path)); gtk_widget_destroy (wn->widget); } @@ -1099,7 +1094,7 @@ ec_rebuild (EConfig *emp) /* If the last section doesn't contain any visible widgets, hide it */ if (sectionnode != NULL && sectionnode->frame != NULL) { - d(printf ("Section %s - %d visible widgets (frame=%p)\n", sectionnode->item->path, n_visible_widgets, sectionnode->frame)); + 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); @@ -1115,7 +1110,7 @@ ec_rebuild (EConfig *emp) if (sectionnode->frame) gtk_widget_show (sectionnode->frame); } - d(printf("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno)); + d (printf ("%s section '%s' [sections=%d]\n", sectionnode->empty?"hiding":"showing", sectionnode->item->path, sectionno)); } /* If the last page doesn't contain anything, hide it */ @@ -1125,7 +1120,7 @@ ec_rebuild (EConfig *emp) pageno--; } else gtk_widget_show (pagenode->frame); - d(printf("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno)); + d (printf ("%s page '%s' [section=%d]\n", pagenode->empty?"hiding":"showing", pagenode->item->path, pageno)); } if (book) { @@ -1735,7 +1730,7 @@ ech_check (EConfig *ec, hdata.config = ec; hdata.target = ec->target; - hdata.pageid = pageid?pageid:""; + hdata.pageid = pageid ? pageid:""; return GPOINTER_TO_INT (e_plugin_invoke (group->hook->hook.plugin, group->check, &hdata)); } @@ -1746,7 +1741,7 @@ ech_config_factory (EConfig *emp, { EConfigHookGroup *group = data; - d(printf("config factory called %s\n", group->id?group->id:"all menus")); + d (printf ("config factory called %s\n", group->id ? group->id:"all menus")); if (emp->target->type != group->target_type || !group->hook->hook.plugin->enabled) @@ -1890,13 +1885,13 @@ emph_construct_item (EPluginHook *eph, { struct _EConfigItem *item; - d(printf(" loading config item\n")); + d (printf (" loading config item\n")); item = g_malloc0 (sizeof (*item)); - if ((item->type = e_plugin_hook_id(root, ech_item_types, "type")) == -1) + if ((item->type = e_plugin_hook_id (root, ech_item_types, "type")) == -1) goto error; - item->path = e_plugin_xml_prop(root, "path"); - item->label = e_plugin_xml_prop_domain(root, "label", eph->plugin->domain); - item->user_data = e_plugin_xml_prop(root, "factory"); + item->path = e_plugin_xml_prop (root, "path"); + item->label = e_plugin_xml_prop_domain (root, "label", eph->plugin->domain); + item->user_data = e_plugin_xml_prop (root, "factory"); if (item->path == NULL || (item->label == NULL && item->user_data == NULL)) @@ -1909,11 +1904,11 @@ emph_construct_item (EPluginHook *eph, else if (item->type == E_CONFIG_SECTION_TABLE) item->factory = (EConfigItemFactoryFunc) ech_config_section_factory; - d(printf(" path=%s label=%s factory=%s\n", item->path, item->label, (gchar *)item->user_data)); + d (printf (" path=%s label=%s factory=%s\n", item->path, item->label, (gchar *) item->user_data)); return item; error: - d(printf("error!\n")); + d (printf ("error!\n")); emph_free_item (item); return NULL; } @@ -1928,10 +1923,10 @@ emph_construct_menu (EPluginHook *eph, EConfigHookClass *class = (EConfigHookClass *) G_OBJECT_GET_CLASS (eph); gchar *tmp; - d(printf(" loading menu\n")); + d (printf (" loading menu\n")); menu = g_malloc0 (sizeof (*menu)); - tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); + tmp = (gchar *) xmlGetProp (root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup (class->target_map, tmp); @@ -1940,19 +1935,21 @@ emph_construct_menu (EPluginHook *eph, goto error; menu->target_type = map->id; - menu->id = e_plugin_xml_prop(root, "id"); + 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); + g_warning ( + "Plugin '%s' missing 'id' field in group for '%s'\n", + eph->plugin->name, + ((EPluginHookClass *) G_OBJECT_GET_CLASS (eph))->id); goto error; } - menu->check = e_plugin_xml_prop(root, "check"); - menu->commit = e_plugin_xml_prop(root, "commit"); - menu->abort = e_plugin_xml_prop(root, "abort"); + menu->check = e_plugin_xml_prop (root, "check"); + menu->commit = e_plugin_xml_prop (root, "commit"); + menu->abort = e_plugin_xml_prop (root, "abort"); menu->hook = (EConfigHook *) eph; node = root->children; while (node) { - if (0 == strcmp((gchar *)node->name, "item")) { + if (0 == strcmp ((gchar *) node->name, "item")) { struct _EConfigItem *item; item = emph_construct_item (eph, menu, node, map); @@ -1976,7 +1973,7 @@ emph_construct (EPluginHook *eph, xmlNodePtr node; EConfigClass *class; - d(printf("loading config hook\n")); + d (printf ("loading config hook\n")); if (((EPluginHookClass *) e_config_hook_parent_class)->construct (eph, ep, root) == -1) return -1; @@ -1985,7 +1982,7 @@ emph_construct (EPluginHook *eph, node = root->children; while (node) { - if (strcmp((gchar *)node->name, "group") == 0) { + if (strcmp ((gchar *) node->name, "group") == 0) { EConfigHookGroup *group; group = emph_construct_menu (eph, node); diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c index fabd1951d3..7a481d3910 100644 --- a/e-util/e-dialog-utils.c +++ b/e-util/e-dialog-utils.c @@ -50,12 +50,9 @@ e_notice (gpointer parent, va_start (args, format); str = g_strdup_vprintf (format, args); - dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - type, - GTK_BUTTONS_OK, - "%s", - str); + dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_DESTROY_WITH_PARENT, + type, GTK_BUTTONS_OK, "%s", str); va_end (args); g_free (str); diff --git a/e-util/e-event.c b/e-util/e-event.c index 409c23c9a9..c9d046c041 100644 --- a/e-util/e-event.c +++ b/e-util/e-event.c @@ -229,7 +229,7 @@ e_event_emit (EEvent *event, EEventPrivate *p = event->priv; GSList *events; - d(printf("emit event %s\n", id)); + d (printf ("emit event %s\n", id)); if (event->target != NULL) { g_warning ("Event already in progress.\n"); @@ -264,9 +264,6 @@ e_event_emit (EEvent *event, struct _event_info *info = events->data; EEventItem *item = info->item; - d(printf("event '%s' mask %08x target %08x\n", - item->id, item->enable, target->mask)); - if (item->enable & target->mask) continue; @@ -429,7 +426,7 @@ emph_construct_item (EPluginHook *eph, item = g_malloc0 (sizeof (*item)); - tmp = (gchar *)xmlGetProp(root, (const guchar *)"target"); + tmp = (gchar *) xmlGetProp (root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup (class->target_map, tmp); @@ -437,13 +434,13 @@ emph_construct_item (EPluginHook *eph, if (map == NULL) goto error; item->target_type = map->id; - item->type = e_plugin_hook_id(root, emph_item_types, "type"); + item->type = e_plugin_hook_id (root, emph_item_types, "type"); if (item->type == -1) item->type = E_EVENT_PASS; - item->priority = e_plugin_xml_int(root, "priority", 0); - item->id = e_plugin_xml_prop(root, "id"); - item->enable = e_plugin_hook_mask(root, map->mask_bits, "enable"); - item->user_data = e_plugin_xml_prop(root, "handle"); + item->priority = e_plugin_xml_int (root, "priority", 0); + item->id = e_plugin_xml_prop (root, "id"); + item->enable = e_plugin_hook_mask (root, map->mask_bits, "enable"); + item->user_data = e_plugin_xml_prop (root, "handle"); if (item->user_data == NULL || item->id == NULL) goto error; @@ -465,7 +462,7 @@ emph_construct (EPluginHook *eph, EEventHookClass *class; GSList *items = NULL; - d(printf("loading event hook\n")); + d (printf ("loading event hook\n")); if (((EPluginHookClass *) e_event_hook_parent_class)-> construct (eph, ep, root) == -1) @@ -476,7 +473,7 @@ emph_construct (EPluginHook *eph, node = root->children; while (node) { - if (strcmp((gchar *)node->name, "event") == 0) { + if (strcmp ((gchar *) node->name, "event") == 0) { EEventItem *item; item = emph_construct_item (eph, node, class); diff --git a/e-util/e-file-request.c b/e-util/e-file-request.c index 4b84aad931..724680a280 100644 --- a/e-util/e-file-request.c +++ b/e-util/e-file-request.c @@ -95,7 +95,7 @@ file_request_send_async (SoupRequest *request, { GSimpleAsyncResult *simple; - d(printf("received request for %s\n", soup_uri_to_string (uri, FALSE))); + d (printf ("received request for %s\n", soup_uri_to_string (uri, FALSE))); /* WebKit won't allow us to load data through local file:// protocol * when using "remote" mail:// protocol, so we have evo-file:// @@ -120,9 +120,11 @@ file_request_send_finish (SoupRequest *request, GAsyncResult *result, GError **error) { + GSimpleAsyncResult *simple; GInputStream *stream; - stream = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)); + simple = G_SIMPLE_ASYNC_RESULT (result); + stream = g_simple_async_result_get_op_res_gpointer (simple); /* Reset the stream before passing it back to webkit */ if (stream && G_IS_SEEKABLE (stream)) @@ -139,7 +141,8 @@ file_request_get_content_length (SoupRequest *request) { EFileRequest *efr = E_FILE_REQUEST (request); - d(printf("Content-Length: %d bytes\n", efr->priv->content_length)); + d (printf ("Content-Length: %d bytes\n", efr->priv->content_length)); + return efr->priv->content_length; } @@ -148,12 +151,12 @@ file_request_get_content_type (SoupRequest *request) { EFileRequest *efr = E_FILE_REQUEST (request); - d(printf("Content-Type: %s\n", efr->priv->content_type)); + d (printf ("Content-Type: %s\n", efr->priv->content_type)); return efr->priv->content_type; } -static const char *data_schemes[] = { "evo-file", NULL }; +static const gchar *data_schemes[] = { "evo-file", NULL }; static void e_file_request_class_init (EFileRequestClass *class) diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 3a863da096..5e4de66b93 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -158,7 +158,7 @@ is_citation (const guchar *c, /* A line that starts with a ">" is a citation, unless it's * just mbox From-mangling... */ - if (strncmp ((const gchar *)c, ">From ", 6) != 0) + if (strncmp ((const gchar *) c, ">From ", 6) != 0) return TRUE; /* If the previous line was a citation, then say this @@ -281,36 +281,37 @@ e_text_to_html_full (const gchar *input, (flags & E_TEXT_TO_HTML_CONVERT_URLS)) { gchar *tmpurl = NULL, *refurl = NULL, *dispurl = NULL; - if (!g_ascii_strncasecmp ((gchar *)cur, "http://", 7) || - !g_ascii_strncasecmp ((gchar *)cur, "https://", 8) || - !g_ascii_strncasecmp ((gchar *)cur, "ftp://", 6) || - !g_ascii_strncasecmp ((gchar *)cur, "nntp://", 7) || - !g_ascii_strncasecmp ((gchar *)cur, "mailto:", 7) || - !g_ascii_strncasecmp ((gchar *)cur, "news:", 5) || - !g_ascii_strncasecmp ((gchar *)cur, "file:", 5) || - !g_ascii_strncasecmp ((gchar *)cur, "callto:", 7) || - !g_ascii_strncasecmp ((gchar *)cur, "h323:", 5) || - !g_ascii_strncasecmp ((gchar *)cur, "sip:", 4) || - !g_ascii_strncasecmp ((gchar *)cur, "webcal:", 7)) { + if (!g_ascii_strncasecmp ((gchar *) cur, "http://", 7) || + !g_ascii_strncasecmp ((gchar *) cur, "https://", 8) || + !g_ascii_strncasecmp ((gchar *) cur, "ftp://", 6) || + !g_ascii_strncasecmp ((gchar *) cur, "nntp://", 7) || + !g_ascii_strncasecmp ((gchar *) cur, "mailto:", 7) || + !g_ascii_strncasecmp ((gchar *) cur, "news:", 5) || + !g_ascii_strncasecmp ((gchar *) cur, "file:", 5) || + !g_ascii_strncasecmp ((gchar *) cur, "callto:", 7) || + !g_ascii_strncasecmp ((gchar *) cur, "h323:", 5) || + !g_ascii_strncasecmp ((gchar *) cur, "sip:", 4) || + !g_ascii_strncasecmp ((gchar *) cur, "webcal:", 7)) { tmpurl = url_extract (&cur, TRUE); if (tmpurl) { refurl = e_text_to_html (tmpurl, 0); dispurl = g_strdup (refurl); } - } else if (!g_ascii_strncasecmp ((gchar *)cur, "www.", 4) && + } else if (!g_ascii_strncasecmp ((gchar *) cur, "www.", 4) && is_url_char (*(cur + 4))) { tmpurl = url_extract (&cur, FALSE); if (tmpurl) { dispurl = e_text_to_html (tmpurl, 0); - refurl = g_strdup_printf ("http://%s", - dispurl); + refurl = g_strdup_printf ( + "http://%s", dispurl); } } if (tmpurl) { - out = check_size (&buffer, &buffer_size, out, - strlen (refurl) + - strlen (dispurl) + 15); + out = check_size ( + &buffer, &buffer_size, out, + strlen (refurl) + + strlen (dispurl) + 15); out += sprintf (out, "<a href=\"%s\">%s</a>", refurl, dispurl); @@ -331,8 +332,9 @@ e_text_to_html_full (const gchar *input, addr = email_address_extract (&cur, &out, linestart); if (addr) { dispaddr = e_text_to_html (addr, 0); - outaddr = g_strdup_printf ("<a href=\"mailto:%s\">%s</a>", - addr, dispaddr); + outaddr = g_strdup_printf ( + "<a href=\"mailto:%s\">%s</a>", + addr, dispaddr); out = check_size (&buffer, &buffer_size, out, strlen (outaddr)); out += sprintf (out, "%s", outaddr); col += strlen (addr); @@ -396,8 +398,8 @@ e_text_to_html_full (const gchar *input, if (flags & (E_TEXT_TO_HTML_CONVERT_SPACES | E_TEXT_TO_HTML_CONVERT_NL)) { do { - out = check_size (&buffer, &buffer_size, - out, 7); + out = check_size ( + &buffer, &buffer_size, out, 7); strcpy (out, " "); out += 6; col++; @@ -428,7 +430,7 @@ e_text_to_html_full (const gchar *input, if (flags & E_TEXT_TO_HTML_ESCAPE_8BIT) *out++ = '?'; else - out += g_snprintf(out, 9, "&#%d;", u); + out += g_snprintf (out, 9, "&#%d;", u); } col++; break; @@ -541,7 +543,8 @@ main (gint argc, if ((url && (!url_tests[i].url || strcmp (url, url_tests[i].url) != 0)) || (!url && url_tests[i].url)) { - printf ("FAILED on \"%s\" -> %s\n (got %s)\n\n", + printf ( + "FAILED on \"%s\" -> %s\n (got %s)\n\n", url_tests[i].text, url_tests[i].url ? url_tests[i].url : "(nothing)", url ? url : "(nothing)"); diff --git a/e-util/e-import.c b/e-util/e-import.c index ab3afc9f33..8b806899a2 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -498,7 +498,7 @@ emph_construct_importer (EPluginHook *eph, d (printf (" loading import item\n")); item = g_malloc0 (sizeof (*item)); - tmp = (gchar *)xmlGetProp (root, (const guchar *)"target"); + tmp = (gchar *) xmlGetProp (root, (const guchar *)"target"); if (tmp == NULL) goto error; map = g_hash_table_lookup (class->target_map, tmp); @@ -552,7 +552,7 @@ emph_construct (EPluginHook *eph, node = root->children; while (node) { - if (strcmp ((gchar *)node->name, "importer") == 0) { + if (strcmp ((gchar *) node->name, "importer") == 0) { struct _EImportHookImporter *ihook; ihook = emph_construct_importer (eph, node); diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index af9327f471..9b68ccc473 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -59,7 +59,7 @@ expire_dir_rec (const gchar *base, struct stat st; gint count = 0; - d(printf("expire dir '%s'\n", base)); + d (printf ("expire dir '%s'\n", base)); dir = g_dir_open (base, 0, NULL); if (dir == NULL) @@ -70,23 +70,23 @@ expire_dir_rec (const gchar *base, 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)); + g_string_append_printf (path, "/%s", d); + d (printf ("Checking '%s' for expiry\n", path->str)); 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) { - d(printf("Removing dir '%s'\n", path->str)); + d (printf ("Removing dir '%s'\n", path->str)); g_rmdir (path->str); } else { count++; } } else if (g_unlink (path->str) == -1) { - d(printf("expiry failed: %s\n", g_strerror(errno))); + d (printf ("expiry failed: %s\n", g_strerror (errno))); count++; } else { - d(printf("expired %s\n", path->str)); + d (printf ("expired %s\n", path->str)); } } else { count++; @@ -95,7 +95,7 @@ expire_dir_rec (const gchar *base, g_string_free (path, TRUE); g_dir_close (dir); - d(printf("expire dir '%s' %d remaining files\n", base, count)); + d (printf ("expire dir '%s' %d remaining files\n", base, count)); return count; } @@ -120,7 +120,7 @@ get_dir (gboolean make) } g_free (tmpdir); #else - path = g_string_new("/tmp/evolution-"); + path = g_string_new ("/tmp/evolution-"); g_string_append_printf (path, "%d", (gint) getuid ()); if (make) { gint ret; @@ -155,7 +155,7 @@ get_dir (gboolean make) } #endif - d(printf("temp dir '%s'\n", path ? path->str : "(null)")); + d (printf ("temp dir '%s'\n", path ? path->str : "(null)")); /* fire off an expiry attempt no more often than TEMP_SCAN seconds */ if (path && (last + TEMP_SCAN) < now) { diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c index 1e66716183..6e36654061 100644 --- a/e-util/e-plugin-ui.c +++ b/e-util/e-plugin-ui.c @@ -526,8 +526,10 @@ e_plugin_ui_hook_init (EPluginUIHook *hook) (GDestroyNotify) g_free, (GDestroyNotify) g_free); - registry = g_hash_table_new_full (g_direct_hash, g_direct_equal, - NULL, (GDestroyNotify) g_hash_table_destroy); + registry = g_hash_table_new_full ( + g_direct_hash, g_direct_equal, + (GDestroyNotify) NULL, + (GDestroyNotify) g_hash_table_destroy); hook->priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (hook); hook->priv->ui_definitions = ui_definitions; diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index 9519074179..3550aad336 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -142,14 +142,15 @@ ep_construct (EPlugin *ep, gint res = -1; gchar *localedir; - ep->domain = e_plugin_xml_prop(root, "domain"); + ep->domain = e_plugin_xml_prop (root, "domain"); if (ep->domain - && (localedir = e_plugin_xml_prop(root, "localedir"))) { + && (localedir = e_plugin_xml_prop (root, "localedir"))) { #ifdef G_OS_WIN32 gchar *mapped_localedir = - e_util_replace_prefix (EVOLUTION_PREFIX, - e_util_get_prefix (), - localedir); + e_util_replace_prefix ( + EVOLUTION_PREFIX, + e_util_get_prefix (), + localedir); g_free (localedir); localedir = mapped_localedir; #endif @@ -157,14 +158,14 @@ ep_construct (EPlugin *ep, g_free (localedir); } - ep->name = e_plugin_xml_prop_domain(root, "name", ep->domain); + ep->name = e_plugin_xml_prop_domain (root, "name", ep->domain); node = root->children; while (node) { - if (strcmp((gchar *)node->name, "hook") == 0) { + if (strcmp ((gchar *) node->name, "hook") == 0) { EPluginHook *hook; EPluginHookClass *type; - gchar *class = e_plugin_xml_prop(node, "class"); + gchar *class = e_plugin_xml_prop (node, "class"); if (class == NULL) { g_warning ( @@ -176,7 +177,7 @@ ep_construct (EPlugin *ep, if (ep->enabled && eph_types != NULL - && (type = g_hash_table_lookup ( + && (type = g_hash_table_lookup ( eph_types, class)) != NULL) { g_free (class); hook = g_object_new (G_OBJECT_CLASS_TYPE (type), NULL); @@ -193,12 +194,12 @@ ep_construct (EPlugin *ep, } else { g_free (class); } - } else if (strcmp((gchar *)node->name, "description") == 0) { + } else if (strcmp ((gchar *) node->name, "description") == 0) { 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"); + } 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)); @@ -319,22 +320,22 @@ ep_load_plugin (xmlNodePtr root, EPluginClass *class; EPlugin *ep; - id = e_plugin_xml_prop(root, "id"); + id = e_plugin_xml_prop (root, "id"); if (id == NULL) { - g_warning("Invalid e-plugin entry in '%s': no id", pdoc->filename); + g_warning ("Invalid e-plugin entry in '%s': no id", pdoc->filename); return NULL; } if (g_hash_table_lookup (ep_plugins, id)) { - g_warning("Plugin '%s' already defined", id); + g_warning ("Plugin '%s' already defined", id); g_free (id); return NULL; } - prop = (gchar *)xmlGetProp(root, (const guchar *)"type"); + prop = (gchar *) xmlGetProp (root, (const guchar *)"type"); if (prop == NULL) { g_free (id); - g_warning("Invalid e-plugin entry in '%s': no type", pdoc->filename); + g_warning ("Invalid e-plugin entry in '%s': no type", pdoc->filename); return NULL; } @@ -373,8 +374,8 @@ ep_load (const gchar *filename, return -1; root = xmlDocGetRootElement (doc); - if (strcmp((gchar *)root->name, "e-plugin-list") != 0) { - g_warning("No <e-plugin-list> root element: %s", filename); + if (strcmp ((gchar *) root->name, "e-plugin-list") != 0) { + g_warning ("No <e-plugin-list> root element: %s", filename); xmlFreeDoc (doc); return -1; } @@ -384,7 +385,7 @@ ep_load (const gchar *filename, pdoc->filename = g_strdup (filename); for (root = root->children; root; root = root->next) { - if (strcmp((gchar *)root->name, "e-plugin") == 0) { + if (strcmp ((gchar *) root->name, "e-plugin") == 0) { gchar *plugin_load_level, *is_system_plugin; plugin_load_level = NULL; @@ -517,7 +518,7 @@ e_plugin_load_plugins (void) const gchar *d; const gchar *path = EVOLUTION_PLUGINDIR; - pd(printf("scanning plugin dir '%s'\n", path)); + pd (printf ("scanning plugin dir '%s'\n", path)); dir = g_dir_open (path, 0, NULL); if (dir == NULL) { diff --git a/e-util/e-stock-request.c b/e-util/e-stock-request.c index 9ee06e911e..8736dba7d4 100644 --- a/e-util/e-stock-request.c +++ b/e-util/e-stock-request.c @@ -117,7 +117,7 @@ handle_stock_request (GSimpleAsyncResult *res, pixbuf, &buffer, &buff_len, "png", NULL, NULL); - request->priv->content_type = g_strdup("image/png"); + request->priv->content_type = g_strdup ("image/png"); request->priv->content_length = buff_len; g_object_unref (pixbuf); @@ -134,7 +134,7 @@ handle_stock_request (GSimpleAsyncResult *res, pixbuf, &buffer, &buff_len, "png", NULL, NULL); - request->priv->content_type = g_strdup("image/png"); + request->priv->content_type = g_strdup ("image/png"); request->priv->content_length = buff_len; g_object_unref (pixbuf); @@ -180,7 +180,7 @@ stock_request_send_async (SoupRequest *request, { GSimpleAsyncResult *simple; - d(printf("received request for %s\n", soup_uri_to_string (uri, FALSE))); + d (printf ("received request for %s\n", soup_uri_to_string (uri, FALSE))); simple = g_simple_async_result_new ( G_OBJECT (request), callback, user_data, @@ -197,12 +197,14 @@ stock_request_send_async (SoupRequest *request, static GInputStream * stock_request_send_finish (SoupRequest *request, - GAsyncResult *result, - GError **error) + GAsyncResult *result, + GError **error) { + GSimpleAsyncResult *simple; GInputStream *stream; - stream = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (result)); + simple = G_SIMPLE_ASYNC_RESULT (result); + stream = g_simple_async_result_get_op_res_gpointer (simple); /* Reset the stream before passing it back to webkit */ if (stream && G_IS_SEEKABLE (stream)) @@ -219,7 +221,7 @@ stock_request_get_content_length (SoupRequest *request) { EStockRequest *esr = E_STOCK_REQUEST (request); - d(printf("Content-Length: %d bytes\n", esr->priv->content_length)); + d (printf ("Content-Length: %d bytes\n", esr->priv->content_length)); return esr->priv->content_length; } @@ -228,12 +230,12 @@ stock_request_get_content_type (SoupRequest *request) { EStockRequest *esr = E_STOCK_REQUEST (request); - d(printf("Content-Type: %s\n", esr->priv->content_type)); + d (printf ("Content-Type: %s\n", esr->priv->content_type)); return esr->priv->content_type; } -static const char *data_schemes[] = { "gtk-stock", NULL }; +static const gchar *data_schemes[] = { "gtk-stock", NULL }; static void e_stock_request_class_init (EStockRequestClass *class) diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c index c457300365..a5da7810dd 100644 --- a/e-util/e-text-event-processor.c +++ b/e-util/e-text-event-processor.c @@ -65,26 +65,28 @@ e_text_event_processor_class_init (ETextEventProcessorClass *class) object_class->set_property = e_text_event_processor_set_property; object_class->get_property = e_text_event_processor_get_property; - e_tep_signals[E_TEP_EVENT] = - g_signal_new ("command", - G_OBJECT_CLASS_TYPE (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ETextEventProcessorClass, command), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, - G_TYPE_POINTER); - - g_object_class_install_property (object_class, PROP_ALLOW_NEWLINES, - g_param_spec_boolean ("allow_newlines", - "Allow newlines", - "Allow newlines", - FALSE, - G_PARAM_READWRITE)); + e_tep_signals[E_TEP_EVENT] = g_signal_new ( + "command", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ETextEventProcessorClass, command), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + g_object_class_install_property ( + object_class, + PROP_ALLOW_NEWLINES, + g_param_spec_boolean ( + "allow_newlines", + "Allow newlines", + "Allow newlines", + FALSE, + G_PARAM_READWRITE)); class->event = NULL; class->command = NULL; - } static void diff --git a/e-util/e-unicode.c b/e-util/e-unicode.c index d92244107a..3ba257df14 100644 --- a/e-util/e-unicode.c +++ b/e-util/e-unicode.c @@ -199,7 +199,7 @@ e_utf8_to_charset_string_sized (const gchar *charset, if (!string) return NULL; - ic = camel_iconv_open(charset, "utf-8"); + ic = camel_iconv_open (charset, "utf-8"); ret = e_utf8_to_iconv_string_sized (ic, string, bytes); camel_iconv_close (ic); @@ -215,7 +215,7 @@ e_utf8_from_locale_string_sized (const gchar *string, if (!string) return NULL; - ic = camel_iconv_open("utf-8", camel_iconv_locale_charset()); + ic = camel_iconv_open ("utf-8", camel_iconv_locale_charset ()); ret = e_utf8_from_iconv_string_sized (ic, string, bytes); camel_iconv_close (ic); @@ -340,7 +340,7 @@ e_xml_get_translated_utf8_string_prop_by_name (const xmlNode *parent, return ret_val; } - combined_name = g_strdup_printf("_%s", prop_name); + 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)); diff --git a/e-util/e-util.c b/e-util/e-util.c index 707f0d0bbc..80c0de56c2 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -838,7 +838,7 @@ e_color_to_value (GdkColor *color) * e_rgba_to_value: * @rgba: a #GdkRGBA * - + * * Converts #GdkRGBA to a 24-bit RGB color value * * Returns: a 24-bit color value @@ -856,7 +856,10 @@ e_rgba_to_value (GdkRGBA *rgba) green = 255 * rgba->green; blue = 255 * rgba->blue; - return (guint32) ((((red & 0xFF) << 16) | ((green & 0xFF) << 8) | (blue & 0xFF)) & 0xffffff); + return (guint32) + ((((red & 0xFF) << 16) | + ((green & 0xFF) << 8) | + (blue & 0xFF)) & 0xffffff); } static gint @@ -903,7 +906,7 @@ e_format_number (gint number) number /= divider; break; case CHAR_MAX: - group = g_strdup_printf("%d", number); + group = g_strdup_printf ("%d", number); number = 0; break; } @@ -933,7 +936,7 @@ e_format_number (gint number) g_list_free (list); return value; } else { - return g_strdup("0"); + return g_strdup ("0"); } } @@ -1034,7 +1037,7 @@ e_strftime_fix_am_pm (gchar *str, gchar *ffmt; gsize ret; - if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) { + 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); } else { @@ -1049,12 +1052,12 @@ e_strftime_fix_am_pm (gchar *str, /* No AM/PM defined by locale * must change to 24 hour clock. */ ffmt = g_strdup (fmt); - for (sp=ffmt; (sp=strstr(sp, "%l")); sp++) { + 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. */ sp[1]='H'; } - for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) { + for (sp = ffmt; (sp = strstr (sp, "%I")); sp++) { sp[1]='H'; } ret = e_strftime (str, max, ffmt, tm); @@ -1392,7 +1395,8 @@ e_binding_transform_color_to_string (GBinding *binding, /* encode color manually, because css styles expect colors in #rrggbb, * not in #rrrrggggbbbb, which is a result of gdk_color_to_string() */ - string = g_strdup_printf ("#%02x%02x%02x", + string = g_strdup_printf ( + "#%02x%02x%02x", (gint) color->red * 256 / 65536, (gint) color->green * 256 / 65536, (gint) color->blue * 256 / 65536); |