QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
pass.cpp File Reference

Implements what both backends share: the environment the store's processes run in, the refusals for links and paths outside the store, .gpg- id lookup, and Pass::finished(), which routes each finished process to its signal. More...

#include "pass.h"
#include "gpgidgeneration.h"
#include "gpgidsigner.h"
#include "gpgkeystate.h"
#include "pathvalidator.h"
#include "processinfo.h"
#include "util.h"
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QHash>
#include <QLocale>
#include <QProcess>
#include <QRandomGenerator>
#include <QRegularExpression>
#include <QTextStream>
#include <array>
#include <optional>
#include <utility>
#include "qtpasslogging.h"
Include dependency graph for pass.cpp:

Go to the source code of this file.

Functions

auto gpgErrorMessage (const QString &err) -> QString
 Maps GPG stderr (which may include –status-fd 2 tokens) to a translated user-friendly encryption error string.

Detailed Description

Implements what both backends share: the environment the store's processes run in, the refusals for links and paths outside the store, .gpg- id lookup, and Pass::finished(), which routes each finished process to its signal.

Definition in file pass.cpp.

Function Documentation

◆ gpgErrorMessage()

auto gpgErrorMessage ( const QString & err)

Maps GPG stderr (which may include –status-fd 2 tokens) to a translated user-friendly encryption error string.

Checks machine-readable [GNUPG:] status tokens first (locale-independent), then falls back to case-insensitive substring matching for GPG builds that do not emit status tokens. Returns an empty string when no known pattern matches.

Declared here so it can be exercised by unit tests without linking the full Pass object.

Parameters
errgpg's stderr, with or without [GNUPG:] status lines.
Returns
A translated message, or an empty string for an error it does not recognise.

Definition at line 471 of file pass.cpp.

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