fixed auto adding package to project on popupmenu

git-svn-id: trunk@8598 -
This commit is contained in:
mattias 2006-01-21 22:43:29 +00:00
parent aa95eef759
commit 4914273463
2 changed files with 4 additions and 0 deletions

View File

@ -607,6 +607,7 @@ var TargetEntries: PGtkTargetEntry;
{$EndIf}
TargetEntries[Index].Target := StrAlloc(Length(FormatName) + 1);
StrPCopy(TargetEntries[Index].Target, FormatName);
TargetEntries[Index].flags:=0;
TargetEntries[Index].Info:=Index;
inc(Index);
end;

View File

@ -2146,6 +2146,7 @@ end;
procedure TPkgManager.AddUnitToProjectMainUsesSection(AProject: TProject;
const AnUnitName, AnUnitInFilename: string);
begin
DumpStack;
// add unit to project main source file
if (pfMainUnitHasUsesSectionForAllUnits in AProject.Flags)
and (AProject.MainUnitInfo<>nil) then begin
@ -2467,6 +2468,8 @@ begin
Result:=mrCancel;
exit;
end;
if OnlyTestIfPossible then
exit(mrOk);
// add a dependency for the package to the project
NewDependency:=APackage.CreateDependencyWithOwner(AProject);
Result:=AddProjectDependency(AProject,NewDependency);