From 7e439efc922b9566bd44a6061c5615c30ebb1916 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 4 Aug 2008 14:43:53 +0000 Subject: [PATCH] Deprecate gtk_file_chooser_*_new_with_backend(), since GIO is already used 2008-08-04 Carlos Garnacho * gtk/gtk.symbols: * gtk/gtkfilechooserbutton.[ch]: * gtk/gtkfilechooserdefault.[ch]: * gtk/gtkfilechooserdialog.[ch]: * gtk/gtkfilechooserwidget.[ch]: Deprecate gtk_file_chooser_*_new_with_backend(), since GIO is already used directly. Fixes #545976. svn path=/trunk/; revision=20972 --- ChangeLog | 10 ++++++++++ gtk/gtk.symbols | 6 ++++++ gtk/gtkfilechooserbutton.c | 33 +++++++++------------------------ gtk/gtkfilechooserbutton.h | 4 ++++ gtk/gtkfilechooserdefault.c | 6 ++---- gtk/gtkfilechooserdefault.h | 2 +- gtk/gtkfilechooserdialog.c | 2 +- gtk/gtkfilechooserdialog.h | 3 +++ gtk/gtkfilechooserwidget.c | 4 ++-- gtk/gtkfilechooserwidget.h | 5 +++++ 10 files changed, 43 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f901c80e0..fd2e7c943f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-04 Carlos Garnacho + + * gtk/gtk.symbols: + * gtk/gtkfilechooserbutton.[ch]: + * gtk/gtkfilechooserdefault.[ch]: + * gtk/gtkfilechooserdialog.[ch]: + * gtk/gtkfilechooserwidget.[ch]: Deprecate + gtk_file_chooser_*_new_with_backend(), since GIO is already used + directly. Fixes #545976. + 2008-08-04 Carlos Garnacho * gtk/gtk.symbols: diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 26284adafe..0c4a436b8d 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -1446,17 +1446,21 @@ gtk_file_chooser_unselect_uri #if IN_FILE(__GTK_FILE_CHOOSER_DIALOG_C__) gtk_file_chooser_dialog_get_type G_GNUC_CONST gtk_file_chooser_dialog_new +#ifndef GTK_DISABLE_DEPRECATED gtk_file_chooser_dialog_new_with_backend #endif #endif +#endif #if IN_HEADER(__GTK_FILE_CHOOSER_WIDGET_H__) #if IN_FILE(__GTK_FILE_CHOOSER_WIDGET_C__) gtk_file_chooser_widget_get_type G_GNUC_CONST gtk_file_chooser_widget_new +#ifndef GTK_DISABLE_DEPRECATED gtk_file_chooser_widget_new_with_backend #endif #endif +#endif #if IN_HEADER(__GTK_FILE_CHOOSER_BUTTON_H__) #if IN_FILE(__GTK_FILE_CHOOSER_BUTTON_C__) @@ -1464,7 +1468,9 @@ gtk_file_chooser_button_get_title gtk_file_chooser_button_get_type G_GNUC_CONST gtk_file_chooser_button_get_width_chars gtk_file_chooser_button_new +#ifndef GTK_DISABLE_DEPRECATED gtk_file_chooser_button_new_with_backend +#endif gtk_file_chooser_button_new_with_dialog gtk_file_chooser_button_set_title gtk_file_chooser_button_set_width_chars diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index 4c9904f92a..1e6519b9c8 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -137,7 +137,6 @@ struct _GtkFileChooserButtonPrivate GtkTreeModel *model; GtkTreeModel *filter_model; - gchar *backend; GtkFileSystem *fs; GFile *old_file; @@ -646,23 +645,13 @@ gtk_file_chooser_button_constructor (GType type, if (!priv->dialog) { - if (priv->backend) - priv->dialog = gtk_file_chooser_dialog_new_with_backend (NULL, NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - priv->backend, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, - GTK_RESPONSE_ACCEPT, - NULL); - else - priv->dialog = gtk_file_chooser_dialog_new (NULL, NULL, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, - GTK_RESPONSE_ACCEPT, - NULL); + priv->dialog = gtk_file_chooser_dialog_new (NULL, NULL, + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, + GTK_RESPONSE_ACCEPT, + NULL); gtk_dialog_set_default_response (GTK_DIALOG (priv->dialog), GTK_RESPONSE_ACCEPT); @@ -685,9 +674,6 @@ gtk_file_chooser_button_constructor (GType type, g_free (current_folder); } - g_free (priv->backend); - priv->backend = NULL; - g_signal_connect (priv->dialog, "delete_event", G_CALLBACK (dialog_delete_event_cb), object); g_signal_connect (priv->dialog, "response", @@ -834,8 +820,7 @@ gtk_file_chooser_button_set_property (GObject *object, break; case GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND: - /* Construct-only */ - priv->backend = g_value_dup_string (value); + /* Ignore property */ break; case GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLE: @@ -2755,6 +2740,7 @@ gtk_file_chooser_button_new (const gchar *title, * Returns: a new button widget. * * Since: 2.6 + * Deprecated: 2.14 **/ GtkWidget * gtk_file_chooser_button_new_with_backend (const gchar *title, @@ -2767,7 +2753,6 @@ gtk_file_chooser_button_new_with_backend (const gchar *title, return g_object_new (GTK_TYPE_FILE_CHOOSER_BUTTON, "action", action, "title", (title ? title : _(DEFAULT_TITLE)), - "file-system-backend", backend, NULL); } diff --git a/gtk/gtkfilechooserbutton.h b/gtk/gtkfilechooserbutton.h index 4d9311726f..b57209c84c 100644 --- a/gtk/gtkfilechooserbutton.h +++ b/gtk/gtkfilechooserbutton.h @@ -69,9 +69,13 @@ struct _GtkFileChooserButtonClass GType gtk_file_chooser_button_get_type (void) G_GNUC_CONST; GtkWidget * gtk_file_chooser_button_new (const gchar *title, GtkFileChooserAction action); + +#ifndef GTK_DISABLE_DEPRECATED GtkWidget * gtk_file_chooser_button_new_with_backend (const gchar *title, GtkFileChooserAction action, const gchar *backend); +#endif /* GTK_DISABLE_DEPRECATED */ + GtkWidget * gtk_file_chooser_button_new_with_dialog (GtkWidget *dialog); G_CONST_RETURN gchar *gtk_file_chooser_button_get_title (GtkFileChooserButton *button); void gtk_file_chooser_button_set_title (GtkFileChooserButton *button, diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 6f22139da2..bc6b2ee798 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -11010,11 +11010,9 @@ list_mtime_data_func (GtkTreeViewColumn *tree_column, } GtkWidget * -_gtk_file_chooser_default_new (const char *file_system) +_gtk_file_chooser_default_new (void) { - return g_object_new (GTK_TYPE_FILE_CHOOSER_DEFAULT, - "file-system-backend", file_system, - NULL); + return g_object_new (GTK_TYPE_FILE_CHOOSER_DEFAULT, NULL); } static void diff --git a/gtk/gtkfilechooserdefault.h b/gtk/gtkfilechooserdefault.h index d4fbda7426..e6eabefefc 100644 --- a/gtk/gtkfilechooserdefault.h +++ b/gtk/gtkfilechooserdefault.h @@ -33,7 +33,7 @@ G_BEGIN_DECLS typedef struct _GtkFileChooserDefault GtkFileChooserDefault; GType _gtk_file_chooser_default_get_type (void) G_GNUC_CONST; -GtkWidget *_gtk_file_chooser_default_new (const char *file_system); +GtkWidget *_gtk_file_chooser_default_new (void); G_END_DECLS diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c index c180a05c2a..93f71c15e6 100644 --- a/gtk/gtkfilechooserdialog.c +++ b/gtk/gtkfilechooserdialog.c @@ -466,7 +466,6 @@ gtk_file_chooser_dialog_new_valist (const gchar *title, result = g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG, "title", title, "action", action, - "file-system-backend", backend, NULL); if (parent) @@ -533,6 +532,7 @@ gtk_file_chooser_dialog_new (const gchar *title, * Return value: a new #GtkFileChooserDialog * * Since: 2.4 + * Deprecated: 2.14 **/ GtkWidget * gtk_file_chooser_dialog_new_with_backend (const gchar *title, diff --git a/gtk/gtkfilechooserdialog.h b/gtk/gtkfilechooserdialog.h index e792fd74ae..d79f6f89a7 100644 --- a/gtk/gtkfilechooserdialog.h +++ b/gtk/gtkfilechooserdialog.h @@ -59,12 +59,15 @@ GtkWidget *gtk_file_chooser_dialog_new (const gchar *title GtkFileChooserAction action, const gchar *first_button_text, ...) G_GNUC_NULL_TERMINATED; + +#ifndef GTK_DISABLE_DEPRECATED GtkWidget *gtk_file_chooser_dialog_new_with_backend (const gchar *title, GtkWindow *parent, GtkFileChooserAction action, const gchar *backend, const gchar *first_button_text, ...) G_GNUC_NULL_TERMINATED; +#endif /* GTK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index bb0792117f..3119ce11df 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -100,7 +100,7 @@ gtk_file_chooser_widget_constructor (GType type, gtk_widget_push_composite_child (); - priv->impl = _gtk_file_chooser_default_new (priv->file_system); + priv->impl = _gtk_file_chooser_default_new (); gtk_box_pack_start (GTK_BOX (object), priv->impl, TRUE, TRUE, 0); gtk_widget_show (priv->impl); @@ -181,6 +181,7 @@ gtk_file_chooser_widget_new (GtkFileChooserAction action) * Return value: a new #GtkFileChooserWidget * * Since: 2.4 + * Deprecated: 2.14 **/ GtkWidget * gtk_file_chooser_widget_new_with_backend (GtkFileChooserAction action, @@ -188,7 +189,6 @@ gtk_file_chooser_widget_new_with_backend (GtkFileChooserAction action, { return g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, "action", action, - "file-system-backend", backend, NULL); } diff --git a/gtk/gtkfilechooserwidget.h b/gtk/gtkfilechooserwidget.h index 1dedeb7a43..333531f573 100644 --- a/gtk/gtkfilechooserwidget.h +++ b/gtk/gtkfilechooserwidget.h @@ -55,8 +55,13 @@ struct _GtkFileChooserWidgetClass GType gtk_file_chooser_widget_get_type (void) G_GNUC_CONST; GtkWidget *gtk_file_chooser_widget_new (GtkFileChooserAction action); + + +#ifndef GTK_DISABLE_DEPRECATED GtkWidget *gtk_file_chooser_widget_new_with_backend (GtkFileChooserAction action, const gchar *backend); +#endif /* GTK_DISABLE_DEPRECATED */ + G_END_DECLS #endif /* __GTK_FILE_CHOOSER_WIDGET_H__ */