IDE: catch wrong dates

git-svn-id: trunk@35086 -
This commit is contained in:
mattias 2012-02-02 15:09:48 +00:00
parent f9917204fc
commit 971b471ca4
10 changed files with 13 additions and 13 deletions

View File

@ -132,7 +132,7 @@ function SetCurrentDirUTF8(const NewDir: String): Boolean; inline;
function CreateDirUTF8(const NewDir: String): Boolean; inline;
function RemoveDirUTF8(const Dir: String): Boolean; inline;
function ForceDirectoriesUTF8(const Dir: string): Boolean; inline;
function FileDateToDateTimeDef(aFileDate: TCTFileAgeTime; const Default: TDateTime): TDateTime;
function FileDateToDateTimeDef(aFileDate: TCTFileAgeTime; const Default: TDateTime = 0): TDateTime;
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
function GetTempFilename(const Path, Prefix: string): string;
@ -2395,7 +2395,7 @@ end;
function FileAgeToStr(aFileAge: longint): string;
begin
Result:=DateTimeToStr(FileDateToDateTime(aFileAge));
Result:=DateTimeToStr(FileDateToDateTimeDef(aFileAge));
end;
//------------------------------------------------------------------------------

View File

@ -882,7 +882,7 @@ begin
Result := '<invalid time>';
exit;
end;
DT := FileDateToDateTime(t);
DT := FileDateToDateTimeDef(t);
DecodeTime(DT,hour,min,sec,hsec);
DecodeDate(DT,year,month,day);
Result := L0(Year)+'/'+L0(Month)+'/'+L0(Day)+' '+L0(Hour)+':'+L0(min)+':'+L0(sec);

View File

@ -91,7 +91,7 @@ begin
Result:=rsModified;
try
Result:=Result+FormatDateTime('DD/MM/YYYY hh:mm',
FileDateToDateTime(FileAgeUTF8(AFilename)));
FileDateToDateTimeDef(FileAgeUTF8(AFilename)));
except
Result:=Result+'?';
end;

View File

@ -38,7 +38,7 @@ unit IDECmdLine;
interface
uses
Classes, SysUtils, FileUtil, LazConf, LCLProc, LazarusIDEStrConsts;
Classes, SysUtils, FileUtil, LazConf, LCLProc;
const
ShowSetupDialogOptLong='--setup';

View File

@ -275,9 +275,9 @@ begin
if CfgCache<>nil then begin
sl.Add('Compiler='+CfgCache.Compiler);
sl.Add('Options='+CfgCache.CompilerOptions);
sl.Add('CompilerDate='+DateTimeToStr(FileDateToDateTime(CfgCache.CompilerDate)));
sl.Add('CompilerDate='+DateTimeToStr(FileDateToDateTimeDef(CfgCache.CompilerDate)));
sl.Add('RealCompiler='+CfgCache.RealCompiler);
sl.Add('RealCompilerDate='+DateTimeToStr(FileDateToDateTime(CfgCache.RealCompilerDate)));
sl.Add('RealCompilerDate='+DateTimeToStr(FileDateToDateTimeDef(CfgCache.RealCompilerDate)));
sl.Add('RealTargetOS='+CfgCache.RealTargetOS);
sl.Add('RealTargetCPU='+CfgCache.RealTargetCPU);
sl.Add('RealCompilerInPath='+CfgCache.RealCompilerInPath);

View File

@ -29,7 +29,7 @@
{For Linux specific implementations.
General unix implementations are in ../unix/lazbaseconf.inc}
uses
Unix, BaseUnix;
Unix;
procedure IfDirectoryExistsAdd(const Directory: string; List: TStrings);
begin

View File

@ -294,11 +294,11 @@ begin
+#13
+'The system default executable'#13
+DefaultExe+#13
+'(date: '+DateTimeToStr(FileDateToDateTime(FileAgeUTF8(DefaultExe)))+')'#13
+'(date: '+DateTimeToStr(FileDateToDateTimeDef(FileAgeUTF8(DefaultExe)))+')'#13
+#13
+'Or your custom executable'#13
+CustomExe+#13
+'(date: '+DateTimeToStr(FileDateToDateTime(FileAgeUTF8(CustomExe)))+')'#13
+'(date: '+DateTimeToStr(FileDateToDateTimeDef(FileAgeUTF8(CustomExe)))+')'#13
,mtConfirmation,
[mrYes,'Start system default',mrNo,'Start my custom',mrAbort],0
);

View File

@ -47,7 +47,7 @@ type
TSplashForm = class(TForm)
Image: TImage;
procedure ApplicationOnIdle(Sender: TObject; var Done: boolean);
procedure ApplicationOnIdle(Sender: TObject; var {%H-}Done: boolean);
procedure ImagePaint(Sender: TObject);
private
protected

View File

@ -573,7 +573,7 @@ begin
exit(mrCancel);
end;
try
PkgLink.FileDate:=FileDateToDateTime(FileAgeUTF8(AFilename));
PkgLink.FileDate:=FileDateToDateTimeDef(FileAgeUTF8(AFilename));
PkgLink.FileDateValid:=true;
XMLConfig:=TXMLConfig.Create(nil);
NewPackage:=TLazPackage.Create;

View File

@ -2352,7 +2352,7 @@ begin
APackage.LPKSource:=Code;
PkgLink:=PkgLinks.AddUserLink(APackage);
if PkgLink<>nil then begin
PkgLink.FileDate:=FileDateToDateTime(FileAgeUTF8(APackage.Filename));
PkgLink.FileDate:=FileDateToDateTimeDef(FileAgeUTF8(APackage.Filename));
PkgLink.FileDateValid:=true;
PkgLinks.SaveUserLinks;
end;