MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / setGitInfo

Method setGitInfo

src/plugins/git/gui/gitlogwidget.cpp:53–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void GitLogWidget::setGitInfo(const QStringList &infos)
54{
55 if (infos.isEmpty())
56 return d->gitEditor->clear();
57
58 const auto &info = infos.join("");
59 CodeFormatHandler handler;
60 const QList<FormattedText> formattedTextList = handler.parseText(FormattedText(info));
61
62 d->gitEditor->clear();
63 QTextCursor cursor = d->gitEditor->textCursor();
64 cursor.beginEditBlock();
65 for (const auto &formattedChunk : formattedTextList)
66 cursor.insertText(formattedChunk.text, formattedChunk.format);
67 cursor.endEditBlock();
68 d->gitEditor->document()->setModified(false);
69
70 cursor.setPosition(0);
71 d->gitEditor->setTextCursor(cursor);
72}
73
74void GitLogWidget::setReadyMessage(const QString &msg)
75{

Callers 1

setInfoMethod · 0.45

Calls 10

FormattedTextClass · 0.85
parseTextMethod · 0.80
textCursorMethod · 0.80
setPositionMethod · 0.80
setTextCursorMethod · 0.80
isEmptyMethod · 0.45
clearMethod · 0.45
insertTextMethod · 0.45
setModifiedMethod · 0.45
documentMethod · 0.45

Tested by

no test coverage detected