mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Separate logic to determine if current open project actions corresponds to a project, see RIDER-39741
GitOrigin-RevId: 220f9012988bfa8cd73b571407f9db82664fba64
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cb52012217
commit
f9b0edafd1
@@ -4,6 +4,7 @@ package com.intellij.ide
|
||||
import com.intellij.ide.impl.ProjectUtil
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.util.containers.ContainerUtil
|
||||
@@ -93,6 +94,13 @@ open class RecentProjectListActionProvider {
|
||||
return ReopenProjectAction(path, projectName, displayName)
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if action corresponds to specified project
|
||||
*/
|
||||
open fun isCurrentProjectAction(project: Project, action: ReopenProjectAction): Boolean {
|
||||
return StringUtil.equals(action.projectPath, project.basePath)
|
||||
}
|
||||
|
||||
private fun getDuplicateProjectNames(openedPaths: Set<String>, recentPaths: Collection<String>): Set<String> {
|
||||
val names = mutableSetOf<String>()
|
||||
val duplicates = mutableSetOf<String>()
|
||||
|
||||
@@ -34,9 +34,10 @@ public class RecentProjectsGroup extends ActionGroup implements DumbAware {
|
||||
return actions.toArray(EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
RecentProjectListActionProvider provider = RecentProjectListActionProvider.getInstance();
|
||||
List<AnAction> list = new ArrayList<>();
|
||||
for (AnAction action : actions) {
|
||||
if (!(action instanceof ReopenProjectAction) || !StringUtil.equals(((ReopenProjectAction)action).getProjectPath(), project.getBasePath())) {
|
||||
if (!(action instanceof ReopenProjectAction) || !provider.isCurrentProjectAction(project, (ReopenProjectAction)action)) {
|
||||
list.add(action);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user