diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-03-07 10:13:38 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2016-03-07 10:13:38 +0000 |
commit | 57f5cbe43e95d72e0904473ab371e9e016b73956 (patch) | |
tree | b8186a4701bbafcf9fc9a71bbcb35fd9b3ee81d1 /tests/service-mocks | |
parent | de4abb7448d329f7e7c20e01f8b14f22627a69a3 (diff) | |
parent | 3aa67455801c7db139be5a9293ddb6d7d703a981 (diff) | |
download | ayatana-indicator-sound-57f5cbe43e95d72e0904473ab371e9e016b73956.tar.gz ayatana-indicator-sound-57f5cbe43e95d72e0904473ab371e9e016b73956.tar.bz2 ayatana-indicator-sound-57f5cbe43e95d72e0904473ab371e9e016b73956.zip |
This branch sets the last running player using accounts service instead of gsettings.
It also includes a new class AccountsServiceAccess, to centralize all accesses to account service properties.
Approved by: PS Jenkins bot, Charles Kerr
Diffstat (limited to 'tests/service-mocks')
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.cpp b/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.cpp index 37de377..b0e4862 100644 --- a/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.cpp +++ b/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.cpp @@ -46,3 +46,18 @@ void AccountsServiceSoundMock::setVolume(double volume) "Volume", property("Volume")); } + +QString AccountsServiceSoundMock::lastRunningPlayer() const +{ + return lastRunningPlayer_; +} + +void AccountsServiceSoundMock::setLastRunningPlayer(QString const & lastRunningPlayer) +{ + lastRunningPlayer_ = lastRunningPlayer; + notifier_.notifyPropertyChanged(QDBusConnection::systemBus(), + ACCOUNTS_SOUND_INTERFACE, + USER_PATH, + "LastRunningPlayer", + property("LastRunningPlayer")); +} diff --git a/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.h b/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.h index bb3dbe8..fd5104e 100644 --- a/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.h +++ b/tests/service-mocks/accounts-mock/AccountsServiceSoundMock.h @@ -37,10 +37,13 @@ class AccountsServiceSoundMock : public QObject, protected QDBusContext { Q_OBJECT Q_PROPERTY(double Volume READ volume WRITE setVolume) + Q_PROPERTY(QString LastRunningPlayer READ lastRunningPlayer WRITE setLastRunningPlayer) public Q_SLOTS: double volume() const; void setVolume(double volume); + QString lastRunningPlayer() const; + void setLastRunningPlayer(QString const & lastRunningPlayer); public: AccountsServiceSoundMock(QObject* parent = 0); @@ -48,6 +51,7 @@ public: private: double volume_; + QString lastRunningPlayer_; DBusPropertiesNotifier notifier_; }; diff --git a/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml b/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml index 859cd46..daf82e5 100644 --- a/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml +++ b/tests/service-mocks/accounts-mock/com.ubuntu.AccountsService.Sound.Mock.xml @@ -2,5 +2,6 @@ <node> <interface name="com.ubuntu.AccountsService.Sound"> <property name="Volume" type="d" access="readwrite"/> + <property name="LastRunningPlayer" type="s" access="readwrite"/> </interface> </node>
\ No newline at end of file |