Permalink
Browse files

keep a proper count of the number of lines discovered, given that som…

…e lines may be reported more than once (I may have to look into that)
  • Loading branch information...
1 parent 830647e commit d6fdb43d41fad60a88bc0521cecc9cc420cdbdf7 @bchang committed Feb 23, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 p4blame/src/main/java/com/github/bchang/p4/blame/swing/SwingBlame.gs
@@ -31,7 +31,7 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {
var _status : JLabel
- var _numDiscovered : int
+ var _discovered = new java.util.HashSet<Integer>()
// TODO - figure these out
var _me : SwingBlame
@@ -123,8 +123,8 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {
}
});
using(_lock) {
- _numDiscovered++
- if (_numDiscovered == _model.getRowCount()) {
+ _discovered.add(line.Id)
+ if (_discovered.size() == _model.getRowCount()) {
EventQueue.invokeLater(new Runnable() {
override function run() {
blameFinished();
@@ -155,7 +155,7 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {
try {
using(_lock) {
- _numDiscovered = 0;
+ _discovered.clear()
}
_lines = _blame.setup(_pathField.getText())
_changes = new IP4ChangeInfo[_lines.length]
@@ -175,6 +175,7 @@ class SwingBlame extends JFrame implements IP4BlameListener, ActionListener {
});
blameThread.start();
} catch (ex : Exception) {
+ ex.printStackTrace()
JOptionPane.showMessageDialog(this, ex.Message)
blameFinished()
}

0 comments on commit d6fdb43

Please sign in to comment.