Skip to content

Commit

Permalink
Use same status for guest user with user-managerd
Browse files Browse the repository at this point in the history
Otherwise UI and user-managerd may be out of sync which can cause some
weird glitches.

Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
  • Loading branch information
Tomin1 committed Aug 11, 2020
1 parent bfb1776 commit f8f62d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/usermodel.cpp
Expand Up @@ -42,6 +42,7 @@
#include <QString>
#include <functional>
#include <grp.h>
#include <pwd.h>
#include <sailfishaccesscontrol.h>
#include <sailfishusermanagerinterface.h>
#include <sys/types.h>
Expand Down Expand Up @@ -80,7 +81,7 @@ UserModel::UserModel(QObject *parent)
, m_dBusInterface(nullptr)
, m_dBusWatcher(new QDBusServiceWatcher(UserManagerService, QDBusConnection::systemBus(),
QDBusServiceWatcher::WatchForRegistration | QDBusServiceWatcher::WatchForUnregistration, this))
, m_guestEnabled(false)
, m_guestEnabled(getpwuid((uid_t)SAILFISH_USERMANAGER_GUEST_UID))
{
qDBusRegisterMetaType<SailfishUserManagerEntry>();
connect(m_dBusWatcher, &QDBusServiceWatcher::serviceRegistered,
Expand All @@ -98,9 +99,6 @@ UserModel::UserModel(QObject *parent)
if (user.isValid()) { // Skip invalid users here
m_users.append(user);
m_uidsToRows.insert(user.uid(), m_users.count()-1);

if (!m_guestEnabled && user.uid() == SAILFISH_USERMANAGER_GUEST_UID)
m_guestEnabled = true;
}
}
}
Expand Down

0 comments on commit f8f62d9

Please sign in to comment.