]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/filedlgg.cpp
fixed a signed/unsigned comparison warning introudced by last warning fix...
[wxWidgets.git] / src / generic / filedlgg.cpp
index 55da3ff5ff0565559ef9c597504e38f853af5a73..9096fef28fd85e2c5a307e916c736d0d10834709 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "filedlgg.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -135,17 +131,10 @@ int wxCALLBACK wxFileDataTimeCompare( long data1, long data2, long data)
      return fd1->GetDateTime().IsLaterThan(fd2->GetDateTime()) ? int(data) : -int(data);
 }
 
-#if defined(__UNIX__) && !defined(__OS2__)
-#define IsTopMostDir(dir)   (dir == wxT("/"))
-#endif
-
 #if defined(__DOS__) || defined(__WINDOWS__) || defined (__OS2__)
 #define IsTopMostDir(dir)   (dir.empty())
-#endif
-
-#if defined(__DOS__) || defined(__WINDOWS__) || defined(__OS2__)
-// defined in src/generic/dirctrlg.cpp
-extern bool wxIsDriveAvailable(const wxString& dirName);
+#else
+#define IsTopMostDir(dir)   (dir == wxT("/"))
 #endif
 
 // defined in src/generic/dirctrlg.cpp
@@ -268,7 +257,7 @@ wxString wxFileData::GetFileType() const
         return _("<LINK>");
     else if (IsDrive())
         return _("<DRIVE>");
-   else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND)
+    else if (m_fileName.Find(wxT('.'), true) != wxNOT_FOUND)
         return m_fileName.AfterLast(wxT('.'));
 
     return wxEmptyString;
@@ -304,7 +293,7 @@ wxString wxFileData::GetHint() const
     }
 
     return s;
-};
+}
 
 wxString wxFileData::GetEntry( fileListFieldType num ) const
 {
@@ -325,7 +314,7 @@ wxString wxFileData::GetEntry( fileListFieldType num ) const
             break;
 
         case FileList_Time:
-                if (!IsDrive())
+            if (!IsDrive())
                 s = GetModificationTime();
             break;
 
@@ -541,7 +530,7 @@ void wxFileCtrl::UpdateFiles()
 #endif // __UNIX__
             wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
             if (Add(fd, item) != -1)
-            item.m_itemId++;
+                item.m_itemId++;
             else
                 delete fd;
         }
@@ -570,7 +559,7 @@ void wxFileCtrl::UpdateFiles()
             {
                 wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
                 if (Add(fd, item) != -1)
-                item.m_itemId++;
+                    item.m_itemId++;
                 else
                     delete fd;
 
@@ -588,7 +577,7 @@ void wxFileCtrl::UpdateFiles()
                 {
                     wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
                     if (Add(fd, item) != -1)
-                    item.m_itemId++;
+                        item.m_itemId++;
                     else
                         delete fd;
 
@@ -695,7 +684,7 @@ void wxFileCtrl::GoToHomeDir()
 
 void wxFileCtrl::GoToDir( const wxString &dir )
 {
-    if (!wxPathExists(dir)) return;
+    if (!wxDirExists(dir)) return;
 
     m_dirName = dir;
     UpdateFiles();
@@ -855,7 +844,6 @@ wxFileCtrl::~wxFileCtrl()
 #define  ID_CHOICE        (wxID_FILEDLGG + 8)
 #define  ID_TEXT          (wxID_FILEDLGG + 9)
 #define  ID_LIST_CTRL     (wxID_FILEDLGG + 10)
-#define  ID_ACTIVATED     (wxID_FILEDLGG + 11)
 #define  ID_CHECK         (wxID_FILEDLGG + 12)
 
 IMPLEMENT_DYNAMIC_CLASS(wxGenericFileDialog, wxFileDialogBase)
@@ -1225,7 +1213,7 @@ void wxGenericFileDialog::OnSelected( wxListEvent &event )
     if (!IsTopMostDir(dir))
         dir += wxFILE_SEP_PATH;
     dir += filename;
-    if (wxPathExists(dir)) return;
+    if (wxDirExists(dir)) return;
 
     ignoreChanges = true;
     m_text->SetValue( filename );
@@ -1267,16 +1255,19 @@ void wxGenericFileDialog::HandleAction( const wxString &fn )
     }
 #endif // __UNIX__
 
-    if ((filename.Find(wxT('*')) != wxNOT_FOUND) ||
-        (filename.Find(wxT('?')) != wxNOT_FOUND))
+    if (!(m_dialogStyle & wxSAVE))
     {
-        if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND)
+        if ((filename.Find(wxT('*')) != wxNOT_FOUND) ||
+            (filename.Find(wxT('?')) != wxNOT_FOUND))
         {
-            wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR );
+            if (filename.Find(wxFILE_SEP_PATH) != wxNOT_FOUND)
+            {
+                wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR );
+                return;
+            }
+            m_list->SetWild( filename );
             return;
         }
-        m_list->SetWild( filename );
-        return;
     }
 
     if (!IsTopMostDir(dir))
@@ -1287,7 +1278,7 @@ void wxGenericFileDialog::HandleAction( const wxString &fn )
         filename = dir;
     }
 
-    if (wxPathExists(filename))
+    if (wxDirExists(filename))
     {
         m_list->GoToDir( filename );
         UpdateControls();