Changeset 743
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/filldir.c
r739 r743 54 54 #pragma alloc_text(FILLDIR,FillInRecordFromFFB,FillInRecordFromFSA,IDFile) 55 55 #pragma alloc_text(FILLDIR1,ProcessDirectory,FillDirCnr,FillTreeCnr) 56 #pragma alloc_text(EMPTYCNR,EmptyCnr) 56 57 57 58 static HPOINTER IDFile(PSZ p) … … 1467 1468 1468 1469 } // FillTreeCnr 1470 1471 1472 /** 1473 * Empty all records from a container and free associated storage and 1474 * Free up field infos 1475 */ 1476 1477 VOID EmptyCnr(HWND hwnd) 1478 { 1479 PFIELDINFO pfi; 1480 1481 // Remove all records 1482 RemoveCnrItems(hwnd, NULL, 0, CMA_FREE); 1483 1484 // Remove field info descriptors 1485 pfi = (PFIELDINFO) WinSendMsg(hwnd, CM_QUERYDETAILFIELDINFO, MPVOID, 1486 MPFROMSHORT(CMA_FIRST)); 1487 if (pfi) 1488 WinSendMsg(hwnd, CM_REMOVEDETAILFIELDINFO, MPVOID, 1489 MPFROM2SHORT(0, CMA_FREE)); 1490 } 1491 1492 1493 /** 1494 * Free storage associated with container item 1495 */ 1496 1497 static VOID FreeCnrItemData(PCNRITEM pci) 1498 { 1499 if (pci->pszSubject && pci->pszSubject != NullStr) 1500 xfree(pci->pszSubject); 1501 1502 if (pci->pszLongname && pci->pszLongname != NullStr && 1503 pci->pszLongname != pci->pszFileName && pci->pszLongname != pci->pszDisplayName) 1504 xfree(pci->pszLongname); 1505 1506 if (pci->pszFileName && pci->pszFileName != NullStr) 1507 xfree(pci->pszFileName); 1508 } 1509 1510 /** 1511 * Free container item and associated storage 1512 */ 1513 1514 VOID FreeCnrItem(HWND hwnd, PCNRITEM pci) 1515 { 1516 FreeCnrItemData(pci); 1517 1518 if (!WinSendMsg(hwnd, CM_FREERECORD, MPFROMP(&pci), MPFROMSHORT(1))) { 1519 // Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__,IDS_CMFREEERRTEXT); 1520 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,"CM_FREERECORD"); 1521 } 1522 } 1523 1524 /** 1525 * Remove item from container and free associated storage 1526 */ 1527 1528 VOID RemoveCnrItems(HWND hwnd, PCNRITEM pci, USHORT usCnt, USHORT usFlags) 1529 { 1530 if (usCnt == 0) { 1531 if (pci != NULL) 1532 Runtime_Error(pszSrcFile, __LINE__, "pci not NULL"); 1533 else { 1534 for (;;) { 1535 pci = (PCNRITEM)WinSendMsg(hwnd, CM_QUERYRECORD, MPVOID, 1536 MPFROMSHORT(CMA_FIRST)); 1537 if (!pci) 1538 break; 1539 else if ((INT)pci == -1) 1540 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,"CM_QUERYRECORD"); 1541 else 1542 RemoveCnrItems(hwnd, pci, 1, usFlags); 1543 } 1544 } 1545 } 1546 else if (usCnt != 1) 1547 Runtime_Error(pszSrcFile, __LINE__, "count not 1"); 1548 else { 1549 FreeCnrItemData(pci); 1550 1551 if (!WinSendMsg(hwnd, CM_REMOVERECORD, MPFROMP(&pci), MPFROM2SHORT(usCnt, CMA_FREE))) { 1552 // Win_Error2(hwnd, hwnd, pszSrcFile, __LINE__,IDS_CMREMOVEERRTEXT); 1553 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__,"CM_REMOVERECORD"); 1554 } 1555 } 1556 } 1557 -
trunk/dll/fm3dll.h
r739 r743 625 625 626 626 /* filldir.c */ 627 VOID FillDirCnr(HWND hwndCnr, CHAR * pszDirectory, DIRCNRDATA * pdcd, 627 VOID EmptyCnr(HWND hwnd); 628 VOID FillDirCnr(HWND hwndCnr, CHAR *pszDirectory, DIRCNRDATA *pdcd, 628 629 PULONGLONG pullBytes); 629 630 VOID FillTreeCnr(HWND hwndCnr, HWND hwndParent); 630 631 VOID ProcessDirectory(const HWND hwndCnr, const PCNRITEM pciParent, 631 const CHAR * szDirBase, const BOOL filestoo,632 const CHAR *szDirBase, const BOOL filestoo, 632 633 const BOOL recurse, const BOOL partial, 633 CHAR * stopflag, DIRCNRDATA *pdcd,634 CHAR *stopflag, DIRCNRDATA *pdcd, 634 635 PULONG pullTotalFiles, PULONGLONG pullTotalBytes); 635 636 ULONGLONG FillInRecordFromFFB(HWND hwndCnr, PCNRITEM pci, 636 637 const PSZ pszDirectory, 637 638 const PFILEFINDBUF4 pffb, const BOOL partial, 638 DIRCNRDATA * pdcd);639 DIRCNRDATA *pdcd); 639 640 ULONGLONG FillInRecordFromFSA(HWND hwndCnr, PCNRITEM pci, 640 641 const PSZ pszFileName, const PFILESTATUS4 pfsa4, 641 const BOOL partial, DIRCNRDATA * pdcd); 642 const BOOL partial, DIRCNRDATA *pdcd); 643 VOID FreeCnrItem(HWND hwnd, PCNRITEM pci); 644 VOID RemoveCnrItems(HWND hwnd, PCNRITEM pci, USHORT usCnt, USHORT usFlags); 642 645 643 646 /* flesh.c */ … … 710 713 VOID CloseHelp(VOID); 711 714 INT ExecFile(HWND hwnd, CHAR * filename); 712 VOID EmptyCnr(HWND hwnd);713 715 VOID SetDetailsSwitches(HWND hwnd, DIRCNRDATA * dcd); 714 716 VOID AdjustDetailsSwitches(HWND hwnd, HWND hwndMenu, USHORT cmd, -
trunk/dll/misc.c
r737 r743 55 55 #pragma alloc_text(CNR_MISC1,AdjustCnrColVis,AdjustCnrColsForFSType) 56 56 #pragma alloc_text(CNR_MISC1,AdjustCnrColsForPref,SetCnrCols) 57 #pragma alloc_text(CNR_MISC2,CnrDirectEdit, EmptyCnr,OpenEdit)57 #pragma alloc_text(CNR_MISC2,CnrDirectEdit,OpenEdit) 58 58 #pragma alloc_text(MISC2,SetMenuCheck,disable_menuitem,SetSortChecks) 59 59 #pragma alloc_text(MISC2,SetDetailsSwitches,SetViewMenu) … … 926 926 return -1; 927 927 return 0; 928 }929 930 VOID EmptyCnr(HWND hwnd)931 {932 /* Empty out a container in preparation to it dying */933 PCNRITEM pci;934 PFIELDINFO pfi;935 936 pci = (PCNRITEM) WinSendMsg(hwnd, CM_QUERYRECORD, MPVOID,937 MPFROMSHORT(CMA_FIRST));938 if (pci && (INT) pci != -1)939 WinSendMsg(hwnd, CM_REMOVERECORD, MPVOID, MPFROM2SHORT(0, CMA_FREE));940 pfi = (PFIELDINFO) WinSendMsg(hwnd, CM_QUERYDETAILFIELDINFO, MPVOID,941 MPFROMSHORT(CMA_FIRST));942 if (pfi)943 WinSendMsg(hwnd, CM_REMOVEDETAILFIELDINFO, MPVOID,944 MPFROM2SHORT(0, CMA_FREE));945 928 } 946 929
Note:
See TracChangeset
for help on using the changeset viewer.
