Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
50596e96
Commit
50596e96
authored
Mar 10, 2020
by
Caio Jordão Carvalho
Browse files
Rate, type and tag filter conditions should be evaluated outside of the loop
parent
225e00d0
Pipeline
#16265
passed with stage
in 14 minutes and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bin/projectsortproxymodel.cpp
View file @
50596e96
...
...
@@ -49,40 +49,42 @@ bool ProjectSortProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
bool
ProjectSortProxyModel
::
filterAcceptsRowItself
(
int
sourceRow
,
const
QModelIndex
&
sourceParent
)
const
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
QModelIndex
index0
=
sourceModel
()
->
index
(
sourceRow
,
i
,
sourceParent
);
if
(
!
index0
.
isValid
())
{
if
(
m_searchRating
>
0
)
{
// Column 7 contains the rating
QModelIndex
indexTag
=
sourceModel
()
->
index
(
sourceRow
,
7
,
sourceParent
);
if
(
sourceModel
()
->
data
(
indexTag
).
toInt
()
!=
m_searchRating
)
{
return
false
;
}
auto
data
=
sourceModel
()
->
data
(
index0
);
if
(
m_searchRating
>
0
)
{
// Column 7 contains the rating
QModelIndex
indexTag
=
sourceModel
()
->
index
(
sourceRow
,
7
,
sourceParent
);
if
(
sourceModel
()
->
data
(
indexTag
).
toInt
()
!=
m_searchRating
)
{
return
false
;
}
}
if
(
m_searchType
>
0
)
{
// Column 3 contains the item type (video, image, title, etc)
QModelIndex
indexTag
=
sourceModel
()
->
index
(
sourceRow
,
3
,
sourceParent
);
if
(
sourceModel
()
->
data
(
indexTag
).
toInt
()
!=
m_searchType
)
{
return
false
;
}
if
(
m_searchType
>
0
)
{
// Column 3 contains the item type (video, image, title, etc)
QModelIndex
indexTag
=
sourceModel
()
->
index
(
sourceRow
,
3
,
sourceParent
);
if
(
sourceModel
()
->
data
(
indexTag
).
toInt
()
!=
m_searchType
)
{
}
if
(
!
m_searchTag
.
isEmpty
())
{
// Column 4 contains the item tag data
QModelIndex
indexTag
=
sourceModel
()
->
index
(
sourceRow
,
4
,
sourceParent
);
auto
tagData
=
sourceModel
()
->
data
(
indexTag
);
for
(
const
QString
&
tag
:
m_searchTag
)
{
if
(
!
tagData
.
toString
().
contains
(
tag
,
Qt
::
CaseInsensitive
))
{
return
false
;
}
}
if
(
!
m_searchTag
.
isEmpty
())
{
// Column 4 contains the item tag data
QModelIndex
indexTag
=
sourceModel
()
->
index
(
sourceRow
,
4
,
sourceParent
);
auto
tagData
=
sourceModel
()
->
data
(
indexTag
);
for
(
const
QString
&
tag
:
m_searchTag
)
{
if
(
!
tagData
.
toString
().
contains
(
tag
,
Qt
::
CaseInsensitive
))
{
return
false
;
}
}
}
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
QModelIndex
index0
=
sourceModel
()
->
index
(
sourceRow
,
i
,
sourceParent
);
if
(
!
index0
.
isValid
())
{
return
false
;
}
auto
data
=
sourceModel
()
->
data
(
index0
);
if
(
data
.
toString
().
contains
(
m_searchString
,
Qt
::
CaseInsensitive
))
{
return
true
;
}
}
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment