Use range-based loops for const Qt containers instead pf Qt's "foreach"

Done for code which already gets a const container var passed to the
foreach macro, or where the var instance can be made const by a simple
"const" keyword addition.
parent d7d41f00
......@@ -93,7 +93,7 @@ QString serializeOpenFilesMessage(const QVector<UrlInfo> &infos)
void openFiles(const QVector<UrlInfo>& infos)
{
foreach (const UrlInfo& info, infos) {
for (const UrlInfo& info : infos) {
if (!ICore::self()->documentController()->openDocument(info.url, info.cursor)) {
qWarning(APP) << i18n("Could not open %1", info.url.toDisplayString(QUrl::PreferLocalFile));
}
......@@ -218,7 +218,7 @@ static int openFilesInRunningInstance(const QVector<UrlInfo>& files, qint64 pid)
QStringList urls;
bool errors_occured = false;
foreach ( const UrlInfo& file, files ) {
for (const UrlInfo& file : files) {
QDBusReply<bool> result = iface.call(QStringLiteral("openDocumentSimple"), file.url.toString(), file.cursor.line(), file.cursor.column());
if ( ! result.value() ) {
QTextStream err(stderr);
......@@ -241,7 +241,7 @@ static int openProjectInRunningInstance(const QVector<UrlInfo>& paths, qint64 pi
QDBusInterface iface(service, QStringLiteral("/org/kdevelop/ProjectController"), QStringLiteral("org.kdevelop.ProjectController"));
int errors = 0;
foreach ( const UrlInfo& path, paths ) {
for (const UrlInfo& path : paths) {
QDBusReply<void> result = iface.call(QStringLiteral("openProjectForUrl"), path.url.toString());
if ( !result.isValid() ) {
QTextStream err(stderr);
......@@ -286,8 +286,7 @@ static QString findSessionId(const SessionInfos& availableSessionInfos, const QS
//If there is a session and a project with the same name, always open the session
//regardless of the order encountered
QString projectAsSession;
foreach(const KDevelop::SessionInfo& si, availableSessionInfos)
{
for (const KDevelop::SessionInfo& si : availableSessionInfos) {
if ( session == si.name || session == si.uuid.toString() ) {
return si.uuid.toString();
} else if (projectAsSession.isEmpty()) {
......@@ -565,9 +564,10 @@ int main( int argc, char *argv[] )
QString session;
uint nRunningSessions = 0;
foreach(const KDevelop::SessionInfo& si, availableSessionInfos)
for (const KDevelop::SessionInfo& si : availableSessionInfos) {
if(KDevelop::SessionController::isSessionRunning(si.uuid.toString()))
++nRunningSessions;
}
// also show the picker dialog when a pid shall be retrieved and multiple
// sessions are running.
......@@ -575,10 +575,11 @@ int main( int argc, char *argv[] )
{
QTextStream qerr(stderr);
SessionInfos candidates;
foreach(const KDevelop::SessionInfo& si, availableSessionInfos)
for (const KDevelop::SessionInfo& si : availableSessionInfos) {
if( (!si.name.isEmpty() || !si.projects.isEmpty() || parser.isSet(QStringLiteral("pid"))) &&
(!parser.isSet(QStringLiteral("pid")) || KDevelop::SessionController::isSessionRunning(si.uuid.toString())))
candidates << si;
}
if(candidates.size() == 0)
{
......@@ -636,8 +637,7 @@ int main( int argc, char *argv[] )
} else if ( parser.isSet(QStringLiteral("new-session")) )
{
session = parser.value(QStringLiteral("new-session"));
foreach(const KDevelop::SessionInfo& si, availableSessionInfos)
{
for (const KDevelop::SessionInfo& si : availableSessionInfos) {
if ( session == si.name ) {
QTextStream qerr(stderr);
qerr << endl << i18n("A session with the name %1 exists already. Use the -s switch to open it.", session) << endl;
......@@ -675,9 +675,10 @@ int main( int argc, char *argv[] )
if(parser.isSet(QStringLiteral("pid"))) {
if (session.isEmpty())
{ // just pick the first running session
foreach(const KDevelop::SessionInfo& si, availableSessionInfos)
for (const KDevelop::SessionInfo& si : availableSessionInfos) {
if(KDevelop::SessionController::isSessionRunning(si.uuid.toString()))
session = si.uuid.toString();
}
}
const KDevelop::SessionInfo* sessionData = findSessionInList(availableSessionInfos, session);
......
......@@ -58,9 +58,9 @@ Plasma::Service *KDevelopSessionsEngine::serviceForSource(const QString &source)
QStringList findSessions()
{
QStringList sessionDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kdevelop/sessions"), QStandardPaths::LocateDirectory);
const QStringList sessionDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kdevelop/sessions"), QStandardPaths::LocateDirectory);
QStringList sessionrcs;
Q_FOREACH(const QString& dir, sessionDirs) {
for (const QString& dir : sessionDirs) {
QDir d(dir);
Q_FOREACH(const QString& sessionDir, d.entryList(QDir::Dirs)) {
QDir sd(d.absoluteFilePath(sessionDir));
......
......@@ -54,7 +54,7 @@ KDevelopSessions::KDevelopSessions(QObject *parent, const QVariantList& args)
KDirWatch *historyWatch = new KDirWatch(this);
const QStringList sessiondirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QStringLiteral("kdevelop/sessions"), QStandardPaths::LocateDirectory);
foreach (const QString &dir, sessiondirs) {
for (const QString& dir : sessiondirs) {
historyWatch->addDir(dir);
}
connect(historyWatch, &KDirWatch::dirty, this, &KDevelopSessions::loadSessions);
......@@ -72,11 +72,11 @@ KDevelopSessions::~KDevelopSessions() = default;
QStringList findSessions()
{
QStringList sessionDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QStringLiteral("kdevelop/sessions"),
QStandardPaths::LocateDirectory);
const QStringList sessionDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
QStringLiteral("kdevelop/sessions"),
QStandardPaths::LocateDirectory);
QStringList sessionrcs;
Q_FOREACH(const QString& dir, sessionDirs) {
for (const QString& dir : sessionDirs) {
QDir d(dir);
Q_FOREACH(const QString& sessionDir, d.entryList(QDir::Dirs)) {
QDir sd(d.absoluteFilePath(sessionDir));
......@@ -96,8 +96,7 @@ void KDevelopSessions::loadSessions()
// Should we add a match for this option or would that clutter the matches too much?
const QStringList list = findSessions();
m_sessions.reserve(list.size());
foreach (const QString &sessionfile, list)
{
for (const QString& sessionfile : list) {
Session session;
session.id = sessionfile.section('/', -2, -2);
KConfig cfg(sessionfile, KConfig::SimpleConfig);
......
......@@ -230,9 +230,9 @@ void FramestackWidget::frameContextMenuRequested(const QPoint& pos)
void FramestackWidget::copySelection()
{
QClipboard *cb = QApplication::clipboard();
QModelIndexList indexes = m_framesTreeView->selectionModel()->selectedRows();
const QModelIndexList indexes = m_framesTreeView->selectionModel()->selectedRows();
QString content;
Q_FOREACH(const QModelIndex& index, indexes) {
for (const QModelIndex& index : indexes) {
IFrameStackModel::FrameItem frame = m_session->frameStackModel()->frame(index);
if (frame.line == -1) {
content += i18nc("#frame function() at file", "#%1 %2() at %3\n",
......
......@@ -101,7 +101,7 @@ void SourceFormatterStyle::setMimeTypes(const SourceFormatterStyle::MimeList& ty
void SourceFormatterStyle::setMimeTypes(const QStringList& types)
{
foreach ( auto& t, types ) {
for (auto& t : types) {
auto items = t.split(QLatin1Char('|'));
if ( items.size() != 2 ) {
continue;
......
......@@ -138,7 +138,7 @@ struct DocumentParsePlan
{
//Pick the strictest possible flags
ParseJob::SequentialProcessingFlags ret = ParseJob::IgnoresSequentialProcessing;
foreach(const DocumentParseTarget &target, targets) {
for (const DocumentParseTarget& target : targets) {
ret |= target.sequentialProcessingFlags;
}
return ret;
......@@ -148,7 +148,7 @@ struct DocumentParsePlan
{
//Pick the best priority
int ret = BackgroundParser::WorstPriority;
foreach(const DocumentParseTarget &target, targets) {
for (const DocumentParseTarget& target : targets) {
if(target.priority < ret) {
ret = target.priority;
}
......@@ -160,7 +160,7 @@ struct DocumentParsePlan
{
//Pick the best features
TopDUContext::Features ret = (TopDUContext::Features)0;
foreach(const DocumentParseTarget &target, targets) {
for (const DocumentParseTarget& target : targets) {
ret = (TopDUContext::Features) (ret | target.features);
}
return ret;
......@@ -170,7 +170,7 @@ struct DocumentParsePlan
{
QVector<QPointer<QObject>> ret;
foreach(const DocumentParseTarget &target, targets) {
for (const DocumentParseTarget& target : targets) {
if(target.notifyWhenReady)
ret << target.notifyWhenReady;
}
......
......@@ -171,9 +171,9 @@ static Cursor cursorAdd(Cursor c, const QString& text)
int DocumentChangeTracker::recommendedDelay(KTextEditor::Document* doc, const KTextEditor::Range& range,
const QString& text, bool removal)
{
auto languages = ICore::self()->languageController()->languagesForUrl(doc->url());
const auto languages = ICore::self()->languageController()->languagesForUrl(doc->url());
int delay = ILanguageSupport::NoUpdateRequired;
Q_FOREACH (const auto& lang, languages) {
for (const auto& lang : languages) {
// take the largest value, because NoUpdateRequired is -2 and we want to make sure
// that if one language requires an update it actually happens
delay = qMax<int>(lang->suggestedReparseDelayForChange(doc, range, text, removal), delay);
......
......@@ -224,12 +224,11 @@ void ClassModel::nodesLayoutAboutToBeChanged(ClassModelNodes::Node*)
void ClassModel::nodesLayoutChanged(ClassModelNodes::Node*)
{
QModelIndexList oldIndexList = persistentIndexList();
const QModelIndexList oldIndexList = persistentIndexList();
QModelIndexList newIndexList;
newIndexList.reserve(oldIndexList.size());
foreach(const QModelIndex& oldIndex, oldIndexList)
{
for (const QModelIndex& oldIndex : oldIndexList) {
Node* node = static_cast<Node*>(oldIndex.internalPointer());
if ( node )
{
......
......@@ -430,10 +430,9 @@ void DerivedClassesFolderNode::populateNode()
if ( klass )
{
uint steps = 10000;
QList< Declaration* > inheriters = DUChainUtils::getInheriters(klass, steps, true);
const QList<Declaration*> inheriters = DUChainUtils::getInheriters(klass, steps, true);
foreach( Declaration* decl, inheriters )
{
for (Declaration* decl : inheriters) {
addNode( new ClassNode(decl, m_model) );
}
}
......
......@@ -112,10 +112,10 @@ void CodeCompletion::checkDocument(Document* textDocument)
{
unregisterDocument(textDocument);
auto langs = ICore::self()->languageController()->languagesForUrl( textDocument->url() );
const auto langs = ICore::self()->languageController()->languagesForUrl( textDocument->url() );
bool found = false;
foreach(const auto lang, langs) {
for (const auto lang : langs) {
if(m_language==lang->name()) {
found=true;
break;
......
......@@ -64,13 +64,13 @@ void CompletionTreeElement::setParent(CompletionTreeElement* parent) {
}
void CompletionTreeNode::appendChildren(const QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeElement>>& children) {
foreach (const auto& child, children) {
for (const auto& child : children) {
appendChild(child);
}
}
void CompletionTreeNode::appendChildren(const QList<QExplicitlySharedDataPointer<KDevelop::CompletionTreeItem>>& children) {
foreach (const auto& child, children) {
for (const auto& child : children) {
appendChild(CompletionTreeElementPointer(child.data()));
}
}
......
......@@ -35,7 +35,7 @@ struct CodeCompletionItemLastGrouper {
CodeCompletionItemLastGrouper(QList<QExplicitlySharedDataPointer<CompletionTreeElement>>& tree, CompletionTreeNode* parent, const QList<CompletionTreeItemPointer>& items)
{
tree.reserve(tree.size() + items.size());
foreach( CompletionTreeItemPointer item, items ) {
for (auto& item : items) {
item->setParent(parent);
tree << QExplicitlySharedDataPointer<CompletionTreeElement>( item.data() );
}
......@@ -52,7 +52,7 @@ struct CodeCompletionItemGrouper {
typedef QMap<KeyType, QList<CompletionTreeItemPointer> > GroupMap;
GroupMap groups;
foreach(const CompletionTreeItemPointer& item, items) {
for (auto& item : items) {
KeyType key = KeyExtractor::extract(item);
typename GroupMap::iterator it = groups.find(key);
if(it == groups.end())
......
......@@ -74,7 +74,7 @@ struct CodeCompletionItemTester
void addElements(const QList<Element>& elements)
{
foreach(Element element, elements) {
for (auto& element : elements) {
Item item(dynamic_cast<CompletionTreeItem*>(element.data()));
if(item)
items << item;
......@@ -86,7 +86,7 @@ struct CodeCompletionItemTester
bool containsDeclaration(Declaration* dec) const
{
foreach(Item item, items) {
for (auto& item : items) {
if (item->declaration().data() == dec) {
return true;
}
......@@ -178,9 +178,10 @@ struct InsertIntoDUChain
m_topContext = nullptr;
QList< TopDUContext* > chains = DUChain::self()->chainsForDocument(m_insertedCode.file());
foreach(TopDUContext* top, chains)
const QList<TopDUContext*> chains = DUChain::self()->chainsForDocument(m_insertedCode.file());
for (TopDUContext* top : chains) {
DUChain::self()->removeDocumentChain(top);
}
}
}
......
......@@ -108,9 +108,9 @@
*
* Make a member variable private and add accessor methods:
* \code
* QList<KDevelop::Declaration*> declarations = topContext->findDeclarations("m_myVariable");
* const QList<KDevelop::Declaration*> declarations = topContext->findDeclarations("m_myVariable");
*
* foreach ( KDevelop::Declaration* d, declarations ) {
* for ( KDevelop::Declaration* d : declarations ) {
* if ( KDevelop::ClassMemberDeclaration* cd = dynamic_cast<KDevelop::ClassMemberDeclaration*>( d ) ) {
* if ( cd->accessPolicy() == KDevelop::Declaration::Public ) {
* KDevelop::DUChainRef* ref = change->modifyObject( cd );
......
......@@ -192,7 +192,7 @@ DocumentChangeSet::ChangeResult BasicRefactoring::applyChangesToDeclarations(con
DocumentChangeSet &changes,
const QList<IndexedDeclaration> &declarations)
{
foreach (const IndexedDeclaration decl, declarations) {
for (auto& decl : declarations) {
Declaration *declaration = decl.data();
if (!declaration)
continue;
......
......@@ -258,8 +258,7 @@ template <class T> QVariant toVariantList(const QVector<T>& list)
{
QVariantList ret;
ret.reserve(list.size());
foreach (const T& t, list)
{
for (const T& t : list) {
ret << QVariant::fromValue<T>(t);
}
return QVariant::fromValue(ret);
......
......@@ -157,9 +157,8 @@ bool CodeGeneratorBase::execute()
if(!d->context)
{
//Attempt to get the context again
QList<TopDUContext *> contexts = DUChain::self()->chainsForDocument(document);
foreach(TopDUContext * top, contexts)
{
const QList<TopDUContext*> contexts = DUChain::self()->chainsForDocument(document);
for (TopDUContext* top : contexts) {
qCDebug(LANGUAGE) << "Checking top context with range: " << top->range() << " for a context";
if((d->context = top->findContextIncluding(d->range)))
break;
......
......@@ -266,9 +266,9 @@ DocumentChangeSet::ChangeResult DocumentChangeSet::applyAllChanges()
ChangesHash filteredSortedChanges;
ChangeResult result = ChangeResult::successfulResult();
QList<IndexedString> files(d->changes.keys());
const QList<IndexedString> files(d->changes.keys());
foreach(const IndexedString &file, files) {
for (const IndexedString& file : files) {
CodeRepresentation::Ptr repr = createCodeRepresentation(file);
if(!repr) {
return ChangeResult(QStringLiteral("Could not create a Representation for %1").arg(file.str()));
......@@ -293,7 +293,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSet::applyAllChanges()
QMap<IndexedString, QString> oldTexts;
//Apply the changes to the files
foreach(const IndexedString &file, files) {
for (const IndexedString& file : files) {
oldTexts[file] = codeRepresentations[file]->text();
result = d->replaceOldText(codeRepresentations[file].data(), newTexts[file], filteredSortedChanges[file]);
......@@ -310,7 +310,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSet::applyAllChanges()
d->updateFiles();
if(d->activationPolicy == Activate) {
foreach(const IndexedString& file, files) {
for (const IndexedString& file : files) {
ICore::self()->documentController()->openDocument(file.toUrl());
}
}
......
......@@ -256,12 +256,11 @@ QVector<SourceFileTemplate::OutputFile> SourceFileTemplate::outputFiles() const
KConfig templateConfig(d->descriptionFileName);
KConfigGroup group(&templateConfig, "General");
QStringList files = group.readEntry("Files", QStringList());
const QStringList files = group.readEntry("Files", QStringList());
qCDebug(LANGUAGE) << "Files in template" << files;
outputFiles.reserve(files.size());
foreach (const QString& fileGroup, files)
{
for (const QString& fileGroup : files) {
KConfigGroup cg(&templateConfig, fileGroup);
OutputFile f;
f.identifier = cg.name();
......
......@@ -221,8 +221,7 @@ void TemplateClassGenerator::setIdentifier(const QString& identifier)
QStringLiteral("/"),
};
QStringList ns;
foreach (const QString& separator, separators)
{
for (const QString& separator : separators) {
ns = identifier.split(separator);
if (ns.size() > 1)
{
......@@ -318,7 +317,7 @@ void TemplateClassGenerator::setBaseClasses(const QList<QString>& bases)
d->allBaseClasses.clear();
// add all bases
foreach (const QString& base, bases) {
for (const QString& base : bases) {
addBaseClass(base);
}
}
......
......@@ -236,8 +236,7 @@ QStringList TemplateRenderer::render(const QStringList& contents) const
qCDebug(LANGUAGE) << d->context.stackHash(0);
QStringList ret;
ret.reserve(contents.size());
foreach (const QString& content, contents)
{
for (const QString& content : contents) {
ret << render(content);
}
return ret;
......
......@@ -116,16 +116,16 @@ void TemplatesModel::refresh()
QStringList templateArchives;
foreach(const QString& archivePath, d->searchPaths) {
const QStringList files = QDir(archivePath).entryList(QDir::Files);
foreach(const QString& file, files) {
for (const QString& file : files) {
templateArchives.append(archivePath + file);
}
}
QStringList templateDescriptions;
const QStringList templatePaths = {QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + d->resourceFilter(TemplatesModelPrivate::Description)};
foreach(const QString& templateDescription, templatePaths) {
for (const QString& templateDescription : templatePaths) {
const QStringList files = QDir(templateDescription).entryList(QDir::Files);
foreach(const QString& file, files) {
for (const QString& file : files) {
templateDescriptions.append(templateDescription + file);
}
}
......@@ -163,12 +163,11 @@ void TemplatesModel::refresh()
QStandardItem *TemplatesModelPrivate::createItem(const QString& name, const QString& category, QStandardItem* parent)
{
QStringList path = category.split(QLatin1Char('/'));
const QStringList path = category.split(QLatin1Char('/'));
QStringList currentPath;
currentPath.reserve(path.size());
foreach (const QString& entry, path)
{
for (const QString& entry : path) {
currentPath << entry;
if (!templateItems.contains(currentPath.join(QLatin1Char('/')))) {
QStandardItem *item = new QStandardItem(entry);
......@@ -194,7 +193,7 @@ void TemplatesModelPrivate::extractTemplateDescriptions()
searchPaths.removeDuplicates();
foreach(const QString &archivePath, searchPaths) {
const QStringList files = QDir(archivePath).entryList(QDir::Files);
foreach(const QString& file, files) {
for (const QString& file : files) {
if(file.endsWith(QLatin1String(".zip")) || file.endsWith(QLatin1String(".tar.bz2"))) {
QString archfile = archivePath + file;
templateArchives.append(archfile);
......@@ -248,8 +247,8 @@ void TemplatesModelPrivate::extractTemplateDescriptions()
*
* This is needed because kde-files.org renames downloaded files
*/
foreach (const QString& entryName, templateArchive->directory()->entries())
{
const auto dirEntries = templateArchive->directory()->entries();
for (const QString& entryName : dirEntries) {
if (entryName.endsWith(suffix)) {
templateEntry = templateArchive->directory()->entry(entryName);
break;
......@@ -265,8 +264,8 @@ void TemplatesModelPrivate::extractTemplateDescriptions()
if (!templateEntry || !templateEntry->isFile())
{
foreach (const QString& entryName, templateArchive->directory()->entries())
{
const auto dirEntries = templateArchive->directory()->entries();
for (const QString& entryName : dirEntries) {
if (entryName.endsWith(suffix)) {
templateEntry = templateArchive->directory()->entry(entryName);
break;
......@@ -317,12 +316,11 @@ QModelIndexList TemplatesModel::templateIndexes(const QString& fileName) const
{
KConfig templateConfig(description);
KConfigGroup general(&templateConfig, "General");
QStringList categories = general.readEntry("Category").split(QLatin1Char('/'));
const QStringList categories = general.readEntry("Category").split(QLatin1Char('/'));
QStringList levels;
levels.reserve(categories.size());
foreach (const QString& category, categories)
{
for (const QString& category : categories) {
levels << category;
indexes << d->templateItems[levels.join(QLatin1Char('/'))]->index();
}
......@@ -385,9 +383,8 @@ QString TemplatesModel::loadTemplateFile(const QString& fileName)
archive.open(QIODevice::WriteOnly);
QDir dir(info.absoluteDir());
QDir::Filters filter = QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot;
foreach (const QFileInfo& entry, dir.entryInfoList(filter))
{
const auto dirEntryInfos = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
for (const QFileInfo& entry : dirEntryInfos) {
if (entry.isFile())
{
archive.addLocalFile(entry.absoluteFilePath(), entry.fileName());
......
......@@ -75,12 +75,11 @@ IndexedString fetchImplementationFileForClass(const Declaration & targetClass)
context = realClass->internalContext();
}
QVector<Declaration *> declarations = context->localDeclarations();
const QVector<Declaration*> declarations = context->localDeclarations();
QMap<IndexedString, unsigned int > implementationsInFile;
foreach(Declaration * decl, declarations)
{
for (Declaration* decl : declarations) {
///@todo check for static variable instantiation as well
if(ClassFunctionDeclaration * classFun = dynamic_cast<ClassFunctionDeclaration *>(decl))
if(FunctionDefinition * def = FunctionDefinition::definition(classFun))
......@@ -111,12 +110,13 @@ IndexedString fetchImplementationFileForClass(const Declaration & targetClass)
IndexedString mostUsesFile;
unsigned int mostUses = 0;
foreach(const IndexedString& currentFile, tiedFiles)
for (const IndexedString& currentFile : tiedFiles) {
if(static_cast<unsigned int>(uses[currentFile].size()) > mostUses)
{
mostUses = uses[currentFile].size();
mostUsesFile = currentFile;
}
}
return mostUsesFile;
}
......
......@@ -115,8 +115,8 @@ protected:
if (LanguageSpecificDeclarationBuilderBase::recompiling()) {
// Seek a matching declaration
QList<Declaration*> declarations = LanguageSpecificDeclarationBuilderBase::currentContext()->findLocalDeclarations(localId, CursorInRevision::invalid(), this->topContext(), AbstractType::Ptr(), DUContext::NoFiltering);
foreach( Declaration* dec, declarations ) {
const QList<Declaration*> declarations = LanguageSpecificDeclarationBuilderBase::currentContext()->findLocalDeclarations(localId, CursorInRevision::invalid(), this->topContext(), AbstractType::Ptr(), DUContext::NoFiltering);
for (Declaration* dec : declarations) {
if( LanguageSpecificDeclarationBuilderBase::wasEncountered(dec) )
continue;
......
......@@ -221,13 +221,13 @@ protected:
CursorInRevision pos(this->editorFindRange(typeNode, typeNode).start);
DUChainReadLocker lock(DUChain::lock());
QList<Declaration*> dec = searchContext()->findDeclarations(id, pos);
const QList<Declaration*> dec = searchContext()->findDeclarations(id, pos);
if ( dec.isEmpty() )
delay = true;
if(!delay) {
foreach( Declaration* decl, dec ) {