diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-03-17 10:06:24 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2016-03-17 10:06:24 +0000 |
commit | ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318 (patch) | |
tree | 26e355f5d1c702dc8a2b9e67702ace213e9054ec /tests/integration/indicator-sound-test-base.cpp | |
parent | e24fb23ad146190a7ba873abb620e2a6def0ad21 (diff) | |
parent | 2acd4961a7e5af93f863503eca90f51d28e6603d (diff) | |
download | ayatana-indicator-sound-ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318.tar.gz ayatana-indicator-sound-ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318.tar.bz2 ayatana-indicator-sound-ce15e8ab1cc1fd37df3badad69da4e0ecc7b9318.zip |
Changed to code to get the root icon. Now it does not take into account the source output, as in fact that code was not differentiating between any particular case.
The code was added in the past in the case that we should differentiate between bluetooth, headphones, etc... but it was never used. Fixes: #1555831
Approved by: Charles Kerr
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r-- | tests/integration/indicator-sound-test-base.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index 9225c1d..b8608f6 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -989,6 +989,49 @@ QVariantList IndicatorSoundTestBase::getActionValue(QString const &action) return QVariantList(); } +QStringList IndicatorSoundTestBase::getRootIconValue(bool *isValid) +{ + QString result = 0; + + QVariantList varList = getActionValue("root"); + if (isValid != nullptr) + { + *isValid = false; + } + if (varList.at(0).canConvert<QDBusArgument>()) + { + const QDBusArgument dbusArg = qvariant_cast<QDBusArgument>(varList.at(0)); + if (dbusArg.currentType() == QDBusArgument::MapType) + { + QVariantMap map; + dbusArg >> map; + QVariantMap::const_iterator iter = map.find("icon"); + if (iter != map.end()) + { + const QDBusArgument iconArg = qvariant_cast<QDBusArgument>((*iter)); + if (iconArg.currentType() == QDBusArgument::StructureType) + { + QString name; + QVariant iconValue; + iconArg.beginStructure(); + iconArg >> name; + iconArg >> iconValue; + if (name == "themed" && iconValue.type() == QVariant::StringList) + { + if (isValid != nullptr) + { + *isValid = true; + } + } + iconArg.endStructure(); + return iconValue.toStringList(); + } + } + } + } + return QStringList(); +} + qlonglong IndicatorSoundTestBase::getVolumeSyncValue(bool *isValid) { qlonglong result = 0; |