Changeset 557 for trunk/dll/update.c
- Timestamp:
- Mar 9, 2007, 7:38:41 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/update.c
r552 r557 15 15 06 Jun 05 SHL Drop unused code 16 16 22 Jul 06 SHL Use wrappers 17 Add FindDriveIcon 17 20 Feb 07 GKY Add SelectDriveIcon() 18 09 Mar 07 GKY Cleanup SelectDriveIcon using "driveflag =" from Steven 18 19 19 20 ***********************************************************************/ … … 37 38 #pragma alloc_text(UPDATECNR,UpdateCnrRecord,UpdateCnrList) 38 39 39 HPOINTER FindDriveIcon(PCNRITEM pci) 40 { 41 *pci->szFileName = toupper(*pci->szFileName); 42 if (isalpha(*pci->szFileName) && 43 toupper(*pci->szFileName) > 'B') { 44 if (driveflags[toupper(*pci->szFileName) - 'A'] & 45 DRIVE_CDROM) 46 pci->rc.hptrIcon = hptrCDROM; 47 else 48 pci->rc.hptrIcon = 49 (driveflags[toupper(*pci->szFileName) - 'A'] & 50 DRIVE_REMOVABLE) ? hptrRemovable 51 :(driveflags[toupper(*pci->szFileName) - 'A'] & 52 DRIVE_VIRTUAL) ? hptrVirtual 53 :(driveflags[toupper(*pci->szFileName) - 'A'] & 54 DRIVE_REMOTE) ? hptrRemote 55 :(driveflags[toupper(*pci->szFileName) - 'A'] & 56 DRIVE_RAMDISK) ? hptrRamdisk 57 :(driveflags[toupper(*pci->szFileName) - 'A'] & 58 DRIVE_ZIPSTREAM) ? hptrZipstrm : hptrDrive; 59 } 60 else 61 pci->rc.hptrIcon = hptrFloppy; 62 return pci->rc.hptrIcon; 63 } 40 HPOINTER SelectDriveIcon(PCNRITEM pci) 41 { 42 UINT driveflag = driveflags[toupper(*pci->szFileName) - 'A']; 43 *pci->szFileName = toupper(*pci->szFileName); 44 if (isalpha(*pci->szFileName) && 45 toupper(*pci->szFileName) > 'B') { 46 if (driveflag & DRIVE_CDROM) 47 pci->rc.hptrIcon = hptrCDROM; 48 else 49 pci->rc.hptrIcon = 50 (driveflag & DRIVE_REMOVABLE) ? hptrRemovable 51 :(driveflag & DRIVE_VIRTUAL) ? hptrVirtual 52 :(driveflag & DRIVE_REMOTE) ? hptrRemote 53 :(driveflag & DRIVE_RAMDISK) ? hptrRamdisk 54 :(driveflag & DRIVE_ZIPSTREAM) ? hptrZipstrm : hptrDrive; 55 } 56 else 57 pci->rc.hptrIcon = hptrFloppy; 58 return pci->rc.hptrIcon; 59 } 64 60 PCNRITEM UpdateCnrRecord(HWND hwndCnr, CHAR * filename, BOOL partial, 65 61 DIRCNRDATA * dcd) … … 149 145 FillInRecordFromFFB(hwndCnr, pci, filename, &ffb, partial, dcd); 150 146 if (strlen(pci->szFileName) < 4) 151 FindDriveIcon(pci);147 SelectDriveIcon(pci); 152 148 oldemphasis = pci->rc.flRecordAttr & (CRA_SELECTED | CRA_CURSORED); 153 149 if (oldemphasis) … … 185 181 filename, &ffb, partial, dcd); 186 182 if (strlen(pci->szFileName) < 4) 187 FindDriveIcon(pci);183 SelectDriveIcon(pci); 188 184 memset(&ri, 0, sizeof(RECORDINSERT)); 189 185 ri.cb = sizeof(RECORDINSERT); … … 231 227 pci, filename, &ffb, partial, dcd); 232 228 if (strlen(pci->szFileName) < 4) 233 FindDriveIcon(pci);229 SelectDriveIcon(pci); 234 230 memset(&ri, 0, sizeof(RECORDINSERT)); 235 231 ri.cb = sizeof(RECORDINSERT); … … 278 274 filename, &ffb, partial, dcd); 279 275 if (strlen(pci->szFileName) < 4) 280 FindDriveIcon(pci);276 SelectDriveIcon(pci); 281 277 memset(&ri, 0, sizeof(RECORDINSERT)); 282 278 ri.cb = sizeof(RECORDINSERT); … … 436 432 pci, filename[x], &ffb, partial, dcd); 437 433 if (IsRoot(pci->szFileName)) 438 FindDriveIcon(pci);434 SelectDriveIcon(pci); 439 435 WinSendMsg(hwndCnr, 440 436 CM_SETRECORDEMPHASIS, … … 460 456 &ffb, partial, dcd); 461 457 if (strlen(pci->szFileName) < 4) 462 FindDriveIcon(pci);458 SelectDriveIcon(pci); 463 459 memset(&ri, 0, sizeof(RECORDINSERT)); 464 460 ri.cb = sizeof(RECORDINSERT); … … 514 510 &ffb, partial, dcd); 515 511 if (strlen(pci->szFileName) < 4) 516 FindDriveIcon(pci);512 SelectDriveIcon(pci); 517 513 memset(&ri, 0, sizeof(RECORDINSERT)); 518 514 ri.cb = sizeof(RECORDINSERT); … … 561 557 &ffb, partial, dcd); 562 558 if (strlen(pci->szFileName) < 4) 563 FindDriveIcon(pci);559 SelectDriveIcon(pci); 564 560 memset(&ri, 0, sizeof(RECORDINSERT)); 565 561 ri.cb = sizeof(RECORDINSERT);
Note:
See TracChangeset
for help on using the changeset viewer.