From 6cbb85f8a94ac3f413b3ac4f24c8f67d43acaa21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 9 Aug 2013 16:05:58 +0200 Subject: [PATCH] Store the current list of downloads. --- src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java index 3714956..c78697a 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -96,6 +96,7 @@ public class CommandReader extends AbstractExecutionThreadService { String lastLine = ""; String line; final List lastResult = Lists.newArrayList(); + final List downloads = Lists.newArrayList(); final List lastConnections = Lists.newArrayList(); while ((line = reader.readLine()) != null) { if (line.equals("")) { @@ -130,7 +131,9 @@ public class CommandReader extends AbstractExecutionThreadService { writeLine("End of Search."); } else if (words[0].equalsIgnoreCase("dcc")) { int counter = 0; - for (Download download : FluentIterable.from(core.downloads()).toSortedList(Ordering.from(BY_NAME).compound(BY_RUNNING))) { + downloads.clear(); + downloads.addAll(FluentIterable.from(core.downloads()).toSortedList(Ordering.from(BY_NAME).compound(BY_RUNNING))); + for (Download download : downloads) { DccReceiver dccReceiver = download.dccReceiver(); if (dccReceiver == null) { /* download has not even started. */ -- 2.7.4