diff options
author | Marc-Andre Laperle | 2020-10-10 05:48:29 +0000 |
---|---|---|
committer | Marc-André Laperle | 2020-10-21 02:59:41 +0000 |
commit | 6ca0bb78bbd0724426c5ab320c1e144e6234dff9 (patch) | |
tree | 4d67bad34f2587c45288c4f9b8b95a1951ce44af /core/org.eclipse.cdt.core | |
parent | cebba80b3662a67b8cdba45f8b510d71aa278e23 (diff) | |
download | org.eclipse.cdt-6ca0bb78bbd0724426c5ab320c1e144e6234dff9.tar.gz org.eclipse.cdt-6ca0bb78bbd0724426c5ab320c1e144e6234dff9.tar.xz org.eclipse.cdt-6ca0bb78bbd0724426c5ab320c1e144e6234dff9.zip |
Bug 329995 - Update all C/C++ views when the active configuration changes
Change the default workspace indexer setting
Use the active configuration by default, which is less confusing because
the UI is properly reflected on active config change. Using a fixed
config can be seen as a more advanced setting for performance concerns.
A new preference is added, only used at default scope:
org.eclipse.cdt.core/cprojectdescription.configRelations
This can be used by products to customize the default according
to their needs (plugin_customization.ini).
This was done because this is a fairly impactful change for users.
Change-Id: I35888ffe5bc1814943f432f88a12094394924c88
Signed-off-by: Alex Freidin <freidin.alex@gmail.com>
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r-- | core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java index c7d4ff4cd5e..ee8e4cd124d 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java @@ -13,14 +13,19 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.settings.model; +import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.settings.model.ICProjectDescriptionPreferences; import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.util.CDataUtil; +import org.eclipse.core.runtime.preferences.DefaultScope; public class CProjectDescriptionPreferences implements ICProjectDescriptionPreferences { + private static final String ATTR_CONFIG_RELATIONS = "configRelations"; //$NON-NLS-1$ - private static final int DEFAULT_RELATIONS = CONFIGS_INDEPENDENT; + // This preference is only used at Default Scope to allow product preference customization (plugin_customization.ini) + private static final String PREF_CPROJECTDESCRIPTION_CONFIG_RELATIONS_KEY = "cprojectdescription.configRelations"; //$NON-NLS-1$ + private boolean fIsReadOnly; private boolean fIsModified; @@ -43,7 +48,8 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe fIsReadOnly = isReadOnly; if (el != null) { if (el.getAttribute(ATTR_CONFIG_RELATIONS) != null) - fConfigRelations = Integer.valueOf(CDataUtil.getInteger(el, ATTR_CONFIG_RELATIONS, DEFAULT_RELATIONS)); + fConfigRelations = Integer + .valueOf(CDataUtil.getInteger(el, ATTR_CONFIG_RELATIONS, getDefaultRelations())); } this.fSuperPreference = superPreference; @@ -61,6 +67,11 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe CDataUtil.setInteger(el, ATTR_CONFIG_RELATIONS, fConfigRelations.intValue()); } + public static int getDefaultRelations() { + return DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID) + .getInt(PREF_CPROJECTDESCRIPTION_CONFIG_RELATIONS_KEY, CONFIGS_LINK_SETTINGS_AND_ACTIVE); + } + @Override public int getConfigurationRelations() { if (fConfigRelations != null) @@ -68,7 +79,7 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe CProjectDescriptionPreferences superPrefs = getSuperPreferences(); if (superPrefs != null) return superPrefs.getConfigurationRelations(); - return DEFAULT_RELATIONS; + return getDefaultRelations(); } @Override |