IDEA-52477 (Git integration waits too long on Swing thread when file history is shown...
authorirengrig <Irina.Chernushina@jetbrains.com>
Sat, 27 Feb 2010 12:39:33 +0000 (15:39 +0300)
committerirengrig <Irina.Chernushina@jetbrains.com>
Sat, 27 Feb 2010 12:39:33 +0000 (15:39 +0300)
platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java

index 61354f08818e6494bb708ad57db7810e701efb40..53ae03f886fe75f454e4a39001620a7c825cfa98 100644 (file)
@@ -125,7 +125,7 @@ public class FileHistoryPanelImpl<S extends CommittedChangeList, U extends Chang
 
   private final String myRepositoryPath;
 
-  private boolean myInRefresh;
+  private volatile boolean myInRefresh;
   private Object myTargetSelection;
   private final AsynchConsumer<VcsHistorySession> myHistoryPanelRefresh;
 
@@ -279,7 +279,7 @@ public class FileHistoryPanelImpl<S extends CommittedChangeList, U extends Chang
 
     replaceTransferable();
 
-    myUpdateAlarm = new Alarm(session.allowAsyncRefresh() ? Alarm.ThreadToUse.SHARED_THREAD : Alarm.ThreadToUse.SWING_THREAD);
+    myUpdateAlarm = new Alarm(Alarm.ThreadToUse.SHARED_THREAD);
 
     final HistoryAsTreeProvider treeHistoryProvider = myHistorySession.getHistoryAsTreeProvider();
 
@@ -314,7 +314,8 @@ public class FileHistoryPanelImpl<S extends CommittedChangeList, U extends Chang
         FileHistoryPanelImpl.this.refresh(vcsHistorySession);
       }
     };
-    
+
+    // todo react to event?
     myUpdateAlarm.addRequest(new Runnable() {
       public void run() {
         if (myProject.isDisposed()) {
@@ -322,13 +323,13 @@ public class FileHistoryPanelImpl<S extends CommittedChangeList, U extends Chang
         }
         final boolean refresh = (! myInRefresh) && myHistorySession.shouldBeRefreshed();
         myUpdateAlarm.cancelAllRequests();
-        myUpdateAlarm.addRequest(this, 10000);
+        myUpdateAlarm.addRequest(this, 20000);
 
         if (refresh) {
           refreshImpl();
         }
       }
-    }, 10000);
+    }, 20000);
 
     init();