diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2022-06-27 17:27:54 +0200 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2022-06-27 17:41:17 +0200 |
commit | 06b8ed27b547aa9ae4adb25326bd3cd5302bb0cf (patch) | |
tree | c64ff67e4b498d0925662beb3fdb37c941328a76 /gcr | |
parent | c69b743368d58761942391a2a013feac3be341e5 (diff) | |
download | gcr-06b8ed27b547aa9ae4adb25326bd3cd5302bb0cf.tar.gz |
gcr: Drop GcrColumn
These were just used for display treeviews. We're not really interested
in putting that kind of stuff inside gcr itself, so just remove it.
Diffstat (limited to 'gcr')
-rw-r--r-- | gcr/gcr-certificate.c | 54 | ||||
-rw-r--r-- | gcr/gcr-certificate.h | 4 | ||||
-rw-r--r-- | gcr/gcr-column.c | 56 | ||||
-rw-r--r-- | gcr/gcr-column.h | 57 | ||||
-rw-r--r-- | gcr/gcr-gnupg-key.c | 21 | ||||
-rw-r--r-- | gcr/gcr-gnupg-key.h | 4 | ||||
-rw-r--r-- | gcr/gcr.h | 1 | ||||
-rw-r--r-- | gcr/meson.build | 2 |
8 files changed, 0 insertions, 199 deletions
diff --git a/gcr/gcr-certificate.c b/gcr/gcr-certificate.c index 71a1416..84b666c 100644 --- a/gcr/gcr-certificate.c +++ b/gcr/gcr-certificate.c @@ -68,15 +68,6 @@ * The interface that implementors of #GcrCertificate must implement. */ -/** - * GCR_CERTIFICATE_COLUMNS: - * - * The columns that are valid for a certificate. This is to be used with - * the [class@TreeSelector] or [class@CollectionModel]. - * - * This is an array of #GcrColumn, owned by the gcr library. - */ - /* * The DER data in this structure is owned by the derived class. * It is only valid for the duration of the current call stack @@ -218,27 +209,6 @@ gcr_certificate_get_markup_text (GcrCertificate *self) return markup; } -static void -on_transform_date_to_string (const GValue *src, GValue *dest) -{ - static const gsize len = 256; - GDate *date; - gchar *result; - - g_return_if_fail (G_VALUE_TYPE (src) == G_TYPE_DATE); - - date = g_value_get_boxed (src); - g_return_if_fail (date); - - result = g_malloc0 (len); - if (!g_date_strftime (result, len, "%x", date)) { - g_free (result); - result = NULL; - } - - g_value_take_string (dest, result); -} - /* --------------------------------------------------------------------------------- * INTERFACE */ @@ -318,30 +288,6 @@ G_DEFINE_INTERFACE (GcrCertificate, gcr_certificate, GCR_TYPE_COMPARABLE); */ /** - * gcr_certificate_get_columns: (skip) - * - * Get the columns appropriate for a certificate - * - * Returns: (transfer none): the columns - */ -const GcrColumn* -gcr_certificate_get_columns (void) -{ - static GcrColumn columns[] = { - { "label", G_TYPE_STRING, G_TYPE_STRING, NC_("column", "Name"), - GCR_COLUMN_SORTABLE }, - { "issuer", G_TYPE_STRING, G_TYPE_STRING, NC_("column", "Issued By"), - GCR_COLUMN_SORTABLE }, - { "expiry", /* later */ 0, G_TYPE_STRING, NC_("column", "Expires"), - GCR_COLUMN_SORTABLE, on_transform_date_to_string }, - { NULL } - }; - - columns[3].property_type = G_TYPE_DATE; - return columns; -} - -/** * gcr_certificate_compare: * @first: (nullable): the certificate to compare * @other: (nullable): the certificate to compare against diff --git a/gcr/gcr-certificate.h b/gcr/gcr-certificate.h index d6a60b9..444b2f5 100644 --- a/gcr/gcr-certificate.h +++ b/gcr/gcr-certificate.h @@ -25,7 +25,6 @@ #endif #include "gcr-types.h" -#include "gcr-column.h" #include "gcr-comparable.h" #include <glib-object.h> @@ -33,7 +32,6 @@ G_BEGIN_DECLS -#define GCR_CERTIFICATE_COLUMNS (gcr_certificate_get_columns ()) #define GCR_TYPE_CERTIFICATE (gcr_certificate_get_type ()) #define GCR_CERTIFICATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_CERTIFICATE, GcrCertificate)) #define GCR_IS_CERTIFICATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCR_TYPE_CERTIFICATE)) @@ -74,8 +72,6 @@ GType gcr_certificate_get_type (void); const guint8 * gcr_certificate_get_der_data (GcrCertificate *self, gsize *n_data); -const GcrColumn* gcr_certificate_get_columns (void); - gint gcr_certificate_compare (GcrComparable *first, GcrComparable *other); diff --git a/gcr/gcr-column.c b/gcr/gcr-column.c deleted file mode 100644 index 099e78e..0000000 --- a/gcr/gcr-column.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * gnome-keyring - * - * Copyright (C) 2011 Collabora Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see <http://www.gnu.org/licenses/>. - * - * Author: Stef Walter <stefw@collabora.co.uk> - */ - -#include "config.h" - -#include "gcr-column.h" - -/** - * GcrColumnFlags: - * @GCR_COLUMN_NONE: No column flags - * @GCR_COLUMN_HIDDEN: Don't display this column. - * @GCR_COLUMN_SORTABLE: This column is sortable. - * - * Flags to be used with a [struct@Column]. - */ - -/** - * GcrColumn: - * @property_name: The name of the property this column will display - * @property_type: The type of the property - * @column_type: The eventual type of the column - * @label: The display label for the column - * @flags: Flags from #GcrColumnFlags - * @transformer: A transformer function used to convert the value from - * the property type to the column type. Can be %NULL if the types - * are the same. - * @user_data: User data associated with the column - * - * Represents a column to display in a `GcrCollectionModel` or - * `GcrTreeSelector`. - * - * The label should be set as a translatable string with a context of - * `"column"`. This should be done with with this macro: - * - * ``` - * NC_("column", "My Column Name") - * ``` - */ diff --git a/gcr/gcr-column.h b/gcr/gcr-column.h deleted file mode 100644 index 9867575..0000000 --- a/gcr/gcr-column.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * gnome-keyring - * - * Copyright (C) 2010 Stefan Walter - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef __GCR_COLUMN_H__ -#define __GCR_COLUMN_H__ - -#if !defined (__GCR_INSIDE_HEADER__) && !defined (GCR_COMPILATION) -#error "Only <gcr/gcr.h> can be included directly." -#endif - -#include "gcr-types.h" - -#include <glib-object.h> - -G_BEGIN_DECLS - -typedef enum { - GCR_COLUMN_NONE = 0, - GCR_COLUMN_HIDDEN = 1 << 1, - GCR_COLUMN_SORTABLE = 1 << 2, -} GcrColumnFlags; - -typedef struct _GcrColumn { - const gchar *property_name; /* The property to retrieve */ - GType property_type; /* The property type */ - GType column_type; /* The resulting property type for this column */ - - const gchar *label; /* The label for this column, or NULL */ - GcrColumnFlags flags; /* Column flags */ - - GValueTransform transformer; /* The way to transform to this type or NULL */ - - gpointer user_data; - - /*< private >*/ - gpointer reserved; -} GcrColumn; - -G_END_DECLS - -#endif /* __GCR_COLUMN_H__ */ diff --git a/gcr/gcr-gnupg-key.c b/gcr/gcr-gnupg-key.c index defeaaf..9dd6dc4 100644 --- a/gcr/gcr-gnupg-key.c +++ b/gcr/gcr-gnupg-key.c @@ -373,24 +373,3 @@ _gcr_gnupg_key_get_keyid (GcrGnupgKey *self) g_return_val_if_fail (GCR_IS_GNUPG_KEY (self), NULL); return _gcr_gnupg_records_get_keyid (self->pv->public_records); } - -/** - * _gcr_gnupg_key_get_columns: - * - * Get the columns that we should display for gnupg keys. - * - * Returns: (transfer none): The columns, %NULL terminated, should not be freed. - */ -const GcrColumn* -_gcr_gnupg_key_get_columns (void) -{ - static GcrColumn columns[] = { - { "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"), - GCR_COLUMN_SORTABLE, NULL, 0 }, - { NULL } - }; - - return columns; -} diff --git a/gcr/gcr-gnupg-key.h b/gcr/gcr-gnupg-key.h index cceb71b..daab378 100644 --- a/gcr/gcr-gnupg-key.h +++ b/gcr/gcr-gnupg-key.h @@ -26,12 +26,10 @@ #include <glib-object.h> -#include "gcr-column.h" #include "gcr-types.h" G_BEGIN_DECLS -#define GCR_GNUPG_KEY_COLUMNS (_gcr_gnupg_key_get_columns ()) #define GCR_TYPE_GNUPG_KEY (_gcr_gnupg_key_get_type ()) #define GCR_GNUPG_KEY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCR_TYPE_GNUPG_KEY, GcrGnupgKey)) #define GCR_GNUPG_KEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCR_TYPE_GNUPG_KEY, GcrGnupgKeyClass)) @@ -55,8 +53,6 @@ struct _GcrGnupgKeyClass { GType _gcr_gnupg_key_get_type (void); -const GcrColumn* _gcr_gnupg_key_get_columns (void); - GcrGnupgKey* _gcr_gnupg_key_new (GPtrArray *pubset, GPtrArray *secset); @@ -35,7 +35,6 @@ #include <gcr/gcr-certificate.h> #include <gcr/gcr-certificate-chain.h> #include <gcr/gcr-certificate-request.h> -#include <gcr/gcr-column.h> #include <gcr/gcr-enum-types.h> #include <gcr/gcr-fingerprint.h> #include <gcr/gcr-importer.h> diff --git a/gcr/meson.build b/gcr/meson.build index 7ccb642..d3f231d 100644 --- a/gcr/meson.build +++ b/gcr/meson.build @@ -26,7 +26,6 @@ gcr_public_sources = files( gcr_private_sources = files( 'gcr-callback-output-stream.c', 'gcr-certificate-extensions.c', - 'gcr-column.c', 'gcr-gnupg-importer.c', 'gcr-gnupg-key.c', 'gcr-gnupg-process.c', @@ -46,7 +45,6 @@ gcr_headers = files( 'gcr-certificate.h', 'gcr-certificate-chain.h', 'gcr-certificate-request.h', - 'gcr-column.h', 'gcr-comparable.h', 'gcr-fingerprint.h', 'gcr-importer.h', |