Changeset 1439 for trunk/dll/treecnr.c


Ignore:
Timestamp:
Jul 12, 2009, 11:57:04 PM (16 years ago)
Author:
Gregg Young
Message:

Changes to allow high mem loading of dll; Refactor .LONGNAME and .SUBJECT EA fetch to FetchCommonEAs. Add szFSType to FillInRecordFromFSA use to bypass EA scan and size formatting for tree container; Fix labels/FS type to work on scan on NOPRESCAN Drives; Fixed dbl directory names on restore of dir cnrs; (Tickets 47, 339, 363, 368, 369, 370)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/treecnr.c

    r1438 r1439  
    7070  07 Jun 09 GKY Fixed double names in tree container when collapsed tree is accessed
    7171                before recursive scan
     72  12 Jul 09 GKY Add option to show file system type or drive label in tree
     73                (get NOPRESCAN drives working)
     74
    7275***********************************************************************/
    7376
     
    274277        if (!stricmp(dirname, pciP->pszFileName))
    275278          break;                        // Found it
    276         if (~pciP->rc.flRecordAttr & CRA_EXPANDED) {
    277           if (!(driveflags[toupper(*pciP->pszFileName) - 'A'] & DRIVE_RSCANNED)) {
    278             WinSendMsg(hwndCnr, UM_RESCAN, MPFROMP(pciP), MPVOID);
    279             WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    280           }
    281           else
    282             WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    283         }
     279        if (~pciP->rc.flRecordAttr & CRA_EXPANDED)
     280          WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    284281        strcpy(szDir, dirname);
    285282        if (p - szDir >= strlen(szDir))
     
    336333                          MPFROM2SHORT(CMA_PARENT, CMA_ITEMORDER));
    337334        if (pciP && (INT) pciP != -1) {
    338           if (!(pciP->rc.flRecordAttr & CRA_EXPANDED)) {
    339             if (!(driveflags[toupper(*pciP->pszFileName) - 'A'] & DRIVE_RSCANNED)) {
    340               WinSendMsg(hwndCnr, UM_RESCAN, MPFROMP(pciP), MPVOID);
    341               WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    342             }
    343             else
    344               WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    345           }
     335          if (!(pciP->rc.flRecordAttr & CRA_EXPANDED))
     336            WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    346337          pciToSelect = pciP;
    347338        }
     
    358349        ShowCnrRecord(hwndCnr, (PMINIRECORDCORE) pciToSelect);
    359350      }
    360       if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED) {
    361         if (!(driveflags[toupper(*pciToSelect->pszFileName) - 'A'] & DRIVE_RSCANNED)) {
    362           WinSendMsg(hwndCnr, UM_RESCAN, MPFROMP(pciToSelect), MPVOID);
    363           WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
    364         }
    365         else
    366           WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
    367       }
     351      if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED)
     352        WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
    368353      if (!quickbail) {
    369354        WinSendMsg(hwndCnr,
     
    375360  }
    376361  WinEnableWindowUpdate(hwndCnr, TRUE);
    377   //DosSleep(1);                        // Let GUI update
    378362}
    379363
     
    18291813                  if (Flesh(hwnd, pci) &&
    18301814                      SHORT2FROMMP(mp1) == CN_EXPANDTREE &&
    1831                       !dcd->suspendview && fTopDir)
    1832                     PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID);
     1815                      !dcd->suspendview && fTopDir) {
     1816                    PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID);
     1817                    //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci);
     1818                  }
    18331819                }
    18341820                driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial;
     
    18431829            }
    18441830            else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) {
    1845               if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir)
    1846                 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID);
    1847             }
    1848             if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && !dcd->suspendview)
    1849               WinSendMsg(hwnd, UM_FILTER, MPVOID, MPVOID);
     1831              if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir){
     1832                PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID);
     1833                //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci);
     1834              }
     1835            }
     1836            if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && !dcd->suspendview){
     1837              WinSendMsg(hwnd, UM_FILTER, MPVOID, MPVOID);
     1838              //DbgMsg(pszSrcFile, __LINE__, "UM_FILTER %p pci %p", hwnd, pci);
     1839            }
    18501840          }
    18511841        }
     
    19421932            CHAR volumelabel[CCHMAXPATH];
    19431933          }
    1944           volser;
     1934          volser;
     1935          CHAR FileSystem[CCHMAXPATH];
     1936          CHAR szBuf[CCHMAXPATH];
    19451937
    19461938          pciL = pciP = pci;
     
    19651957            INT removable, x = (INT) (toupper(*pci->pszFileName) - 'A');
    19661958            ULONG drvtype;
    1967             CHAR FileSystem[CCHMAXPATH];
    19681959
    19691960            DosError(FERR_DISABLEHARDERR);
     
    20081999                driveflags[x] |= DRIVE_NOLONGNAMES;
    20092000              }
    2010               SelectDriveIcon(pciP);
    2011               WinSendMsg(hwnd,
    2012                          CM_INVALIDATERECORD,
    2013                          MPFROMP(&pciP),
    2014                          MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION));
     2001              SelectDriveIcon(pciP);
    20152002              if (hwndMain)
    20162003                PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID);
     
    20222009                                  FSIL_VOLSER, &volser,
    20232010                                  (ULONG) sizeof(volser));
    2024           if (!status) {
     2011          if (!status) {
    20252012            if (!volser.serial ||
    20262013                driveserial[toupper(*pci->pszFileName) - 'A'] !=
     
    20362023            if (!pciL)
    20372024              Flesh(hwnd, pciP);
    2038           }
     2025            if (fShowFSTypeInTree) {
     2026              strcpy(szBuf, pciP->pszFileName);
     2027              strcat(szBuf, " [");
     2028              strcat(szBuf, FileSystem);
     2029              strcat(szBuf, "]");
     2030              pciP->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);
     2031              }
     2032            else if (fShowDriveLabelInTree) {
     2033              strcpy(szBuf, pciP->pszFileName);
     2034              strcat(szBuf, " [");
     2035              strcat(szBuf, volser.volumelabel);
     2036              strcat(szBuf, "]");
     2037              pciP->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);
     2038            }
     2039            pciP->rc.pszIcon = pciP->pszDisplayName;
     2040            WinSendMsg(hwnd,
     2041                       CM_INVALIDATERECORD,
     2042                       MPFROMP(&pciP),
     2043                       MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION));
     2044          }
    20392045          else {
    20402046            driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
     
    23562362      dcd->suspendview = tempsusp;
    23572363      PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     2364      //DbgMsg(pszSrcFile, __LINE__, "UM_RESCAN %p pci %s", hwnd, (CHAR *) mp1);
    23582365    }
    23592366    return 0;
     
    26222629        runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT,
    26232630                HWND_DESKTOP, pszSrcFile, __LINE__, NULL, NULL,
    2624                 "%s %s", PCSZ_LVMEXE, "/RediscoverPRM");
    2625          PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     2631                "%s %s", PCSZ_LVMEXE, "/RediscoverPRM");
     2632        PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
    26262633        break;
    26272634
Note: See TracChangeset for help on using the changeset viewer.