diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-07-24 00:40:59 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-07-27 08:07:39 -0400 |
commit | eee85d39e56205976ab8b215e1e3e92e9d8c4913 (patch) | |
tree | 5c831fe370048ebbf0cc53be5af0db522923c150 /gtk/gtksearchengine.c | |
parent | f7bba525fc7a02443907b5baf365ac09c2009775 (diff) | |
download | gtk+-eee85d39e56205976ab8b215e1e3e92e9d8c4913.tar.gz |
Avoid more GFile<>uri roundtrips
Make GtkSearchHit carry a GFile instead of an uri. Most of the
search engines already have the object around, and converting
to an uri and back is unnecessary extra work.
Diffstat (limited to 'gtk/gtksearchengine.c')
-rw-r--r-- | gtk/gtksearchengine.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtksearchengine.c b/gtk/gtksearchengine.c index eff96923aa..fbbb80b0d0 100644 --- a/gtk/gtksearchengine.c +++ b/gtk/gtksearchengine.c @@ -311,7 +311,7 @@ search_hit_equal (gconstpointer a, gconstpointer b) const GtkSearchHit *ha = (const GtkSearchHit *)a; const GtkSearchHit *hb = (const GtkSearchHit *)b; - return g_str_equal (ha->uri, hb->uri); + return g_file_equal (ha->file, hb->file); } @@ -320,7 +320,7 @@ search_hit_hash (gconstpointer a) { const GtkSearchHit *ha = (const GtkSearchHit *)a; - return g_str_hash (ha->uri); + return g_file_hash (ha->file); } GtkSearchHit * @@ -329,7 +329,7 @@ _gtk_search_hit_dup (GtkSearchHit *hit) GtkSearchHit *dup; dup = g_new (GtkSearchHit, 1); - dup->uri = g_strdup (hit->uri); + dup->file = g_object_ref (hit->file); if (hit->info) dup->info = g_object_ref (hit->info); else @@ -341,7 +341,7 @@ _gtk_search_hit_dup (GtkSearchHit *hit) void _gtk_search_hit_free (GtkSearchHit *hit) { - g_free (hit->uri); + g_clear_object (&hit->file); g_clear_object (&hit->info); g_free (hit); } |