[gtk+/wip/csoriano/pathbar_rework: 3/3] gtkpathbar: don't use gtk_file_system
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/csoriano/pathbar_rework: 3/3] gtkpathbar: don't use gtk_file_system
- Date: Mon, 2 Mar 2015 16:43:39 +0000 (UTC)
commit 857081285a3c38160c84336e26f455741268cf32
Author: Carlos Soriano <csoriano gnome org>
Date: Mon Mar 2 17:41:49 2015 +0100
gtkpathbar: don't use gtk_file_system
gtk/gtkpathbar.c | 42 ++++++++++++++++++++++++------------------
1 files changed, 24 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index ff60f9b..084d4ed 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]