7#include <QRegularExpression>
47 executePass(
PASS_SHOW, {
"show", file},
"",
true);
62 QStringList args = {
"insert",
"-m"};
73 executePass(
PASS_REMOVE, {
"rm", (isDir ?
"-rf" :
"-f"), file});
86 QString dirWithoutPassdir =
88 QStringList args = {
"init",
"--path=" + dirWithoutPassdir};
89 foreach (
const UserInfo &user, users) {
103 QFileInfo srcFileInfo = QFileInfo(src);
104 QFileInfo destFileInfo = QFileInfo(dest);
110 if (!force && srcFileInfo.isFile() && destFileInfo.isFile()) {
115 .relativeFilePath(QDir(src).absolutePath());
117 .relativeFilePath(QDir(dest).absolutePath());
120 if (srcFileInfo.isFile() && srcFileInfo.suffix() ==
"gpg") {
123 if (destFileInfo.isFile() && destFileInfo.suffix() ==
"gpg") {
144 QFileInfo srcFileInfo = QFileInfo(src);
145 QFileInfo destFileInfo = QFileInfo(dest);
150 if (!force && srcFileInfo.isFile() && destFileInfo.isFile()) {
155 .relativeFilePath(QDir(src).absolutePath());
157 .relativeFilePath(QDir(dest).absolutePath());
160 if (srcFileInfo.isFile() && srcFileInfo.suffix() ==
"gpg") {
163 if (destFileInfo.isFile() && destFileInfo.suffix() ==
"gpg") {
180void RealPass::executePass(
PROCESS id,
const QStringList &args, QString input,
181 bool readStdout,
bool readStderr) {
183 std::move(input), readStdout, readStderr);
static int executeBlocking(QString app, const QStringList &args, QString input=QString(), QString *process_out=Q_NULLPTR, QString *process_err=Q_NULLPTR)
Executor::executeBlocking blocking version of the executor, takes input and presents it as stdin.
void executeWrapper(PROCESS id, const QString &app, const QStringList &args, bool readStdout=true, bool readStderr=true)
static QString getPassStore(const QString &defaultValue=QVariant().toString())
static QString getPassExecutable(const QString &defaultValue=QVariant().toString())
virtual void Insert(QString file, QString newValue, bool overwrite=false) Q_DECL_OVERRIDE
RealPass::Insert pass insert.
virtual void OtpGenerate(QString file) Q_DECL_OVERRIDE
RealPass::OtpGenerate pass otp.
virtual void GitPull() Q_DECL_OVERRIDE
RealPass::GitPull pass git pull wrapper.
virtual void GitPush() Q_DECL_OVERRIDE
RealPass::GitPush pass git push wrapper.
virtual void Init(QString path, const QList< UserInfo > &users) Q_DECL_OVERRIDE
RealPass::Init initialize pass repository.
virtual void GitInit() Q_DECL_OVERRIDE
RealPass::GitInit pass git init wrapper.
virtual void Remove(QString file, bool isDir=false) Q_DECL_OVERRIDE
RealPass::Remove pass remove wrapper.
void Copy(const QString src, const QString dest, const bool force=false) Q_DECL_OVERRIDE
RealPass::Copy copy a file (or folder)
virtual void GitPull_b() Q_DECL_OVERRIDE
RealPass::GitInit pass git pull wrapper which blocks until process finishes.
void Move(const QString src, const QString dest, const bool force=false) Q_DECL_OVERRIDE
RealPass::Move move a file (or folder)
virtual void Show(QString file) Q_DECL_OVERRIDE
RealPass::Show pass show.
static const QRegularExpression & endsWithGpg()
Enumerators for configuration and runtime items.
Stores key info lines including validity, creation date and more.
bool enabled
UserInfo::enabled.
QString key_id
UserInfo::key_id hexadecimal representation.