Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 1eae0c48 authored by David Nolden's avatar David Nolden

Adapt to changes in kdevplatform

parent a04bd3a2
......@@ -186,19 +186,6 @@ class CppDUContext : public BaseContext {
CppDUContext( const Param1& p1, const Param2& p2) : BaseContext(p1, p2), m_instantiatedFrom(0) {
}
~CppDUContext() {
//Delete all the local declarations first, so they also delete their instantiations
BaseContext::deleteLocalDeclarations();
//Specializations will be destroyed the same time this is destroyed
QSet<CppDUContext<BaseContext>*> instatiations;
{
QMutexLocker l(&cppDuContextInstantiationsMutex);
instatiations = m_instatiations;
}
foreach( CppDUContext<BaseContext>* instatiation, instatiations )
delete instatiation;
}
///Overridden to take care of templates and other c++ specific things
virtual bool findDeclarationsInternal(const DUContext::SearchItem::PtrList& identifiers, const SimpleCursor& position, const AbstractType::Ptr& dataType, DUContext::DeclarationList& ret, const TopDUContext* source, typename BaseContext::SearchFlags basicFlags ) const
{
......@@ -494,6 +481,18 @@ class CppDUContext : public BaseContext {
virtual QWidget* createNavigationWidget(Declaration* decl, TopDUContext* topContext, const QString& htmlPrefix, const QString& htmlSuffix) const;
private:
~CppDUContext() {
//Delete all the local declarations first, so they also delete their instantiations
BaseContext::deleteLocalDeclarations();
//Specializations will be destroyed the same time this is destroyed
QSet<CppDUContext<BaseContext>*> instatiations;
{
QMutexLocker l(&cppDuContextInstantiationsMutex);
instatiations = m_instatiations;
}
foreach( CppDUContext<BaseContext>* instatiation, instatiations )
delete instatiation;
}
virtual void mergeDeclarationsInternal(QList< QPair<Declaration*, int> >& definitions, const SimpleCursor& position, QHash<const DUContext*, bool>& hadContexts, const TopDUContext* source, bool searchInParents, int currentDepth) const
{
......
......@@ -847,7 +847,7 @@ void DeclarationBuilder::visitUsing(UsingAST * node)
SimpleCursor pos = editor()->findPosition(node->start_token, KDevelop::EditorIntegrator::FrontEdge);
QList<Declaration*> declarations = currentContext()->findDeclarations(id, pos);
if(!declarations.isEmpty()) {
decl->setAliasedDeclaration(declarations[0]->indexed());
decl->setAliasedDeclaration(declarations[0]);
}else{
kDebug() << "Aliased declaration not found:" << id.toString();
}
......
......@@ -146,7 +146,7 @@ ExpressionEvaluationResult ExpressionParser::evaluateType( AST* ast, ParseSessio
ret.isInstance = v.lastInstance().isInstance;
if(v.lastInstance().declaration)
ret.instanceDeclaration = v.lastInstance().declaration->indexed();
ret.instanceDeclaration = KDevelop::IndexedDeclaration(v.lastInstance().declaration.data());
foreach(DeclarationPointer decl, v.lastDeclarations())
if(decl)
......
......@@ -170,7 +170,7 @@ void TestDUChain::cleanupTestCase()
DUChainWriteLocker lock(DUChain::lock());
//KDevelop::EditorIntegrator::releaseTopRange(topContext->textRangePtr());
delete topContext;
topContext->deleteSelf();
}
Declaration* TestDUChain::findDeclaration(DUContext* context, const Identifier& id, const SimpleCursor& position)
......@@ -1999,7 +1999,7 @@ struct TestContext {
~TestContext() {
unImport(imports);
DUChainWriteLocker lock(DUChain::lock());
delete m_context;
m_context->deleteSelf();
}
void verify(QList<TestContext*> allContexts) {
......
......@@ -145,7 +145,7 @@ void PreprocessJob::run()
default:
break;
}
p->setFinalLocation(DocumentRange(parentJob()->document().str(), KTextEditor::Cursor(0,0), KTextEditor::Cursor(0,0)));
p->setFinalLocation(DocumentRange(parentJob()->document().str(), KTextEditor::Cursor::invalid(), KTextEditor::Cursor::invalid()));
p->setLocationStack(parentJob()->includeStack());
parentJob()->addPreprocessorProblem(p);
......@@ -157,7 +157,6 @@ void PreprocessJob::run()
// Q_ASSERT( !contents.isEmpty() );
file.close();
m_firstEnvironmentFile->setModificationRevision( KDevelop::ModificationRevision(fileInfo.lastModified()) );
}
else
......@@ -172,6 +171,8 @@ void PreprocessJob::run()
contents = parentJob()->contentsFromEditor().toUtf8();
m_firstEnvironmentFile->setModificationRevision( KDevelop::ModificationRevision( fileInfo.lastModified(), parentJob()->revisionToken() ) );
}
KDevelop::ModificationRevision::clearModificationCache(parentJob()->document());
if(m_secondEnvironmentFile) //Copy some information from the environment-file to its content-part
m_secondEnvironmentFile->setModificationRevision(m_firstEnvironmentFile->modificationRevision());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment