X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/daf3246330c8ae7b4536cd1f6deef733a405cecd..79099b80ad442cb93b2f7df716bf3d1dd80b446f:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 32c1cdc692..66ea7d88fe 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -113,7 +113,7 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI // No logical drives; return "\" paths.Add(wxT("\\")); names.Add(wxT("\\")); - return 1; + icon_ids.Add(wxFileIconsTable::computer); #elif defined(__WIN32__) wxChar driveBuffer[256]; size_t n = (size_t) GetLogicalDriveStrings(255, driveBuffer); @@ -242,7 +242,7 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI !CFStringGetCString(cfstr, cstr, CFStringGetLength(cfstr) + 1, kCFStringEncodingMacRoman)) { - CFRelease( cstr ); + CFRelease( cfstr ); continue; } wxString name( cstr , wxConvLocal ); @@ -291,6 +291,8 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI #else #error "Unsupported platform in wxGenericDirCtrl!" #endif + wxASSERT_MSG( (paths.GetCount() == names.GetCount()), wxT("The number of paths and their human readable names should be equal in number.")); + wxASSERT_MSG( (paths.GetCount() == icon_ids.GetCount()), wxT("Wrong number of icons for available drives.")); return paths.GetCount(); } @@ -323,6 +325,7 @@ bool wxIsDriveAvailable(const wxString& dirName) int setdrive(int drive) { #ifdef __WXWINCE__ + wxUnusedVar(drive); return 0; #elif defined(__GNUWIN32__) && \ (defined(__MINGW32_MAJOR_VERSION) && __MINGW32_MAJOR_VERSION >= 1) @@ -355,6 +358,7 @@ int setdrive(int drive) bool wxIsDriveAvailable(const wxString& dirName) { #ifdef __WXWINCE__ + wxUnusedVar(dirName); return false; #else #ifdef __WIN32__ @@ -403,9 +407,9 @@ bool wxIsDriveAvailable(const wxString& dirName) // Function which is called by quick sort. We want to override the default wxArrayString behaviour, // and sort regardless of case. -static int wxCMPFUNC_CONV wxDirCtrlStringCompareFunction(wxString* strFirst, wxString* strSecond) +static int wxCMPFUNC_CONV wxDirCtrlStringCompareFunction(const wxString& strFirst, const wxString& strSecond) { - return strFirst->CmpNoCase(*strSecond); + return strFirst.CmpNoCase(strSecond); } //----------------------------------------------------------------------------- @@ -1172,15 +1176,15 @@ void wxGenericDirCtrl::DoResize() // correct control height to always be returned, rather // than the drop-down list height which is sometimes returned. wxSize oldSize = m_filterListCtrl->GetSize(); - m_filterListCtrl->SetSize(wxDefaultPosition.x, - wxDefaultPosition.y, + m_filterListCtrl->SetSize(wxDefaultCoord, + wxDefaultCoord, oldSize.x+10, - wxDefaultSize.y, + wxDefaultCoord, wxSIZE_USE_EXISTING); - m_filterListCtrl->SetSize(wxDefaultPosition.x, - wxDefaultPosition.y, + m_filterListCtrl->SetSize(wxDefaultCoord, + wxDefaultCoord, oldSize.x, - wxDefaultSize.y, + wxDefaultCoord, wxSIZE_USE_EXISTING); #endif filterSz = m_filterListCtrl->GetSize();