UI/BrowserModel.py

changeset 2613
0799eea6feba
parent 2409
df3820f08247
child 2677
3d4277929fb3
child 2769
8cbebde7a984
--- a/UI/BrowserModel.py	Mon Apr 22 20:26:20 2013 +0200
+++ b/UI/BrowserModel.py	Tue Apr 23 19:13:45 2013 +0200
@@ -33,23 +33,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().__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