I had a look at the OptionSelector code this morning (for the first
time) in the hope I could help Dan, one of our community developers, but
one morning was not enough to be 100% sure of what's wrong here. I will
leave a report of my investigation below:

Works -> on Krillin rc-proposed
Fails -> on Arale OTA11

Report:
- On Arale OTA11, where it fails, I see that when I select index > 3 not all 
delegates are created. Let's suppose I select the item with index 6, then close 
the app, open again, I see that ListView creates delegates 0,1,2,3 and 6, but 
not 4-5. That leads me to believe the highlightFollowsCurrentItem logic was not 
triggered, otherwise scrolling from 0 to 6 would require info about delegates 
4-5 as well.


LOG:
REFERENCE TO SOURCE OF THE APP EXPOSING THE BUG
http://bazaar.launchpad.net/~ocs-team/owncloud-sync/trunk/view/30/Owncloud-Sync/Owncloud-Sync/ui/AccountSettingsPage.qml#L91

//this is onSourceChanged for the Image inside OptionSelectorDelegate
qml: SOURCE 0 
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Themes/Ambiance/artwork/chevron_down.png
 false false
//This is printed from the OptionSelectorDelegate having modelData "0", from 
inside Component.onCompleted
qml: I AM ALIVE! 0
//onHeightChanged for the ListView inside OptionSelector.qml
qml: LISTVIEW HEIGHT 115
qml: SOURCE 15 
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Themes/Ambiance/artwork/chevron_down.png
 false false
qml: I AM ALIVE! 15
qml: SOURCE 30 
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Themes/Ambiance/artwork/chevron_down.png
 false false
qml: I AM ALIVE! 30
qml: SOURCE 45 
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Themes/Ambiance/artwork/chevron_down.png
 false false
qml: I AM ALIVE! 45
qml: [AccountsSettingsPage] - Set Frequency Index:6
qml: LISTVIEW CURRENTINDEX CHANGED TO 6
qml: SOURCE 120 
file:///usr/lib/arm-linux-gnueabihf/qt5/qml/Ubuntu/Components/Themes/Ambiance/artwork/chevron_down.png
 false false
//Delegate with modelData 120 is instantiated, but not those with data "60", 
"120" (see app source link above). The listview does not scroll, and the UI 
still shows "No Sync", i.e. the element at index 0, even though ListView's 
currentIndex is now 6
qml: I AM ALIVE! 120


It seems like it could be a timing issue in ListView itself, i.e. 
highlightFollowsCurrentItem doesn't work if you set the currentIndex too early, 
although I'm not sure about this. Someone should have a deeper look.

- Additionally, OptionSelectorDelegate has a Connection to 
onCurrentlyExpandedChanged.
http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/staging/view/1986/src/Ubuntu/Components/1.3/OptionSelectorDelegate.qml#L166
Let's pick up the case I described above again: I open the app, select "120 
minutes" in the setting OptionSelector, then close the app, open it again (at 
this point the OptionSelector shows "No Sync" although currentIndex of the 
ListView is 6, as said in the previous bullet point). NOW I tap on the 
OptionSelector, it expands, and I notice that the onCurrentlyExpandedChanged 
slot is only called for the delegates at index 0,1,2,3, even though the view is 
now showing all delegates, from index 0 to 6. Moreover, there are no ticks or 
chevron-down images on the right side of ANY of the delegates (yes, it's just a 
list of labels at this point) until I select one value again.



** Changed in: ubuntu-ui-toolkit (Ubuntu)
     Assignee: (unassigned) => Zsombor Egri (zsombi)

** Changed in: ubuntu-ui-toolkit (Ubuntu)
   Importance: Undecided => High

** Changed in: ubuntu-ui-toolkit (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1589939

Title:
  OptionSelector: Setting selectedIndex unpredictable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1589939/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to