DocMgr: adopt to modified engine

git-svn-id: trunk@35084 -
This commit is contained in:
dodi 2012-02-02 13:24:51 +00:00
parent cf7bcd2c21
commit 916b25ac4d
4 changed files with 17 additions and 32 deletions

View File

@ -95,9 +95,8 @@
<UnitName Value="ConfigFile"/>
</Unit8>
<Unit9>
<Filename Value="..\..\..\fpc-trunk\utils\fpdoc\dglobals.pp"/>
<Filename Value="text.txt"/>
<IsPartOfProject Value="True"/>
<UnitName Value="dGlobals"/>
</Unit9>
</Units>
</ProjectOptions>
@ -109,7 +108,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="$(FPCSrcDir)\utils\fpdoc"/>
<OtherUnitFiles Value="$(FPCSrcDir)\utils\fpdoc;$(FPCSrcDir)\packages\fcl-passrc\src"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
@ -127,7 +126,7 @@
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="4">
<Exceptions Count="5">
<Item1>
<Name Value="EAbort"/>
</Item1>
@ -140,6 +139,9 @@
<Item4>
<Name Value="EStringListError"/>
</Item4>
<Item5>
<Name Value="EParserError"/>
</Item5>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -7,7 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, dGlobals, umakeskel, fMain, fConfig, uManager, fLogView,
Forms, umakeskel, fMain, fConfig, uManager, fLogView,
fUpdateView, ulpk, ConfigFile;
{$R *.res}

View File

@ -431,6 +431,7 @@ begin
begin
FModules:=TStringList.Create;
FModules.Sorted:=True;
FModules.OwnsObjects := True; //auto destroy
end;
I:=FModules.IndexOf(AName);
IF (I=-1) then
@ -444,17 +445,19 @@ begin
end;
Destructor TSkelEngine.Destroy;
Var
I : Integer;
begin
If Assigned(FModules) then
{$IFDEF old}
If Assigned(FModules) then
begin
For I:=0 to FModules.Count-1 do
FModules.Objects[i].Free;
FreeAndNil(FModules);
end;
{$ELSE}
FreeAndNil(FModules);
{$ENDIF}
end;
Function TSkelEngine.MustWriteElement(El : TPasElement; Full : Boolean) : Boolean;

View File

@ -109,7 +109,6 @@ type
property Requires: TStrings read FRequires write SetRequires; //only string?
property IncludePath: string read FIncludePath write SetIncludePath; //-Fi
property UnitPath: string read FUnitPath write SetUnitPath; //-Fu
//property DefOS: string; - variations!
end;
{ TFPDocHelper }
@ -156,7 +155,6 @@ type
FRootDir: string;
UpdateCount: integer;
procedure SetFPDocDir(AValue: string);
procedure SetLazarusDir(AValue: string);
procedure SetOnChange(AValue: TNotifyEvent);
procedure SetPackage(AValue: TDocPackage);
procedure SetProfile(AValue: string);
@ -177,7 +175,7 @@ type
function LoadConfig(const ADir: string; Force: boolean = False): boolean;
function SaveConfig: boolean;
procedure AddProfile(const AName: string);
function AddProject(const APkg, AFile: string; UpdateCfg: boolean): boolean; //from config
function AddProject(const APkg, AFile: string): boolean; //from config
function CreateProject(const AFileName: string; APkg: TDocPackage): boolean;
function AddPackage(AName: string): TDocPackage;
function ImportLpk(const AFile: string): TDocPackage;
@ -189,7 +187,6 @@ type
function Update(APkg: TDocPackage; const AUnit: string): boolean;
public //published?
property FpcDocDir: string read FFPDocDir write SetFPDocDir;
//property LazarusDir: string read FLazarusDir write SetLazarusDir;
property RootDir: string read FRootDir write SetRootDir;
property Options: TCmdOptions read FOptions;
property Profile: string read FProfile write SetProfile;
@ -264,11 +261,6 @@ begin
if FRequires=AValue then Exit;
if AValue = nil then exit;
if AValue.Count = 0 then exit;
{
if Pos('=', AValue[0]) > 0 then
FRequires.Assign(AValue) //clears previous content
else
}
Import;
end;
@ -534,7 +526,6 @@ begin
Config.WriteSectionValues('descrs', Descriptions);
//all done
Config.Flush;
//Config.UpdateFile; //not dirty???
Loaded := True;
end;
@ -570,7 +561,7 @@ end;
destructor TFPDocManager.Destroy;
begin
SaveConfig;
FreeAndNil(Config); //save?
FreeAndNil(Config);
FreeAndNil(FPackages);
FreeAndNil(FOptions);
inherited Destroy;
@ -582,12 +573,6 @@ begin
FFPDocDir:=AValue;
end;
procedure TFPDocManager.SetLazarusDir(AValue: string);
begin
if FLazarusDir=AValue then Exit;
FLazarusDir:=AValue;
end;
procedure TFPDocManager.SetOnChange(AValue: TNotifyEvent);
begin
if FOnChange=AValue then Exit;
@ -705,7 +690,7 @@ begin
s := Packages.Names[i];
pf := Packages.ValueFromIndex[i];
if pf <> '' then begin
AddProject(s, pf, False); //add and load project file, don't update config!
AddProject(s, pf); //add and load project file, don't update config!
FModified := True; //force app notification
end;
end;
@ -761,7 +746,6 @@ begin
//create project file
APkg.ProjectFile := ChangeFileExt(APkg.ProjectFile, '_prj.xml');
CreateProject(APkg.ProjectFile, APkg);
//APkg.UpdateConfig; - required?
//update Packages[] string
Packages[Result] := APkg.Name + '=' + APkg.ProjectFile;
end;
@ -774,7 +758,7 @@ end;
Called by
- init - not Dirty!
*)
function TFPDocManager.AddProject(const APkg, AFile: string; UpdateCfg: boolean): boolean;
function TFPDocManager.AddProject(const APkg, AFile: string): boolean;
var
pkg: TDocPackage;
i: integer;
@ -902,8 +886,6 @@ begin
pkg.Loaded := False; //force reload
if not pkg.Loaded then begin
Result := pkg.ImportProject(Helper, Helper.Package, AFile);
//register now, with project file known
//RegisterPackage(pkg);
end;
finally
EndTest;
@ -998,7 +980,6 @@ begin
if not Result then
exit;
APkg.CreateProject(self, ''); //create project file?
//ParseFPDocOption('--project='+APkg.ProjectFile);
Package := Packages.FindPackage(APkg.Name);
//Options?
//okay, so far
@ -1089,7 +1070,6 @@ end;
(* MakeSkel functionality - create skeleton or update file
using temporary Project
*)
//function TFPDocManager.Update(APkg: TDocPackage; const AUnit: string): boolean;
function TFPDocHelper.Update(APkg: TDocPackage; const AUnit: string): boolean;
function DocumentUnit(const AUnit: string): boolean;