Changeset 1444 for trunk/dll/dircnrs.c


Ignore:
Timestamp:
Jul 23, 2009, 1:24:23 AM (16 years ago)
Author:
Gregg Young
Message:

Rework of drivebar to rescan all drives and refresh media buttons and menu items grey out inappropriate menu items. Streamline Tree scan code and use semaphores to serialize access. Add NOEASUPPORT and LOCALHD driveflag; .LONGNAME usage fixes; (Tickets 377-386)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1439 r1444  
    6565  29 Mar 09 SHL Increase extended search timeout to 3 seconds
    6666  28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
     67  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
     68  22 Jul 09 SHL Cleanup of SETFOCUS code
    6769
    6870***********************************************************************/
     
    805807                            MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    806808          if (!pciC) {
    807             if (fInitialDriveScan)
    808               Stubby(dcd->hwndCnr, pci);
    809             else {
    810               while (StubbyScanCount != 0)
    811                 DosSleep(50);
    812               Stubby(dcd->hwndCnr, pci);
    813             }
     809            Stubby(dcd->hwndCnr, pci);
    814810          }
    815811        }
     
    859855      }
    860856      RemoveCnrItems(dcd->hwndCnr, NULL, 0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE);
    861       AdjustCnrColsForFSType(dcd->hwndCnr, dcd->directory, &dcd->ds);
     857      AdjustCnrColsForFSType(dcd->hwndCnr, dcd->directory, &dcd->ds, FALSE);
    862858      dcd->ullTotalBytes = dcd->totalfiles =
    863859        dcd->selectedfiles = dcd->selectedbytes = 0;
     
    13481344
    13491345  case WM_SETFOCUS:
    1350     /*
    1351      * put name of our window (directory name) on status line
    1352      */
    1353     if (dcd && hwndStatus && mp2) {
    1354 
     1346    /* put name of our window (directory name) on status line */
     1347    if (mp2) {
     1348      // Getting focus
     1349      if (dcd && hwndStatus) {
     1350        /* put name of our window (directory name) on status line */
    13551351      PCNRITEM pci = NULL;
    1356 
    13571352      if (fAutoView && hwndMain) {
    13581353        pci = WinSendMsg(hwnd, CM_QUERYRECORDEMPHASIS, MPFROMLONG(CMA_FIRST),
     
    13741369        PostMsg(hwndMain, UM_ADVISEFOCUS, MPFROMLONG(dcd->hwndFrame), MPVOID);
    13751370    }
    1376     if (mp2) {
     1371
    13771372      LastDir = hwnd;
    13781373      PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     1374
    13791375      if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) {
    13801376        PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
    1381 
    13821377        if (pszTempDir) {
    13831378          if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))
    1384             free(pszTempDir);
     1379            free(pszTempDir);           // Failed
    13851380        }
    13861381      }
     
    14511446                           CM_QUERYRECORDEMPHASIS,
    14521447                           MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED));
    1453           if (pci && (INT) pci != -1) {
     1448          if (pci && (INT) pci != -1) {
    14541449            if (fSplitStatus && hwndStatus2) {
    14551450              CommaFmtULL(tb, sizeof(tb), pci->cbFile + pci->easize, ' ');
     
    16011596        WinEnableMenuItem(DirCnrMenu, IDM_FINDINTREE, (hwndTree != (HWND) 0));
    16021597      }
    1603       PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
     1598      if (!fInitialDriveScan)
     1599        PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
    16041600    }
    16051601    else {
     
    16181614      SayView(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
    16191615                              DIR_VIEW), dcd->flWindowAttr);
    1620       //DbgMsg(pszSrcFile, __LINE__, "UM_SETUP2 %p pci %p", hwnd, dcd);
    16211616    } else
    16221617      PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
     
    24242419
    24252420      case IDM_SWITCH:
    2426         if (mp2) {
     2421        if (mp2) {
    24272422          strcpy(dcd->previous, dcd->directory);
    2428           strcpy(dcd->directory, (CHAR *)mp2);
     2423          strcpy(dcd->directory, (CHAR *)mp2);
    24292424          //DosEnterCritSec(); // GKY 11-27-08
    24302425          dcd->stopflag++;
    2431           //DosExitCritSec();
     2426          //DosExitCritSec();
    24322427          if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    24332428            strcpy(dcd->directory, dcd->previous);
     
    34843479    break;
    34853480
     3481  case WM_TIMER:
     3482    return ActionWMTimer(hwnd, mp1, mp2);
     3483
    34863484  case WM_CLOSE:
    34873485    WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID);
     
    36293627      /* Got match make found item current item */
    36303628      USHORT attrib = CRA_CURSORED;
     3629      // 29 Mar 09 SHL fixme to clear other object select if not extended select
    36313630      if (!stricmp(pci->pszDisplayName, dcd->szCommonName))
    36323631        attrib |= CRA_SELECTED;
Note: See TracChangeset for help on using the changeset viewer.