Changeset 956 for trunk/dll


Ignore:
Timestamp:
Feb 16, 2008, 11:34:01 PM (18 years ago)
Author:
Gregg Young
Message:

Fix attempt to free container items that were never inserted. Fix "collect" so it updates recollected files and unhides them if needed. (Ticket 220)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r953 r956  
    4545  10 Feb 08 GKY Implement bubble help for bitmap menu items
    4646  15 Feb 08 SHL Sync with settings menu rework
     47  15 Feb 08 GKY Fix attempt to free container items that were never inserted
     48  15 Feb 08 GKY Fix "collect" so it updates recollected files and unhides them if needed
    4749
    4850***********************************************************************/
     
    591593            nm = 1;
    592594            hdir = HDIR_CREATE;
    593             DosError(FERR_DISABLEHARDERR);
    594             if (*li->list[x] &&
     595            DosError(FERR_DISABLEHARDERR);
     596            if (FindCnrRecord(dcd->hwndCnr,
     597                              li->list[x],
     598                              NULL,
     599                              FALSE,
     600                              FALSE,
     601                              TRUE)) {
     602              pci = UpdateCnrRecord(dcd->hwndCnr, li->list[x], FALSE, dcd);
     603              if (Filter((PMINIRECORDCORE) pci, (PVOID) & dcd->mask)) {
     604                pci->rc.flRecordAttr &= ~CRA_FILTERED;
     605                WinSendMsg(dcd->hwndCnr, CM_INVALIDATERECORD, MPVOID,
     606                           MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
     607              }
     608              pci = (PCNRITEM) pci->rc.preccNextRecord;
     609              if (pciP)
     610                pciP->rc.preccNextRecord = (PMINIRECORDCORE) pci;
     611              else
     612                pciFirst = pci;
     613            }
     614            else if (*li->list[x] &&
    595615                !DosQueryPathInfo(li->list[x], FIL_QUERYFULLNAME,
    596616                                  fullname, sizeof(fullname)) &&
    597617                !IsRoot(fullname) &&
    598                 !FindCnrRecord(dcd->hwndCnr,
    599                                fullname,
    600                                NULL,
    601                                FALSE,
    602                                FALSE,
    603                                TRUE) &&
    604618                !xDosFindFirst(fullname,
    605619                               &hdir,
     
    609623                               &fb4, sizeof(fb4), &nm, FIL_QUERYEASIZEL)) {
    610624              DosFindClose(hdir);
    611               priority_normal();
    612               *fb4.achName = 0;
    613               ullTotalBytes = FillInRecordFromFFB(dcd->hwndCnr,
    614                                                   pci,
    615                                                   fullname, &fb4, FALSE, dcd);
    616               dcd->ullTotalBytes += ullTotalBytes;
    617               pciP = pci;
    618               pci = (PCNRITEM) pci->rc.preccNextRecord;
     625              priority_normal();
     626                *fb4.achName = 0;
     627                ullTotalBytes = FillInRecordFromFFB(dcd->hwndCnr,
     628                                                    pci,
     629                                                    fullname, &fb4, FALSE, dcd);
     630                dcd->ullTotalBytes += ullTotalBytes;
     631                pciP = pci;
     632                pci = (PCNRITEM) pci->rc.preccNextRecord;
    619633            }
    620634            else {
     
    625639                pciP->rc.preccNextRecord = (PMINIRECORDCORE) pci;
    626640              else
    627                 pciFirst = pci;
    628               FreeCnrItem(hwnd, pciT);
     641                pciFirst = pci;
     642              if (pciT)
     643                FreeCnrItemData(pciT); // FreeCnrItem(hwnd, pciT);
    629644              ulMaxFiles--;             // Remember gone
    630645            }
     
    699714            }
    700715            /* fullname now contains name of file to collect */
    701             DosError(FERR_DISABLEHARDERR);
    702             if (IsFullName(fullname) &&
     716            DosError(FERR_DISABLEHARDERR);
     717            if (FindCnrRecord(dcd->hwndCnr,
     718                              fullname,
     719                              NULL,
     720                              FALSE,
     721                              FALSE,
     722                              TRUE)) {
     723              pci = UpdateCnrRecord(dcd->hwndCnr, fullname, FALSE, dcd);
     724              if (Filter((PMINIRECORDCORE) pci, (PVOID) & dcd->mask)) {
     725                pci->rc.flRecordAttr &= ~CRA_FILTERED;
     726                WinSendMsg(dcd->hwndCnr, CM_INVALIDATERECORD, MPVOID,
     727                           MPFROM2SHORT(0, CMA_REPOSITION | CMA_ERASE));
     728              }
     729              /*pci = (PCNRITEM) pci->rc.preccNextRecord;
     730              if (pciP)
     731                pciP->rc.preccNextRecord = (PMINIRECORDCORE) pci;
     732              else
     733                pciFirst = pci;*/
     734            }
     735            else if (IsFullName(fullname) &&
    703736                !IsRoot(fullname) &&
    704737                !DosQueryPathInfo(fullname,
    705738                                  FIL_QUERYEASIZEL,
    706739                                  &fs4,
    707                                   sizeof(fs4)) &&
    708                 !FindCnrRecord(dcd->hwndCnr,
    709                                fullname, NULL, FALSE, FALSE, TRUE)) {
     740                                  sizeof(fs4)))  {
    710741              /* collect it */
    711742              pci = WinSendMsg(dcd->hwndCnr,
Note: See TracChangeset for help on using the changeset viewer.