urlhandler: Fix devicePicker selection with --device
When using 'Send a file/URL' in the indicator with multiple devices, the device the user selects for file sharing is not automatically selected in the URL handler dialog that follows.
As shown above, 'Device C' is selected for file sharing but 'Device D' is the one selected in the prompt.
This happens because model.rowForDevice(deviceId)
is called without
waiting for the model to be populated, always returning -1.
Resolving this exposed another bug, where the selected device was still
not the one picked. This happens because proxyModel
is used to fill the
QComboBox
but model
is used to find the correct index. Since
DevicesPluginFilterProxyModel
sorts and filters the data from model
the indices do not match.
This commit addresses these issues by deferring the device selection until
data is available and implementing rowForDevice
for filtered/sorted data
in DevicesPluginFilterProxyModel
.