summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2021-05-28 06:54:08 +0200
committerArno <arno@disconnect.de>2021-05-28 06:54:08 +0200
commit058ba694d3796673fdf044d6e4e0642ff8866dbc (patch)
tree796ebff262d90d7aa449de3566fb817c44e71000
parent308f8ae11f08b811318373183e12b53d27deb631 (diff)
downloadSheMov-058ba694d3796673fdf044d6e4e0642ff8866dbc.tar.gz
SheMov-058ba694d3796673fdf044d6e4e0642ff8866dbc.tar.bz2
SheMov-058ba694d3796673fdf044d6e4e0642ff8866dbc.zip
Fix guessOld()
The filename was never compared to the current index, so everything was appended to the first match. Fix it by adding the needed comparison.
-rw-r--r--movieinfopage.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/movieinfopage.cpp b/movieinfopage.cpp
index 2d90df9..787329f 100644
--- a/movieinfopage.cpp
+++ b/movieinfopage.cpp
@@ -258,7 +258,8 @@ void MovieInfoPage::guessOld(const QString &fullPath){
QString curBaseName = curFi.completeBaseName();
for(int i = 0; i < mFileModel->rowCount(mFileModel->rootIndex()); ++i){
QModelIndex curIdx = mFileModel->index(i, WizardTreeModel::FileName, mFileModel->rootIndex());
- if(curIdx.isValid()){
+ QString indexFn = curIdx.data().toString();
+ if(curIdx.isValid() && indexFn.contains(curBaseName)){
if(fnRe.match(curBaseName).hasMatch()){
if(curFi.absoluteFilePath() != fi.absoluteFilePath()){
parent = curIdx;