diff options
author | Andrew Gvozdev | 2009-09-01 03:29:32 +0000 |
---|---|---|
committer | Andrew Gvozdev | 2009-09-01 03:29:32 +0000 |
commit | c180619310950305861771fbeefb89073a4ec0c3 (patch) | |
tree | 20fc0dd49d779585fa3a23f3be07687d27a60f18 /build/org.eclipse.cdt.managedbuilder.ui | |
parent | 640ca45d956f487bf85e28bb25032c684c771116 (diff) | |
download | org.eclipse.cdt-c180619310950305861771fbeefb89073a4ec0c3.tar.gz org.eclipse.cdt-c180619310950305861771fbeefb89073a4ec0c3.tar.xz org.eclipse.cdt-c180619310950305861771fbeefb89073a4ec0c3.zip |
bug 288156: [Scanner Discovery] Makefile project pretends not having discovery profile
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r-- | build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java index f78b8a98796..b019f46ab67 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/properties/DiscoveryTab.java @@ -301,6 +301,24 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf 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() { if (resTable.getSelectionCount() == 0) return; @@ -332,7 +350,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf String[] profiles = new String[profilesList.size()]; int counter = 0; int pos = 0; - String savedId = buildInfo.getSelectedProfileId(); + String selectedProfileId = buildInfo.getSelectedProfileId(); ITool[] tools = null; boolean needPerRcProfile = cbi.isPerRcTypeDiscovery(); if (!page.isForPrefs()) { @@ -349,35 +367,28 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf } } for (String profileId : profilesList) { - if (tools != null) { - boolean ok = false; - for (ITool tool : tools) { - IInputType[] inputTypes = ((Tool) tool).getAllInputTypes(); - if (null != inputTypes) { - for (IInputType it : inputTypes) { - String[] requiedProfiles = getDiscoveryProfileIds(tool, it); - if (null != requiedProfiles) { - for (String requiredProfile : requiedProfiles) { - if (profileId.equals(requiredProfile)) { - ok = true; - break; - } - } - } - } + + // do not check selected profile id in tool-chain because + // for Makefile project tool-chain does not contain profile, + // instead default one is loaded from preferences to selectedProfileId + if (!profileId.equals(selectedProfileId)) { + if (tools != null) { + boolean foundProfile = false; + for (ITool tool : tools) { + foundProfile = toolContainsProfile(tool, profileId); + if (foundProfile) + break; } - if (ok) - break; + if (!foundProfile) + continue; } - if (!ok) - continue; } if (needPerRcProfile && !CfgScannerConfigProfileManager.isPerFileProfile(profileId)) continue; visibleProfilesList.add(profileId); labels[counter] = profiles[counter] = getProfileName(profileId); - if (profileId.equals(savedId)) + if (profileId.equals(selectedProfileId)) pos = counter; buildInfo.setSelectedProfileId(profileId); // needs to create page for (DiscoveryProfilePageConfiguration p : pagesList) { @@ -399,7 +410,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf } profileComboBox.setItems(normalize(labels, profiles, counter)); - buildInfo.setSelectedProfileId(savedId); + buildInfo.setSelectedProfileId(selectedProfileId); if (profileComboBox.getItemCount() > 0) profileComboBox.select(pos); enableAllControls(); |