From e223bc238ea3e2dbeaabcc4c9218558d26273de5 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 13 Aug 2015 13:51:13 +0200 Subject: Fix crash in deleteFiles This was a hard one. SmDirWatcher raced against the model. Stop and quit the watcher before actually deleting files. That can take a while if file operations are in progress, so show the busy cursor. --- smdirmodel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'smdirmodel.cpp') diff --git a/smdirmodel.cpp b/smdirmodel.cpp index 32bc241..b9394d8 100644 --- a/smdirmodel.cpp +++ b/smdirmodel.cpp @@ -215,3 +215,14 @@ TimerHandler::~TimerHandler(){ mTimer->start(); } } + +WatcherHandler::WatcherHandler(SmDirWatcher *watcher) : mWatcher(watcher){ + mWatcher->quit(); + mWatcher->wait(); + mWatcher->blockSignals(true); +} + +WatcherHandler::~WatcherHandler(){ + mWatcher->blockSignals(false); + mWatcher->start(); +} -- cgit v1.2.3-70-g09d2