[kupfer] plugin.documents: Use gio to avoid encoding problems in recent files
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] plugin.documents: Use gio to avoid encoding problems in recent files
- Date: Tue, 27 Oct 2009 15:40:18 +0000 (UTC)
commit 0473adc8f2f4154e762675bc835e8f1c9e3a158b
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Oct 27 16:30:26 2009 +0100
plugin.documents: Use gio to avoid encoding problems in recent files
In some cases, the gtk API does not manage to return a local path,
which gio can always do it given an URL.
kupfer/plugin/documents.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/kupfer/plugin/documents.py b/kupfer/plugin/documents.py
index acd733f..910ebd6 100644
--- a/kupfer/plugin/documents.py
+++ b/kupfer/plugin/documents.py
@@ -67,12 +67,12 @@ class RecentsSource (Source, PicklingHelperMixin):
uri = item.get_uri()
name = item.get_short_name()
if item.is_local():
- fileloc = item.get_uri_display()
- leaf = FileLeaf(fileloc, name)
+ leaf = FileLeaf(gio.File(uri).get_path())
else:
leaf = UrlLeaf(uri, name)
item_leaves.append((leaf, item.get_modified()))
- return (t[0] for t in sorted(item_leaves, key=lambda t: t[1], reverse=True))
+ for lf, date in sorted(item_leaves, key=lambda t: t[1], reverse=True):
+ yield lf
def get_description(self):
return _("Recently used documents")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]