Changeset 1344 for trunk/dll/extract.c


Ignore:
Timestamp:
Dec 19, 2008, 2:40:20 PM (17 years ago)
Author:
Gregg Young
Message:

Update extract to filename based subdirectory; Remember now remembers the previous directory and ignores filename as extract path which is identical to its previous behavior. (Ticket 22)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/extract.c

    r1306 r1344  
    100100{
    101101  EXTRDATA *arcdata = NULL;
    102   ULONG size = sizeof(BOOL);
     102  ULONG size;
    103103  BOOL fFileNameExtPath;
    104104
     
    108108    arcdata = (EXTRDATA *) mp2;
    109109    {
    110       ULONG sizet;
     110      BOOL fDirectory = FALSE;
    111111      BOOL fRemember = FALSE;
    112       BOOL fDirectory = FALSE;
    113112      PFNWP oldproc;
    114113
     
    118117      if (oldproc)
    119118        WinSetWindowPtr(WinWindowFromID(hwnd, EXT_DIRECTORY),
    120                         QWL_USER, (PVOID) oldproc);
     119                        QWL_USER, (PVOID) oldproc);
     120      size = sizeof(BOOL);
    121121      PrfQueryProfileData(fmprof, FM3Str, "RememberExt",
    122                           (PVOID) & fRemember, &size);
     122                          (PVOID) & fRemember, &size);
     123      size = sizeof(BOOL);
    123124      PrfQueryProfileData(fmprof, FM3Str, "DirectoryExt",
    124125                          (PVOID) & fDirectory, &size);
     126      size = sizeof(BOOL);
    125127      PrfQueryProfileData(fmprof, FM3Str, "FileNamePathExt",
    126128                          (PVOID) & fFileNameExtPath, &size);
     
    171173      if (fRemember) {
    172174
    173         CHAR textdir[CCHMAXPATH];
    174 
    175         sizet = sizeof(textdir);
    176         *textdir = 0;
    177         PrfQueryProfileData(fmprof, FM3Str, "Ext_ExtractDir",
    178                             (PVOID) textdir, &size);
     175        CHAR textdir[CCHMAXPATH];
     176
     177        PrfQueryProfileString(fmprof, FM3Str, "Ext_ExtractDir", NULL, textdir, sizeof(textdir));
    179178        if (*textdir && !IsFile(textdir))
    180179          strcpy(arcdata->extractdir, textdir);
    181         sizet = sizeof(textdir);
    182         *textdir = 0;
    183         PrfQueryProfileData(fmprof, FM3Str, "Ext_Mask", (PVOID) textdir,
    184                             &size);
     180        PrfQueryProfileString(fmprof, FM3Str, "Ext_Mask", NULL, textdir, sizeof(textdir));
    185181        WinSetDlgItemText(hwnd, EXT_MASK, textdir);
    186182      }
     
    224220        WinEnableWindow(WinWindowFromID(hwnd, EXT_WDIRS), FALSE);
    225221      else if (fRemember) {
    226         //size = sizeof(BOOL);
    227         fRemember = FALSE;
     222        fRemember = FALSE;
     223        size = sizeof(BOOL);
    228224        PrfQueryProfileData(fmprof, FM3Str, "Ext_WDirs",
    229225                            (PVOID) &fRemember, &size);
     
    251247      {
    252248        BOOL fRemember = WinQueryButtonCheckstate(hwnd, EXT_REMEMBER);
    253 
     249        size = sizeof(BOOL);
    254250        PrfWriteProfileData(fmprof, FM3Str, "RememberExt",
    255                             (PVOID) &fRemember, size);
     251                            (PVOID) &fRemember, size);
     252        WinSendDlgItemMsg(hwnd, EXT_FILENAMEEXT, BM_SETCHECK,
     253                            MPFROM2SHORT(FALSE, 0), MPVOID);
    256254      }
    257255      break;
     
    260258      {
    261259        BOOL fDirectory = WinQueryButtonCheckstate(hwnd, EXT_AWDIRS);
    262 
     260        size = sizeof(BOOL);
    263261        PrfWriteProfileData(fmprof, FM3Str, "DirectoryExt",
    264262                            (PVOID) &fDirectory, size);
     
    279277    case EXT_FILENAMEEXT:
    280278      {
    281         BOOL fFileNameExtPath = WinQueryButtonCheckstate(hwnd, EXT_FILENAMEEXT);
    282 
     279        BOOL fFileNameExtPath = WinQueryButtonCheckstate(hwnd, EXT_FILENAMEEXT);
     280        BOOL fRemember = WinQueryButtonCheckstate(hwnd, EXT_REMEMBER);
     281        size = sizeof(BOOL);
    283282        PrfWriteProfileData(fmprof, FM3Str, "FileNamePathExt",
    284                             (PVOID) &fFileNameExtPath, size);
     283                            fRemember ? FALSE : (PVOID) &fFileNameExtPath, size);
     284        if (fRemember)
     285          break;
    285286        if (fFileNameExtPath && arcdata->arcname) {
    286287          CHAR FileName[CCHMAXPATH];
     
    426427          if (fRemember) {
    427428            PrfWriteProfileString(fmprof, FM3Str, "Ext_ExtractDir", s);
    428             fRemember = WinQueryButtonCheckstate(hwnd, EXT_WDIRS);
     429            fRemember = WinQueryButtonCheckstate(hwnd, EXT_WDIRS);
     430            size = sizeof(BOOL);
    429431            PrfWriteProfileData(fmprof, FM3Str, "Ext_WDirs",
    430432                                (PVOID) &fRemember, size);
Note: See TracChangeset for help on using the changeset viewer.