Changeset 730 for trunk/dll/treecnr.c
- Timestamp:
- Jul 22, 2007, 7:57:09 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/treecnr.c
r726 r730 155 155 CM_QUERYRECORDEMPHASIS, 156 156 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED)); 157 if (pci && (INT) pci != -1 && !stricmp(pci-> szFileName, dirname)) {157 if (pci && (INT) pci != -1 && !stricmp(pci->pszFileName, dirname)) { 158 158 quickbail = TRUE; 159 159 goto MakeTop; /* skip lookup bullsh*t */ … … 170 170 pciP = FindCnrRecord(hwndCnr, szDir, NULL, TRUE, FALSE, TRUE); 171 171 if (pciP && (INT) pciP != -1) { 172 if (!stricmp(dirname, pciP-> szFileName))172 if (!stricmp(dirname, pciP->pszFileName)) 173 173 break; 174 174 if (!(pciP->rc.flRecordAttr & CRA_EXPANDED)) … … 199 199 MPVOID, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 200 200 while (pciP && (INT) pciP != -1) { 201 if (toupper(*pciP-> szFileName) == toupper(*dirname))201 if (toupper(*pciP->pszFileName) == toupper(*dirname)) 202 202 /* collapse all levels if branch is our drive */ 203 203 ExpandAll(hwndCnr, FALSE, pciP); … … 634 634 sprintf(s, GetPString(IDS_NUMDRIVESTEXT), cnri.cRecords); 635 635 if (pci) { 636 if (!(driveflags[toupper(*pci-> szFileName) - 'A'] &636 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 637 637 DRIVE_REMOVABLE) || 638 driveserial[toupper(*pci-> szFileName) - 'A'] != -1) {638 driveserial[toupper(*pci->pszFileName) - 'A'] != -1) { 639 639 memset(&volser, 0, sizeof(volser)); 640 640 DosError(FERR_DISABLEHARDERR); 641 if (!DosQueryFSInfo(toupper(*pci-> szFileName) - '@',641 if (!DosQueryFSInfo(toupper(*pci->pszFileName) - '@', 642 642 FSIL_VOLSER, 643 643 &volser, … … 645 645 dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) { 646 646 DosError(FERR_DISABLEHARDERR); 647 if (!DosQueryFSInfo(toupper(*pci-> szFileName) - '@',647 if (!DosQueryFSInfo(toupper(*pci->pszFileName) - '@', 648 648 FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) { 649 649 CommaFmtULL(tb, sizeof(tb), … … 654 654 else 655 655 *szFree = 0; 656 driveserial[toupper(*pci-> szFileName) - 'A'] = volser.serial;656 driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial; 657 657 sprintf(&s[strlen(s)], 658 658 GetPString(IDS_TREESTATUSSTARTTEXT), 659 toupper(*pci-> szFileName),659 toupper(*pci->pszFileName), 660 660 volser.volumelabel, volser.serial, szFree); 661 661 if (!fMoreButtons) { … … 663 663 (dcd->mask.attrFile != ALLATTRS || 664 664 ((fFilesInTree || 665 (driveflags[toupper(*pci-> szFileName)] &665 (driveflags[toupper(*pci->pszFileName)] & 666 666 DRIVE_INCLUDEFILES)) ? 667 667 dcd->mask.antiattr : … … 679 679 /* find root record and strip it */ 680 680 pci = FindParentRecord(dcd->hwndCnr, pci); 681 driveserial[toupper(*pci-> szFileName) - 'A'] = -1;681 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 682 682 UnFlesh(dcd->hwndCnr, pci); 683 683 } … … 993 993 pci = (PCNRITEM) CurrentRecord(hwnd); 994 994 if (pci && (INT) pci != -1) { 995 if (IsRoot(pci-> szFileName))995 if (IsRoot(pci->pszFileName)) 996 996 menuHwnd = CheckMenu(&TreeMenu, TREE_POPUP); 997 997 else { … … 1067 1067 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED)); 1068 1068 if (pci && (INT) pci != -1 && fComments && 1069 !(driveflags[toupper(*pci-> szFileName) - 'A'] & DRIVE_SLOW))1070 WinSendMsg(hwndMain, UM_LOADFILE, MPFROMP(pci-> szFileName), MPVOID);1069 !(driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_SLOW)) 1070 WinSendMsg(hwndMain, UM_LOADFILE, MPFROMP(pci->pszFileName), MPVOID); 1071 1071 else 1072 1072 WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID); … … 1081 1081 if (pci) { 1082 1082 if (*(ULONG *) realappname == FM3UL) { 1083 sprintf(str, "%s %s", GetPString(IDS_DTTEXT), pci-> szFileName);1083 sprintf(str, "%s %s", GetPString(IDS_DTTEXT), pci->pszFileName); 1084 1084 WinSetWindowText(dcd->hwndFrame, str); 1085 1085 WinSetWindowText(WinWindowFromID(dcd->hwndFrame, FID_TITLEBAR), … … 1088 1088 else 1089 1089 WinSetWindowText(WinWindowFromID(dcd->hwndFrame, 1090 MAIN_STATUS), pci-> szFileName);1090 MAIN_STATUS), pci->pszFileName); 1091 1091 if (fMoreButtons && hwndName) { 1092 WinSetWindowText(hwndName, pci-> szFileName);1092 WinSetWindowText(hwndName, pci->pszFileName); 1093 1093 sprintf(str, 1094 1094 "%04u/%02u/%02u %02u:%02u:%02u", … … 1112 1112 1113 1113 if (pci) 1114 NotifyError(pci-> szFileName, (ULONG) mp2);1114 NotifyError(pci->pszFileName, (ULONG) mp2); 1115 1115 } 1116 1116 return 0; … … 1300 1300 } 1301 1301 if (uso != DO_LINK && 1302 !(driveflags[toupper(*pci-> szFileName) - 'A'] &1302 !(driveflags[toupper(*pci->pszFileName) - 'A'] & 1303 1303 DRIVE_NOTWRITEABLE)) { 1304 1304 … … 1306 1306 1307 1307 if (!fQuickArcFind && 1308 !(driveflags[toupper(*pci-> szFileName) - 'A'] &1308 !(driveflags[toupper(*pci->pszFileName) - 'A'] & 1309 1309 DRIVE_SLOW)) 1310 info = find_type(pci-> szFileName, NULL);1310 info = find_type(pci->pszFileName, NULL); 1311 1311 else 1312 info = quick_find_type(pci-> szFileName, NULL);1312 info = quick_find_type(pci->pszFileName, NULL); 1313 1313 if (!info || ((uso == DO_MOVE && !info->move) || 1314 1314 (uso == DO_COPY && !info->create))) { … … 1327 1327 if (!pci || (INT) pci == -1) 1328 1328 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 1329 if (driveflags[toupper(*pci-> szFileName) - 'A'] &1329 if (driveflags[toupper(*pci->pszFileName) - 'A'] & 1330 1330 DRIVE_NOTWRITEABLE) 1331 1331 return MRFROM2SHORT(DOR_DROP, DO_LINK); 1332 if (toupper(*pci-> szFileName) < 'C')1332 if (toupper(*pci->pszFileName) < 'C') 1333 1333 return MRFROM2SHORT(DOR_DROP, DO_COPY); 1334 1334 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */ … … 1359 1359 } 1360 1360 if (hwndStatus2) { 1361 WinSetWindowText(hwndStatus2, (IsRoot(pci-> szFileName)) ?1361 WinSetWindowText(hwndStatus2, (IsRoot(pci->pszFileName)) ? 1362 1362 GetPString(IDS_DRAGROOTTEXT) : 1363 1363 (pci->attrFile & FILE_DIRECTORY) ? … … 1523 1523 if (fFollowTree && 1524 1524 !(driveflags 1525 [toupper(*((PCNRITEM) pre->pRecord)-> szFileName) -1525 [toupper(*((PCNRITEM) pre->pRecord)->pszFileName) - 1526 1526 'A'] & DRIVE_INVALID)) { 1527 1527 if (!LastDir && !ParentIsDesktop(hwnd, dcd->hwndParent)) … … 1547 1547 WinSetWindowText(WinWindowFromID(dcd->hwndFrame, 1548 1548 MAIN_STATUS), 1549 ((PCNRITEM) (pre->pRecord))-> szFileName);1549 ((PCNRITEM) (pre->pRecord))->pszFileName); 1550 1550 } 1551 1551 } … … 1570 1570 if (!(pci->attrFile & FILE_DIRECTORY)) 1571 1571 dcd->hwndLastMenu = CheckMenu(&FileMenu, FILE_POPUP); 1572 else if (!IsRoot(pci-> szFileName))1572 else if (!IsRoot(pci->pszFileName)) 1573 1573 dcd->hwndLastMenu = CheckMenu(&DirMenu, DIR_POPUP); 1574 1574 else … … 1620 1620 1621 1621 if (pci && (INT) pci != -1 && !(pci->flags & RECFLAGS_ENV)) { 1622 if (driveflags[toupper(*pci-> szFileName) - 'A'] & DRIVE_REMOVABLE) {1622 if (driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_REMOVABLE) { 1623 1623 1624 1624 struct … … 1632 1632 memset(&volser, 0, sizeof(volser)); 1633 1633 DosError(FERR_DISABLEHARDERR); 1634 if (!DosQueryFSInfo(toupper(*pci-> szFileName) - '@',1634 if (!DosQueryFSInfo(toupper(*pci->pszFileName) - '@', 1635 1635 FSIL_VOLSER, &volser, 1636 1636 (ULONG) sizeof(volser))) { 1637 1637 if (SHORT2FROMMP(mp1) == CN_COLLAPSETREE && 1638 1638 !volser.serial || 1639 driveserial[toupper(*pci-> szFileName) - 'A'] !=1639 driveserial[toupper(*pci->pszFileName) - 'A'] != 1640 1640 volser.serial) 1641 1641 UnFlesh(hwnd, pci); 1642 1642 if (SHORT2FROMMP(mp1) != CN_COLLAPSETREE || 1643 1643 (!volser.serial || 1644 driveserial[toupper(*pci-> szFileName) - 'A'] !=1644 driveserial[toupper(*pci->pszFileName) - 'A'] != 1645 1645 volser.serial)) { 1646 1646 if (Flesh(hwnd, pci) && … … 1649 1649 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 1650 1650 } 1651 driveserial[toupper(*pci-> szFileName) - 'A'] = volser.serial;1651 driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial; 1652 1652 } 1653 1653 else { 1654 driveserial[toupper(*pci-> szFileName) - 'A'] = -1;1654 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 1655 1655 UnFlesh(hwnd, pci); 1656 1656 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); … … 1721 1721 (INT) pci != -1 && 1722 1722 !(pci->rc.flRecordAttr & CRA_INUSE) && 1723 !(pci->flags & RECFLAGS_ENV) && IsFullName(pci-> szFileName)) {1724 if (driveflags[toupper(*pci-> szFileName) - 'A'] & DRIVE_INVALID) {1723 !(pci->flags & RECFLAGS_ENV) && IsFullName(pci->pszFileName)) { 1724 if (driveflags[toupper(*pci->pszFileName) - 'A'] & DRIVE_INVALID) { 1725 1725 DosBeep(50, 100); 1726 1726 if (hwndStatus) … … 1730 1730 DosError(FERR_DISABLEHARDERR); 1731 1731 if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) { 1732 if (!(ulDriveMap & 1L << (toupper(*pci-> szFileName) - 'A'))) {1732 if (!(ulDriveMap & 1L << (toupper(*pci->pszFileName) - 'A'))) { 1733 1733 pciL = pciP = pci; 1734 1734 for (;;) { … … 1751 1751 } 1752 1752 } 1753 if (driveflags[toupper(*pci-> szFileName) - 'A'] &1753 if (driveflags[toupper(*pci->pszFileName) - 'A'] & 1754 1754 (DRIVE_REMOVABLE | DRIVE_NOPRESCAN)) { 1755 1755 … … 1775 1775 } 1776 1776 } 1777 if ((driveflags[toupper(*pci-> szFileName) - 'A'] &1777 if ((driveflags[toupper(*pci->pszFileName) - 'A'] & 1778 1778 DRIVE_NOPRESCAN) || 1779 (toupper(*pci-> szFileName) > 'B' &&1780 !(driveflags[toupper(*pci-> szFileName) - 'A'] &1779 (toupper(*pci->pszFileName) > 'B' && 1780 !(driveflags[toupper(*pci->pszFileName) - 'A'] & 1781 1781 DRIVE_CDROM))) { 1782 1782 1783 INT removable, x = (INT) (toupper(*pci-> szFileName) - 'A');1783 INT removable, x = (INT) (toupper(*pci->pszFileName) - 'A'); 1784 1784 ULONG drvtype; 1785 1785 CHAR FileSystem[CCHMAXPATH]; 1786 1786 1787 1787 DosError(FERR_DISABLEHARDERR); 1788 removable = CheckDrive(toupper(*pciP-> szFileName),1788 removable = CheckDrive(toupper(*pciP->pszFileName), 1789 1789 FileSystem, &drvtype); 1790 1790 if (removable != -1) { … … 1837 1837 memset(&volser, 0, sizeof(volser)); 1838 1838 DosError(FERR_DISABLEHARDERR); 1839 status = DosQueryFSInfo(toupper(*pci-> szFileName) - '@',1839 status = DosQueryFSInfo(toupper(*pci->pszFileName) - '@', 1840 1840 FSIL_VOLSER, &volser, 1841 1841 (ULONG) sizeof(volser)); 1842 1842 if (!status) { 1843 1843 if (!volser.serial || 1844 driveserial[toupper(*pci-> szFileName) - 'A'] !=1844 driveserial[toupper(*pci->pszFileName) - 'A'] != 1845 1845 volser.serial) { 1846 1846 UnFlesh(hwnd, pciP); 1847 1847 Flesh(hwnd, pciP); 1848 driveserial[toupper(*pci-> szFileName) - 'A'] = volser.serial;1848 driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial; 1849 1849 } 1850 1850 pciL = WinSendMsg(hwnd, … … 1856 1856 } 1857 1857 else { 1858 driveserial[toupper(*pci-> szFileName) - 'A'] = -1;1858 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 1859 1859 UnFlesh(hwnd, pci); 1860 1860 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); … … 1864 1864 } 1865 1865 status = 0; 1866 IsOk = (IsRoot(pci-> szFileName) &&1867 IsValidDrive(toupper(*pci-> szFileName)));1866 IsOk = (IsRoot(pci->pszFileName) && 1867 IsValidDrive(toupper(*pci->pszFileName))); 1868 1868 if (!IsOk) { 1869 1869 DosError(FERR_DISABLEHARDERR); 1870 status = DosFindFirst(pci-> szFileName, &hDir,1870 status = DosFindFirst(pci->pszFileName, &hDir, 1871 1871 FILE_NORMAL | FILE_DIRECTORY | 1872 1872 FILE_ARCHIVED | FILE_READONLY | … … 1885 1885 } 1886 1886 if ((shiftstate & (KC_CTRL | KC_SHIFT)) == (KC_CTRL | KC_SHIFT)) { 1887 OpenObject(pci-> szFileName, Settings, dcd->hwndFrame);1887 OpenObject(pci->pszFileName, Settings, dcd->hwndFrame); 1888 1888 return 0; 1889 1889 } 1890 1890 if (!(shiftstate & (KC_CTRL | KC_SHIFT))) { 1891 1891 if (!ParentIsDesktop(hwnd, dcd->hwndParent)) { 1892 if (FindDirCnrByName(pci-> szFileName, TRUE))1892 if (FindDirCnrByName(pci->pszFileName, TRUE)) 1893 1893 return 0; 1894 1894 } … … 1907 1907 (PVOID) & flWindowAttr, &size); 1908 1908 if (flWindowAttr & CV_DETAIL) { 1909 if (IsRoot(pci-> szFileName))1909 if (IsRoot(pci->pszFileName)) 1910 1910 strcpy(s, "TREE"); 1911 1911 else 1912 1912 strcpy(s, "DETAILS"); 1913 1913 } 1914 OpenObject(pci-> szFileName, s, dcd->hwndFrame);1914 OpenObject(pci->pszFileName, s, dcd->hwndFrame); 1915 1915 return 0; 1916 1916 } … … 1920 1920 if (LastDir && !fDCOpens && !(shiftstate & KC_SHIFT)) { 1921 1921 WinSendMsg(LastDir, 1922 UM_SETDIR, MPFROMP(pci-> szFileName), MPVOID);1922 UM_SETDIR, MPFROMP(pci->pszFileName), MPVOID); 1923 1923 WinSetWindowPos(WinQueryWindow(WinQueryWindow(LastDir, 1924 1924 QW_PARENT), … … 1929 1929 OpenDirCnr(hwnd, 1930 1930 dcd->hwndParent, 1931 dcd->hwndFrame, FALSE, pci-> szFileName);1931 dcd->hwndFrame, FALSE, pci->pszFileName); 1932 1932 } 1933 1933 else { 1934 if (!(driveflags[toupper(*pci-> szFileName) - 'A'] &1934 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 1935 1935 DRIVE_INCLUDEFILES)) 1936 1936 WinSendMsg(hwnd, … … 1945 1945 DefaultViewKeys(hwnd, 1946 1946 dcd->hwndFrame, 1947 dcd->hwndParent, &swp, pci-> szFileName);1947 dcd->hwndParent, &swp, pci->pszFileName); 1948 1948 } 1949 1949 } 1950 1950 } 1951 1951 else { 1952 if (!IsRoot(pci-> szFileName)) {1953 NotifyError(pci-> szFileName, status);1952 if (!IsRoot(pci->pszFileName)) { 1953 NotifyError(pci->pszFileName, status); 1954 1954 WinSendMsg(hwnd, 1955 1955 CM_REMOVERECORD, … … 2026 2026 CHAR szDrv[CCHMAXPATH]; 2027 2027 2028 strcpy(szDrv, pci-> szFileName);2029 chDrvU = *pci-> szFileName;2028 strcpy(szDrv, pci->pszFileName); 2029 chDrvU = *pci->pszFileName; 2030 2030 chDrvU = toupper(chDrvU); 2031 2031 MakeValidDir(szDrv); … … 2232 2232 2233 2233 pci = (PCNRITEM) CurrentRecord(hwnd); 2234 if (pci && (INT) pci != -1 && isalpha(*pci-> szFileName)) {2235 *d = toupper(*pci-> szFileName);2234 if (pci && (INT) pci != -1 && isalpha(*pci->pszFileName)) { 2235 *d = toupper(*pci->pszFileName); 2236 2236 p = GetCmdSpec(FALSE); 2237 2237 memset(&pgd, 0, sizeof(pgd)); … … 2298 2298 pci = (PCNRITEM) CurrentRecord(hwnd); 2299 2299 if (pci && (INT) pci != -1) { 2300 strcpy(dir, pci-> szFileName);2300 strcpy(dir, pci->pszFileName); 2301 2301 MakeValidDir(dir); 2302 2302 } … … 2330 2330 if (pci && (INT) pci != -1) 2331 2331 dcd->mask.fFilesIncluded = 2332 ((driveflags[toupper(*pci-> szFileName) - 'A'] &2332 ((driveflags[toupper(*pci->pszFileName) - 'A'] & 2333 2333 DRIVE_INCLUDEFILES) != 0); 2334 2334 else … … 2370 2370 pci = (PCNRITEM) CurrentRecord(hwnd); 2371 2371 if (pci && (INT) pci != -1) { 2372 strcpy(newpath, pci-> szFileName);2372 strcpy(newpath, pci->pszFileName); 2373 2373 MakeValidDir(newpath); 2374 2374 } … … 2556 2556 PCNRITEM pci = (PCNRITEM)CurrentRecord(hwnd); 2557 2557 if (pci && (INT)pci != -1) { 2558 UINT driveflag = driveflags[toupper(*pci-> szFileName) - 'A'];2558 UINT driveflag = driveflags[toupper(*pci->pszFileName) - 'A']; 2559 2559 if (pci->attrFile & FILE_DIRECTORY) { 2560 2560 if (pci->flags & RECFLAGS_UNDERENV) … … 2565 2565 (~driveflag & DRIVE_NOPRESCAN && pci->rc.hptrIcon == hptrDunno)) 2566 2566 { 2567 driveflags[toupper(*pci-> szFileName) - 'A'] &=2567 driveflags[toupper(*pci->pszFileName) - 'A'] &= 2568 2568 (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS | 2569 2569 DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS | DRIVE_NOSTATS); 2570 DriveFlagsOne(toupper(*pci-> szFileName) - 'A');2571 driveflag = driveflags[toupper(*pci-> szFileName) - 'A'];2570 DriveFlagsOne(toupper(*pci->pszFileName) - 'A'); 2571 driveflag = driveflags[toupper(*pci->pszFileName) - 'A']; 2572 2572 if (driveflag & DRIVE_INVALID) 2573 2573 pci->rc.hptrIcon = hptrDunno; … … 2653 2653 pci = (PCNRITEM) CurrentRecord(hwnd); 2654 2654 if (pci && (INT) pci != -1) 2655 CommonDriveCmd(hwnd, pci-> szFileName, SHORT1FROMMP(mp1));2655 CommonDriveCmd(hwnd, pci->pszFileName, SHORT1FROMMP(mp1)); 2656 2656 } 2657 2657 break;
Note:
See TracChangeset
for help on using the changeset viewer.