mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs] IDEA-95947 Don't notify about the same unregistered root twice
This commit is contained in:
@@ -28,12 +28,14 @@ import com.intellij.openapi.vcs.VcsDirectoryMapping;
|
||||
import com.intellij.openapi.vcs.VcsNotifier;
|
||||
import com.intellij.openapi.vcs.VcsRootError;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.intellij.openapi.util.text.StringUtil.pluralize;
|
||||
|
||||
@@ -46,6 +48,7 @@ public class VcsRootProblemNotifier {
|
||||
|
||||
private final @NotNull Project myProject;
|
||||
private final @NotNull VcsConfiguration mySettings;
|
||||
@NotNull private final Set<VcsRootError> myReportedUnregisteredRoots = ContainerUtil.newHashSet();
|
||||
|
||||
private @Nullable Notification myNotification;
|
||||
private final @NotNull Object NOTIFICATION_LOCK = new Object();
|
||||
@@ -78,6 +81,11 @@ public class VcsRootProblemNotifier {
|
||||
String title = makeTitle(unregisteredRoots, invalidRoots);
|
||||
String description = makeDescription(unregisteredRoots, invalidRoots);
|
||||
|
||||
if (myReportedUnregisteredRoots.containsAll(unregisteredRoots) && invalidRoots.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
myReportedUnregisteredRoots.addAll(unregisteredRoots);
|
||||
|
||||
synchronized (NOTIFICATION_LOCK) {
|
||||
expireNotification();
|
||||
NotificationListener listener = new MyNotificationListener(myProject, mySettings);
|
||||
|
||||
Reference in New Issue
Block a user