native: fix warings in search

This commit is contained in:
Johannes Jöns 2024-07-11 22:15:50 +02:00
parent 4306f561a6
commit 54b5730fcd

View file

@ -185,12 +185,19 @@ Rectangle {
filteredApiDataModel.clear()
for (var i = 0; i < apiDataModel.count; ++i) {
var item = apiDataModel.get(i)
if (item.name.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 ||
item.key.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 ||
item.amount.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 ||
item.start.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 ||
item.end.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 ||
item.group.toLowerCase().indexOf(searchText.toLowerCase()) !== -1) {
var name = item.name ? item.name.toString().toLowerCase() : ""
var key = item.key ? item.key.toString().toLowerCase() : ""
var amount = item.amount ? item.amount.toString().toLowerCase() : ""
var start = item.start ? item.start.toString().toLowerCase() : ""
var end = item.end ? item.end.toString().toLowerCase() : ""
var group = item.group ? item.group.toString().toLowerCase() : ""
if (name.indexOf(searchText.toLowerCase()) !== -1 ||
key.indexOf(searchText.toLowerCase()) !== -1 ||
amount.indexOf(searchText.toLowerCase()) !== -1 ||
start.indexOf(searchText.toLowerCase()) !== -1 ||
end.indexOf(searchText.toLowerCase()) !== -1 ||
group.indexOf(searchText.toLowerCase()) !== -1) {
filteredApiDataModel.append(item)
}
}