]> git.saurik.com Git - wxWidgets.git/commitdiff
Made wxGenericDirCtrl compile with Cygwin
authorJulian Smart <julian@anthemion.co.uk>
Tue, 17 Oct 2000 17:15:18 +0000 (17:15 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 17 Oct 2000 17:15:18 +0000 (17:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/dirctrlg.h
src/generic/dirctrlg.cpp
src/makeg95.env

index e383a0dc4c460766bf569adbf2b4a285e6781fce..0d391fea6ef6c0877f4d493bf5c2a29ea7419700 100644 (file)
@@ -49,7 +49,6 @@ class WXDLLEXPORT wxDirItemDataEx : public wxTreeItemData
 public:
   wxDirItemDataEx(const wxString& path, const wxString& name, bool isDir);
   ~wxDirItemDataEx();
-  bool HasSubDirs();
   void SetNewDirName( wxString path );
   wxString m_path, m_name;
   bool m_isHidden;
index d20e028b0def03ff79497133ae112609de6e24ec..5ea3910aee93b0dec8ccd7fd63486ee889307ac7 100644 (file)
 
 #ifdef __WXMSW__
 #include <windows.h>
+
+#ifndef __GNUWIN32__
 #include <direct.h>
 #include <stdlib.h>
 #include <ctype.h>
 #endif
 
+#endif
+
 #ifdef __BORLANDC__
 #include "dos.h"
 #endif
@@ -293,7 +297,7 @@ static const int ID_CANCEL = 1003;
 static const int ID_NEW = 1004;
 //static const int ID_CHECK = 1005;
 
-#ifdef __WXMSW__
+#if defined(__WXMSW__)
 static bool wxIsDriveAvailable(const wxString dirName)
 {
 #ifdef __WIN32__
@@ -306,6 +310,9 @@ static bool wxIsDriveAvailable(const wxString dirName)
     if (dirName.Len() == 3 && dirName[(size_t)1] == wxT(':'))
     {
         wxString dirNameLower(dirName.Lower());
+#if defined(__GNUWIN32__)
+        success = wxPathExists(dirNameLower);
+#else
         int currentDrive = _getdrive();
         int thisDrive = (int) (dirNameLower[(size_t)0] - 'a' + 1) ;
         int err = _chdrive( thisDrive ) ;
@@ -315,6 +322,7 @@ static bool wxIsDriveAvailable(const wxString dirName)
         {
             success = FALSE;
         }
+#endif
     }
 #ifdef __WIN32__
     (void) SetErrorMode(errorMode);
@@ -354,32 +362,6 @@ void wxDirItemDataEx::SetNewDirName( wxString path )
     m_name = wxFileNameFromPath( path );
 }
 
-// No longer used, and takes a very long time
-bool wxDirItemDataEx::HasSubDirs()
-{
-    if (m_path.IsEmpty())
-        return TRUE;
-
-    // On WIN32, must check if this volume is mounted or
-    // we get an error dialog for e.g. drive a:
-#ifdef __WIN32__
-    if (!wxIsDriveAvailable(m_path))
-        return FALSE;
-#endif
-
-    wxString search = m_path;
-    
-    if (m_path.Last() != wxFILE_SEP_PATH)
-    {
-        search += wxString(wxFILE_SEP_PATH);
-    }
-    search += wxT("*");
-
-    wxLogNull log;
-    wxString path = wxFindFirstFile( search, wxDIR );
-    return (bool)(!path.IsNull());
-}
-
 //-----------------------------------------------------------------------------
 // wxGenericDirCtrl
 //-----------------------------------------------------------------------------
@@ -710,8 +692,8 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
     if (!wxIsDriveAvailable(dirName))
     {
         data->m_isExpanded = FALSE;
-        wxMessageBox(wxT("Sorry, this drive is not available."));
-          return;
+        //wxMessageBox(wxT("Sorry, this drive is not available."));
+        return;
     }
 #endif
 
index a0461f5fa3ed900cb874ec22221e4d4b6cb5f1a9..0f3115a32944510cd7e4a34f44bef4daa8c17e2f 100644 (file)
@@ -18,7 +18,7 @@ MINGW32=1
 MINGW32VERSION=2.95
 
 # If building DLL, the version
-WXVERSION=22_0
+WXVERSION=23_0
 
 # Say yes if you have a "modern" linker that supports --shared option.
 # Note that you're probably going to wait forever for dlltool/gcc/etc