mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
rbutil: Replace QRegExp with QRegularExpression.
The former is not part of Qt6 anymore, while the latter has been introduced with Qt5. We don't support Qt4 anymore, so move to QRegularExpression. Change-Id: Icc15ef422790f3740660c5581294aa0536f46b1f
This commit is contained in:
parent
72071d108c
commit
9e28474e47
11 changed files with 41 additions and 37 deletions
|
|
@ -263,9 +263,10 @@ QString TalkGenerator::correctString(QString s)
|
|||
int i = 0;
|
||||
int max = m_corrections.size();
|
||||
while(i < max) {
|
||||
corrected = corrected.replace(QRegExp(m_corrections.at(i).search,
|
||||
corrected = corrected.replace(QRegularExpression(m_corrections.at(i).search,
|
||||
m_corrections.at(i).modifier.contains("i")
|
||||
? Qt::CaseInsensitive : Qt::CaseSensitive),
|
||||
? QRegularExpression::NoPatternOption
|
||||
: QRegularExpression::CaseInsensitiveOption),
|
||||
m_corrections.at(i).replace);
|
||||
i++;
|
||||
}
|
||||
|
|
@ -329,7 +330,7 @@ void TalkGenerator::setLang(QString name)
|
|||
co.search = items.at(3);
|
||||
co.replace = items.at(4);
|
||||
// Qt uses backslash for back references, Perl uses dollar sign.
|
||||
co.replace.replace(QRegExp("\\$(\\d+)"), "\\\\1");
|
||||
co.replace.replace(QRegularExpression("\\$(\\d+)"), "\\\\1");
|
||||
co.modifier = items.at(5);
|
||||
m_corrections.append(co);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue