[git] GPA - branch, master, updated. gpa-0.9.7-7-g347e2a4

by Werner Koch cvs at cvs.gnupg.org
Tue Sep 1 07:50:35 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Assistant".

The branch, master has been updated
       via  347e2a436a7d5e936df295875edea8e1d4a22120 (commit)
      from  9599359bb8cdb24af704be03f0532b69523152df (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 347e2a436a7d5e936df295875edea8e1d4a22120
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Aug 31 10:33:21 2015 +0200

    Use GnuPG 2.1 style pubkey algo format also for subkey lists.
    
    * src/gpasubkeylist.c (SUBKEY_SIZE): Define only for old gpgme
    versions.
    (gpa_subkey_list_new): Ditto for "Size".
    (gpa_subkey_list_set_key): Use new algostr if possble.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/gpasubkeylist.c b/src/gpasubkeylist.c
index 78e933b..b37cf7b 100644
--- a/src/gpasubkeylist.c
+++ b/src/gpasubkeylist.c
@@ -40,7 +40,9 @@ static gboolean query_tooltip_cb (GtkWidget *wdiget, int x, int y,
 typedef enum
 {
   SUBKEY_ID,
+#if GPGME_VERSION_NUMBER >= 0x010601  /* GPGME < 1.6.1 */
   SUBKEY_SIZE,
+#endif
   SUBKEY_ALGO,
   SUBKEY_CREATED,
   SUBKEY_EXPIRE,
@@ -103,11 +105,13 @@ gpa_subkey_list_new (void)
 						     NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
 
+#if GPGME_VERSION_NUMBER < 0x010601  /* GPGME < 1.6.1 */
   renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes (_("Size"), renderer,
 						     "text", SUBKEY_SIZE,
 						     NULL);
   gtk_tree_view_append_column (GTK_TREE_VIEW (list), column);
+#endif
 
   renderer = gtk_cell_renderer_text_new ();
   column = gtk_tree_view_column_new_with_attributes (_("Created"),
@@ -204,6 +208,10 @@ gpa_subkey_list_set_key (GtkWidget *list, gpgme_key_t key)
   gpgme_subkey_t subkey, secsubkey;
   gpgme_key_t seckey;
   gchar *p, *size, *expires;
+#if GPGME_VERSION_NUMBER >= 0x010601  /* GPGME >= 1.6.1 */
+  char *algostr_buf;
+#endif
+  const char *algostr;
 
   /* Empty the list */
   gtk_list_store_clear (store);
@@ -242,12 +250,21 @@ gpa_subkey_list_set_key (GtkWidget *list, gpgme_key_t key)
           if (*expires != '>' && (p = strchr (expires, ' ')))
             *p = 0;
 
+#if GPGME_VERSION_NUMBER >= 0x010601  /* GPGME >= 1.6.1 */
+          algostr_buf = gpgme_pubkey_algo_string (key->subkeys);
+          algostr = algostr_buf? algostr_buf : "?";
+#else  /* GPGME < 1.6.1 */
+          algostr = gpgme_pubkey_algo_name (subkey->pubkey_algo),
+#endif  /* GPGME < 1.6.1 */
+
           gtk_list_store_set
             (store, &iter,
              SUBKEY_ID, subkey->keyid+8,
+#if GPGME_VERSION_NUMBER < 0x010601  /* GPGME < 1.6.1 */
              SUBKEY_SIZE, size,
+#endif
              SUBKEY_ALGO,
-             gpgme_pubkey_algo_name (subkey->pubkey_algo),
+             algostr,
              SUBKEY_CREATED,
              gpa_creation_date_string (subkey->timestamp),
              SUBKEY_EXPIRE,
@@ -262,6 +279,9 @@ gpa_subkey_list_set_key (GtkWidget *list, gpgme_key_t key)
              -1);
 	  g_free (size);
 	  g_free (expires);
+#if GPGME_VERSION_NUMBER >= 0x010601  /* GPGME >= 1.6.1 */
+          gpgme_free (algostr_buf);
+#endif
 	}
     }
 }

-----------------------------------------------------------------------

Summary of changes:
 src/gpasubkeylist.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The GNU Privacy Assistant
http://git.gnupg.org




More information about the Gnupg-commits mailing list