Changeset 1891 for trunk/dll/comp.c


Ignore:
Timestamp:
Jan 31, 2020, 3:47:37 AM (6 years ago)
Author:
Steven Levine
Message:

Rework FreeCnrItem to ensure all CNRITEMs deleted.
Use WinSendMsg CMA_NEXT.
Was using preccNextRecord which is not recommended because control does
not maintain linkage after inserts and deletes.
Note: arccnrs.c still needs to be reworked to use common functions from filldir.c.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/comp.c

    r1878 r1891  
    66  Compare directories
    77
    8   Copyright (c) 1993-02 M. Kimes
    9   Copyright (c) 2003, 2013 Steven H. Levine
     8  Copyright (c) 1993-2002 M. Kimes
     9  Copyright (c) 2003-2020 Steven H. Levine
    1010
    1111  16 Oct 02 MK Baseline
     
    8989  09 Mar 13 SHL SetButtonEnables: correct enable support for newish buttons
    9090  10 Mar 13 GKY Improvrd readonly check on delete to allow cancel and don't ask again options
    91                 Added saymsg2 for this purpose
     91                Added saymsg2 for this purpose
    9292  10 Mar 13 GKY Fixes to snapshot file.
    9393  14 Jun 15 GKY Changes to prvenet access violations when cmp is freed
     94  28 Jan 20 SHL ActionCnrThread: report CM_INVALIDATERECORD failures
    9495
    9596***********************************************************************/
     
    150151#include "excputil.h"                   // xbeginthread
    151152#include "info.h"                       // driveflags
    152 #include "worker.h"                     // MOVEIT
    153 #include "rename.h"                     // RenameProc
     153#include "worker.h"                     // MOVEIT
     154#include "rename.h"                     // RenameProc
    154155
    155156typedef struct
     
    177178  HDIR hdir = HDIR_CREATE;
    178179  ULONG ulFindCnt;
    179   //CHAR szDate[DATE_BUF_BYTES];
    180 
    181   // 13 Aug 07 SHL fixme to use FileToGet
     180  // CHAR szDate[DATE_BUF_BYTES];
     181
     182  // 13 Aug 07 SHL FIXME to use FileToGet
    182183  pffb = xmalloc(sizeof(FILEFINDBUF4L), pszSrcFile, __LINE__);
    183184  if (pffb) {
     
    188189      enddir++;
    189190      ulFindCnt = 1;
    190       // 13 Aug 07 SHL fixme to report errors
     191      // 13 Aug 07 SHL FIXME to report errors
    191192      if (!xDosFindFirst(mask,
    192193                         &hdir,
     
    198199          strcpy(enddir, pffb->achName);
    199200          if (!(pffb->attrFile & FILE_DIRECTORY)) {
    200             //FDateFormat(szDate, pffb->fdateLastWrite);
     201            // FDateFormat(szDate, pffb->fdateLastWrite);
    201202            fprintf(fp,
    202                     "\"%s\",%u,%llu,%lu/%lu/%lu,%02u:%02u:%02u,%lu,%lu,N\n",
     203                    "\"%s\",%u,%llu,%lu/%lu/%lu,%02u:%02u:%02u,%lu,%lu,N\n",
    203204                    mask,
    204205                    enddir - mask,
    205                     pffb->cbFile,
    206                     pffb->fdateLastWrite.year + 1980,
    207                     pffb->fdateLastWrite.month,
    208                     pffb->fdateLastWrite.day,
     206                    pffb->cbFile,
     207                    pffb->fdateLastWrite.year + 1980,
     208                    pffb->fdateLastWrite.month,
     209                    pffb->fdateLastWrite.day,
    209210                    pffb->ftimeLastWrite.hours,
    210211                    pffb->ftimeLastWrite.minutes,
     
    572573                       MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    573574      pciD = WinSendMsg(hwndCnrD, CM_QUERYRECORD, MPVOID,
    574                         MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
    575       fConfirmAction =  WinQueryButtonCheckstate(cmp->hwnd, COMP_CONFIRMACTION);
     575                        MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
     576      fConfirmAction = WinQueryButtonCheckstate(cmp->hwnd, COMP_CONFIRMACTION);
    576577      InitITimer(&itdSleep, 500);       // Sleep every 500 mSec
    577578
     
    595596          case IDM_DELETE:
    596597
    597             if (fConfirmAction && !dontask) {
    598               rc = saymsg2(NULL, 0, cmp->hwnd, GetPString(IDS_CONFIRMDELETE), GetPString(IDS_DOYOUWISHTODELETE),
    599                            pciS->pszFileName);
    600               if (rc == 3 || rc == 4) {       
    601                 if (rc == 4)
    602                   enddelete = TRUE;
    603                 break;
    604               }
    605               else if (rc == 2)
    606                 dontask = TRUE;
    607             }
     598            if (fConfirmAction && !dontask) {
     599              rc = saymsg2(NULL, 0, cmp->hwnd, GetPString(IDS_CONFIRMDELETE), GetPString(IDS_DOYOUWISHTODELETE),
     600                           pciS->pszFileName);
     601              if (rc == 3 || rc == 4) {
     602                if (rc == 4)
     603                  enddelete = TRUE;
     604                break;
     605              }
     606              else if (rc == 2)
     607                dontask = TRUE;
     608            }
     609
    608610            if (!unlinkf(pciS->pszFileName)) {
    609611              WinSendMsg(hwndCnrS, CM_SETRECORDEMPHASIS, MPFROMP(pciS),
     
    612614              if (!*pciD->pszFileName) {
    613615                // Other side is blank - remove from both sides
     616
     617#               ifdef PMPRINTF
     618                PmPrintf_Report(pszSrcFile, __LINE__, "ActionCnrThread RemoveCnrItems pciS %p", pciS);
     619#               endif
     620
    614621                RemoveCnrItems(hwndCnrS, pciS, 1, CMA_FREE | CMA_INVALIDATE);
    615622                if (pciD->rc.flRecordAttr & CRA_SELECTED)
    616623                  WinSendMsg(hwndCnrD, CM_SETRECORDEMPHASIS, MPFROMP(pciD),
    617624                             MPFROM2SHORT(FALSE, CRA_SELECTED));
     625
     626#               ifdef PMPRINTF
     627                PmPrintf_Report(pszSrcFile, __LINE__, "ActionCnrThread RemoveCnrItems pciD %p", pciD);
     628#               endif
     629
    618630                RemoveCnrItems(hwndCnrD, pciD, 1, CMA_FREE | CMA_INVALIDATE);
    619631              }
    620632              else {
    621633                // Other side is not blank - blank just this side
     634
     635#               ifdef PMPRINTF
     636                PmPrintf_Report(pszSrcFile, __LINE__, "ActionCnrThread FreeCnrItemData pciS %p", pciS);
     637#               endif
     638
    622639                FreeCnrItemData(pciS);
    623640                // 29 Aug 08 SHL Point pci fields at NullStr to sync with FreeCnrItemData mods
     
    626643                pciS->rc.pszIcon = pciS->pszFileName;
    627644                pciS->flags = 0;        // Just on one side
    628                 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS),
    629                            MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED));
    630                   pciD->flags = 0;      // Just on one side
    631                   if (pciD->pszSubject != NullStr) {
    632                     xfree(pciD->pszSubject, pszSrcFile, __LINE__);
    633                     pciD->pszSubject = NullStr;
    634                   }
    635                 }
     645                if (!WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS),
     646                                MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED))) {
     647                  Win_Error(hwndCnrS, cmp->hwnd, pszSrcFile, __LINE__, "CM_INVALIDATERECORD");
     648                }
     649
     650                pciD->flags = 0;        // Just on one side
     651                if (pciD->pszSubject != NullStr) {
     652                  xfree(pciD->pszSubject, pszSrcFile, __LINE__);
     653                  pciD->pszSubject = NullStr;
     654                }
     655              }
     656
    636657              if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR))
    637658                cmp->cmp->totalleft--;
     
    639660                cmp->cmp->totalright--;
    640661            }
    641             break;
     662            break; // IDM_DELETE
    642663
    643664          case IDM_MOVE:
     
    702723                pciD->attrFile = pciS->attrFile;
    703724                pciD->pszDispAttr = pciS->pszDispAttr;
    704                 pciD->flags = 0;                // Just on one side
     725                pciD->flags = 0;        // Just on one side
    705726                pciD->date = pciS->date;
    706727                pciD->time = pciS->time;
     
    727748                  pciS->pszSubject = NullStr;
    728749                }
    729                 pciS->flags = 0;                // Just on one side
    730 
    731                 WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS),
    732                            MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED));
    733 
    734                 WinSendMsg(hwndCnrD, CM_INVALIDATERECORD, MPFROMP(&pciD),
    735                            MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED));
     750                pciS->flags = 0;        // Just on one side
     751
     752                if (!WinSendMsg(hwndCnrS, CM_INVALIDATERECORD, MPFROMP(&pciS),
     753                           MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED))) {
     754                  Win_Error(hwndCnrS, cmp->hwnd, pszSrcFile, __LINE__, "CM_INVALIDATERECORD");
     755                }
     756
     757                if (!WinSendMsg(hwndCnrD, CM_INVALIDATERECORD, MPFROMP(&pciD),
     758                           MPFROM2SHORT(1, CMA_ERASE | CMA_TEXTCHANGED))) {
     759                  Win_Error(hwndCnrD, cmp->hwnd, pszSrcFile, __LINE__, "CM_INVALIDATERECORD");
     760                }
    736761
    737762                if (hwndCnrS == WinWindowFromID(cmp->hwnd, COMP_LEFTDIR))
     
    868893        SleepIfNeeded(&itdSleep, 0);
    869894      } // while
     895
    870896      WinPostMsg(cmp->hwnd, WM_TIMER, MPFROMLONG(ID_COMP_TIMER), 0);    // Force update
    871897    Abort:
     
    10771103
    10781104  if (numD != x) {
    1079     // Something out of sync - fixme to document why slow logic needed
     1105    // Something out of sync - FIXME to document why slow logic needed
    10801106    if (!slow) {
    10811107      slow = TRUE;
     
    12021228                  else if (memcmp(buf1, buf2, numread1))
    12031229                    break;
    1204                 }       // while
     1230                } // while
    12051231              } // same len
    12061232            } // if open ok
     
    13151341        pciD = pciDa[x];
    13161342        CompSelectSetSelects(pciS,
    1317                              pciD,
    1318                              pciS->flags & CNRITEM_EASDIFFER,
    1319                              pciD->flags & CNRITEM_EASDIFFER,
    1320                              wantAnd);
     1343                             pciD,
     1344                             pciS->flags & CNRITEM_EASDIFFER,
     1345                             pciD->flags & CNRITEM_EASDIFFER,
     1346                             wantAnd);
    13211347      }
    13221348      SleepIfNeeded(&itdSleep, 0);
     
    15961622
    15971623# ifdef FORTIFY
    1598   // 10 May 08 SHL fixme to suppress W111
     1624  // 10 May 08 SHL FIXME to suppress W111
    15991625  Fortify_EnterScope();
    16001626#  endif
     
    16031629    Runtime_Error(pszSrcFile, __LINE__, NULL);
    16041630#   ifdef FORTIFY
    1605     // 10 May 08 SHL fixme to suppress W111
     1631    // 10 May 08 SHL FIXME to suppress W111
    16061632    Fortify_LeaveScope();
    16071633#    endif
     
    16481674        lenr++;
    16491675      priority_normal();
    1650       // Clear containers
     1676      // Clear containers in case restarting
    16511677      RemoveCnrItems(hwndRight, NULL, 0, CMA_FREE | CMA_INVALIDATE);
    16521678      RemoveCnrItems(hwndLeft, NULL, 0, CMA_FREE | CMA_INVALIDATE);
     
    16781704        CHAR str[CCHMAXPATH * 2], *p;
    16791705        CHAR *moder = "r";
    1680         BOOL fFixedSnap = TRUE;
     1706        BOOL fFixedSnap = TRUE;
    16811707
    16821708        memset(&fb4, 0, sizeof(fb4));
     
    17441770                      p = strchr(p, ',');
    17451771                      if (p) {
    1746                         p++;
    1747                         if (((strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - strchr(p, ',')) > 5) {
    1748                           CHAR szTemp[30];
    1749                           CHAR *q;
    1750                           int i;
    1751 
    1752                           memset(szTemp, 0, sizeof(szTemp));
    1753                           i = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 3 - p;
    1754                           strncpy(&szTemp, p, i);
    1755                           for (q = szTemp; q = strchr(szTemp, ',');) {
    1756                             strcpy(q, q + 1);
    1757                           }
    1758                           fb4.cbFile = atoll(szTemp);
    1759                           fFixedSnap = FALSE;
    1760 
    1761                         }
    1762                         else
    1763                           fb4.cbFile = atoll(p);
    1764                         if (!strchr(p, '/'))
    1765                           fFixedSnap = FALSE;
    1766                         p = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 6;
    1767                         p = strchr(p, ',');
    1768                         if (p) {
    1769                           p++;
    1770                           if (ulDateFmt == 2 || ulDateFmt == 3 || fFixedSnap)
    1771                             fb4.fdateLastWrite.year = atol(p) - 1980;
    1772                           else if (ulDateFmt == 1)
    1773                             fb4.fdateLastWrite.day = atol(p);
    1774                           else
    1775                             fb4.fdateLastWrite.month = atol(p);
    1776                           p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]);
    1777                           if (p) {
    1778                             p++;
    1779                             if (ulDateFmt == 2 || ulDateFmt == 1 || fFixedSnap)
    1780                               fb4.fdateLastWrite.month = atol(p);
    1781                             else
    1782                               fb4.fdateLastWrite.day = atol(p);
    1783                             p = strchr(p, '/') ?  strchr(p, '/') : strchr(p, DateSeparator[0]);
    1784                             if (p) {
    1785                               p++;
    1786                               if (ulDateFmt == 2 || fFixedSnap)
    1787                                 fb4.fdateLastWrite.day = atol(p);
    1788                               else if (ulDateFmt == 3)
    1789                                 fb4.fdateLastWrite.month = atol(p);
    1790                               else
    1791                                 fb4.fdateLastWrite.year = atol(p) - 1980;
     1772                        p++;
     1773                        if (((strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - strchr(p, ',')) > 5) {
     1774                          CHAR szTemp[30];
     1775                          CHAR *q;
     1776                          int i;
     1777
     1778                          memset(szTemp, 0, sizeof(szTemp));
     1779                          i = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 3 - p;
     1780                          strncpy(&szTemp, p, i);
     1781                          for (q = szTemp; q = strchr(szTemp, ',');) {
     1782                            strcpy(q, q + 1);
     1783                          }
     1784                          fb4.cbFile = atoll(szTemp);
     1785                          fFixedSnap = FALSE;
     1786
     1787                        }
     1788                        else
     1789                          fb4.cbFile = atoll(p);
     1790                        if (!strchr(p, '/'))
     1791                          fFixedSnap = FALSE;
     1792                        p = (strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0])) - 6;
     1793                        p = strchr(p, ',');
     1794                        if (p) {
     1795                          p++;
     1796                          if (ulDateFmt == 2 || ulDateFmt == 3 || fFixedSnap)
     1797                            fb4.fdateLastWrite.year = atol(p) - 1980;
     1798                          else if (ulDateFmt == 1)
     1799                            fb4.fdateLastWrite.day = atol(p);
     1800                          else
     1801                            fb4.fdateLastWrite.month = atol(p);
     1802                          p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]);
     1803                          if (p) {
     1804                            p++;
     1805                            if (ulDateFmt == 2 || ulDateFmt == 1 || fFixedSnap)
     1806                              fb4.fdateLastWrite.month = atol(p);
     1807                            else
     1808                              fb4.fdateLastWrite.day = atol(p);
     1809                            p = strchr(p, '/') ? strchr(p, '/') : strchr(p, DateSeparator[0]);
     1810                            if (p) {
     1811                              p++;
     1812                              if (ulDateFmt == 2 || fFixedSnap)
     1813                                fb4.fdateLastWrite.day = atol(p);
     1814                              else if (ulDateFmt == 3)
     1815                                fb4.fdateLastWrite.month = atol(p);
     1816                              else
     1817                                fb4.fdateLastWrite.year = atol(p) - 1980;
    17921818                              p = strchr(p, ',');
    1793                               if (p) {
     1819                              if (p) {
    17941820                                p++;
    17951821                                fb4.ftimeLastWrite.hours = atol(p);
    1796                                 p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]);
    1797                                 if (p) {
     1822                                p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]);
     1823                                if (p) {
    17981824                                  p++;
    17991825                                  fb4.ftimeLastWrite.minutes = atol(p);
    1800                                   p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]);
    1801                                   if (p) {
     1826                                  p = strchr(p, ':') ? strchr(p, ':') : strchr(p, TimeSeparator[0]);
     1827                                  if (p) {
    18021828                                    p++;
    18031829                                    fb4.ftimeLastWrite.twosecs = atol(p);
    18041830                                    p = strchr(p, ',');
    1805                                     if (p) {
     1831                                    if (p) {
    18061832                                      p++;
    18071833                                      fb4.attrFile = atol(p);
    18081834                                      p = strchr(p, ',');
    1809                                       if (p) {
     1835                                      if (p) {
    18101836                                        p++;
    18111837                                        fb4.cbList = atol(p) * 2;
     
    18131839                                          strupr(str + 1);
    18141840                                        else if (fForceLower)
    1815                                           strlwr(str + 1);
     1841                                          strlwr(str + 1);
    18161842                                        if (AddToFileList((str + 1) + lenr,
    18171843                                                          &fb4,
     
    18351861            } // while
    18361862          } // if have rightdir
    1837           fclose(fp);
    1838           if (!filesr)
    1839             saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP,
     1863          fclose(fp);
     1864          if (!filesr)
     1865            saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP,
    18401866                   GetPString(IDS_WARNINGTEXT),
    18411867                   GetPString(IDS_SNAPSHOTFILEBADFORMAT));
    1842         }
    1843         else
    1844           saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP,
    1845                 GetPString(IDS_WARNINGTEXT),
    1846                 GetPString(IDS_SNAPSHOTFILELOADFAILED), cmp->rightlist);
     1868        }
     1869        else
     1870          saymsg(MB_OK | MB_ICONASTERISK, HWND_DESKTOP,
     1871                GetPString(IDS_WARNINGTEXT),
     1872                GetPString(IDS_SNAPSHOTFILELOADFAILED), cmp->rightlist);
    18471873      } // if snapshot file
    18481874
     
    19051931        while ((filesl && filesl[l]) || (filesr && filesr[r])) {
    19061932
    1907           ULONG ulRecsToInsert; // limited to USHRT_MAX
     1933          ULONG ulRecsToInsert;         // limited to USHRT_MAX
    19081934
    19091935          if (cmp->stop)
     
    19711997            pcil->pszDispAttr = FileAttrToString(pcil->attrFile);
    19721998            pcil->cbFile = filesl[l]->cbFile;
    1973             // 12 Jan 08 SHL fixme to use cached size here too
     1999            // 12 Jan 08 SHL FIXME to use cached size here too
    19742000            CommaFmtULL(szBuf, sizeof(szBuf), pcil->cbFile, ' ');
    19752001            pcil->pszFmtFileSize = xstrdup(szBuf, pszSrcFile, __LINE__);
     
    19922018            pcil->crtime.seconds = filesl[l]->crtime.twosecs * 2;
    19932019            pcil->crtime.minutes = filesl[l]->crtime.minutes;
    1994             pcil->crtime.hours = filesl[l]->crtime.hours;
    1995             DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);
     2020            pcil->crtime.hours = filesl[l]->crtime.hours;
     2021            DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);
    19962022            if (cmp && *cmp->dcd.mask.szMask) {
    19972023              if (!Filter((PMINIRECORDCORE)pcil, (PVOID)&cmp->dcd.mask)) {
    19982024                pcil->rc.flRecordAttr |= CRA_FILTERED;
    19992025                pcir->rc.flRecordAttr |= CRA_FILTERED;
    2000               }
    2001             }
    2002             DosReleaseMutexSem(hmtxFiltering);
     2026              }
     2027            }
     2028            DosReleaseMutexSem(hmtxFiltering);
    20032029          } // if on left
    20042030
     
    20132039            pcir->pszDispAttr = FileAttrToString(pcir->attrFile);
    20142040            pcir->cbFile = filesr[r]->cbFile;
    2015             // 12 Jan 08 SHL fixme to used cached size here too
     2041            // 12 Jan 08 SHL FIXME to used cached size here too
    20162042            CommaFmtULL(szBuf, sizeof(szBuf), pcir->cbFile, ' ');
    20172043            pcir->pszFmtFileSize = xstrdup(szBuf, pszSrcFile, __LINE__);
     
    20352061            pcir->crtime.minutes = filesr[r]->crtime.minutes;
    20362062            pcir->crtime.hours = filesr[r]->crtime.hours;
    2037             // Bypass check if already filtered on left side
    2038             DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);
     2063            // Bypass check if already filtered on left side
     2064            DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);
    20392065            if (cmp && ~pcir->rc.flRecordAttr & CRA_FILTERED &&
    20402066                *cmp->dcd.mask.szMask) {
     
    20422068                pcil->rc.flRecordAttr |= CRA_FILTERED;
    20432069                pcir->rc.flRecordAttr |= CRA_FILTERED;
    2044               }
    2045             }
    2046             DosReleaseMutexSem(hmtxFiltering);
     2070              }
     2071            }
     2072            DosReleaseMutexSem(hmtxFiltering);
    20472073          } // if on right
    20482074
     
    21812207                            MPFROMP(pcirFirst), MPFROMP(&ri))) {
    21822208              Win_Error(hwndRight, cmp->hwnd, pszSrcFile, __LINE__, "CM_INSERTRECORD");
    2183               // 2011-05-29 SHL fixme?
     2209              // 2011-05-29 SHL FIXME?
    21842210              RemoveCnrItems(hwndLeft, NULL, 0, CMA_FREE | CMA_INVALIDATE);
    21852211              FreeCnrItemList(hwndRight, pcirFirst);
     
    23182344  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTONE), fEnable);
    23192345  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTNEWER), fEnable);
    2320   WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTEAS), fEnable);  // 2013-03-09 SHL
     2346  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTEAS), fEnable);       // 2013-03-09 SHL
    23212347  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTOLDER), fEnable);
    23222348  WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTBIGGER), fEnable);
     
    23252351  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTONE), fEnable);
    23262352  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTNEWER), fEnable);
    2327   WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTEAS), fEnable); // 2013-03-09 SHL
     2353  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTEAS), fEnable);     // 2013-03-09 SHL
    23282354  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTOLDER), fEnable);
    23292355  WinEnableWindow(WinWindowFromID(hwnd, IDM_DESELECTBIGGER), fEnable);
     
    23462372  WinEnableWindow(WinWindowFromID(hwnd, COMP_INCLUDESUBDIRS), fEnable);
    23472373  WinEnableWindow(WinWindowFromID(hwnd, COMP_HIDENOTSELECTED), fEnable);
    2348   WinEnableWindow(WinWindowFromID(hwnd, COMP_CONFIRMACTION), fEnable); // 2013-03-09 SHL
     2374  WinEnableWindow(WinWindowFromID(hwnd, COMP_CONFIRMACTION), fEnable);  // 2013-03-09 SHL
    23492375}
    23502376
     
    24042430      {
    24052431        USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT,
    2406                         COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
    2407                         COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
    2408                         COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
    2409                         COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
    2410                         COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
    2411                         COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
     2432                        COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
     2433                        COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
     2434                        COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
     2435                        COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
     2436                        COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
     2437                        COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
    24122438        UINT x;
    24132439        CHAR s[24];
     
    25692595        pci = (PCNRITEM)pcown->pRecord;
    25702596        // 01 Aug 07 SHL if field null or blank, we draw
    2571         // fixme to document why - probably to optimize and bypass draw?
     2597        // FIXME to document why - probably to optimize and bypass draw?
    25722598        if (pci && (INT)pci != -1 && !*pci->pszFileName && pci->pszFileName != NullStr)
    25732599          return MRFROMLONG(TRUE);
     
    27282754        if (cmp) {
    27292755          PCNRITEM pci = (PCNRITEM)mp2;
    2730           USHORT id = COMP_CNRMENU;             // Assume container menu
     2756          USHORT id = COMP_CNRMENU;     // Assume container menu
    27312757
    27322758          if (cmp->dcd.hwndLastMenu)
     
    27792805      case CN_BEGINEDIT:
    27802806      case CN_REALLOCPSZ:
    2781         // fixme to be gone - field edits not allowed?
     2807        // FIXME to be gone - field edits not allowed?
    27822808        Runtime_Error(pszSrcFile, __LINE__,
    27832809                      "CN_BEGINEDIT/CN_REALLOCPSZ unexpected");
     
    28712897                          CA_DETAILSVIEWTITLES | CA_OWNERDRAW;
    28722898      WinSendDlgItemMsg(hwnd, COMP_LEFTDIR, CM_SETCNRINFO, MPFROMP(&cnri),
    2873                         MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR));
     2899                        MPFROMLONG(CMA_CNRTITLE | CMA_FLWINDOWATTR));
    28742900      WinSetDlgItemText(hwnd, COMP_LISTLOADED, "");
    28752901      cnri.pszCnrTitle = cmp->rightdir;
     
    29993025
    30003026  case WM_COMMAND:
    3001     // 29 Apr 09 SHL fixme to support more context menu items - IDM_VIEW, IDM_EDIT etc.
     3027    // 29 Apr 09 SHL FIXME to support more context menu items - IDM_VIEW, IDM_EDIT etc.
    30023028    switch (SHORT1FROMMP(mp1)) {
    30033029    case IDM_COMPARE:
     
    33253351        ULONG size = sizeof(SWP);
    33263352        USHORT ids[] = {COMP_FRAME, COMP_LEFTDIR, COMP_RIGHTDIR, COMP_COLLECT,
    3327                         COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
    3328                         COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
    3329                         COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
    3330                         COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
    3331                         COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
    3332                         COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
     3353                        COMP_VIEW, COMP_NOTE, COMP_TOTALLEFT, COMP_SELLEFT, COMP_TOTALRIGHT,
     3354                        COMP_SELRIGHT, COMP_CNRMENU, COMP_DIRMENU, COMP_MENU,
     3355                        COMP_INCLUDESUBDIRS, COMP_SETDIRS, COMP_COPYLEFT, COMP_MOVELEFT,
     3356                        COMP_DELETELEFT, COMP_COPYRIGHT, COMP_MOVERIGHT, COMP_DELETERIGHT,
     3357                        COMP_TOTALLEFTHDR, COMP_SELLEFTHDR, COMP_TOTALRIGHTHDR,
     3358                        COMP_SELRIGHTHDR, COMP_FILTER, COMP_HIDENOTSELECTED, 0};
    33333359        UINT x;
    33343360        CHAR s[24];
    33353361        WinQueryWindowPos(hwnd, &swp);
    33363362        PrfWriteProfileData(fmprof, FM3Str, "CompDir.Position", (PVOID) &swp,
    3337                             size);
     3363                            size);
    33383364        for (x = 0; ids[x]; x++) {
    33393365          sprintf(s, "CompDir%i", ids[x]);
     
    33483374        Runtime_Error(pszSrcFile, __LINE__, NULL);
    33493375      else {
    3350         cmp->stop = TRUE;                       // In case thread running
     3376        cmp->stop = TRUE;               // In case thread running
    33513377        if (cmp->filling)
    3352           break;                                // UM_CONTAINER_FILLED will dismiss
     3378          break;                        // UM_CONTAINER_FILLED will dismiss
    33533379      }
    33543380      {
     
    33873413    case IDM_SELECTSAME:                // Name and size
    33883414    case IDM_INVERT:
    3389 
    3390 
    33913415      cmp = INSTDATA(hwnd);
    33923416      if (!cmp)
     
    35333557    cmp = INSTDATA(hwnd);
    35343558    if (cmp) {
    3535       // 17 Jan 08 SHL fixme to know if stop really needed?
     3559      // 17 Jan 08 SHL FIXME to know if stop really needed?
    35363560      WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_COMP_TIMER);
    35373561      if (cmp->dcd.hwndLastMenu)
     
    35473571      DosReleaseMutexSem(hmtxFiltering);
    35483572    }
     3573
     3574#   ifdef PMPRINTF
     3575    PmPrintf_Report(pszSrcFile, __LINE__, "CompareDlgProc EmptyCnr Left");
     3576#   endif
    35493577    EmptyCnr(GetHwndLeft(hwnd));
     3578
     3579#   ifdef PMPRINTF
     3580    PmPrintf_Report(pszSrcFile, __LINE__, "CompareDlgProc EmptyCnr Right");
     3581#   endif
    35503582    EmptyCnr(GetHwndRight(hwnd));
     3583
    35513584    DosPostEventSem(CompactSem);
    35523585    break;
Note: See TracChangeset for help on using the changeset viewer.