mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 17:25:38 +02:00
Bug 545373 - User Defined Toolchains are not getting saved
Change-Id: I41fa5c60d25936465e19ce4e4f2d820b14102b85 Signed-off-by: Kondal Kolipaka <kondal.kolipaka@gmail.com>
This commit is contained in:
parent
2042418982
commit
4b7b3c5e79
2 changed files with 20 additions and 3 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.ui; singleton:=true
|
||||
Bundle-Version: 6.6.100.qualifier
|
||||
Bundle-Version: 6.6.200.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.ui.CUIPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package org.eclipse.cdt.ui.build;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.build.IToolChain;
|
||||
|
@ -314,8 +315,24 @@ public class ToolChainPreferencePage extends PreferencePage implements IWorkbenc
|
|||
}
|
||||
|
||||
try {
|
||||
if (!toolChains.equals(manager.getAllToolChains())) {
|
||||
manager.setToolChainOrder(toolChains);
|
||||
Collection<IToolChain> latestToolchains = manager.getAllToolChains();
|
||||
if (!toolChains.equals(latestToolchains)) {
|
||||
|
||||
List<IToolChain> newOrderedList = new ArrayList<>();
|
||||
for (IToolChain toolChain : toolChains) {
|
||||
if (latestToolchains.contains(toolChain)) { //Still there? - for example: existing user defined tool chain would have been removed
|
||||
newOrderedList.add(toolChain);
|
||||
}
|
||||
}
|
||||
|
||||
//add the remaining list at the end - for example: newly added user defined tool chains
|
||||
for (IToolChain toolChain : latestToolchains) {
|
||||
if (!newOrderedList.contains(toolChain)) {
|
||||
newOrderedList.add(toolChain);
|
||||
}
|
||||
}
|
||||
|
||||
manager.setToolChainOrder(newOrderedList);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
CUIPlugin.log(e.getStatus());
|
||||
|
|
Loading…
Add table
Reference in a new issue