OSDN Git Service

Ver0.04a
authorMasayuki Satoh <miyabi.satoh@gmail.com>
Thu, 21 Aug 2014 14:42:20 +0000 (23:42 +0900)
committerMasayuki Satoh <miyabi.satoh@gmail.com>
Thu, 21 Aug 2014 14:42:20 +0000 (23:42 +0900)
filetableview.cpp

index d8ac8de..10ac2be 100644 (file)
@@ -110,15 +110,11 @@ void FileTableView::setSide(const QString &side)
 void FileTableView::setRootPath(const QString &path, bool addHistory)\r
 {\r
     FileTableModel *m = static_cast<FileTableModel*>(model());\r
-    int curRow = currentIndex().row();\r
     QFileInfo info(path);\r
-    bool isReload = false;\r
 \r
     if (info.isDir()) {\r
         getMainWnd()->statusBar()->showMessage(tr("ファイルリストの取得中..."));\r
-        if (info.absoluteFilePath() == m->absolutePath()) {\r
-            isReload = true;\r
-        }\r
+\r
         setUpdatesEnabled(false);\r
         m->setPath(info.absoluteFilePath());\r
         setUpdatesEnabled(true);\r
@@ -128,20 +124,6 @@ void FileTableView::setRootPath(const QString &path, bool addHistory)
         }\r
         updateMenu();\r
 \r
-        if (isReload) {\r
-            if (curRow < 0) {\r
-                curRow = 0;\r
-            }\r
-            else if (curRow >= m->rowCount()) {\r
-                curRow = m->rowCount() - 1;\r
-            }\r
-        }\r
-        else {\r
-            curRow = 0;\r
-        }\r
-        qDebug() << curRow;\r
-        setCurrentIndex(m->index(curRow, 0));\r
-        selectRow(curRow);\r
         getMainWnd()->statusBar()->showMessage(tr("レディ"), 5000);\r
     }\r
 }\r
@@ -451,7 +433,7 @@ void FileTableView::refresh()
     FileTableModel *m = static_cast<FileTableModel*>(model());\r
     int row = currentIndex().row();\r
     setRootPath(m->absolutePath(), false);\r
-    if (row >= m->rowCount()) {\r
+    if (m->rowCount() <= row) {\r
         row = m->rowCount() - 1;\r
     }\r
     setCurrentIndex(m->index(row, 0));\r