Skip to content

Commit

Permalink
Update for Qt6.5 changes to QRegularExpression.
Browse files Browse the repository at this point in the history
The change here is the conversion of the matching functions to take a
QStringView instead of a QString.  The older functions have been
deprecated.  Since a QStringView is anything that can be made to look
like a QString, the changes are pretty trivial.

https://doc.qt.io/qt-6/qregularexpression.html
  • Loading branch information
linuxdude42 committed Dec 30, 2024
1 parent 29d3a7a commit 2dfd2ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mythtv/libs/libmythtv/eitfixup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,9 +1184,15 @@ void EITFixUp::FixComHem(DBEventEIT &event, bool process_subtitle)
static const QRegularExpression comHemDirector { "[Rr]egi" };
static const QRegularExpression comHemActor { "[Ss]kådespelare|[Ii] rollerna" };
static const QRegularExpression comHemHost { "[Pp]rogramledare" };
#if QT_VERSION < QT_VERSION_CHECK(6,5,0)
auto dmatch = comHemDirector.match(pmatch.capturedView(1));
auto amatch = comHemActor.match(pmatch.capturedView(1));
auto hmatch = comHemHost.match(pmatch.capturedView(1));
#else
auto dmatch = comHemDirector.matchView(pmatch.capturedView(1));
auto amatch = comHemActor.matchView(pmatch.capturedView(1));
auto hmatch = comHemHost.matchView(pmatch.capturedView(1));
#endif
if (dmatch.hasMatch())
role = DBPerson::kDirector;
else if (amatch.hasMatch())
Expand Down Expand Up @@ -1254,7 +1260,11 @@ void EITFixUp::FixComHem(DBEventEIT &event, bool process_subtitle)
}

// Rerun with day, month and possibly year specified
#if QT_VERSION < QT_VERSION_CHECK(6,5,0)
match2 = comHemRerun2.match(match.capturedView(1));
#else
match2 = comHemRerun2.matchView(match.capturedView(1));
#endif
if (match2.hasMatch())
{
int day = match2.capturedView(1).toInt();
Expand Down

0 comments on commit 2dfd2ca

Please sign in to comment.