diff options
author | Arno <arno@disconnect.de> | 2022-04-15 13:27:34 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2022-04-15 13:27:34 +0200 |
commit | 856119c5a43b4781b051b93a0713c152cfd99f85 (patch) | |
tree | 4e2fde4e7a76179cc243e0665091c6ad429ea640 /movieinfopage.cpp | |
parent | 62d3ca1482b202d2883eeb5e17e72300e8612477 (diff) | |
download | SheMov-856119c5a43b4781b051b93a0713c152cfd99f85.tar.gz SheMov-856119c5a43b4781b051b93a0713c152cfd99f85.tar.bz2 SheMov-856119c5a43b4781b051b93a0713c152cfd99f85.zip |
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...
Diffstat (limited to 'movieinfopage.cpp')
-rw-r--r-- | movieinfopage.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
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<QVariant> 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()); |