Commit db568ffc authored by David Nolden's avatar David Nolden

Adapt to the changes in kdevplatform that changes AbstractFunctionDeclaration.

parent b0d9f26b
......@@ -56,12 +56,12 @@ void createArgumentList(const NormalDeclarationCompletionItem& item, QString& re
if( getArgumentContext(dec) )
parameters = getArgumentContext(dec)->localDeclarations();
QStringList defaultParams = decl->defaultParameters();
// QStringList defaultParams = decl->defaultParameters();
QVector<Declaration*>::const_iterator paramNameIt = parameters.begin();
QStringList::const_iterator defaultParamIt = defaultParams.begin();
uint defaultParamNum = 0;
int firstDefaultParam = functionType->arguments().count() - defaultParams.count();
int firstDefaultParam = functionType->arguments().count() - decl->defaultParametersSize();
ret = "(";
bool first = true;
......@@ -134,8 +134,8 @@ void createArgumentList(const NormalDeclarationCompletionItem& item, QString& re
}
if( num >= firstDefaultParam ) {
ret += " = " + *defaultParamIt;
++defaultParamIt;
ret += " = " + decl->defaultParameters()[defaultParamNum].str();
++defaultParamNum;
}
++num;
......
......@@ -1124,7 +1124,7 @@ void DeclarationBuilder::visitParameterDeclaration(ParameterDeclarationAST* node
defaultParam += editor()->tokenToString(token);
function->addDefaultParameter(defaultParam);
function->addDefaultParameter(IndexedString(defaultParam));
}
}
}
......
......@@ -378,8 +378,7 @@ class NavigationContext : public KShared {
KDevelop::DUContext* argumentContext = Cpp::getArgumentContext(m_declaration.data());
if(argumentContext) {
QList<QString>::const_iterator defaultIt = function->defaultParameters().begin();
int firstDefaultParam = argumentContext->localDeclarations().count() - function->defaultParameters().count();
int firstDefaultParam = argumentContext->localDeclarations().count() - function->defaultParametersSize();
int currentArgNum = 0;
foreach(Declaration* argument, argumentContext->localDeclarations()) {
......@@ -393,7 +392,7 @@ class NavigationContext : public KShared {
m_currentText += " " + nameHighlight(Qt::escape(argument->identifier().toString()));
if( currentArgNum >= firstDefaultParam )
m_currentText += " = " + Qt::escape(function->defaultParameters()[ currentArgNum - firstDefaultParam ]);
m_currentText += " = " + Qt::escape(function->defaultParameters()[ currentArgNum - firstDefaultParam ].str());
++currentArgNum;
}
......
......@@ -56,7 +56,7 @@ void ViableFunction::matchParameters( const OverloadResolver::ParameterList& par
if( !isValid() || !m_topContext )
return;
Q_ASSERT(m_funDecl);
if( params.parameters.size() + m_funDecl->defaultParameters().size() < m_type->arguments().size() && !partial )
if( params.parameters.size() + m_funDecl->defaultParametersSize() < m_type->arguments().size() && !partial )
return; //Not enough parameters + default-parameters
if( params.parameters.size() > m_type->arguments().size() )
return; //Too many parameters
......
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