mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
bug 322695: Can't access preferences of any unrelated CDT project having "bad" project in workspace
This commit is contained in:
parent
ff4042c747
commit
ed40d8e4d6
3 changed files with 21 additions and 2 deletions
|
@ -571,6 +571,19 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
return getExtensionProjectTypeMap().get(id);
|
return getExtensionProjectTypeMap().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the base extension configuration from the manifest (plugin.xml)
|
||||||
|
* or {@code null} if not found.
|
||||||
|
*
|
||||||
|
* @since 8.0
|
||||||
|
*/
|
||||||
|
public static IConfiguration getExtensionConfiguration(IConfiguration cfg) {
|
||||||
|
for(;cfg != null && !cfg.isExtensionElement(); cfg = cfg.getParent()) {
|
||||||
|
// empty loop to find base configuration
|
||||||
|
}
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the configuration from the manifest with the ID specified in the argument
|
* @return the configuration from the manifest with the ID specified in the argument
|
||||||
* or {@code null}.
|
* or {@code null}.
|
||||||
|
|
|
@ -31,6 +31,7 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
import org.eclipse.osgi.util.NLS;
|
||||||
|
|
||||||
public class BuildConfigurationData extends CConfigurationData {
|
public class BuildConfigurationData extends CConfigurationData {
|
||||||
private Configuration fCfg;
|
private Configuration fCfg;
|
||||||
|
@ -177,7 +178,11 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if(!fCfg.isSupported()){
|
if(!fCfg.isSupported()){
|
||||||
flags |= CConfigurationStatus.TOOLCHAIN_NOT_SUPPORTED;
|
flags |= CConfigurationStatus.TOOLCHAIN_NOT_SUPPORTED;
|
||||||
msg = DataProviderMessages.getString("BuildConfigurationData.0"); //$NON-NLS-1$
|
msg = DataProviderMessages.getString("BuildConfigurationData.NoConfigurationSupport"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
} else if (ManagedBuildManager.getExtensionConfiguration(fCfg)==null){
|
||||||
|
flags |= CConfigurationStatus.SETTINGS_INVALID;
|
||||||
|
msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.OrphanedConfiguration"), fCfg.getId()); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flags != 0)
|
if(flags != 0)
|
||||||
|
|
|
@ -21,4 +21,5 @@ ProjectConverter.6=the project conversion failed
|
||||||
ProjectConverter.7=targets conversion
|
ProjectConverter.7=targets conversion
|
||||||
ProjectConverter.8=the project conversion failed due to unknown reason
|
ProjectConverter.8=the project conversion failed due to unknown reason
|
||||||
ProjectConverter.9=the given project is not a valid CDT project
|
ProjectConverter.9=the given project is not a valid CDT project
|
||||||
BuildConfigurationData.0=The configuration support is not installed on the system
|
BuildConfigurationData.NoConfigurationSupport=The configuration support is not installed on the system
|
||||||
|
BuildConfigurationData.OrphanedConfiguration=Orphaned configuration. No base extension cfg exists for ID={0}
|
||||||
|
|
Loading…
Add table
Reference in a new issue