Skip to content

Commit ae2379e

Browse files
Improvement files/tracker/info
Issue: When 'hide all' only file size is visible. Fix: always show 'files count' and 'trackers count' after file name. And some code cleanup.
1 parent addf85b commit ae2379e

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

source/code/main.pas

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,9 @@ procedure TFormTrackerModify.UpdateTorrentTrackerList;
932932
begin
933933
//Copy the trackers found in one torrent file to FTrackerFromInsideTorrentFilesList
934934
for TrackerStr in FDecodePresentTorrent.TrackerList do
935+
begin
935936
AddButIngnoreDuplicates(FTrackerFromInsideTorrentFilesList, TrackerStr);
937+
end;
936938
end;
937939

938940
procedure TFormTrackerModify.ShowTrackerInsideFileList;
@@ -958,10 +960,13 @@ procedure TFormTrackerModify.CheckedOnOffAllTrackers(Value: boolean);
958960
i: integer;
959961
begin
960962
//Set all the trackers checkbox ON or OFF
961-
with CheckListBoxTrackersList do
962-
if Count > 0 then
963-
for i := 0 to Count - 1 do
964-
Checked[i] := Value;
963+
if CheckListBoxTrackersList.Count > 0 then
964+
begin
965+
for i := 0 to CheckListBoxTrackersList.Count - 1 do
966+
begin
967+
CheckListBoxTrackersList.Checked[i] := Value;
968+
end;
969+
end;
965970
end;
966971

967972
function TFormTrackerModify.ValidTrackerURL(const TrackerURL: UTF8String): boolean;
@@ -1288,10 +1293,13 @@ procedure TFormTrackerModify.MenuTrackersAllTorrentArePublicPrivateClick(
12881293
exit;
12891294

12901295
//Set all the trackers publick/private checkbox ON or OFF
1291-
with CheckListBoxPublicPrivateTorrent do
1292-
if Count > 0 then
1293-
for i := 0 to Count - 1 do
1294-
Checked[i] := TMenuItem(Sender).Tag = 1;
1296+
if CheckListBoxPublicPrivateTorrent.Count > 0 then
1297+
begin
1298+
for i := 0 to CheckListBoxPublicPrivateTorrent.Count - 1 do
1299+
begin
1300+
CheckListBoxPublicPrivateTorrent.Checked[i] := TMenuItem(Sender).Tag = 1;
1301+
end;
1302+
end;
12951303
end;
12961304

12971305

@@ -1728,8 +1736,9 @@ procedure TFormTrackerModify.ViewUpdateOneTorrentFileDecoded;
17281736

17291737
//Add the torrent file name + size of all the files combined.
17301738
TorrentFileNameStr := TorrentFileNameStr + ' SIZE: ' +
1731-
ByteSizeToBiggerSizeFormatStr(FDecodePresentTorrent.TotalFileSize);
1732-
1739+
ByteSizeToBiggerSizeFormatStr(FDecodePresentTorrent.TotalFileSize)
1740+
+ ' Files: ' + IntToStr(FDecodePresentTorrent.InfoFilesCount) + ''
1741+
+ ' Tracker: ' + IntToStr(FDecodePresentTorrent.TrackerList.Count) + '';
17331742

17341743

17351744
TreeNodeTorrent := TreeViewFileContents.Items.AddChild(FTreeNodeRoot,
@@ -1756,7 +1765,6 @@ procedure TFormTrackerModify.ViewUpdateOneTorrentFileDecoded;
17561765
//Show a how many files are there
17571766
TreeNodeFiles.Text := TreeNodeFiles.Text + ' (' + IntToStr(TreeNodeFiles.Count) + ')';
17581767

1759-
17601768
//Show all the trackers inside the torrent
17611769
for TrackerStr in FDecodePresentTorrent.TrackerList do
17621770
begin
@@ -1789,7 +1797,6 @@ procedure TFormTrackerModify.ViewUpdateOneTorrentFileDecoded;
17891797
TreeViewFileContents.Items.AddChild(TreeNodeInfo, 'Private: no');
17901798
end;
17911799

1792-
17931800
//All the files count inside the torrent must be added to FTotalFileInsideTorrent
17941801
Inc(FTotalFileInsideTorrent, FDecodePresentTorrent.InfoFilesCount);
17951802

0 commit comments

Comments
 (0)