Yasumichi Akahoshi
yasum****@users*****
2005年 5月 19日 (木) 09:24:11 JST
Index: cxplorer/src/cxp-pref-dialog.c diff -u cxplorer/src/cxp-pref-dialog.c:1.4 cxplorer/src/cxp-pref-dialog.c:1.5 --- cxplorer/src/cxp-pref-dialog.c:1.4 Thu May 19 02:16:37 2005 +++ cxplorer/src/cxp-pref-dialog.c Thu May 19 09:24:11 2005 @@ -5,7 +5,7 @@ * A widget of Property dialog * @author Yasumichi Akahoshi <yasum****@users*****> * @date Sun Apr 3 02:53:00 2005 - * $Revision: 1.4 $ + * $Revision: 1.5 $ ****************************************************************************/ #ifdef HAVE_CONFIG_H @@ -63,13 +63,6 @@ gpointer g_class); static GObject * cxp_pref_dialog_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties); static void cxp_pref_dialog_construct_child (CxpPrefDialog *self); -static void cxp_pref_dialog_set_property (GObject * object, - guint property_id, - const GValue * value, - GParamSpec * pspec); -static void cxp_pref_dialog_get_property (GObject * object, - guint property_id, GValue * value, - GParamSpec * pspec); static void cxp_pref_dialog_dispose (GObject * obj); static void cxp_pref_dialog_finalize (GObject * obj); static void cxp_pref_dialog_ok_button_clicked (GtkWidget *button, CxpPrefDialog *dialog); @@ -78,25 +71,13 @@ static void cxp_pref_dialog_class_init (CxpPrefDialogClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GParamSpec *pspec; gobject_class->constructor = cxp_pref_dialog_constructor; - gobject_class->set_property = cxp_pref_dialog_set_property; - gobject_class->get_property = cxp_pref_dialog_get_property; gobject_class->dispose = cxp_pref_dialog_dispose; gobject_class->finalize = cxp_pref_dialog_finalize; parent_class = g_type_class_peek_parent (klass); - pspec = g_param_spec_object ("gconf-client", - "CxpPrefDialog construct prop", - "Set gconf-client", - GCONF_TYPE_CLIENT, - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE); - g_object_class_install_property (gobject_class, - CXP_PREF_DIALOG_GCONF_CLIENT, - pspec); - g_type_class_add_private (klass, sizeof (CxpPrefDialogPrivate)); } @@ -105,6 +86,7 @@ { CxpPrefDialogPrivate *private = CXP_PREF_DIALOG_GET_PRIVATE(instance); + private->client = gconf_client_get_default (); private->dispose_has_run = FALSE; } @@ -197,46 +179,6 @@ g_signal_connect (ok_button, "clicked", G_CALLBACK(cxp_pref_dialog_ok_button_clicked), self); } -static void cxp_pref_dialog_set_property (GObject * object, - guint property_id, - const GValue * value, - GParamSpec * pspec) -{ - CxpPrefDialog *self = CXP_PREF_DIALOG (object); - CxpPrefDialogPrivate *private = CXP_PREF_DIALOG_GET_PRIVATE(self); - - switch (property_id) - { - case CXP_PREF_DIALOG_GCONF_CLIENT: - if (private->client != NULL) - { - g_object_unref (private->client); - } - private->client = GCONF_CLIENT(g_value_dup_object (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void cxp_pref_dialog_get_property (GObject * object, - guint property_id, GValue * value, - GParamSpec * pspec) -{ - CxpPrefDialogPrivate *private = CXP_PREF_DIALOG_GET_PRIVATE(object); - - switch (property_id) - { - case CXP_PREF_DIALOG_GCONF_CLIENT: - g_value_set_object (value, private->client); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - static void cxp_pref_dialog_dispose (GObject * obj) { CxpPrefDialogPrivate *private = CXP_PREF_DIALOG_GET_PRIVATE(obj); @@ -314,11 +256,11 @@ /** * Creates a new dialog box which show detail of file. */ -GtkWidget *cxp_pref_dialog_new(GConfClient *client) +GtkWidget *cxp_pref_dialog_new (void) { CxpPrefDialog *dialog; - dialog = g_object_new(CXP_TYPE_PREF_DIALOG, "gconf-client", client, NULL); + dialog = g_object_new(CXP_TYPE_PREF_DIALOG, NULL); return GTK_WIDGET(dialog); } Index: cxplorer/src/cxp-pref-dialog.h diff -u cxplorer/src/cxp-pref-dialog.h:1.2 cxplorer/src/cxp-pref-dialog.h:1.3 --- cxplorer/src/cxp-pref-dialog.h:1.2 Sun May 8 01:03:23 2005 +++ cxplorer/src/cxp-pref-dialog.h Thu May 19 09:24:11 2005 @@ -34,6 +34,6 @@ GType cxp_pref_dialog_get_type (void); /* API. */ -GtkWidget *cxp_pref_dialog_new(GConfClient *client); +GtkWidget *cxp_pref_dialog_new (void); #endif /* CXP_PREF_DIALOG_H */ Index: cxplorer/src/cxplorer-window.c diff -u cxplorer/src/cxplorer-window.c:1.56 cxplorer/src/cxplorer-window.c:1.57 --- cxplorer/src/cxplorer-window.c:1.56 Thu May 19 08:16:16 2005 +++ cxplorer/src/cxplorer-window.c Thu May 19 09:24:11 2005 @@ -778,7 +778,7 @@ CxplorerWindowPrivate *private = CXPLORER_WINDOW_GET_PRIVATE (user_data); GtkWidget *dialog; - dialog = cxp_pref_dialog_new (private->client); + dialog = cxp_pref_dialog_new (); gtk_dialog_run (GTK_DIALOG(dialog)); gtk_widget_destroy (dialog); }