move text document for file path convenience function

Move it from language client utils to a static function inside
the text document.

Change-Id: I91bc72d0e978c1d843082e12bb8a0fa60a1bbc5e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2019-02-14 11:07:33 +01:00
parent fa4f925fda
commit b41b5a0714
6 changed files with 19 additions and 21 deletions

View File

@@ -361,11 +361,8 @@ TextMarkRegistry::TextMarkRegistry(QObject *parent)
void TextMarkRegistry::add(TextMark *mark)
{
instance()->m_marks[mark->fileName()].insert(mark);
auto document = qobject_cast<TextDocument *>(
DocumentModel::documentForFilePath(mark->fileName().toString()));
if (!document)
return;
document->addMark(mark);
if (TextDocument *document = TextDocument::textDocumentForFileName(mark->fileName()))
document->addMark(mark);
}
bool TextMarkRegistry::remove(TextMark *mark)