v0.3.0
[case] / src / filelist.cpp
index a4927b8..3cbe475 100644 (file)
 #include <QProcess>
 #include <QUrl>
 #include <QEvent>
+#include <QScrollBar>
 
 #include <hildon-mime.h>
 #include <dbus/dbus.h>
 
-#include "fileoperator.h"
+#include "utils.h"
 
 
 FileList::FileList(QWidget *parent) :
@@ -62,11 +63,13 @@ const QString FileList::path() const {
 
 
 bool FileList::changePath(QString path) {
-    path = FileOperator::unwindPath(path);
+    path = unwindPath(path);
     QDir dir(fileSystemModel->rootPath());
     if (dir.cd(path)) {
+        scrollBarPosition[fileSystemModel->rootPath()] = verticalScrollBar()->value();
         setRootIndex(fileSystemModel->setRootPath(dir.absolutePath()));
         clearSelection();
+        verticalScrollBar()->setValue(scrollBarPosition[dir.absolutePath()]);
         emit pathChanged(fileSystemModel->rootPath());
         return true;
     }