From ce402f298b2f9733b614fbf1bde99a052d0ab5c0 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 21 Mar 2013 16:14:54 +0100 Subject: Final inotify! A huge commit, I know, but it was definitely worth it! It makes the homebrew FilesystemModel work! It's divided up into two threads: 1. The Watcher: it reacts on inotify events and dispatches them to: 2. The Collector: this thread gathers the data and emits the SIGNALS to the the view. Now we can actually refresh the View, not possible with QFileSystemModel, and the data reloads in almost real time without blocking the GUI. Unfortunately this uncovered some bugs I had to fix: 1. Helper::md5sum: Don't crash if read fails with -1 2. SmTreeModel::addRow is broken. Even after 5h I couldn't figure out how or why, so I brute forced it. Reset the moded when a file is added. 3. Get rid of a lot of unneeded #include's I guess that's about it... --- filesystemwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'filesystemwidget.cpp') diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp index b842541..5f462e8 100644 --- a/filesystemwidget.cpp +++ b/filesystemwidget.cpp @@ -65,7 +65,7 @@ FilesystemWidget::FilesystemWidget(QWidget *parent) : QWidget(parent), mClipboar mFileProxy = new FilesystemFileProxy; mFileProxy->setSourceModel(mFileModel); - mFileView->setModel(mFileProxy); + mFileView->setModel(mFileProxy); mFileView->setSortingEnabled(true); mFileView->sortByColumn(0, Qt::AscendingOrder); mFileView->setItemsExpandable(false); -- cgit v1.2.3-70-g09d2