~mterry/unity8/new-input-proxies

« back to all changes in this revision

Viewing changes to tests/plugins/AccountsService/PropertiesServer.cpp

  • Committer: Michael Terry
  • Date: 2016-02-04 21:54:54 UTC
  • Revision ID: michael.terry@canonical.com-20160204215454-urgia29zavpa1wtl
Refactor AccountsService plugin to use less boilerplate

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
    }
43
43
}
44
44
 
 
45
QVariantMap PropertiesServer::GetAll(const QString &interface)
 
46
{
 
47
    if (m_properties.contains(interface)) {
 
48
        return m_properties[interface];
 
49
    } else {
 
50
        sendErrorReply(QDBusError::InvalidArgs, "Bad interface");
 
51
        return QVariantMap();
 
52
    }
 
53
}
 
54
 
45
55
void PropertiesServer::Set(const QString &interface, const QString &property, const QDBusVariant &variant)
46
56
{
47
57
    QVariant newValue = variant.variant();
82
92
    m_properties["com.canonical.unity.AccountsService"]["LauncherItems"] = QVariant::fromValue(QList<QVariantMap>());
83
93
    m_properties["com.canonical.unity.AccountsService.Private"]["FailedLogins"] = 0;
84
94
    m_properties["com.ubuntu.touch.AccountsService.SecurityPrivacy"]["StatsWelcomeScreen"] = true;
 
95
    m_properties["com.ubuntu.AccountsService.Input"]["MouseCursorSpeed"] = 0.5;
 
96
    m_properties["com.ubuntu.AccountsService.Input"]["TouchpadCursorSpeed"] = 0.5;
85
97
    m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableLauncherWhileLocked"] = true;
86
98
    m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableIndicatorsWhileLocked"] = true;
87
99
    m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["PasswordDisplayHint"] = AccountsService::Keyboard;