QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
pass.cpp File Reference
#include "pass.h"
#include "gpgkeystate.h"
#include "helpers.h"
#include "qtpasssettings.h"
#include "util.h"
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
#include <QFileInfo>
#include <QProcess>
#include <QRandomGenerator>
#include <QRegularExpression>
#include <algorithm>
#include <utility>
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.
auto parseGrepOutput (const QString &rawOut) -> QList< QPair< QString, QStringList > >
 Parses 'pass grep' raw output into (entry, matches) pairs.

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.

Examples
/home/runner/work/QtPass/QtPass/src/pass.cpp.

Definition at line 507 of file pass.cpp.

◆ parseGrepOutput()

auto parseGrepOutput ( const QString & rawOut) -> QList< QPair< QString, QStringList > >

Parses 'pass grep' raw output into (entry, matches) pairs.

pass grep emits ANSI blue color (\x1B[94m) at the start of each entry header line. This is checked before stripping ANSI so headers are detected reliably regardless of locale.

Examples
/home/runner/work/QtPass/QtPass/src/pass.cpp.

Definition at line 568 of file pass.cpp.