on 2492425 help sign in
unity8/tests/plugins/AccountsService/PropertiesServer.cpp
45 lines 1.6 kB history raw
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
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.
7 *
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.
12 *
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/>
16 *
17 * Authored by: Michael Terry <michael.terry@canonical.com>
18 */
20#include "PropertiesServer.h"
22PropertiesServer::PropertiesServer(QObject *parent)
23 : QObject(parent),
24 edge_demo(true)
28QDBusVariant PropertiesServer::Get(const QString &interface, const QString &property)
30 if (interface == "com.canonical.unity.AccountsService" && property == "demo-edges") {
31 return QDBusVariant(QVariant(edge_demo));
32 } else {
33 sendErrorReply(QDBusError::InvalidArgs, "Bad interface or property");
34 return QDBusVariant(QVariant());
35 }
38void PropertiesServer::Set(const QString &interface, const QString &property, const QDBusVariant &variant)
40 if (interface == "com.canonical.unity.AccountsService" && property == "demo-edges") {
41 edge_demo = variant.variant().toBool();
42 } else {
43 sendErrorReply(QDBusError::InvalidArgs, "Bad interface or property");
44 }