Commit 08178c05 authored by Fabian Vogt's avatar Fabian Vogt
Browse files

Load user information once on startup

Summary:
Apparently the seccomp filter can break KUser in certain setups, so load the
info before the sandbox is active.

Test Plan:
Provided a test package to the reporter on the downstream bug
(https://bugzilla.opensuse.org/show_bug.cgi?id=1160995), who reported
success.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26722
parent 078d9ebd
......@@ -196,6 +196,11 @@ void UnlockApp::initialize()
m_lnfIntegration->setConfig(KScreenSaverSettings::self()->sharedConfig());
m_lnfIntegration->init();
const KUser user;
const QString fullName = user.property(KUser::FullName).toString();
m_userName = fullName.isEmpty() ? user.loginName() : fullName;
m_userImage = user.faceIconPath();
installEventFilter(this);
}
......@@ -297,11 +302,9 @@ void UnlockApp::desktopResized()
// engine stuff
QQmlContext* context = view->engine()->rootContext();
const KUser user;
const QString fullName = user.property(KUser::FullName).toString();
context->setContextProperty(QStringLiteral("kscreenlocker_userName"), fullName.isEmpty() ? user.loginName() : fullName);
context->setContextProperty(QStringLiteral("kscreenlocker_userImage"), user.faceIconPath());
context->setContextProperty(QStringLiteral("kscreenlocker_userName"), m_userName);
context->setContextProperty(QStringLiteral("kscreenlocker_userImage"), m_userImage);
context->setContextProperty(QStringLiteral("authenticator"), m_authenticator);
context->setContextProperty(QStringLiteral("org_kde_plasma_screenlocker_greeter_interfaceVersion"), 2);
context->setContextProperty(QStringLiteral("org_kde_plasma_screenlocker_greeter_view"), view);
......
......@@ -110,6 +110,7 @@ private:
bool m_canSuspend = false;
bool m_canHibernate = false;
QString m_userName, m_userImage;
KWayland::Client::ConnectionThread *m_ksldConnection = nullptr;
KWayland::Client::Registry *m_ksldRegistry = nullptr;
......
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