QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
PassBackendFactory Class Reference

Owns the Pass backend lifecycle (RealPass vs ImitatePass). More...

#include <passbackendfactory.h>

Collaboration diagram for PassBackendFactory:

Static Public Member Functions

static auto getPass () -> Pass *
 Get the active backend, constructing and initialising it on first use after construction or invalidation.
static auto getRealPass () -> RealPass *
 Get the lazily-constructed RealPass backend.
static auto getImitatePass () -> ImitatePass *
 Get the lazily-constructed ImitatePass backend.
static void invalidate ()
 Forget the currently active backend.
static auto isIdle () -> bool
 Whether neither backend runs or waits for anything: after a switch of backend the previous one is kept, with its own queue. Backends not constructed yet count as idle (none is constructed here).

Private Member Functions

 PassBackendFactory ()=default
 Not constructible; the class has only static members.

Static Private Attributes

static Pass * pass = nullptr
 The backend getPass() last selected; null until the first call and again after invalidate(). Points at one of the two below.
static QScopedPointer< RealPass > realPass
 The pass backend, constructed on first use.
static QScopedPointer< ImitatePass > imitatePass
 The gpg and git backend, constructed on first use.

Detailed Description

Owns the Pass backend lifecycle (RealPass vs ImitatePass).

Extracted from QtPassSettings, which conflated settings storage with deciding and caching which password-store backend is active. The factory lazily constructs the two concrete backends, hands out the active one based on the configured mode, and exposes invalidate() so a settings change can force the active backend to be re-selected on next use.

Definition at line 29 of file passbackendfactory.h.

Member Function Documentation

◆ getImitatePass()

auto PassBackendFactory::getImitatePass ( ) -> ImitatePass *
static

Get the lazily-constructed ImitatePass backend.

Returns
Pointer to the ImitatePass instance.

Definition at line 48 of file passbackendfactory.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPass()

auto PassBackendFactory::getPass ( ) -> Pass *
static

Get the active backend, constructing and initialising it on first use after construction or invalidation.

Returns
Pointer to the active Pass backend (RealPass when "use pass" is enabled, otherwise ImitatePass).

Definition at line 22 of file passbackendfactory.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRealPass()

auto PassBackendFactory::getRealPass ( ) -> RealPass *
static

Get the lazily-constructed RealPass backend.

Returns
Pointer to the RealPass instance.

Definition at line 41 of file passbackendfactory.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invalidate()

void PassBackendFactory::invalidate ( )
static

Forget the currently active backend.

The next getPass() call re-selects and re-initialises a backend. Call after changing the "use pass" setting so the switch takes effect.

Definition at line 62 of file passbackendfactory.cpp.

Here is the caller graph for this function:

◆ isIdle()

auto PassBackendFactory::isIdle ( ) -> bool
static

Whether neither backend runs or waits for anything: after a switch of backend the previous one is kept, with its own queue. Backends not constructed yet count as idle (none is constructed here).

Returns
true when every constructed backend is idle.

Definition at line 57 of file passbackendfactory.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ imitatePass

QScopedPointer< ImitatePass > PassBackendFactory::imitatePass
staticprivate

The gpg and git backend, constructed on first use.

Definition at line 76 of file passbackendfactory.h.

◆ pass

Pass * PassBackendFactory::pass = nullptr
staticprivate

The backend getPass() last selected; null until the first call and again after invalidate(). Points at one of the two below.

Definition at line 68 of file passbackendfactory.h.

◆ realPass

QScopedPointer< RealPass > PassBackendFactory::realPass
staticprivate

The pass backend, constructed on first use.

Definition at line 74 of file passbackendfactory.h.


The documentation for this class was generated from the following files: