mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
bug 288156: [Scanner Discovery] Makefile project pretends not having discovery profile
This commit is contained in:
parent
640ca45d95
commit
c180619310
1 changed files with 34 additions and 23 deletions
|
@ -301,6 +301,24 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
||||||
return (x == -1) ? id : id.substring(x + 1);
|
return (x == -1) ? id : id.substring(x + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean toolContainsProfile(ITool tool, String profileId) {
|
||||||
|
IInputType[] inputTypes = ((Tool) tool).getAllInputTypes();
|
||||||
|
if (inputTypes == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (IInputType inputType : inputTypes) {
|
||||||
|
String[] requiedProfiles = getDiscoveryProfileIds(tool, inputType);
|
||||||
|
if (requiedProfiles != null) {
|
||||||
|
for (String requiredProfile : requiedProfiles) {
|
||||||
|
if (profileId.equals(requiredProfile)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
private void handleToolSelected() {
|
private void handleToolSelected() {
|
||||||
if (resTable.getSelectionCount() == 0)
|
if (resTable.getSelectionCount() == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -332,7 +350,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
||||||
String[] profiles = new String[profilesList.size()];
|
String[] profiles = new String[profilesList.size()];
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
String savedId = buildInfo.getSelectedProfileId();
|
String selectedProfileId = buildInfo.getSelectedProfileId();
|
||||||
ITool[] tools = null;
|
ITool[] tools = null;
|
||||||
boolean needPerRcProfile = cbi.isPerRcTypeDiscovery();
|
boolean needPerRcProfile = cbi.isPerRcTypeDiscovery();
|
||||||
if (!page.isForPrefs()) {
|
if (!page.isForPrefs()) {
|
||||||
|
@ -349,35 +367,28 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String profileId : profilesList) {
|
for (String profileId : profilesList) {
|
||||||
if (tools != null) {
|
|
||||||
boolean ok = false;
|
// do not check selected profile id in tool-chain because
|
||||||
for (ITool tool : tools) {
|
// for Makefile project tool-chain does not contain profile,
|
||||||
IInputType[] inputTypes = ((Tool) tool).getAllInputTypes();
|
// instead default one is loaded from preferences to selectedProfileId
|
||||||
if (null != inputTypes) {
|
if (!profileId.equals(selectedProfileId)) {
|
||||||
for (IInputType it : inputTypes) {
|
if (tools != null) {
|
||||||
String[] requiedProfiles = getDiscoveryProfileIds(tool, it);
|
boolean foundProfile = false;
|
||||||
if (null != requiedProfiles) {
|
for (ITool tool : tools) {
|
||||||
for (String requiredProfile : requiedProfiles) {
|
foundProfile = toolContainsProfile(tool, profileId);
|
||||||
if (profileId.equals(requiredProfile)) {
|
if (foundProfile)
|
||||||
ok = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (ok)
|
if (!foundProfile)
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
if (!ok)
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if (needPerRcProfile && !CfgScannerConfigProfileManager.isPerFileProfile(profileId))
|
if (needPerRcProfile && !CfgScannerConfigProfileManager.isPerFileProfile(profileId))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
visibleProfilesList.add(profileId);
|
visibleProfilesList.add(profileId);
|
||||||
labels[counter] = profiles[counter] = getProfileName(profileId);
|
labels[counter] = profiles[counter] = getProfileName(profileId);
|
||||||
if (profileId.equals(savedId))
|
if (profileId.equals(selectedProfileId))
|
||||||
pos = counter;
|
pos = counter;
|
||||||
buildInfo.setSelectedProfileId(profileId); // needs to create page
|
buildInfo.setSelectedProfileId(profileId); // needs to create page
|
||||||
for (DiscoveryProfilePageConfiguration p : pagesList) {
|
for (DiscoveryProfilePageConfiguration p : pagesList) {
|
||||||
|
@ -399,7 +410,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
||||||
}
|
}
|
||||||
profileComboBox.setItems(normalize(labels, profiles, counter));
|
profileComboBox.setItems(normalize(labels, profiles, counter));
|
||||||
|
|
||||||
buildInfo.setSelectedProfileId(savedId);
|
buildInfo.setSelectedProfileId(selectedProfileId);
|
||||||
if (profileComboBox.getItemCount() > 0)
|
if (profileComboBox.getItemCount() > 0)
|
||||||
profileComboBox.select(pos);
|
profileComboBox.select(pos);
|
||||||
enableAllControls();
|
enableAllControls();
|
||||||
|
|
Loading…
Add table
Reference in a new issue