Changeset 1871 for trunk/dll/select.c
- Timestamp:
- Sep 21, 2015, 12:57:02 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/select.c
r1838 r1871 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2004, 201 1Steven H. Levine9 Copyright (c) 2004, 2015 Steven H. Levine 10 10 11 11 01 Aug 04 SHL Rework lstrip/rstrip usage … … 34 34 02 Aug 15 GKY Remove unneed SubbyScan code and improve suppression of blank lines and 35 35 duplicate subdirectory name caused by running Stubby in worker threads. 36 20 Sep 15 GKY Create CollapseAll and modify ExpandAll to reduce code overhead 37 both to try and speed drive expansion. Change ExpandAll to allow it to loop 38 in UM_EXPAND until until drive is completely expanded. Changes were need to 39 work with Flesh, Stubby and UnFlesh being moved to a thread 36 40 37 41 ***********************************************************************/ … … 65 69 #include "stristr.h" // findstring 66 70 #include "fortify.h" 71 #include "flesh.h" 67 72 #if 0 68 73 #define __PMPRINTF__ … … 564 569 } 565 570 566 VOID ExpandAll(HWND hwndCnr, BOOL expand, PCNRITEM pciParent) 567 { 568 PCNRITEM pci; 569 571 BOOL ExpandAll(HWND hwndCnr, INT count, PCNRITEM pciParent) 572 { 573 PCNRITEM pci; 574 static BOOL fExpanding = FALSE; 575 static INT counter = 1; 576 577 if (count != counter && count != 0) { 578 if (count > counter) { 579 fExpanding = FALSE; 580 counter++; 581 } 582 else if (count < counter) { 583 fExpanding = FALSE; 584 counter = 1; 585 } 586 } 570 587 if (!pciParent) 571 588 pciParent = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL), 572 589 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 573 590 if (pciParent) { 574 if (expand && ~pciParent->rc.flRecordAttr & CRA_EXPANDED) 591 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent), 592 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 593 // Only expand items that have childern 594 if (pci && ~pciParent->rc.flRecordAttr & CRA_EXPANDED) { 575 595 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciParent), MPVOID); 576 else if (!expand && (pciParent->rc.flRecordAttr & CRA_EXPANDED)) 596 if (count != 0) { 597 fExpanding = TRUE; 598 if (!IsFleshWorkListEmpty()) { 599 WaitFleshWorkListEmpty(NULL); // Let it expand 600 } 601 } 602 } 603 while (pci && (INT)pci != -1) { 604 ExpandAll(hwndCnr, count, pci); 605 if (!IsFleshWorkListEmpty()) 606 WaitFleshWorkListEmpty(NULL); // Wait for container to catch up 607 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), 608 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 609 } 610 } 611 //DosSleep(0); 612 return fExpanding; 613 } 614 615 VOID CollapseAll(HWND hwndCnr, PCNRITEM pciParent) 616 { 617 PCNRITEM pci; 618 619 if (!pciParent) 620 pciParent = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(NULL), 621 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 622 if (pciParent) { 623 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent), 624 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 625 if ((pciParent->rc.flRecordAttr & CRA_EXPANDED)) 577 626 WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciParent), MPVOID); 578 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pciParent), 579 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 580 while (pci && (INT)pci != -1) { 581 ExpandAll(hwndCnr, expand, pci); 627 while (pci && (INT)pci != -1) { 628 CollapseAll(hwndCnr, pci); 582 629 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), 583 630 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 584 631 } 585 632 }
Note:
See TracChangeset
for help on using the changeset viewer.