diff options
-rw-r--r-- | gpg4usb.pro | 8 | ||||
-rw-r--r-- | gpgcontext.cpp | 3 | ||||
-rw-r--r-- | main.cpp | 8 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gpg4usb.pro b/gpg4usb.pro index dec67fc..d21c606 100644 --- a/gpg4usb.pro +++ b/gpg4usb.pro @@ -11,6 +11,8 @@ DEPENDPATH += . INCLUDEPATH += . \ ./include +#DEFINES += GPG4USB_NON_PORTABLE + #CONFIG += release static CONFIG += debug QT += network @@ -90,4 +92,8 @@ TRANSLATIONS = release/ts/gpg4usb_en.ts \ release/ts/gpg4usb_vi.ts \ release/ts/gpg4usb_my.ts \ release/ts/gpg4usb_fa_IR.ts - + + +contains(DEFINES, GPG4USB_NON_PORTABLE) { + message(Building non portable version...) +} diff --git a/gpgcontext.cpp b/gpgcontext.cpp index e28ce41..89a6bab 100644 --- a/gpgcontext.cpp +++ b/gpgcontext.cpp @@ -75,11 +75,12 @@ GpgContext::GpgContext() /* err = gpgme_ctx_set_engine_info(mCtx, GPGME_PROTOCOL_OpenPGP, gpgBin.toUtf8().constData(), gpgKeys.toUtf8().constData());*/ +#ifndef GPG4USB_NON_PORTABLE err = gpgme_ctx_set_engine_info(mCtx, GPGME_PROTOCOL_OpenPGP, gpgBin.toLocal8Bit().constData(), gpgKeys.toLocal8Bit().constData()); checkErr(err); - +#endif /** Setting the output type must be done at the beginning */ /** think this means ascii-armor --> ? */ @@ -49,6 +49,8 @@ int main(int argc, char *argv[]) #endif qDebug() << getenv("GNUPGHOME"); + +#ifndef GPG4USB_NON_PORTABLE // take care of gpg not creating directorys on harddisk putenv(QString("GNUPGHOME=" + appPath + "/keydb").toAscii().data()); @@ -57,6 +59,12 @@ int main(int argc, char *argv[]) // specify default path & format for QSettings QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, appPath); +#else + // in non portable conf should go to ~/.conf/gpg4usb + app.setOrganizationName("gpg4usb"); + qDebug() << "gpg4usb non portable build"; +#endif + QSettings::setDefaultFormat(QSettings::IniFormat); QSettings settings; |