Changeset 1882 for trunk/dll/treecnr.c


Ignore:
Timestamp:
Oct 12, 2015, 9:59:34 PM (10 years ago)
Author:
Gregg Young
Message:

ExpandAll on a CDROM drive caused directory not found errors. Changed waits so they are longer on removable drives errors are gone performance on hard drives is unchanged.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/treecnr.c

    r1880 r1882  
    795795      INT x = 0;
    796796      BOOL fExpanding = TRUE;
    797 
     797      PCNRITEM pci = (PCNRITEM) mp2;
     798
     799      if (!pci) {
     800        Runtime_Error(pszSrcFile, __LINE__, NULL);
     801        return 0;
     802      }
    798803      dcd->suspendview = TRUE;
    799804      priority_idle();
    800805      if (SHORT1FROMMP(mp1) == IDM_EXPAND) {
    801         fExpandAll = TRUE;
     806        if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_REMOVABLE))
     807          fExpandAll = TRUE;
    802808        while (fExpanding) { // Not serialized not practical to wait on very large directories
    803809          x++;
    804810          if (!IsFleshWorkListEmpty()) {
    805             WaitFleshWorkListEmpty(NULL, 10); // Let it expand
     811            WaitFleshWorkListEmpty(NULL, fExpandAll ? 1 : 50); // Let it expand
    806812          }
    807           fExpanding = ExpandAll(dcd->hwndCnr, x, (PCNRITEM) mp2);
     813          fExpanding = ExpandAll(dcd->hwndCnr, x, pci);
    808814          DosSleep(240);
    809815        }
     
    811817      }
    812818      else
    813         CollapseAll(dcd->hwndCnr, (PCNRITEM) mp2);
     819        CollapseAll(dcd->hwndCnr, pci);
    814820      priority_normal();
    815821      DosSleep(1); // Fixes tree epansion (dir text and icons all placed on
Note: See TracChangeset for help on using the changeset viewer.