| 63 | }; |
| 64 | |
| 65 | void TemplateClassGeneratorPrivate::fetchSuperClasses(const DeclarationPointer& declaration) |
| 66 | { |
| 67 | DUChainReadLocker lock; |
| 68 | |
| 69 | //Prevent duplicity |
| 70 | if (allBaseClasses.contains(declaration)) { |
| 71 | return; |
| 72 | } |
| 73 | |
| 74 | allBaseClasses << declaration; |
| 75 | |
| 76 | DUContext* context = declaration->internalContext(); |
| 77 | if (context) { |
| 78 | const auto importedParentContexts = context->importedParentContexts(); |
| 79 | for (const DUContext::Import& import : importedParentContexts) { |
| 80 | if (DUContext* parentContext = import.context(context->topContext())) { |
| 81 | if (parentContext->type() == DUContext::Class) { |
| 82 | fetchSuperClasses(DeclarationPointer(parentContext->owner())); |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | TemplateClassGenerator::TemplateClassGenerator(const QUrl& baseUrl) |
| 90 | : d_ptr(new TemplateClassGeneratorPrivate) |
no test coverage detected