Bazaar: Replace QRegExp

Task-number: QTCREATORBUG-24098
Change-Id: I450d5756359596495f501759670970c9c541d4d9
Reviewed-by: Hugues Delorme <delorme.hugues@fougue.pro>
This commit is contained in:
hjk
2020-06-23 16:36:59 +02:00
parent f7242cdce9
commit a6fe2efd4e
7 changed files with 35 additions and 26 deletions

View File

@@ -62,16 +62,16 @@ QString BazaarEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const
cursor.select(QTextCursor::LineUnderCursor);
if (cursor.hasSelection()) {
const QString line = cursor.selectedText();
const int start = m_changesetId.indexIn(line);
if (start > -1) {
const QString match = m_changesetId.cap(0);
const int stop = start + match.length();
const QRegularExpressionMatch match = m_changesetId.match(line);
if (match.hasMatch()) {
const int start = match.capturedStart();
const int stop = match.capturedEnd();
if (start <= cursorCol && cursorCol <= stop) {
cursor = cursorIn;
cursor.select(QTextCursor::WordUnderCursor);
if (cursor.hasSelection()) {
const QString change = cursor.selectedText();
if (m_exactChangesetId.exactMatch(change))
if (m_exactChangesetId.match(change).hasMatch())
return change;
}
}