[gcr/nielsdg/certificate-gdatetime: 5/6] certificate: Remove markup-text




commit 33f64237aaf6292d7c040eabade47c75661219bf
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Jul 6 21:56:27 2022 +0200

    certificate: Remove markup-text
    
    It's a silly property that was introduced for the likes of Seahorse,
    which should just do better.

 gcr/Gcr-3.metadata    |  1 -
 gcr/gcr-certificate.c | 46 +---------------------------------------------
 gcr/gcr-certificate.h |  2 --
 3 files changed, 1 insertion(+), 48 deletions(-)
---
diff --git a/gcr/Gcr-3.metadata b/gcr/Gcr-3.metadata
index 3eee7e5c..41ab1678 100644
--- a/gcr/Gcr-3.metadata
+++ b/gcr/Gcr-3.metadata
@@ -3,7 +3,6 @@
 
 Certificate
        .label nullable=true
-       .markup nullable=true
        .subject nullable=true
        .issuer nullable=true
 Comparable
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index 13b2379e..f0d6d66a 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -94,7 +94,6 @@ static GBytes * _gcr_certificate_get_issuer_const (GcrCertificate *self);
 enum {
        PROP_FIRST = 0x0007000,
        PROP_LABEL,
-       PROP_MARKUP_TEXT,
        PROP_DESCRIPTION,
        PROP_SUBJECT_NAME,
        PROP_ISSUER_NAME,
@@ -181,34 +180,6 @@ digest_certificate (GcrCertificate *self, GChecksumType type)
        return digest;
 }
 
-/**
- * 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;
-       gchar *markup;
-
-       g_object_get (self, "label", &label, NULL);
-       issuer = gcr_certificate_get_issuer_name (self);
-
-       if (issuer)
-               markup = g_markup_printf_escaped ("%s\n<small>Issued by: %s</small>", label, issuer);
-       else
-               markup = g_markup_printf_escaped ("%s\n<small>Issued by: <i>No name</i></small>", label);
-
-       g_free (label);
-       g_free (issuer);
-       return markup;
-}
-
 /* ---------------------------------------------------------------------------------
  * INTERFACE
  */
@@ -240,16 +211,7 @@ gcr_certificate_default_init (GcrCertificateIface *iface)
                                              "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
                /**
-                * GcrCertificate:markup-text:
-                *
-                * GLib markup to describe the certificate
-                */
-               g_object_interface_install_property (iface,
-                        g_param_spec_string ("markup-text", "Markup text", "Markup which describes object 
being rendered",
-                                             "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
-               /**
-                * GcrCertificate:subject-name:
+                * GcrCertificate:subject:
                 *
                 * Common name part of the certificate subject
                 */
@@ -971,7 +933,6 @@ gcr_certificate_mixin_emit_notify (GcrCertificate *self)
 
        obj = G_OBJECT (self);
        g_object_notify (obj, "label");
-       g_object_notify (obj, "markup-text");
        g_object_notify (obj, "subject-name");
        g_object_notify (obj, "issuer-name");
        g_object_notify (obj, "expiry-date");
@@ -1006,8 +967,6 @@ gcr_certificate_mixin_class_init (GObjectClass *object_class)
 {
        if (!g_object_class_find_property (object_class, "description"))
                g_object_class_override_property (object_class, PROP_DESCRIPTION, "description");
-       if (!g_object_class_find_property (object_class, "markup-text"))
-               g_object_class_override_property (object_class, PROP_MARKUP_TEXT, "markup-text");
        if (!g_object_class_find_property (object_class, "label"))
                g_object_class_override_property (object_class, PROP_LABEL, "label");
        if (!g_object_class_find_property (object_class, "subject-name"))
@@ -1078,9 +1037,6 @@ gcr_certificate_mixin_get_property (GObject *obj, guint prop_id,
        case PROP_DESCRIPTION:
                g_value_set_string (value, _("Certificate"));
                break;
-       case PROP_MARKUP_TEXT:
-               g_value_take_string (value, gcr_certificate_get_markup_text (cert));
-               break;
        case PROP_ISSUER_NAME:
                g_value_take_string (value, gcr_certificate_get_issuer_name (cert));
                break;
diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h
index ab65026e..9f7a1f26 100644
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@ -120,8 +120,6 @@ 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);
-
 gboolean            gcr_certificate_get_basic_constraints  (GcrCertificate *self,
                                                             gboolean *is_ca,
                                                             gint *path_len);


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