1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Bug 277903, don't refresh exe list if import doesn't add and new ones.

This commit is contained in:
Ken Ryall 2009-05-26 18:24:30 +00:00
parent 053ba2bfc4
commit 37c2a407da
2 changed files with 14 additions and 10 deletions

View file

@ -45,16 +45,16 @@ import org.eclipse.debug.core.DebugPlugin;
*/ */
public class ExecutablesManager extends PlatformObject { public class ExecutablesManager extends PlatformObject {
private HashMap<String, Executable> executables = new HashMap<String, Executable>(); private final HashMap<String, Executable> executables = new HashMap<String, Executable>();
private List<IExecutablesChangeListener> changeListeners = Collections.synchronizedList(new ArrayList<IExecutablesChangeListener>()); private final List<IExecutablesChangeListener> changeListeners = Collections.synchronizedList(new ArrayList<IExecutablesChangeListener>());
private List<ISourceFileRemapping> sourceFileRemappings = Collections.synchronizedList(new ArrayList<ISourceFileRemapping>()); private final List<ISourceFileRemapping> sourceFileRemappings = Collections.synchronizedList(new ArrayList<ISourceFileRemapping>());
private List<IExecutableProvider> executableProviders = Collections.synchronizedList(new ArrayList<IExecutableProvider>()); private final List<IExecutableProvider> executableProviders = Collections.synchronizedList(new ArrayList<IExecutableProvider>());
private List<ISourceFilesProvider> sourceFileProviders = Collections.synchronizedList(new ArrayList<ISourceFilesProvider>()); private final List<ISourceFilesProvider> sourceFileProviders = Collections.synchronizedList(new ArrayList<ISourceFilesProvider>());
private List<IExecutableImporter> executableImporters = Collections.synchronizedList(new ArrayList<IExecutableImporter>()); private final List<IExecutableImporter> executableImporters = Collections.synchronizedList(new ArrayList<IExecutableImporter>());
private boolean refreshNeeded = true; private boolean refreshNeeded = true;
private boolean tempDisableRefresh = false; private boolean tempDisableRefresh = false;
private Job refreshJob = new Job("Get Executables") { private final Job refreshJob = new Job("Get Executables") {
@Override @Override
public IStatus run(IProgressMonitor monitor) { public IStatus run(IProgressMonitor monitor) {
@ -204,6 +204,7 @@ public class ExecutablesManager extends PlatformObject {
} }
public void importExecutables(final String[] fileNames, IProgressMonitor monitor) { public void importExecutables(final String[] fileNames, IProgressMonitor monitor) {
boolean handled = false;
try { try {
tempDisableRefresh = true; tempDisableRefresh = true;
@ -222,7 +223,7 @@ public class ExecutablesManager extends PlatformObject {
}}); }});
for (IExecutableImporter importer : executableImporters) { for (IExecutableImporter importer : executableImporters) {
boolean handled = importer.importExecutables(fileNames, new SubProgressMonitor(monitor, 1)); handled = importer.importExecutables(fileNames, new SubProgressMonitor(monitor, 1));
if (handled || monitor.isCanceled()) { if (handled || monitor.isCanceled()) {
break; break;
} }
@ -233,6 +234,7 @@ public class ExecutablesManager extends PlatformObject {
tempDisableRefresh = false; tempDisableRefresh = false;
} }
if (handled)
refreshExecutables(monitor); refreshExecutables(monitor);
monitor.done(); monitor.done();
} }

View file

@ -63,6 +63,7 @@ public class StandardExecutableImporter implements IExecutableImporter {
IProject exeProject = null; IProject exeProject = null;
boolean checkProject = false; boolean checkProject = false;
boolean handled = false;
// Weed out existing ones // Weed out existing ones
for (String path : fileNames) { for (String path : fileNames) {
@ -120,6 +121,7 @@ public class StandardExecutableImporter implements IExecutableImporter {
} }
importExecutable(exeProject, path); importExecutable(exeProject, path);
handled = true;
} }
monitor.worked(1); monitor.worked(1);
if (monitor.isCanceled()) { if (monitor.isCanceled()) {
@ -127,7 +129,7 @@ public class StandardExecutableImporter implements IExecutableImporter {
} }
} }
monitor.done(); monitor.done();
return true; return handled;
} }
public boolean AllowImport(IPath path) { public boolean AllowImport(IPath path) {