Skip to content

Commit b1c4091

Browse files
committed
Fix Qt6 compatibility
Signed-off-by: Maxime Gervais <[email protected]>
1 parent 3f0e065 commit b1c4091

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Source/GUI/Qt/settingswindow.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,17 +277,16 @@ void SettingsWindow::create_parsespeed_options(QString& parsespeed)
277277
//---------------------------------------------------------------------------
278278
void SettingsWindow::add_displaycaptions_to_html_selection(QString& displaycaptions, QString& html, const QString& selector)
279279
{
280-
QRegExp reg("class=\"displaycaptionsList form-control\">");
280+
QRegularExpression reg("class=\"displaycaptionsList form-control\">", QRegularExpression::InvertedGreedinessOption);
281281
int pos = html.indexOf(selector);
282282

283-
reg.setMinimal(true);
284-
285283
if (pos == -1)
286284
return;
287285

288-
if ((pos = reg.indexIn(html, pos)) != -1)
286+
QRegularExpressionMatch match = reg.match(html, pos);
287+
if ((pos = match.capturedStart()) != -1)
289288
{
290-
pos += reg.matchedLength();
289+
pos += match.capturedLength();
291290
html.insert(pos, displaycaptions);
292291
}
293292
}

0 commit comments

Comments
 (0)