From 83ae6b2684a95adfe1e2d0990e7ff40b03112437 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 22 Aug 2012 19:12:32 +0200 Subject: [PATCH 2/3] Move construct 'provider' property into RealmKerberos base class * That way we can create RealmKerberos as a concrete class * Derived classes override and actually use the property https://bugs.freedesktop.org/show_bug.cgi?id=53958 --- service/realm-kerberos.c | 11 ++++++++++- service/realm-samba.c | 4 +--- service/realm-sssd.c | 4 +--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/service/realm-kerberos.c b/service/realm-kerberos.c index 59801bb..0969210 100644 --- a/service/realm-kerberos.c +++ b/service/realm-kerberos.c @@ -24,6 +24,7 @@ #include "realm-kerberos.h" #include "realm-kerberos-membership.h" #include "realm-login-name.h" +#include "realm-provider.h" #include "realm-settings.h" #include @@ -47,7 +48,8 @@ struct _RealmKerberosPrivate { enum { PROP_0, PROP_NAME, - PROP_DISCOVERY + PROP_DISCOVERY, + PROP_PROVIDER, }; G_DEFINE_TYPE (RealmKerberos, realm_kerberos, G_TYPE_DBUS_OBJECT_SKELETON); @@ -654,6 +656,9 @@ realm_kerberos_set_property (GObject *obj, case PROP_DISCOVERY: realm_kerberos_set_discovery (self, g_value_get_boxed (value)); break; + case PROP_PROVIDER: + /* ignore */ + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; @@ -698,6 +703,10 @@ realm_kerberos_class_init (RealmKerberosClass *klass) g_object_class_install_property (object_class, PROP_DISCOVERY, g_param_spec_boxed ("discovery", "Discovery", "Discovery Data", G_TYPE_HASH_TABLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (object_class, PROP_PROVIDER, + g_param_spec_object ("provider", "Provider", "Samba Provider", + REALM_TYPE_PROVIDER, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } void diff --git a/service/realm-samba.c b/service/realm-samba.c index 6789ca7..d3dde2e 100644 --- a/service/realm-samba.c +++ b/service/realm-samba.c @@ -647,9 +647,7 @@ realm_samba_class_init (RealmSambaClass *klass) object_class->notify = realm_samba_notify; object_class->finalize = realm_samba_finalize; - g_object_class_install_property (object_class, PROP_PROVIDER, - g_param_spec_object ("provider", "Provider", "Samba Provider", - REALM_TYPE_PROVIDER, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + g_object_class_override_property (object_class, PROP_PROVIDER, "provider"); } static void diff --git a/service/realm-sssd.c b/service/realm-sssd.c index f5d3604..ce435eb 100644 --- a/service/realm-sssd.c +++ b/service/realm-sssd.c @@ -417,9 +417,7 @@ realm_sssd_class_init (RealmSssdClass *klass) object_class->notify = realm_sssd_notify; object_class->finalize = realm_sssd_finalize; - g_object_class_install_property (object_class, PROP_PROVIDER, - g_param_spec_object ("provider", "Provider", "SssdAd Provider", - REALM_TYPE_PROVIDER, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); + g_object_class_override_property (object_class, PROP_PROVIDER, "provider"); g_type_class_add_private (klass, sizeof (RealmSssdPrivate)); } -- 1.7.12