mirror of https://gitlab.com/basile.b/dexed.git
libman, update after alias changed + fix update after addition
This commit is contained in:
parent
fa5c3c5d9d
commit
fc0bc94c60
|
@ -96,7 +96,6 @@ type
|
||||||
function getLibraryByAlias(const value: string): TLibraryItem;
|
function getLibraryByAlias(const value: string): TLibraryItem;
|
||||||
function getLibraryByImport(const value: string): TLibraryItem;
|
function getLibraryByImport(const value: string): TLibraryItem;
|
||||||
procedure setCollection(value: TCollection);
|
procedure setCollection(value: TCollection);
|
||||||
procedure updateItemsByAlias;
|
|
||||||
function getLibrariesCount: integer;
|
function getLibrariesCount: integer;
|
||||||
procedure FPOObservedChanged(ASender: TObject; Operation: TFPObservedOperation; Data : Pointer);
|
procedure FPOObservedChanged(ASender: TObject; Operation: TFPObservedOperation; Data : Pointer);
|
||||||
published
|
published
|
||||||
|
@ -124,6 +123,8 @@ type
|
||||||
procedure updateDCD;
|
procedure updateDCD;
|
||||||
// find the aliases of the libraries used by the libraries.
|
// find the aliases of the libraries used by the libraries.
|
||||||
procedure updateCrossDependencies;
|
procedure updateCrossDependencies;
|
||||||
|
procedure updateAfterAddition(lib: TLibraryItem);
|
||||||
|
procedure updateItemsByAlias;
|
||||||
property librariesCount: integer read getLibrariesCount;
|
property librariesCount: integer read getLibrariesCount;
|
||||||
property libraryByIndex[value: integer]: TLibraryItem read getLibraryByIndex;
|
property libraryByIndex[value: integer]: TLibraryItem read getLibraryByIndex;
|
||||||
property libraryByAlias[const value: string]: TLibraryItem read getLibraryByAlias;
|
property libraryByAlias[const value: string]: TLibraryItem read getLibraryByAlias;
|
||||||
|
@ -472,15 +473,15 @@ begin
|
||||||
end;
|
end;
|
||||||
fItemsByAlias.delete(lib.libAlias);
|
fItemsByAlias.delete(lib.libAlias);
|
||||||
end;
|
end;
|
||||||
ooAddItem:
|
|
||||||
begin
|
|
||||||
fItemsByAlias.insert(lib.libAlias, lib);
|
|
||||||
// TODO-cupdate on addition, item ctor is not yet finished !
|
|
||||||
//updateCrossDependencies;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TLibraryManager.updateAfterAddition(lib: TLibraryItem);
|
||||||
|
begin
|
||||||
|
fItemsByAlias.insert(lib.libAlias, lib);
|
||||||
|
updateCrossDependencies;
|
||||||
|
end;
|
||||||
|
|
||||||
function TLibraryManager.getLibraryByIndex(index: integer): TLibraryItem;
|
function TLibraryManager.getLibraryByIndex(index: integer): TLibraryItem;
|
||||||
begin
|
begin
|
||||||
exit(TLibraryItem(fCollection.Items[index]));
|
exit(TLibraryItem(fCollection.Items[index]));
|
||||||
|
@ -687,6 +688,7 @@ var
|
||||||
dep: TLibraryItem;
|
dep: TLibraryItem;
|
||||||
imp: string;
|
imp: string;
|
||||||
begin
|
begin
|
||||||
|
updateItemsByAlias;
|
||||||
for i := 0 to fCollection.Count-1 do
|
for i := 0 to fCollection.Count-1 do
|
||||||
begin
|
begin
|
||||||
lib := libraryByIndex[i];
|
lib := libraryByIndex[i];
|
||||||
|
|
|
@ -77,7 +77,7 @@ type
|
||||||
procedure projCompiling(project: ICECommonProject);
|
procedure projCompiling(project: ICECommonProject);
|
||||||
procedure projCompiled(project: ICECommonProject; success: boolean);
|
procedure projCompiled(project: ICECommonProject; success: boolean);
|
||||||
function itemForRow(row: TListItem): TLibraryItem;
|
function itemForRow(row: TListItem): TLibraryItem;
|
||||||
procedure RowToLibrary(row: TListItem);
|
procedure RowToLibrary(row: TListItem; added: boolean = false);
|
||||||
function sourceRoot(project: ICECommonProject): string;
|
function sourceRoot(project: ICECommonProject): string;
|
||||||
procedure lexFindToken(const token: PLexToken; out stop: boolean);
|
procedure lexFindToken(const token: PLexToken; out stop: boolean);
|
||||||
//
|
//
|
||||||
|
@ -536,7 +536,7 @@ begin
|
||||||
row.SubItems.Add(prj.filename);
|
row.SubItems.Add(prj.filename);
|
||||||
row.SubItems.Add(enableStr[true]);
|
row.SubItems.Add(enableStr[true]);
|
||||||
row.Selected:=true;
|
row.Selected:=true;
|
||||||
RowToLibrary(row);
|
RowToLibrary(row, true);
|
||||||
row.MakeVisible(false);
|
row.MakeVisible(false);
|
||||||
itf.message('The package to register is a source library.' +
|
itf.message('The package to register is a source library.' +
|
||||||
'It is not pre-compiled but its sources are registered', nil, amcMisc, amkInf);
|
'It is not pre-compiled but its sources are registered', nil, amcMisc, amkInf);
|
||||||
|
@ -570,7 +570,7 @@ begin
|
||||||
row.SubItems.Add(prj.filename);
|
row.SubItems.Add(prj.filename);
|
||||||
row.SubItems.Add(enableStr[true]);
|
row.SubItems.Add(enableStr[true]);
|
||||||
row.Selected:=true;
|
row.Selected:=true;
|
||||||
RowToLibrary(row);
|
RowToLibrary(row, true);
|
||||||
row.MakeVisible(false);
|
row.MakeVisible(false);
|
||||||
showWidget;
|
showWidget;
|
||||||
end else
|
end else
|
||||||
|
@ -605,6 +605,7 @@ begin
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
List.Selected.Caption := al;
|
List.Selected.Caption := al;
|
||||||
|
LibMan.updateItemsByAlias;
|
||||||
RowToLibrary(List.Selected);
|
RowToLibrary(List.Selected);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -694,7 +695,7 @@ begin
|
||||||
row.Selected:= true;
|
row.Selected:= true;
|
||||||
row.MakeVisible(false);
|
row.MakeVisible(false);
|
||||||
SetFocus;
|
SetFocus;
|
||||||
RowToLibrary(row);
|
RowToLibrary(row, true);
|
||||||
finally
|
finally
|
||||||
str.free;
|
str.free;
|
||||||
end;
|
end;
|
||||||
|
@ -839,7 +840,7 @@ begin
|
||||||
List.EndUpdate;
|
List.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCELibManEditorWidget.RowToLibrary(row: TListItem);
|
procedure TCELibManEditorWidget.RowToLibrary(row: TListItem; added: boolean = false);
|
||||||
var
|
var
|
||||||
itm: TLibraryItem;
|
itm: TLibraryItem;
|
||||||
begin
|
begin
|
||||||
|
@ -855,7 +856,10 @@ begin
|
||||||
itm.updateModulesInfo;
|
itm.updateModulesInfo;
|
||||||
|
|
||||||
LibMan.updateDCD;
|
LibMan.updateDCD;
|
||||||
LibMan.updateCrossDependencies;
|
if added then
|
||||||
|
LibMan.updateCrossDependencies
|
||||||
|
else
|
||||||
|
Libman.updateAfterAddition(itm);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCELibManEditorWidget.sourceRoot(project: ICECommonProject): string;
|
function TCELibManEditorWidget.sourceRoot(project: ICECommonProject): string;
|
||||||
|
|
Loading…
Reference in New Issue