|
QtPass 2.0.0
Developer documentation
|
QtPass is a multi-platform GUI for pass, the standard Unix password manager. This site documents its source code for people who work on it. QtPass has no public API: everything here, private members included, is described for contributors.
If you want to use QtPass rather than change it, https://qtpass.org/ and the Readme are the places to go.
Read these four classes first; almost everything else hangs off them.
The topics below group the remaining classes by what they are for.
QtPass can work a password store in two ways, chosen by the "use pass" setting.
Both derive from Pass, so the rest of the program does not know which one is active. PassBackendFactory constructs them on first use and picks one; QtPassSettings::getPass() is how callers reach it.
An operation in ImitatePass is usually several processes: an insert is gpg, then git add, then git commit. SimpleTransaction groups them so the operation is reported once, when its last process ends.
Nothing in the interface waits for a process. A call on Pass queues work and returns; the result arrives later as a signal.
Showing an entry, step by step:
An operation that queued a command ends in a finished... signal or in Pass::processErrorExit(), and code that disables part of the interface while it runs relies on that to be released again. Checks made before anything is queued are less uniform: some refusals emit Pass::processErrorExit() too, others only Pass::critical(). The signal descriptions in Pass say which.
A few things do not go through the queue. Executor::executeBlocking() runs a process and waits; it is for worker threads and for short probes. NativeGrep, the content search, decrypts on a thread of its own and reports through Pass::finishedGrep(). Re-encrypting a folder in ImitatePass runs on a worker thread as well.
Decrypted entries pass through this code, and several rules keep them from ending up where they should not. Please keep them when changing things.
The pages are generated by Doxygen from the comments in src/ and main/, from this page and from doxygen/groups.dox. The documentation job fails on any Doxygen warning, so run it before pushing:
Nothing printed means no warnings. Open docs/index.html to read the result.
What a comment needs:
Building, testing and the pull request workflow are described in CONTRIBUTING.md. The test coverage report shows which lines of src/ the tests run; it is rebuilt with these pages on every change to main.