#SETTING UP FOLDERVIEW
- model = QDirModel(window)
+ model = QFileSystemModel(window) model.setFilter(QDir.AllDirs|QDir.NoDotAndDotDot) self.folderView.setModel(model)
@@ -127,6 +127,7 @@
#Loop to expand the current directory in the folderview.
lastDir = settings.value("mainwindow/workingDirectory", QVariant(QDir.homePath())) log.debug('Current directory: %s' % lastDir.toString())
+ model.setRootPath(lastDir.toString())
path = QDir(lastDir.toString())
while True: self.folderView.expand(model.index(path.absolutePath()))
Actually the fix was waaaaay easier than I expected...
According to Qt docs, QDirModel is deprecated and you should use QFileSystemModel instead.
The patch below fixes the issue:
=== modified file 'gui/main.py'
self. splitter. setSizes( [600, 1000])
--- gui/main.py 2012-11-04 14:45:22 +0000
+++ gui/main.py 2013-08-23 21:06:13 +0000
@@ -94,7 +94,7 @@
#SETTING UP FOLDERVIEW l(window)
model. setFilter( QDir.AllDirs| QDir.NoDotAndDo tDot)
self. folderView. setModel( model)
- model = QDirModel(window)
+ model = QFileSystemMode
@@ -127,6 +127,7 @@ value(" mainwindow/ workingDirector y", QVariant( QDir.homePath( )))
log.debug( 'Current directory: %s' % lastDir.toString()) th(lastDir. toString( )) toString( ))
self. folderView. expand( model.index( path.absolutePa th()))
#Loop to expand the current directory in the folderview.
lastDir = settings.
+ model.setRootPa
path = QDir(lastDir.
while True: