diff --git a/ide/mainintf.pas b/ide/mainintf.pas index fdd4283325..0658e8b36f 100644 --- a/ide/mainintf.pas +++ b/ide/mainintf.pas @@ -158,10 +158,6 @@ type function DoPublishModule(Options: TPublishModuleOptions; const SrcDirectory, DestDirectory: string ): TModalResult; virtual; abstract; - - function ExtendProjectUnitSearchPath(AProject: TProject; NewUnitPaths: string): boolean; - function ExtendProjectIncSearchPath(AProject: TProject; NewIncPaths: string): boolean; - function DoFixupComponentReferences(RootComponent: TComponent; OpenFlags: TOpenFlags): TModalResult; virtual; abstract; @@ -352,50 +348,6 @@ begin UpdateCaption; end; -function TMainIDEInterface.ExtendProjectUnitSearchPath(AProject: TProject; - NewUnitPaths: string): boolean; -var - CurUnitPaths: String; - r: TModalResult; -begin - CurUnitPaths:=AProject.CompilerOptions.ParsedOpts.GetParsedValue(pcosUnitPath); - NewUnitPaths:=RemoveSearchPaths(NewUnitPaths,CurUnitPaths); - if NewUnitPaths<>'' then begin - NewUnitPaths:=CreateRelativeSearchPath(NewUnitPaths,AProject.ProjectDirectory); - r:=IDEMessageDialog(lisExtendUnitPath, - Format(lisExtendUnitSearchPathOfProjectWith, [#13, NewUnitPaths]), - mtConfirmation, [mbYes, mbNo, mbCancel]); - case r of - mrYes: AProject.CompilerOptions.MergeToUnitPaths(NewUnitPaths); - mrNo: ; - else exit(false); - end; - end; - Result:=true; -end; - -function TMainIDEInterface.ExtendProjectIncSearchPath(AProject: TProject; - NewIncPaths: string): boolean; -var - CurIncPaths: String; - r: TModalResult; -begin - CurIncPaths:=AProject.CompilerOptions.ParsedOpts.GetParsedValue(pcosIncludePath); - NewIncPaths:=RemoveSearchPaths(NewIncPaths,CurIncPaths); - if NewIncPaths<>'' then begin - NewIncPaths:=CreateRelativeSearchPath(NewIncPaths,AProject.ProjectDirectory); - r:=IDEMessageDialog(lisExtendIncludePath, - Format(lisExtendIncludeFilesSearchPathOfProjectWith, [#13, NewIncPaths]), - mtConfirmation, [mbYes, mbNo, mbCancel]); - case r of - mrYes: AProject.CompilerOptions.MergeToIncludePaths(NewIncPaths); - mrNo: ; - else exit(false); - end; - end; - Result:=true; -end; - function TMainIDEInterface.DoJumpToSourcePosition(const Filename: string; NewX, NewY, NewTopLine: integer; AddJumpPoint: boolean; MarkLine: Boolean): TModalResult; var diff --git a/ide/project.pp b/ide/project.pp index 42a3426028..c0fc413c34 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -1014,6 +1014,8 @@ type function GetStateFilename: string; function GetCompileSourceFilename: string; procedure AutoAddOutputDirToIncPath; + function ExtendUnitSearchPath(NewUnitPaths: string): boolean; + function ExtendIncSearchPath(NewIncPaths: string): boolean; // compile state file function LoadStateFile(IgnoreErrors: boolean): TModalResult; @@ -4883,6 +4885,48 @@ begin end; end; +function TProject.ExtendUnitSearchPath(NewUnitPaths: string): boolean; +var + CurUnitPaths: String; + r: TModalResult; +begin + CurUnitPaths:=CompilerOptions.ParsedOpts.GetParsedValue(pcosUnitPath); + NewUnitPaths:=RemoveSearchPaths(NewUnitPaths,CurUnitPaths); + if NewUnitPaths<>'' then begin + NewUnitPaths:=CreateRelativeSearchPath(NewUnitPaths,ProjectDirectory); + r:=IDEMessageDialog(lisExtendUnitPath, + Format(lisExtendUnitSearchPathOfProjectWith, [#13, NewUnitPaths]), + mtConfirmation, [mbYes, mbNo, mbCancel]); + case r of + mrYes: CompilerOptions.MergeToUnitPaths(NewUnitPaths); + mrNo: ; + else exit(false); + end; + end; + Result:=true; +end; + +function TProject.ExtendIncSearchPath(NewIncPaths: string): boolean; +var + CurIncPaths: String; + r: TModalResult; +begin + CurIncPaths:=CompilerOptions.ParsedOpts.GetParsedValue(pcosIncludePath); + NewIncPaths:=RemoveSearchPaths(NewIncPaths,CurIncPaths); + if NewIncPaths<>'' then begin + NewIncPaths:=CreateRelativeSearchPath(NewIncPaths,ProjectDirectory); + r:=IDEMessageDialog(lisExtendIncludePath, + Format(lisExtendIncludeFilesSearchPathOfProjectWith, [#13, NewIncPaths]), + mtConfirmation, [mbYes, mbNo, mbCancel]); + case r of + mrYes: CompilerOptions.MergeToIncludePaths(NewIncPaths); + mrNo: ; + else exit(false); + end; + end; + Result:=true; +end; + function TProject.LoadStateFile(IgnoreErrors: boolean): TModalResult; var XMLConfig: TXMLConfig; diff --git a/ide/projectinspector.pas b/ide/projectinspector.pas index f16825ca0f..0f33a2415a 100644 --- a/ide/projectinspector.pas +++ b/ide/projectinspector.pas @@ -1252,12 +1252,12 @@ end; function TProjectInspectorForm.ExtendIncSearchPath(NewIncPaths: string): boolean; begin - Result:=MainIDEInterface.ExtendProjectIncSearchPath(LazProject,NewIncPaths); + Result:=LazProject.ExtendIncSearchPath(NewIncPaths); end; function TProjectInspectorForm.ExtendUnitSearchPath(NewUnitPaths: string): boolean; begin - Result:=MainIDEInterface.ExtendProjectUnitSearchPath(LazProject,NewUnitPaths); + Result:=LazProject.ExtendUnitSearchPath(NewUnitPaths); end; function TProjectInspectorForm.FilesBaseDirectory: string;