8#ifndef SRC_PROFILEINIT_H_
9#define SRC_PROFILEINIT_H_
11#include <QCoreApplication>
13#include <QProcessEnvironment>
32 Q_DECLARE_TR_FUNCTIONS(ProfileInit)
48 static auto needsInit(
const QString &path) -> bool;
69 static auto initialise(
const QString &dir,
const QList<UserInfo> &users,
71 QString *note) -> bool;
97 ProfileInit() =
default;
132 static auto writeGpgId(
const QString &gpgIdFile,
const QList<UserInfo> &users,
133 bool signed_, QString *note,
134 QByteArray *written =
nullptr) -> bool;
144 static auto signGpgId(
const QString &gpgIdFile,
const QByteArray &contents,
157 static auto commitGpgId(
const QString &dir,
const QString &gpgIdFile,
159 QString *note) -> bool;
174 const QStringList &args, QString *note) -> bool;
184 static auto refusedForGit(
const QString &dir,
const QStringList &files,
185 QString *note) -> bool;
static auto needsInit(const QString &path) -> bool
Check if a profile path needs initialization.
static auto refusedForGit(const QString &dir, const QStringList &files, QString *note) -> bool
Whether staging files in dir is refused because git could wait on something there for good: a ....
static auto initialise(const QString &dir, const QList< UserInfo > &users, const AppSettings &settings, bool useGit, QString *note) -> bool
Write the recipients and, if wanted, put the folder under git.
static auto entriesOnThisList(const QString &dir, bool viaPass) -> QStringList
The encrypted entries under dir that the new root list covers: visible regular .gpg files,...
static auto initGit(const QString &dir, const AppSettings &s, QString *note) -> bool
Put an existing store under Git: git init, stage the .gpg entries and the .gpg-id files (nothing else...
static auto commitGpgId(const QString &dir, const QString &gpgIdFile, const QString &sigFile, const AppSettings &s, QString *note) -> bool
git init in dir, stage the .gpg-id and its signature, and commit them (signed when pass....
static auto runGit(QProcess &git, const AppSettings &s, const QString &dir, const QStringList &args, QString *note) -> bool
Run one set-up git command on git and wait for it: init and add, which read what lies in the folder,...
static auto signingKeyUnavailable(const AppSettings &s, QString *note) -> bool
Whether the profile has a signing key whose secret key gpg does not hold, so no list may be written: ...
static auto gpgEnvironment(const AppSettings &s) -> QProcessEnvironment
The environment QtPass runs gpg in outside the active store's backend: the system's,...
static auto gitIdentityConfigured(const QString &dir, const AppSettings &s) -> bool
Whether git has a name and e-mail to commit with, i.e. user.name and user.email resolve (globally or ...
static auto writeGpgId(const QString &gpgIdFile, const QList< UserInfo > &users, bool signed_, QString *note, QByteArray *written=nullptr) -> bool
Write the enabled recipients to gpgIdFile, whole or not at all; with signed_ the list carries the gen...
static auto signGpgId(const QString &gpgIdFile, const QByteArray &contents, const AppSettings &s, QString *note) -> bool
Sign the list just written as gpgIdFile, over the bytes contents that were written.
Plain value-object holding all flat QtPass configuration.
Stores GPG key info including validity, creation date, and more.