Changeset 1553 for trunk/dll/treecnr.c
- Timestamp:
- Nov 20, 2010, 10:18:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/treecnr.c
r1552 r1553 84 84 11 Apr 10 GKY Fix drive tree rescan failure and program hang caused by event sem 85 85 never being posted 86 20 Nov 10 GKY Rework scanning code to remove redundant scans, prevent double directory 87 entries in the tree container, fix related semaphore performance using 88 combination of event and mutex semaphores 86 89 87 90 ***********************************************************************/ … … 644 647 dcd = INSTDATA(hwnd); 645 648 if (dcd) { 646 649 BOOL tempsusp, tempfollow, temptop; 647 650 648 651 DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); … … 656 659 } 657 660 ShowTreeRec(dcd->hwndCnr, (CHAR *)mp1, fCollapseFirst, TRUE); 658 // fixme Is this PostMsg needed if recursive scan has already been done?659 661 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 660 662 dcd->suspendview = (USHORT) tempsusp; … … 771 773 if (cnri.cRecords) { 772 774 sprintf(s, GetPString(IDS_NUMDRIVESTEXT), cnri.cRecords); 773 if (pci && pci->pszFileName && *pci->pszFileName) {775 if (pci && (INT) pci != -1 && pci->pszFileName && *pci->pszFileName) { 774 776 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 775 777 DRIVE_REMOVABLE) || … … 1827 1829 driveserial[toupper(*pci->pszFileName) - 'A'] != 1828 1830 volser.serial)) { 1829 if (Flesh(hwnd, pci) && 1830 SHORT2FROMMP(mp1) == CN_EXPANDTREE && 1831 !dcd->suspendview && fTopDir) { 1831 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && Flesh(hwnd, pci) 1832 &&!dcd->suspendview && fTopDir) { 1832 1833 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 1833 1834 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); … … 1905 1906 INT x; 1906 1907 1907 Dos WaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT);1908 DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT); 1908 1909 DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 1909 1910 if (fFollowTree) … … 1984 1985 if (!status) { 1985 1986 if (!volser.serial || driveserial[x] != volser.serial) { 1986 UnFlesh(hwnd, pciP);1987 1987 Flesh(hwnd, pciP); 1988 1988 driveserial[x] = volser.serial; … … 1992 1992 MPFROMP(pciP), 1993 1993 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 1994 if (!pciL) 1995 Flesh(hwnd, pciP); 1994 if (!pciL) { 1995 Flesh(hwnd, pciP); 1996 } 1996 1997 if ((fShowFSTypeInTree || fShowDriveLabelInTree) && 1997 1998 strlen(pciP->pszFileName) < 4) { … … 2790 2791 if (pci->flags & RECFLAGS_UNDERENV) 2791 2792 break; 2792 Dos WaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT);2793 DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT); 2793 2794 DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 2794 2795 UnFlesh(hwnd, pci); … … 2802 2803 else if (strlen(pci->pszFileName) < 4) { 2803 2804 SelectDriveIcon(pci); 2804 } 2805 if ((fShowFSTypeInTree || fShowDriveLabelInTree) && 2806 strlen(pci->pszFileName) < 4) { 2807 strcpy(szBuf, pci->pszFileName); 2808 strcat(szBuf, " ["); 2809 strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel); 2810 strcat(szBuf, "]"); 2811 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__); 2812 pci->rc.pszIcon = pci->pszDisplayName; 2813 } 2805 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 2806 strcpy(szBuf, pci->pszFileName); 2807 strcat(szBuf, " ["); 2808 strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel); 2809 strcat(szBuf, "]"); 2810 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__); 2811 pci->rc.pszIcon = pci->pszDisplayName; 2812 } 2813 } 2814 2814 WinSendMsg(hwnd, 2815 2815 CM_INVALIDATERECORD,
Note:
See TracChangeset
for help on using the changeset viewer.