File watcher: ignore missing files/folders to prevent 'deleted' events later.

This commit is contained in:
Matthias Koefferlein 2017-04-20 00:09:03 +02:00
parent 2dd03c0e37
commit 9c2c3301cf
1 changed files with 5 additions and 3 deletions

View File

@ -85,11 +85,13 @@ FileSystemWatcher::add_file (const std::string &path)
QDateTime time;
QFileInfo fi (tl::to_qstring (path));
if (fi.exists ()) {
size = size_t (fi.size ());
time = fi.lastModified ();
if (! fi.exists () || ! fi.isReadable ()) {
return;
}
size = size_t (fi.size ());
time = fi.lastModified ();
std::map<std::string, FileEntry>::iterator i = m_files.find (path);
if (i != m_files.end ()) {
i->second.refcount += 1;