Changeset 1863


Ignore:
Timestamp:
Aug 23, 2015, 2:13:48 AM (10 years ago)
Author:
Gregg Young
Message:

Remove recurse scan code; fix A:\ drive not ready error caused by not moving the cursor from drive A:\ fast enough. Have Flesh remove pcis that have NullStr FileNames.

Location:
trunk/dll
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r1856 r1863  
    116116  04 Aug 15 SHL Move StubbyThread to flesh.c
    117117  07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh
     118  22 Aug 15 GKY Remove recurse scan code.
     119  22 Aug 15 GKY Minimize the occurence of an A:\ Drive not ready error by moving the cursor
     120                to the default drive.
    118121
    119122***********************************************************************/
     
    15021505
    15031506  // move cursor onto the default drive rather than the first drive
    1504   if (!fSwitchTreeOnDirChg) {
     1507  pci = (PCNRITEM) WinSendMsg(hwndCnr,
     1508                              CM_QUERYRECORD,
     1509                              MPVOID,
     1510                              MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
     1511  while (pci && (INT)pci != -1) {
     1512    if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulCurDriveNum) {
     1513      WinSendMsg(hwndCnr,
     1514                 CM_SETRECORDEMPHASIS,
     1515                 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED));
     1516      break;
     1517    }
    15051518    pci = (PCNRITEM) WinSendMsg(hwndCnr,
    1506                                 CM_QUERYRECORD,
    1507                                 MPVOID,
    1508                                 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    1509     while (pci && (INT)pci != -1) {
    1510       if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulCurDriveNum) {
    1511         WinSendMsg(hwndCnr,
    1512                    CM_SETRECORDEMPHASIS,
    1513                    MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED));
    1514         break;
    1515       }
    1516       pci = (PCNRITEM) WinSendMsg(hwndCnr,
    1517                                   CM_QUERYRECORD,
    1518                                   MPFROMP(pci),
    1519                                   MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
    1520     }
     1519                                CM_QUERYRECORD,
     1520                                MPFROMP(pci),
     1521                                MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
    15211522  }
    15221523
     
    16161617            ~flags & DRIVE_NOPRESCAN &&
    16171618            (!fNoRemovableScan || ~flags & DRIVE_REMOVABLE)) {
    1618           AddFleshWorkRequest(hwndCnr, pci, eFillDir);
     1619          AddFleshWorkRequest(hwndCnr, pci, eStubby);
    16191620        } // if drive needs to be scanned
    16201621      }
  • trunk/dll/flesh.c

    r1861 r1863  
    249249                              CM_QUERYRECORD,
    250250                              MPFROMP(pciParent),
    251                               MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
     251                              MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    252252
    253253  // 2015-08-06 SHL allow pciL -1
    254254  // 2015-08-06 SHL FIXME to not need pszFileName check
    255   if (!pciL || (INT)pciL == -1 || !*pciL->pszFileName) {
     255  if (!pciL || (INT)pciL == -1 || !*pciL->pszFileName || !strcmp(pciL->pszFileName, NullStr)) {
    256256
    257257    // No children or filename null
     
    287287                     NULL,              // total files
    288288                     NULL);             // total bytes
    289     if (pciParent && pciParent->pszFileName && !(driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_RSCANNED))
    290       driveflags[toupper(*pciParent->pszFileName) - 'A'] |= DRIVE_RSCANNED;
    291289    return TRUE;
    292290  }
     
    786784  }
    787785  c = strlen(((PFLESHWORKITEM)item)->pci->pszFileName);
    788   return strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0;
     786    return strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0;
    789787}
    790788
     
    956954
    957955        if (WinIsWindow((HAB)0, item->hwndCnr)) {
    958 
    959           ULONG flags;
    960 
    961956#if 0 // 2015-08-07 SHL FIXME debug
    962957          // 2015-08-03 SHL FIXME debug
     
    985980            FleshEnv(item->hwndCnr, item->pci);
    986981            break;
    987           case eFillDir:
    988982          case eStubby:
    989983            // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug
    990             flags = driveflags[toupper(*item->pci->pszFileName) - 'A'];
    991 
    992 #if 1
    993             if (item->action == eFillDir) {
    994               // eFillDir maps to eFlesh or eStubby depending on fRScan.. settings
    995               if (((fRScanLocal && flags & DRIVE_LOCALHD) ||
    996                    (fRScanRemote && flags & DRIVE_REMOTE) ||
    997                    (fRScanVirtual && flags & DRIVE_VIRTUAL))  &&
    998                   (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) |
    999                               (fRScanSlow ? 0 : DRIVE_SLOW)))))
    1000               {
    1001                 item->action = eFlesh;
    1002               }
    1003               else
    1004                 item->action = eStubby;
    1005             }
    1006 #else
    1007             wantFlesh = ((fRScanLocal && flags & DRIVE_LOCALHD ) ||
    1008                          (fRScanRemote && flags & DRIVE_REMOTE) ||
    1009                          (fRScanVirtual && flags & DRIVE_VIRTUAL))  &&
    1010                          // 2015-08-11 SHL typo - should not be local or
    1011                         (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) ||
    1012                                     (fRScanSlow ? 0 : DRIVE_SLOW))));
    1013 #endif
    1014             if (item->action == eStubby) {
    1015               Stubby(item->hwndCnr, item->pci);
    1016               break;
    1017             }
    1018             // Drop through to eFlesh
    1019 
     984            Stubby(item->hwndCnr, item->pci);
     985            break;
    1020986          case eFlesh:
    1021987            if (Flesh(item->hwndCnr, item->pci)) {
  • trunk/dll/flesh.h

    r1860 r1863  
    1111  07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh
    1212  19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items
     13  22 Aug 15 GKY Remove recurse scan code.
    1314
    1415***********************************************************************/
     
    1920BOOL StartFleshWorkThread(VOID);
    2021
    21 typedef enum {eStubby, eFlesh, eFleshEnv, eUnFlesh, eFillDir} FLESHWORKACTION;
     22typedef enum {eStubby, eFlesh, eFleshEnv, eUnFlesh} FLESHWORKACTION;
    2223
    2324BOOL IsFleshWorkListEmpty();
  • trunk/dll/fm3dlg.h

    r1778 r1863  
    4848  09 Feb 14 GKY Fix separate parameters. Moved to general page renamed separate settings
    4949                for apps.
     50  22 Aug 15 GKY Remove recurse scan code.
    5051
    5152***********************************************************************/
     
    746747#define CFGS_NOREMOVABLESCAN                                                            25368
    747748#define CFGS_FILESTOGET                                                                 25369
    748 #define CFGS_RSCANLOCAL                                                                 25370
    749 #define CFGS_RSCANREMOTE                                                                25371
    750 #define CFGS_RSCANVIRTUAL                                                               25372
    751 #define CFGS_RSCANSLOW                                                                  25373
    752 #define CFGS_RSCANNOWRITE                                                               25374
    753749#define CFGS_EJECTREMOVABLESCAN                                                         25375
    754750#define CFGS_EJECTCDSCAN                                                                25376
     
    950946#define DVS_RAMDISK                                                                     27018
    951947#define DVS_WRITEVERIFYOFF                                                              27019
    952 #define DVS_RSCANNED                                                                    27020
    953948#define DVS_LOCALHD                                                                     27021
    954949#define DVS_NOEASUPPORT                                                                 27022
  • trunk/dll/fm3res.dlg

    r1778 r1863  
    6060  09 Feb 14 GKY Fix separate parameters. Moved to general page renamed separate settings
    6161                for apps.
     62  22 Aug 15 GKY Remove recurse scan code.
    6263 
    6364***********************************************************************/
     
    20002001                        SPBS_NUMERICONLY | SPBS_MASTER | SPBS_SERVANT |
    20012002                        SPBS_JUSTCENTER | WS_TABSTOP | SPBS_FASTSPIN |
    2002                         WS_VISIBLE
    2003         GROUPBOX        "Recurse scan at startup:", -1, 130, 65, 166, 70, NOT WS_GROUP
    2004         AUTOCHECKBOX    "Local hard drives", CFGS_RSCANLOCAL, 136, 116, 106, 10
    2005         AUTOCHECKBOX    "Remote drives", CFGS_RSCANREMOTE, 136, 104, 106, 10
    2006         AUTOCHECKBOX    "Virtual drives", CFGS_RSCANVIRTUAL, 136, 92, 106, 10
    2007         AUTOCHECKBOX    "Slow drives of drive types selected", CFGS_RSCANSLOW,
    2008                         142, 80, 136, 10
    2009         AUTOCHECKBOX    "Read only drives of drive types selected", CFGS_RSCANNOWRITE,
    2010                         142, 68, 136, 10
     2003                        WS_VISIBLE         
    20112004        GROUPBOX        "Drive tree rescan on media eject from:", -1, 130, 16, 166, 45, NOT WS_GROUP
    20122005        AUTOCHECKBOX    "Removable drives", CFGS_EJECTREMOVABLESCAN, 136, 44, 106, 10
     
    21492142                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    21502143        CHECKBOX        "Invalid", DVS_INVALID, 4, 34, 94, 10,
    2151                         BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    2152                         PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
    2153         CHECKBOX        "Recursive scan done", DVS_RSCANNED, 4, 22, 94, 10,
    21542144                        BS_NOPOINTERFOCUS | NOT WS_TABSTOP
    21552145                        PRESPARAMS PP_FOREGROUNDCOLOR, 0x00808080L
  • trunk/dll/info.c

    r1749 r1863  
    3939                causing an error message from DefaultView
    4040  28 Apr 14 JBS Ticket #522: Ensure use of wrapper functions where needed
     41  22 Aug 15 GKY Remove recurse scan code.
    4142
    4243***********************************************************************/
     
    984985      WinCheckButton(hwnd,DVS_WRITEVERIFYOFF,
    985986                     ((driveflags[drive] & DRIVE_WRITEVERIFYOFF) != 0));
    986       WinCheckButton(hwnd,DVS_RSCANNED,
    987                      ((driveflags[drive] & DRIVE_RSCANNED) != 0));
    988987      WinCheckButton(hwnd,DVS_LOCALHD,
    989988                     ((driveflags[drive] & DRIVE_LOCALHD) != 0));
  • trunk/dll/init.c

    r1860 r1863  
    137137  19 Aug 15 SHL Delete obsoletes
    138138  20 Aug 15 SHL Support PCSZ_DOS...SEM
     139  22 Aug 15 GKY Remove recurse scan code.
    139140
    140141***********************************************************************/
     
    12091210    fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget =
    12101211    fShowTarget = fDrivebarHelp = fCheckMM = fInitialDriveScan =
    1211     fEjectRemovableScan = fRScanLocal = TRUE;
     1212    fEjectRemovableScan = TRUE;
    12121213  ulCnrType = CCS_EXTENDSEL;
    12131214  FilesToGet = FILESTOGET_MAX;
     
    16101611  PrfQueryProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, &size);
    16111612  size = sizeof(BOOL);
    1612   PrfQueryProfileData(fmprof, appname, "RScanLocal", &fRScanLocal, &size);
    1613   size = sizeof(BOOL);
    1614   PrfQueryProfileData(fmprof, appname, "RScanRemote", &fRScanRemote, &size);
    1615   size = sizeof(BOOL);
    1616   PrfQueryProfileData(fmprof, appname, "RScanVirtual", &fRScanVirtual, &size);
    1617   size = sizeof(BOOL);
    1618   PrfQueryProfileData(fmprof, appname, "RScanSlow", &fRScanSlow, &size);
    1619   size = sizeof(BOOL);
    1620   PrfQueryProfileData(fmprof, appname, "RScanNoWrite", &fRScanNoWrite, &size);
    1621   size = sizeof(BOOL);
    16221613  PrfQueryProfileData(fmprof, appname, "EjectRemovableScan", &fEjectRemovableScan, &size);
    16231614  size = sizeof(BOOL);
     
    16621653  // 2015-08-11 SHL FIXME debug
    16631654  DbgMsg(pszSrcFile, __LINE__, "ShowEnv %u SwitchTree %u SwitchTreeExpand %u SwitchTreeOnFocus %u CollapseFirst %u", fShowEnv, fSwitchTreeOnDirChg, fSwitchTreeExpand, fSwitchTreeOnFocus, fCollapseFirst);
    1664   DbgMsg(pszSrcFile, __LINE__, "RScanLocal %u RScanRemote %u RScanVirtual %u RScanSlow RScanNoWrite %u", fRScanLocal, fRScanRemote, fRScanVirtual, fRScanSlow, fRScanNoWrite);
    1665 
     1655 
    16661656  LoadDetailsSwitches(PCSZ_DIRCNR, &dsDirCnrDefault, FALSE);
    16671657
  • trunk/dll/notebook.c

    r1844 r1863  
    6868  25 May 15 GKY Auto open help only on first access of quick setting page during a session.
    6969  09 Aug 15 SHL Use RESTORE_STATE_...
     70  22 Aug 15 GKY Remove recurse scan code.
    7071
    7172***********************************************************************/
     
    167168BOOL fRealIdle;
    168169BOOL fRemoteBug;
    169 BOOL fRScanLocal;
    170 BOOL fRScanRemote;
    171 BOOL fRScanVirtual;
    172 BOOL fRScanSlow;
    173 BOOL fRScanNoWrite;
    174170BOOL fSaveState;
    175171BOOL fShowDriveOnly;
     
    508504    WinCheckButton(hwnd, CFGS_REMOTEBUG, fRemoteBug);
    509505    WinCheckButton(hwnd, CFGS_NOREMOVABLESCAN, fNoRemovableScan);
    510     WinCheckButton(hwnd, CFGS_RSCANLOCAL, fRScanLocal);
    511     WinCheckButton(hwnd, CFGS_RSCANREMOTE, fRScanRemote);
    512     WinCheckButton(hwnd, CFGS_RSCANVIRTUAL, fRScanVirtual);
    513     WinCheckButton(hwnd, CFGS_RSCANSLOW, fRScanSlow);
    514     WinCheckButton(hwnd, CFGS_RSCANNOWRITE, fRScanNoWrite);
    515506    WinCheckButton(hwnd, CFGS_EJECTREMOVABLESCAN, fEjectRemovableScan);
    516507    WinCheckButton(hwnd, CFGS_EJECTCDSCAN, fEjectCDScan);
     
    573564    fRemoteBug = WinQueryButtonCheckstate(hwnd, CFGS_REMOTEBUG);
    574565    PrfWriteProfileData(fmprof, appname, "RemoteBug", &fRemoteBug,
    575                         sizeof(BOOL));
    576     fRScanLocal = WinQueryButtonCheckstate(hwnd, CFGS_RSCANLOCAL);
    577     PrfWriteProfileData(fmprof, appname, "RScanLocal", &fRScanLocal,
    578                         sizeof(BOOL));
    579     fRScanRemote = WinQueryButtonCheckstate(hwnd, CFGS_RSCANREMOTE);
    580     PrfWriteProfileData(fmprof, appname, "RScanRemote", &fRScanRemote,
    581                         sizeof(BOOL));
    582     fRScanVirtual = WinQueryButtonCheckstate(hwnd, CFGS_RSCANVIRTUAL);
    583     PrfWriteProfileData(fmprof, appname, "RScanVirtual", &fRScanVirtual,
    584                         sizeof(BOOL));
    585     fRScanSlow = WinQueryButtonCheckstate(hwnd, CFGS_RSCANSLOW);
    586     PrfWriteProfileData(fmprof, appname, "RScanSlow", &fRScanSlow,
    587                         sizeof(BOOL));
    588     fRScanNoWrite = WinQueryButtonCheckstate(hwnd, CFGS_RSCANNOWRITE);
    589     PrfWriteProfileData(fmprof, appname, "RScanNoWrite", &fRScanNoWrite,
    590566                        sizeof(BOOL));
    591567    fNoRemovableScan = WinQueryButtonCheckstate(hwnd, CFGS_NOREMOVABLESCAN);
     
    31753151      fForceLower = FALSE;
    31763152      fEjectRemovableScan = FALSE;
    3177       fRScanLocal = FALSE;
    31783153      dsDirCnrDefault.detailslongname = FALSE;
    31793154      dsDirCnrDefault.detailssubject = FALSE;
     
    33543329      fDrivebarHelp = TRUE;
    33553330      fShowTarget = TRUE;
    3356       fRScanLocal = TRUE;
    3357       fRScanRemote = FALSE;
    3358       fRScanVirtual = FALSE;
    3359       fRScanSlow = FALSE;
    3360       fRScanNoWrite = FALSE;
    33613331      fEjectRemovableScan = TRUE;
    33623332      fEjectCDScan = FALSE;
     
    36703640      fDrivebarHelp = TRUE;
    36713641      fShowTarget = TRUE;
    3672       fRScanLocal = TRUE;
    3673       fRScanRemote = TRUE;
    3674       fRScanVirtual = FALSE;
    3675       fRScanSlow = FALSE;
    3676       fRScanNoWrite = FALSE;
    36773642      fEjectRemovableScan = TRUE;
    36783643      fEjectCDScan = TRUE;
  • trunk/dll/notebook.h

    r1778 r1863  
    2020  09 Feb 14 GKY Fix separate parameters. Moved to general page renamed separate settings
    2121                for apps.
     22  22 Aug 15 GKY Remove recurse scan code.
    2223
    2324***********************************************************************/
     
    8788extern BOOL fRealIdle;
    8889extern BOOL fRemoteBug;
    89 extern BOOL fRScanLocal;
    90 extern BOOL fRScanRemote;
    91 extern BOOL fRScanVirtual;
    92 extern BOOL fRScanSlow;
    9390extern BOOL fRScanNoWrite;
    9491extern BOOL fSaveState;
  • trunk/dll/worker.c

    r1859 r1863  
    7070  12 Aug 15 JBS Ticket #522: Ensure no "highmem-unsafe" functions are called directly
    7171                Calls to unsafe Dos... functions have been changed to call the wrapped xDos... functions
     72  22 Aug 15 GKY Remove recurse scan code.
    7273
    7374***********************************************************************/
     
    994995                                GetPString(IDS_TOTEXT), newname);
    995996                      }
    996                       if (!strcmp(realappname, "FM/4") ||
    997                           ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
     997                      if (!strcmp(realappname, "FM/4") &&
    998998                          AddToList(wk->li->list[x],
    999                                     &files, &cFilesModified, &cItemsAllocated)))
     999                                    &files, &cFilesModified, &cItemsAllocated))
    10001000                        Broadcast(hab2,
    10011001                                  wk->li->type == IDM_RENAME ? wk->hwndParent : wk->hwndCnr,
    10021002                                  UM_UPDATERECORD,
    10031003                                  MPFROMP(wk->li->list[x]), MPVOID);
    1004                       if (!strcmp(realappname, "FM/4") ||
    1005                           (driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
     1004                      if (!strcmp(realappname, "FM/4") &&
    10061005                          AddToList(newname, &files, &cFilesModified, &cItemsAllocated))
    10071006                        Broadcast(hab2,
Note: See TracChangeset for help on using the changeset viewer.