From 7604867025faaf3b015193ca89454b72d981bd58 Mon Sep 17 00:00:00 2001 From: Xavi Garcia Mena Date: Wed, 2 Mar 2016 14:50:43 +0100 Subject: Changed following Charles's suggestions --- tests/integration/indicator-sound-test-base.cpp | 14 +++++++------- tests/integration/indicator-sound-test-base.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index 1cea780..cf60868 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -448,15 +448,15 @@ bool IndicatorSoundTestBase::initializeMenuChangedSignal() return true; } -QVariant IndicatorSoundTestBase::waitPropertyChanged(QString property) +QVariant IndicatorSoundTestBase::waitPropertyChanged(QSignalSpy *signalSpy, QString property) { QVariant ret_val; - if (signal_spy_volume_changed_) + if (signalSpy) { - signal_spy_volume_changed_->wait(); - if (signal_spy_volume_changed_->count()) + signalSpy->wait(); + if (signalSpy->count()) { - QList arguments = signal_spy_volume_changed_->takeLast(); + QList arguments = signalSpy->takeLast(); if (arguments.size() == 3 && static_cast(arguments.at(1).type()) == QMetaType::QVariantMap) { QMap map = arguments.at(1).toMap(); @@ -472,13 +472,13 @@ QVariant IndicatorSoundTestBase::waitPropertyChanged(QString property) } bool IndicatorSoundTestBase::waitVolumeChangedInIndicator() { - QVariant val = waitPropertyChanged("Volume"); + QVariant val = waitPropertyChanged(signal_spy_volume_changed_.get(), "Volume"); return !val.isNull(); } QVariant IndicatorSoundTestBase::waitLastRunningPlayerChanged() { - return waitPropertyChanged("LastRunningPlayer"); + return waitPropertyChanged(signal_spy_volume_changed_.get(), "LastRunningPlayer"); } void IndicatorSoundTestBase::initializeAccountsInterface() diff --git a/tests/integration/indicator-sound-test-base.h b/tests/integration/indicator-sound-test-base.h index ecdbd7d..5c36031 100644 --- a/tests/integration/indicator-sound-test-base.h +++ b/tests/integration/indicator-sound-test-base.h @@ -144,7 +144,7 @@ protected: float getVolumeValue(bool *isValid = nullptr); - QVariant waitPropertyChanged(QString property); + static QVariant waitPropertyChanged(QSignalSpy * signalSpy, QString property); QVariant waitLastRunningPlayerChanged(); -- cgit v1.2.3