ItemCount volumeIndex = 1;
OSErr err = noErr ;
-
+
while( noErr == err )
{
HFSUniStr255 volumeName ;
FSRef fsRef ;
FSVolumeInfo volumeInfo ;
- err = FSGetVolumeInfo(0, volumeIndex, NULL, kFSVolInfoFlags , &volumeInfo , &volumeName, &fsRef);
- if( noErr == err )
- {
- wxString path = wxMacFSRefToPath( &fsRef ) ;
+ err = FSGetVolumeInfo(0, volumeIndex, NULL, kFSVolInfoFlags , &volumeInfo , &volumeName, &fsRef);
+ if( noErr == err )
+ {
+ wxString path = wxMacFSRefToPath( &fsRef ) ;
wxString name = wxMacHFSUniStrToString( &volumeName ) ;
-
+
if ( (volumeInfo.flags & kFSVolFlagSoftwareLockedMask) || (volumeInfo.flags & kFSVolFlagHardwareLockedMask) )
{
icon_ids.Add(wxFileIconsTable::cdrom);
icon_ids.Add(wxFileIconsTable::drive);
}
// todo other removable
-
+
paths.Add(path);
names.Add(name);
volumeIndex++ ;
- }
+ }
}
#elif defined(__UNIX__)
bool wxDirItemData::HasSubDirs() const
{
- if (m_path.IsEmpty())
+ if (m_path.empty())
return false;
wxDir dir;
bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const
{
- if (m_path.IsEmpty())
+ if (m_path.empty())
return false;
wxDir dir;
m_treeCtrl = CreateTreeCtrl(this, wxID_TREECTRL,
wxPoint(0,0), GetClientSize(), treeStyle);
- if (!filter.IsEmpty() && (style & wxDIRCTRL_SHOW_FILTERS))
+ if (!filter.empty() && (style & wxDIRCTRL_SHOW_FILTERS))
m_filterListCtrl = new wxDirFilterListCtrl(this, wxID_FILTERLISTCTRL, wxDefaultPosition, wxDefaultSize, filterStyle);
m_defaultPath = dir;
void wxGenericDirCtrl::OnEndEditItem(wxTreeEvent &event)
{
- if ((event.GetLabel().IsEmpty()) ||
+ if ((event.GetLabel().empty()) ||
(event.GetLabel() == _(".")) ||
(event.GetLabel() == _("..")) ||
(event.GetLabel().Find(wxT('/')) != wxNOT_FOUND) ||
{
wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(childId);
- if (data && !data->m_path.IsEmpty())
+ if (data && !data->m_path.empty())
{
wxString childPath(data->m_path);
if (!wxEndsWithPathSeparator(childPath))
Create();
#if wxUSE_MIMETYPE
- if (!extension.IsEmpty())
+ if (!extension.empty())
{
wxFileIconEntry *entry = (wxFileIconEntry*) m_HashTable->Get(extension);
if (entry) return (entry -> id);
}
- wxFileType *ft = (mime.IsEmpty()) ?
+ wxFileType *ft = (mime.empty()) ?
wxTheMimeTypesManager -> GetFileTypeFromExtension(extension) :
wxTheMimeTypesManager -> GetFileTypeFromMimeType(mime);
wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& WXUNUSED(item),
wxTreeItemIdValue& cookie) const
{
- wxTreeItemId item(TreeView_GetNextSibling(GetHwnd(),
- HITEM(wxTreeItemId(cookie))));
+ wxTreeItemId fromCookie(cookie);
+
+ HTREEITEM hitem = HITEM(fromCookie);
+
+ hitem = TreeView_GetNextSibling(GetHwnd(), hitem);
+
+ wxTreeItemId item(hitem);
+
cookie = item.m_pItem;
return item;
wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& WXUNUSED(item),
long& cookie) const
{
- wxTreeItemId item(TreeView_GetNextSibling
- (
- GetHwnd(),
- HITEM(wxTreeItemId((void *)cookie)
- )));
+ wxTreeItemId fromCookie((void *)cookie);
+
+ HTREEITEM hitem = HITEM(fromCookie);
+
+ hitem = TreeView_GetNextSibling(GetHwnd(), hitem);
+
+ wxTreeItemId item(hitem);
+
cookie = (long)item.m_pItem;
return item;
}
UINT mask = 0;
- if ( !text.IsEmpty() )
+ if ( !text.empty() )
{
mask |= TVIF_TEXT;
tvIns.item.pszText = (wxChar *)text.c_str(); // cast is ok