зеркало из https://github.com/mozilla/pjs.git
Restoring file dates when decoding was off by 12 hours. This is now fixed. [r=ssu]
This commit is contained in:
Родитель
63d1d03215
Коммит
91c69bcd0e
|
@ -29,41 +29,6 @@
|
|||
#include "MoreDesktopMgr.h"
|
||||
#include "IterateDirectory.h"
|
||||
|
||||
OSErr DTSetAPPL(Str255 volName,
|
||||
short vRefNum,
|
||||
OSType creator,
|
||||
long applParID,
|
||||
Str255 applName)
|
||||
{
|
||||
OSErr err;
|
||||
DTPBRec *pb = NULL;
|
||||
short dtRefNum;
|
||||
short realVRefNum;
|
||||
Boolean newDTDatabase;
|
||||
/* get the real vRefnum */
|
||||
err = DetermineVRefNum(volName, vRefNum, &realVRefNum);
|
||||
if (err == noErr)
|
||||
{
|
||||
err = DTOpen(volName, vRefNum, &dtRefNum, &newDTDatabase);
|
||||
if (err == noErr && !newDTDatabase)
|
||||
{
|
||||
pb = (DTPBRec*) NewPtrClear( sizeof(DTPBRec) );
|
||||
|
||||
if (pb==NULL) return -1;
|
||||
|
||||
pb->ioNamePtr = applName;
|
||||
pb->ioDTRefNum = dtRefNum;
|
||||
pb->ioDirID = applParID;
|
||||
pb->ioFileCreator = creator;
|
||||
|
||||
err = PBDTAddAPPLSync(pb);
|
||||
|
||||
if (pb) DisposePtr((Ptr)pb);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------*
|
||||
* Constructors/Destructor
|
||||
*----------------------------------------------------------------------*/
|
||||
|
@ -454,10 +419,10 @@ nsAppleSingleDecoder::ProcessFileDates(ASEntry inEntry)
|
|||
err = PBGetCatInfoSync(&pb);
|
||||
if ( err != noErr )
|
||||
return -1;
|
||||
#define YR_2000_SECONDS 3029572800
|
||||
pb.hFileInfo.ioFlCrDat = dates.create + 3029572800;
|
||||
pb.hFileInfo.ioFlMdDat = dates.modify + 3029572800;
|
||||
pb.hFileInfo.ioFlBkDat = dates.backup + 3029572800;
|
||||
#define YR_2000_SECONDS 3029529600
|
||||
pb.hFileInfo.ioFlCrDat = dates.create + YR_2000_SECONDS;
|
||||
pb.hFileInfo.ioFlMdDat = dates.modify + YR_2000_SECONDS;
|
||||
pb.hFileInfo.ioFlBkDat = dates.backup + YR_2000_SECONDS;
|
||||
/* Not sure if mac has the last access time */
|
||||
|
||||
nsAppleSingleDecoder::PLstrncpy(name, mOutSpec->name, mOutSpec->name[0]);
|
||||
|
@ -595,6 +560,41 @@ nsAppleSingleDecoder::EntryToMacFile(ASEntry inEntry, UInt16 inTargetSpecRefNum)
|
|||
return err;
|
||||
}
|
||||
|
||||
OSErr DTSetAPPL(Str255 volName,
|
||||
short vRefNum,
|
||||
OSType creator,
|
||||
long applParID,
|
||||
Str255 applName)
|
||||
{
|
||||
OSErr err;
|
||||
DTPBRec *pb = NULL;
|
||||
short dtRefNum;
|
||||
short realVRefNum;
|
||||
Boolean newDTDatabase;
|
||||
/* get the real vRefnum */
|
||||
err = DetermineVRefNum(volName, vRefNum, &realVRefNum);
|
||||
if (err == noErr)
|
||||
{
|
||||
err = DTOpen(volName, vRefNum, &dtRefNum, &newDTDatabase);
|
||||
if (err == noErr && !newDTDatabase)
|
||||
{
|
||||
pb = (DTPBRec*) NewPtrClear( sizeof(DTPBRec) );
|
||||
|
||||
if (pb==NULL) return -1;
|
||||
|
||||
pb->ioNamePtr = applName;
|
||||
pb->ioDTRefNum = dtRefNum;
|
||||
pb->ioDirID = applParID;
|
||||
pb->ioFileCreator = creator;
|
||||
|
||||
err = PBDTAddAPPLSync(pb);
|
||||
|
||||
if (pb) DisposePtr((Ptr)pb);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
OSErr
|
||||
nsAppleSingleDecoder::FSMakeUnique(FSSpec *ioSpec)
|
||||
{
|
||||
|
|
|
@ -205,6 +205,18 @@ private:
|
|||
OSErr FSMakeUnique(FSSpec *ioSpec);
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
OSErr DTSetAPPL(Str255 volName,short vRefNum,OSType creator,long applParID,Str255 applName);
|
||||
pascal void
|
||||
DecodeDirIterateFilter(const CInfoPBRec * const cpbPtr, Boolean *quitFlag, void *yourDataPtr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma options align=reset
|
||||
|
||||
#endif /* _NS_APPLESINGLEDECODER_H_ */
|
Загрузка…
Ссылка в новой задаче