diff options
-rw-r--r-- | wizard.cpp | 8 | ||||
-rw-r--r-- | wizard.h | 9 |
2 files changed, 15 insertions, 2 deletions
@@ -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()) { @@ -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; |