From b1c40916013267fe462f10b6921185c6fdffb40a Mon Sep 17 00:00:00 2001 From: Maxime Gervais Date: Wed, 10 Jan 2024 16:24:06 +0100 Subject: [PATCH] Fix Qt6 compatibility Signed-off-by: Maxime Gervais --- Source/GUI/Qt/settingswindow.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/GUI/Qt/settingswindow.cpp b/Source/GUI/Qt/settingswindow.cpp index bb009a25..13939ec3 100644 --- a/Source/GUI/Qt/settingswindow.cpp +++ b/Source/GUI/Qt/settingswindow.cpp @@ -277,17 +277,16 @@ void SettingsWindow::create_parsespeed_options(QString& parsespeed) //--------------------------------------------------------------------------- void SettingsWindow::add_displaycaptions_to_html_selection(QString& displaycaptions, QString& html, const QString& selector) { - QRegExp reg("class=\"displaycaptionsList form-control\">"); + QRegularExpression reg("class=\"displaycaptionsList form-control\">", QRegularExpression::InvertedGreedinessOption); int pos = html.indexOf(selector); - reg.setMinimal(true); - if (pos == -1) return; - if ((pos = reg.indexIn(html, pos)) != -1) + QRegularExpressionMatch match = reg.match(html, pos); + if ((pos = match.capturedStart()) != -1) { - pos += reg.matchedLength(); + pos += match.capturedLength(); html.insert(pos, displaycaptions); } }