mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 14:13:46 +02:00
IDE: fixed updating project inspector when unit is removed
git-svn-id: trunk@16022 -
This commit is contained in:
parent
cb9189c27a
commit
50afe07cfb
60
ide/main.pp
60
ide/main.pp
@ -13727,37 +13727,43 @@ var
|
||||
Dummy: Boolean;
|
||||
begin
|
||||
Result:=mrOk;
|
||||
AnUnitInfo.IsPartOfProject:=false;
|
||||
if (Project1.MainUnitID>=0)
|
||||
and (pfMainUnitHasUsesSectionForAllUnits in Project1.Flags)
|
||||
then begin
|
||||
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
|
||||
ShortUnitName:=AnUnitInfo.UnitName;
|
||||
if (ShortUnitName<>'') then begin
|
||||
Dummy:=CodeToolBoss.RemoveUnitFromAllUsesSections(
|
||||
Project1.MainUnitInfo.Source,ShortUnitName);
|
||||
if Dummy then
|
||||
Project1.MainUnitInfo.Modified:=true
|
||||
else begin
|
||||
ApplyCodeToolChanges;
|
||||
DoJumpToCodeToolBossError;
|
||||
Result:=mrCancel;
|
||||
exit;
|
||||
if not AnUnitInfo.IsPartOfProject then exit;
|
||||
Project1.BeginUpdate(true);
|
||||
try
|
||||
AnUnitInfo.IsPartOfProject:=false;
|
||||
if (Project1.MainUnitID>=0)
|
||||
and (pfMainUnitHasUsesSectionForAllUnits in Project1.Flags)
|
||||
then begin
|
||||
BeginCodeTool(ActiveSourceEditor,ActiveUnitInfo,[]);
|
||||
ShortUnitName:=AnUnitInfo.UnitName;
|
||||
if (ShortUnitName<>'') then begin
|
||||
Dummy:=CodeToolBoss.RemoveUnitFromAllUsesSections(
|
||||
Project1.MainUnitInfo.Source,ShortUnitName);
|
||||
if Dummy then
|
||||
Project1.MainUnitInfo.Modified:=true
|
||||
else begin
|
||||
ApplyCodeToolChanges;
|
||||
DoJumpToCodeToolBossError;
|
||||
Result:=mrCancel;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if (AnUnitInfo.ComponentName<>'') then begin
|
||||
Dummy:=Project1.RemoveCreateFormFromProjectFile(
|
||||
'T'+AnUnitInfo.ComponentName,AnUnitInfo.ComponentName);
|
||||
if not Dummy then begin
|
||||
ApplyCodeToolChanges;
|
||||
DoJumpToCodeToolBossError;
|
||||
Result:=mrCancel;
|
||||
exit;
|
||||
if (AnUnitInfo.ComponentName<>'') then begin
|
||||
Dummy:=Project1.RemoveCreateFormFromProjectFile(
|
||||
'T'+AnUnitInfo.ComponentName,AnUnitInfo.ComponentName);
|
||||
if not Dummy then begin
|
||||
ApplyCodeToolChanges;
|
||||
DoJumpToCodeToolBossError;
|
||||
Result:=mrCancel;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
ApplyCodeToolChanges;
|
||||
end;
|
||||
ApplyCodeToolChanges;
|
||||
Project1.Modified:=true;
|
||||
finally
|
||||
Project1.EndUpdate;
|
||||
end;
|
||||
Project1.Modified:=true;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.OnCompilerOptionsDialogTest(Sender: TObject);
|
||||
|
@ -726,8 +726,8 @@ begin
|
||||
dec(FUpdateLock);
|
||||
if FUpdateLock=0 then begin
|
||||
if pifTitleChanged in FFlags then UpdateTitle;
|
||||
if pifButtonsChanged in FFlags then UpdateButtons;
|
||||
if pifItemsChanged in FFlags then UpdateItems;
|
||||
if pifButtonsChanged in FFlags then UpdateButtons;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -337,8 +337,8 @@ implementation
|
||||
|
||||
|
||||
var
|
||||
InterfaceInitializationHandlers,
|
||||
InterfaceFinalizationHandlers: TFPList;
|
||||
InterfaceInitializationHandlers: TFPList = nil;
|
||||
InterfaceFinalizationHandlers: TFPList = nil;
|
||||
DebugTextAllocated: boolean;
|
||||
DebugText: ^Text;
|
||||
LineInfoCache: TAvgLvlTree = nil;
|
||||
|
Loading…
Reference in New Issue
Block a user