Project/ProjectBaseBrowser.py

changeset 5011
4085e2348621
parent 4631
5c1a96925da4
child 5389
9b1c800daff3
--- a/Project/ProjectBaseBrowser.py	Sat Jul 02 14:54:14 2016 +0200
+++ b/Project/ProjectBaseBrowser.py	Sat Jul 02 19:14:09 2016 +0200
@@ -12,7 +12,7 @@
 import os
 
 from PyQt5.QtCore import QModelIndex, pyqtSignal, Qt, QCoreApplication, \
-    QItemSelectionModel, QItemSelection
+    QItemSelectionModel, QItemSelection, QElapsedTimer
 from PyQt5.QtGui import QCursor
 from PyQt5.QtWidgets import QTreeView, QApplication, QMenu, QDialog, \
     QAbstractItemView
@@ -21,6 +21,7 @@
 from E5Gui import E5MessageBox
 
 from UI.Browser import Browser
+from UI.BrowserModel import BrowserDirectoryItem, BrowserFileItem
 
 from .ProjectBrowserModel import ProjectBrowserSimpleDirectoryItem, \
     ProjectBrowserDirectoryItem, ProjectBrowserFileItem
@@ -81,6 +82,10 @@
         
         self._init()    # perform common initialization tasks
         
+        self._keyboardSearchString = ""
+        self._keyboardSearchTimer = QElapsedTimer()
+        self._keyboardSearchTimer.invalidate()
+        
         self._initHookMethods()     # perform initialization of the hooks
         self.hooksMenuEntries = {}
         
@@ -680,6 +685,20 @@
         itm = self.model().item(self.currentIndex())
         return itm
     
+    def _keyboardSearchType(self, item):
+        """
+        Protected method to check, if the item is of the correct type.
+        
+        @param item reference to the item
+        @type BrowserItem
+        @return flag indicating a correct type
+        @rtype bool
+        """
+        return isinstance(
+            item, (BrowserDirectoryItem, BrowserFileItem,
+                   ProjectBrowserSimpleDirectoryItem,
+                   ProjectBrowserDirectoryItem, ProjectBrowserFileItem))
+    
     ###########################################################################
     ## Support for hooks below
     ###########################################################################

eric ide

mercurial