[kupfer] browser: Add hints to qpfer URL lookups for selection



commit 3476c9eaae6eef08d89ce4fe74e41322a781aebf
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Fri Dec 11 01:47:03 2009 +0100

    browser: Add hints to qpfer URL lookups for selection
    
    Add type hints to the URL lookups for selected file etc. This
    dramatically narrows the number of sources we need to search for the
    items.
    
    The issue is mostly not lookup speed (which is quick), but that we
    might hit a source that must be rescanned to be searched; and that may
    slow the lookup by a comparatively big factor.

 kupfer/browser.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index 34dd8ad..173ca20 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -1128,11 +1128,12 @@ class Interface (gobject.GObject):
 		self._reset_to_toplevel = True
 
 	def select_selected_file(self):
-		self.data_controller.find_object("qpfer:selectedtext")
-		self.data_controller.find_object("qpfer:selectedfile")
+		# Add optional lookup data to narrow the search
+		self.data_controller.find_object("qpfer:selectedtext#any.TextLeaf")
+		self.data_controller.find_object("qpfer:selectedfile#any.FileLeaf")
 
 	def select_selected_text(self):
-		self.data_controller.find_object("qpfer:selectedtext")
+		self.data_controller.find_object("qpfer:selectedtext#any.TextLeaf")
 
 	def select_quit(self):
 		self.data_controller.find_object("qpfer:quit")



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