From 0785ecb91374aecdc3f49ee90daf0ee41e054ef0 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Mon, 10 Dec 2012 18:35:15 +0100 Subject: [PATCH] API cleanup --- .../src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java | 2 ++ .../src/com/intellij/ide/SaveAndSyncHandlerImpl.java | 6 +++--- .../fileChooser/actions/RefreshFileChooserAction.java | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java index 7a9bf72b8fdd..4e1a9d40afbc 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/RefreshQueue.java @@ -66,6 +66,8 @@ public abstract class RefreshQueue { session.launch(); } + /** @deprecated use {@linkplain #refresh(boolean, boolean, Runnable, ModalityState, VirtualFile...)} with {@linkplain ManagingFS#getLocalRoots()} (to remove in IDEA 13) */ + @SuppressWarnings("UnusedDeclaration") public abstract void refreshLocalRoots(boolean async, @Nullable Runnable postAction, @NotNull ModalityState modalityState); public abstract void processSingleEvent(@NotNull VFileEvent event); diff --git a/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java b/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java index 85429a7e1c8b..f46461f2788a 100644 --- a/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/SaveAndSyncHandlerImpl.java @@ -27,6 +27,7 @@ import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ex.ProjectManagerEx; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.NewVirtualFile; import com.intellij.openapi.vfs.newvfs.RefreshQueue; import com.intellij.util.Alarm; @@ -159,7 +160,6 @@ public class SaveAndSyncHandlerImpl implements ApplicationComponent, SaveAndSync LOG.debug("enter: synchronize()"); } - myRefreshDelayAlarm.cancelAllRequests(); myRefreshDelayAlarm.addRequest(new Runnable() { @Override @@ -178,11 +178,11 @@ public class SaveAndSyncHandlerImpl implements ApplicationComponent, SaveAndSync } public void maybeRefresh(@NotNull ModalityState modalityState) { - if (myBlockSyncOnFrameActivationCount.get() == 0 && GeneralSettings.getInstance().isSyncOnFrameActivation()) { + if (GeneralSettings.getInstance().isSyncOnFrameActivation() && myBlockSyncOnFrameActivationCount.get() == 0) { if (LOG.isDebugEnabled()) { LOG.debug("refresh VFS"); } - RefreshQueue.getInstance().refreshLocalRoots(true, null, modalityState); + RefreshQueue.getInstance().refresh(true, true, null, modalityState, ManagingFS.getInstance().getLocalRoots()); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileChooser/actions/RefreshFileChooserAction.java b/platform/platform-impl/src/com/intellij/openapi/fileChooser/actions/RefreshFileChooserAction.java index ffac802ff771..d57c2f55a579 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileChooser/actions/RefreshFileChooserAction.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileChooser/actions/RefreshFileChooserAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.project.DumbAware; +import com.intellij.openapi.vfs.newvfs.ManagingFS; import com.intellij.openapi.vfs.newvfs.RefreshQueue; /** @@ -26,6 +27,6 @@ import com.intellij.openapi.vfs.newvfs.RefreshQueue; */ public class RefreshFileChooserAction extends AnAction implements DumbAware { public void actionPerformed(final AnActionEvent e) { - RefreshQueue.getInstance().refreshLocalRoots(true, null, ModalityState.current()); + RefreshQueue.getInstance().refresh(true, true, null, ModalityState.current(), ManagingFS.getInstance().getLocalRoots()); } } \ No newline at end of file