From 19fdc5b67990bb75009a1fc511619bd449d559d7 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Sat, 13 Jul 2024 15:37:31 +0000 Subject: Stop acting as admin when the authorization expires Previously, the authorization just silently expired without any visible change. The surprise only came when the user tried to do any action, which immediately would show a password prompt. We don't want users to randomly type passwords into password prompts unexpectedly showing up. This commit avoids that. With this change, the view container visibly de-escalates privileges and shows a message explaining what happened. A method was implemented in kio-admin to make this possible. See: https://commits.kde.org/kio-admin/a2da29289d12ef845e2c1da17ed04c59f1c47762 This commit also improves some logic around the responsibility of hiding bars and activating view containers. This is also part of my project funded by the European Commission. --- src/dolphinviewcontainer.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/dolphinviewcontainer.h') diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h index 55d00a3b8..c5da6b48b 100644 --- a/src/dolphinviewcontainer.h +++ b/src/dolphinviewcontainer.h @@ -21,6 +21,8 @@ #include #include +#include + namespace Admin { class Bar; @@ -150,8 +152,9 @@ public: /** * Shows the message \message with the given type \messageType non-modal above the view-content. + * \buttonActions defines actions which the user can trigger as a response to this message. They are presented as buttons below the \message. */ - void showMessage(const QString &message, KMessageWidget::MessageType messageType); + void showMessage(const QString &message, KMessageWidget::MessageType messageType, std::initializer_list buttonActions = {}); /** * Refreshes the view container to get synchronized with the (updated) Dolphin settings. @@ -328,11 +331,6 @@ private Q_SLOTS: */ void showItemInfo(const KFileItem &item); - /** - * Sets the Admin::Bar visible or invisible based on whether \a url is an admin url. - */ - void updateAdminBarVisibility(const QUrl &url); - void closeFilterBar(); /** -- cgit v1.3