mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 23:58:06 +02:00
IDEIntf: added AddDependencyToOwners
git-svn-id: trunk@33835 -
This commit is contained in:
parent
16bfa87121
commit
1fb32e5be1
@ -833,6 +833,7 @@ var
|
||||
// returns false to abort
|
||||
var
|
||||
Pkg: TIDEPackage;
|
||||
DepOwner: TObject;
|
||||
begin
|
||||
Result:=true;
|
||||
Pkg:=PackageEditingInterface.FindPackageWithName(NewGroupName);
|
||||
@ -852,6 +853,11 @@ var
|
||||
exit(false);
|
||||
end;
|
||||
end;
|
||||
if PackageEditingInterface.IsOwnerDependingOnPkg(CurOwner,NewGroupName,DepOwner)
|
||||
then begin
|
||||
// already depending on package name
|
||||
exit(true);
|
||||
end;
|
||||
// ToDo add dependency
|
||||
|
||||
end;
|
||||
|
@ -218,6 +218,8 @@ type
|
||||
|
||||
function IsOwnerDependingOnPkg(AnOwner: TObject; const PkgName: string;
|
||||
out DependencyOwner: TObject): boolean; virtual; abstract;
|
||||
function AddDependencyToOwners(OwnerList: TFPList; APackage: TIDEPackage;
|
||||
OnlyTestIfPossible: boolean = false): TModalResult; virtual; abstract;
|
||||
function AddUnitDependenciesForComponentClasses(const UnitFilename: string;
|
||||
ComponentClassnames: TStrings;
|
||||
Quiet: boolean = false): TModalResult; virtual; abstract;
|
||||
|
@ -74,8 +74,6 @@ type
|
||||
IsPartOfProject: boolean): TModalResult; virtual; abstract;
|
||||
function FindIncludeFileInProjectDependencies(Project1: TProject;
|
||||
const Filename: string): string; virtual; abstract;
|
||||
function AddDependencyToOwners(OwnerList: TFPList; APackage: TLazPackage;
|
||||
OnlyTestIfPossible: boolean = false): TModalResult; virtual; abstract;
|
||||
function SearchFile(const AFilename: string;
|
||||
SearchFlags: TSearchIDEFileFlags;
|
||||
InObject: TObject): TPkgFile; virtual; abstract;
|
||||
|
@ -217,7 +217,7 @@ type
|
||||
function GetPackageOfCurrentSourceEditor(out APackage: TLazPackage): TPkgFile;
|
||||
function IsOwnerDependingOnPkg(AnOwner: TObject; const PkgName: string;
|
||||
out DependencyOwner: TObject): boolean; override;
|
||||
function AddDependencyToOwners(OwnerList: TFPList; APackage: TLazPackage;
|
||||
function AddDependencyToOwners(OwnerList: TFPList; APackage: TIDEPackage;
|
||||
OnlyTestIfPossible: boolean = false): TModalResult; override;
|
||||
function DoOpenPkgFile(PkgFile: TPkgFile): TModalResult;
|
||||
function FindVirtualUnitSource(PkgFile: TPkgFile): string;
|
||||
@ -3221,14 +3221,16 @@ begin
|
||||
end;
|
||||
|
||||
function TPkgManager.AddDependencyToOwners(OwnerList: TFPList;
|
||||
APackage: TLazPackage; OnlyTestIfPossible: boolean): TModalResult;
|
||||
APackage: TIDEPackage; OnlyTestIfPossible: boolean): TModalResult;
|
||||
var
|
||||
i: Integer;
|
||||
Item: TObject;
|
||||
NewDependency: TPkgDependency;
|
||||
ADependency: TPkgDependency;
|
||||
r: TModalResult;
|
||||
Pkg: TLazPackage;
|
||||
begin
|
||||
Pkg:=APackage as TLazPackage;
|
||||
if not OnlyTestIfPossible then begin
|
||||
Result:=AddDependencyToOwners(OwnerList,APackage,true);
|
||||
if Result<>mrOk then exit;
|
||||
@ -3239,7 +3241,7 @@ begin
|
||||
Item:=TObject(OwnerList[i]);
|
||||
if Item=APackage then continue;
|
||||
if Item is TProject then begin
|
||||
Result:=AddProjectDependency(TProject(Item),APackage,OnlyTestIfPossible);
|
||||
Result:=AddProjectDependency(TProject(Item),Pkg,OnlyTestIfPossible);
|
||||
if Result<>mrOk then exit;
|
||||
end else if Item is TLazPackage then begin
|
||||
NewDependency:=TPkgDependency.Create;
|
||||
|
Loading…
Reference in New Issue
Block a user