]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fswatcher_kqueue.cpp
Support using GetTextExtent() with empty string to get descent in wxOSX.
[wxWidgets.git] / src / unix / fswatcher_kqueue.cpp
index 41ecbdede7940f9d25653534e3027aa075455625..f2de067154de0bfad937a0fa217060f489b86b98 100644 (file)
@@ -149,8 +149,7 @@ public:
         // TODO more error conditions according to man
         // XXX closing file descriptor removes the watch. The logic resides in
         // the watch which is not nice, but effective and simple
-        bool ret = watch->Close();
-        if (ret == -1)
+        if ( !watch->Close() )
         {
             wxLogSysError(_("Unable to remove kqueue watch"));
             return false;
@@ -314,17 +313,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);