Skip to content

Commit

Permalink
keep a proper count of the number of lines discovered, given that som…
Browse files Browse the repository at this point in the history
…e lines may be reported more than once (I may have to look into that)
  • Loading branch information
bchang committed Feb 23, 2012
1 parent 830647e commit d6fdb43
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {


var _status : JLabel var _status : JLabel


var _numDiscovered : int var _discovered = new java.util.HashSet<Integer>()


// TODO - figure these out // TODO - figure these out
var _me : SwingBlame var _me : SwingBlame
Expand Down Expand Up @@ -123,8 +123,8 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {
} }
}); });
using(_lock) { using(_lock) {
_numDiscovered++ _discovered.add(line.Id)
if (_numDiscovered == _model.getRowCount()) { if (_discovered.size() == _model.getRowCount()) {
EventQueue.invokeLater(new Runnable() { EventQueue.invokeLater(new Runnable() {
override function run() { override function run() {
blameFinished(); blameFinished();
Expand Down Expand Up @@ -155,7 +155,7 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {


try { try {
using(_lock) { using(_lock) {
_numDiscovered = 0; _discovered.clear()
} }
_lines = _blame.setup(_pathField.getText()) _lines = _blame.setup(_pathField.getText())
_changes = new IP4ChangeInfo[_lines.length] _changes = new IP4ChangeInfo[_lines.length]
Expand All @@ -175,6 +175,7 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {
}); });
blameThread.start(); blameThread.start();
} catch (ex : Exception) { } catch (ex : Exception) {
ex.printStackTrace()
JOptionPane.showMessageDialog(this, ex.Message) JOptionPane.showMessageDialog(this, ex.Message)
blameFinished() blameFinished()
} }
Expand Down

0 comments on commit d6fdb43

Please sign in to comment.