Ignore extra modify events after rename in wxFileSystemWatcher.
Document that such extra events may occur and generally improve the event types documentation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -348,6 +348,21 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(expected.GetPath(), e->GetPath());
|
||||
CPPUNIT_ASSERT_EQUAL(expected.GetNewPath(), e->GetNewPath());
|
||||
|
||||
// Under MSW extra modification events are sometimes reported after a
|
||||
// rename and we just can't get rid of them, so ignore them in this
|
||||
// test if they do happen.
|
||||
if ( e->GetChangeType() == wxFSW_EVENT_RENAME &&
|
||||
m_events.size() == 2 )
|
||||
{
|
||||
const wxFileSystemWatcherEvent* const e2 = m_events.back();
|
||||
if ( e2->GetChangeType() == wxFSW_EVENT_MODIFY &&
|
||||
e2->GetPath() == e->GetNewPath() )
|
||||
{
|
||||
// This is a modify event for the new file, ignore it.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
WX_ASSERT_EQUAL_MESSAGE
|
||||
(
|
||||
(
|
||||
|
Reference in New Issue
Block a user