[balsa] Remove option to build with GnomeKeyring



commit 1edb64b1470245c9b9e301f4ea592a7fe72bcf47
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Sep 19 18:05:34 2017 -0400

    Remove option to build with GnomeKeyring
    
    Remove obsolete option to build with deprecated GnomeKeyring
    
        * configure.ac: do not check for the lib and do not define
        HAVE_GNOME_KEYRING and friends.
        * libbalsa/imap-server.c (libbalsa_imap_server_new_from_config):
        do not use it.
        * libbalsa/server.c (libbalsa_server_load_config),
        (libbalsa_server_save_config): ditto.
        * libbalsa/server.h: ditto.
        * src/balsa-app.c (ask_password_real): ditto.
        * src/folder-conf.c (folder_conf_imap_node): ditto.
        * src/mailbox-conf.c (create_imap_mailbox_dialog): ditto.

 ChangeLog              |   15 +++++++++++++
 configure.ac           |   25 -----------------------
 libbalsa/imap-server.c |   33 ------------------------------
 libbalsa/server.c      |   52 ------------------------------------------------
 libbalsa/server.h      |   10 ---------
 src/balsa-app.c        |    3 --
 src/folder-conf.c      |    3 --
 src/mailbox-conf.c     |    3 --
 8 files changed, 15 insertions(+), 129 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index aa5edfd..98eea9d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
 2017-09-19  Peter Bloomfield  <pbloomfield bellsouth net>
 
+       Remove obsolete option to build with deprecated GnomeKeyring
+
+       * configure.ac: do not check for the lib and do not define
+       HAVE_GNOME_KEYRING and friends.
+       * libbalsa/imap-server.c (libbalsa_imap_server_new_from_config):
+       do not use it.
+       * libbalsa/server.c (libbalsa_server_load_config),
+       (libbalsa_server_save_config): ditto.
+       * libbalsa/server.h: ditto.
+       * src/balsa-app.c (ask_password_real): ditto.
+       * src/folder-conf.c (folder_conf_imap_node): ditto.
+       * src/mailbox-conf.c (create_imap_mailbox_dialog): ditto.
+
+2017-09-19  Peter Bloomfield  <pbloomfield bellsouth net>
+
        HAVE_GNOME is redundant
 
        * configure.ac: do not define it.
diff --git a/configure.ac b/configure.ac
index 44ce414..8144000 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,26 +233,8 @@ dnl #####################################################################
 
 if test x$with_gnome != xno; then
    TOOLKIT_CATEGORIES="GNOME;GTK;"
-   gnome_extras="$gnome_extras gio-unix-2.0"
-   if test x$with_libsecret == xno; then
-     AC_MSG_CHECKING([whether we have gnome-keyring])
-     if $PKG_CONFIG --atleast-version=1.0 gnome-keyring-1; then
-        gnome_extras="$gnome_extras gnome-keyring-1"
-        AC_DEFINE(HAVE_GNOME_KEYRING,1,[Defined when gnome-keyring is there.])
-        # Work around http://bugzilla.gnome.org/show_bug.cgi?id=556530
-        if $PKG_CONFIG --atleast-version=2.24.1 gnome-keyring-1; then
-           AC_DEFINE(HAVE_GNOME_KEYRING_24,1,
-                     [Defined with gnome-keyring-2.24 or newer.])
-        fi
-        with_gnome_keyring=yes
-     else
-        with_gnome_keyring=no
-     fi
-     AC_MSG_RESULT($with_gnome_keyring)
-   fi
 else
    TOOLKIT_CATEGORIES="GTK;"
-   gnome_extras=""
 fi
 AC_SUBST(TOOLKIT_CATEGORIES)
 
@@ -270,14 +252,12 @@ gmime-2.6
 gio-2.0
 gthread-2.0
 gnutls
-$gnome_extras
 ])
 
 PKG_CHECK_MODULES(BALSA_AB, [
    glib-2.0
    gtk+-3.0
    gmime-2.6
-   $gnome_extras
 ])
 
 PKG_CHECK_MODULES(LIBNETCLIENT, [
@@ -809,11 +789,6 @@ if test x"$BALSA_FROM_GIT" = xyes ; then
        echo "or just plain not work. Use it at your own risk. You have been warned."
        echo "======================================================================"
        echo ""
-        if test x$with_gnome_keyring == xyes ; then
-            AC_MSG_ERROR([Cannot build in a git tree with deprecated GnomeKeyring.
-                  Either install and configure with libsecret
-                  or configure --without-gnome.])
-        fi
 fi
 
 if test x"$use_html_widget" = xwebkit ; then
diff --git a/libbalsa/imap-server.c b/libbalsa/imap-server.c
index 4c072cb..6a8ad02 100644
--- a/libbalsa/imap-server.c
+++ b/libbalsa/imap-server.c
@@ -32,8 +32,6 @@
 
 #if defined(HAVE_LIBSECRET)
 #include <libsecret/secret.h>
-#elif defined(HAVE_GNOME_KEYRING)
-#include <gnome-keyring.h>
 #endif                          /* defined(HAVE_LIBSECRET) */
 
 #include "libbalsa.h"
@@ -553,37 +551,6 @@ libbalsa_imap_server_new_from_config(void)
                     }
                 }
             }
-#elif defined (HAVE_GNOME_KEYRING)
-           GnomeKeyringResult r;
-           server->passwd = NULL;
-           r = gnome_keyring_find_password_sync(LIBBALSA_SERVER_KEYRING_SCHEMA,
-                                                &server->passwd,
-                                                "protocol", server->protocol,
-                                                "server", server->host,
-                                                "user", server->user,
-                                                NULL);
-           if(r != GNOME_KEYRING_RESULT_OK) {
-               gnome_keyring_free_password(server->passwd);
-               server->passwd = NULL;
-               printf("Keyring has no password for %s@%s\n",
-                      server->user, server->host);
-               server->passwd = libbalsa_conf_private_get_string("Password");
-               if (server->passwd != NULL) {
-                   gchar *buff = libbalsa_rot(server->passwd);
-                   libbalsa_free_password(server->passwd);
-                   server->passwd = buff;
-                   gnome_keyring_store_password_sync
-                        (LIBBALSA_SERVER_KEYRING_SCHEMA, NULL,
-                         _("Balsa passwords"), server->passwd,
-                         "protocol", server->protocol,
-                         "server", server->host,
-                         "user", server->user,
-                         NULL);
-                   /* We could in principle clear the password in the
-                      config file here but we do not for the backward
-                      compatibility. */
-               }
-           }
 #else
             server->passwd = libbalsa_conf_private_get_string("Password");
            if (server->passwd != NULL) {
diff --git a/libbalsa/server.c b/libbalsa/server.c
index a3914c2..7b62f25 100644
--- a/libbalsa/server.c
+++ b/libbalsa/server.c
@@ -28,8 +28,6 @@
 
 #if defined(HAVE_LIBSECRET)
 #include <libsecret/secret.h>
-#elif defined(HAVE_GNOME_KEYRING)
-#include <gnome-keyring.h>
 #endif                          /* defined(HAVE_LIBSECRET) */
 
 #include <openssl/err.h>
@@ -51,18 +49,6 @@ static const SecretSchema server_schema = {
     }
 };
 const SecretSchema *LIBBALSA_SERVER_SECRET_SCHEMA = &server_schema;
-#elif defined(HAVE_GNOME_KEYRING) && !defined(HAVE_GNOME_KEYRING_24)
-static const GnomeKeyringPasswordSchema server_schema = {
-    GNOME_KEYRING_ITEM_GENERIC_SECRET,
-    {
-       { "protocol", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
-       { "server",   GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
-       { "user",     GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
-       { NULL, 0 }
-    }
-};
-const GnomeKeyringPasswordSchema* LIBBALSA_SERVER_KEYRING_SCHEMA =
-    &server_schema;
 #endif                          /* defined(HAVE_LIBSECRET) */
 
 static GObjectClass *parent_class = NULL;
@@ -391,35 +377,6 @@ libbalsa_server_load_config(LibBalsaServer * server)
                 }
             }
         }
-#elif defined (HAVE_GNOME_KEYRING)
-       GnomeKeyringResult res =
-           gnome_keyring_find_password_sync(LIBBALSA_SERVER_KEYRING_SCHEMA,
-                                            &server->passwd,
-                                            "protocol", server->protocol,
-                                            "server", server->host,
-                                            "user", server->user,
-                                            NULL);
-       if(res != GNOME_KEYRING_RESULT_OK) {
-           gnome_keyring_free_password(server->passwd);
-           server->passwd = NULL;
-           printf("Error retrieving password from key ring. Falling back\n");
-           server->passwd = libbalsa_conf_private_get_string("Password");
-           if (server->passwd != NULL) {
-               gchar *buff = libbalsa_rot(server->passwd);
-               libbalsa_free_password(server->passwd);
-               server->passwd = buff;
-               gnome_keyring_store_password_sync
-                   (LIBBALSA_SERVER_KEYRING_SCHEMA, NULL,
-                    _("Balsa passwords"), server->passwd,
-                    "protocol", server->protocol,
-                    "server", server->host,
-                    "user", server->user,
-                    NULL);
-                   /* We could in principle clear the password in the
-                      config file here but we do not for the backward
-                      compatibility. */
-           }
-       }
 #else
        server->passwd = libbalsa_conf_private_get_string("Password");
        if (server->passwd != NULL) {
@@ -479,15 +436,6 @@ libbalsa_server_save_config(LibBalsaServer * server)
                    server->user, server->host, err->message);
             g_error_free(err);
         }
-#elif defined (HAVE_GNOME_KEYRING)
-       gnome_keyring_store_password_sync(LIBBALSA_SERVER_KEYRING_SCHEMA,
-                                    NULL,
-                                    _("Balsa passwords"),
-                                    server->passwd,
-                                    "protocol", server->protocol,
-                                    "server", server->host,
-                                    "user", server->user,
-                                    NULL);
 #else
        gchar *buff = libbalsa_rot(server->passwd);
        libbalsa_conf_private_set_string("Password", buff);
diff --git a/libbalsa/server.h b/libbalsa/server.h
index af30ade..2f47088 100644
--- a/libbalsa/server.h
+++ b/libbalsa/server.h
@@ -33,16 +33,6 @@
 #include <libsecret/secret.h>
 extern const SecretSchema *LIBBALSA_SERVER_SECRET_SCHEMA;
 #define libbalsa_free_password secret_password_free
-#elif defined (HAVE_GNOME_KEYRING)
-#include <gnome-keyring.h>
-
-#if defined(HAVE_GNOME_KEYRING_24)
-#define LIBBALSA_SERVER_KEYRING_SCHEMA GNOME_KEYRING_NETWORK_PASSWORD
-#else
-extern const GnomeKeyringPasswordSchema* LIBBALSA_SERVER_KEYRING_SCHEMA;
-#endif /* HAVE_GNOME_KEYRING_24 */
-
-#define libbalsa_free_password gnome_keyring_free_password
 #else
 #define libbalsa_free_password g_free
 #endif                          /* defined(HAVE_LIBSECRET) */
diff --git a/src/balsa-app.c b/src/balsa-app.c
index b58897b..c58538e 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -62,9 +62,6 @@ ask_password_real(LibBalsaServer * server, LibBalsaMailbox * mbox)
 #if defined(HAVE_LIBSECRET)
     static const gchar *remember_password_message =
         N_("_Remember password in Secret Service");
-#elif defined (HAVE_GNOME_KEYRING)
-    static const gchar *remember_password_message =
-        N_("_Remember password in keyring");
 #else
     static const gchar *remember_password_message =
         N_("_Remember password");
diff --git a/src/folder-conf.c b/src/folder-conf.c
index 0f20f5a..262742a 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -279,9 +279,6 @@ folder_conf_imap_node(BalsaMailboxNode *mn)
 #if defined(HAVE_LIBSECRET)
     static const gchar *remember_password_message =
         N_("_Remember password in Secret Service");
-#elif defined (HAVE_GNOME_KEYRING)
-    static const gchar *remember_password_message =
-        N_("_Remember password in keyring");
 #else
     static const gchar *remember_password_message =
         N_("_Remember password");
diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 90b5727..6cb3a87 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -1376,9 +1376,6 @@ create_imap_mailbox_dialog(MailboxConfWindow *mcw)
 #if defined(HAVE_LIBSECRET)
     static const gchar *remember_password_message =
         N_("_Remember password in Secret Service");
-#elif defined (HAVE_GNOME_KEYRING)
-    static const gchar *remember_password_message =
-        N_("_Remember password in keyring");
 #else
     static const gchar *remember_password_message =
         N_("_Remember password");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]