Queues an in-place rename for an item. This method is used when a file is created using the shell new menu, and the item may or may not have been inserted into the listview yet. */
| 1262 | may or may not have been inserted into |
| 1263 | the listview yet. */ |
| 1264 | void ShellBrowser::QueueRename(PCIDLIST_ABSOLUTE pidlItem) |
| 1265 | { |
| 1266 | /* Items are inserted within the context |
| 1267 | of this thread. Therefore, either pending |
| 1268 | items have already been inserted, or they |
| 1269 | have yet to be inserted. |
| 1270 | First, look for the file using it's display |
| 1271 | name. If the file is not found, set a flag |
| 1272 | indicating that when items are inserted, |
| 1273 | they should be checked against this item. |
| 1274 | Once a match is found, rename the item |
| 1275 | in-place within the listview. */ |
| 1276 | |
| 1277 | TCHAR szItem[MAX_PATH]; |
| 1278 | LVITEM lvItem; |
| 1279 | BOOL bItemFound = FALSE; |
| 1280 | int nItems; |
| 1281 | int i = 0; |
| 1282 | |
| 1283 | GetDisplayName(pidlItem, szItem, SIZEOF_ARRAY(szItem), SHGDN_INFOLDER); |
| 1284 | |
| 1285 | nItems = ListView_GetItemCount(m_hListView); |
| 1286 | |
| 1287 | for (i = 0; i < nItems; i++) |
| 1288 | { |
| 1289 | lvItem.mask = LVIF_PARAM; |
| 1290 | lvItem.iItem = i; |
| 1291 | lvItem.iSubItem = 0; |
| 1292 | ListView_GetItem(m_hListView, &lvItem); |
| 1293 | |
| 1294 | if (CompareIdls(pidlItem, m_itemInfoMap.at((int) lvItem.lParam).pidlComplete.get())) |
| 1295 | { |
| 1296 | bItemFound = TRUE; |
| 1297 | |
| 1298 | ListView_EditLabel(m_hListView, i); |
| 1299 | break; |
| 1300 | } |
| 1301 | } |
| 1302 | |
| 1303 | if (!bItemFound) |
| 1304 | { |
| 1305 | m_bNewItemCreated = TRUE; |
| 1306 | m_pidlNewItem = ILCloneFull(pidlItem); |
| 1307 | } |
| 1308 | } |
| 1309 | |
| 1310 | void ShellBrowser::SelectItems(const std::list<std::wstring> &PastedFileList) |
| 1311 | { |
no test coverage detected