Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PairPage doesn't show same devices when reopened #315

Open
jmlich opened this issue Dec 1, 2023 · 1 comment
Open

PairPage doesn't show same devices when reopened #315

jmlich opened this issue Dec 1, 2023 · 1 comment

Comments

@jmlich
Copy link
Contributor

jmlich commented Dec 1, 2023

I was examining the behavior of the PairPage, and it seems a little confusing to me. I must admit the used mechanism is hard for me to understand.

groups: DelegateModelGroup {
id: visibleItems
name: "visible"
includeByDefault: false
}
filterOnGroup: "visible"
items.onChanged: {
var itemsCount = items.count
if (itemsCount > 0) {
items.setGroups(0, itemsCount, "items")
}
for (var i = 0; i < itemsCount; ++i) {
var item = items.get(i)
item.inVisible = item.model.FriendlyName.indexOf(deviceType) !== -1
}
}

It seems to try to filter devices by name based on the selection on the previous page. However, it seems that this mechanism isn't used when the model is initialized (when I click back and reopen the page). My first impression was that the device list is not properly refreshed during scanning.

@jmlich
Copy link
Contributor Author

jmlich commented Jan 3, 2024

Long story short: the filtering is applied just "items.onChanged", but not onCompleted, which may look strange. It may happen that list is loaded and doesn't change for few seconds (if you are in between of model update interval).

I am actually not sure which event (onCompleted?) should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant