void CFolderView::OnFileActionRenamedOldName(TCHAR *szFileName) { list<Added_t>::iterator itrAdded; BOOL bFileHandled = FALSE; /* Loop through each file that is awaiting add to check for the renamed file. */ for(itrAdded = m_FilesAdded.begin();itrAdded != m_FilesAdded.end();itrAdded++) { if(lstrcmp(szFileName,itrAdded->szFileName) == 0) { bFileHandled = TRUE; g_bNewFileRenamed = TRUE; m_FilesAdded.erase(itrAdded); break; } } if(!bFileHandled) { /* Find the index of the item that was renamed... Store the index so that it is known which item needs renaming when the files new name is received. */ iRenamedItem = LocateFileItemInternalIndex(szFileName); } }
void CShellBrowser::RemoveItemInternal(const TCHAR *szFileName) { std::list<Added_t>::iterator itr; int iItemInternal; BOOL bFound = FALSE; /* First check if this item is in the queue of awaiting items. If it is, remove it. */ for(itr = m_FilesAdded.begin();itr != m_FilesAdded.end();itr++) { if(lstrcmp(szFileName,itr->szFileName) == 0) { m_FilesAdded.erase(itr); bFound = TRUE; break; } } if(!bFound) { iItemInternal = LocateFileItemInternalIndex(szFileName); if(iItemInternal != -1) RemoveItem(iItemInternal); } }
int CShellBrowser::LocateFileItemIndex(const TCHAR *szFileName) const { LV_FINDINFO lvFind; int iItem; int iInternalIndex; iInternalIndex = LocateFileItemInternalIndex(szFileName); if(iInternalIndex != -1) { lvFind.flags = LVFI_PARAM; lvFind.lParam = iInternalIndex; iItem = ListView_FindItem(m_hListView,-1,&lvFind); return iItem; } return -1; }