inspection settings: do not override stored settings when try to init from source profile (IDEA-112668)

This commit is contained in:
Anna Kozlova
2013-08-30 17:37:42 +04:00
parent 1e303c62e6
commit f287c7c9ee
2 changed files with 6 additions and 7 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2013 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.
@@ -546,7 +546,7 @@ public class InspectionProfileImpl extends ProfileEx implements ModifiableModel,
@NotNull
private List<InspectionToolWrapper> createTools(Project project) {
if (mySource != null) {
return ContainerUtil.map(mySource.getAllTools(project), new Function<ScopeToolState, InspectionToolWrapper>() {
return ContainerUtil.map(mySource.getDefaultStates(project), new Function<ScopeToolState, InspectionToolWrapper>() {
@NotNull
@Override
public InspectionToolWrapper fun(@NotNull ScopeToolState state) {
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2013 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.
@@ -196,7 +196,7 @@ public class SingleInspectionProfilePanel extends JPanel {
private boolean wereToolSettingsModified(Descriptor descriptor) {
InspectionToolWrapper toolWrapper = descriptor.getToolWrapper();
if (toolWrapper == null || !mySelectedProfile.isToolEnabled(descriptor.getKey())) {
if (!mySelectedProfile.isToolEnabled(descriptor.getKey(), descriptor.getScope(), myProjectProfileManager.getProject())) {
return false;
}
Element oldConfig = descriptor.getConfig();
@@ -722,9 +722,8 @@ public class SingleInspectionProfilePanel extends JPanel {
final InspectionConfigTreeNode node = new InspectionConfigTreeNode(descriptor, null, !hasNonDefaultScope, enabled, !hasNonDefaultScope);
getGroupNode(myRoot, descriptor.getGroup()).add(node);
if (hasNonDefaultScope) {
for (ScopeToolState nonDefaultState : nonDefaultTools) {
node.add(new InspectionConfigTreeNode(new Descriptor(nonDefaultState, mySelectedProfile,
project), nonDefaultState, false, false));
for (Descriptor desc : myDescriptors.get(descriptor)) {
node.add(new InspectionConfigTreeNode(desc, desc.getState(), false, false));
}
node.add(new InspectionConfigTreeNode(descriptor, descriptor.getState(), true, false));
}