Git log: fix: always indicate when refreshing is over
authorirengrig <Irina.Chernushina@jetbrains.com>
Wed, 14 Apr 2010 19:45:21 +0000 (23:45 +0400)
committerirengrig <Irina.Chernushina@jetbrains.com>
Wed, 14 Apr 2010 19:45:21 +0000 (23:45 +0400)
plugins/git4idea/src/git4idea/history/browser/GitTreeController.java

index 78a0954f00413aa68b20617c5487ee721c2f5c4e..dadcba39ddf411eea8ad923f9e368985974f7639 100644 (file)
@@ -91,26 +91,29 @@ class GitTreeController implements ManageGitTreeView {
     myAlarm = new Alarm(Alarm.ThreadToUse.OWN_THREAD, project);
     myFilterRequestsMerger = new RequestsMerger(new Runnable() {
       public void run() {
-        if (myFilterHolder.isDirty()) {
-          final Portion filtered = loadPortion(myFilterHolder.getStartingPoints(), myFilterHolder.getCurrentPoint(), null,
-                                               myFilterHolder.getFilters(), PageSizes.LOAD_SIZE);
-          if (filtered == null) return;
+        try {
+          if (myFilterHolder.isDirty()) {
+            final Portion filtered = loadPortion(myFilterHolder.getStartingPoints(), myFilterHolder.getCurrentPoint(), null,
+                                                 myFilterHolder.getFilters(), PageSizes.LOAD_SIZE);
+            if (filtered == null) return;
 
-          final List<GitCommit> commitList = filtered.getXFrom(0, PageSizes.VISIBLE_PAGE_SIZE);
-          myFiltered = filtered;
-          myTreeView.refreshView(commitList, new TravelTicket(filtered.isStartFound(), filtered.getLast().getDate()));
+            final List<GitCommit> commitList = filtered.getXFrom(0, PageSizes.VISIBLE_PAGE_SIZE);
+            myFiltered = filtered;
+            myTreeView.refreshView(commitList, new TravelTicket(filtered.isStartFound(), filtered.getLast().getDate()));
 
-          myFilterHolder.setDirty(false);
-        }
+            myFilterHolder.setDirty(false);
+          }
 
-        // highlighting
-        if (myHighlightingHolder.isNothingSelected()) {
-          myTreeView.clearHighlighted();
-          return;
-        }
+          // highlighting
+          if (myHighlightingHolder.isNothingSelected()) {
+            myTreeView.clearHighlighted();
+            return;
+          }
 
-        myTreeView.acceptHighlighted(loadIdsToHighlight());
-        myTreeView.refreshFinished();
+          myTreeView.acceptHighlighted(loadIdsToHighlight());
+        } finally {
+          myTreeView.refreshFinished();
+        }
       }
     }, new Consumer<Runnable>() {
       public void consume(Runnable runnable) {