2 * Copyright 2013 Canonical Ltd.
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * version 3 along with this program. If not, see
15 * <http://www.gnu.org/licenses/>
17 * Authored by: Michael Terry <michael.terry@canonical.com>
20#include "PropertiesServer.h"
21#include "AccountsService.h"
25#include <QDBusMessage>
27PropertiesServer::PropertiesServer(QObject *parent)
33QDBusVariant PropertiesServer::Get(const QString &interface, const QString &property)
35 if (m_properties[interface].contains(property)) {
36 return QDBusVariant(m_properties[interface][property]);
38 sendErrorReply(QDBusError::InvalidArgs, "Bad interface or property");
39 return QDBusVariant(QVariant());
43void PropertiesServer::Set(const QString &interface, const QString &property, const QDBusVariant &variant)
45 QVariant newValue = variant.variant();
47 if (m_properties[interface].contains(property)) {
48 QVariant& oldValue = m_properties[interface][property];
49 if (oldValue != newValue) {
52 // Special case for Background file.
53 if (interface == "org.freedesktop.Accounts.User" && property == "BackgroundFile") {
56 QVariantMap propertyChanges;
57 propertyChanges[property] = newValue;
58 Q_EMIT PropertiesChanged(interface, propertyChanges, QStringList());
60 // FIXME: Here to replicate current behaviour
61 // Not sure why accounts-service is triggering Changed when we're
62 // emitting PropertyChanges from org.freedesktop.DBus.Properties as well.
67 sendErrorReply(QDBusError::InvalidArgs, "Bad interface or property");
71void PropertiesServer::Reset()
73 m_properties["com.canonical.unity.AccountsService"]["demo-edges"] = false;
74 m_properties["com.canonical.unity.AccountsService.Private"]["FailedLogins"] = 0;
75 m_properties["com.ubuntu.touch.AccountsService.SecurityPrivacy"]["StatsWelcomeScreen"] = true;
76 m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableLauncherWhileLocked"] = true;
77 m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableIndicatorsWhileLocked"] = true;
78 m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["PasswordDisplayHint"] = AccountsService::Keyboard;
79 m_properties["com.ubuntu.location.providers.here.AccountsService"]["LicenseAccepted"] = false;
80 m_properties["com.ubuntu.location.providers.here.AccountsService"]["LicenseBasePath"] = "";
81 m_properties["org.freedesktop.Accounts.User"]["BackgroundFile"] = "";
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list