added a test that watches test/testfile which can be given the browser as bookmark file - it work's; refs https://dev.swisssign.com/projects/swissstick/ticket/980; refs #150

This commit is contained in:
Marc Wäckerlin
2012-05-07 12:52:03 +00:00
parent 5df301d37e
commit 09911ffa99
6 changed files with 91 additions and 3 deletions

View File

@@ -81,8 +81,14 @@ class FileStorage: public Storage {
}
private Q_SLOTS:
void setupWatcher() {
_watcher.removePaths(_watcher.files());
if (readable()) _watcher.addPath(_file.fileName());
bool watching(_watcher.files().size());
if (watching) // remove watchlist if already existent
_watcher.removePaths(_watcher.files());
if (readable()) { // add file to watchlist
_watcher.addPath(_file.fileName());
if (!watching) // send change event if file is initially created
changed();
}
}
private:
QFile _file;