mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CPP-8004 Set CLion's project name from CMake's ${PROJECT_NAME}: also update cached names in RecentProjectsManagerBase.state (used in File | Open Recent...)
This commit is contained in:
@@ -520,9 +520,7 @@ public abstract class RecentProjectsManagerBase extends RecentProjectsManager im
|
||||
|
||||
@Override
|
||||
public void projectClosing(Project project) {
|
||||
synchronized (myStateLock) {
|
||||
myState.names.put(getProjectPath(project), getProjectDisplayName(project));
|
||||
}
|
||||
updateProjectName(project);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -538,6 +536,13 @@ public abstract class RecentProjectsManagerBase extends RecentProjectsManager im
|
||||
}
|
||||
}
|
||||
|
||||
public void updateProjectName(Project project) {
|
||||
synchronized (myStateLock) {
|
||||
myState.names.put(getProjectPath(project), getProjectDisplayName(project));
|
||||
}
|
||||
clearNameCache();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getProjectName(@NotNull String path) {
|
||||
String cached = myNameCache.get(path);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.project.impl;
|
||||
|
||||
import com.intellij.ide.RecentProjectsManager;
|
||||
import com.intellij.ide.RecentProjectsManagerBase;
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.startup.StartupManagerEx;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -134,7 +135,7 @@ public class ProjectImpl extends PlatformComponentManagerImpl implements Project
|
||||
public void setProjectName(@NotNull String projectName) {
|
||||
if (!projectName.equals(myName)) {
|
||||
myName = projectName;
|
||||
RecentProjectsManager.getInstance().clearNameCache();
|
||||
((RecentProjectsManagerBase)RecentProjectsManager.getInstance()).updateProjectName(this);
|
||||
|
||||
StartupManager.getInstance(this).runWhenProjectIsInitialized((DumbAwareRunnable)() -> {
|
||||
if (isDisposed()) return;
|
||||
|
||||
Reference in New Issue
Block a user