Changeset 1681 for trunk/dll/comp.c
- Timestamp:
- Jan 6, 2013, 1:25:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/comp.c
r1673 r1681 81 81 12 Aug 12 GKY Fix loading of a list file in the right compare container 82 82 12 Aug 12 GKY Allow for selection of include subdirectories or a list file on initial startup of compare dirs 83 05 Jan 13 GKY Fix snapshot file to actually load and save (with/without subdirectories) properly. 84 05 Jan 13 GKY Toggle of include subdirectories leaves snapshot file loaded. 85 05 Jan 13 GKY Added an indicator (textbox) that a list (snapshot) file is loaded. 83 86 84 87 ***********************************************************************/ … … 185 188 strcpy(enddir, pffb->achName); 186 189 if (!(pffb->attrFile & FILE_DIRECTORY)) { 187 CommaFmtULL(szCmmaFmtFileSize, 188 sizeof(szCmmaFmtFileSize), pffb->cbFile, ' '); 190 ulltoa(pffb->cbFile, szCmmaFmtFileSize, 10); 189 191 FDateFormat(szDate, pffb->fdateLastWrite); 190 192 fprintf(fp, … … 237 239 fp = xfopen(sf->filename, modew, pszSrcFile, __LINE__, FALSE); 238 240 if (fp) { 239 fprintf(fp, "\"%s\"\n", sf->dirname); 241 fprintf(fp, "\"%s\"\n", sf->dirname); 242 //DbgMsg(pszSrcFile, __LINE__, "recurse %i", sf->recurse); 240 243 SnapShot(sf->dirname, fp, sf->recurse); 241 244 fclose(fp); … … 1552 1555 1553 1556 // Build list of all files in right directory 1557 //DbgMsg(pszSrcFile, __LINE__, "list file %s", cmp->rightlist); 1554 1558 if (!*cmp->rightlist) { 1555 1559 if (fForceLower) … … 1558 1562 strupr(cmp->rightdir); 1559 1563 FillDirList(cmp->rightdir, lenr, cmp->includesubdirs, 1560 1564 &filesr, &cmp->cmp->totalright, &numallocr); 1561 1565 } 1562 1566 else { … … 1565 1569 FILEFINDBUF4L fb4; 1566 1570 CHAR str[CCHMAXPATH * 2], *p; 1567 1571 CHAR *moder = "r"; 1568 1572 1569 1573 memset(&fb4, 0, sizeof(fb4)); 1570 1574 fp = xfopen(cmp->rightlist, moder, pszSrcFile, __LINE__, FALSE); 1571 1575 if (fp) { 1572 1576 while (!feof(fp)) { 1573 1577 // First get name of directory … … 1599 1603 1600 1604 memset(&cnri, 0, sizeof(cnri)); 1601 cnri.cb = sizeof(cnri); 1605 cnri.cb = sizeof(cnri); 1606 WinSetDlgItemText(cmp->hwnd, COMP_LISTLOADED, "List File Loaded"); 1602 1607 cnri.pszCnrTitle = cmp->rightdir; 1603 1608 if (!WinSendMsg(hwndRight, CM_SETCNRINFO, 1604 1609 MPFROMP(&cnri), MPFROMLONG(CMA_CNRTITLE))) { 1605 Win_Error(hwndRight, cmp->hwnd, pszSrcFile, __LINE__, "CM_SETCNRINFO"); 1610 Win_Error(hwndRight, cmp->hwnd, pszSrcFile, __LINE__, "CM_SETCNRINFO"); 1611 WinSetDlgItemText(cmp->hwnd, COMP_LISTLOADED, ""); 1606 1612 } 1607 1613 … … 1609 1615 lenr = strlen(cmp->rightdir); 1610 1616 if (cmp->rightdir[strlen(cmp->rightdir) - 1] != '\\') 1611 lenr++; 1612 while (!feof(fp)) { 1617 lenr++; 1618 //DbgMsg(pszSrcFile, __LINE__, "end of file %i", feof(fp)); 1619 while (!feof(fp)) { 1613 1620 if (!xfgets_bstripcr 1614 (str, sizeof(str), fp, pszSrcFile, __LINE__)) 1615 break; 1621 (str, sizeof(str), fp, pszSrcFile, __LINE__)) { 1622 break; 1623 } 1616 1624 p = str; 1617 1625 if (*p == '\"') { … … 1619 1627 if (*p && *p != '\"') { 1620 1628 p = strchr(p, '\"'); 1621 1629 if (p) { 1622 1630 *p = 0; 1623 1631 p++; 1624 1632 if (*p == ',') { 1625 1633 p++; 1626 1634 if (!cmp->includesubdirs && atol(p) > lenr) 1627 1635 continue; 1628 1636 p = strchr(p, ','); 1629 1637 if (p) { 1630 1638 p++; 1631 // 27 Sep 07 SHL fixme to do ULONGLONG conversion 1632 fb4.cbFile = atol(p); 1639 fb4.cbFile = atoll(p); 1633 1640 p = strchr(p, ','); 1634 if (p) { 1635 p++; 1636 fb4.fdateLastWrite.year = atol(p) - 1980; 1637 p = strchr(p, '/'); 1638 if (p) { 1639 p++; 1640 fb4.fdateLastWrite.month = atol(p); 1641 p = strchr(p, '/'); 1642 if (p) { 1643 p++; 1644 fb4.fdateLastWrite.day = atol(p); 1641 if (p) { 1642 p++; 1643 if (ulDateFmt == 2 || ulDateFmt == 3) 1644 fb4.fdateLastWrite.year = atol(p) - 1980; 1645 if (ulDateFmt == 1) 1646 fb4.fdateLastWrite.day = atol(p); 1647 else 1648 fb4.fdateLastWrite.month = atol(p); 1649 p = strchr(p, DateSeparator[0]); 1650 if (p) { 1651 p++; 1652 if (ulDateFmt == 2 || ulDateFmt == 3) 1653 fb4.fdateLastWrite.month = atol(p); 1654 else 1655 fb4.fdateLastWrite.day = atol(p); 1656 p = strchr(p, DateSeparator[0]); 1657 if (p) { 1658 p++; 1659 if (ulDateFmt == 2) 1660 fb4.fdateLastWrite.day = atol(p); 1661 if (ulDateFmt == 3) 1662 fb4.fdateLastWrite.month = atol(p); 1663 else 1664 fb4.fdateLastWrite.year = atol(p) - 1980; 1645 1665 p = strchr(p, ','); 1646 1666 if (p) { 1647 1667 p++; 1648 1668 fb4.ftimeLastWrite.hours = atol(p); 1649 p = strchr(p, ':');1650 1669 p = strchr(p, TimeSeparator[0]); 1670 if (p) { 1651 1671 p++; 1652 1672 fb4.ftimeLastWrite.minutes = atol(p); 1653 p = strchr(p, ':');1654 1673 p = strchr(p, TimeSeparator[0]); 1674 if (p) { 1655 1675 p++; 1656 1676 fb4.ftimeLastWrite.twosecs = atol(p); 1657 1677 p = strchr(p, ','); 1658 1678 if (p) { 1659 1679 p++; 1660 1680 fb4.attrFile = atol(p); 1661 1681 p = strchr(p, ','); 1662 1682 if (p) { 1663 1683 p++; 1664 1684 fb4.cbList = atol(p) * 2; … … 1666 1686 strupr(str + 1); 1667 1687 else if (fForceLower) 1668 1688 strlwr(str + 1); 1669 1689 if (AddToFileList((str + 1) + lenr, 1670 1690 &fb4, … … 1688 1708 } // while 1689 1709 } // if have rightdir 1690 1710 fclose(fp); 1691 1711 } 1692 FillDirList(cmp->rightdir, lenr, cmp->includesubdirs,1693 &filesr, &cmp->cmp->totalright, &numallocr);1694 1712 } // if snapshot file 1695 1713 1696 1714 if (filesr) 1697 1715 qsort(filesr, cmp->cmp->totalright, sizeof(CHAR *), CompNames); 1698 1716 1699 1717 // We now have two lists of files, both sorted. … … 2499 2517 case BN_CLICKED: 2500 2518 cmp = INSTDATA(hwnd); 2501 if (cmp)2502 *cmp->rightlist = 0;2519 //if (cmp) 2520 // *cmp->rightlist = 0; 2503 2521 PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID); 2504 2522 PostMsg(hwnd, UM_SETDIR, MPVOID, MPVOID); … … 2703 2721 CA_DETAILSVIEWTITLES | CA_OWNERDRAW; 2704 2722 WinSendDlgItemMsg(hwnd, COMP_LEFTDIR, CM_SETCNRINFO, MPFROMP(&cnri), 2705 MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR)); 2723 MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR)); 2724 WinSetDlgItemText(hwnd, COMP_LISTLOADED, ""); 2706 2725 cnri.pszCnrTitle = cmp->rightdir; 2707 2726 WinSendDlgItemMsg(hwnd, COMP_RIGHTDIR, CM_SETCNRINFO, MPFROMP(&cnri), … … 3046 3065 strcpy(sf->dirname, cmp->leftdir); 3047 3066 else 3048 strcpy(sf->dirname, cmp->rightdir); 3049 sf->recurse = cmp->includesubdirs; 3067 strcpy(sf->dirname, cmp->rightdir); 3068 cmp->includesubdirs = WinQueryButtonCheckstate(hwnd, 3069 COMP_INCLUDESUBDIRS); 3070 sf->recurse = cmp->includesubdirs; 3071 //DbgMsg(pszSrcFile, __LINE__, "recurse %i %i", sf->recurse, cmp->includesubdirs); 3050 3072 if (xbeginthread(StartSnapThread, 3051 3073 65536,
Note:
See TracChangeset
for help on using the changeset viewer.