Skip to content

Commit

Permalink
Fix time spent visual update after sorting list
Browse files Browse the repository at this point in the history
Seems TaskTableModel.actionPerformed fired from individual Tasks
is another example of somewhere where the row index does not need
to be translated from model to view...

Fixes #1 / #1
  • Loading branch information
OmegaPhil authored and OmegaPhil committed Jul 2, 2014
1 parent ee6503a commit 1d7c531
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/cz/aiken/util/lwtt/TaskTableModel.java
Expand Up @@ -408,8 +408,8 @@ public synchronized void saveToFile() {
* Processes an action event.
*
* If the event has been generated by the auto-save timer it saves
* the data. Otherwise (a button action occurred) it updates
* the appropriate table cell.
* the data, otherwise the event is an individual Task update - the
* appropriate table cell is updated
* @param e action event
*/
public void actionPerformed(ActionEvent e) {
Expand All @@ -419,12 +419,9 @@ public void actionPerformed(ActionEvent e) {
}
else {

// Converting the task index to the current sorted view index
int[] rows = new int[1];
rows[0] = tasks.indexOf(src);
rows = taskFrame.convertRowIndicesToView(rows);
fireTableCellUpdated(rows[0], 1);
fireTableCellUpdated(rows[0], 2);
// For some reason this does not need translation to the view??
fireTableCellUpdated(tasks.indexOf(src), 1);
fireTableCellUpdated(tasks.indexOf(src), 2);
}
}
}

0 comments on commit 1d7c531

Please sign in to comment.