From 7bda040f35c6be15dbf1ba007de28849a0803cae Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 16 Mar 2013 16:13:05 +0100 Subject: First shot at SmDirModel Gotta take a break here. Hopefully this will end up in a custom QFilesystemModel, but I'm hitting so many bugs on the way. Some things haven't worked for ages, I guess. Anyway, the watcher doesn't do anythying right now, still fixing bugs... --- fileview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fileview.cpp') diff --git a/fileview.cpp b/fileview.cpp index dba2948..07e64be 100644 --- a/fileview.cpp +++ b/fileview.cpp @@ -28,6 +28,7 @@ #include "fileview.h" #include "hoverwindow.h" #include "smglobals.h" +#include "smdirmodel.h" #include "helper.h" FileView::FileView(QWidget *parent) : QTreeView(parent), mDeleteA(0) { @@ -53,10 +54,10 @@ void FileView::markFiles(){ QRegExp re(glob); for(int i = 0; i < rowCount; ++i){ QModelIndex cur = rootIndex().child(i, 0); - if(cur.data(QFileSystemModel::FileNameRole).toString() == ".."){ + if(cur.data(SmDirModel::NameRole).toString() == ".."){ continue; } - if(re.indexIn(cur.data(QFileSystemModel::FileNameRole).toString()) != -1){ + if(re.indexIn(cur.data(SmDirModel::NameRole).toString()) != -1){ selectionModel()->select(cur, QItemSelectionModel::Select | QItemSelectionModel::Rows); } } -- cgit v1.2.3-70-g09d2