1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

[268528] Discovery profile options panel doesn't show since 5.0.2 up

This commit is contained in:
Alena Laskavaia 2009-03-16 14:50:32 +00:00
parent 4d246d8477
commit 97bb50f277
3 changed files with 41 additions and 30 deletions

View file

@ -22,6 +22,8 @@ import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
public class CfgScannerConfigUtil {
public static CfgInfoContext adjustPerRcTypeContext(CfgInfoContext context){
if(((Configuration)context.getConfiguration()).isPreference())
return context;
Tool tool = (Tool)context.getTool();
IResourceInfo rcInfo = context.getResourceInfo();
IInputType inType = context.getInputType();

View file

@ -208,6 +208,8 @@ public class CfgScannerConfigInfoFactory2 {
}
}
} else {
if(cfg.isPreference())
continue;
CfgInfoContext context = new CfgInfoContext(rcInfo, tool, null);
context = CfgScannerConfigUtil.adjustPerRcTypeContext(context);
if(context != null && context.getResourceInfo() != null){
@ -304,7 +306,7 @@ public class CfgScannerConfigInfoFactory2 {
if(!isPerRcTypeDiscovery())
return true;
return !CfgScannerConfigProfileManager.isPerFileProfile(profileId);
return CfgScannerConfigProfileManager.isPerFileProfile(profileId);
}
}

View file

@ -311,40 +311,47 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
int pos = 0;
String savedId = buildInfo.getSelectedProfileId();
ITool[] tools = null;
Tool tool = (Tool)iContext.getTool();
if(null == tool) {
IConfiguration conf = iContext.getConfiguration();
if(null != conf) {
tools = conf.getToolChain().getTools();
boolean needPerRcProfile = cbi.isPerRcTypeDiscovery();
if(!page.isForPrefs()) {
Tool tool = (Tool)iContext.getTool();
if(null == tool) {
IConfiguration conf = iContext.getConfiguration();
if(null != conf) {
tools = conf.getToolChain().getTools();
}
if(null == tools)
return;
}
if(null == tools)
return;
else
tools = new ITool[] { tool };
}
else
tools = new ITool[] { tool };
for (String profileId : profilesList) {
boolean ok = false;
for(int i = 0; i < tools.length; ++i) {
IInputType[] inputTypes = ((Tool)tools[i]).getAllInputTypes();
if(null != inputTypes) {
for(IInputType it : inputTypes) {
String[] requiedProfiles = getDiscoveryProfileIds(tools[i], it);
if(null != requiedProfiles) {
for(String requiredProfile : requiedProfiles) {
if(profileId.equals(requiredProfile)) {
ok = true;
break;
}
}
}
if(tools != null) {
boolean ok = false;
for(int i = 0; i < tools.length; ++i) {
IInputType[] inputTypes = ((Tool)tools[i]).getAllInputTypes();
if(null != inputTypes) {
for(IInputType it : inputTypes) {
String[] requiedProfiles = getDiscoveryProfileIds(tools[i], it);
if(null != requiedProfiles) {
for(String requiredProfile : requiedProfiles) {
if(profileId.equals(requiredProfile)) {
ok = true;
break;
}
}
}
}
}
if(ok)
break;
}
if(ok)
break;
}
if(!ok)
continue;
if (!ok)
continue;
}
if (needPerRcProfile && !CfgScannerConfigProfileManager.isPerFileProfile(profileId))
continue;
visibleProfilesList.add(profileId);
labels[counter] = profiles[counter] = getProfileName(profileId);
if (profileId.equals(savedId))