Fix ordering of device ports
The current port index doesn't always correspond to the position of the port in the QVector returned by Device::ports(). This fixes that.
The current port index doesn't always correspond to the position of the port in the QVector returned by Device::ports(). This fixes that.