1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Fix to 175508

This commit is contained in:
Mikhail Sennikovsky 2007-02-26 15:40:20 +00:00
parent 5099040937
commit fdc6c2b7fe
2 changed files with 32 additions and 14 deletions

View file

@ -766,44 +766,61 @@ public class PathEntryTranslator {
return new IPath[0]; return new IPath[0];
} }
private IPath getEntryPath(ICSettingEntry entry){ private IPath[] getEntryPath(ICSettingEntry entry){
return valueToEntryPath(entry.getName(), (entry.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH) != 0); return valueToEntryPath(entry.getName(), (entry.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH) != 0);
} }
private IPath valueToEntryPath(String value, boolean isWsp){ private IPath[] valueToEntryPath(String value, boolean isWsp){
IPath path = new Path(value); IPath path = new Path(value);
IPath result[] = new IPath[2];
if(isWsp){ if(isWsp){
if(!path.isAbsolute()){ if(!path.isAbsolute()){
result[0] = fProject.getFullPath().makeRelative();
result[1] = path;
path = fProject.getFullPath().append(path); path = fProject.getFullPath().append(path);
} else {
if(path.segmentCount() != 0){
result[0] = new Path(path.segment(0));
result[1] = path.removeFirstSegments(1).makeRelative();
} }
path = path.makeRelative(); }
// path = path.makeRelative();
} else { } else {
if(!path.isAbsolute()){ if(!path.isAbsolute()){
IPath location = fProject.getLocation(); IPath location = fProject.getLocation();
if(location != null) if(location != null)
path = location.append(path); path = location.append(path);
} }
result[1] = path;
} }
return path; return result;
} }
public IPathEntry toPathEntry(){ public IPathEntry toPathEntry(){
if(fLangEntry != null){ if(fLangEntry != null){
switch(fLangEntry.getKind()){ switch(fLangEntry.getKind()){
case ICLanguageSettingEntry.INCLUDE_FILE: case ICLanguageSettingEntry.INCLUDE_FILE:{
return CoreModel.newIncludeFileEntry(fPath, null, null, getEntryPath(fLangEntry), getExclusionPatterns(), fIsExported); IPath paths[] = getEntryPath(fLangEntry);
case ICLanguageSettingEntry.INCLUDE_PATH: return CoreModel.newIncludeFileEntry(fPath, null, paths[0], paths[1], getExclusionPatterns(), fIsExported);
}
case ICLanguageSettingEntry.INCLUDE_PATH:{
IPath paths[] = getEntryPath(fLangEntry);
ICIncludePathEntry ipe = (ICIncludePathEntry)fLangEntry; ICIncludePathEntry ipe = (ICIncludePathEntry)fLangEntry;
return CoreModel.newIncludeEntry(fPath, null, getEntryPath(fLangEntry), !ipe.isLocal(), getExclusionPatterns(), fIsExported); return CoreModel.newIncludeEntry(fPath, paths[0], paths[1], !ipe.isLocal(), getExclusionPatterns(), fIsExported);
}
case ICLanguageSettingEntry.MACRO: case ICLanguageSettingEntry.MACRO:
return CoreModel.newMacroEntry(fPath, fLangEntry.getName(), fLangEntry.getValue(), getExclusionPatterns(), fIsExported); return CoreModel.newMacroEntry(fPath, fLangEntry.getName(), fLangEntry.getValue(), getExclusionPatterns(), fIsExported);
case ICLanguageSettingEntry.MACRO_FILE: case ICLanguageSettingEntry.MACRO_FILE:{
return CoreModel.newMacroFileEntry(fPath, null, null, getEntryPath(fLangEntry), getExclusionPatterns(), fIsExported); IPath paths[] = getEntryPath(fLangEntry);
return CoreModel.newMacroFileEntry(fPath, paths[0], null, paths[1], getExclusionPatterns(), fIsExported);
}
case ICLanguageSettingEntry.LIBRARY_PATH: case ICLanguageSettingEntry.LIBRARY_PATH:
return null; return null;
case ICLanguageSettingEntry.LIBRARY_FILE: case ICLanguageSettingEntry.LIBRARY_FILE:{
return CoreModel.newLibraryEntry(fPath, null, getEntryPath(fLangEntry), null, null, null, fIsExported); IPath paths[] = getEntryPath(fLangEntry);
return CoreModel.newLibraryEntry(fPath, paths[0], paths[1], null, null, null, fIsExported);
}
case ICLanguageSettingEntry.OUTPUT_PATH: case ICLanguageSettingEntry.OUTPUT_PATH:
return CoreModel.newOutputEntry(fPath, getExclusionPatterns()); return CoreModel.newOutputEntry(fPath, getExclusionPatterns());
case ICLanguageSettingEntry.SOURCE_PATH: case ICLanguageSettingEntry.SOURCE_PATH:

View file

@ -67,7 +67,6 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
synchronized(this){ synchronized(this){
if(recreate || rescan || !fInited){ if(recreate || rescan || !fInited){
fInited = true;
ICExtensionReference ref = null; ICExtensionReference ref = null;
boolean newStile = true; boolean newStile = true;
ICConfigurationDescription cfg = null; ICConfigurationDescription cfg = null;
@ -111,6 +110,8 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
initializeProvider(fProvider); initializeProvider(fProvider);
} }
fInited = true;
} }
} }