aboutsummaryrefslogtreecommitdiff
path: root/tests/accounts-mock/AccountsServiceSoundMock.cpp
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-21 11:53:31 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-21 11:53:31 +0200
commitae0602ca11090c6c70cdf289ce3871766d36519c (patch)
tree2a8591780c403f3dc0d416d800df4f6abfffb02e /tests/accounts-mock/AccountsServiceSoundMock.cpp
parent913282e093a723b7e3a7bb899a77a068edafcd01 (diff)
downloadayatana-indicator-sound-ae0602ca11090c6c70cdf289ce3871766d36519c.tar.gz
ayatana-indicator-sound-ae0602ca11090c6c70cdf289ce3871766d36519c.tar.bz2
ayatana-indicator-sound-ae0602ca11090c6c70cdf289ce3871766d36519c.zip
code cleanup
Diffstat (limited to 'tests/accounts-mock/AccountsServiceSoundMock.cpp')
-rw-r--r--tests/accounts-mock/AccountsServiceSoundMock.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/tests/accounts-mock/AccountsServiceSoundMock.cpp b/tests/accounts-mock/AccountsServiceSoundMock.cpp
index 10f4f8d..37de377 100644
--- a/tests/accounts-mock/AccountsServiceSoundMock.cpp
+++ b/tests/accounts-mock/AccountsServiceSoundMock.cpp
@@ -22,6 +22,8 @@
#include "AccountsServiceSoundMock.h"
#include "AccountsDefs.h"
+using namespace ubuntu::indicators::testing;
+
AccountsServiceSoundMock::AccountsServiceSoundMock(QObject* parent)
: QObject(parent)
, volume_(0.0)
@@ -38,23 +40,9 @@ double AccountsServiceSoundMock::volume() const
void AccountsServiceSoundMock::setVolume(double volume)
{
volume_ = volume;
- notifyPropertyChanged(ACCOUNTS_SOUND_INTERFACE,
- USER_PATH,
- "Volume");
-}
-
-void AccountsServiceSoundMock::notifyPropertyChanged(QString const & interface,
- QString const & path,
- QString const & propertyName)
-{
- QDBusMessage signal = QDBusMessage::createSignal(
- path,
- "org.freedesktop.DBus.Properties",
- "PropertiesChanged");
- signal << interface;
- QVariantMap changedProps;
- changedProps.insert(propertyName, property(propertyName.toStdString().c_str()));
- signal << changedProps;
- signal << QStringList();
- QDBusConnection::systemBus().send(signal);
+ notifier_.notifyPropertyChanged(QDBusConnection::systemBus(),
+ ACCOUNTS_SOUND_INTERFACE,
+ USER_PATH,
+ "Volume",
+ property("Volume"));
}