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

Pass, the abstract password-store backend that RealPass and ImitatePass implement, and gpgErrorMessage(), which turns gpg's stderr into a message for the user. More...

#include "appsettings.h"
#include "enums.h"
#include "executor.h"
#include "gpgidgeneration.h"
#include "userinfo.h"
#include <QProcess>
#include <QProcessEnvironment>
#include <QQueue>
#include <QString>
#include <QStringList>
#include <cassert>
#include <map>
#include <optional>
Include dependency graph for pass.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ResolvedGpgconfCommand
 Represents a command invocation for gpgconf operations. More...
class  Pass
 Abstract base class for password store operations. More...
struct  Pass::RecipientsForEditing
 What a dialog may do with the list of a folder (recipientsForEditing()). More...

Functions

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

Detailed Description

Pass, the abstract password-store backend that RealPass and ImitatePass implement, and gpgErrorMessage(), which turns gpg's stderr into a message for the user.

Definition in file pass.h.

Function Documentation

◆ gpgErrorMessage()

QString 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: