Changeset View
Changeset View
Standalone View
Standalone View
shell/watcheddocumentset.cpp
Show All 22 Lines | |||||
23 | #include "watcheddocumentset.h" | 23 | #include "watcheddocumentset.h" | ||
24 | 24 | | |||
25 | #include <interfaces/icore.h> | 25 | #include <interfaces/icore.h> | ||
26 | #include <interfaces/idocumentcontroller.h> | 26 | #include <interfaces/idocumentcontroller.h> | ||
27 | #include <interfaces/idocument.h> | 27 | #include <interfaces/idocument.h> | ||
28 | #include <interfaces/iprojectcontroller.h> | 28 | #include <interfaces/iprojectcontroller.h> | ||
29 | #include <interfaces/iproject.h> | 29 | #include <interfaces/iproject.h> | ||
30 | #include <language/duchain/duchain.h> | 30 | #include <language/duchain/duchain.h> | ||
31 | #include <language/duchain/duchainlock.h> | ||||
31 | #include <language/duchain/topducontext.h> | 32 | #include <language/duchain/topducontext.h> | ||
32 | #include <project/interfaces/iprojectfilemanager.h> | 33 | #include <project/interfaces/iprojectfilemanager.h> | ||
33 | #include <project/projectmodel.h> | 34 | #include <project/projectmodel.h> | ||
34 | 35 | | |||
35 | namespace KDevelop | 36 | namespace KDevelop | ||
36 | { | 37 | { | ||
37 | 38 | | |||
38 | enum ActionFlag { | 39 | enum ActionFlag { | ||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 142 | foreach (const DUContext::Import& ctx, context->importedParentContexts()) { | |||
143 | 144 | | |||
144 | if (topCtx) | 145 | if (topCtx) | ||
145 | getImportsFromDU(topCtx, visitedContexts); | 146 | getImportsFromDU(topCtx, visitedContexts); | ||
146 | } | 147 | } | ||
147 | } | 148 | } | ||
148 | 149 | | |||
149 | void getImportsFromDUChain() | 150 | void getImportsFromDUChain() | ||
150 | { | 151 | { | ||
152 | KDevelop::DUChainReadLocker lock; | ||||
151 | QSet<TopDUContext*> visitedContexts; | 153 | QSet<TopDUContext*> visitedContexts; | ||
152 | 154 | | |||
153 | m_imports.clear(); | 155 | m_imports.clear(); | ||
154 | foreach (const IndexedString& doc, m_documents) { | 156 | foreach (const IndexedString& doc, m_documents) { | ||
155 | TopDUContext* ctx = DUChain::self()->chainForDocument(doc); | 157 | TopDUContext* ctx = DUChain::self()->chainForDocument(doc); | ||
156 | getImportsFromDU(ctx, visitedContexts); | 158 | getImportsFromDU(ctx, visitedContexts); | ||
157 | visitedContexts.remove(ctx); | 159 | visitedContexts.remove(ctx); | ||
158 | } | 160 | } | ||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |