filechooser: Drop the ::current-folder-changed signal

This signal does not work on native file choosers,
and it exposes internals of the widget that should
not be public. And it is just not very interesting.
This commit is contained in:
Matthias Clasen 2020-07-09 01:48:33 -04:00
parent 911ae64931
commit e31bacf7be
7 changed files with 0 additions and 85 deletions

View File

@ -81,30 +81,6 @@ gtk_file_chooser_default_init (GtkFileChooserInterface *iface)
{
GType iface_type = G_TYPE_FROM_INTERFACE (iface);
/**
* GtkFileChooser::current-folder-changed:
* @chooser: the object which received the signal.
*
* This signal is emitted when the current folder in a #GtkFileChooser
* changes. This can happen due to the user performing some action that
* changes folders, such as selecting a bookmark or visiting a folder on the
* file list. It can also happen as a result of calling a function to
* explicitly change the current folder in a file chooser.
*
* Normally you do not need to connect to this signal, unless you need to keep
* track of which folder a file chooser is showing.
*
* See also: gtk_file_chooser_set_current_folder(),
* gtk_file_chooser_get_current_folder(),
*/
g_signal_new (I_("current-folder-changed"),
iface_type,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkFileChooserIface, current_folder_changed),
NULL, NULL,
NULL,
G_TYPE_NONE, 0);
/**
* GtkFileChooser::selection-changed:
* @chooser: the object which received the signal.

View File

@ -645,8 +645,6 @@ gtk_file_chooser_button_set_current_folder (GtkFileChooser *chooser,
update_combo_box (button);
g_signal_emit_by_name (button, "current-folder-changed");
if (button->active)
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button->chooser), file, NULL);
@ -2519,7 +2517,6 @@ common_response_cb (GtkFileChooserButton *button,
{
save_inactive_state (button);
g_signal_emit_by_name (button, "current-folder-changed");
g_signal_emit_by_name (button, "selection-changed");
}
else

View File

@ -160,7 +160,6 @@
*
* There is no support for the signals that are emitted when the user
* navigates in the dialog, including:
* * #GtkFileChooser::current-folder-changed
* * #GtkFileChooser::selection-changed
*
* If you need any of the above you will have to use #GtkFileChooserDialog directly.

View File

@ -56,8 +56,6 @@ static GListModel * delegate_get_shortcut_folders (GtkFileChooser *choose
static void delegate_notify (GObject *object,
GParamSpec *pspec,
gpointer data);
static void delegate_current_folder_changed (GtkFileChooser *chooser,
gpointer data);
static void delegate_selection_changed (GtkFileChooser *chooser,
gpointer data);
@ -166,8 +164,6 @@ _gtk_file_chooser_set_delegate (GtkFileChooser *receiver,
g_object_set_data (G_OBJECT (receiver), I_("gtk-file-chooser-delegate"), delegate);
g_signal_connect (delegate, "notify",
G_CALLBACK (delegate_notify), receiver);
g_signal_connect (delegate, "current-folder-changed",
G_CALLBACK (delegate_current_folder_changed), receiver);
g_signal_connect (delegate, "selection-changed",
G_CALLBACK (delegate_selection_changed), receiver);
}
@ -318,13 +314,6 @@ delegate_selection_changed (GtkFileChooser *chooser,
g_signal_emit_by_name (data, "selection-changed");
}
static void
delegate_current_folder_changed (GtkFileChooser *chooser,
gpointer data)
{
g_signal_emit_by_name (data, "current-folder-changed");
}
GSettings *
_gtk_file_chooser_get_settings_for_widget (GtkWidget *widget)
{

View File

@ -5084,8 +5084,6 @@ update_current_folder_get_info_cb (GCancellable *cancellable,
g_object_notify (G_OBJECT (impl), "subtitle");
g_signal_emit_by_name (impl, "current-folder-changed", 0);
g_signal_emit_by_name (impl, "selection-changed", 0);
out:

View File

@ -41,25 +41,6 @@ static GtkWidget *preview_image;
#endif
static GtkFileChooserAction action;
static void
print_current_folder (GtkFileChooser *chooser)
{
GFile *cwd;
cwd = gtk_file_chooser_get_current_folder (chooser);
if (cwd != NULL)
{
char *uri = g_file_get_uri (cwd);
g_print ("Current folder changed :\n %s\n", uri ? uri : "(null)");
g_free (uri);
g_object_unref (cwd);
}
else
{
g_print ("Current folder changed :\n none\n");
}
}
static void
print_selected (GtkFileChooser *chooser)
{
@ -345,8 +326,6 @@ main (int argc, char **argv)
g_signal_connect (dialog, "selection-changed",
G_CALLBACK (print_selected), NULL);
g_signal_connect (dialog, "current-folder-changed",
G_CALLBACK (print_current_folder), NULL);
g_signal_connect (dialog, "response",
G_CALLBACK (response_cb), &done);

View File

@ -147,27 +147,6 @@ tests_button_clicked_cb (GtkButton *real_button,
gtk_window_present (GTK_WINDOW (tests));
}
static void
chooser_current_folder_changed_cb (GtkFileChooser *chooser,
gpointer user_data)
{
GFile *folder, *filename;
char *folder_uri, *filename_uri;
folder = gtk_file_chooser_get_current_folder (chooser);
filename = gtk_file_chooser_get_file (chooser);
folder_uri = g_file_get_uri (folder);
filename_uri = g_file_get_uri (filename);
g_message ("%s::current-folder-changed\n\tFolder: `%s'\n\tFilename: `%s'\nDone.\n",
G_OBJECT_TYPE_NAME (chooser), folder_uri, filename_uri);
g_free (folder_uri);
g_free (filename_uri);
g_object_unref (folder);
g_object_unref (filename);
}
static void
chooser_selection_changed_cb (GtkFileChooser *chooser,
gpointer user_data)
@ -214,8 +193,6 @@ add_new_filechooser_button (const gchar *mnemonic,
g_object_unref (path);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), chooser);
g_signal_connect (chooser, "current-folder-changed",
G_CALLBACK (chooser_current_folder_changed_cb), NULL);
g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL);
gtk_box_append (GTK_BOX (hbox), chooser);