diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2015-05-05 03:26:47 +0200 |
---|---|---|
committer | Anne Jan Brouwer <annejan@noprotocol.com> | 2015-05-05 03:26:47 +0200 |
commit | efe9a5ca9f5c34f406adf927c265e9ef0682da72 (patch) | |
tree | bde1669936f28e1a19e2041771d630f8443842e0 | |
parent | b690cf3627e2fa364d699b6dfb4bc8afd9d83a2f (diff) |
test fix for mac
-rw-r--r-- | main.cpp | 2 | ||||
-rw-r--r-- | mainwindow.cpp | 11 | ||||
-rw-r--r-- | qtpass.pro | 16 |
3 files changed, 17 insertions, 12 deletions
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) QCoreApplication::setOrganizationName("IJHack"); QCoreApplication::setOrganizationDomain("ijhack.org"); QCoreApplication::setApplicationName("QtPass"); - QCoreApplication::setApplicationVersion("0.1.0"); + QCoreApplication::setApplicationVersion("0.8.0"); //Setup and load translator for localization QTranslator translator; diff --git a/mainwindow.cpp b/mainwindow.cpp index f58f7305..bd3ad081 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -318,7 +318,7 @@ void MainWindow::on_treeView_clicked(const QModelIndex &index) if (usePass) { executePass('"' + file + '"'); } else { - executeWrapper(gpgExecutable , "--no-tty --use-agent -dq \"" + file + '"'); + executeWrapper(gpgExecutable , "-d --quiet --yes --no-encrypt-to --batch --use-agent \"" + file + '"'); } } } @@ -348,13 +348,18 @@ void MainWindow::executeWrapper(QString app, QString args, QString input) { } wrapperRunning = true; process->setWorkingDirectory(passStore); + QStringList env = QProcess::systemEnvironment(); if (!gpgHome.isEmpty()) { - QStringList env = QProcess::systemEnvironment(); QDir absHome(gpgHome); absHome.makeAbsolute(); env << "GNUPGHOME=" + absHome.path(); - process->setEnvironment(env); } +#ifdef __APPLE__ + // TODO needs check to see if path exists or some other handling!! + env.replaceInStrings("PATH=", "PATH=/usr/local/MacGPG2/bin:"); +#endif + //QMessageBox::information(this, "env", env.join("\n")); + process->setEnvironment(env); ui->textBrowser->clear(); ui->textBrowser->setTextColor(Qt::black); enableUiElements(false); @@ -34,12 +34,12 @@ FORMS += mainwindow.ui \ usersdialog.ui nosingleapp { -QMAKE_CXXFLAGS += -DSINGLE_APP=0 + QMAKE_CXXFLAGS += -DSINGLE_APP=0 } else { -SOURCES += singleapplication.cpp -HEADERS += singleapplication.h -QT += network -QMAKE_CXXFLAGS += -DSINGLE_APP=1 + SOURCES += singleapplication.cpp + HEADERS += singleapplication.h + QT += network + QMAKE_CXXFLAGS += -DSINGLE_APP=1 } TRANSLATIONS += localization/localization_nl_NL.ts \ @@ -51,7 +51,7 @@ TRANSLATIONS += localization/localization_nl_NL.ts \ localization/localization_pl_PL.ts \ localization/localization_ru_RU.ts -RESOURCES += resources.qrc +RESOURCES += resources.qrc win32 { RC_FILE = windows.rc @@ -59,7 +59,7 @@ win32 { QMAKE_LFLAGS += -static-libgcc -static-libstdc++ } QMAKE_LFLAGS += -Wl,--dynamicbase -Wl,--nxcompat - LIBS += -lmpr + LIBS += -lmpr } else:macx { ICON = artwork/icon.icns } @@ -68,4 +68,4 @@ OTHER_FILES += LICENSE \ README.md target.path = /usr/local/bin/ -INSTALLS += target +INSTALLS += target |