Comment 9 for bug 1214103

Revision history for this message
netmask (netmask) wrote :

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'
--- gui/main.py 2012-11-04 14:45:22 +0000
+++ gui/main.py 2013-08-23 21:06:13 +0000
@@ -94,7 +94,7 @@
         self.splitter.setSizes([600, 1000])

         #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()))