Commit e33067c9 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Use QStringLiteral("") to construct strings instead of QString("")

REVIEW: 121889
parent 4f4bc2e4
......@@ -195,7 +195,7 @@ QVariant Breakpoint::data(int column, int role) const
}
//FIXME: there should be proper columns for function name and address.
if (!m_address.isEmpty() && role == Qt::DisplayRole) {
ret = QString("%1 (%2)").arg(ret).arg(m_address);
ret = QStringLiteral("%1 (%2)").arg(ret).arg(m_address);
}
return ret;
}
......
......@@ -215,9 +215,9 @@ void FramestackWidget::copySelection()
Q_FOREACH( QModelIndex index, indexes) {
IFrameStackModel::FrameItem frame = m_session->frameStackModel()->frame(index);
if (frame.line == -1) {
content += QString("#%1 %2() at %3\n").arg(frame.nr).arg(frame.name).arg(frame.file.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash));
content += QStringLiteral("#%1 %2() at %3\n").arg(frame.nr).arg(frame.name).arg(frame.file.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash));
} else {
content += QString("#%1 %2() at %3:%4\n").arg(frame.nr).arg(frame.name).arg(frame.file.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash)).arg(frame.line+1);
content += QStringLiteral("#%1 %2() at %3:%4\n").arg(frame.nr).arg(frame.name).arg(frame.file.url(QUrl::PreferLocalFile | QUrl::StripTrailingSlash)).arg(frame.line+1);
}
}
cb->setText(content);
......
......@@ -406,7 +406,7 @@ void VariableTree::contextMenuEvent(QContextMenuEvent* event)
just to delete it. */
if (var && var->isAlive() && !controller()->stateIsOn(s_dbgNotStarted)) {
GDBCommand* cmd = new GDBCommand(DataEvaluateExpression,
QString("&%1")
QStringLiteral("&%1")
.arg(var->gdbExpression()));
cmd->setHandler(this, &VariableTree::handleAddressComputed, true /*handles error*/);
cmd->setThread(var->thread());
......
......@@ -117,7 +117,7 @@ QVariant CompletionTreeItem::data(const QModelIndex& index, int role, const Code
Q_UNUSED(index)
Q_UNUSED(model)
if(role == Qt::DisplayRole)
return QString("not implemented");
return QStringLiteral("not implemented");
return QVariant();
}
......
......@@ -145,7 +145,7 @@ QVariant NormalDeclarationCompletionItem::data(const QModelIndex& index, int rol
}
} else if(index.column() == CodeCompletionModel::Prefix) {
if(m_declaration->kind() == Declaration::Namespace)
return QString("namespace");
return QStringLiteral("namespace");
if (m_declaration->abstractType()) {
if(EnumeratorType::Ptr enumerator = m_declaration->type<EnumeratorType>()) {
if(m_declaration->context()->owner() && m_declaration->context()->owner()->abstractType()) {
......@@ -161,7 +161,7 @@ QVariant NormalDeclarationCompletionItem::data(const QModelIndex& index, int rol
if (functionType->returnType()) {
QString ret = shortenedTypeString(m_declaration, desiredTypeLength);
if(shortenArgumentHintReturnValues && argumentHintDepth() && ret.length() > maximumArgumentHintReturnValueLength)
return QString("...");
return QStringLiteral("...");
else
return ret;
}else if(argumentHintDepth()) {
......
......@@ -151,7 +151,7 @@ bool CodeGeneratorBase::execute()
TopDUContext * documentChain = DUChain::self()->chainForDocument(document);
if(!documentChain)
{
setErrorText(QString("Could not find chain for selected document: %1").arg(document.url()));
setErrorText(QStringLiteral("Could not find chain for selected document: %1").arg(document.url()));
return false;
}
d->context = documentChain->findContextIncluding(d->range);
......
......@@ -341,7 +341,7 @@ InsertArtificialCodeRepresentation::InsertArtificialCodeRepresentation(const Ind
while(artificialStrings.contains(m_file))
{
++idx;
m_file = IndexedString(CodeRepresentation::artificialPath(QString("%1_%2").arg(idx).arg(file.str())));
m_file = IndexedString(CodeRepresentation::artificialPath(QStringLiteral("%1_%2").arg(idx).arg(file.str())));
}
}
......
......@@ -251,7 +251,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSet::applyAllChanges()
foreach(const IndexedString &file, files) {
CodeRepresentation::Ptr repr = createCodeRepresentation(file);
if(!repr) {
return ChangeResult(QString("Could not create a Representation for %1").arg(file.str()));
return ChangeResult(QStringLiteral("Could not create a Representation for %1").arg(file.str()));
}
codeRepresentations[file] = repr;
......@@ -316,7 +316,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSetPrivate::replaceOldText(CodeRep
const DocumentChange& change(*sortedChangesList[pos]);
if(!dynamic->replace(change.m_range, change.m_oldText, change.m_newText, change.m_ignoreOldText))
{
QString warningString = QString("Inconsistent change in %1 at %2:%3 -> %4:%5 = %6(encountered \"%7\") -> \"%8\"")
QString warningString = QStringLiteral("Inconsistent change in %1 at %2:%3 -> %4:%5 = %6(encountered \"%7\") -> \"%8\"")
.arg(change.m_document.str())
.arg(change.m_range.start().line())
.arg(change.m_range.start().column())
......@@ -339,7 +339,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSetPrivate::replaceOldText(CodeRep
//For files on disk
if (!repr->setText(newText)) {
QString warningString = QString("Could not replace text in the document: %1")
QString warningString = QStringLiteral("Could not replace text in the document: %1")
.arg(sortedChangesList.begin()->data()->m_document.str());
if(replacePolicy == DocumentChangeSet::WarnOnFailedChange) {
qCWarning(LANGUAGE) << warningString;
......@@ -441,7 +441,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSetPrivate::generateNewText(const
}
}
}else{
QString warningString = QString("Inconsistent change in %1 at %2:%3 -> %4:%5"
QString warningString = QStringLiteral("Inconsistent change in %1 at %2:%3 -> %4:%5"
" = \"%6\"(encountered \"%7\") -> \"%8\"")
.arg(file.str())
.arg(change.m_range.start().line())
......@@ -512,7 +512,7 @@ DocumentChangeSet::ChangeResult DocumentChangeSetPrivate::removeDuplicates(const
continue;
} else {
return DocumentChangeSet::ChangeResult(
QString("Inconsistent change-request at %1; "
QStringLiteral("Inconsistent change-request at %1; "
"intersecting changes: "
"\"%2\"->\"%3\"@%4:%5->%6:%7 & \"%8\"->\"%9\"@%10:%11->%12:%13 ")
.arg(file.str(), ( *previous )->m_oldText, ( *previous )->m_newText)
......
......@@ -241,7 +241,7 @@ public:
/**
* @param resourcePrefix ugly ugly parameter required for testing :-/
*/
void setTemplateDescription(const QString& templateDescription, const QString& resourcePrefix = QString("kdevfiletemplates"));
void setTemplateDescription(const QString& templateDescription, const QString& resourcePrefix = QStringLiteral("kdevfiletemplates"));
/**
* Returns true if this SourceFileTemplate represents an actual template archive, and false otherwise
......
......@@ -135,9 +135,9 @@ void TestTemplateClassGenerator::templateVariablesCpp()
setLowercaseFileNames(generator);
QVariantHash variables = generator->renderer()->variables();
CHECK_TEMPLATE_VARIABLE(name, QString, QString("ClassName"));
CHECK_TEMPLATE_VARIABLE(name, QString, QStringLiteral("ClassName"));
CHECK_TEMPLATE_VARIABLE(output_file_header, QString, QString("classname.h"));
CHECK_TEMPLATE_VARIABLE(output_file_header, QString, QStringLiteral("classname.h"));
CHECK_TEMPLATE_VARIABLE(output_file_header_absolute, QString, baseUrl.resolved(QUrl("classname.h")).toLocalFile());
}
......@@ -147,9 +147,9 @@ void TestTemplateClassGenerator::templateVariablesYaml()
setLowercaseFileNames(generator);
QVariantHash variables = generator->renderer()->variables();
CHECK_TEMPLATE_VARIABLE(name, QString, QString("ClassName"));
CHECK_TEMPLATE_VARIABLE(name, QString, QStringLiteral("ClassName"));
CHECK_TEMPLATE_VARIABLE(output_file_description, QString, QString("classname.yaml"));
CHECK_TEMPLATE_VARIABLE(output_file_description, QString, QStringLiteral("classname.yaml"));
CHECK_TEMPLATE_VARIABLE(output_file_description_absolute, QString, baseUrl.resolved(QUrl("classname.yaml")).toLocalFile());
}
......@@ -164,22 +164,22 @@ void TestTemplateClassGenerator::codeDescription()
QVERIFY(variables.contains("base_classes"));
QVariantList inheritance = variables["base_classes"].toList();
QCOMPARE(inheritance.size(), 1);
QCOMPARE(inheritance.first().value<InheritanceDescription>().baseType, QString("QObject"));
QCOMPARE(inheritance.first().value<InheritanceDescription>().inheritanceMode, QString("public"));
QCOMPARE(inheritance.first().value<InheritanceDescription>().baseType, QStringLiteral("QObject"));
QCOMPARE(inheritance.first().value<InheritanceDescription>().inheritanceMode, QStringLiteral("public"));
QVERIFY(variables.contains("members"));
QVariantList members = variables["members"].toList();
QCOMPARE(members.size(), 3);
QCOMPARE(members.first().value<VariableDescription>().type, QString("QString"));
QCOMPARE(members.first().value<VariableDescription>().name, QString("name"));
QCOMPARE(members.first().value<VariableDescription>().type, QStringLiteral("QString"));
QCOMPARE(members.first().value<VariableDescription>().name, QStringLiteral("name"));
QVERIFY(variables.contains("functions"));
QVariantList methods = variables["functions"].toList();
QCOMPARE(methods.size(), 2);
QCOMPARE(methods.first().value<FunctionDescription>().name, QString("doSomething"));
QCOMPARE(methods.first().value<FunctionDescription>().name, QStringLiteral("doSomething"));
QCOMPARE(methods.first().value<FunctionDescription>().arguments.size(), 2);
QCOMPARE(methods.first().value<FunctionDescription>().returnArguments.size(), 0);
QCOMPARE(methods.last().value<FunctionDescription>().name, QString("getSomeOtherNumber"));
QCOMPARE(methods.last().value<FunctionDescription>().name, QStringLiteral("getSomeOtherNumber"));
QCOMPARE(methods.last().value<FunctionDescription>().arguments.size(), 0);
QCOMPARE(methods.last().value<FunctionDescription>().returnArguments.size(), 1);
}
......@@ -265,7 +265,7 @@ void TestTemplateClassGenerator::setLowercaseFileNames(TemplateClassGenerator* g
for (; it != urls.constEnd(); ++it)
{
QString fileName = it.value().fileName().toLower();
QUrl base = it.value().resolved(QUrl(QString("./%1").arg(fileName)));
QUrl base = it.value().resolved(QUrl(QStringLiteral("./%1").arg(fileName)));
generator->setFileUrl(it.key(), base);
}
}
......
......@@ -78,7 +78,7 @@ void TestTemplateRenderer::includeTemplates()
void TestTemplateRenderer::kdevFilters()
{
renderer->addVariable("activity", QString("testing"));
renderer->addVariable("activity", QStringLiteral("testing"));
QString result = renderer->render("{% load kdev_filters %}I am {{ activity }} software. {{ activity|upper_first }} is a very rewarding task. ", QString());
QString expected = "I am testing software. Testing is a very rewarding task. ";
......
......@@ -64,7 +64,7 @@ void TestTemplatesModel::descriptionParsing()
QCOMPARE(items.size(), 1);
QStandardItem* item = items.first();
QCOMPARE(item->data(TemplatesModel::CommentRole).toString(), QString("Describes a class using YAML syntax"));
QCOMPARE(item->data(TemplatesModel::CommentRole).toString(), QStringLiteral("Describes a class using YAML syntax"));
QVERIFY(item->data(TemplatesModel::IconNameRole).toString().isEmpty());
QString descriptionFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kdevcodegentest/template_descriptions/test_yaml.desktop";
......@@ -78,9 +78,9 @@ void TestTemplatesModel::templateIndexes()
QModelIndexList indexes = model->templateIndexes("test_yaml.tar.bz2");
QCOMPARE(indexes.size(), 3);
QCOMPARE(model->data(indexes[0]).toString(), QString("Testing"));
QCOMPARE(model->data(indexes[1]).toString(), QString("YAML"));
QCOMPARE(model->data(indexes[2]).toString(), QString("Testing YAML template"));
QCOMPARE(model->data(indexes[0]).toString(), QStringLiteral("Testing"));
QCOMPARE(model->data(indexes[1]).toString(), QStringLiteral("YAML"));
QCOMPARE(model->data(indexes[2]).toString(), QStringLiteral("Testing YAML template"));
}
......
......@@ -55,9 +55,9 @@ Declaration* AliasDeclaration::clonePrivate() const {
QString AliasDeclaration::toString() const {
if( aliasedDeclaration().isValid() )
return QString("Alias %1 as %2").arg(aliasedDeclaration().declaration()->qualifiedIdentifier().toString()).arg(identifier().toString());
return QStringLiteral("Alias %1 as %2").arg(aliasedDeclaration().declaration()->qualifiedIdentifier().toString()).arg(identifier().toString());
else
return QString("Lost alias %1").arg(identifier().toString());
return QStringLiteral("Lost alias %1").arg(identifier().toString());
}
void AliasDeclaration::setAliasedDeclaration(const IndexedDeclaration& decl) {
......
......@@ -91,11 +91,11 @@ QString ClassFunctionDeclaration::toString() const {
TypePtr<FunctionType> function = type<FunctionType>();
if(function) {
return QString("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn )).arg(identifier().toString()).arg(function->partToString( FunctionType::SignatureArguments ));
return QStringLiteral("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn )).arg(identifier().toString()).arg(function->partToString( FunctionType::SignatureArguments ));
} else {
QString type = abstractType() ? abstractType()->toString() : QString("<notype>");
QString type = abstractType() ? abstractType()->toString() : QStringLiteral("<notype>");
qCDebug(LANGUAGE) << "A function has a bad type attached:" << type;
return QString("invalid member-function %1 type %2").arg(identifier().toString()).arg(type);
return QStringLiteral("invalid member-function %1 type %2").arg(identifier().toString()).arg(type);
}
}
......
......@@ -471,7 +471,7 @@ bool Declaration::operator ==(const Declaration & other) const
QString Declaration::toString() const
{
return QString("%3 %4").arg(abstractType() ? abstractType()->toString() : QString("<notype>")).arg(identifier().toString());
return QStringLiteral("%3 %4").arg(abstractType() ? abstractType()->toString() : QStringLiteral("<notype>")).arg(identifier().toString());
}
......
......@@ -203,10 +203,10 @@ QualifiedIdentifier DeclarationId::qualifiedIdentifier() const
if(decl)
return decl->qualifiedIdentifier();
return QualifiedIdentifier(QString("(unknown direct declaration)"));
return QualifiedIdentifier(QStringLiteral("(unknown direct declaration)"));
}
return QualifiedIdentifier(QString("(missing)")) + indirect.m_identifier.identifier();
return QualifiedIdentifier(QStringLiteral("(missing)")) + indirect.m_identifier.identifier();
}
}
......@@ -24,15 +24,15 @@
namespace KDevelop {
QString shortLabel(KDevelop::DUContext* context) {
return QString("q%1").arg((quint64)context);
return QStringLiteral("q%1").arg((quint64)context);
}
QString shortLabel(KDevelop::Declaration* declaration) {
return QString("q%1").arg((quint64)declaration);
return QStringLiteral("q%1").arg((quint64)declaration);
}
QString rangeToString( const KTextEditor::Range& r ) {
return QString("%1:%2->%3:%4").arg(r.start().line()).arg(r.start().column()).arg(r.end().line()).arg(r.end().column());
return QStringLiteral("%1:%2->%3:%4").arg(r.start().line()).arg(r.start().column()).arg(r.end().line()).arg(r.end().column());
}
......@@ -136,7 +136,7 @@ QString DumpDotGraphPrivate::dotGraphInternal(KDevelop::DUContext* context, bool
label = file;
if( topCtx->importers().count() != 0 )
label += QString(" imported by %1").arg(topCtx->importers().count());
label += QStringLiteral(" imported by %1").arg(topCtx->importers().count());
} else {
label = "unknown file";
}
......@@ -147,7 +147,7 @@ QString DumpDotGraphPrivate::dotGraphInternal(KDevelop::DUContext* context, bool
label += ' ' + rangeToString(context->range().castToSimpleRange());
}
//label = QString("%1 ").arg((size_t)context) + label;
//label = QStringLiteral("%1 ").arg((size_t)context) + label;
if( isMaster && !dynamic_cast<TopDUContext*>(context) ) {
//Also draw contexts that import this one
......@@ -169,7 +169,7 @@ QString DumpDotGraphPrivate::dotGraphInternal(KDevelop::DUContext* context, bool
}
if( !context->childContexts().isEmpty() )
label += QString(", %1 C.").arg(context->childContexts().count());
label += QStringLiteral(", %1 C.").arg(context->childContexts().count());
if( !shortened ) {
foreach (DUContext* child, context->childContexts()) {
......@@ -179,7 +179,7 @@ QString DumpDotGraphPrivate::dotGraphInternal(KDevelop::DUContext* context, bool
}
if( !context->localDeclarations().isEmpty() )
label += QString(", %1 D.").arg(context->localDeclarations().count());
label += QStringLiteral(", %1 D.").arg(context->localDeclarations().count());
if(!shortened )
{
......@@ -191,7 +191,7 @@ QString DumpDotGraphPrivate::dotGraphInternal(KDevelop::DUContext* context, bool
addDeclaration(stream, context->owner());
}
stream << shortLabel(context) << "[shape=" << shape << ",label=\"" << label << "\"" << (isMaster ? QString("color=red") : QString("color=blue")) << "];\n";
stream << shortLabel(context) << "[shape=" << shape << ",label=\"" << label << "\"" << (isMaster ? QStringLiteral("color=red") : QStringLiteral("color=blue")) << "];\n";
if( isMaster )
stream << "}\n";
......
......@@ -76,7 +76,7 @@ QString FunctionDeclaration::toString() const {
TypePtr<FunctionType> function = type.cast<FunctionType>();
if(function) {
return QString("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn )).arg(identifier().toString()).arg(function->partToString( FunctionType::SignatureArguments ));
return QStringLiteral("%1 %2 %3").arg(function->partToString( FunctionType::SignatureReturn )).arg(identifier().toString()).arg(function->partToString( FunctionType::SignatureArguments ));
}else{
return Declaration::toString();
}
......
......@@ -104,9 +104,9 @@ void NamespaceAliasDeclaration::setAbstractType(AbstractType::Ptr type) {
QString NamespaceAliasDeclaration::toString() const {
DUCHAIN_D(NamespaceAliasDeclaration);
if( indexedIdentifier() != globalIndexedImportIdentifier() )
return QString("Import %1 as %2").arg(d->m_importIdentifier.identifier().toString()).arg(identifier().toString());
return QStringLiteral("Import %1 as %2").arg(d->m_importIdentifier.identifier().toString()).arg(identifier().toString());
else
return QString("Import %1").arg(d->m_importIdentifier.identifier().toString());
return QStringLiteral("Import %1").arg(d->m_importIdentifier.identifier().toString());
}
}
......@@ -109,7 +109,7 @@ QString AbstractDeclarationNavigationContext::html(bool shorten)
if(auto integralType = m_declaration->type<ConstantIntegralType>()) {
const QString plainValue = integralType->valueAsString();
if (!plainValue.isEmpty()) {
modifyHtml() += QString(" = %1").arg(plainValue);
modifyHtml() += QStringLiteral(" = %1").arg(plainValue);
}
}
......@@ -246,20 +246,20 @@ QString AbstractDeclarationNavigationContext::html(bool shorten)
else
modifyHtml() += labelHighlight(i18n( "Decl.: " ));
makeLink( QString("%1 :%2").arg( m_declaration->url().toUrl().fileName() ).arg( m_declaration->rangeInCurrentRevision().start().line()+1 ), m_declaration, NavigationAction::JumpToSource );
makeLink( QStringLiteral("%1 :%2").arg( m_declaration->url().toUrl().fileName() ).arg( m_declaration->rangeInCurrentRevision().start().line()+1 ), m_declaration, NavigationAction::JumpToSource );
modifyHtml() += " ";
//modifyHtml() += "<br />";
if(!dynamic_cast<FunctionDefinition*>(m_declaration.data())) {
if( FunctionDefinition* definition = FunctionDefinition::definition(m_declaration.data()) ) {
modifyHtml() += labelHighlight(i18n( " Def.: " ));
makeLink( QString("%1 :%2").arg( definition->url().toUrl().fileName() ).arg( definition->rangeInCurrentRevision().start().line()+1 ), DeclarationPointer(definition), NavigationAction::JumpToSource );
makeLink( QStringLiteral("%1 :%2").arg( definition->url().toUrl().fileName() ).arg( definition->rangeInCurrentRevision().start().line()+1 ), DeclarationPointer(definition), NavigationAction::JumpToSource );
}
}
if( FunctionDefinition* definition = dynamic_cast<FunctionDefinition*>(m_declaration.data()) ) {
if(definition->declaration()) {
modifyHtml() += labelHighlight(i18n( " Decl.: " ));
makeLink( QString("%1 :%2").arg( definition->declaration()->url().toUrl().fileName() ).arg( definition->declaration()->rangeInCurrentRevision().start().line()+1 ), DeclarationPointer(definition->declaration()), NavigationAction::JumpToSource );
makeLink( QStringLiteral("%1 :%2").arg( definition->declaration()->url().toUrl().fileName() ).arg( definition->declaration()->rangeInCurrentRevision().start().line()+1 ), DeclarationPointer(definition->declaration()), NavigationAction::JumpToSource );
}
}
......@@ -392,9 +392,9 @@ void AbstractDeclarationNavigationContext::htmlAdditionalNavigation()
if(overridden) {
modifyHtml() += i18n("Overrides a ");
makeLink(i18n("function"), QString("jump_to_overridden"), NavigationAction(DeclarationPointer(overridden), KDevelop::NavigationAction::NavigateDeclaration));
makeLink(i18n("function"), QStringLiteral("jump_to_overridden"), NavigationAction(DeclarationPointer(overridden), KDevelop::NavigationAction::NavigateDeclaration));
modifyHtml() += i18n(" from ");
makeLink(prettyQualifiedIdentifier(DeclarationPointer(overridden->context()->owner())).toString(), QString("jump_to_overridden_container"), NavigationAction(DeclarationPointer(overridden->context()->owner()), KDevelop::NavigationAction::NavigateDeclaration));
makeLink(prettyQualifiedIdentifier(DeclarationPointer(overridden->context()->owner())).toString(), QStringLiteral("jump_to_overridden_container"), NavigationAction(DeclarationPointer(overridden->context()->owner()), KDevelop::NavigationAction::NavigateDeclaration));
modifyHtml() += "<br />";
}else{
......@@ -407,9 +407,9 @@ void AbstractDeclarationNavigationContext::htmlAdditionalNavigation()
uint num = 0;
foreach(Declaration* decl, decls) {
modifyHtml() += i18n("Hides a ");
makeLink(i18n("function"), QString("jump_to_hide_%1").arg(num), NavigationAction(DeclarationPointer(decl), KDevelop::NavigationAction::NavigateDeclaration));
makeLink(i18n("function"), QStringLiteral("jump_to_hide_%1").arg(num), NavigationAction(DeclarationPointer(decl), KDevelop::NavigationAction::NavigateDeclaration));
modifyHtml() += i18n(" from ");
makeLink(prettyQualifiedIdentifier(DeclarationPointer(decl->context()->owner())).toString(), QString("jump_to_hide_container_%1").arg(num), NavigationAction(DeclarationPointer(decl->context()->owner()), KDevelop::NavigationAction::NavigateDeclaration));
makeLink(prettyQualifiedIdentifier(DeclarationPointer(decl->context()->owner())).toString(), QStringLiteral("jump_to_hide_container_%1").arg(num), NavigationAction(DeclarationPointer(decl->context()->owner()), KDevelop::NavigationAction::NavigateDeclaration));
modifyHtml() += "<br />";
++num;
......@@ -508,7 +508,7 @@ void AbstractDeclarationNavigationContext::htmlClass()
eventuallyMakeTypeLinks( klass.cast<AbstractType>() );
FOREACH_FUNCTION( const KDevelop::BaseClassInstance& base, classDecl->baseClasses ) {
modifyHtml() += ", " + stringFromAccess(base.access) + " " + (base.virtualInheritance ? QString("virtual") : QString()) + " ";
modifyHtml() += ", " + stringFromAccess(base.access) + " " + (base.virtualInheritance ? QStringLiteral("virtual") : QString()) + " ";
eventuallyMakeTypeLinks(base.baseClass.abstractType());
}
} else {
......@@ -543,7 +543,7 @@ void AbstractDeclarationNavigationContext::htmlIdentifiedType(AbstractType::Ptr
if(!id.isEmpty())
id = id.mid(id.count()-1);
htmlIdentifiedType(contextType, contextIdType);
modifyHtml() += QString("::").toHtmlEscaped();
modifyHtml() += QStringLiteral("::").toHtmlEscaped();
}
}
......@@ -560,7 +560,7 @@ void AbstractDeclarationNavigationContext::eventuallyMakeTypeLinks( AbstractType
type = typeToShow(type);
if( !type ) {
modifyHtml() += typeHighlight(QString("<no type>").toHtmlEscaped());
modifyHtml() += typeHighlight(QStringLiteral("<no type>").toHtmlEscaped());
return;
}
......@@ -611,7 +611,7 @@ QString AbstractDeclarationNavigationContext::identifierHighlight(const QString&
}
if (decl->isDeprecated()) {
ret = QString("<i>%1</i>").arg(ret);
ret = QStringLiteral("<i>%1</i>").arg(ret);
}
return ret;
}
......
......@@ -110,7 +110,7 @@ QString AbstractIncludeNavigationContext::html(bool shorten)
void AbstractIncludeNavigationContext::getFileInfo(TopDUContext* duchain)
{
modifyHtml() += QString("%1: %2 %3: %4").arg(labelHighlight(i18nc("Files included into this file", "Includes"))).arg(duchain->importedParentContexts().count()).arg(labelHighlight(i18nc("Count of files this file was included into", "Included by"))).arg(duchain->importers().count());
modifyHtml() += QStringLiteral("%1: %2 %3: %4").arg(labelHighlight(i18nc("Files included into this file", "Includes"))).arg(duchain->importedParentContexts().count()).arg(labelHighlight(i18nc("Count of files this file was included into", "Included by"))).arg(duchain->importers().count());
modifyHtml() += "<br />";
}
......@@ -153,7 +153,7 @@ void AbstractIncludeNavigationContext::addDeclarationsFromContext(KDevelop::DUCo
if(!addedDeclarations.contains(id) && filterDeclaration(*declarationIterator) ) {
//Show the declaration
if(!first)
modifyHtml() += QString(", ").toHtmlEscaped();
modifyHtml() += QStringLiteral(", ").toHtmlEscaped();
else
first = false;
......
......@@ -105,7 +105,7 @@ QString AbstractNavigationContext::createLink(const QString& name, QString targe
if( m_linkCount == m_selectedLink )
str = "<font style=\"background-color:#f1f1f1;\" color=\"#880088\">" + str + "</font>";
QString ret = "<a href=\"" + targetId + "\"" + ((m_linkCount == m_selectedLink && m_currentPositionLine == -1) ? QString(" name = \"currentPosition\"") : QString()) + ">" + str + "</a>";
QString ret = "<a href=\"" + targetId + "\"" + ((m_linkCount == m_selectedLink && m_currentPositionLine == -1) ? QStringLiteral(" name = \"currentPosition\"") : QString()) + ">" + str + "</a>";
if( m_selectedLink == m_linkCount )
m_selectedLinkAction = action;
......@@ -441,7 +441,7 @@ void AbstractNavigationContext::addHtml(QString html) {
if(line.indexOf(newLineRegExp) != -1) {
++m_currentLine;
if(m_currentLine == m_currentPositionLine) {
m_currentText += "<font color=\"#880088\"> <a name = \"currentPosition\" >" + QString("<->").toHtmlEscaped() + "</a> </font>";
m_currentText += "<font color=\"#880088\"> <a name = \"currentPosition\" >" + QStringLiteral("<->").toHtmlEscaped() + "</a> </font>";
}
}
}
......
......@@ -101,14 +101,14 @@ QString ProblemNavigationContext::html(bool shorten)
const DocumentRange range = diagnostic->finalLocation();
Declaration* declaration = DUChainUtils::itemUnderCursor(range.document.toUrl(), range.start());
modifyHtml() += labelHighlight(QString("%1: ").arg(diagnostic->severityString()));
modifyHtml() += labelHighlight(QStringLiteral("%1: ").arg(diagnostic->severityString()));
modifyHtml() += diagnostic->description();
if (declaration) {
modifyHtml() += "<br/>";
makeLink(declaration->toString(), KDevelop::DeclarationPointer(declaration), NavigationAction::NavigateDeclaration);
modifyHtml() += i18n(" in ");
makeLink(QString("%1 :%2").arg(declaration->url().toUrl().fileName()).arg(declaration->rangeInCurrentRevision().start().line()+1), KDevelop::DeclarationPointer(declaration), NavigationAction::NavigateDeclaration);
makeLink(QStringLiteral("%1 :%2").arg(declaration->url().toUrl().fileName()).arg(declaration->rangeInCurrentRevision().start().line()+1), KDevelop::DeclarationPointer(declaration), NavigationAction::NavigateDeclaration);
}
modifyHtml() += "<br/>";
}
......
......@@ -116,7 +116,7 @@ OneUseWidget::OneUseWidget(IndexedDeclaration declaration, IndexedString documen
connect(m_label, &QLabel::linkActivated, this, &OneUseWidget::jumpTo);
DUChainReadLocker lock(DUChain::lock());
QString text = "<a href='open'>" + i18nc("refers to a line in source code", "Line <b>%1</b>:", range.start().line()) + QString("</a>");
QString text = "<a href='open'>" + i18nc("refers to a line in source code", "Line <b>%1</b>:", range.start().line()) + QStringLiteral("</a>");
if(!m_sourceLine.isEmpty() && m_sourceLine.length() > m_range->range().end().column()) {
text += "&nbsp;&nbsp;" + highlightAndEscapeUseText(m_sourceLine, 0, m_range->range());
......@@ -129,7 +129,7 @@ OneUseWidget::OneUseWidget(IndexedDeclaration declaration, IndexedString documen
for(int a = start; a < end; ++a) {
QString lineText = code.line(a).toHtmlEscaped();
if (m_range->range().start().line() <= a && m_range->range().end().line() >= a) {
lineText = QString("<b>") + lineText + QString("</b>");
lineText = QStringLiteral("<b>") + lineText + QStringLiteral("</b>");
}
if(!lineText.trimmed().isEmpty()) {
toolTipText += lineText + "<br>";
......@@ -138,7 +138,7 @@ OneUseWidget::OneUseWidget(IndexedDeclaration declaration, IndexedString documen
if ( toolTipText.endsWith("<br>") ) {
toolTipText.remove(toolTipText.length() - 4, 4);
}
setToolTip(QString("<html><body><pre>") + toolTipText + QString("</pre></body></html>"));
setToolTip(QStringLiteral("<html><body><pre>") + toolTipText + QStringLiteral("</pre></body></html>"));
}