mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
write file even through only project profile name was changed (IDEA-25257)
This commit is contained in:
@@ -59,6 +59,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
|
||||
protected Map<String, Profile> myProfiles = new HashMap<String, Profile>();
|
||||
protected final DependencyValidationManager myHolder;
|
||||
protected List<ProfileChangeAdapter> myProfilesListener = new ArrayList<ProfileChangeAdapter>();
|
||||
@NonNls private static final String PROJECT_DEFAULT_PROFILE_NAME = "Project Default";
|
||||
|
||||
public DefaultProjectProfileManager(final Project project, final String profileType, final DependencyValidationManager holder) {
|
||||
myProject = project;
|
||||
@@ -142,7 +143,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
|
||||
}
|
||||
}
|
||||
|
||||
if (profiles != null) {
|
||||
if (profiles != null || !Comparing.strEqual(PROJECT_PROFILE, PROJECT_DEFAULT_PROFILE_NAME)) {
|
||||
DefaultJDOMExternalizer.writeExternal(this, element);
|
||||
final Element version = new Element("version");
|
||||
version.setAttribute("value", VERSION);
|
||||
@@ -188,13 +189,12 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
|
||||
public Profile getProjectProfileImpl(){
|
||||
if (isPlatform() || !USE_PROJECT_PROFILE) return myApplicationProfileManager.getRootProfile();
|
||||
if (PROJECT_PROFILE == null || myProfiles.isEmpty()){
|
||||
@NonNls final String projectProfileName = "Project Default";
|
||||
setProjectProfile(projectProfileName);
|
||||
setProjectProfile(PROJECT_DEFAULT_PROFILE_NAME);
|
||||
final Profile projectProfile = myApplicationProfileManager.createProfile();
|
||||
projectProfile.copyFrom(myApplicationProfileManager.getRootProfile());
|
||||
projectProfile.setLocal(false);
|
||||
projectProfile.setName(projectProfileName);
|
||||
myProfiles.put(projectProfileName, projectProfile);
|
||||
projectProfile.setName(PROJECT_DEFAULT_PROFILE_NAME);
|
||||
myProfiles.put(PROJECT_DEFAULT_PROFILE_NAME, projectProfile);
|
||||
} else if (!myProfiles.containsKey(PROJECT_PROFILE)){
|
||||
final String projectProfileAttempt = myProfiles.keySet().iterator().next();
|
||||
setProjectProfile(projectProfileAttempt);
|
||||
|
||||
Reference in New Issue
Block a user