Skip to main content
summaryrefslogtreecommitdiffstats
path: root/qt
diff options
context:
space:
mode:
authorAlena Laskavaia2014-11-28 15:22:49 -0500
committerElena Laskavaia2014-12-01 17:00:12 -0500
commitb53246227a4f3470545094eb0657dd5873a0b0e6 (patch)
tree445175bd3189f2c5fde5f1330ada4f101e292815 /qt
parent1e517e23e45c19d5601d62d6b66d26b5cae4665d (diff)
downloadorg.eclipse.cdt-b53246227a4f3470545094eb0657dd5873a0b0e6.tar.gz
org.eclipse.cdt-b53246227a4f3470545094eb0657dd5873a0b0e6.tar.xz
org.eclipse.cdt-b53246227a4f3470545094eb0657dd5873a0b0e6.zip
Optimzed Qt codan checker not to lock the ask if not running
Change-Id: Iff6749ea46f9c6970b4e96e47d8554846feb0dfe Signed-off-by: Alena Laskavaia <elaskavaia.cdt@gmail.com> Reviewed-on: https://git.eclipse.org/r/37304
Diffstat (limited to 'qt')
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java
index b582aeb804..93a5896ccd 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/codan/QtSyntaxChecker.java
@@ -24,6 +24,8 @@ import org.eclipse.cdt.internal.qt.core.QtMethodReference;
import org.eclipse.cdt.qt.core.QtNature;
import org.eclipse.cdt.qt.core.QtPlugin;
import org.eclipse.cdt.qt.core.index.IQMethod;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.osgi.util.NLS;
/**
@@ -49,6 +51,13 @@ public class QtSyntaxChecker extends AbstractIndexAstChecker implements IChecker
}
@Override
+ public synchronized boolean processResource(IResource resource) throws OperationCanceledException {
+ if (QtNature.hasNature(resource.getProject()))
+ return super.processResource(resource);
+ return false;
+ }
+
+ @Override
public void processAst(IASTTranslationUnit ast) {
// Run the checker only on Qt-enabled projects.
if (QtNature.hasNature(ASTUtil.getProject(ast)))

Back to the top