//--------------------------------------------------------------------------- void __fastcall TFileOperationProgressType::Start(TFileOperation AOperation, TOperationSide ASide, int ACount, bool ATemp, const UnicodeString ADirectory, unsigned long ACPSLimit) { Clear(); Operation = AOperation; Side = ASide; Count = ACount; InProgress = true; Cancel = csContinue; Directory = ADirectory; Temp = ATemp; CPSLimit = ACPSLimit; try { DoProgress(); } catch (...) { // connection can be lost during progress callbacks ClearTransfer(); InProgress = false; throw; } }
//--------------------------------------------------------------------------- void __fastcall TFileOperationProgressType::Clear() { FileName = L""; AsciiTransfer = false; ResumeStatus = rsNotAvailable; Count = 0; FFilesFinished = 0; StartTime = Now(); Suspended = false; FSuspendTime = 0; InProgress = false; FileInProgress = false; TotalTransfered = 0; TotalSkipped = 0; TotalSize = 0; SkippedSize = 0; TotalSizeSet = false; Operation = foNone; Temp = false; SkipToAll = false; BatchOverwrite = boNo; // to bypass check in ClearTransfer() TransferSize = 0; CPSLimit = 0; FTicks.clear(); FTotalTransferredThen.clear(); ClearTransfer(); }
//--------------------------------------------------------------------------- void __fastcall TFileOperationProgressType::Stop() { // added to include remaining bytes to TotalSkipped, in case // the progress happens to update before closing ClearTransfer(); InProgress = false; DoProgress(); }
//--------------------------------------------------------------------------- void __fastcall TFileOperationProgressType::SetFile(UnicodeString AFileName, bool AFileInProgress) { FileName = AFileName; FileInProgress = AFileInProgress; ClearTransfer(); FFileStartTime = Now(); DoProgress(); }
//--------------------------------------------------------------------------- void __fastcall TFileOperationProgressType::SetFile(UnicodeString AFileName, bool AFileInProgress) { FullFileName = AFileName; if (Side == osRemote) { // historically set were passing filename-only for remote site operations, // now we need to collect a full paths, so we pass in full path, // but still want to have filename-only in FileName AFileName = UnixExtractFileName(AFileName); } FileName = AFileName; FileInProgress = AFileInProgress; ClearTransfer(); FFileStartTime = Now(); DoProgress(); }