Changeset 1856 for trunk/dll/dircnrs.c
- Timestamp:
- Aug 18, 2015, 7:12:52 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/dll/dircnrs.c (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dircnrs.c
r1838 r1856 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 201 0Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 16 Oct 02 SHL Handle large partitions … … 85 85 22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories. 86 86 02 Mar 14 GKY Speed up intial drive scans Ticket 528 87 26 Jun 14 SHL Rework DirObjWndProc UM_RESCAN to avoid hanging FM/2 Lite when tree hidden87 26 Jun 14 SHL Rework DirObjWndProc UM_RESCAN to avoid hanging FM/2 Lite when tree hidden 88 88 30 Aug 14 GKY Add semaphore hmtxFiltering to prevent freeing dcd while filtering. Prevents 89 89 a trap when FM2 is shutdown while directory containers are still populating … … 92 92 02 Aug 15 GKY Remove unneed SubbyScan code and improve suppression of blank lines and 93 93 duplicate subdirectory name caused by running Stubby in worker threads. 94 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 94 95 95 96 ***********************************************************************/ … … 139 140 // SpecialSelect2 140 141 #include "dirsize.h" // DirSizeProc 141 #include "flesh.h" // Flesh, Stubby, UnFlesh142 #include "flesh.h" // AddFleshWorkRequest 142 143 #include "valid.h" // IsValidDir 143 144 #include "objwin.h" // MakeObjWin … … 766 767 # ifdef FORTIFY 767 768 Fortify_BecomeOwner(dcd); // We free dcd 768 if (GetTidForThread() != 1)769 Fortify_ChangeScope(dcd, -1);769 if (GetTidForThread()) 770 Fortify_ChangeScope(dcd, -1); 770 771 # endif 771 772 // set unique id … … 779 780 # ifdef FORTIFY 780 781 // TID 1 will free data 781 if (GetTidForThread() != 1)782 if (GetTidForThread()) 782 783 Fortify_LeaveScope(); 783 784 # endif … … 844 845 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 845 846 if (!pciC) { 846 Stubby(dcd->hwndCnr, pci);847 AddFleshWorkRequest(dcd->hwndCnr, pci, eStubby); 847 848 } 848 849 } … … 899 900 // 2014-06-26 SHL FM/2 Lite may not have drive tree yet 900 901 if (hwndTree) { 902 // 2015-08-12 SHL Optimze to update drive tree for only last saved state 903 904 // 2015-08-13 SHL 905 if (fSwitchTreeOnDirChg) 906 DbgMsg(pszSrcFile, __LINE__, "DirObjWndProc UM_RESCAN cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug 907 901 908 if (fSwitchTreeOnDirChg) { 902 909 // Keep drive tree in sync with directory container 903 910 PSZ pszTempDir; 911 #if 0 // 2015-08-12 SHL FIXME to be gone fInitialDriveScan 904 912 while (fInitialDriveScan) 905 DosSleep(10); // Allow to complete 906 DosSleep(50); 913 DosSleep(500); // Allow to complete 914 DosSleep(200); // Allow to complete 915 #endif 907 916 pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 908 917 if (pszTempDir) { 909 918 if (hwndMain) { 910 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame) 919 if (TopWindow(hwndMain, (HWND)0) == dcd->hwndFrame) { 920 DbgMsg(pszSrcFile, __LINE__, "DirObjWndProc UM_RESCAN PostMsg(UM_SHOWME)"); // 2015-08-04 SHL FIXME debug 911 921 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 912 922 free(pszTempDir); 923 } 913 924 } 914 925 else { 926 DbgMsg(pszSrcFile, __LINE__, "DirObjWndProc UM_RESCAN PostMsg(UM_SHOWME)"); // 2015-08-04 SHL FIXME debug 915 927 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 916 928 free(pszTempDir); … … 1229 1241 0, 1230 1242 0, 1231 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);1243 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER); 1232 1244 FreeList(dcd->lastselection); 1233 1245 WinSetWindowPtr(dcd->hwndCnr, QWL_USER, NULL); // 13 Apr 10 SHL Set NULL before freeing dcd … … 1421 1433 LastDir = hwnd; 1422 1434 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1435 // 2015-08-13 SHL 1423 1436 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) { 1424 1437 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1438 DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc WM_SETFOCUS cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug 1425 1439 if (pszTempDir) { 1440 DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc WM_SETFOCUS PostMsg(UM_SHOWME, %s)", pszTempDir); // 2015-08-04 SHL FIXME debug 1426 1441 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 1427 1442 free(pszTempDir); // Failed … … 1490 1505 cnri.pszCnrTitle = dcd->directory; 1491 1506 WinSendMsg(hwnd, 1492 CM_SETCNRINFO, MPFROMP(&cnri), MPFROMLONG(CMA_CNRTITLE));1507 CM_SETCNRINFO, MPFROMP(&cnri), MPFROMLONG(CMA_CNRTITLE)); 1493 1508 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 1494 1509 dcd->totalfiles = cnri.cRecords; … … 1569 1584 WinSendMsg(hwnd, 1570 1585 CM_QUERYCNRINFO, 1571 MPFROMP(&cnri), MPFROMLONG(sizeof(CNRINFO)));1586 MPFROMP(&cnri), MPFROMLONG(sizeof(CNRINFO))); 1572 1587 cnri.pSortRecord = (PVOID) SortDirCnr; 1573 1588 WinSendMsg(hwnd, … … 1596 1611 cnri.flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT)); 1597 1612 cnri.flWindowAttr |= (CV_NAME | CA_DETAILSVIEWTITLES | CV_MINI | 1598 CV_FLOW);1613 CV_FLOW); 1599 1614 cnri.pSortRecord = (PVOID) SortDirCnr; 1600 1615 … … 1653 1668 WinEnableMenuItem(DirCnrMenu, IDM_FINDINTREE, (hwndTree != (HWND) 0)); 1654 1669 } 1655 // 2014-06-11 SHL fm/2 lite can get here before drive scan completes 1656 //if (!fInitialDriveScan) // 2014-08-30 GKY This doesn't seem to be needed 1657 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 1670 // 2014-06-11 SHL fm/2 lite can get here before drive scan completes - may not be true anymore 1671 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 1658 1672 } 1659 1673 else { … … 1963 1977 1964 1978 if (pszTempDir) { 1979 DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc IDM_FINDINTREE PostMsg(UM_SHOWME)"); // 2015-08-04 SHL FIXME debug 1965 1980 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), 1966 1981 MPFROMLONG(1L))) … … 2128 2143 dcd->sortFlags |= SORT_REVERSE; 2129 2144 break; 2130 }2145 } 2131 2146 WinSendMsg(hwnd, CM_SORTRECORD, MPFROMP(SortDirCnr), 2132 2147 MPFROMLONG(dcd->sortFlags)); … … 2728 2743 case IDM_PRINT: 2729 2744 case IDM_SHADOW: 2730 case IDM_SHADOW2:2731 case IDM_JAVAEXE:2745 case IDM_SHADOW2: 2746 case IDM_JAVAEXE: 2732 2747 case IDM_OBJECT: 2733 2748 case IDM_VIEW: … … 2847 2862 DosBeep(250,100); 2848 2863 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 2849 UnFlesh(hwnd, pci);2864 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2850 2865 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2851 2866 } … … 2855 2870 driveserial[toupper(*pci->pszFileName) - 'A'] != 2856 2871 volser.serial) 2857 UnFlesh(hwnd, pci);2872 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2858 2873 if (SHORT2FROMMP(mp1) != CN_COLLAPSETREE || 2859 2874 (!volser.serial || 2860 2875 driveserial[toupper(*pci->pszFileName) - 'A'] != 2861 2876 volser.serial)) { 2862 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && Flesh(hwnd, pci) && 2877 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2878 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && AddFleshWorkRequest(hwnd, pci, eFlesh) && 2863 2879 !dcd->suspendview && fTopDir ) { 2864 2880 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); … … 2870 2886 } 2871 2887 else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) { 2872 if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir) { 2888 if (AddFleshWorkRequest(hwnd, pci, eFlesh) && !dcd->suspendview && fTopDir) { 2889 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2873 2890 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 2874 2891 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); … … 3275 3292 else { 3276 3293 3277 MRESULT mre;3278 3279 mre = CnrDirectEdit(hwnd, msg, mp1, mp2);3294 MRESULT mre; 3295 3296 mre = CnrDirectEdit(hwnd, msg, mp1, mp2); 3280 3297 if (mre != (MRESULT) - 1) 3281 3298 return mre; … … 3530 3547 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); 3531 3548 if (LastDir == hwnd) 3532 LastDir = (HWND) 0;3549 LastDir = (HWND) 0; 3533 3550 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 3534 3551 if (dcd) { … … 3549 3566 0, 3550 3567 0, 3551 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);3568 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER); 3552 3569 FreeList(dcd->lastselection); 3553 3570 WinSetWindowPtr(hwnd, QWL_USER, NULL); … … 3821 3838 Win_Error(hwndClient, hwndClient, pszSrcFile, __LINE__, 3822 3839 PCSZ_WINCREATEWINDOW); 3823 PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);3824 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);3825 free(dcd);3826 DosReleaseMutexSem(hmtxFiltering);3840 PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID); 3841 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 3842 free(dcd); 3843 DosReleaseMutexSem(hmtxFiltering); 3827 3844 hwndFrame = (HWND) 0; 3828 3845 }
Note:
See TracChangeset
for help on using the changeset viewer.
