summaryrefslogtreecommitdiffstats
path: root/src/pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pass.cpp')
-rw-r--r--src/pass.cpp59
1 files changed, 27 insertions, 32 deletions
diff --git a/src/pass.cpp b/src/pass.cpp
index 65651c8a..785072e6 100644
--- a/src/pass.cpp
+++ b/src/pass.cpp
@@ -20,15 +20,13 @@ Pass::Pass() : wrapperRunning(false), env(QProcess::systemEnvironment()) {
connect(&exec, &Executor::starting, this, &Pass::startingExecuteWrapper);
}
-void Pass::executeWrapper(int id, const QString &app,
- const QStringList &args, bool readStdout,
- bool readStderr) {
+void Pass::executeWrapper(int id, const QString &app, const QStringList &args,
+ bool readStdout, bool readStderr) {
executeWrapper(id, app, args, QString(), readStdout, readStderr);
}
-void Pass::executeWrapper(int id, const QString &app,
- const QStringList &args, QString input,
- bool readStdout, bool readStderr) {
+void Pass::executeWrapper(int id, const QString &app, const QStringList &args,
+ QString input, bool readStdout, bool readStderr) {
QString d;
for (auto &i : args)
d += " " + i;
@@ -37,21 +35,21 @@ void Pass::executeWrapper(int id, const QString &app,
readStderr);
}
-void Pass::init(){
- #ifdef __APPLE__
- // If it exists, add the gpgtools to PATH
- if (QFile("/usr/local/MacGPG2/bin").exists())
- env.replaceInStrings("PATH=", "PATH=/usr/local/MacGPG2/bin:");
- // Add missing /usr/local/bin
- if (env.filter("/usr/local/bin").isEmpty())
- env.replaceInStrings("PATH=", "PATH=/usr/local/bin:");
- #endif
+void Pass::init() {
+#ifdef __APPLE__
+ // If it exists, add the gpgtools to PATH
+ if (QFile("/usr/local/MacGPG2/bin").exists())
+ env.replaceInStrings("PATH=", "PATH=/usr/local/MacGPG2/bin:");
+ // Add missing /usr/local/bin
+ if (env.filter("/usr/local/bin").isEmpty())
+ env.replaceInStrings("PATH=", "PATH=/usr/local/bin:");
+#endif
- if (!QtPassSettings::getGpgHome().isEmpty()) {
- QDir absHome(QtPassSettings::getGpgHome());
- absHome.makeAbsolute();
- env << "GNUPGHOME=" + absHome.path();
- }
+ if (!QtPassSettings::getGpgHome().isEmpty()) {
+ QDir absHome(QtPassSettings::getGpgHome());
+ absHome.makeAbsolute();
+ env << "GNUPGHOME=" + absHome.path();
+ }
}
/**
@@ -281,10 +279,9 @@ QString Pass::getRecipientString(QString for_file, QString separator,
* @param args
*/
void Pass::executePass(int id, const QStringList &args, QString input,
- bool readStdout ,bool readStderr)
-{
- executeWrapper(id, QtPassSettings::getPassExecutable(), args , input,
- readStdout, readStderr);
+ bool readStdout, bool readStderr) {
+ executeWrapper(id, QtPassSettings::getPassExecutable(), args, input,
+ readStdout, readStderr);
}
/**
@@ -292,18 +289,16 @@ void Pass::executePass(int id, const QStringList &args, QString input,
* @param args
*/
void Pass::executeGpg(int id, const QStringList &args, QString input,
- bool readStdout,bool readStderr)
-{
- executeWrapper(id, QtPassSettings::getGpgExecutable(), args, input,
- readStdout, readStderr);
+ bool readStdout, bool readStderr) {
+ executeWrapper(id, QtPassSettings::getGpgExecutable(), args, input,
+ readStdout, readStderr);
}
/**
* @brief Pass::executeGit easy wrapper for running git commands
* @param args
*/
void Pass::executeGit(int id, const QStringList &args, QString input,
- bool readStdout,bool readStderr)
-{
- executeWrapper(id, QtPassSettings::getGitExecutable(), args, input,
- readStdout, readStderr);
+ bool readStdout, bool readStderr) {
+ executeWrapper(id, QtPassSettings::getGitExecutable(), args, input,
+ readStdout, readStderr);
}