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() filteredApiDataModel.clear()
for (var i = 0; i < apiDataModel.count; ++i) { for (var i = 0; i < apiDataModel.count; ++i) {
var item = apiDataModel.get(i) var item = apiDataModel.get(i)
if (item.name.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 || var name = item.name ? item.name.toString().toLowerCase() : ""
item.key.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 || var key = item.key ? item.key.toString().toLowerCase() : ""
item.amount.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 || var amount = item.amount ? item.amount.toString().toLowerCase() : ""
item.start.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 || var start = item.start ? item.start.toString().toLowerCase() : ""
item.end.toLowerCase().indexOf(searchText.toLowerCase()) !== -1 || var end = item.end ? item.end.toString().toLowerCase() : ""
item.group.toLowerCase().indexOf(searchText.toLowerCase()) !== -1) { 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) filteredApiDataModel.append(item)
} }
} }