mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 14:40:24 +02:00
IDE: catch wrong dates
git-svn-id: trunk@35086 -
This commit is contained in:
parent
f9917204fc
commit
971b471ca4
@ -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;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -38,7 +38,7 @@ unit IDECmdLine;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LazConf, LCLProc, LazarusIDEStrConsts;
|
||||
Classes, SysUtils, FileUtil, LazConf, LCLProc;
|
||||
|
||||
const
|
||||
ShowSetupDialogOptLong='--setup';
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user