Mark a device as open only after all settings was aplied


Otherwise it lead to emmiting of the QSP::NotOpenError in case we close
a device from a slot, which is connected to QSP::SerialPortError signal.
In this case QSP::close() called twice: from the slot, and from the
QSP::open() method (this behavior can be reproduced with Terminal
example).

So, inside of QSP::open() we need to move QIODevice::open() down, and
instead of QSP::close() to use QSPP::close().

Tested on Linux with USB PL2303 with trying to setup an unsupported
baud rate as 14400 baud.

Change-Id: I12dec085423dd9f5a08b7884f32dd2ba8aa8c951
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
commite0d91fb76477d21f9152c16044f0492c4cac9998
parent5d58e6950f63e000d31124b567f2f8351c8820f6
authorDenis Shienkov <denis.shienkov@gmail.com>
committerDenis Shienkov <denis.shienkov@gmail.com>
commit timeThu, 4 Dec 2014 13:45:54 +0100