~ycheng-twn/ubuntu-system-settings/ubuntu-system-settings_4debug

« back to all changes in this revision

Viewing changes to src/accountsservice.cpp

  • Committer: CI bot
  • Author(s): Iain Lane
  • Date: 2014-07-11 16:12:13 UTC
  • mfrom: (774.3.2 as-activation)
  • Revision ID: ps-jenkins@lists.canonical.com-20140711161213-2nwfh9uhf3z1t9ud
[accountsservice] Don't guard D-Bus calls with isValid, because that doesn't work if the service has timed out. 
Approved by: Sebastien Bacher

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
             this,
46
46
             SLOT (slotNameOwnerChanged (QString, QString, QString)));
47
47
 
48
 
    if (m_accountsserviceIface.isValid()) {
49
 
        setUpInterface();
50
 
    }
 
48
    setUpInterface();
51
49
}
52
50
 
53
51
void AccountsService::slotChanged(QString interface,
101
99
QVariant AccountsService::getUserProperty(const QString &interface,
102
100
                                          const QString &property)
103
101
{
104
 
    if (!m_accountsserviceIface.isValid())
105
 
        return QVariant();
106
102
 
107
103
    QDBusInterface iface (
108
104
                "org.freedesktop.Accounts",
133
129
                "org.freedesktop.DBus.Properties",
134
130
                m_systemBusConnection,
135
131
                this);
136
 
    if (iface.isValid()) {
137
 
        // The value needs to be carefully wrapped
138
 
        iface.call("Set",
139
 
                   interface,
140
 
                   property,
141
 
                   QVariant::fromValue(QDBusVariant(value)));
142
 
    }
 
132
    // The value needs to be carefully wrapped
 
133
    iface.call("Set",
 
134
               interface,
 
135
               property,
 
136
               QVariant::fromValue(QDBusVariant(value)));
143
137
}
144
138
 
145
139
void AccountsService::customSetUserProperty(const QString &method,
151
145
                          m_systemBusConnection,
152
146
                          this);
153
147
 
154
 
    if (iface.isValid())
155
 
        iface.call(method, value);
156
 
 
 
148
    iface.call(method, value);
157
149
}