From d3e07d1e41fb8b8fdde5cba6d804bc5bdac761e0 Mon Sep 17 00:00:00 2001 From: nils Date: Fri, 4 Nov 2011 08:30:55 +0000 Subject: import from gnupg in wizard home works in windows now (still untested, but it should work) git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@599 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- wizard.cpp | 8 ++++++-- wizard.h | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/wizard.cpp b/wizard.cpp index 5bb6823..3d4162c 100644 --- a/wizard.cpp +++ b/wizard.cpp @@ -170,8 +170,12 @@ QString ImportPage::getGnuPGHome() { QString gnuPGHome=""; #ifdef _WIN32 - QSettings gnuPGsettings("HKEY_CURRENT_USER\\Software\\GNU\\GNUPG\\Default", QSettings::Nativeformat); - gnuPGsettings.value(); + QSettings gnuPGsettings("HKEY_CURRENT_USER\\Software\\GNU\\GNUPG", QSettings::NativeFormat); + gnuPGHome = gnuPGsettings.value("HomeDir").toString(); + if (gnuPGHome.isEmpty()) { + return NULL; + } + #else gnuPGHome=QDir::homePath()+"/.gnupg"; if (! QFile(gnuPGHome).exists()) { diff --git a/wizard.h b/wizard.h index 73dd38e..7e9601e 100644 --- a/wizard.h +++ b/wizard.h @@ -80,10 +80,19 @@ public: ImportPage(GpgME::GpgContext *ctx, QWidget *parent = 0); private slots: + /** + * @details Import keys from gnupg-homedir, private or/and public depend on the checked boxes + */ bool importKeys(); private: int nextId() const; + + /** + * @details String containing the gnupg-homedir + * @returns String containg the gnupg-homedir, but NULL, if the in windows registry entry + * doesn't exist or in linux ~/.gnupg doesn't exist + */ QString getGnuPGHome(); QLabel *topLabel; -- cgit v1.2.3