Commit 67904e21 authored by Marco Martin's avatar Marco Martin

don't show logout when kauthorized doesn't want it

BUG:380344
reviewed-by: kbroulik
parent 8b39e1a5
......@@ -47,6 +47,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <KPackage/Package>
#include <KPackage/PackageLoader>
#include <KAuthorized>
#include <KIconLoader>
#include <KLocalizedString>
#include <KUser>
......@@ -125,6 +126,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWindow* parent,
mapSpdMethods->insert(QStringLiteral("SuspendState"), QVariant::fromValue(spdMethods.contains(Solid::PowerManagement::SuspendState)));
mapSpdMethods->insert(QStringLiteral("HibernateState"), QVariant::fromValue(spdMethods.contains(Solid::PowerManagement::HibernateState)));
context->setContextProperty(QStringLiteral("spdMethods"), mapSpdMethods);
context->setContextProperty(QStringLiteral("canLogout"), KAuthorized::authorize(QStringLiteral("logout")));
QString bootManager = KConfig(QStringLiteral(KDE_CONFDIR "/kdm/kdmrc"), KConfig::SimpleConfig)
.group("Shutdown")
......
......@@ -150,6 +150,7 @@ PlasmaCore.ColorScope {
KeyNavigation.left: shutdownButton
KeyNavigation.right: suspendButton
focus: sdtype == ShutdownType.ShutdownTypeNone
visible: canLogout
}
}
......
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