[gtk+/filesystemmodel: 24/28] cleanup
- From: Benjamin Otte <otte src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+/filesystemmodel: 24/28] cleanup
- Date: Tue, 23 Jun 2009 16:18:52 -0400 (EDT)
commit d08887bf46856fe1ebf07116016ed0a92761bf19
Author: Benjamin Otte <otte gnome org>
Date: Mon Jun 22 21:51:31 2009 +0200
cleanup
make file argument be a GFile * instead of a GObject *
gtk/gtkfilechooserdefault.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index d700e66..e24b4bb 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -6717,20 +6717,21 @@ my_g_format_time_for_display (glong secs)
}G_STMT_END
static void
-file_system_model_got_thumbnail (GObject *file, GAsyncResult *res, gpointer data)
+file_system_model_got_thumbnail (GObject *object, GAsyncResult *res, gpointer data)
{
GtkFileSystemModel *model = data; /* might be unreffed if operation was cancelled */
+ GFile *file = G_FILE (object);
GFileInfo *queried, *info;
GtkTreeIter iter;
- queried = g_file_query_info_finish (G_FILE (file), res, NULL);
+ queried = g_file_query_info_finish (file, res, NULL);
if (queried == NULL)
return;
/* now we know model is valid */
/* file was deleted */
- if (!_gtk_file_system_model_get_iter_for_file (model, &iter, G_FILE (file)))
+ if (!_gtk_file_system_model_get_iter_for_file (model, &iter, file))
return;
info = g_file_info_dup (_gtk_file_system_model_get_info (model, &iter));
@@ -6739,7 +6740,7 @@ file_system_model_got_thumbnail (GObject *file, GAsyncResult *res, gpointer data
copy_attribute (info, queried, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
copy_attribute (info, queried, G_FILE_ATTRIBUTE_STANDARD_ICON);
- _gtk_file_system_update_file (model, G_FILE (file), info, FALSE);
+ _gtk_file_system_update_file (model, file, info, FALSE);
g_object_unref (info);
}
@@ -6777,15 +6778,15 @@ file_system_model_set (GtkFileSystemModel *model,
case MODEL_COL_PIXBUF:
if (info)
{
- if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH) ||
- g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED) ||
- g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_ICON))
+ if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_ICON) ||
+ g_file_info_has_attribute (info, "filechooser::queried"))
{
g_value_take_object (value, _gtk_file_info_render_icon (info, GTK_WIDGET (impl), impl->icon_size));
}
else
{
g_value_set_object (value, NULL);
+ g_file_info_set_attribute_boolean (info, "filechooser::queried", TRUE);
g_file_query_info_async (file,
G_FILE_ATTRIBUTE_THUMBNAIL_PATH ","
G_FILE_ATTRIBUTE_THUMBNAILING_FAILED ","
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]