Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java3
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefreshAction.java16
2 files changed, 9 insertions, 10 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
index 3e1230f28..2710f157a 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamUIPlugin.java
@@ -375,12 +375,13 @@ public class TeamUIPlugin extends AbstractUIPlugin implements IPropertyChangeLis
RefreshSubscriberJob refreshJob = getRefreshJob();
refreshJob.setRefreshInterval(getPreferenceStore().getInt(IPreferenceIds.SYNCVIEW_DELAY) * 60);
if(((Boolean)event.getNewValue()).booleanValue()) {
+ refreshJob.setRestartOnCancel(true);
refreshJob.setReschedule(true);
refreshJob.schedule();
} else {
refreshJob.setRestartOnCancel(false /* don't restart the job */);
refreshJob.setReschedule(false);
- refreshJob.cancel();
+ refreshJob.cancel();
}
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefreshAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefreshAction.java
index 34019258e..00bc93d2d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefreshAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/sync/actions/RefreshAction.java
@@ -63,17 +63,15 @@ public class RefreshAction extends Action {
}
public static void run(SyncViewer viewer, IResource[] resources, TeamSubscriber subscriber) {
- if(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_BACKGROUND_SYNC)) {
- // Cancel the scheduled background refresh but ensure it gets rescheduled
- // to run later.
- Platform.getJobManager().cancel(RefreshSubscriberJob.getFamily());
+ // Cancel the scheduled background refresh or any other refresh that is happening.
+ // The scheduled background refresh will restart automatically.
+ Platform.getJobManager().cancel(RefreshSubscriberJob.getFamily());
+ if(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_BACKGROUND_SYNC)) {
RefreshSubscriberJob job = new RefreshSubscriberJob(Policy.bind("SyncViewRefresh.taskName", new Integer(resources.length).toString()), resources, subscriber); //$NON-NLS-1$
- if(TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(IPreferenceIds.SYNCVIEW_SCHEDULED_SYNC)) {
- job.schedule();
- }
- } else {
+ job.schedule();
+ } else {
runBlocking(viewer, subscriber, resources);
- }
+ }
}
private static void runBlocking(SyncViewer viewer, final TeamSubscriber s, final IResource[] resources) {

Back to the top