summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Hruby <michal.mhr@gmail.com>2012-02-13 09:55:35 +0100
committerMichal Hruby <michal.mhr@gmail.com>2012-02-13 09:55:35 +0100
commit2800e7b68a4997a1d80416a91be22bc92123fb70 (patch)
tree8a6cb55cc417469ea9d1929f05ab57c6441ed77f
parentf999b323278502bb99267fb35792f79f5aeb931b (diff)
Fix encoding issues from GtkRecent
-rw-r--r--src/recent-manager-provider.vala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/recent-manager-provider.vala b/src/recent-manager-provider.vala
index dc246ca..466a71c 100644
--- a/src/recent-manager-provider.vala
+++ b/src/recent-manager-provider.vala
@@ -87,7 +87,10 @@ public class RecentManagerGtk : DataProvider
foreach (Gtk.RecentInfo ri in recent_manager.get_items ())
{
- unowned string uri = ri.get_uri ();
+ // GFile and GtkRecentInfo use different encoding of the uris, so we'll
+ // do this
+ File file_obj = File.new_for_uri (ri.get_uri ());
+ string uri = file_obj.get_uri ();
if (ri.get_private_hint () || uri.has_prefix ("file:///tmp/"))
continue;
if (ri.is_local () && !ri.exists ())
@@ -138,11 +141,13 @@ public class RecentManagerGtk : DataProvider
continue;
}
- string origin = Path.get_dirname (ri.get_uri ());
+ var parent_file = file_obj.get_parent ();
+ string origin = parent_file != null ?
+ parent_file.get_uri () : Path.get_dirname (uri);
var subject =
- new Subject.full (ri.get_uri (),
+ new Subject.full (uri,
interpretation_for_mimetype (ri.get_mime_type ()),
- manifestation_for_uri (ri.get_uri ()),
+ manifestation_for_uri (uri),
ri.get_mime_type (),
origin,
ri.get_display_name (),