diff options
author | Arno <am@disconnect.de> | 2010-05-12 19:58:20 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-05-12 19:58:20 +0200 |
commit | e0fcfd2bc9bee8fd5b27157acab4be8497117844 (patch) | |
tree | e38ad067636094321b99b9ce6f0647dcc0ccee3f /fileview.cpp | |
parent | 962fbe7377d47bf50cc580fcac21a98cd8a0fd85 (diff) | |
download | SheMov-e0fcfd2bc9bee8fd5b27157acab4be8497117844.tar.gz SheMov-e0fcfd2bc9bee8fd5b27157acab4be8497117844.tar.bz2 SheMov-e0fcfd2bc9bee8fd5b27157acab4be8497117844.zip |
Discard QDirModel
QDirModel is deprecated by the Nokia guys. Use QFileSystemModel instead.
Diffstat (limited to 'fileview.cpp')
-rw-r--r-- | fileview.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fileview.cpp b/fileview.cpp index 649ef3c..7853504 100644 --- a/fileview.cpp +++ b/fileview.cpp @@ -11,7 +11,7 @@ #include <QKeyEvent> #include <QModelIndex> #include <QRegExp> -#include <QDirModel> +#include <QFileSystemModel> #include <QSortFilterProxyModel> #include <QAction> #include <QApplication> @@ -42,13 +42,13 @@ void FileView::createFolder(){ mCreateFolderDialog->show(); } -void FileView::refresh(){ +/*void FileView::refresh(){ QSortFilterProxyModel *proxy = static_cast<QSortFilterProxyModel*>(model()); - QDirModel *model = static_cast<QDirModel*>(proxy->sourceModel()); + QFileSystemModel *model = static_cast<QFileSystemModel*>(proxy->sourceModel()); QModelIndex root = rootIndex(); QModelIndex real = proxy->mapToSource(root); model->refresh(root); -} +}*/ void FileView::doMark(){ int rowCount = model()->rowCount(rootIndex()); @@ -56,7 +56,7 @@ void FileView::doMark(){ if(rowCount && !sRegex.isEmpty()){ QRegExp re(sRegex); QSortFilterProxyModel *proxy = static_cast<QSortFilterProxyModel*>(model()); - QDirModel *model = static_cast<QDirModel*>(proxy->sourceModel()); + QFileSystemModel *model = static_cast<QFileSystemModel*>(proxy->sourceModel()); bool match(false); for(int i = 0; i < rowCount; ++i){ QModelIndex cur = rootIndex().child(i, 0); @@ -86,7 +86,7 @@ void FileView::doCreateFolder(){ return; } QSortFilterProxyModel *proxy = static_cast<QSortFilterProxyModel*>(model()); - QDirModel *model = static_cast<QDirModel*>(proxy->sourceModel()); + QFileSystemModel *model = static_cast<QFileSystemModel*>(proxy->sourceModel()); QModelIndex sRoot = proxy->mapToSource(rootIndex()); QModelIndex newIdx = model->mkdir(sRoot, folderName); if(newIdx == QModelIndex()){ |