diff options
author | Michael Catanzaro <mcatanzaro@igalia.com> | 2016-03-21 23:13:34 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2016-03-21 23:55:15 -0500 |
commit | c5d5bd28f071b3734b0f07af7e802f902263d6f0 (patch) | |
tree | 32a2bf0127ac7732e4afa4dd65da6c81b17585ee /embed/ephy-encoding.c | |
parent | 17c9805c3b7901d17666c71a2163de980eb5c774 (diff) | |
download | epiphany-uncrustify.tar.gz |
Uncrustifyuncrustify
For a better future. Apologies when your 'git blame' resolves to this.
I'm actually really impressed how well uncrustify works. This required
only a little one-time manual work to avoid extra space in 'else {'.
This breaks function prototype alignment, but we should get rid of most
of those anyway.
We decided to start aligning function parameters, like other GNOME
applications. It looks nicer this way, and I couldn't teach uncrustify
the previous Epiphany style.
Diffstat (limited to 'embed/ephy-encoding.c')
-rw-r--r-- | embed/ephy-encoding.c | 122 |
1 files changed, 60 insertions, 62 deletions
diff --git a/embed/ephy-encoding.c b/embed/ephy-encoding.c index a0665a515..dec62dfec 100644 --- a/embed/ephy-encoding.c +++ b/embed/ephy-encoding.c @@ -21,8 +21,7 @@ #include <string.h> -struct _EphyEncoding -{ +struct _EphyEncoding { GObject parent_instance; char *title; @@ -62,9 +61,9 @@ ephy_encoding_finalize (GObject *object) } static void -ephy_encoding_get_property (GObject *object, - guint prop_id, - GValue *value, +ephy_encoding_get_property (GObject *object, + guint prop_id, + GValue *value, GParamSpec *pspec) { EphyEncoding *encoding = EPHY_ENCODING (object); @@ -105,8 +104,7 @@ elide_underscores (const char *original) for (p = original; *p; p++) { if (!last_underscore && *p == '_') { last_underscore = TRUE; - } - else { + } else { last_underscore = FALSE; *q++ = *p; } @@ -118,53 +116,53 @@ elide_underscores (const char *original) } static void -ephy_encoding_set_property (GObject *object, - guint prop_id, +ephy_encoding_set_property (GObject *object, + guint prop_id, const GValue *value, - GParamSpec *pspec) + GParamSpec *pspec) { EphyEncoding *encoding = EPHY_ENCODING (object); switch (prop_id) { - case PROP_TITLE: { - char *elided, *collate_key, *normalised; - - g_free (encoding->title); - encoding->title = g_strdup (g_value_get_string (value)); - - elided = elide_underscores (encoding->title); - normalised = g_utf8_normalize (elided, -1, G_NORMALIZE_DEFAULT); - collate_key = g_utf8_collate_key (normalised, -1); - - g_object_set (object, - "title-elided", elided, - "collation-key", collate_key, - NULL); - - g_free (collate_key); - g_free (normalised); - g_free (elided); - - break; - } - case PROP_TITLE_ELIDED: - g_free (encoding->title_elided); - encoding->title_elided = g_strdup (g_value_get_string (value)); - break; - case PROP_COLLATION_KEY: - g_free (encoding->collation_key); - encoding->collation_key = g_strdup (g_value_get_string (value)); - break; - case PROP_ENCODING: - g_free (encoding->encoding); - encoding->encoding = g_strdup (g_value_get_string (value)); - break; - case PROP_LANGUAGE_GROUPS: - encoding->language_groups = g_value_get_int (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; + case PROP_TITLE: { + char *elided, *collate_key, *normalised; + + g_free (encoding->title); + encoding->title = g_strdup (g_value_get_string (value)); + + elided = elide_underscores (encoding->title); + normalised = g_utf8_normalize (elided, -1, G_NORMALIZE_DEFAULT); + collate_key = g_utf8_collate_key (normalised, -1); + + g_object_set (object, + "title-elided", elided, + "collation-key", collate_key, + NULL); + + g_free (collate_key); + g_free (normalised); + g_free (elided); + + break; + } + case PROP_TITLE_ELIDED: + g_free (encoding->title_elided); + encoding->title_elided = g_strdup (g_value_get_string (value)); + break; + case PROP_COLLATION_KEY: + g_free (encoding->collation_key); + encoding->collation_key = g_strdup (g_value_get_string (value)); + break; + case PROP_ENCODING: + g_free (encoding->encoding); + encoding->encoding = g_strdup (g_value_get_string (value)); + break; + case PROP_LANGUAGE_GROUPS: + encoding->language_groups = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; } } @@ -193,25 +191,25 @@ ephy_encoding_class_init (EphyEncodingClass *klass) obj_properties[PROP_COLLATION_KEY] = g_param_spec_string ("collation-key", - "Collation Key", - "The encoding's collation key", - "", - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + "Collation Key", + "The encoding's collation key", + "", + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); obj_properties[PROP_ENCODING] = g_param_spec_string ("encoding", - "Encoding", - "The encoding's encoding", - "", - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + "Encoding", + "The encoding's encoding", + "", + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); obj_properties[PROP_LANGUAGE_GROUPS] = g_param_spec_int ("language-groups", - "Language Groups", - "The encoding's language groups", - LG_NONE, LG_ALL, - LG_NONE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); + "Language Groups", + "The encoding's language groups", + LG_NONE, LG_ALL, + LG_NONE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_properties (gobject_class, LAST_PROP, obj_properties); } |