Fix issue with current port index not always representing the actual current port
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.