[polkit-1] Simplify Polkit1Backend action exists lookup
ClosedPublic

Authored by davidedmundson on Feb 10 2020, 12:21 PM.

Details

Summary

Now that isValid() is on demand, and actionStatus is correct, we don't
need to query every possible action.

We will call setupAction which will query the state of this action when
the action is constructed. This will in turn tell us if it is valid
using the existing AuthStatus value.

This means we have all the information available without having to fetch
a whole list, simplifying the code, getting rid of a pseudo-blocking
large DBus call and an event loop all at once.

This mostly completes T12643 within KF5 with no behavioural changes for clients.

Test Plan

Ran sddmthemeinstaller -i got an auth prompt
edited sddmthemeinstaller to an invalid name. Got an error "trying to start an invalid action"

Unit tests pass

Diff Detail

Repository
R283 KAuth
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 10 2020, 12:21 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Feb 10 2020, 12:21 PM
broulik accepted this revision.Feb 10 2020, 1:41 PM
This revision is now accepted and ready to land.Feb 10 2020, 1:41 PM
This revision was automatically updated to reflect the committed changes.