Commit 24dfbe46 authored by Milian Wolff's avatar Milian Wolff

Port away from deprecated IndexedString API.

Use these patterns:

IndexedString idx(QLatin1String("..."));;
kDebug() << idx;
QString string = idx.toString();
KUrl url = idx.toUrl();
parent 8473f6e8
......@@ -92,7 +92,7 @@ KSharedPtr< IDocumentation > ManPagePlugin::documentationForDeclaration( Declara
Q_ASSERT(dec);
Q_ASSERT(dec->topContext());
Q_ASSERT(dec->topContext()->parsingEnvironmentFile());
static const KDevelop::IndexedString cppLanguage("C++");
static const KDevelop::IndexedString cppLanguage(QLatin1String("C++"));
if (dec->topContext()->parsingEnvironmentFile()->language() != cppLanguage) {
return KSharedPtr<IDocumentation>();
}
......@@ -103,7 +103,7 @@ KSharedPtr< IDocumentation > ManPagePlugin::documentationForDeclaration( Declara
// Don't show man-page documentation for files that are not in /usr/include, because then we
// most probably will be confusing the global function-name with a local one
if(!dec->topContext()->url().str().startsWith("/usr/"))
if(!dec->topContext()->url().toString().startsWith("/usr/"))
return KSharedPtr<IDocumentation>();
///@todo Do more verification to make sure that we're showing the correct documentation for the declaration
......
......@@ -50,10 +50,13 @@ KSharedPtr< KDevelop::IDocumentation > QtHelpProviderAbstract::documentationForD
if(dec) {
QStringList idList;
{
KDevelop::DUChainReadLocker lock(KDevelop::DUChain::lock());
KDevelop::QualifiedIdentifier qid = dec->qualifiedIdentifier();
KDevelop::QualifiedIdentifier qid;
{
KDevelop::DUChainReadLocker lock(KDevelop::DUChain::lock());
qid = dec->qualifiedIdentifier();
}
for(int a = 0; a < qid.count(); ++a)
idList << qid.at(a).identifier().str(); //Copy over the identifier components, without the template-parameters
idList << qid.at(a).identifier().toString(); //Copy over the identifier components, without the template-parameters
}
QString id = idList.join("::");
......@@ -62,7 +65,7 @@ KSharedPtr< KDevelop::IDocumentation > QtHelpProviderAbstract::documentationForD
kDebug() << "doc_found" << id << links;
if(!links.isEmpty())
return KSharedPtr<KDevelop::IDocumentation>(new QtHelpDocumentation(id, m_engine.linksForIdentifier(id)));
return KSharedPtr<KDevelop::IDocumentation>(new QtHelpDocumentation(id, links));
}
}
......
......@@ -1121,7 +1121,7 @@ bool CodeCompletionContext::doIncludeCompletion()
#ifndef TEST_COMPLETION
bool local = line.startsWith('"');
m_includeItems = CppUtils::allFilesInIncludePath(KUrl(m_duContext->url().str()), local, prefixPath);
m_includeItems = CppUtils::allFilesInIncludePath(m_duContext->url().toUrl(), local, prefixPath);
#endif
return true;
......@@ -1192,7 +1192,7 @@ QSet<DUContext*> CodeCompletionContext::memberAccessContainers() const {
}
// foreach(DUContext* context, ret) {
// kDebug() << "member-access container:" << context->url().str() << context->range().textRange() << context->scopeIdentifier(true).toString();
// kDebug() << "member-access container:" << context->url() << context->range().textRange() << context->scopeIdentifier(true).toString();
// }
return ret;
......@@ -1277,13 +1277,14 @@ static TopDUContext* proxyContextForUrl(KUrl url)
}
void CodeCompletionContext::preprocessText( int line ) {
///TODO: make static
QSet<IndexedString> disableMacros;
disableMacros.insert(IndexedString("SIGNAL"));
disableMacros.insert(IndexedString("SLOT"));
disableMacros.insert(IndexedString("emit"));
disableMacros.insert(IndexedString("Q_EMIT"));
disableMacros.insert(IndexedString("Q_SIGNAL"));
disableMacros.insert(IndexedString("Q_SLOT"));
disableMacros.insert(IndexedString(QLatin1String("SIGNAL")));
disableMacros.insert(IndexedString(QLatin1String("SLOT")));
disableMacros.insert(IndexedString(QLatin1String("emit")));
disableMacros.insert(IndexedString(QLatin1String("Q_EMIT")));
disableMacros.insert(IndexedString(QLatin1String("Q_SIGNAL")));
disableMacros.insert(IndexedString(QLatin1String("Q_SLOT")));
// Use the proxy-context if possible, because that one contains most of the macros if existent
TopDUContext* useTopContext = proxyContextForUrl(m_duContext->url().toUrl());
......@@ -1316,7 +1317,7 @@ void getOverridable(DUContext* base, DUContext* current, QMap< QPair<IndexedType
if(classFun->isConstructor() || classFun->isDestructor())
key.second = base->owner()->identifier().identifier();
if(classFun->isDestructor())
key.second = IndexedString("~" + key.second.str());
key.second = IndexedString("~" + key.second.toString());
}
if(!overridable.contains(key) && base->findLocalDeclarations(KDevelop::Identifier(key.second), CursorInRevision::invalid(), 0, key.first.abstractType(), KDevelop::DUContext::OnlyFunctions).isEmpty())
overridable.insert(key, KDevelop::CompletionTreeItemPointer(new ImplementationHelperItem(ImplementationHelperItem::Override, DeclarationPointer(decl), completionContext, (classFun && classFun->isAbstract()) ? 1 : 2)));
......
......@@ -187,7 +187,7 @@ void createArgumentList(const NormalDeclarationCompletionItem& item, QString& re
if( num >= firstDefaultParam && includeDefaultParams ) {
ret += " = ";
QString defaultParam = decl->defaultParameters()[defaultParamNum].str();
QString defaultParam = decl->defaultParameters()[defaultParamNum].toString();
if(defaultParam.length() <= maxDefaultParameterLength)
ret += defaultParam;
else
......
......@@ -409,7 +409,7 @@ void ImplementationHelperItem::execute(KTextEditor::Document* document, const KT
KDevelop::ReferencedTopDUContext updated( DUChain::self()->waitForUpdate(doc, TopDUContext::AllDeclarationsAndContexts) );
if(!updated) {
kDebug() << "not creating slot because failed to update" << doc.str();
kDebug() << "not creating slot because failed to update" << doc;
return;
}
lock.lock();
......
......@@ -183,7 +183,7 @@ void NormalDeclarationCompletionItem::execute(KTextEditor::Document* document, c
return;
}
executeSignalSlotCompletionItem( document, _word, classFun->isSignal(),
classFun->identifier().toString(), classFun->normalizedSignature().str() );
classFun->identifier().toString(), classFun->normalizedSignature().toString() );
return;
}
......
......@@ -87,7 +87,7 @@ int findIncludeLineFromDUChain(KTextEditor::Document* document, int maxLine, con
if (import.position.line > maxLine) {
continue;
}
const int matchQuality = sharedPathLevel(import.context(top)->url().str(), includeFile);
const int matchQuality = sharedPathLevel(import.context(top)->url().toString(), includeFile);
if (matchQuality >= currentMatchQuality) {
line = import.position.line + 1;
currentMatchQuality = matchQuality;
......@@ -287,8 +287,8 @@ QList<KDevelop::CompletionTreeItemPointer> missingIncludeCompletionItems(const Q
return ret;
}
KUrl currentUrl(context->topContext()->url().str());
KUrl currentPath(context->topContext()->url().str());
KUrl currentUrl(context->topContext()->url().toUrl());
KUrl currentPath(context->topContext()->url().toUrl());
currentPath.setFileName(QString());
Cpp::EnvironmentFilePointer env(dynamic_cast<Cpp::EnvironmentFile*>(context->topContext()->parsingEnvironmentFile().data()));
......@@ -331,7 +331,7 @@ QList<KDevelop::CompletionTreeItemPointer> missingIncludeCompletionItems(const Q
if(dynamic_cast<KDevelop::AliasDeclaration*>(decl))
continue;
if(!isSource(context->url().str())) {
if(!isSource(context->url().toString())) {
if(decl && (decl->context()->type() == DUContext::Namespace || decl->context()->type() == DUContext::Global) && !needInstance && (decl->type<CppClassType>() || decl->type<KDevelop::EnumerationType>()) ) {
if(!haveForwardDeclarationItems.contains(decl->id()))
ret += KDevelop::CompletionTreeItemPointer( new ForwardDeclarationItem(DeclarationPointer(decl)) );
......
......@@ -80,7 +80,8 @@ void CodeCompletionWorker::computeCompletions(KDevelop::DUContextPointer context
topContext = TopDUContextPointer(context->topContext());
if(!topContext)
return;
if(!topContext->parsingEnvironmentFile() || topContext->parsingEnvironmentFile()->language() != IndexedString("C++")) {
static const IndexedString cppLang(QLatin1String("C++"));
if(!topContext->parsingEnvironmentFile() || topContext->parsingEnvironmentFile()->language() != cppLang) {
kDebug() << "top-context has wrong language:";
return;
}
......
......@@ -110,7 +110,7 @@ void AdaptSignatureAction::execute() {
lock.unlock();
m_otherSideTopContext = DUChain::self()->waitForUpdate(url, TopDUContext::AllDeclarationsContextsAndUses);
if(!m_otherSideTopContext) {
kDebug() << "failed to update" << url.str();
kDebug() << "failed to update" << url;
return;
}
......
......@@ -30,7 +30,7 @@
using namespace KDevelop;
QString StringProgressBar::text() const {
return m_text.str();
return m_text.toString();
}
void StringProgressBar::setText(IndexedString text) {
......
......@@ -57,7 +57,7 @@ void RenameAction::execute() {
TopDUContext* topContext = DUChainUtils::standardContextForUrl(it.key().toUrl());
if (!topContext) {
//This would be abnormal
kDebug() << "while renaming" << it.key().str() << "didn't produce a context";
kDebug() << "while renaming" << it.key() << "didn't produce a context";
continue;
}
......
......@@ -116,6 +116,7 @@ void RenameAssistant::textChanged(const KTextEditor::Range& invocationRange, con
return;
}
if (shouldRenameUses(declAtCursor)) {
const QString identifier = declAtCursor->identifier().identifier().toString();
QMap< IndexedString, QList<RangeInRevision> > declUses = declAtCursor->uses();
if (declUses.size() > 0) {
for(QMap< IndexedString, QList< RangeInRevision > >::iterator it = declUses.begin(); it != declUses.end(); ++it)
......@@ -123,7 +124,7 @@ void RenameAssistant::textChanged(const KTextEditor::Range& invocationRange, con
foreach(RangeInRevision range, it.value())
{
SimpleRange currentRange = declAtCursor->transformFromLocalRevision(range);
if(currentRange.isEmpty() || m_view->document()->text(currentRange.textRange()) != declAtCursor->identifier().identifier().str())
if(currentRange.isEmpty() || m_view->document()->text(currentRange.textRange()) != identifier)
return; // One of the uses is invalid. Maybe the replacement has already been performed.
}
}
......
......@@ -54,8 +54,8 @@ Signature getDeclarationSignature(const Declaration *functionDecl, const DUConte
Signature signature;
const AbstractFunctionDeclaration* abstractFunDecl = dynamic_cast<const AbstractFunctionDeclaration*>(functionDecl);
foreach(Declaration* parameter, functionCtxt->localDeclarations()) {
signature.defaultParams << (includeDefaults ? abstractFunDecl->defaultParameterForArgument(pos).str() : "");
signature.parameters << qMakePair(parameter->indexedType(), parameter->identifier().identifier().str());
signature.defaultParams << (includeDefaults ? abstractFunDecl->defaultParameterForArgument(pos).toString() : "");
signature.parameters << qMakePair(parameter->indexedType(), parameter->identifier().identifier().toString());
++pos;
}
signature.isConst = functionDecl->abstractType() && functionDecl->abstractType()->modifiers() & AbstractType::ConstModifier;
......@@ -229,4 +229,4 @@ void AdaptDefinitionSignatureAssistant::parseJobFinished(KDevelop::ParseJob* job
emit actionsChanged();
}
#include "signatureassistant.moc"
\ No newline at end of file
#include "signatureassistant.moc"
......@@ -67,7 +67,7 @@ using namespace KDevelop;
// #define WARN_BEFORE_REFACTORING
// static Identifier destructorForName(Identifier name) {
// QString str = name.identifier().str();
// QString str = name.identifier().toString();
// if(str.startsWith("~"))
// return Identifier(str);
// return Identifier("~"+str);
......@@ -117,7 +117,7 @@ void SimpleRefactoring::doContextMenu(KDevelop::ContextMenuExtension& extension,
Declaration* declaration = declContext->declaration().data();
if(declaration) {
QFileInfo finfo(declaration->topContext()->url().str());
QFileInfo finfo(declaration->topContext()->url().toString());
if (finfo.isWritable()) {
QAction* action = new QAction(i18n("Rename %1", declaration->qualifiedIdentifier().toString()), this);
action->setData(QVariant::fromValue(IndexedDeclaration(declaration)));
......@@ -396,10 +396,10 @@ void SimpleRefactoring::startInteractiveRename(KDevelop::IndexedDeclaration decl
KMessageBox::error(ICore::self()->uiController()->activeMainWindow(), i18n("No declaration under cursor"));
return;
}
QFileInfo info(declaration->topContext()->url().str());
QFileInfo info(declaration->topContext()->url().toString());
if (!info.isWritable()) {
KMessageBox::error(ICore::self()->uiController()->activeMainWindow(),
i18n("Declaration is located in non-writeable file %1.", declaration->topContext()->url().str()));
i18n("Declaration is located in non-writeable file %1.", declaration->topContext()->url().toString()));
return;
}
......@@ -424,7 +424,7 @@ void SimpleRefactoring::startInteractiveRename(KDevelop::IndexedDeclaration decl
///Step 1: Allow the user to specify a replacement name, and allow him to see all uses
QString originalName = declaration->identifier().identifier().str();
QString originalName = declaration->identifier().identifier().toString();
QString replacementName;
//Since we don't yet know what the text should be replaced with, we just collect the top-contexts to process
......
......@@ -127,7 +127,7 @@ void ContextBuilder::createUserProblem(AST* node, QString text) {
KDevelop::ProblemPointer problem(new KDevelop::Problem);
problem->setDescription(text);
problem->setSource(KDevelop::ProblemData::DUChainBuilder);
problem->setFinalLocation(DocumentRange(IndexedString(currentContext()->url().str()), editor()->findRange(node).castToSimpleRange()));
problem->setFinalLocation(DocumentRange(currentContext()->url(), editor()->findRange(node).castToSimpleRange()));
currentContext()->topContext()->addProblem(problem);
}
......@@ -348,7 +348,7 @@ ReferencedTopDUContext ContextBuilder::buildContexts(Cpp::EnvironmentFilePointer
{
DUChainWriteLocker lock(DUChain::lock());
if(updateContext && (updateContext->parsingEnvironmentFile() && updateContext->parsingEnvironmentFile()->isProxyContext())) {
kDebug(9007) << "updating a context " << file->url().str() << " from a proxy-context to a content-context";
kDebug(9007) << "updating a context " << file->url() << " from a proxy-context to a content-context";
updateContext->parsingEnvironmentFile()->setIsProxyContext(false);
}
}
......@@ -438,7 +438,7 @@ ReferencedTopDUContext ContextBuilder::buildContexts(Cpp::EnvironmentFilePointer
if (!m_importedParentContexts.isEmpty()) {
DUChainReadLocker lock(DUChain::lock());
kWarning() << file->url().str() << "Previous parameter declaration context didn't get used??" ;
kWarning() << file->url() << "Previous parameter declaration context didn't get used??" ;
// KDevelop::DumpChain dump;
// dump.dump(topLevelContext);
m_importedParentContexts.clear();
......
......@@ -38,7 +38,7 @@ REGISTER_DUCHAIN_ITEM_WITH_DATA(CppNormalDUContext, DUContextData);
template<>
QWidget* CppDUContext<TopDUContext>::createNavigationWidget( Declaration* decl, TopDUContext* topContext, const QString& htmlPrefix, const QString& htmlSuffix ) const {
if( decl == 0 ) {
KUrl u( url().str() );
KUrl u( url().toUrl() );
IncludeItem i;
i.pathNumber = -1;
i.name = u.fileName();
......
......@@ -119,9 +119,12 @@ extern QMutex cppDuContextInstantiationsMutex;
///For debugging. Describes the last search context.
QString describeLastContext() const {
if( m_lastScopeContext ) {
return "Context " + m_lastScopeContext->scopeIdentifier(true).toString() + QString(" from %1:%2").arg(m_lastScopeContext->url().str()).arg(m_lastScopeContext->range().start.line);
return QString("Context %1 from %2:%3")
.arg(m_lastScopeContext->scopeIdentifier(true).toString())
.arg(m_lastScopeContext->url().toString())
.arg(m_lastScopeContext->range().start.line);
} else {
return QString("Global search with top-context %2").arg(topContext()->url().str());
return QString("Global search with top-context of %1").arg(topContext()->url().toString());
}
}
......
......@@ -823,7 +823,7 @@ Declaration* DeclarationBuilder::openFunctionDeclaration(NameAST* name, AST* ran
//Merge the scope of the declaration, else the declarations could be confused with global functions.
//This is done before the actual search, so there are no name-clashes while searching the class for a constructor.
//FIXME: Can we do without this?
localId.setIdentifier(id.left(-1).toString() + "::" + localId.identifier().str());
localId.setIdentifier(id.left(-1).toString() + "::" + localId.identifier().toString());
}
if(currentContext()->type() == DUContext::Class) {
......
......@@ -143,7 +143,7 @@ uint Cpp::MacroIndexConversion::toIndex(const rpp::pp_macro& macro) const {
//For debugging
QString id(const EnvironmentFile* file) {
return file->url().str() + QString(" %1").arg((size_t)file) ;
return file->url().toString() + QString(" %1").arg((size_t)file) ;
}
QString print(const Cpp::ReferenceCountedStringSet& set) {
......@@ -155,7 +155,7 @@ QString print(const Cpp::ReferenceCountedStringSet& set) {
ret += ", ";
first = false;
ret += (*it).str();
ret += (*it).toString();
++it;
}
return ret;
......@@ -209,7 +209,7 @@ bool EnvironmentFile::matchEnvironment(const ParsingEnvironment* _environment) c
if( cppEnvironment->identityOffsetRestrictionEnabled() && cppEnvironment->identityOffsetRestriction() != identityOffset() ) {
#ifdef DEBUG_LEXERCACHE
kDebug( 9007 ) << "file" << url().str() << "does not match branching hash. Restriction:" << cppEnvironment->identityOffsetRestriction() << "Actual:" << identityOffset();
kDebug( 9007 ) << "file" << url() << "does not match branching hash. Restriction:" << cppEnvironment->identityOffsetRestriction() << "Actual:" << identityOffset();
#endif
return false;
}
......@@ -222,7 +222,7 @@ bool EnvironmentFile::matchEnvironment(const ParsingEnvironment* _environment) c
if(EnvironmentManager::self()->matchingLevel() == EnvironmentManager::Naive)
if(cppEnvironment->macroNameSet().contains(headerGuard())) {
#ifdef DEBUG_LEXERCACHE
kDebug( 9007 ) << "file" << url().str() << "environment contains the header-guard, returning true";
kDebug( 9007 ) << "file" << url() << "environment contains the header-guard, returning true";
#endif
return true;
}
......@@ -237,7 +237,7 @@ bool EnvironmentFile::matchEnvironment(const ParsingEnvironment* _environment) c
#ifdef DEBUG_LEXERCACHE
if(debugging()) {
kDebug(9007) << "The environment contains a macro that can affect the cached file, but that should not exist:" << m->name.str();
kDebug(9007) << "The environment contains a macro that can affect the cached file, but that should not exist:" << m->name;
}
#endif
return false;
......@@ -254,20 +254,20 @@ bool EnvironmentFile::matchEnvironment(const ParsingEnvironment* _environment) c
rpp::pp_macro* m = cppEnvironment->retrieveStoredMacro( it.ref().name );
if ( !m || !(*m == it.ref()) ) {
if( !m && it.ref().isUndef() ) {
ifDebug( kDebug( 9007 ) << "Undef-macro" << it.ref().name.str() << "is ok" << m );
ifDebug( kDebug( 9007 ) << "Undef-macro" << it.ref().name << "is ok" << m );
//It is okay, we did not find a macro, but the used macro is an undef macro
//Q_ASSERT(0); //Undef-macros should not be marked as used
} else {
ifDebug( kDebug( 9007 ) << "The cached file " << url().str() << " used a macro called \"" << it.ref().name.str() << "\"(from" << it.ref().file.str() << "), but the environment" << (m ? "contains differing macro of that name" : "does not contain that macro") << ", the cached file is not used" );
ifDebug( if(m) { kDebug() << "Used macro: " << it.ref().toString() << "from" << it.ref().file.str() << "found:" << m->toString() << "from" << m->file.str(); } );
ifDebug( kDebug( 9007 ) << "The cached file " << url() << " used a macro called \"" << it.ref().name << "\"(from" << it.ref().file << "), but the environment" << (m ? "contains differing macro of that name" : "does not contain that macro") << ", the cached file is not used" );
ifDebug( if(m) { kDebug() << "Used macro: " << it.ref().toString() << "from" << it.ref().file << "found:" << m->toString() << "from" << m->file; } );
return false;
}
}else{
ifDebug( kDebug( 9007 ) << it.ref().name.str() << "match" );
ifDebug( kDebug( 9007 ) << it.ref().name << "match" );
}
}
ifDebug( kDebug( 9007 ) << "Using cached file " << url().str() );
ifDebug( kDebug( 9007 ) << "Using cached file " << url() );
return true;
}
......@@ -298,13 +298,13 @@ bool EnvironmentFile::needsUpdate(const ParsingEnvironment* environment) const {
EnvironmentFile::EnvironmentFile( const IndexedString& url, TopDUContext* topContext ) : ParsingEnvironmentFile(*new EnvironmentFileData(), url) {
d_func_dynamic()->setClassId(this);
setLanguage(IndexedString("C++"));
setLanguage(IndexedString(QLatin1String("C++")));
d_func_dynamic()->m_topContext = IndexedTopDUContext(topContext);
d_func_dynamic()->m_url = url;
// ifDebug( kDebug(9007) << "created for" << url.str() << "modification-time:" << d_func_dynamic()->m_modificationTime );
// ifDebug( kDebug(9007) << "created for" << url << "modification-time:" << d_func_dynamic()->m_modificationTime );
clearModificationRevisions();
}
......@@ -330,7 +330,7 @@ void EnvironmentFile::addDefinedMacro( const rpp::pp_macro& macro, const rpp::pp
ENSURE_WRITE_LOCKED
#ifdef DEBUG_LEXERCACHE
if(debugging()) {
kDebug( 9007 ) << id(this) << "defined macro" << macro.name.str();
kDebug( 9007 ) << id(this) << "defined macro" << macro.name;
}
#endif
if( previousOfSameName && d_func()->m_definedMacros.contains(*previousOfSameName) )
......@@ -364,7 +364,7 @@ void EnvironmentFile::usingMacro( const rpp::pp_macro& macro ) {
if ( !d_func()->m_definedMacroNames.contains( macro.name ) && !d_func()->m_unDefinedMacroNames.contains( macro.name ) && !macro.isUndef() ) {
#ifdef DEBUG_LEXERCACHE
if(debugging()) {
kDebug( 9007 ) << id(this) << "used macro" << macro.name.str() << "from" << macro.file.str();
kDebug( 9007 ) << id(this) << "used macro" << macro.name << "from" << macro.file;
}
#endif
d_func_dynamic()->m_usedMacros.insert( macro );
......
......@@ -2033,7 +2033,7 @@ void ExpressionVisitor::createDelayedType( AST* node , bool expression ) {
if(chosenFunction)
if(m_mapAst) session()->mapCallAstToType(node, chosenFunction->type<FunctionType>());
static IndexedString functionCallOperatorIdentifier("operator()");
static IndexedString functionCallOperatorIdentifier(QLatin1String("operator()"));
bool createUseOnParen = (bool)chosenFunction && (constructedType || chosenFunction->identifier().identifier() == functionCallOperatorIdentifier);
//Re-create the use we have discarded earlier, this time with the correct overloaded function chosen.
......
......@@ -161,7 +161,7 @@ public:
if(arg.declaration.data())
{
// Find a unique name
QString baseName = arg.declaration.data()->identifier().identifier().str();
QString baseName = arg.declaration.data()->identifier().identifier().toString();
for(int a = 1; a < 1000; ++a)
{
if(!hadNames.contains(baseName))
......
......@@ -53,7 +53,7 @@ void NameASTVisitor::visitUnqualifiedName(UnqualifiedNameAST *node)
if (node->id)
tmp_name = m_session->token_stream->symbol(node->id);
if (node->tilde)
tmp_name = IndexedString(QLatin1String("~") + tmp_name.str());
tmp_name = IndexedString(QLatin1String("~") + tmp_name.toString());
if (OperatorFunctionIdAST *op_id = node->operator_id) {
#if defined(__GNUC__)
#warning "NameASTVisitor::visitUnqualifiedName() -- implement me"
......
......@@ -37,7 +37,7 @@ IncludeNavigationContext::IncludeNavigationContext(const IncludeItem& item, KDev
bool IncludeNavigationContext::filterDeclaration(Declaration* decl)
{
QString declId = decl->identifier().identifier().str();
QString declId = decl->identifier().identifier().toString();
//filter out forward-declarations and macro-expansions without a range
//And filter out declarations with reserved identifiers
return !decl->qualifiedIdentifier().toString().isEmpty() && !decl->range().isEmpty() && !decl->isForwardDeclaration()
......
......@@ -102,7 +102,7 @@ MacroNavigationContext::~MacroNavigationContext()
QString MacroNavigationContext::name() const
{
return m_macro->name.str();
return m_macro->name.toString();
}
QWidget* MacroNavigationContext::widget() const
......@@ -126,7 +126,7 @@ QString MacroNavigationContext::html(bool shorten)
if(!first)
args += ", ";
first = false;
args += b.str();
args += b.toString();
}
args += ')';
......@@ -140,7 +140,7 @@ QString MacroNavigationContext::html(bool shorten)
"%3 the link to the definition",
"%1: %2, defined in %3",
(m_macro->function_like ? i18n("Function macro") : i18n("Macro")),
importantHighlight(m_macro->name.str()) + args,
importantHighlight(m_macro->name.toString()) + args,
createLink(path, path, action) );
modifyHtml() += fontSizeSuffix(shorten) + "</p></body></html>";
......
......@@ -190,9 +190,9 @@ kDebug() << aj.index() << aj2.index();
QCOMPARE(t.at(0).templateIdentifiersCount(), 2u);
QCOMPARE(t.at(1).templateIdentifiersCount(), 1u);
QCOMPARE(t.at(2).templateIdentifiersCount(), 1u);
QCOMPARE(t.at(0).identifier().str(), QString("Area"));
QCOMPARE(t.at(1).identifier().str(), QString("jump"));
QCOMPARE(t.at(2).identifier().str(), QString("tes"));
QCOMPARE(t.at(0).identifier().toString(), QString("Area"));
QCOMPARE(t.at(1).identifier().toString(), QString("jump"));
QCOMPARE(t.at(2).identifier().toString(), QString("tes"));
QualifiedIdentifier op1("operator<");
QualifiedIdentifier op2("operator<=");
......@@ -2732,7 +2732,7 @@ void TestDUChain::testSignalSlotDeclaration() {
QCOMPARE(top->childContexts()[1]->localDeclarations().count(), 1);
QtFunctionDeclaration* qtDecl = dynamic_cast<QtFunctionDeclaration*>(top->childContexts()[1]->localDeclarations()[0]);
QVERIFY(qtDecl);
QCOMPARE(qtDecl->normalizedSignature().str(), QString("A::B,const Q*"));
QCOMPARE(qtDecl->normalizedSignature().toString(), QString("A::B,const Q*"));
}
{
......
......@@ -835,7 +835,7 @@ void TestExpressionParser::testTypeConversion() {
QVERIFY(functionDecl);
QVERIFY(functionDecl->defaultParametersSize() == 1);
QCOMPARE(functionDecl->defaultParameters()[0].str(), QString("5"));
QCOMPARE(functionDecl->defaultParameters()[0].toString(), QString("5"));
//QVERIFY(0);
//lock.lock();
......
......@@ -257,7 +257,7 @@ void TypeASTVisitor::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node)
bool isDecltypeInParen = false;
if (node->isDecltype && node->expression->kind == AST::Kind_PrimaryExpression) {
int startPosition = m_session->token_stream->position(node->expression->start_token);
static IndexedString paren("(");
static IndexedString paren(QLatin1Char('('));
isDecltypeInParen = m_session->contentsVector()[startPosition] == paren.index();
}
......
......@@ -307,7 +307,7 @@ void TypeBuilder::visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *node)
bool isDecltypeInParen = false;
if (node->isDecltype && node->expression->kind == AST::Kind_PrimaryExpression) {
int startPosition = editor()->parseSession()->token_stream->position(node->expression->start_token);
static IndexedString paren("(");
static IndexedString paren(QLatin1String("("));
isDecltypeInParen = editor()->parseSession()->contentsVector()[startPosition] == paren.index();
}
......
......@@ -319,7 +319,7 @@ void CppLanguageSupport::switchDefinitionDeclaration()
if(def && def->declaration()) {
Declaration* declaration = def->declaration();
KTextEditor::Range targetRange = declaration->rangeInCurrentRevision().textRange();
KUrl url(declaration->url().str());
KUrl url(declaration->url().toUrl());