Changeset 557 for trunk/dll/update.c


Ignore:
Timestamp:
Mar 9, 2007, 7:38:41 PM (18 years ago)
Author:
Gregg Young
Message:

Changes for 3.05 beta mostly drive flag/tree related

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/update.c

    r552 r557  
    1515  06 Jun 05 SHL Drop unused code
    1616  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
    1819
    1920***********************************************************************/
     
    3738#pragma alloc_text(UPDATECNR,UpdateCnrRecord,UpdateCnrList)
    3839
    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                   }
     40HPOINTER 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}
    6460PCNRITEM UpdateCnrRecord(HWND hwndCnr, CHAR * filename, BOOL partial,
    6561                         DIRCNRDATA * dcd)
     
    149145        FillInRecordFromFFB(hwndCnr, pci, filename, &ffb, partial, dcd);
    150146        if (strlen(pci->szFileName) < 4)
    151         FindDriveIcon(pci);
     147        SelectDriveIcon(pci);
    152148        oldemphasis = pci->rc.flRecordAttr & (CRA_SELECTED | CRA_CURSORED);
    153149        if (oldemphasis)
     
    185181                                              filename, &ffb, partial, dcd);
    186182          if (strlen(pci->szFileName) < 4)
    187           FindDriveIcon(pci);
     183          SelectDriveIcon(pci);
    188184          memset(&ri, 0, sizeof(RECORDINSERT));
    189185          ri.cb = sizeof(RECORDINSERT);
     
    231227                                    pci, filename, &ffb, partial, dcd);
    232228                if (strlen(pci->szFileName) < 4)
    233                 FindDriveIcon(pci);
     229                SelectDriveIcon(pci);
    234230                memset(&ri, 0, sizeof(RECORDINSERT));
    235231                ri.cb = sizeof(RECORDINSERT);
     
    278274                                              filename, &ffb, partial, dcd);
    279275          if (strlen(pci->szFileName) < 4)
    280           FindDriveIcon(pci);
     276          SelectDriveIcon(pci);
    281277          memset(&ri, 0, sizeof(RECORDINSERT));
    282278          ri.cb = sizeof(RECORDINSERT);
     
    436432                                pci, filename[x], &ffb, partial, dcd);
    437433            if (IsRoot(pci->szFileName))
    438             FindDriveIcon(pci);
     434            SelectDriveIcon(pci);
    439435            WinSendMsg(hwndCnr,
    440436                       CM_SETRECORDEMPHASIS,
     
    460456                                                  &ffb, partial, dcd);
    461457              if (strlen(pci->szFileName) < 4)
    462               FindDriveIcon(pci);
     458              SelectDriveIcon(pci);
    463459              memset(&ri, 0, sizeof(RECORDINSERT));
    464460              ri.cb = sizeof(RECORDINSERT);
     
    514510                                                        &ffb, partial, dcd);
    515511                    if (strlen(pci->szFileName) < 4)
    516                     FindDriveIcon(pci);
     512                    SelectDriveIcon(pci);
    517513                    memset(&ri, 0, sizeof(RECORDINSERT));
    518514                    ri.cb = sizeof(RECORDINSERT);
     
    561557                                                    &ffb, partial, dcd);
    562558                if (strlen(pci->szFileName) < 4)
    563                 FindDriveIcon(pci);
     559                SelectDriveIcon(pci);
    564560                memset(&ri, 0, sizeof(RECORDINSERT));
    565561                ri.cb = sizeof(RECORDINSERT);
Note: See TracChangeset for help on using the changeset viewer.