Kaynağa Gözat

Issue 1242.

Don't try to load more lines than the frameBuffer allows.
This reduces the time the client hangs, but the underlying problem (adding lotsa lines takes lotsa time) is still there


git-svn-id: http://svn.dmdirc.com/trunk@4061 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Shane Mc Cormack 16 yıl önce
ebeveyn
işleme
09cfc02e20

+ 5
- 3
src/com/dmdirc/addons/logging/HistoryWindow.java Dosyayı Görüntüle

@@ -67,9 +67,11 @@ public class HistoryWindow extends FrameContainer {
67 67
         window.setTitle(title);
68 68
         window.setVisible(true);
69 69
         
70
-        final Stack<String> lines = reader.getLines(
71
-                IdentityManager.getGlobalConfig().getOptionInt("plugin-Logging",
72
-                "history.lines", 50000));
70
+        final int historyLineCount = IdentityManager.getGlobalConfig().getOptionInt(
71
+                "plugin-Logging", "history.lines", 50000);
72
+        final int frameBufferSize = IdentityManager.getGlobalConfig().getOptionInt(
73
+                "ui", "frameBufferSize", 10000);
74
+        final Stack<String> lines = reader.getLines(Math.min(frameBufferSize, historyLineCount));
73 75
         while (lines.size() > 0) {
74 76
             window.addLine(lines.pop(), false);
75 77
         }

Loading…
İptal
Kaydet