[gcr] gcr: Add gcr_certificate_get_markup() function



commit 3b951f502d5f8b494679e2d748c979b90075f171
Author: Stef Walter <stefw gnome org>
Date:   Mon Mar 3 13:59:42 2014 +0100

    gcr: Add gcr_certificate_get_markup() function
    
    For seahorse to use when implementing its GcrCertificate derived
    class.

 docs/reference/gcr/gcr-sections.txt |    1 +
 gcr/gcr-base.symbols                |    1 +
 gcr/gcr-certificate.c               |   14 +++++++++++---
 gcr/gcr-certificate.h               |    2 ++
 4 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt
index 7e3db2b..c9af8ec 100644
--- a/docs/reference/gcr/gcr-sections.txt
+++ b/docs/reference/gcr/gcr-sections.txt
@@ -94,6 +94,7 @@ GCR_CERTIFICATE_MIXIN_IMPLEMENT_COMPARABLE
 gcr_certificate_mixin_comparable_init
 gcr_certificate_compare
 gcr_certificate_get_icon
+gcr_certificate_get_markup_text
 <SUBSECTION Standard>
 gcr_certificate_get_columns
 GCR_CERTIFICATE
diff --git a/gcr/gcr-base.symbols b/gcr/gcr-base.symbols
index 030e057..c3ddfbc 100644
--- a/gcr/gcr-base.symbols
+++ b/gcr/gcr-base.symbols
@@ -30,6 +30,7 @@ gcr_certificate_get_issuer_name
 gcr_certificate_get_issuer_part
 gcr_certificate_get_issuer_raw
 gcr_certificate_get_key_size
+gcr_certificate_get_markup_text
 gcr_certificate_get_serial_number
 gcr_certificate_get_serial_number_hex
 gcr_certificate_get_subject_cn
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index ef3270d..dad64d8 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -199,8 +199,16 @@ digest_certificate (GcrCertificate *self, GChecksumType type)
        return digest;
 }
 
-static gchar*
-calculate_markup (GcrCertificate *self)
+/**
+ * gcr_certificate_get_markup_text:
+ * @self: a certificate
+ *
+ * Calculate a GMarkup string for displaying this certificate.
+ *
+ * Returns: (transfer full): the markup string
+ */
+gchar *
+gcr_certificate_get_markup_text (GcrCertificate *self)
 {
        gchar *label = NULL;
        gchar *issuer;
@@ -1184,7 +1192,7 @@ gcr_certificate_mixin_get_property (GObject *obj, guint prop_id,
                g_value_set_string (value, _("Certificate"));
                break;
        case PROP_MARKUP:
-               g_value_take_string (value, calculate_markup (cert));
+               g_value_take_string (value, gcr_certificate_get_markup_text (cert));
                break;
        case PROP_ISSUER:
                g_value_take_string (value, gcr_certificate_get_issuer_name (cert));
diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h
index b46cb76..05946a4 100644
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@ -127,6 +127,8 @@ guchar*             gcr_certificate_get_fingerprint        (GcrCertificate *self
 gchar*              gcr_certificate_get_fingerprint_hex    (GcrCertificate *self,
                                                             GChecksumType type);
 
+gchar *             gcr_certificate_get_markup_text        (GcrCertificate *self);
+
 GIcon*              gcr_certificate_get_icon               (GcrCertificate *self);
 
 gboolean            gcr_certificate_get_basic_constraints  (GcrCertificate *self,


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