Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java')
-rw-r--r--qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java
index 7390f91d368..9bc3f02bd72 100644
--- a/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java
+++ b/qt/org.eclipse.cdt.qt.core/src/org/eclipse/cdt/internal/qt/core/index/QtIndexImpl.java
@@ -12,7 +12,9 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IndexFilter;
+import org.eclipse.cdt.internal.qt.core.pdom.AbstractQtPDOMClass;
import org.eclipse.cdt.internal.qt.core.pdom.QtPDOMQObject;
+import org.eclipse.cdt.qt.core.index.IQGadget;
import org.eclipse.cdt.qt.core.index.IQObject;
import org.eclipse.cdt.qt.core.index.QtIndex;
import org.eclipse.core.runtime.CoreException;
@@ -42,6 +44,11 @@ public class QtIndexImpl extends QtIndex {
return name == null ? null : cdtIndex.get(new QObjectImplAccessor(name));
}
+ @Override
+ public IQGadget findQGadget(String[] name) {
+ return name == null ? null : cdtIndex.get(new QGadgetImplAccessor(name));
+ }
+
private class QObjectImplAccessor implements CDTIndex.Accessor<IQObject> {
private final char[][] name;
@@ -63,4 +70,26 @@ public class QtIndexImpl extends QtIndex {
return null;
}
}
+
+ private class QGadgetImplAccessor implements CDTIndex.Accessor<IQGadget> {
+
+ private final char[][] name;
+
+ public QGadgetImplAccessor(String[] qualName) {
+ name = new char[qualName.length][];
+ for(int i = 0; i < name.length; ++i)
+ name[i] = qualName[i].toCharArray();
+ }
+
+ @Override
+ public IQGadget access(IIndex index) throws CoreException {
+
+ // TODO can there be more than one result?
+ for(IIndexBinding binding : index.findBindings(name, QtLinkageFilter, null))
+ if (binding instanceof AbstractQtPDOMClass)
+ return new QGadget(QtIndexImpl.this, cdtIndex, (AbstractQtPDOMClass) binding);
+
+ return null;
+ }
+ }
}

Back to the top