From 856119c5a43b4781b051b93a0713c152cfd99f85 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 15 Apr 2022 13:27:34 +0200 Subject: Make it run with Qt6 This is a huge commit. Changes: * Obviously, make it compile * Make it run (only scarcely tested) * get rid of most of clang's warnings Let's see what surprises are in store... --- movieinfopage.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'movieinfopage.cpp') diff --git a/movieinfopage.cpp b/movieinfopage.cpp index 787329f..6ebc1e1 100644 --- a/movieinfopage.cpp +++ b/movieinfopage.cpp @@ -151,13 +151,11 @@ void MovieInfoPage::addFile(const QString &file){ itemData[WizardTreeModel::FileType] = WizardTreeModel::Movie; }else{ QString baseName = fi.completeBaseName(); - QRegExp reFront = QRegExp("front"); - reFront.setCaseSensitivity(Qt::CaseInsensitive); - QRegExp reBack = QRegExp("back"); - reBack.setCaseSensitivity(Qt::CaseInsensitive); - if(baseName.endsWith('f') || (reFront.indexIn(baseName) != -1)){ + QRegularExpression reFront("front", QRegularExpression::CaseInsensitiveOption); + QRegularExpression reBack("back", QRegularExpression::CaseInsensitiveOption); + if(baseName.endsWith('f') || reFront.match(baseName).hasMatch()){ itemData[WizardTreeModel::FileType] = WizardTreeModel::FrontCover; - }else if(baseName.endsWith('b') || (reBack.indexIn(baseName) != -1)){ + }else if(baseName.endsWith('b') || reBack.match(baseName).hasMatch()){ itemData[WizardTreeModel::FileType] = WizardTreeModel::BackCover; }else{ itemData[WizardTreeModel::FileType] = WizardTreeModel::GeneralCover; @@ -254,7 +252,7 @@ void MovieInfoPage::guessOld(const QString &fullPath){ QDirIterator it(fi.dir()); QList itemData; while(it.hasNext()){ - QFileInfo curFi = it.next(); + QFileInfo curFi(it.next()); QString curBaseName = curFi.completeBaseName(); for(int i = 0; i < mFileModel->rowCount(mFileModel->rootIndex()); ++i){ QModelIndex curIdx = mFileModel->index(i, WizardTreeModel::FileName, mFileModel->rootIndex()); -- cgit v1.2.3-70-g09d2