UI/BrowserModel.py

branch
Py2 comp.
changeset 2677
3d4277929fb3
parent 2525
8b507a9a2d40
parent 2613
0799eea6feba
child 2791
a9577f248f04
--- a/UI/BrowserModel.py	Fri May 24 18:39:58 2013 +0200
+++ b/UI/BrowserModel.py	Tue May 28 20:52:12 2013 +0200
@@ -35,23 +35,25 @@
     """
     Class implementing the browser model.
     """
-    def __init__(self, parent=None):
+    def __init__(self, parent=None, nopopulate=False):
         """
         Constructor
         
         @param parent reference to parent object (QObject)
+        @keyparam nopopulate flag indicating to not populate the model (boolean)
         """
         super(BrowserModel, self).__init__(parent)
         
-        rootData = QApplication.translate("BrowserModel", "Name")
-        self.rootItem = BrowserItem(None, rootData)
-        
         self.progDir = None
         self.watchedItems = {}
         self.watcher = QFileSystemWatcher(self)
         self.watcher.directoryChanged.connect(self.directoryChanged)
         
-        self.__populateModel()
+        if not nopopulate:
+            rootData = QApplication.translate("BrowserModel", "Name")
+            self.rootItem = BrowserItem(None, rootData)
+            
+            self.__populateModel()
     
     def columnCount(self, parent=QModelIndex()):
         """

eric ide

mercurial