Commit b6ff3647 authored by Tomi Leppänen's avatar Tomi Leppänen

Stop monitoring seat changes if uid is set

Technically it would be possible to create UserInfo object in QML before
activation has happened and then set it's uid to another user. In
practice that's quite unusual thing to do. Previously it would have
replaced the user with current user but now it just stops monitoring for
changes instead.
Signed-off-by: Tomi Leppänen's avatarTomi Leppänen <tomi.leppanen@jolla.com>
parent 5638f15e
......@@ -564,6 +564,11 @@ void UserInfo::waitForActivation()
auto *notifier = new QSocketNotifier(fd, QSocketNotifier::Read, this);
connect(notifier, &QSocketNotifier::activated, this, [this, notifier, monitor](int socket) {
Q_UNUSED(socket)
if (uid() != (int)UnknownCurrentUserId) {
// This user has been changed to someone else already, stop monitoring
qCDebug(lcUsersLog) << "UserInfo uid had been changed";
notifier->deleteLater();
}
// Check if seat0 has got active user
uid_t uid = InvalidId;
if (sd_seat_get_active("seat0", NULL, &uid) >= 0 && uid != InvalidId) {
......
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