Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2008-03-18 15:05:02 +0000
committerAnton Leherbauer2008-03-18 15:05:02 +0000
commit616baf0dd6c657da74c92c14131e425c12f69517 (patch)
tree608fd86f8e83bdd9356144edde87ae9f49ba1acd /core/org.eclipse.cdt.core/model/org
parent868da804e7bb2dfe470e79927d40d2f9e9545c56 (diff)
downloadorg.eclipse.cdt-616baf0dd6c657da74c92c14131e425c12f69517.tar.gz
org.eclipse.cdt-616baf0dd6c657da74c92c14131e425c12f69517.tar.xz
org.eclipse.cdt-616baf0dd6c657da74c92c14131e425c12f69517.zip
Cosmetics for binary runner
Diffstat (limited to 'core/org.eclipse.cdt.core/model/org')
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java20
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java2
2 files changed, 13 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
index 0bff1434c24..726d9e8eb00 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 QNX Software Systems and others.
+ * Copyright (c) 2000, 2008 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
* QNX Software Systems - Initial API and implementation
* Warren Paul (Nokia)
* Markus Schorn (Wind River Systems)
+ * Anton Leherbauer (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
@@ -107,7 +108,11 @@ public class BinaryRunner {
vlib.removeChildren();
vbin.removeChildren();
- cproject.getProject().accept(new Visitor(monitor), IContainer.INCLUDE_PHANTOMS);
+ // traverse project, but only if at least one binary parser is configured
+ BinaryParserConfig[] parsers = CModelManager.getDefault().getBinaryParser(cproject.getProject());
+ if (parsers.length > 0) {
+ cproject.getProject().accept(new Visitor(monitor), IContainer.INCLUDE_PHANTOMS);
+ }
if (!monitor.isCanceled()) {
CModelOperation op = new BinaryRunnerOperation(cproject);
@@ -179,10 +184,6 @@ public class BinaryRunner {
return false;
}
vMonitor.worked(1);
- // give a hint to the user of what we are doing
- String name = proxy.getName();
- vMonitor.subTask(name);
-
// Attempt to speed things up by rejecting up front
// Things we know should not be Binary files.
@@ -193,7 +194,7 @@ public class BinaryRunner {
}
// check against known content types
-
+ String name = proxy.getName();
IContentType contentType = CCorePlugin.getContentType(project, name);
if (contentType != null && textContentType != null) {
if (contentType != null && contentType.isKindOf(textContentType)) {
@@ -203,6 +204,9 @@ public class BinaryRunner {
}
}
+ // give a hint to the user of what we are doing
+ vMonitor.subTask(name);
+
// we have a candidate
IPath path = proxy.requestFullPath();
if (path != null) {
@@ -214,8 +218,8 @@ public class BinaryRunner {
if (bin != null) {
// Create the file will add it to the {Archive,Binary}Containery.
factory.create(file, bin, cproject);
- return true;
}
+ return true;
}
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
index f1b1f0dd0f0..bf7a8361ab8 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
@@ -599,7 +599,7 @@ public class CModelManager implements IResourceChangeListener, ICDescriptorListe
try {
parser = parsers[i].getBinaryParser();
if (parser.getHintBufferSize() > hints) {
- hints = parser.getHintBufferSize();
+ hints = Math.max(hints, parser.getHintBufferSize());
}
} catch (CoreException e) {
}

Back to the top