[gedit] Fix pygi API bugs for query_info in quickopen



commit 5cf9ac442a025d42443cea9cf1451c0e6154dea1
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Tue Mar 22 16:42:15 2011 +0100

    Fix pygi API bugs for query_info in quickopen

 plugins/quickopen/quickopen/__init__.py    |    7 +++++--
 plugins/quickopen/quickopen/popup.py       |    4 +++-
 plugins/quickopen/quickopen/virtualdirs.py |   10 +++++++---
 3 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py
index 1ade33b..782cafc 100644
--- a/plugins/quickopen/quickopen/__init__.py
+++ b/plugins/quickopen/quickopen/__init__.py
@@ -142,8 +142,11 @@ class QuickOpenPlugin(GObject.Object, Gedit.WindowActivatable):
                         f = Gio.file_new_for_uri(uri)
 
                         if f.is_native():
-                                try:    
-                                        info = f.query_info("standard::type", 0, None)
+                                try:
+                                        info = f.query_info(Gio.FILE_ATTRIBUTE_STANDARD_TYPE,
+                                                                                Gio.FileQueryInfoFlags.NONE,
+                                                                                None)
+
                                         if info and info.get_file_type() == Gio.FileType.DIRECTORY:
                                                 paths.append(f)
                                 except:
diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py
index 3897979..09e29b2 100644
--- a/plugins/quickopen/quickopen/popup.py
+++ b/plugins/quickopen/quickopen/popup.py
@@ -244,7 +244,9 @@ class Popup(Gtk.Dialog):
                 return os.sep.join(out)
 
         def _get_icon(self, f):
-                query = f.query_info(Gio.FILE_ATTRIBUTE_STANDARD_ICON)
+                query = f.query_info(Gio.FILE_ATTRIBUTE_STANDARD_ICON,
+                                                         Gio.FileQueryInfoFlags.NONE,
+                                                         None)
 
                 if not query:
                         return None
diff --git a/plugins/quickopen/quickopen/virtualdirs.py b/plugins/quickopen/quickopen/virtualdirs.py
index 9a6dce3..1ee5a1d 100644
--- a/plugins/quickopen/quickopen/virtualdirs.py
+++ b/plugins/quickopen/quickopen/virtualdirs.py
@@ -38,15 +38,19 @@ class VirtualDirectory(object):
                         return
 
                 try:
-                        info = child.query_info("standard::*")
+                        info = child.query_info("standard::*",
+                                                                        Gio.FileQueryInfoFlags.NONE,
+                                                                        None)
+
                         if info:
                                 self._children.append((child, info))
-                except:
-                        pass
+                except StandardError as e:
+                        print e
 
 class RecentDocumentsDirectory(VirtualDirectory):
         def __init__(self, maxitems=10):
                 VirtualDirectory.__init__(self, 'recent')
+
                 self._maxitems = maxitems
                 self.fill()
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]