aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-accounts.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-accounts.c')
-rw-r--r--mail/mail-accounts.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index 3e2452db0f..5d7945c614 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -637,19 +637,12 @@ timeout_changed (GtkEntry *entry, gpointer data)
static void
pgp_path_changed (GtkEntry *entry, gpointer data)
{
- const char *path, *bin;
- CamelPgpType type = CAMEL_PGP_TYPE_NONE;
+ CamelPgpType type;
+ const char *path;
path = gtk_entry_get_text (entry);
- bin = g_basename (path);
-
- /* FIXME: This detection should be better */
- if (!strcmp (bin, "pgp"))
- type = CAMEL_PGP_TYPE_PGP2;
- else if (!strcmp (bin, "pgpv") || !strcmp (bin, "pgpe") || !strcmp (bin, "pgpk") || !strcmp (bin, "pgps"))
- type = CAMEL_PGP_TYPE_PGP5;
- else if (!strncmp (bin, "gpg", 3))
- type = CAMEL_PGP_TYPE_GPG;
+
+ type = mail_config_pgp_type_detect_from_path (path);
mail_config_set_pgp_path (path && *path ? path : NULL);
mail_config_set_pgp_type (type);