mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Don't generate recursive callbacks when changing capture comments
This commit is contained in:
@@ -58,7 +58,9 @@ CommentView::CommentView(ICaptureContext &ctx, QWidget *parent)
|
||||
{
|
||||
QString text = QString::fromUtf8(m_commentsEditor->getText(m_commentsEditor->textLength() + 1));
|
||||
text.remove(QLatin1Char('\r'));
|
||||
m_ignoreModifications = true;
|
||||
m_Ctx.SetNotes(lit("comments"), text);
|
||||
m_ignoreModifications = false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -93,15 +95,17 @@ void CommentView::OnCaptureLoaded()
|
||||
|
||||
void CommentView::OnEventChanged(uint32_t eventId)
|
||||
{
|
||||
if(m_ignoreModifications)
|
||||
return;
|
||||
|
||||
QString oldText = QString::fromUtf8(m_commentsEditor->getText(m_commentsEditor->textLength() + 1));
|
||||
QString newText = m_Ctx.GetNotes("comments");
|
||||
|
||||
if(oldText != newText)
|
||||
{
|
||||
bool oldIgnore = m_ignoreModifications;
|
||||
m_ignoreModifications = true;
|
||||
m_commentsEditor->setText(newText.toUtf8().data());
|
||||
m_commentsEditor->emptyUndoBuffer();
|
||||
m_ignoreModifications = oldIgnore;
|
||||
m_ignoreModifications = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user