1
0
Fork 0
forked from len0rd/rockbox

rbutil: Replace QRegExp with QRegularExpression.

More updating for Qt6 compatibility.

Change-Id: I2f5bb943acc1f6bdd7bdab0e90e3c0ede596f43a
This commit is contained in:
Dominik Riebeling 2021-12-26 20:13:05 +01:00
parent 1ad4faa334
commit 241d478ce9
2 changed files with 8 additions and 5 deletions

View file

@ -169,16 +169,20 @@ bool TalkFileCreator::createTalkList(QDir startDir)
else // its a File else // its a File
{ {
// insert into List // insert into List
if( !fileInf.fileName().isEmpty() && !fileInf.fileName().endsWith(".talk") && m_talkFiles) if(!fileInf.fileName().isEmpty()
&& !fileInf.fileName().endsWith(".talk")
&& m_talkFiles)
{ {
//test if we should ignore this file //test if we should ignore this file
bool match = false; bool match = false;
for(int i=0; i < m_ignoreFiles.size();i++) for(int i=0; i < m_ignoreFiles.size();i++)
{ {
QRegExp rx(m_ignoreFiles[i].trimmed()); QRegularExpression rx(
rx.setPatternSyntax(QRegExp::Wildcard); QRegularExpression::wildcardToRegularExpression(
if(rx.exactMatch(fileInf.fileName())) (m_ignoreFiles[i].trimmed())));
if(rx.match(fileInf.fileName()).hasMatch())
match = true; match = true;
} }
if(match) if(match)
continue; continue;

View file

@ -275,7 +275,6 @@ QString TalkGenerator::correctString(QString s)
LOG_INFO() << "corrected string" << s << "to" << corrected; LOG_INFO() << "corrected string" << s << "to" << corrected;
return corrected; return corrected;
m_abort = true;
} }
void TalkGenerator::setLang(QString name) void TalkGenerator::setLang(QString name)