aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-04 11:47:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-01-05 09:22:21 +0800
commit5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a (patch)
tree92b05ad7116690bf2da53a0fa6ba813fcbea50c7 /e-util
parent69945127d8a7933512bb14eb20ff85354704b5cc (diff)
downloadgsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.gz
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.bz2
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.lz
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.xz
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.tar.zst
gsoc2013-evolution-5c80f1534b435ff5c1c9cc88eb9f5c5c1124f82a.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-html-utils.c5
-rw-r--r--e-util/e-logger.c10
-rw-r--r--e-util/e-non-intrusive-error-dialog.c11
-rw-r--r--e-util/e-util.c85
4 files changed, 76 insertions, 35 deletions
diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c
index 03e5b73fc0..8e3b050f65 100644
--- a/e-util/e-html-utils.c
+++ b/e-util/e-html-utils.c
@@ -496,7 +496,10 @@ main (gint argc, gchar **argv)
gchar *html, *url, *p;
for (i = 0; i < num_url_tests; i++) {
- html = e_text_to_html (url_tests[i].text, E_TEXT_TO_HTML_CONVERT_URLS | E_TEXT_TO_HTML_CONVERT_ADDRESSES);
+ html = e_text_to_html (
+ url_tests[i].text,
+ E_TEXT_TO_HTML_CONVERT_URLS |
+ E_TEXT_TO_HTML_CONVERT_ADDRESSES);
url = strstr (html, "href=\"");
if (url) {
diff --git a/e-util/e-logger.c b/e-util/e-logger.c
index 07571d229a..dd151b6009 100644
--- a/e-util/e-logger.c
+++ b/e-util/e-logger.c
@@ -93,7 +93,10 @@ logger_set_name (ELogger *logger,
logger->priv->timer = 0;
if (!logger->priv->fp)
- g_warning ("%s: Failed to open log file '%s' for writing.", G_STRFUNC, logger->priv->logfile ? logger->priv->logfile : "[null]");
+ g_warning (
+ "%s: Failed to open log file '%s' for writing.",
+ G_STRFUNC, logger->priv->logfile ?
+ logger->priv->logfile : "[null]");
g_free (temp);
}
@@ -260,7 +263,10 @@ e_logger_get_logs (ELogger *logger,
fp = g_fopen (logger->priv->logfile, "r");
if (!fp) {
- g_warning ("%s: Cannot open log file '%s' for reading! No flush yet?\n", G_STRFUNC, logger->priv->logfile ? logger->priv->logfile : "[null]");
+ g_warning (
+ "%s: Cannot open log file '%s' for reading! "
+ "No flush yet?\n", G_STRFUNC, logger->priv->logfile ?
+ logger->priv->logfile : "[null]");
return;
}
diff --git a/e-util/e-non-intrusive-error-dialog.c b/e-util/e-non-intrusive-error-dialog.c
index e36190fc9a..4e7e8a2d58 100644
--- a/e-util/e-non-intrusive-error-dialog.c
+++ b/e-util/e-non-intrusive-error-dialog.c
@@ -171,7 +171,10 @@ eni_error_level_value_changed (GtkComboBox *w, gpointer *data)
}
void
-eni_show_logger(ELogger *logger, GtkWidget *top,const gchar *error_timeout_path, const gchar *error_level_path)
+eni_show_logger (ELogger *logger,
+ GtkWidget *top,
+ const gchar *error_timeout_path,
+ const gchar *error_level_path)
{
GtkWidget *container;
GtkWidget *label;
@@ -233,8 +236,10 @@ eni_show_logger(ELogger *logger, GtkWidget *top,const gchar *error_timeout_path,
widget = gtk_combo_box_new_text ();
for (i = E_LOG_ERROR; i <= E_LOG_DEBUG; i++)
gtk_combo_box_append_text (
- GTK_COMBO_BOX (widget), ldata[i].text);
- gtk_combo_box_set_active ((GtkComboBox *) widget, eni_config_get_error_level(error_level_path));
+ GTK_COMBO_BOX (widget), ldata[i].text);
+ gtk_combo_box_set_active (
+ GTK_COMBO_BOX (widget),
+ eni_config_get_error_level (error_level_path));
g_signal_connect (
widget, "changed",
diff --git a/e-util/e-util.c b/e-util/e-util.c
index ade2b38fbf..eaf98f33e5 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -724,7 +724,9 @@ e_format_number (gint number)
}
if (list) {
- value = g_new(gchar, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep));
+ value = g_new (
+ gchar, 1 + char_length + (group_count - 1) *
+ strlen (locality->thousands_sep));
iterator = list;
value_iterator = value;
@@ -1232,23 +1234,34 @@ e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d)
}
/* font options cache */
-static gchar *fo_antialiasing = NULL, *fo_hinting = NULL, *fo_subpixel_order = NULL;
+static gchar *fo_antialiasing = NULL;
+static gchar *fo_hinting = NULL;
+static gchar *fo_subpixel_order = NULL;
static GStaticMutex fo_lock = G_STATIC_MUTEX_INIT;
static void
-fo_option_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data)
+fo_option_changed (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data)
{
- #define update_value(key,variable) \
- g_free (variable); \
- variable = gconf_client_get_string (client, "/desktop/gnome/font_rendering/" key, NULL);
+ const gchar *key;
g_static_mutex_lock (&fo_lock);
- update_value ("antialiasing", fo_antialiasing);
- update_value ("hinting", fo_hinting);
- update_value ("rgba_order", fo_subpixel_order);
- g_static_mutex_unlock (&fo_lock);
- #undef update_value
+ g_free (fo_antialiasing);
+ key = "/desktop/gnome/font_rendering/antialiasing";
+ fo_antialiasing = gconf_client_get_string (client, key, NULL);
+
+ g_free (fo_hinting);
+ key = "/desktop/gnome/font_rendering/hinting";
+ fo_hinting = gconf_client_get_string (client, key, NULL);
+
+ g_free (fo_subpixel_order);
+ key = "/desktop/gnome/font_rendering/rgba_order";
+ fo_subpixel_order = gconf_client_get_string (client, key, NULL);
+
+ g_static_mutex_unlock (&fo_lock);
}
cairo_font_options_t *
@@ -1258,12 +1271,25 @@ get_font_options (void)
cairo_font_options_t *font_options = cairo_font_options_create ();
if (fo_gconf == NULL) {
+ const gchar *key;
+
fo_gconf = gconf_client_get_default ();
- gconf_client_add_dir (fo_gconf, "/desktop/gnome/font_rendering", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
- gconf_client_notify_add (fo_gconf, "/desktop/gnome/font_rendering/antialiasing", fo_option_changed, NULL, NULL, NULL);
- gconf_client_notify_add (fo_gconf, "/desktop/gnome/font_rendering/hinting", fo_option_changed, NULL, NULL, NULL);
- gconf_client_notify_add (fo_gconf, "/desktop/gnome/font_rendering/rgba_order", fo_option_changed, NULL, NULL, NULL);
+ key = "/desktop/gnome/font_rendering";
+ gconf_client_add_dir (
+ fo_gconf, key, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
+ key = "/desktop/gnome/font_rendering/antialiasing";
+ gconf_client_notify_add (
+ fo_gconf, key, fo_option_changed, NULL, NULL, NULL);
+
+ key = "/desktop/gnome/font_rendering/hinting";
+ gconf_client_notify_add (
+ fo_gconf, key, fo_option_changed, NULL, NULL, NULL);
+
+ key = "/desktop/gnome/font_rendering/rgba_order";
+ gconf_client_notify_add (
+ fo_gconf, key, fo_option_changed, NULL, NULL, NULL);
fo_option_changed (fo_gconf, 0, NULL, NULL);
}
@@ -1391,24 +1417,23 @@ e_util_guess_mime_type (const gchar *filename, gboolean localfile)
if (localfile) {
GFile *file;
+ GFileInfo *fi;
if (strstr (filename, "://"))
file = g_file_new_for_uri (filename);
else
file = g_file_new_for_path (filename);
- if (file) {
- GFileInfo *fi;
-
- fi = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
- if (fi) {
- mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (fi));
-
- g_object_unref (fi);
- }
-
- g_object_unref (file);
+ fi = g_file_query_info (
+ file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ G_FILE_QUERY_INFO_NONE, NULL, NULL);
+ if (fi) {
+ mime_type = g_content_type_get_mime_type (
+ g_file_info_get_content_type (fi));
+ g_object_unref (fi);
}
+
+ g_object_unref (file);
}
if (!mime_type) {
@@ -1456,7 +1481,8 @@ e_util_get_category_filter_options (void)
* Sets an #ESourceList of a given GConf path to an #ESourceComboBox.
**/
void
-e_util_set_source_combo_box_list (GtkWidget *source_combo_box, const gchar *source_gconf_path)
+e_util_set_source_combo_box_list (GtkWidget *source_combo_box,
+ const gchar *source_gconf_path)
{
ESourceList *source_list;
GConfClient *gconf_client;
@@ -1465,8 +1491,9 @@ e_util_set_source_combo_box_list (GtkWidget *source_combo_box, const gchar *sour
g_return_if_fail (source_gconf_path != NULL);
gconf_client = gconf_client_get_default ();
- source_list = e_source_list_new_for_gconf (gconf_client, source_gconf_path);
- g_object_set (G_OBJECT (source_combo_box), "source-list", source_list, NULL);
+ source_list = e_source_list_new_for_gconf (
+ gconf_client, source_gconf_path);
+ g_object_set (source_combo_box, "source-list", source_list, NULL);
g_object_unref (source_list);
g_object_unref (gconf_client);
}