diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-02-23 10:07:50 +0100 |
---|---|---|
committer | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-02-23 10:07:50 +0100 |
commit | 957c495207b8c53ffa9d3622c24fdff4f31cebfa (patch) | |
tree | bdac05be2556ffc26c7a4fa8e1c86fa47b80a59f /tests/integration/indicator-sound-test-base.cpp | |
parent | ba4e4b3973a00902ff0f3d9eb4650f5f61e76c78 (diff) | |
download | ayatana-indicator-sound-957c495207b8c53ffa9d3622c24fdff4f31cebfa.tar.gz ayatana-indicator-sound-957c495207b8c53ffa9d3622c24fdff4f31cebfa.tar.bz2 ayatana-indicator-sound-957c495207b8c53ffa9d3622c24fdff4f31cebfa.zip |
added integration test to check last running player
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r-- | tests/integration/indicator-sound-test-base.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index 8242fb6..1cea780 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -456,17 +456,14 @@ QVariant IndicatorSoundTestBase::waitPropertyChanged(QString property) signal_spy_volume_changed_->wait(); if (signal_spy_volume_changed_->count()) { - QList<QVariant> arguments = signal_spy_volume_changed_->takeFirst(); + QList<QVariant> arguments = signal_spy_volume_changed_->takeLast(); if (arguments.size() == 3 && static_cast<QMetaType::Type>(arguments.at(1).type()) == QMetaType::QVariantMap) { - QVariantMap map = arguments.at(1).toMap(); - QMapIterator<QString, QVariant> iter(map); - while (iter.hasNext()) { - iter.next(); - if (iter.key() == property) - { - return iter.value(); - } + QMap<QString, QVariant> map = arguments.at(1).toMap(); + QMap<QString, QVariant>::iterator iter = map.find(property); + if (iter != map.end()) + { + return iter.value(); } } } |