expanding unit test for QAudioDecoder
Looking for feedback concerning: implementation of the change desired functionality of QAudioDecoder Changed the behaviour of QAudioDecoder for more sane error output Change-Id: I82193a94b6fe1ef4202a4ac7bd95c607e0bee9c6 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
02efdccae9
commit
e24f4fed53
@@ -140,9 +140,7 @@ QAudioDecoder::QAudioDecoder(QObject *parent)
|
||||
Q_D(QAudioDecoder);
|
||||
|
||||
d->provider = QMediaServiceProvider::defaultServiceProvider();
|
||||
if (d->service == 0) {
|
||||
d->error = ServiceMissingError;
|
||||
} else {
|
||||
if (d->service) {
|
||||
d->control = qobject_cast<QAudioDecoderControl*>(d->service->requestControl(QAudioDecoderControl_iid));
|
||||
if (d->control != 0) {
|
||||
connect(d->control, SIGNAL(stateChanged(QAudioDecoder::State)), SLOT(_q_stateChanged(QAudioDecoder::State)));
|
||||
@@ -157,6 +155,10 @@ QAudioDecoder::QAudioDecoder(QObject *parent)
|
||||
connect(d->control ,SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64)));
|
||||
}
|
||||
}
|
||||
if (!d->control) {
|
||||
d->error = ServiceMissingError;
|
||||
d->errorString = tr("The QAudioDecoder object does not have a valid service");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user