Commit 167649d3 authored by Tomaz  Canabrava's avatar Tomaz Canabrava

Don't query for the document twice

parent f1fca7c8
Pipeline #7538 passed with stage
in 6 minutes and 20 seconds
......@@ -297,11 +297,10 @@ void Project::tryToRemoveCodeDocument(KTextEditor::Document *document)
QString Project::documentName(KTextEditor::Document *document) const
if (!d->m_documentNames.value(document).isEmpty()) {
return d->m_documentNames.value(document);
} else { // fall back to internal document name
return document->documentName();
const QString docName = d->m_documentNames.value(document);
return !docName.isEmpty()
? docName
: document->documentName();
void Project::setDocumentName(KTextEditor::Document *document, const QString &name)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment