From 753bebe04573dd884a2fe220e78e97e96acc3bfe Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 19 Feb 2009 15:15:49 +0000 Subject: [PATCH] sort functions so their order is more "standard", some cosmetic cleanup 2009-02-19 Michael Natterer * gtk/gtkmountoperation.c: sort functions so their order is more "standard", some cosmetic cleanup (not changing any code). svn path=/trunk/; revision=22377 --- ChangeLog | 5 +++ gtk/gtkmountoperation.c | 96 ++++++++++++++++------------------------- 2 files changed, 42 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c1be4f2ad..3e25f4329c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-19 Michael Natterer + + * gtk/gtkmountoperation.c: sort functions so their order is more + "standard", some cosmetic cleanup (not changing any code). + 2009-02-19 Michael Natterer * tests/testgtk.c: add some orientation flipping code to the diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c index d79fd43f28..b4802edd84 100644 --- a/gtk/gtkmountoperation.c +++ b/gtk/gtkmountoperation.c @@ -68,8 +68,7 @@ * When necessary, #GtkMountOperation shows dialogs to ask for passwords. */ -/* GObject, GtkObject methods - */ +static void gtk_mount_operation_finalize (GObject *object); static void gtk_mount_operation_set_property (GObject *object, guint prop_id, const GValue *value, @@ -78,10 +77,7 @@ static void gtk_mount_operation_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void gtk_mount_operation_finalize (GObject *object); -/* GMountOperation methods - */ static void gtk_mount_operation_ask_password (GMountOperation *op, const char *message, const char *default_user, @@ -121,30 +117,11 @@ struct _GtkMountOperationPrivate { gboolean anonymous; }; -static void -gtk_mount_operation_finalize (GObject *object) -{ - GtkMountOperation *operation; - GtkMountOperationPrivate *priv; - - operation = GTK_MOUNT_OPERATION (object); - - priv = operation->priv; - - if (priv->parent_window) - g_object_unref (priv->parent_window); - - if (priv->screen) - g_object_unref (priv->screen); - - G_OBJECT_CLASS (gtk_mount_operation_parent_class)->finalize (object); -} - static void gtk_mount_operation_class_init (GtkMountOperationClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GMountOperationClass *mount_op_class; + GMountOperationClass *mount_op_class = G_MOUNT_OPERATION_CLASS (klass); g_type_class_add_private (klass, sizeof (GtkMountOperationPrivate)); @@ -152,7 +129,6 @@ gtk_mount_operation_class_init (GtkMountOperationClass *klass) object_class->get_property = gtk_mount_operation_get_property; object_class->set_property = gtk_mount_operation_set_property; - mount_op_class = G_MOUNT_OPERATION_CLASS (klass); mount_op_class->ask_password = gtk_mount_operation_ask_password; mount_op_class->ask_question = gtk_mount_operation_ask_question; mount_op_class->aborted = gtk_mount_operation_aborted; @@ -180,9 +156,30 @@ gtk_mount_operation_class_init (GtkMountOperationClass *klass) P_("The screen where this window will be displayed."), GDK_TYPE_SCREEN, GTK_PARAM_READWRITE)); - } +static void +gtk_mount_operation_init (GtkMountOperation *operation) +{ + operation->priv = G_TYPE_INSTANCE_GET_PRIVATE (operation, + GTK_TYPE_MOUNT_OPERATION, + GtkMountOperationPrivate); +} + +static void +gtk_mount_operation_finalize (GObject *object) +{ + GtkMountOperation *operation = GTK_MOUNT_OPERATION (object); + GtkMountOperationPrivate *priv = operation->priv; + + if (priv->parent_window) + g_object_unref (priv->parent_window); + + if (priv->screen) + g_object_unref (priv->screen); + + G_OBJECT_CLASS (gtk_mount_operation_parent_class)->finalize (object); +} static void gtk_mount_operation_set_property (GObject *object, @@ -190,25 +187,20 @@ gtk_mount_operation_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - GtkMountOperation *operation; - gpointer tmp; - - operation = GTK_MOUNT_OPERATION (object); + GtkMountOperation *operation = GTK_MOUNT_OPERATION (object); switch (prop_id) { - case PROP_PARENT: - tmp = g_value_get_object (value); - gtk_mount_operation_set_parent (operation, tmp); - break; + case PROP_PARENT: + gtk_mount_operation_set_parent (operation, g_value_get_object (value)); + break; - case PROP_SCREEN: - tmp = g_value_get_object (value); - gtk_mount_operation_set_screen (operation, tmp); - break; + case PROP_SCREEN: + gtk_mount_operation_set_screen (operation, g_value_get_object (value)); + break; - case PROP_IS_SHOWING: - default: + case PROP_IS_SHOWING: + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } @@ -220,11 +212,8 @@ gtk_mount_operation_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - GtkMountOperationPrivate *priv; - GtkMountOperation *operation; - - operation = GTK_MOUNT_OPERATION (object); - priv = operation->priv; + GtkMountOperation *operation = GTK_MOUNT_OPERATION (object); + GtkMountOperationPrivate *priv = operation->priv; switch (prop_id) { @@ -246,14 +235,6 @@ gtk_mount_operation_get_property (GObject *object, } } -static void -gtk_mount_operation_init (GtkMountOperation *operation) -{ - operation->priv = G_TYPE_INSTANCE_GET_PRIVATE (operation, - GTK_TYPE_MOUNT_OPERATION, - GtkMountOperationPrivate); -} - static void remember_button_toggled (GtkToggleButton *button, GtkMountOperation *operation) @@ -274,11 +255,8 @@ pw_dialog_got_response (GtkDialog *dialog, gint response_id, GtkMountOperation *mount_op) { - GtkMountOperationPrivate *priv; - GMountOperation *op; - - priv = mount_op->priv; - op = G_MOUNT_OPERATION (mount_op); + GtkMountOperationPrivate *priv = mount_op->priv; + GMountOperation *op = G_MOUNT_OPERATION (mount_op); if (response_id == GTK_RESPONSE_OK) {