Fix handling deletion of watched directory in MSW wxFileSystemWatcher.
Don't log an incomprehensible error when the watched directory itself is deleted, but generate wxFSW_EVENT_DELETE for it. This is consistent with the behaviour under Unix and generally more useful. Closes #13294. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -232,6 +232,21 @@ bool wxIOCPThread::ReadEvents()
|
||||
case wxIOCPService::Status_Error:
|
||||
return true; // error was logged already, we don't want to exit
|
||||
|
||||
case wxIOCPService::Status_Deleted:
|
||||
{
|
||||
wxFileSystemWatcherEvent
|
||||
removeEvent(wxFSW_EVENT_DELETE,
|
||||
watch->GetPath(),
|
||||
wxFileName());
|
||||
SendEvent(removeEvent);
|
||||
}
|
||||
|
||||
// It isn't useful to continue watching this directory as it
|
||||
// doesn't exist any more -- and even recreating a directory with
|
||||
// the same name still wouldn't resume generating events for the
|
||||
// existing wxIOCPService, so it's useless to continue.
|
||||
return false;
|
||||
|
||||
case wxIOCPService::Status_Exit:
|
||||
return false; // stop reading events
|
||||
}
|
||||
|
Reference in New Issue
Block a user