mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 20:18:19 +02:00
IDE: added macro FallBackOutputRoot, source editor context menu item to open package of package source file
git-svn-id: trunk@28932 -
This commit is contained in:
parent
ca4fb99240
commit
a8b437d1a0
@ -113,6 +113,9 @@ type
|
|||||||
var Abort: boolean): string;
|
var Abort: boolean): string;
|
||||||
function MacroFuncSecondaryConfigPath(const Param: string; const Data: PtrInt;
|
function MacroFuncSecondaryConfigPath(const Param: string; const Data: PtrInt;
|
||||||
var Abort: boolean): string;
|
var Abort: boolean): string;
|
||||||
|
function MacroFuncFallbackOutputRoot(const Param: string; const Data: PtrInt;
|
||||||
|
var Abort: boolean): string;
|
||||||
|
|
||||||
function CTMacroFuncProjectUnitPath(Data: Pointer): boolean;
|
function CTMacroFuncProjectUnitPath(Data: Pointer): boolean;
|
||||||
function CTMacroFuncProjectIncPath(Data: Pointer): boolean;
|
function CTMacroFuncProjectIncPath(Data: Pointer): boolean;
|
||||||
function CTMacroFuncProjectSrcPath(Data: Pointer): boolean;
|
function CTMacroFuncProjectSrcPath(Data: Pointer): boolean;
|
||||||
@ -318,6 +321,8 @@ begin
|
|||||||
lisPrimaryConfigPath, @MacroFuncPrimaryConfigPath, []));
|
lisPrimaryConfigPath, @MacroFuncPrimaryConfigPath, []));
|
||||||
GlobalMacroList.Add(TTransferMacro.Create('SecondaryConfigPath','',
|
GlobalMacroList.Add(TTransferMacro.Create('SecondaryConfigPath','',
|
||||||
lisSecondaryConfigPath, @MacroFuncSecondaryConfigPath, []));
|
lisSecondaryConfigPath, @MacroFuncSecondaryConfigPath, []));
|
||||||
|
GlobalMacroList.Add(TTransferMacro.Create('FallbackOutputRoot','',
|
||||||
|
lisSecondaryConfigPath, @MacroFuncFallbackOutputRoot, []));
|
||||||
|
|
||||||
// codetools macro functions
|
// codetools macro functions
|
||||||
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
|
CodeToolBoss.DefineTree.MacroFunctions.AddExtended(
|
||||||
@ -1405,6 +1410,12 @@ begin
|
|||||||
Result:=GetSecondaryConfigPath;
|
Result:=GetSecondaryConfigPath;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TBuildManager.MacroFuncFallbackOutputRoot(const Param: string;
|
||||||
|
const Data: PtrInt; var Abort: boolean): string;
|
||||||
|
begin
|
||||||
|
Result:=AppendPathDelim(GetPrimaryConfigPath)+'lib';
|
||||||
|
end;
|
||||||
|
|
||||||
function TBuildManager.MacroFuncSrcOS(const Param: string; const Data: PtrInt;
|
function TBuildManager.MacroFuncSrcOS(const Param: string; const Data: PtrInt;
|
||||||
var Abort: boolean): string;
|
var Abort: boolean): string;
|
||||||
begin
|
begin
|
||||||
|
@ -246,7 +246,6 @@ const
|
|||||||
type
|
type
|
||||||
TLocalSubstitutionEvent = function(const s: string;
|
TLocalSubstitutionEvent = function(const s: string;
|
||||||
PlatformIndependent: boolean): string of object;
|
PlatformIndependent: boolean): string of object;
|
||||||
TGetWritableOutputDirectory = procedure(var s: string) of object;
|
|
||||||
|
|
||||||
TCompilerOptionsParseType = (
|
TCompilerOptionsParseType = (
|
||||||
coptUnparsed, // no macros resolved
|
coptUnparsed, // no macros resolved
|
||||||
|
@ -109,6 +109,15 @@ type
|
|||||||
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TQuickFixRecompilingChecksumChanged }
|
||||||
|
|
||||||
|
TQuickFixRecompilingChecksumChanged = class(TIDEMsgQuickFixItem)
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
function IsApplicable(Line: TIDEMessageLine): boolean; override;
|
||||||
|
procedure Execute(const Msg: TIDEMessageLine; Step: TIMQuickFixStep); override;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure QuickFixParameterNotUsed(Sender: TObject; Step: TIMQuickFixStep;
|
procedure QuickFixParameterNotUsed(Sender: TObject; Step: TIMQuickFixStep;
|
||||||
Msg: TIDEMessageLine);
|
Msg: TIDEMessageLine);
|
||||||
procedure QuickFixUnitNotUsed(Sender: TObject; Step: TIMQuickFixStep;
|
procedure QuickFixUnitNotUsed(Sender: TObject; Step: TIMQuickFixStep;
|
||||||
@ -250,6 +259,7 @@ begin
|
|||||||
RegisterIDEMsgQuickFix(TQuickFixIdentifierNotFoundAddLocal.Create);
|
RegisterIDEMsgQuickFix(TQuickFixIdentifierNotFoundAddLocal.Create);
|
||||||
RegisterIDEMsgQuickFix(TQuickFixLocalVariableNotUsed_Remove.Create);
|
RegisterIDEMsgQuickFix(TQuickFixLocalVariableNotUsed_Remove.Create);
|
||||||
RegisterIDEMsgQuickFix(TQuickFixHint_Hide.Create);
|
RegisterIDEMsgQuickFix(TQuickFixHint_Hide.Create);
|
||||||
|
//RegisterIDEMsgQuickFix(TQuickFixRecompilingChecksumChanged.Create);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure FreeStandardIDEQuickFixItems;
|
procedure FreeStandardIDEQuickFixItems;
|
||||||
@ -257,6 +267,35 @@ begin
|
|||||||
FreeThenNil(IDEMsgQuickFixes);
|
FreeThenNil(IDEMsgQuickFixes);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TQuickFixRecompilingChecksumChanged }
|
||||||
|
|
||||||
|
constructor TQuickFixRecompilingChecksumChanged.Create;
|
||||||
|
begin
|
||||||
|
Name:='Show dialog for message Recompiling Unit1, checksum changed for Unit1';
|
||||||
|
Caption:='Explore message "checksum changed"';
|
||||||
|
Steps:=[imqfoMenuItem];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TQuickFixRecompilingChecksumChanged.IsApplicable(Line: TIDEMessageLine
|
||||||
|
): boolean;
|
||||||
|
begin
|
||||||
|
Result:=false;
|
||||||
|
if not REMatches(Line.Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i')
|
||||||
|
then exit;
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TQuickFixRecompilingChecksumChanged.Execute(
|
||||||
|
const Msg: TIDEMessageLine; Step: TIMQuickFixStep);
|
||||||
|
begin
|
||||||
|
if Step=imqfoMenuItem then begin
|
||||||
|
debugln(['TQuickFixRecompilingChecksumChanged.Execute ']);
|
||||||
|
if not REMatches(Msg.Msg,'Recompiling ([a-z_][a-z_0-9]*), checksum changed for ([a-z_][a-z_0-9]*)','i')
|
||||||
|
then exit;
|
||||||
|
debugln(['TQuickFixRecompilingChecksumChanged.Execute Unit1=',REVar(1),', checksum changed for Unit2=',REVar(2)]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TQuickFixUnitNotFoundPosition }
|
{ TQuickFixUnitNotFoundPosition }
|
||||||
|
|
||||||
constructor TQuickFixUnitNotFoundPosition.Create;
|
constructor TQuickFixUnitNotFoundPosition.Create;
|
||||||
|
@ -5175,7 +5175,7 @@ var
|
|||||||
|
|
||||||
procedure MaybeAddPopup(const ASuffix: String; const ANewOnClick: TNotifyEvent);
|
procedure MaybeAddPopup(const ASuffix: String; const ANewOnClick: TNotifyEvent);
|
||||||
begin
|
begin
|
||||||
if FileExistsUTF8(ChangeFileExt(CurFilename,ASuffix)) then
|
if FileExistsCached(ChangeFileExt(CurFilename,ASuffix)) then
|
||||||
AddContextPopupMenuItem(Format(lisOpenLfm,
|
AddContextPopupMenuItem(Format(lisOpenLfm,
|
||||||
[ChangeFileExt(FileName,ASuffix)]), true, ANewOnClick);
|
[ChangeFileExt(FileName,ASuffix)]), true, ANewOnClick);
|
||||||
end;
|
end;
|
||||||
|
@ -50,7 +50,7 @@ var
|
|||||||
of REMatches.
|
of REMatches.
|
||||||
The ModifierStr sets the default values of r.e.syntax modifiers. Modifiers
|
The ModifierStr sets the default values of r.e.syntax modifiers. Modifiers
|
||||||
in r.e. (?ismx-ismx) will replace this default values.
|
in r.e. (?ismx-ismx) will replace this default values.
|
||||||
If you try to set unsupported modifier, Error will be called
|
If you try to set unsupported modifier, an exception is raised
|
||||||
|
|
||||||
Modifier /i - caseinsensitive, initialized from RegExprModifierI
|
Modifier /i - caseinsensitive, initialized from RegExprModifierI
|
||||||
Modifier /s - '.' works as any char (else as [^\n]),
|
Modifier /s - '.' works as any char (else as [^\n]),
|
||||||
@ -63,7 +63,7 @@ var
|
|||||||
Examples:
|
Examples:
|
||||||
if REMatches('Lazarus','aza') then ...
|
if REMatches('Lazarus','aza') then ...
|
||||||
|
|
||||||
if REMatches('Lazarus','a(.)a') then
|
if REMatches('Lazarus','a(.)a','i') then
|
||||||
s:=REVar(1); // this will be the 'z'
|
s:=REVar(1); // this will be the 'z'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,7 +861,6 @@ var
|
|||||||
OnGetAllRequiredPackages: TGetAllRequiredPackagesEvent = nil;
|
OnGetAllRequiredPackages: TGetAllRequiredPackagesEvent = nil;
|
||||||
OnGetDependencyOwnerDescription: TGetDependencyOwnerDescription = nil;
|
OnGetDependencyOwnerDescription: TGetDependencyOwnerDescription = nil;
|
||||||
OnGetDependencyOwnerDirectory: TGetDependencyOwnerDirectory = nil;
|
OnGetDependencyOwnerDirectory: TGetDependencyOwnerDirectory = nil;
|
||||||
OnGetWritablePkgOutputDirectory: TGetWritablePkgOutputDirectory = nil;
|
|
||||||
OnPackageFileLoaded: TNotifyEvent = nil;
|
OnPackageFileLoaded: TNotifyEvent = nil;
|
||||||
|
|
||||||
function CompareLazPackageID(Data1, Data2: Pointer): integer;
|
function CompareLazPackageID(Data1, Data2: Pointer): integer;
|
||||||
|
@ -285,6 +285,7 @@ type
|
|||||||
out NeedBuildAllFlag: boolean): TModalResult;
|
out NeedBuildAllFlag: boolean): TModalResult;
|
||||||
function PreparePackageOutputDirectory(APackage: TLazPackage;
|
function PreparePackageOutputDirectory(APackage: TLazPackage;
|
||||||
CleanUp: boolean): TModalResult;
|
CleanUp: boolean): TModalResult;
|
||||||
|
function GetFallbackOutputDir(APackage: TLazPackage): string;
|
||||||
function CheckAmbiguousPackageUnits(APackage: TLazPackage): TModalResult;
|
function CheckAmbiguousPackageUnits(APackage: TLazPackage): TModalResult;
|
||||||
function SavePackageMainSource(APackage: TLazPackage;
|
function SavePackageMainSource(APackage: TLazPackage;
|
||||||
Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult;
|
Flags: TPkgCompileFlags; ShowAbort: boolean): TModalResult;
|
||||||
@ -3043,9 +3044,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
// the normal output directory is not writable
|
// the normal output directory is not writable
|
||||||
// => try the fallback directory
|
// => try the fallback directory
|
||||||
if not Assigned(OnGetWritablePkgOutputDirectory) then exit;
|
NewOutputDir:=GetFallbackOutputDir(APackage);
|
||||||
NewOutputDir:=OutputDir;
|
|
||||||
OnGetWritablePkgOutputDirectory(APackage,NewOutputDir);
|
|
||||||
if (NewOutputDir=OutputDir) or (NewOutputDir='') then exit;
|
if (NewOutputDir=OutputDir) or (NewOutputDir='') then exit;
|
||||||
APackage.CompilerOptions.ParsedOpts.OutputDirectoryOverride:=NewOutputDir;
|
APackage.CompilerOptions.ParsedOpts.OutputDirectoryOverride:=NewOutputDir;
|
||||||
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
Result:=CheckIfCurPkgOutDirNeedsCompile(APackage,
|
||||||
@ -3854,9 +3853,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// the normal output directory is not writable
|
// the normal output directory is not writable
|
||||||
// => use the fallback directory
|
// => use the fallback directory
|
||||||
if not Assigned(OnGetWritablePkgOutputDirectory) then exit(mrCancel);
|
NewOutputDir:=GetFallbackOutputDir(APackage);
|
||||||
NewOutputDir:=OutputDir;
|
|
||||||
OnGetWritablePkgOutputDirectory(APackage,NewOutputDir);
|
|
||||||
if (NewOutputDir=OutputDir) or (NewOutputDir='') then exit(mrCancel);
|
if (NewOutputDir=OutputDir) or (NewOutputDir='') then exit(mrCancel);
|
||||||
APackage.CompilerOptions.ParsedOpts.OutputDirectoryOverride:=NewOutputDir;
|
APackage.CompilerOptions.ParsedOpts.OutputDirectoryOverride:=NewOutputDir;
|
||||||
end;
|
end;
|
||||||
@ -3908,6 +3905,25 @@ begin
|
|||||||
Result:=mrOk;
|
Result:=mrOk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLazPackageGraph.GetFallbackOutputDir(APackage: TLazPackage): string;
|
||||||
|
var
|
||||||
|
Dir: String;
|
||||||
|
begin
|
||||||
|
// use the default output directory, if it is relative
|
||||||
|
// (this way the fallback creates the same amount of target directories)
|
||||||
|
Dir:=APackage.CompilerOptions.ParsedOpts.UnparsedValues[pcosOutputDir];
|
||||||
|
Dir:=APackage.SubstitutePkgMacros(Dir,false);
|
||||||
|
GlobalMacroList.SubstituteStr(Dir);
|
||||||
|
if FilenameIsAbsolute(Dir) then begin
|
||||||
|
// it is not relative => create a default one
|
||||||
|
Dir:='$(TargetOS)-$(TargetCPU)';
|
||||||
|
end;
|
||||||
|
Dir:='$(FallbackOutputRoot)'+PathDelim+APackage.Name+PathDelim+Dir;
|
||||||
|
GlobalMacroList.SubstituteStr(Dir);
|
||||||
|
debugln(['TLazPackageGraph.GetFallbackOutputDir ',APackage.Name,': ',Dir]);
|
||||||
|
Result:=Dir;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLazPackageGraph.CheckAmbiguousPackageUnits(APackage: TLazPackage
|
function TLazPackageGraph.CheckAmbiguousPackageUnits(APackage: TLazPackage
|
||||||
): TModalResult;
|
): TModalResult;
|
||||||
var
|
var
|
||||||
|
@ -154,8 +154,6 @@ type
|
|||||||
out Description: string);
|
out Description: string);
|
||||||
procedure GetDependencyOwnerDirectory(Dependency: TPkgDependency;
|
procedure GetDependencyOwnerDirectory(Dependency: TPkgDependency;
|
||||||
out Directory: string);
|
out Directory: string);
|
||||||
procedure GetWritablePkgOutputDirectory(APackage: TLazPackage;
|
|
||||||
var AnOutDirectory: string);
|
|
||||||
procedure PackageFileLoaded(Sender: TObject);
|
procedure PackageFileLoaded(Sender: TObject);
|
||||||
procedure OnCheckInstallPackageList(PkgIDList: TFPList; out Ok: boolean);
|
procedure OnCheckInstallPackageList(PkgIDList: TFPList; out Ok: boolean);
|
||||||
function LoadDependencyList(FirstDependency: TPkgDependency): TModalResult;
|
function LoadDependencyList(FirstDependency: TPkgDependency): TModalResult;
|
||||||
@ -213,7 +211,7 @@ type
|
|||||||
function GetSourceFilesOfOwners(OwnerList: TFPList): TStrings; override;
|
function GetSourceFilesOfOwners(OwnerList: TFPList): TStrings; override;
|
||||||
function GetPossibleOwnersOfUnit(const UnitFilename: string;
|
function GetPossibleOwnersOfUnit(const UnitFilename: string;
|
||||||
Flags: TPkgIntfOwnerSearchFlags): TFPList; override;
|
Flags: TPkgIntfOwnerSearchFlags): TFPList; override;
|
||||||
function GetPackageOfCurrentSourceEditor: TPkgFile;
|
function GetPackageOfCurrentSourceEditor(out APackage: TLazPackage): TPkgFile;
|
||||||
function AddDependencyToOwners(OwnerList: TFPList; APackage: TLazPackage;
|
function AddDependencyToOwners(OwnerList: TFPList; APackage: TLazPackage;
|
||||||
OnlyTestIfPossible: boolean = false): TModalResult; override;
|
OnlyTestIfPossible: boolean = false): TModalResult; override;
|
||||||
function DoOpenPkgFile(PkgFile: TPkgFile): TModalResult;
|
function DoOpenPkgFile(PkgFile: TPkgFile): TModalResult;
|
||||||
@ -469,28 +467,6 @@ begin
|
|||||||
GetDirectoryOfDependencyOwner(Dependency,Directory);
|
GetDirectoryOfDependencyOwner(Dependency,Directory);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPkgManager.GetWritablePkgOutputDirectory(APackage: TLazPackage;
|
|
||||||
var AnOutDirectory: string);
|
|
||||||
var
|
|
||||||
NewOutDir: String;
|
|
||||||
begin
|
|
||||||
if DirectoryIsWritableCached(AnOutDirectory) then exit;
|
|
||||||
|
|
||||||
ForceDirectory(AnOutDirectory);
|
|
||||||
InvalidateFileStateCache;
|
|
||||||
if DirectoryIsWritableCached(AnOutDirectory) then exit;
|
|
||||||
//debugln('TPkgManager.GetWritablePkgOutputDirectory AnOutDirectory=',AnOutDirectory,' ',dbgs(DirectoryIsWritable(AnOutDirectory)));
|
|
||||||
|
|
||||||
// output directory is not writable
|
|
||||||
// -> redirect to config directory
|
|
||||||
NewOutDir:=SetDirSeparators('/$(TargetCPU)-$(TargetOS)');
|
|
||||||
IDEMacros.SubstituteMacros(NewOutDir);
|
|
||||||
NewOutDir:=TrimFilename(GetPrimaryConfigPath+PathDelim+'lib'+PathDelim
|
|
||||||
+APackage.Name+NewOutDir);
|
|
||||||
AnOutDirectory:=NewOutDir;
|
|
||||||
debugln('TPkgManager.GetWritablePkgOutputDirectory APackage=',APackage.IDAsString,' AnOutDirectory="',AnOutDirectory,'"');
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TPkgManager.PackageFileLoaded(Sender: TObject);
|
procedure TPkgManager.PackageFileLoaded(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DoCallNotifyHandler(pihtPackageFileLoaded,Sender);
|
DoCallNotifyHandler(pihtPackageFileLoaded,Sender);
|
||||||
@ -574,11 +550,11 @@ end;
|
|||||||
|
|
||||||
procedure TPkgManager.OnOpenPackageForCurrentSrcEditFile(Sender: TObject);
|
procedure TPkgManager.OnOpenPackageForCurrentSrcEditFile(Sender: TObject);
|
||||||
var
|
var
|
||||||
PkgFile: TPkgFile;
|
APackage: TLazPackage;
|
||||||
begin
|
begin
|
||||||
PkgFile:=GetPackageOfCurrentSourceEditor;
|
GetPackageOfCurrentSourceEditor(APackage);
|
||||||
if PkgFile<>nil then
|
if APackage<>nil then
|
||||||
DoOpenPackage(PkgFile.LazPackage,[],false);
|
DoOpenPackage(APackage,[],false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPkgManager.CreateIDEWindow(Sender: TObject; aFormName: string; var
|
procedure TPkgManager.CreateIDEWindow(Sender: TObject; aFormName: string; var
|
||||||
@ -1508,7 +1484,6 @@ begin
|
|||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
OnGetDependencyOwnerDescription:=@GetDependencyOwnerDescription;
|
OnGetDependencyOwnerDescription:=@GetDependencyOwnerDescription;
|
||||||
OnGetDependencyOwnerDirectory:=@GetDependencyOwnerDirectory;
|
OnGetDependencyOwnerDirectory:=@GetDependencyOwnerDirectory;
|
||||||
OnGetWritablePkgOutputDirectory:=@GetWritablePkgOutputDirectory;
|
|
||||||
OnPackageFileLoaded:=@PackageFileLoaded;
|
OnPackageFileLoaded:=@PackageFileLoaded;
|
||||||
|
|
||||||
// componentpalette
|
// componentpalette
|
||||||
@ -1720,11 +1695,11 @@ end;
|
|||||||
procedure TPkgManager.OnSourceEditorPopupMenu(
|
procedure TPkgManager.OnSourceEditorPopupMenu(
|
||||||
const AddMenuItemProc: TAddMenuItemProc);
|
const AddMenuItemProc: TAddMenuItemProc);
|
||||||
var
|
var
|
||||||
PkgFile: TPkgFile;
|
APackage: TLazPackage;
|
||||||
begin
|
begin
|
||||||
PkgFile:=GetPackageOfCurrentSourceEditor;
|
GetPackageOfCurrentSourceEditor(APackage);
|
||||||
if PkgFile<>nil then
|
if APackage<>nil then
|
||||||
AddMenuItemProc(Format(lisOpenPackage2, [PkgFile.LazPackage.Name]), true,
|
AddMenuItemProc(Format(lisOpenPackage2, [APackage.Name]), true,
|
||||||
@OnOpenPackageForCurrentSrcEditFile);
|
@OnOpenPackageForCurrentSrcEditFile);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3138,15 +3113,29 @@ begin
|
|||||||
FreeThenNil(Result);
|
FreeThenNil(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.GetPackageOfCurrentSourceEditor: TPkgFile;
|
function TPkgManager.GetPackageOfCurrentSourceEditor(out APackage: TLazPackage
|
||||||
|
): TPkgFile;
|
||||||
var
|
var
|
||||||
SrcEdit: TSourceEditor;
|
SrcEdit: TSourceEditor;
|
||||||
|
Filename: String;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
APackage:=nil;
|
||||||
SrcEdit:=SourceEditorManager.GetActiveSE;
|
SrcEdit:=SourceEditorManager.GetActiveSE;
|
||||||
if SrcEdit<>nil then begin
|
if SrcEdit=nil then exit;
|
||||||
Result:=SearchFile(SrcEdit.Filename,[],nil);
|
Filename:=SrcEdit.FileName;
|
||||||
end else
|
Result:=SearchFile(Filename,[],nil);
|
||||||
SrcEdit:=nil;
|
if Result<>nil then begin
|
||||||
|
APackage:=Result.LazPackage;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
for i:=0 to PackageGraph.Count-1 do begin
|
||||||
|
APackage:=PackageGraph[i];
|
||||||
|
if CompareFilenames(APackage.GetSrcFilename,SrcEdit.FileName)=0 then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
APackage:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgManager.AddDependencyToOwners(OwnerList: TFPList;
|
function TPkgManager.AddDependencyToOwners(OwnerList: TFPList;
|
||||||
|
Loading…
Reference in New Issue
Block a user