Changeset 1876 for trunk/dll/treecnr.c
- Timestamp:
- Oct 11, 2015, 1:42:28 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/treecnr.c
r1875 r1876 120 120 to avoid them seen as directories and having random subdirectories attached to 121 121 them. 122 10 Oct 15 GKY Eliminate some unnecessary Flesh and UnFlesh calls 123 10 Oct 15 GKY Update icon and display name on CD/DVD eject in all cases. 124 10 Oct 15 GKY Don't use Flesh thread for floppy drive scans fix them getting mistakenly identified 125 as directories and add nonexistent subdirectories. 122 126 123 127 ***********************************************************************/ … … 868 872 { 869 873 PCNRITEM pci = (PCNRITEM) mp1; 870 PCNRITEM pciL;871 874 872 875 if (pci) { 873 pciL = (PCNRITEM)WinSendMsg(dcd->hwndCnr,874 CM_QUERYRECORD,875 MPFROMP(pci),876 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));877 if (pciL && (INT) pciL != -1) {878 WaitFleshWorkListEmpty(NULL, 10); // 2015-08-13 SHL in case pci still in work list879 AddFleshWorkRequest(hwnd, pci, eUnFlesh);876 if ((INT) mp2 == 21 && pci->rc.hptrIcon == hptrCDROM) { 877 if (fEjectCDScan) 878 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 879 else { 880 driveflags[toupper(*pci->pszFileName) - 'A'] |= DRIVE_INVALID; 881 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 882 } 880 883 } 881 if ((INT) mp2 == 21 && pci->rc.hptrIcon == hptrCDROM)882 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);883 884 NotifyError(pci->pszFileName, (ULONG) mp2); 884 885 } … … 935 936 if (cnri.cRecords) { 936 937 sprintf(s, GetPString(IDS_NUMDRIVESTEXT), cnri.cRecords); 937 if (pci && (INT) pci != -1 && pci->pszFileName != NullStr) { //fixme? will try checking pci->pszFileName instead of the pointer938 if (pci && (INT) pci != -1) { 938 939 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 939 940 DRIVE_REMOVABLE) || … … 1004 1005 } 1005 1006 else { 1006 PCNRITEM pciL;1007 1007 // find root record and strip it if needed 1008 1008 pci = FindParentRecord(dcd->hwndCnr, pci); 1009 1009 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 1010 pciL = (PCNRITEM)WinSendMsg(dcd->hwndCnr, 1011 CM_QUERYRECORD, 1012 MPFROMP(pci), 1013 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 1014 if (pciL && (INT) pciL != -1) { 1010 if (pci->fleshed) { 1015 1011 WaitFleshWorkListEmpty(pci->pszFileName, 240); // 2015-08-19 SHL in case pci still in work list 1016 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 1012 if ((toupper(*pci->pszFileName) - 'A') > 1) { 1013 DbgMsg(pszSrcFile, __LINE__,"UM_RESCAN2 UnFlesh %s", pci->pszFileName); 1014 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 1015 } 1016 else 1017 UnFlesh(hwnd, pci); 1017 1018 } 1018 1019 } … … 1403 1404 } 1404 1405 } 1405 //DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_RESCAN PostMsg(UM_RESCAN2, %p %s)",1406 // pci, pci && pci->pszFileName ? pci->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug1407 1406 PostMsg(dcd->hwndObject, UM_RESCAN2, MPFROMP(pci), MPVOID); 1408 1407 if (hwndStatus2) … … 1410 1409 } 1411 1410 return 0; 1412 #if 0 1413 case UM_SETUP2: 1414 { 1415 PCNRITEM pci = (PCNRITEM) mp1; 1416 1417 if (pci) { 1418 WaitFleshWorkListEmpty(NULL, 10); // 2015-08-13 SHL in case pci still in work list 1419 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 1420 if ((INT) mp2 == 21) 1421 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 1422 NotifyError(pci->pszFileName, (ULONG) mp2); 1423 } 1424 } 1425 return 0; 1426 #endif 1411 1427 1412 case UM_SETUP: 1428 1413 # ifdef FORTIFY … … 2020 2005 HDIR hDir = HDIR_CREATE; 2021 2006 ULONG nm = 1; 2022 // APIRET status;2023 2007 BOOL IsOk = FALSE; 2024 2008 ULONG ulDriveNum, ulDriveMap; … … 2105 2089 driveserial[x] = volser.serial; 2106 2090 } 2107 pciL = WinSendMsg(hwnd, 2108 CM_QUERYRECORD, 2109 MPFROMP(pciP), 2110 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 2111 if (!pciL) { 2091 if (!pciP->fleshed) { 2112 2092 AddFleshWorkRequest(hwnd, pciP, eFlesh); // forceFlesh 2113 2093 } … … 2453 2433 case UM_DRIVECMD: 2454 2434 if (mp1) { 2455 //DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_DRIVECMD ShowTreeRec(\"%s\")", mp1);2435 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_DRIVECMD ShowTreeRec(\"%s\")", mp1); 2456 2436 ShowTreeRec(hwnd, (CHAR *)mp1, FALSE, TRUE); 2457 //DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc PostMsg(IDM_UPDATE)");2437 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc PostMsg(IDM_UPDATE)"); 2458 2438 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 2459 2439 } … … 2920 2900 if (pci->flags & RECFLAGS_UNDERENV) 2921 2901 break; 2922 2923 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2902 if (pci->fleshed) { 2903 if (x > 1) { 2904 DbgMsg(pszSrcFile, __LINE__,"UM_UPDATE UnFlesh %s", pci->pszFileName); 2905 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2906 } 2907 else 2908 UnFlesh(hwnd, pci); 2909 } 2924 2910 2925 2911 // Check if drive type might need update 2926 2912 if ((driveflag & (DRIVE_INVALID | DRIVE_NOPRESCAN)) || 2927 (~driveflag & DRIVE_NOPRESCAN && pci->rc.hptrIcon == hptrDunno) || x < 2) {2913 (~driveflag & DRIVE_NOPRESCAN && pci->rc.hptrIcon == hptrDunno)) { 2928 2914 DriveFlagsOne(x, FileSystem, &volser); 2929 2915 driveflag = driveflags[x]; 2930 if (driveflag & DRIVE_INVALID) 2931 pci->rc.hptrIcon = hptrDunno; 2916 if (driveflag & DRIVE_INVALID) 2917 if (driveflag & DRIVE_REMOVABLE) { 2918 pci->rc.hptrIcon = hptrRemovable; 2919 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 2920 strcpy(szBuf, pci->pszFileName); 2921 strcat(szBuf, " ["); 2922 strcat(szBuf, "]"); 2923 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__); 2924 pci->rc.pszIcon = pci->pszDisplayName; 2925 } 2926 } 2927 else 2928 pci->rc.hptrIcon = hptrDunno; 2932 2929 else if (strlen(pci->pszFileName) < 4) { 2933 2930 SelectDriveIcon(pci); … … 2947 2944 if (hwndMain) 2948 2945 PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID); 2949 } 2950 DbgMsg(pszSrcFile, __LINE__, " TreeCnrWndProc IDM_UPDATE %s", pci->pszFileName); // 2015-08-03 SHL FIXME debug 2951 if (~driveflag & DRIVE_INVALID || x < 2) 2952 AddFleshWorkRequest(hwnd, pci, eFlesh); 2946 } 2947 if (~driveflag & DRIVE_INVALID) { 2948 if (x > 1) { 2949 // Note the UnFlesh above may not have completed when this is called 2950 // We need to keep it behind the UnFlesh in line 2951 AddFleshWorkRequest(hwnd, pci, eFlesh); 2952 } 2953 else 2954 Flesh(hwnd, pci); 2955 } 2953 2956 } 2954 2957 } … … 3484 3487 volser.serial) 3485 3488 { 3486 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3487 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 3489 if (pci->fleshed) { 3490 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3491 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 3492 } 3488 3493 } 3489 3494 if (qmsg.msg != UM_COLLAPSETREE || … … 3501 3506 else { 3502 3507 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 3503 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3504 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 3508 if (pci->fleshed) { 3509 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3510 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 3511 } 3505 3512 PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID); 3506 3513 if (!fAlertBeepOff)
Note:
See TracChangeset
for help on using the changeset viewer.