Converter: Clear old left-over values when saving configuration. (Remove a hack)

git-svn-id: trunk@46868 -
This commit is contained in:
juha 2014-11-15 20:40:55 +00:00
parent 2da65785f9
commit 934571346f

View File

@ -231,8 +231,9 @@ var
Node: TAVLTreeNode; Node: TAVLTreeNode;
Item: PStringToStringTreeItem; Item: PStringToStringTreeItem;
SubPath: String; SubPath: String;
i, j: Integer; i: Integer;
begin begin
Config.DeletePath(Path); // Make sure there are no old leftover items.
Config.SetDeleteValue(Path+'Count', Tree.Tree.Count, 0); Config.SetDeleteValue(Path+'Count', Tree.Tree.Count, 0);
Node:=Tree.Tree.FindLowest; Node:=Tree.Tree.FindLowest;
i:=0; i:=0;
@ -244,11 +245,6 @@ begin
Node:=Tree.Tree.FindSuccessor(Node); Node:=Tree.Tree.FindSuccessor(Node);
inc(i); inc(i);
end; end;
// Remove leftover items in case the list has become shorter.
for j:=i to i+10 do begin
SubPath:=Path+'Item'+IntToStr(j)+'/';
Config.DeletePath(SubPath);
end;
end; end;
// Load and store configuration in TFuncsAndCategories : // Load and store configuration in TFuncsAndCategories :