[gcr/nielsdg/drop-icons] Drop custom icons in gcr
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcr/nielsdg/drop-icons] Drop custom icons in gcr
- Date: Sun, 26 Jun 2022 19:58:06 +0000 (UTC)
commit d48f18b452aaa78f3213ecc036eebb8e04ec7a99
Author: Niels De Graef <nielsdegraef gmail com>
Date: Sun Jun 26 21:56:06 2022 +0200
Drop custom icons in gcr
Icons are problematic to provide within gcr, as different DEs that are
using it, have different expectations what such an icon should look
like: one wants it to be colorful, another wants it to be monochrome,
yet another wants everything skeumorphic etc.
Let's not deal with this in gcr4 and drop any icons. If applications
want to provide an icon, they can do that themselves much better then we
ever can.
gcr-gtk3/gcr-certificate-widget.c | 11 +-
gcr-gtk3/gcr-section.c | 32 -
gcr-gtk3/gcr-section.h | 2 -
gcr-gtk3/icons/16x16/gcr-gnupg.png | Bin 637 -> 0 bytes
gcr-gtk3/icons/16x16/gcr-key-pair.png | Bin 879 -> 0 bytes
gcr-gtk3/icons/16x16/gcr-key.png | Bin 650 -> 0 bytes
gcr-gtk3/icons/16x16/gcr-password.png | Bin 483 -> 0 bytes
gcr-gtk3/icons/16x16/gcr-smart-card.png | Bin 509 -> 0 bytes
gcr-gtk3/icons/22x22/gcr-gnupg.png | Bin 843 -> 0 bytes
gcr-gtk3/icons/22x22/gcr-key-pair.png | Bin 1275 -> 0 bytes
gcr-gtk3/icons/22x22/gcr-key.png | Bin 868 -> 0 bytes
gcr-gtk3/icons/22x22/gcr-password.png | Bin 803 -> 0 bytes
gcr-gtk3/icons/22x22/gcr-smart-card.png | Bin 666 -> 0 bytes
gcr-gtk3/icons/24x24/gcr-gnupg.png | Bin 858 -> 0 bytes
gcr-gtk3/icons/24x24/gcr-key-pair.png | Bin 1278 -> 0 bytes
gcr-gtk3/icons/24x24/gcr-key.png | Bin 882 -> 0 bytes
gcr-gtk3/icons/24x24/gcr-password.png | Bin 744 -> 0 bytes
gcr-gtk3/icons/24x24/gcr-smart-card.png | Bin 645 -> 0 bytes
gcr-gtk3/icons/256x256/gcr-gnupg.png | Bin 8863 -> 0 bytes
gcr-gtk3/icons/256x256/gcr-password.png | Bin 5596 -> 0 bytes
gcr-gtk3/icons/256x256/gcr-smart-card.png | Bin 10098 -> 0 bytes
gcr-gtk3/icons/32x32/gcr-gnupg.png | Bin 1129 -> 0 bytes
gcr-gtk3/icons/32x32/gcr-key-pair.png | Bin 1903 -> 0 bytes
gcr-gtk3/icons/32x32/gcr-key.png | Bin 1176 -> 0 bytes
gcr-gtk3/icons/32x32/gcr-password.png | Bin 902 -> 0 bytes
gcr-gtk3/icons/32x32/gcr-smart-card.png | Bin 1093 -> 0 bytes
gcr-gtk3/icons/48x48/gcr-gnupg.png | Bin 1679 -> 0 bytes
gcr-gtk3/icons/48x48/gcr-key-pair.png | Bin 3502 -> 0 bytes
gcr-gtk3/icons/48x48/gcr-key.png | Bin 2036 -> 0 bytes
gcr-gtk3/icons/48x48/gcr-password.png | Bin 1525 -> 0 bytes
gcr-gtk3/icons/48x48/gcr-smart-card.png | Bin 1724 -> 0 bytes
gcr-gtk3/icons/meson.build | 33 -
gcr-gtk3/icons/render-icons.py | 174 --
gcr-gtk3/icons/src/gcr-gnupg.svg | 293 --
gcr-gtk3/icons/src/gcr-key-and-keypair.svg | 4138 ----------------------------
gcr-gtk3/icons/src/gcr-password.svg | 1222 --------
gcr-gtk3/icons/src/gcr-smart-card.svg | 1165 --------
gcr-gtk3/meson.build | 2 -
gcr-gtk4/gcr-certificate-widget.c | 11 +-
gcr-gtk4/gcr-section.c | 41 -
gcr-gtk4/gcr-section.h | 2 -
gcr/gcr-certificate.c | 34 -
gcr/gcr-certificate.h | 2 -
gcr/gcr-gnupg-importer.c | 17 -
gcr/gcr-gnupg-key.c | 44 +-
gcr/gcr-gnupg-key.h | 2 -
gcr/gcr-gnupg-records.c | 79 -
gcr/gcr-gnupg-records.h | 2 -
gcr/gcr-icons.c | 64 -
gcr/gcr-icons.h | 46 -
gcr/gcr-importer.c | 10 -
gcr/gcr-memory-icon.c | 223 --
gcr/gcr-memory-icon.h | 66 -
gcr/gcr-pkcs11-importer.c | 21 -
gcr/gcr.h | 1 -
gcr/meson.build | 4 -
gcr/test-memory-icon.c | 218 --
meson.build | 1 -
58 files changed, 5 insertions(+), 7955 deletions(-)
---
diff --git a/gcr-gtk3/gcr-certificate-widget.c b/gcr-gtk3/gcr-certificate-widget.c
index e5fefdc2..e8861758 100644
--- a/gcr-gtk3/gcr-certificate-widget.c
+++ b/gcr-gtk3/gcr-certificate-widget.c
@@ -138,17 +138,13 @@ gcr_certificate_widget_init (GcrCertificateWidget *self)
static GtkWidget*
_gcr_certificate_widget_add_section (GcrCertificateWidget *self,
const gchar *title,
- GIcon *icon,
gboolean important)
{
GtkWidget *widget;
g_assert (GCR_IS_CERTIFICATE_WIDGET (self));
- if (icon)
- widget = gcr_section_new_with_icon (title, icon);
- else
- widget = gcr_section_new (title);
+ widget = gcr_section_new (title);
gtk_size_group_add_widget (self->size_group, widget);
if (important)
@@ -539,7 +535,6 @@ gcr_certificate_widget_set_certificate (GcrCertificateWidget *self, GcrCertifica
GtkWidget *section, *label;
PangoAttrList *attributes;
gchar *display;
- GIcon *icon;
GBytes *bytes, *number;
GNode *asn, *subject_public_key;
GQuark oid;
@@ -558,11 +553,9 @@ gcr_certificate_widget_set_certificate (GcrCertificateWidget *self, GcrCertifica
g_set_object (&self->certificate, NULL);
}
- icon = gcr_certificate_get_icon (self->certificate);
display = calculate_label (self);
- section = _gcr_certificate_widget_add_section (self, display, icon, TRUE);
+ section = _gcr_certificate_widget_add_section (self, display, TRUE);
g_clear_pointer (&display, g_free);
- g_object_unref (icon);
bytes = g_bytes_new_static (data, n_data);
asn = egg_asn1x_create_and_decode (pkix_asn1_tab, "Certificate", bytes);
diff --git a/gcr-gtk3/gcr-section.c b/gcr-gtk3/gcr-section.c
index 24c15023..bc6373ef 100644
--- a/gcr-gtk3/gcr-section.c
+++ b/gcr-gtk3/gcr-section.c
@@ -21,7 +21,6 @@ G_DEFINE_TYPE (GcrSection, gcr_section, GTK_TYPE_GRID)
enum {
PROP_TITLE = 1,
- PROP_ICON,
N_PROPERTIES
};
@@ -53,13 +52,6 @@ gcr_section_get_property (GObject *object,
case PROP_TITLE:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (self->label)));
break;
- case PROP_ICON:
- {
- GIcon *icon;
- gtk_image_get_gicon (GTK_IMAGE (self->image), &icon, NULL);
- g_value_set_object (value, icon);
- }
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -78,16 +70,6 @@ gcr_section_set_property (GObject *object,
case PROP_TITLE:
gtk_label_set_label (GTK_LABEL (self->label), g_value_get_string (value));
break;
- case PROP_ICON:
- if (!self->image)
- {
- self->image = gtk_image_new ();
- gtk_grid_attach (GTK_GRID (self), self->image, 1, 0, 1, 1);
- gtk_container_child_set (GTK_CONTAINER (self), self->frame, "width", 2, NULL);
- }
-
- gtk_image_set_from_gicon (GTK_IMAGE (self->image), g_value_get_object (value),
GTK_ICON_SIZE_BUTTON);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -108,13 +90,6 @@ gcr_section_class_init (GcrSectionClass *klass)
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
- obj_properties[PROP_ICON] =
- g_param_spec_object ("icon",
- "Icon",
- "The Icon to use",
- G_TYPE_ICON,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
-
g_object_class_install_properties (object_class,
N_PROPERTIES,
obj_properties);
@@ -161,13 +136,6 @@ gcr_section_new (const gchar *title)
return g_object_new (GCR_TYPE_SECTION, "title", title, NULL);
}
-GtkWidget *
-gcr_section_new_with_icon (const gchar *title,
- GIcon *icon)
-{
- return g_object_new (GCR_TYPE_SECTION, "title", title, "icon", icon, NULL);
-}
-
void
gcr_section_add_child (GcrSection *self,
const gchar *description,
diff --git a/gcr-gtk3/gcr-section.h b/gcr-gtk3/gcr-section.h
index 69950cc9..359716d5 100644
--- a/gcr-gtk3/gcr-section.h
+++ b/gcr-gtk3/gcr-section.h
@@ -17,8 +17,6 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GcrSection, gcr_section, GCR, SECTION, GtkGrid)
GtkWidget *gcr_section_new (const gchar *title);
-GtkWidget *gcr_section_new_with_icon (const gchar *title,
- GIcon *icon);
void gcr_section_add_child (GcrSection *self,
const gchar *description,
diff --git a/gcr-gtk3/meson.build b/gcr-gtk3/meson.build
index 3ad4f74c..2d75c5e9 100644
--- a/gcr-gtk3/meson.build
+++ b/gcr-gtk3/meson.build
@@ -1,5 +1,3 @@
-subdir('icons')
-
gcr_gtk3_headers_install_dir = gcr_headers_subdir / 'gcr-gtk3'
gcr_gtk3_public_sources = files(
diff --git a/gcr-gtk4/gcr-certificate-widget.c b/gcr-gtk4/gcr-certificate-widget.c
index 58e3e55e..d301c0fd 100644
--- a/gcr-gtk4/gcr-certificate-widget.c
+++ b/gcr-gtk4/gcr-certificate-widget.c
@@ -145,17 +145,13 @@ gcr_certificate_widget_init (GcrCertificateWidget *self)
static GtkWidget*
_gcr_certificate_widget_add_section (GcrCertificateWidget *self,
const gchar *title,
- GIcon *icon,
gboolean important)
{
GtkWidget *widget;
g_assert (GCR_IS_CERTIFICATE_WIDGET (self));
- if (icon)
- widget = gcr_section_new_with_icon (title, icon);
- else
- widget = gcr_section_new (title);
+ widget = gcr_section_new (title);
gtk_size_group_add_widget (self->size_group, widget);
if (important)
@@ -546,7 +542,6 @@ gcr_certificate_widget_set_certificate (GcrCertificateWidget *self, GcrCertifica
GtkWidget *section, *label;
PangoAttrList *attributes;
gchar *display;
- GIcon *icon;
GBytes *bytes, *number;
GNode *asn, *subject_public_key;
GQuark oid;
@@ -565,11 +560,9 @@ gcr_certificate_widget_set_certificate (GcrCertificateWidget *self, GcrCertifica
g_set_object (&self->certificate, NULL);
}
- icon = gcr_certificate_get_icon (self->certificate);
display = calculate_label (self);
- section = _gcr_certificate_widget_add_section (self, display, icon, TRUE);
+ section = _gcr_certificate_widget_add_section (self, display, TRUE);
g_clear_pointer (&display, g_free);
- g_object_unref (icon);
bytes = g_bytes_new_static (data, n_data);
asn = egg_asn1x_create_and_decode (pkix_asn1_tab, "Certificate", bytes);
diff --git a/gcr-gtk4/gcr-section.c b/gcr-gtk4/gcr-section.c
index 33aa1c31..ecd8a9cc 100644
--- a/gcr-gtk4/gcr-section.c
+++ b/gcr-gtk4/gcr-section.c
@@ -21,7 +21,6 @@ G_DEFINE_TYPE (GcrSection, gcr_section, GTK_TYPE_WIDGET)
enum {
PROP_TITLE = 1,
- PROP_ICON,
N_PROPERTIES
};
@@ -53,9 +52,6 @@ gcr_section_get_property (GObject *object,
case PROP_TITLE:
g_value_set_string (value, gtk_label_get_label (GTK_LABEL (self->label)));
break;
- case PROP_ICON:
- g_value_set_object (value, gtk_image_get_gicon (GTK_IMAGE (self->image)));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -74,29 +70,6 @@ gcr_section_set_property (GObject *object,
case PROP_TITLE:
gtk_label_set_label (GTK_LABEL (self->label), g_value_get_string (value));
break;
- case PROP_ICON:
- if (!self->image)
- {
- GtkLayoutManager *layout_manager;
- GtkLayoutChild *child;
-
- self->image = gtk_image_new ();
- gtk_widget_insert_after (self->image, GTK_WIDGET (self), self->label);
- layout_manager = gtk_widget_get_layout_manager (GTK_WIDGET (self));
-
- child = gtk_layout_manager_get_layout_child (layout_manager, self->image);
- g_object_set (G_OBJECT (child),
- "column", 1,
- NULL);
-
- child = gtk_layout_manager_get_layout_child (layout_manager, self->frame);
- g_object_set (G_OBJECT (child),
- "column-span", 2,
- NULL);
- }
-
- gtk_image_set_from_gicon (GTK_IMAGE (self->image), g_value_get_object (value));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -118,13 +91,6 @@ gcr_section_class_init (GcrSectionClass *klass)
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
- obj_properties[PROP_ICON] =
- g_param_spec_object ("icon",
- "Icon",
- "The Icon to use",
- G_TYPE_ICON,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
-
g_object_class_install_properties (object_class,
N_PROPERTIES,
obj_properties);
@@ -179,13 +145,6 @@ gcr_section_new (const gchar *title)
return g_object_new (GCR_TYPE_SECTION, "title", title, NULL);
}
-GtkWidget *
-gcr_section_new_with_icon (const gchar *title,
- GIcon *icon)
-{
- return g_object_new (GCR_TYPE_SECTION, "title", title, "icon", icon, NULL);
-}
-
void
gcr_section_add_child (GcrSection *self,
const gchar *description,
diff --git a/gcr-gtk4/gcr-section.h b/gcr-gtk4/gcr-section.h
index 9f275d92..0bc7c270 100644
--- a/gcr-gtk4/gcr-section.h
+++ b/gcr-gtk4/gcr-section.h
@@ -18,8 +18,6 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GcrSection, gcr_section, GCR, SECTION, GtkWidget)
GtkWidget *gcr_section_new (const gchar *title);
-GtkWidget *gcr_section_new_with_icon (const gchar *title,
- GIcon *icon);
void gcr_section_add_child (GcrSection *self,
const gchar *description,
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c
index 714f4a96..71a14168 100644
--- a/gcr/gcr-certificate.c
+++ b/gcr/gcr-certificate.c
@@ -22,7 +22,6 @@
#include "gcr-certificate.h"
#include "gcr-certificate-extensions.h"
#include "gcr-comparable.h"
-#include "gcr-icons.h"
#include "gcr-internal.h"
#include "gcr-subject-public-key.h"
@@ -106,7 +105,6 @@ enum {
PROP_LABEL,
PROP_MARKUP,
PROP_DESCRIPTION,
- PROP_ICON,
PROP_SUBJECT,
PROP_ISSUER,
PROP_EXPIRY
@@ -280,15 +278,6 @@ gcr_certificate_default_init (GcrCertificateIface *iface)
g_param_spec_string ("markup", "Markup", "Markup which describes object being
rendered",
"", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
- /**
- * GcrCertificate:icon:
- *
- * An icon representing the certificate
- */
- g_object_interface_install_property (iface,
- g_param_spec_object ("icon", "Icon", "Icon for the object being rendered",
- G_TYPE_ICON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
/**
* GcrCertificate:subject:
*
@@ -339,7 +328,6 @@ const GcrColumn*
gcr_certificate_get_columns (void)
{
static GcrColumn columns[] = {
- { "icon", /* later */ 0, /* later */ 0, NULL, 0 },
{ "label", G_TYPE_STRING, G_TYPE_STRING, NC_("column", "Name"),
GCR_COLUMN_SORTABLE },
{ "issuer", G_TYPE_STRING, G_TYPE_STRING, NC_("column", "Issued By"),
@@ -349,7 +337,6 @@ gcr_certificate_get_columns (void)
{ NULL }
};
- columns[0].property_type = columns[0].column_type = G_TYPE_ICON;
columns[3].property_type = G_TYPE_DATE;
return columns;
}
@@ -987,22 +974,6 @@ gcr_certificate_get_serial_number_hex (GcrCertificate *self)
return hex;
}
-/**
- * gcr_certificate_get_icon: (skip)
- * @self: The certificate
- *
- * Get the icon for a certificate.
- *
- * Returns: (transfer full): the icon for this certificate, which should be
- * released with g_object_unref()
- */
-GIcon *
-gcr_certificate_get_icon (GcrCertificate *self)
-{
- g_return_val_if_fail (GCR_IS_CERTIFICATE (self), FALSE);
- return g_themed_icon_new (GCR_ICON_CERTIFICATE);
-}
-
/**
* gcr_certificate_get_basic_constraints:
* @self: the certificate
@@ -1113,8 +1084,6 @@ gcr_certificate_mixin_class_init (GObjectClass *object_class)
g_object_class_override_property (object_class, PROP_MARKUP, "markup");
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, "icon"))
- g_object_class_override_property (object_class, PROP_ICON, "icon");
if (!g_object_class_find_property (object_class, "subject"))
g_object_class_override_property (object_class, PROP_SUBJECT, "subject");
if (!g_object_class_find_property (object_class, "issuer"))
@@ -1180,9 +1149,6 @@ gcr_certificate_mixin_get_property (GObject *obj, guint prop_id,
case PROP_SUBJECT:
g_value_take_string (value, gcr_certificate_get_subject_name (cert));
break;
- case PROP_ICON:
- g_value_set_object (value, gcr_certificate_get_icon (cert));
- break;
case PROP_DESCRIPTION:
g_value_set_string (value, _("Certificate"));
break;
diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h
index 12a12752..d6a60b92 100644
--- a/gcr/gcr-certificate.h
+++ b/gcr/gcr-certificate.h
@@ -126,8 +126,6 @@ gchar* gcr_certificate_get_fingerprint_hex (GcrCertificate *self
gchar * gcr_certificate_get_markup_text (GcrCertificate *self);
-GIcon* gcr_certificate_get_icon (GcrCertificate *self);
-
gboolean gcr_certificate_get_basic_constraints (GcrCertificate *self,
gboolean *is_ca,
gint *path_len);
diff --git a/gcr/gcr-gnupg-importer.c b/gcr/gcr-gnupg-importer.c
index 5fa93bdc..36c40c4b 100644
--- a/gcr/gcr-gnupg-importer.c
+++ b/gcr/gcr-gnupg-importer.c
@@ -30,7 +30,6 @@
enum {
PROP_0,
PROP_LABEL,
- PROP_ICON,
PROP_IMPORTED,
PROP_DIRECTORY,
PROP_INTERACTION,
@@ -97,18 +96,6 @@ calculate_label (GcrGnupgImporter *self)
return g_strdup_printf (_("GnuPG Keyring: %s"), directory);
}
-static GIcon *
-calculate_icon (GcrGnupgImporter *self)
-{
- const gchar *directory;
-
- directory = _gcr_gnupg_process_get_directory (self->pv->process);
- if (directory == NULL)
- return g_themed_icon_new ("user-home");
- else
- return g_themed_icon_new ("folder");
-}
-
static gchar *
calculate_uri (GcrGnupgImporter *self)
{
@@ -203,9 +190,6 @@ _gcr_gnupg_importer_get_property (GObject *obj,
case PROP_LABEL:
g_value_take_string (value, calculate_label (self));
break;
- case PROP_ICON:
- g_value_take_object (value, calculate_icon (self));
- break;
case PROP_IMPORTED:
g_value_set_boxed (value, _gcr_gnupg_importer_get_imported (self));
break;
@@ -236,7 +220,6 @@ _gcr_gnupg_importer_class_init (GcrGnupgImporterClass *klass)
gobject_class->get_property = _gcr_gnupg_importer_get_property;
g_object_class_override_property (gobject_class, PROP_LABEL, "label");
- g_object_class_override_property (gobject_class, PROP_ICON, "icon");
g_object_class_override_property (gobject_class, PROP_INTERACTION, "interaction");
g_object_class_override_property (gobject_class, PROP_URI, "uri");
diff --git a/gcr/gcr-gnupg-key.c b/gcr/gcr-gnupg-key.c
index f4126656..defeaaf8 100644
--- a/gcr/gcr-gnupg-key.c
+++ b/gcr/gcr-gnupg-key.c
@@ -22,7 +22,6 @@
#include "gcr-gnupg-key.h"
#include "gcr-gnupg-records.h"
#include "gcr-record.h"
-#include "gcr-memory-icon.h"
#include "gck/gck.h"
@@ -37,13 +36,12 @@ enum {
PROP_MARKUP,
PROP_DESCRIPTION,
PROP_SHORT_KEYID,
- PROP_ICON
+ N_PROPS
};
struct _GcrGnupgKeyPrivate {
GPtrArray *public_records;
GPtrArray *secret_records;
- GIcon *icon;
};
G_DEFINE_TYPE_WITH_PRIVATE (GcrGnupgKey, _gcr_gnupg_key, G_TYPE_OBJECT);
@@ -148,9 +146,6 @@ _gcr_gnupg_key_get_property (GObject *obj, guint prop_id, GValue *value,
case PROP_SHORT_KEYID:
g_value_set_string (value, _gcr_gnupg_records_get_short_keyid (self->pv->public_records));
break;
- case PROP_ICON:
- g_value_set_object (value, _gcr_gnupg_key_get_icon (self));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
@@ -231,15 +226,6 @@ _gcr_gnupg_key_class_init (GcrGnupgKeyClass *klass)
g_object_class_install_property (gobject_class, PROP_SHORT_KEYID,
g_param_spec_string ("short-keyid", "Short Key ID", "Display key identifier",
"", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
- /**
- * GcrGnupgKey:icon:
- *
- * Icon for this key.
- */
- g_object_class_install_property (gobject_class, PROP_ICON,
- g_param_spec_object ("icon", "Icon", "Icon for this key",
- G_TYPE_ICON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
}
/**
@@ -388,32 +374,6 @@ _gcr_gnupg_key_get_keyid (GcrGnupgKey *self)
return _gcr_gnupg_records_get_keyid (self->pv->public_records);
}
-/**
- * _gcr_gnupg_key_get_icon:
- * @self: A gnupg key.
- *
- * Get the display icon for this key.
- *
- * Return value: (transfer none): The icon, owned by the key.
- */
-GIcon*
-_gcr_gnupg_key_get_icon (GcrGnupgKey *self)
-{
- g_return_val_if_fail (GCR_IS_GNUPG_KEY (self), NULL);
-
- if (self->pv->icon == NULL) {
- self->pv->icon = _gcr_gnupg_records_get_icon (self->pv->public_records);
- if (self->pv->icon == NULL) {
- if (self->pv->secret_records)
- self->pv->icon = g_themed_icon_new ("gcr-key-pair");
- else
- self->pv->icon = g_themed_icon_new ("gcr-key");
- }
- }
-
- return self->pv->icon;
-}
-
/**
* _gcr_gnupg_key_get_columns:
*
@@ -425,7 +385,6 @@ const GcrColumn*
_gcr_gnupg_key_get_columns (void)
{
static GcrColumn columns[] = {
- { "icon", /* later */ 0, /* later */ 0, NULL, 0, NULL, 0 },
{ "label", G_TYPE_STRING, G_TYPE_STRING, NC_("column", "Name"),
GCR_COLUMN_SORTABLE, NULL, 0 },
{ "short-keyid", G_TYPE_STRING, G_TYPE_STRING, NC_("column", "Key ID"),
@@ -433,6 +392,5 @@ _gcr_gnupg_key_get_columns (void)
{ NULL }
};
- columns[0].property_type = columns[0].column_type = G_TYPE_ICON;
return columns;
}
diff --git a/gcr/gcr-gnupg-key.h b/gcr/gcr-gnupg-key.h
index 9a3da2b8..cceb71b9 100644
--- a/gcr/gcr-gnupg-key.h
+++ b/gcr/gcr-gnupg-key.h
@@ -72,8 +72,6 @@ GPtrArray* _gcr_gnupg_key_get_secret_records (GcrGnupgKey *s
void _gcr_gnupg_key_set_secret_records (GcrGnupgKey *self,
GPtrArray *records);
-GIcon* _gcr_gnupg_key_get_icon (GcrGnupgKey *self);
-
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GcrGnupgKey, g_object_unref)
G_END_DECLS
diff --git a/gcr/gcr-gnupg-records.c b/gcr/gcr-gnupg-records.c
index f8ee6bb3..222f3dd0 100644
--- a/gcr/gcr-gnupg-records.c
+++ b/gcr/gcr-gnupg-records.c
@@ -21,7 +21,6 @@
#include "gcr-gnupg-records.h"
#include "gcr-record.h"
-#include "gcr-memory-icon.h"
#include "gck/gck.h"
@@ -184,81 +183,3 @@ _gcr_gnupg_records_get_fingerprint (GPtrArray *records)
return _gcr_record_get_raw (record, GCR_RECORD_FPR_FINGERPRINT);
return NULL;
}
-
-#define TYPE_IMAGE 0x01
-#define IMAGE_HEADER_LEN 0x10
-#define IMAGE_JPEG_SIG "\x10\x00\x01\x01"
-#define IMAGE_JPEG_SIG_LEN 4
-
-static void
-add_emblem_to_icon (GIcon **icon,
- const gchar *emblem_name)
-{
- GIcon *emblem_icon;
- GIcon *result;
- GEmblem *emblem;
-
- emblem_icon = g_themed_icon_new (emblem_name);
- emblem = g_emblem_new_with_origin (emblem_icon, G_EMBLEM_ORIGIN_LIVEMETADATA);
- result = g_emblemed_icon_new (*icon, emblem);
- g_object_unref (*icon);
- *icon = result;
- g_object_unref (emblem);
- g_object_unref (emblem_icon);
-}
-
-GIcon *
-_gcr_gnupg_records_get_icon (GPtrArray *records)
-{
- GcrRecord *record;
- gchar validity;
- guchar *data;
- gsize n_data;
- guint type;
- GIcon *icon;
- guint i;
-
- for (i = 0; i < records->len; i++) {
- record = records->pdata[i];
- if (GCR_RECORD_SCHEMA_XA1 != _gcr_record_get_schema (record))
- continue;
- if (!_gcr_record_get_uint (record, GCR_RECORD_XA1_TYPE, &type))
- continue;
- if (type != TYPE_IMAGE)
- continue;
-
- data = _gcr_record_get_base64 (record, GCR_RECORD_XA1_DATA, &n_data);
- g_return_val_if_fail (data != NULL, NULL);
-
- /* Header is 16 bytes long */
- if (n_data <= IMAGE_HEADER_LEN) {
- g_free (data);
- continue;
- }
-
- /* These are the header bytes. See gnupg doc/DETAILS */
- g_assert (IMAGE_JPEG_SIG_LEN < IMAGE_HEADER_LEN);
- if (memcmp (data, IMAGE_JPEG_SIG, IMAGE_JPEG_SIG_LEN) != 0) {
- g_free (data);
- continue;
- }
-
- icon = G_ICON (_gcr_memory_icon_new_full ("image/jpeg", data,
- n_data, IMAGE_HEADER_LEN,
- g_free));
-
- validity = _gcr_record_get_char (record, GCR_RECORD_XA1_TRUST);
- if (validity != 0 && validity != 'm' && validity != 'f' && validity != 'u')
- add_emblem_to_icon (&icon, "dialog-question");
-
- /* We have a valid header */
- return icon;
- }
-
- if (_gcr_records_find (records, GCR_RECORD_SCHEMA_SEC))
- return g_themed_icon_new ("gcr-key-pair");
- else
- return g_themed_icon_new ("gcr-key");
-
- return NULL;
-}
diff --git a/gcr/gcr-gnupg-records.h b/gcr/gcr-gnupg-records.h
index 1f26538e..bbc6859f 100644
--- a/gcr/gcr-gnupg-records.h
+++ b/gcr/gcr-gnupg-records.h
@@ -39,8 +39,6 @@ gboolean _gcr_gnupg_records_parse_user_id (const gchar *user_
gchar **email,
gchar **comment);
-GIcon * _gcr_gnupg_records_get_icon (GPtrArray *records);
-
G_END_DECLS
#endif /* __GCR_GNUPG_RECORD_H__ */
diff --git a/gcr/gcr-importer.c b/gcr/gcr-importer.c
index f1916f02..0b98a616 100644
--- a/gcr/gcr-importer.c
+++ b/gcr/gcr-importer.c
@@ -90,16 +90,6 @@ gcr_importer_default_init (GcrImporterInterface *iface)
"",
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
- /**
- * GcrImporter:icon:
- *
- * The icon for the importer.
- */
- g_object_interface_install_property (iface,
- g_param_spec_object ("icon", "Icon", "The icon for the importer",
- G_TYPE_ICON,
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
-
/**
* GcrImporter:interaction:
*
diff --git a/gcr/gcr-pkcs11-importer.c b/gcr/gcr-pkcs11-importer.c
index 8f65f359..e65e95f4 100644
--- a/gcr/gcr-pkcs11-importer.c
+++ b/gcr/gcr-pkcs11-importer.c
@@ -23,7 +23,6 @@
#include "config.h"
#include "gcr-fingerprint.h"
-#include "gcr-icons.h"
#include "gcr-internal.h"
#include "gcr-library.h"
#include "gcr-import-interaction.h"
@@ -42,7 +41,6 @@
enum {
PROP_0,
PROP_LABEL,
- PROP_ICON,
PROP_INTERACTION,
PROP_SLOT,
PROP_IMPORTED,
@@ -605,21 +603,6 @@ calculate_label (GcrPkcs11Importer *self)
return result;
}
-static GIcon *
-calculate_icon (GcrPkcs11Importer *self,
- GckTokenInfo *token_info)
-{
- GckTokenInfo *info = NULL;
- GIcon *result;
-
- if (token_info == NULL)
- info = token_info = gck_slot_get_token_info (self->slot);
- result = gcr_icon_for_token (token_info);
- gck_token_info_free (info);
-
- return result;
-}
-
static gchar *
calculate_uri (GcrPkcs11Importer *self)
{
@@ -647,9 +630,6 @@ _gcr_pkcs11_importer_get_property (GObject *obj,
case PROP_LABEL:
g_value_take_string (value, calculate_label (self));
break;
- case PROP_ICON:
- g_value_take_object (value, calculate_icon (self, NULL));
- break;
case PROP_SLOT:
g_value_set_object (value, _gcr_pkcs11_importer_get_slot (self));
break;
@@ -683,7 +663,6 @@ _gcr_pkcs11_importer_class_init (GcrPkcs11ImporterClass *klass)
gobject_class->get_property = _gcr_pkcs11_importer_get_property;
g_object_class_override_property (gobject_class, PROP_LABEL, "label");
- g_object_class_override_property (gobject_class, PROP_ICON, "icon");
g_object_class_override_property (gobject_class, PROP_INTERACTION, "interaction");
g_object_class_override_property (gobject_class, PROP_URI, "uri");
diff --git a/gcr/gcr.h b/gcr/gcr.h
index aaa2982d..7135e819 100644
--- a/gcr/gcr.h
+++ b/gcr/gcr.h
@@ -38,7 +38,6 @@
#include <gcr/gcr-column.h>
#include <gcr/gcr-enum-types.h>
#include <gcr/gcr-fingerprint.h>
-#include <gcr/gcr-icons.h>
#include <gcr/gcr-importer.h>
#include <gcr/gcr-library.h>
#include <gcr/gcr-mock-prompter.h>
diff --git a/gcr/meson.build b/gcr/meson.build
index 88428eed..1d780f0c 100644
--- a/gcr/meson.build
+++ b/gcr/meson.build
@@ -7,7 +7,6 @@ gcr_public_sources = files(
'gcr-certificate-request.c',
'gcr-comparable.c',
'gcr-fingerprint.c',
- 'gcr-icons.c',
'gcr-importer.c',
'gcr-import-interaction.c',
'gcr-library.c',
@@ -34,7 +33,6 @@ gcr_private_sources = files(
'gcr-gnupg-records.c',
'gcr-gnupg-util.c',
'gcr-key-mechanisms.c',
- 'gcr-memory-icon.c',
'gcr-openpgp.c',
'gcr-openssh.c',
'gcr-pkcs11-importer.c',
@@ -51,7 +49,6 @@ gcr_headers = files(
'gcr-column.h',
'gcr-comparable.h',
'gcr-fingerprint.h',
- 'gcr-icons.h',
'gcr-importer.h',
'gcr-import-interaction.h',
'gcr-library.h',
@@ -331,7 +328,6 @@ gcr_test_names = [
'trust',
'parser',
'record',
- 'memory-icon',
'gnupg-key',
'gnupg-process',
'system-prompt',
diff --git a/meson.build b/meson.build
index d50575d6..a6d600c3 100644
--- a/meson.build
+++ b/meson.build
@@ -144,6 +144,5 @@ endif
# Post-install scripts
gnome.post_install(
- gtk_update_icon_cache: get_option('gtk3'),
glib_compile_schemas: true,
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]