diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-03-02 17:41:49 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-03-02 17:41:49 +0100 |
commit | 857081285a3c38160c84336e26f455741268cf32 (patch) | |
tree | 05fe5c4541a81af7f38dc911d90cdb03cfab68a7 | |
parent | 7c77dc53c76d364adea3bda82158fd620506bd01 (diff) | |
download | gtk+-857081285a3c38160c84336e26f455741268cf32.tar.gz |
gtkpathbar: don't use gtk_file_systemwip/csoriano/pathbar_rework
-rw-r--r-- | gtk/gtkpathbar.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index ff60f9b794..084d4edab0 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -1780,24 +1780,29 @@ gtk_path_bar_set_file_finish (struct SetFileInfo *info, } static void -gtk_path_bar_get_info_callback (GCancellable *cancellable, - GFileInfo *info, - const GError *error, - gpointer data) +gtk_path_bar_get_info_callback (GObject *source, + GAsyncResult *result, + gpointer data) { + GFile *file = G_FILE (source); + GFileInfo *info; + const GError *error; gboolean cancelled = g_cancellable_is_cancelled (cancellable); struct SetFileInfo *file_info = data; ButtonData *button_data; const gchar *display_name; gboolean is_hidden; + info = g_file_query_info_finish (file, result, error); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + gtk_path_bar_set_file_finish (file_info, FALSE); return; if (cancellable != file_info->path_bar->priv->get_info_cancellable) { gtk_path_bar_set_file_finish (file_info, FALSE); - g_object_unref (cancellable); + g_object_unref (file_info->path_bar->priv->get_info_cancellable); return; } @@ -1840,12 +1845,13 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable, file_info->parent_file = g_file_get_parent (file_info->file); /* Recurse asynchronously */ - file_info->path_bar->priv->get_info_cancellable = - _gtk_file_system_get_info (file_info->path_bar->priv->file_system, - file_info->file, - "standard::display-name,standard::is-hidden,standard::is-backup", - gtk_path_bar_get_info_callback, - file_info); + g_file_query_info_async (file_info->file, + "standard::display-name,standard::is-hidden,standard::is-backup", + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT, + path_bar->priv->get_info_cancellable, + gtk_path_bar_get_info_callback, + file_info); } void @@ -1873,13 +1879,13 @@ gtk_path_bar_set_file (GtkPathBar *path_bar, if (path_bar->priv->get_info_cancellable) g_cancellable_cancel (path_bar->priv->get_info_cancellable); - path_bar->priv->get_info_cancellable = - _gtk_file_system_get_info (path_bar->priv->file_system, - info->file, - "standard::display-name,standard::is-hidden,standard::is-backup", - gtk_path_bar_get_info_callback, - info); - + g_file_query_info_async (file, + "standard::display-name,standard::is-hidden,standard::is-backup", + G_FILE_QUERY_INFO_NONE, + G_PRIORITY_DEFAULT, + path_bar->priv->get_info_cancellable, + gtk_path_bar_get_info_callback, + sidebar); } /* FIXME: This should be a construct-only property */ |