Don't give error message for non-existent paths in wxFileSystemWatcher.

The file we're trying to watch might have been just deleted, this is an
unavoidable (and not only in theory but also in practice when watching busy
directories) race condition so don't give an error message if this does happen
but simply return false from Add().

Closes #15051.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-03-02 12:11:40 +00:00
parent 4efbeff4a5
commit c35c7df103

View File

@@ -100,7 +100,10 @@ bool wxFileSystemWatcherBase::Add(const wxFileName& path, int events)
}
else
{
wxLogError(_("Can't monitor non-existent path \"%s\" for changes."),
// Don't overreact to being passed a non-existent item. It may have
// only just been deleted, in which case doing nothing is correct
wxLogTrace(wxTRACE_FSWATCHER,
"Can't monitor non-existent path \"%s\" for changes.",
path.GetFullPath());
return false;
}