return GTK_WIDGET(viewer->textview->vbox);
}
-static gchar *_get_gpg_executable_name()
-{
- gpgme_engine_info_t e;
-
- if (!gpgme_get_engine_info(&e)) {
- while (e != NULL) {
- if (e->protocol == GPGME_PROTOCOL_OpenPGP
- && e->file_name != NULL) {
- debug_print("Found gpg executable: '%s'\n", e->file_name);
- return e->file_name;
- }
- }
- }
-
- return NULL;
-}
-
#ifdef G_OS_WIN32
struct _ImportCtx {
gboolean done;
}
gpgme_get_key(ctx, sig->fpr, &key, 0);
if (!key) {
- gchar *gpgbin = _get_gpg_executable_name();
- gchar *cmd = g_strdup_printf("\"%s\" --no-tty --recv-keys %s",
+ gchar *gpgbin = get_gpg_executable_name();
+ gchar *cmd = g_strdup_printf("\"%s\" --batch --no-tty --recv-keys %s",
(gpgbin ? gpgbin : "gpg"), sig->fpr);
AlertValue val = G_ALERTDEFAULT;
if (!prefs_common_get_prefs()->work_offline) {
gchar **argv;
argv = strsplit_with_quote(cmd, " ", 0);
res = execvp(argv[0], argv);
+ perror("execvp");
exit(255);
} else {
int status = 0;
ctx->exitcode = STILL_ACTIVE;
ctx->cmd = cmd;
- if (pthread_create(&pt, PTHREAD_CREATE_JOINABLE,
+ if (pthread_create(&pt, NULL,
_import_threaded, (void *)ctx) != 0) {
debug_print("Couldn't create thread, continuing unthreaded.\n");
_import_threaded(ctx);
return;
} else {
TEXTVIEW_INSERT(_("\n Key ID "));
+
+#if defined GPGME_VERSION_NUMBER && GPGME_VERSION_NUMBER >= 0x010700
+ TEXTVIEW_INSERT(key->fpr);
+#else
TEXTVIEW_INSERT(sig->fpr);
+#endif
+
TEXTVIEW_INSERT(":\n\n");
TEXTVIEW_INSERT(_(" This key is in your keyring.\n"));
}