[gnome-keyring] Add function for registering well known renderers.



commit a973f429fb67242b51582fc408679c3efed259cb
Author: Stef Walter <stefw collabora co uk>
Date:   Thu Mar 31 09:08:55 2011 +0200

    Add function for registering well known renderers.
    
    Renderers for certificates and keys are registered.

 gcr/gcr-renderer.c |   12 ++++++++++++
 gcr/gcr-renderer.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gcr/gcr-renderer.c b/gcr/gcr-renderer.c
index 54e4216..fd50936 100644
--- a/gcr/gcr-renderer.c
+++ b/gcr/gcr-renderer.c
@@ -24,6 +24,9 @@
 #include "gcr-deprecated.h"
 #include "gcr-renderer.h"
 
+#include "gcr-certificate-renderer.h"
+#include "gcr-key-renderer.h"
+
 #include "gck/gck.h"
 
 #include <gtk/gtk.h>
@@ -229,6 +232,8 @@ gcr_renderer_create (const gchar *label, GckAttributes *attrs)
 
 	g_return_val_if_fail (attrs, NULL);
 
+	gcr_renderer_register_well_known ();
+
 	if (!registered_renderers)
 		return NULL;
 
@@ -279,3 +284,10 @@ gcr_renderer_register (GType renderer_type, GckAttributes *attrs)
 	g_array_append_val (registered_renderers, registered);
 	registered_sorted = FALSE;
 }
+
+void
+gcr_renderer_register_well_known (void)
+{
+	g_type_class_unref (g_type_class_ref (GCR_TYPE_CERTIFICATE_RENDERER));
+	g_type_class_unref (g_type_class_ref (GCR_TYPE_KEY_RENDERER));
+}
diff --git a/gcr/gcr-renderer.h b/gcr/gcr-renderer.h
index b09787b..242374a 100644
--- a/gcr/gcr-renderer.h
+++ b/gcr/gcr-renderer.h
@@ -77,6 +77,8 @@ GcrRenderer*              gcr_renderer_create                     (const gchar *
 void                      gcr_renderer_register                   (GType renderer_type,
                                                                    GckAttributes *attrs);
 
+void                   gcr_renderer_register_well_known           (void);
+
 G_END_DECLS
 
 #endif /* __GCR_RENDERER_H__ */



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