From: Vadim Zeitlin Date: Tue, 3 May 2011 10:40:28 +0000 (+0000) Subject: Correct wxDirExists() check in OS X wxFileSystemWatcher implementation. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d66ddd70c7976fe519c8997117f1d5e813133560 Correct wxDirExists() check in OS X wxFileSystemWatcher implementation. Pass the full path to wxDirExists, not the relative path from the watched directory as this won't work unless the watched directory is the same as the current one. Closes #13161. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/fswatcher_kqueue.cpp b/src/unix/fswatcher_kqueue.cpp index 41ecbdede7..5229e5139b 100644 --- a/src/unix/fswatcher_kqueue.cpp +++ b/src/unix/fswatcher_kqueue.cpp @@ -314,17 +314,12 @@ protected: wxArrayInt::iterator changeType = changedFlags.begin(); for ( ; it != changedFiles.end(); ++it, ++changeType ) { - wxFileName path; - if ( wxDirExists(*it) ) - { - path = wxFileName::DirName( - basepath + wxFileName::GetPathSeparator() + *it - ); - } - else - { - path.Assign(basepath, *it); - } + const wxString fullpath = w.GetPath() + + wxFileName::GetPathSeparator() + + *it; + const wxFileName path(wxDirExists(fullpath) + ? wxFileName::DirName(fullpath) + : wxFileName::FileName(fullpath)); wxFileSystemWatcherEvent event(*changeType, path, path); SendEvent(event);