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
}\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
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