Login | ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/delphiutils/trunk/FileReadChecker/FileReadCheckerMain.pas
(Generate patch)

Comparing trunk/FileReadChecker/FileReadCheckerMain.pas (file contents):
Revision 84 by daniel-marschall, Fri May 3 12:26:45 2019 UTC vs.
Revision 85 by daniel-marschall, Mon May 6 17:42:23 2019 UTC

# Line 16 | Line 16 | type
16      ProgressBar1: TProgressBar;
17      procedure Button1Click(Sender: TObject);
18      procedure FormClose(Sender: TObject; var Action: TCloseAction);
19 +    procedure FormCreate(Sender: TObject);
20    private
21      procedure FindFiles(FilesList: TStrings; StartDir, FileMask: string; errorSL: TStrings=nil);
22      procedure EnableDisableControls(enabled: boolean);
# Line 45 | Line 46 | begin
46    begin
47      Application.ProcessMessages;
48      if Application.Terminated then Abort;
49 +
50 +    if FilesList.Count = FilesList.Capacity - 1 then
51 +      FilesList.Capacity := FilesList.Capacity + 1000;
52 +
53      FilesList.Add(StartDir + SR.Name);
54      IsFound := FindNext(SR) = 0;
55    end;
# Line 117 | Line 122 | begin
122      cnt := 0;
123      sl := TStringList.Create;
124      try
125 +      sl.Sorted := false;
126        sl.BeginUpdate;
127        Label2.Caption := 'Scan folders ...';
128        
# Line 137 | Line 143 | begin
143            inc(cnt);
144          end;
145  
146 <        Label2.Caption := MinimizeName(fil, Label2.Canvas, Label2.Width);
146 >        QueryPerformanceCounter(c2);
147 >        elapsedSecs := Ceil((c2-c1)/f);
148 >        Label2.Caption := MinimizeName(Format('[%.2d:%.2d:%.2d] %s', [elapsedSecs div 3600, elapsedSecs mod 3600 div 60, elapsedSecs mod 3600 mod 60, fil]), Label2.Canvas, Label2.Width);
149  
150          Application.ProcessMessages;
151          if Application.Terminated then Abort;
# Line 152 | Line 160 | begin
160        QueryPerformanceCounter(c2);
161        elapsedSecs := Ceil((c2-c1)/f);
162  
163 <      ShowMessageFmt('Finished. Found %d error(s). Time: %.2d:%.2d:%.2d', [cnt, elapsedSecs div 3600, elapsedSecs mod 3600 div 60, elapsedSecs mod 3600 mod 60]);
163 >      ShowMessageFmt('Finished. Found %d error(s). Elapsed time: %.2d:%.2d:%.2d', [cnt, elapsedSecs div 3600, elapsedSecs mod 3600 div 60, elapsedSecs mod 3600 mod 60]);
164      end;
165    finally
166      EnableDisableControls(true);
# Line 164 | Line 172 | begin
172    Application.Terminate;
173   end;
174  
175 + procedure TForm1.FormCreate(Sender: TObject);
176 + begin
177 +  DoubleBuffered := true;
178 +
179 +  {$IFDEF UNICODE}
180 +  Caption := Caption + ' [Unicode]';
181 +  {$ELSE}
182 +  Caption := Caption + ' [ANSI]';
183 +  {$ENDIF}
184 + end;
185 +
186   procedure TForm1.EnableDisableControls(enabled: boolean);
187   begin
188    Button1.Enabled := enabled;
189    Label1.Enabled := enabled;
190    Edit1.Enabled := enabled;
191 <  Memo1.Enabled := enabled;
191 >  // Memo1.Enabled := enabled; // is already readonly by default
192   end;
193  
194   end.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines