[gtk+/bgo687196-filesystemmodel-crash: 2/2] Remove argument to _gtk_file_system_model_update_file() that should not be part of the internal API
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/bgo687196-filesystemmodel-crash: 2/2] Remove argument to _gtk_file_system_model_update_file() that should not be part of the internal API
- Date: Thu, 1 Nov 2012 02:59:32 +0000 (UTC)
commit f39f5749148e240ea9b72f4806c1b01e85e504d7
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Oct 31 20:54:02 2012 -0600
Remove argument to _gtk_file_system_model_update_file() that should not be part of the internal API
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkfilechooserdefault.c | 2 +-
gtk/gtkfilesystemmodel.c | 18 +++++++++++-------
gtk/gtkfilesystemmodel.h | 3 +--
3 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index dab06c3..09d6303 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -6798,7 +6798,7 @@ file_system_model_got_thumbnail (GObject *object, GAsyncResult *res, gpointer da
copy_attribute (info, queried, G_FILE_ATTRIBUTE_THUMBNAILING_FAILED);
copy_attribute (info, queried, G_FILE_ATTRIBUTE_STANDARD_ICON);
- _gtk_file_system_model_update_file (model, file, info, FALSE);
+ _gtk_file_system_model_update_file (model, file, info);
g_object_unref (info);
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 9f738b9..90a4db2 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -184,6 +184,9 @@ struct _GtkFileSystemModelClass
void (*finished_loading) (GtkFileSystemModel *model, GError *error);
};
+static guint node_get_for_file (GtkFileSystemModel *model,
+ GFile *file);
+
static void add_file (GtkFileSystemModel *model,
GFile *file,
GFileInfo *info);
@@ -1189,13 +1192,19 @@ gtk_file_system_model_query_done (GObject * object,
GtkFileSystemModel *model = data; /* only a valid pointer if not cancelled */
GFile *file = G_FILE (object);
GFileInfo *info;
+ guint id;
info = g_file_query_info_finish (file, res, NULL);
if (info == NULL)
return;
gdk_threads_enter ();
- _gtk_file_system_model_update_file (model, file, info, TRUE);
+
+ _gtk_file_system_model_update_file (model, file, info);
+
+ id = node_get_for_file (model, file);
+ gtk_file_system_model_sort_node (model, id);
+
gdk_threads_leave ();
}
@@ -1852,7 +1861,6 @@ remove_file (GtkFileSystemModel *model,
* @model: the model
* @file: the file
* @info: the new file info
- * @requires_resort: FIXME: get rid of this argument
*
* Tells the file system model that the file changed and that the
* new @info should be used for it now. If the file is not part of
@@ -1861,8 +1869,7 @@ remove_file (GtkFileSystemModel *model,
void
_gtk_file_system_model_update_file (GtkFileSystemModel *model,
GFile *file,
- GFileInfo *info,
- gboolean requires_resort)
+ GFileInfo *info)
{
FileModelNode *node;
guint i, id;
@@ -1894,9 +1901,6 @@ _gtk_file_system_model_update_file (GtkFileSystemModel *model,
if (node->visible)
emit_row_changed_for_node (model, id);
-
- if (requires_resort)
- gtk_file_system_model_sort_node (model, id);
}
/**
diff --git a/gtk/gtkfilesystemmodel.h b/gtk/gtkfilesystemmodel.h
index 2264fcf..8ccfa1b 100644
--- a/gtk/gtkfilesystemmodel.h
+++ b/gtk/gtkfilesystemmodel.h
@@ -71,8 +71,7 @@ void _gtk_file_system_model_add_and_query_file (GtkFileSystemMode
const char *attributes);
void _gtk_file_system_model_update_file (GtkFileSystemModel *model,
GFile *file,
- GFileInfo *info,
- gboolean requires_resort);
+ GFileInfo *info);
void _gtk_file_system_model_set_show_hidden (GtkFileSystemModel *model,
gboolean show_hidden);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]