Commit 036fd9d1 authored by David Edmundson's avatar David Edmundson
Browse files

[kcms/users] Avoid race condition on startup

If accounts service is not yet running the name will not be registered
when we make our first call.

We call into AccountsService from our client code with a blocking call.
We then create a new QDBusAbstractInterface on a given service.

QDBusAbstractInterface::isValid effectively is just a check that the
service is registered. This might not be processed yet at the time we
call this. It isn't a helpful check, if it wasn't up the previous call
to fetch users would have failed. We can just remove it.

BUG: 429314


(cherry picked from commit 987cafc2)
parent aafe500e
......@@ -117,7 +117,7 @@ void User::setPath(const QDBusObjectPath &path) {
if (!m_dbusIface.isNull()) delete m_dbusIface;
m_dbusIface = new OrgFreedesktopAccountsUserInterface(QStringLiteral("org.freedesktop.Accounts"), path.path(), QDBusConnection::systemBus(), this);
if (!m_dbusIface->isValid() || m_dbusIface->lastError().isValid() || m_dbusIface->systemAccount()) {
if (m_dbusIface->systemAccount()) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment