Skip to content

Commit 436d727

Browse files
committed
Switched from RichTextBox to ListBox for console output to massively increase speed when used on folders with large numbers of files
1 parent e204faf commit 436d727

File tree

2 files changed

+85
-48
lines changed

2 files changed

+85
-48
lines changed

WindowsApp1/Compact.Designer.vb

Lines changed: 76 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WindowsApp1/Compact.vb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Imports Ookii.Dialogs
66
Imports System.Management
77

88
Public Class Compact
9-
Dim version = "1.4.0_rc0"
9+
Dim version = "1.4.0_rc1"
1010
Private WithEvents MyProcess As Process
1111
Private Delegate Sub AppendOutputTextDelegate(ByVal text As String)
1212

@@ -202,28 +202,23 @@ Public Class Compact
202202

203203

204204

205-
Private Sub AppendOutputText(ByVal text As String) 'Attach output to the embedded console
206-
205+
Private Sub AppendOutputText(ByVal text As String) 'Attach output to the embedded console
207206
Try
208-
209207
If conOut.InvokeRequired Then
210208
Dim serverOutDelegate As New AppendOutputTextDelegate(AddressOf AppendOutputText)
211-
Me.Invoke(serverOutDelegate, text)
209+
Me.Invoke(serverOutDelegate, text.Replace("ÿ", " "))
212210
Else
213-
214-
conOut.AppendText(text.Replace("ÿ", " "))
215-
conOut.Select(conOut.TextLength, 1)
216-
conOut.ScrollToCaret()
211+
If text <> vbCrLf Then
212+
conOut.Items.Insert(0, text)
213+
End If
217214
End If
218-
219215
Catch ex As Exception
220-
221216
End Try
222-
223217
End Sub
224218

225219

226220

221+
227222
'Set variables for the advanced compression checkboxes.
228223
Dim workingDir As String = ""
229224
Dim recursiveScan As String = ""
@@ -343,7 +338,7 @@ Public Class Compact
343338
If passthrougharg = "query" Then isQueryMode = 1
344339

345340
progresspercent.Visible = True
346-
conOut.Clear()
341+
conOut.Items.Clear()
347342

348343
MyProcess = New Process
349344

@@ -445,6 +440,7 @@ Public Class Compact
445440
Private Sub CheckShowConOut_CheckedChanged(sender As Object, e As EventArgs) Handles checkShowConOut.CheckedChanged 'Handles showing the embedded console
446441
If checkShowConOut.Checked Then
447442
conOut.Visible = True
443+
448444
Else
449445
conOut.Visible = False
450446
End If

0 commit comments

Comments
 (0)