X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/92b178b7404b002778d8288353f65e27ee5de5dd..refs/heads/master:/src/admin/workerintegration.h diff --git a/src/admin/workerintegration.h b/src/admin/workerintegration.h index 0c87c2ecf..1e32c33d3 100644 --- a/src/admin/workerintegration.h +++ b/src/admin/workerintegration.h @@ -11,6 +11,7 @@ #include class DolphinMainWindow; +class DolphinViewContainer; class KActionCollection; class QAction; class QUrl; @@ -58,9 +59,18 @@ public: static void createActAsAdminAction(KActionCollection *actionCollection, DolphinMainWindow *dolphinMainWindow); /** - * Triggers the m_actAsAdminAction only if it is currently checked. + * An interface that only allows friend classes to show the WorkerIntegration::m_actAsAdminAction to users. + * Aside from these friend classes the action is only accessible through the actionCollection of DolphinMainWindow. */ - static void exitAdminMode(); + class FriendAccess + { + /** @returns WorkerIntegration::m_actAsAdminAction or crashes if WorkerIntegration::createActAsAdminAction() has not been called previously. */ + static QAction *actAsAdminAction(); + + friend class Bar; /// Allows the bar to access the actAsAdminAction, so users can use the bar to change who they are acting as. + friend DolphinViewContainer; // Allows the view container to access the actAsAdminAction, so the action can be shown to users when they are trying to + // view a folder for which they are lacking read permissions. + }; private: WorkerIntegration(DolphinMainWindow *parent, QAction *actAsAdminAction);