diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-08-29 18:24:05 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-08-29 18:37:10 +0200 |
commit | 52d960542b4d5fdf2bd06735d0dbf7934cf2ec12 (patch) | |
tree | 5e000d5ed40b52b003c02b597e51ae0b87ff22ac /libnautilus-extension/nautilus-property-page.c | |
parent | 4cafccd82859a4ee0bdfad3e31a310f2d94c0485 (diff) | |
download | nautilus-52d960542b4d5fdf2bd06735d0dbf7934cf2ec12.tar.gz |
general: run uncrustify
And make the style of Nautilus the same for all files.
Hopefully we can fix all the style issues we can find in the next days,
so expect a little of movement on this.
https://bugzilla.gnome.org/show_bug.cgi?id=770564
Diffstat (limited to 'libnautilus-extension/nautilus-property-page.c')
-rw-r--r-- | libnautilus-extension/nautilus-property-page.c | 340 |
1 files changed, 186 insertions, 154 deletions
diff --git a/libnautilus-extension/nautilus-property-page.c b/libnautilus-extension/nautilus-property-page.c index 545f2999f..a1c9d3a87 100644 --- a/libnautilus-extension/nautilus-property-page.c +++ b/libnautilus-extension/nautilus-property-page.c @@ -1,5 +1,5 @@ /* - * nautilus-property-page.h - Property pages exported by + * nautilus-property-page.h - Property pages exported by * NautilusPropertyProvider objects. * * Copyright (C) 2003 Novell, Inc. @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU Library General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. - * + * * Author: Dave Camp <dave@ximian.com> * */ @@ -26,18 +26,20 @@ #include <glib/gi18n-lib.h> -enum { - PROP_0, - PROP_NAME, - PROP_LABEL, - PROP_PAGE, - LAST_PROP +enum +{ + PROP_0, + PROP_NAME, + PROP_LABEL, + PROP_PAGE, + LAST_PROP }; -struct _NautilusPropertyPageDetails { - char *name; - GtkWidget *label; - GtkWidget *page; +struct _NautilusPropertyPageDetails +{ + char *name; + GtkWidget *label; + GtkWidget *page; }; static GObjectClass *parent_class = NULL; @@ -67,182 +69,212 @@ static GObjectClass *parent_class = NULL; */ NautilusPropertyPage * nautilus_property_page_new (const char *name, - GtkWidget *label, - GtkWidget *page_widget) + GtkWidget *label, + GtkWidget *page_widget) { - NautilusPropertyPage *page; - - g_return_val_if_fail (name != NULL, NULL); - g_return_val_if_fail (label != NULL && GTK_IS_WIDGET (label), NULL); - g_return_val_if_fail (page_widget != NULL && GTK_IS_WIDGET (page_widget), - NULL); - - page = g_object_new (NAUTILUS_TYPE_PROPERTY_PAGE, - "name", name, - "label", label, - "page", page_widget, - NULL); - - return page; + NautilusPropertyPage *page; + + g_return_val_if_fail (name != NULL, NULL); + g_return_val_if_fail (label != NULL && GTK_IS_WIDGET (label), NULL); + g_return_val_if_fail (page_widget != NULL && GTK_IS_WIDGET (page_widget), + NULL); + + page = g_object_new (NAUTILUS_TYPE_PROPERTY_PAGE, + "name", name, + "label", label, + "page", page_widget, + NULL); + + return page; } static void -nautilus_property_page_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec) +nautilus_property_page_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec) { - NautilusPropertyPage *page; - - page = NAUTILUS_PROPERTY_PAGE (object); - - switch (param_id) { - case PROP_NAME : - g_value_set_string (value, page->details->name); - break; - case PROP_LABEL : - g_value_set_object (value, page->details->label); - break; - case PROP_PAGE : - g_value_set_object (value, page->details->page); - break; - default : - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } + NautilusPropertyPage *page; + + page = NAUTILUS_PROPERTY_PAGE (object); + + switch (param_id) + { + case PROP_NAME: + { + g_value_set_string (value, page->details->name); + } + break; + + case PROP_LABEL: + { + g_value_set_object (value, page->details->label); + } + break; + + case PROP_PAGE: + { + g_value_set_object (value, page->details->page); + } + break; + + default: + { + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + } + break; + } } static void -nautilus_property_page_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec) +nautilus_property_page_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec) { - NautilusPropertyPage *page; - - page = NAUTILUS_PROPERTY_PAGE (object); - - switch (param_id) { - case PROP_NAME : - g_free (page->details->name); - page->details->name = g_strdup (g_value_get_string (value)); - g_object_notify (object, "name"); - break; - case PROP_LABEL : - if (page->details->label) { - g_object_unref (page->details->label); - } - - page->details->label = g_object_ref (g_value_get_object (value)); - g_object_notify (object, "label"); - break; - case PROP_PAGE : - if (page->details->page) { - g_object_unref (page->details->page); - } - - page->details->page = g_object_ref (g_value_get_object (value)); - g_object_notify (object, "page"); - break; - default : - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); - break; - } + NautilusPropertyPage *page; + + page = NAUTILUS_PROPERTY_PAGE (object); + + switch (param_id) + { + case PROP_NAME: + { + g_free (page->details->name); + page->details->name = g_strdup (g_value_get_string (value)); + g_object_notify (object, "name"); + } + break; + + case PROP_LABEL: + { + if (page->details->label) + { + g_object_unref (page->details->label); + } + + page->details->label = g_object_ref (g_value_get_object (value)); + g_object_notify (object, "label"); + } + break; + + case PROP_PAGE: + { + if (page->details->page) + { + g_object_unref (page->details->page); + } + + page->details->page = g_object_ref (g_value_get_object (value)); + g_object_notify (object, "page"); + } + break; + + default: + { + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); + } + break; + } } static void nautilus_property_page_dispose (GObject *object) { - NautilusPropertyPage *page; - - page = NAUTILUS_PROPERTY_PAGE (object); - - if (page->details->label) { - g_object_unref (page->details->label); - page->details->label = NULL; - } - if (page->details->page) { - g_object_unref (page->details->page); - page->details->page = NULL; - } + NautilusPropertyPage *page; + + page = NAUTILUS_PROPERTY_PAGE (object); + + if (page->details->label) + { + g_object_unref (page->details->label); + page->details->label = NULL; + } + if (page->details->page) + { + g_object_unref (page->details->page); + page->details->page = NULL; + } } static void nautilus_property_page_finalize (GObject *object) { - NautilusPropertyPage *page; - - page = NAUTILUS_PROPERTY_PAGE (object); + NautilusPropertyPage *page; - g_free (page->details->name); + page = NAUTILUS_PROPERTY_PAGE (object); - g_free (page->details); + g_free (page->details->name); - G_OBJECT_CLASS (parent_class)->finalize (object); + g_free (page->details); + + G_OBJECT_CLASS (parent_class)->finalize (object); } static void nautilus_property_page_instance_init (NautilusPropertyPage *page) { - page->details = g_new0 (NautilusPropertyPageDetails, 1); + page->details = g_new0 (NautilusPropertyPageDetails, 1); } static void nautilus_property_page_class_init (NautilusPropertyPageClass *class) { - parent_class = g_type_class_peek_parent (class); - - G_OBJECT_CLASS (class)->finalize = nautilus_property_page_finalize; - G_OBJECT_CLASS (class)->dispose = nautilus_property_page_dispose; - G_OBJECT_CLASS (class)->get_property = nautilus_property_page_get_property; - G_OBJECT_CLASS (class)->set_property = nautilus_property_page_set_property; - - g_object_class_install_property (G_OBJECT_CLASS (class), - PROP_NAME, - g_param_spec_string ("name", - "Name", - "Name of the page", - NULL, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE)); - g_object_class_install_property (G_OBJECT_CLASS (class), - PROP_LABEL, - g_param_spec_object ("label", - "Label", - "Label widget to display in the notebook tab", - GTK_TYPE_WIDGET, - G_PARAM_READWRITE)); - g_object_class_install_property (G_OBJECT_CLASS (class), - PROP_PAGE, - g_param_spec_object ("page", - "Page", - "Widget for the property page", - GTK_TYPE_WIDGET, - G_PARAM_READWRITE)); + parent_class = g_type_class_peek_parent (class); + + G_OBJECT_CLASS (class)->finalize = nautilus_property_page_finalize; + G_OBJECT_CLASS (class)->dispose = nautilus_property_page_dispose; + G_OBJECT_CLASS (class)->get_property = nautilus_property_page_get_property; + G_OBJECT_CLASS (class)->set_property = nautilus_property_page_set_property; + + g_object_class_install_property (G_OBJECT_CLASS (class), + PROP_NAME, + g_param_spec_string ("name", + "Name", + "Name of the page", + NULL, + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS (class), + PROP_LABEL, + g_param_spec_object ("label", + "Label", + "Label widget to display in the notebook tab", + GTK_TYPE_WIDGET, + G_PARAM_READWRITE)); + g_object_class_install_property (G_OBJECT_CLASS (class), + PROP_PAGE, + g_param_spec_object ("page", + "Page", + "Widget for the property page", + GTK_TYPE_WIDGET, + G_PARAM_READWRITE)); } -GType +GType nautilus_property_page_get_type (void) { - static GType type = 0; - - if (!type) { - const GTypeInfo info = { - sizeof (NautilusPropertyPageClass), - NULL, - NULL, - (GClassInitFunc)nautilus_property_page_class_init, - NULL, - NULL, - sizeof (NautilusPropertyPage), - 0, - (GInstanceInitFunc)nautilus_property_page_instance_init - }; - - type = g_type_register_static - (G_TYPE_OBJECT, - "NautilusPropertyPage", - &info, 0); - } - - return type; + static GType type = 0; + + if (!type) + { + const GTypeInfo info = + { + sizeof (NautilusPropertyPageClass), + NULL, + NULL, + (GClassInitFunc) nautilus_property_page_class_init, + NULL, + NULL, + sizeof (NautilusPropertyPage), + 0, + (GInstanceInitFunc) nautilus_property_page_instance_init + }; + + type = g_type_register_static + (G_TYPE_OBJECT, + "NautilusPropertyPage", + &info, 0); + } + + return type; } |