[gedit] Fix quickopen pygi file enumeration
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Fix quickopen pygi file enumeration
- Date: Tue, 22 Mar 2011 16:01:00 +0000 (UTC)
commit 4ee4fb903dfd485b5b80ce3ddb1e1f4a04cb1b99
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Tue Mar 22 17:00:52 2011 +0100
Fix quickopen pygi file enumeration
plugins/quickopen/quickopen/popup.py | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py
index f0adf86..169dda7 100644
--- a/plugins/quickopen/quickopen/popup.py
+++ b/plugins/quickopen/quickopen/popup.py
@@ -139,19 +139,28 @@ class Popup(Gtk.Dialog):
entries = []
try:
- entries = gfile.enumerate_children("standard::*", Gio.FileQueryInfoFlags.NONE, None)
- except GObject.Error:
+ ret = gfile.enumerate_children("standard::*", Gio.FileQueryInfoFlags.NONE, None)
+ except GObject.Error as e:
pass
+ if isinstance(ret, Gio.FileEnumerator):
+ while True:
+ entry = ret.next_file(None)
+
+ if not entry:
+ break
+
+ entries.append((gfile.get_child(entry.get_name()), entry))
+ else:
+ entries = ret
+
children = []
for entry in entries:
- if isinstance(gfile, VirtualDirectory):
- child = entry
- else:
- child = gfile.get_child(entry.get_name())
-
- children.append((child, entry.get_name(), entry.get_file_type(), entry.get_icon()))
+ children.append((entry[0],
+ entry[1].get_name(),
+ entry[1].get_file_type(),
+ entry[1].get_icon()))
return children
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]