mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 20:59:17 +02:00
Opkman: Bug fix: Package filter is not working properly. Reported by forum user @totya.
git-svn-id: trunk@57575 -
This commit is contained in:
parent
10994c4ec0
commit
8c69e30eb6
@ -226,6 +226,7 @@ begin
|
|||||||
PackageDownloader.OnJSONProgress := nil;
|
PackageDownloader.OnJSONProgress := nil;
|
||||||
PackageDownloader.OnJSONDownloadCompleted := nil;
|
PackageDownloader.OnJSONDownloadCompleted := nil;
|
||||||
StopUpdates;
|
StopUpdates;
|
||||||
|
Application.RemoveOnDeactivateHandler(@DoDeactivate);
|
||||||
VisualTree.Free;
|
VisualTree.Free;
|
||||||
Application.HintHidePause := FHintTimeOut;
|
Application.HintHidePause := FHintTimeOut;
|
||||||
end;
|
end;
|
||||||
|
@ -30,7 +30,7 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
Forms, Controls, Graphics, ExtCtrls, StdCtrls, VirtualTrees,
|
Forms, Controls, Graphics, ExtCtrls, StdCtrls, VirtualTrees,
|
||||||
// OpkMan
|
// OpkMan
|
||||||
opkman_const, opkman_serializablepackages, opkman_options;
|
opkman_const, opkman_serializablepackages, opkman_options, opkman_visualtree;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -63,6 +63,7 @@ type
|
|||||||
procedure VSTCompareNodes(Sender: TBaseVirtualTree; Node1,
|
procedure VSTCompareNodes(Sender: TBaseVirtualTree; Node1,
|
||||||
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
|
||||||
procedure VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
procedure VSTFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
|
||||||
|
function IsNodeVisible(const APackageName: String): Boolean;
|
||||||
public
|
public
|
||||||
procedure PopulateList(const ATyp: Integer; const AExtra: String = '');
|
procedure PopulateList(const ATyp: Integer; const AExtra: String = '');
|
||||||
property Count: Integer read GetCount;
|
property Count: Integer read GetCount;
|
||||||
@ -138,6 +139,8 @@ begin
|
|||||||
InvCnt := 0;
|
InvCnt := 0;
|
||||||
for I := 0 to SerializablePackages.Count - 1 do
|
for I := 0 to SerializablePackages.Count - 1 do
|
||||||
begin
|
begin
|
||||||
|
if not IsNodeVisible(SerializablePackages.Items[I].DisplayName) then
|
||||||
|
Continue;
|
||||||
if ATyp = 0 then
|
if ATyp = 0 then
|
||||||
begin
|
begin
|
||||||
for J := 0 to SerializablePackages.Items[I].LazarusPackages.Count - 1 do
|
for J := 0 to SerializablePackages.Items[I].LazarusPackages.Count - 1 do
|
||||||
@ -296,5 +299,24 @@ begin
|
|||||||
Finalize(Data^);
|
Finalize(Data^);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPackageListFrm.IsNodeVisible(const APackageName: String): Boolean;
|
||||||
|
var
|
||||||
|
Node: PVirtualNode;
|
||||||
|
Data: opkman_visualtree.PData;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
Node := VisualTree.VST.GetFirst;
|
||||||
|
while Assigned(Node) do
|
||||||
|
begin
|
||||||
|
Data := VisualTree.VST.GetNodeData(Node);
|
||||||
|
if (Data^.DataType = 1) and (Data^.PackageDisplayName = APackageName) then
|
||||||
|
begin
|
||||||
|
Result := VisualTree.VST.IsVisible[Node];
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
Node := VisualTree.VST.GetNext(Node);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user