diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index 912b2e07e17..1812b0329a2 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,7 @@ +2003-11-26 Mikhail Khodjaiants + Fix for PR 47595: Referenced projects are not checked in the list of generic source locations. + * SourceLookupBlock.java + 2003-11-26 Mikhail Khodjaiants Cleanup. * CDTDebugModelPresentation.java diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java index fe94b5f2359..490ff27fbc2 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/sourcelookup/SourceLookupBlock.java @@ -126,31 +126,25 @@ public class SourceLookupBlock implements Observer IProject project = getProjectFromLaunchConfiguration( configuration ); if ( project != null ) { - IProject oldProject = getProject(); setProject( project ); - if ( project.equals( oldProject ) ) + try { - try + String id = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "" ); + if ( isEmpty( id ) || + CDebugUIPlugin.getDefaultSourceLocatorID().equals( id ) || + CDebugUIPlugin.getDefaultSourceLocatorOldID().equals( id ) ) { - String id = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "" ); - if ( isEmpty( id ) || - CDebugUIPlugin.getDefaultSourceLocatorID().equals( id ) || - CDebugUIPlugin.getDefaultSourceLocatorOldID().equals( id ) ) - { - String memento = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "" ); - if ( !isEmpty( memento ) ) - initializeFromMemento( memento ); - else - initializeDefaults(); - } - } - catch( CoreException e ) - { - initializeDefaults(); + String memento = configuration.getAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, "" ); + if ( !isEmpty( memento ) ) + initializeFromMemento( memento ); + else + initializeDefaults(); } } - else + catch( CoreException e ) + { initializeDefaults(); + } } else { @@ -174,7 +168,22 @@ public class SourceLookupBlock implements Observer private void initializeDefaults() { - initializeGeneratedLocations( getProject(), new ICSourceLocation[] { SourceLookupFactory.createProjectSourceLocation( getProject() ) } ); + fGeneratedSourceListField.removeAllElements(); + IProject project = getProject(); + if ( project != null && project.exists() && project.isOpen() ) + { + ICSourceLocation location = SourceLookupFactory.createProjectSourceLocation( project, true ); + fGeneratedSourceListField.addElement( location ); + fGeneratedSourceListField.setChecked( location, true ); + List list = CDebugUtils.getReferencedProjects( project ); + Iterator it = list.iterator(); + while( it.hasNext() ) + { + location = SourceLookupFactory.createProjectSourceLocation( (IProject)it.next(), true ); + fGeneratedSourceListField.addElement( location ); + fGeneratedSourceListField.setChecked( location, true ); + } + } resetAdditionalLocations( CDebugCorePlugin.getDefault().getCommonSourceLocations() ); fSearchForDuplicateFiles.setSelection( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) ); }