From: <ou...@us...> - 2007-07-15 23:06:49
|
Revision: 2073 http://svn.sourceforge.net/jcl/?rev=2073&view=rev Author: outchy Date: 2007-07-15 16:06:45 -0700 (Sun, 15 Jul 2007) Log Message: ----------- Refactoring to remove some hints Modified Paths: -------------- trunk/jcl/install/JclInstall.pas Modified: trunk/jcl/install/JclInstall.pas =================================================================== --- trunk/jcl/install/JclInstall.pas 2007-07-15 20:59:34 UTC (rev 2072) +++ trunk/jcl/install/JclInstall.pas 2007-07-15 23:06:45 UTC (rev 2073) @@ -3020,15 +3020,14 @@ end; function TJclDistribution.GetVersion: string; -var - DailyFileName, SvnEntriesFileName, RevisionText, StableText, Source: string; - TextFile: TJclMappedTextReader; - Revision, Index: Integer; -begin - Revision := 0; + function GetRevision: Integer; + var + DailyFileName, SvnEntriesFileName, RevisionText: string; + TextFile: TJclMappedTextReader; + Index: Integer; + begin + Result := 0; - if JclVersionRelease = 0 then - begin DailyFileName := FJclPath + DailyRevisionFileName; if FileExists(DailyFileName) then begin @@ -3041,14 +3040,14 @@ Index := Length(RevisionText) - 1; // skip the '.' while (Index > 1) and (RevisionText[Index] in AnsiDecDigits) do Dec(Index); - Revision := StrToIntDef(Copy(RevisionText, Index + 1, Length(RevisionText) - Index - 1), 0); + Result := StrToIntDef(Copy(RevisionText, Index + 1, Length(RevisionText) - Index - 1), 0); end; finally TextFile.Free; end; end; - if Revision = 0 then + if Result = 0 then begin SvnEntriesFileName := FJclPath + EntriesFileName1; if not FileExists(SvnEntriesFileName) then @@ -3062,16 +3061,27 @@ TextFile.ReadLn; TextFile.ReadLn; RevisionText := TextFile.ReadLn; - Revision := StrToIntDef(RevisionText, 0); + Result := StrToIntDef(RevisionText, 0); finally TextFile.Free; end; end; end; + end; +var + StableText, Source: string; + Revision: Integer; +begin + if JclVersionRelease = 0 then + begin + Revision := GetRevision; StableText := RsJclVersionTesting; end else + begin + Revision := 0; StableText := RsJclVersionRelease; + end; if Revision = 0 then begin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |