From d5dfef66bb5b12ade920d3bf2d171186e9b7e8dc Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sun, 2 Mar 2014 11:43:58 +0100 Subject: [PATCH] Prefer to use normalised signal/slot signatures Change-Id: I48ae4b46f7a0342a1436ba78958b057e919e3a8a Reviewed-by: Marc Mutz --- examples/multimediawidgets/camera/camera.cpp | 4 ++-- examples/multimediawidgets/player/player.cpp | 2 +- .../qcamerabackend/tst_qcamerabackend.cpp | 4 ++-- .../qmediaplayerbackend/tst_qmediaplayerbackend.cpp | 8 ++++---- tests/auto/unit/qcamera/tst_qcamera.cpp | 20 ++++++++++---------- tests/auto/unit/qmediaobject/tst_qmediaobject.cpp | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/multimediawidgets/camera/camera.cpp b/examples/multimediawidgets/camera/camera.cpp index adb54ef..abbbf83 100644 --- a/examples/multimediawidgets/camera/camera.cpp +++ b/examples/multimediawidgets/camera/camera.cpp @@ -140,8 +140,8 @@ void Camera::setCamera(const QByteArray &cameraDevice) connect(imageCapture, SIGNAL(error(int,QCameraImageCapture::Error,QString)), this, SLOT(displayCaptureError(int,QCameraImageCapture::Error,QString))); - connect(camera, SIGNAL(lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason)), - this, SLOT(updateLockStatus(QCamera::LockStatus, QCamera::LockChangeReason))); + connect(camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)), + this, SLOT(updateLockStatus(QCamera::LockStatus,QCamera::LockChangeReason))); ui->captureWidget->setTabEnabled(0, (camera->isCaptureModeSupported(QCamera::CaptureStillImage))); ui->captureWidget->setTabEnabled(1, (camera->isCaptureModeSupported(QCamera::CaptureVideo))); diff --git a/examples/multimediawidgets/player/player.cpp b/examples/multimediawidgets/player/player.cpp index 843b9ec..64363ee 100644 --- a/examples/multimediawidgets/player/player.cpp +++ b/examples/multimediawidgets/player/player.cpp @@ -104,7 +104,7 @@ Player::Player(QWidget *parent) histogramLayout->addWidget(histogram, 1); probe = new QVideoProbe(this); - connect(probe, SIGNAL(videoFrameProbed(const QVideoFrame&)), histogram, SLOT(processFrame(QVideoFrame))); + connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)), histogram, SLOT(processFrame(QVideoFrame))); probe->setSource(player); QPushButton *openButton = new QPushButton(tr("Open"), this); diff --git a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp index 137377c..8909691 100644 --- a/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp +++ b/tests/auto/integration/qcamerabackend/tst_qcamerabackend.cpp @@ -356,7 +356,7 @@ void tst_QCameraBackend::testCameraCapture() QSignalSpy capturedSignal(&imageCapture, SIGNAL(imageCaptured(int,QImage))); QSignalSpy savedSignal(&imageCapture, SIGNAL(imageSaved(int,QString))); - QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int, QCameraImageCapture::Error,QString))); + QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int,QCameraImageCapture::Error,QString))); imageCapture.capture(); QTRY_COMPARE(errorSignal.size(), 1); @@ -427,7 +427,7 @@ void tst_QCameraBackend::testCaptureToBuffer() QSignalSpy capturedSignal(&imageCapture, SIGNAL(imageCaptured(int,QImage))); QSignalSpy imageAvailableSignal(&imageCapture, SIGNAL(imageAvailable(int,QVideoFrame))); QSignalSpy savedSignal(&imageCapture, SIGNAL(imageSaved(int,QString))); - QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int, QCameraImageCapture::Error,QString))); + QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int,QCameraImageCapture::Error,QString))); camera.start(); QTRY_VERIFY(imageCapture.isReadyForCapture()); diff --git a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp index 380e344..689843e 100644 --- a/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp +++ b/tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp @@ -736,9 +736,9 @@ void tst_QMediaPlayerBackend::probes() QAudioProbe *audioProbe = new QAudioProbe; ProbeDataHandler probeHandler; - connect(videoProbe, SIGNAL(videoFrameProbed(const QVideoFrame&)), &probeHandler, SLOT(processFrame(QVideoFrame))); + connect(videoProbe, SIGNAL(videoFrameProbed(QVideoFrame)), &probeHandler, SLOT(processFrame(QVideoFrame))); connect(videoProbe, SIGNAL(flush()), &probeHandler, SLOT(flushVideo())); - connect(audioProbe, SIGNAL(audioBufferProbed(const QAudioBuffer&)), &probeHandler, SLOT(processBuffer(QAudioBuffer))); + connect(audioProbe, SIGNAL(audioBufferProbed(QAudioBuffer)), &probeHandler, SLOT(processBuffer(QAudioBuffer))); connect(audioProbe, SIGNAL(flush()), &probeHandler, SLOT(flushAudio())); QVERIFY(videoProbe->setSource(player)); @@ -762,8 +762,8 @@ void tst_QMediaPlayerBackend::playlist() { QMediaPlayer player; - QSignalSpy mediaSpy(&player, SIGNAL(mediaChanged(const QMediaContent&))); - QSignalSpy currentMediaSpy(&player, SIGNAL(currentMediaChanged(const QMediaContent&))); + QSignalSpy mediaSpy(&player, SIGNAL(mediaChanged(QMediaContent))); + QSignalSpy currentMediaSpy(&player, SIGNAL(currentMediaChanged(QMediaContent))); QSignalSpy stateSpy(&player, SIGNAL(stateChanged(QMediaPlayer::State))); QSignalSpy errorSpy(&player, SIGNAL(error(QMediaPlayer::Error))); diff --git a/tests/auto/unit/qcamera/tst_qcamera.cpp b/tests/auto/unit/qcamera/tst_qcamera.cpp index 11032a4..3bbbc36 100644 --- a/tests/auto/unit/qcamera/tst_qcamera.cpp +++ b/tests/auto/unit/qcamera/tst_qcamera.cpp @@ -331,7 +331,7 @@ void tst_QCamera::testSimpleCameraCapture() QCOMPARE(imageCapture.error(), QCameraImageCapture::NoError); QVERIFY(imageCapture.errorString().isEmpty()); - QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int, QCameraImageCapture::Error,QString))); + QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int,QCameraImageCapture::Error,QString))); imageCapture.capture(QString::fromLatin1("/dev/null")); QCOMPARE(errorSignal.size(), 1); QCOMPARE(imageCapture.error(), QCameraImageCapture::NotSupportedFeatureError); @@ -349,7 +349,7 @@ void tst_QCamera::testSimpleCameraLock() QSignalSpy lockedSignal(&camera, SIGNAL(locked())); QSignalSpy lockFailedSignal(&camera, SIGNAL(lockFailed())); - QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason))); camera.searchAndLock(); QCOMPARE(camera.lockStatus(), QCamera::Locked); @@ -461,7 +461,7 @@ void tst_QCamera::testCameraCapture() QVERIFY(!imageCapture.isReadyForCapture()); QSignalSpy capturedSignal(&imageCapture, SIGNAL(imageCaptured(int,QImage))); - QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int, QCameraImageCapture::Error,QString))); + QSignalSpy errorSignal(&imageCapture, SIGNAL(error(int,QCameraImageCapture::Error,QString))); imageCapture.capture(QString::fromLatin1("/dev/null")); QCOMPARE(capturedSignal.size(), 0); @@ -942,7 +942,7 @@ void tst_QCamera::testCameraLockCancel() QSignalSpy lockedSignal(&camera, SIGNAL(locked())); QSignalSpy lockFailedSignal(&camera, SIGNAL(lockFailed())); - QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason))); camera.searchAndLock(); QCOMPARE(camera.lockStatus(), QCamera::Searching); QCOMPARE(lockedSignal.count(), 0); @@ -1322,8 +1322,8 @@ void tst_QCamera::testSearchAndLockWithLockTypes() /* Spy the signals */ QSignalSpy lockedSignal(&camera, SIGNAL(locked())); QSignalSpy lockFailedSignal(&camera, SIGNAL(lockFailed())); - QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason))); - QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus, QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason))); /* search and lock the camera with QCamera::LockExposure and verify if the signal is emitted correctly */ camera.searchAndLock(QCamera::LockExposure); @@ -1357,8 +1357,8 @@ void tst_QCamera::testUnlockWithType() /* Spy the signal */ QSignalSpy lockedSignal(&camera, SIGNAL(locked())); QSignalSpy lockFailedSignal(&camera, SIGNAL(lockFailed())); - QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus, QCamera::LockChangeReason))); - QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus, QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignal(&camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason))); /* lock the camera with QCamera::LockExposure and Verify if the signal is emitted correctly */ camera.searchAndLock(QCamera::LockExposure); @@ -1438,7 +1438,7 @@ void tst_QCamera::testLockStatusChangedWithTypesSignal() QCOMPARE(camera.lockStatus(), QCamera::Unlocked); /* Spy the signal lockStatusChanged(QCamera::LockType,QCamera::LockStatus, QCamera::LockChangeReason) */ - QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus, QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason))); /* Lock the camera with type QCamera::LockExposure */ camera.searchAndLock(QCamera::LockExposure); @@ -1584,7 +1584,7 @@ void tst_QCamera::testLockChangeReason() QCamera camera; - QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus, QCamera::LockChangeReason))); + QSignalSpy lockStatusChangedSignalWithType(&camera, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason))); /* Set the lockChangeReason */ service.mockLocksControl->setLockChangeReason(QCamera::LockAcquired); diff --git a/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp b/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp index 8d0bf88..ca7e493 100644 --- a/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp +++ b/tests/auto/unit/qmediaobject/tst_qmediaobject.cpp @@ -380,7 +380,7 @@ void tst_QMediaObject::metaDataChanged() QtTestMediaObject object(&service); QSignalSpy changedSpy(&object, SIGNAL(metaDataChanged())); - QSignalSpy changedWithValueSpy(&object, SIGNAL(metaDataChanged(QString, QVariant))); + QSignalSpy changedWithValueSpy(&object, SIGNAL(metaDataChanged(QString,QVariant))); service.metaData.setMetaData("key", "Value"); QCOMPARE(changedSpy.count(), 1); -- 2.7.4