24 + onPressAndHold: {
25 + var id = items.get(currentIndex = index).desktop_file
26 + if (id != undefined) currentId = id
27 + }
items.get(currentIndex = index) saves you one line of code, but it makes the entire thing much less clear. In general assignements should be on their own separate line for clarity (relying on the fact that the "value" of an assignement is implicitly the assigned operand is clever but rather obscure).
Also when you rename currentIndex rename var id in a matching way since you're already there.
24 + onPressAndHold: { currentIndex = index).desktop_file
25 + var id = items.get(
26 + if (id != undefined) currentId = id
27 + }
items.get( currentIndex = index) saves you one line of code, but it makes the entire thing much less clear. In general assignements should be on their own separate line for clarity (relying on the fact that the "value" of an assignement is implicitly the assigned operand is clever but rather obscure).
Also when you rename currentIndex rename var id in a matching way since you're already there.