/** * seahorse_object_get_property: * @obj: The object to get the property for * @prop_id: The property requested * @value: out - the value as #GValue * @pspec: a #GParamSpec for the warning * * Returns: The property of the object @obj defined by the id @prop_id in @value. * */ static void seahorse_object_get_property (GObject *obj, guint prop_id, GValue *value, GParamSpec *pspec) { SeahorseObject *self = SEAHORSE_OBJECT (obj); switch (prop_id) { case PROP_CONTEXT: g_value_set_object (value, seahorse_object_get_context (self)); break; case PROP_SOURCE: g_value_set_object (value, seahorse_object_get_source (self)); break; case PROP_PREFERRED: g_value_set_object (value, seahorse_object_get_preferred (self)); break; case PROP_PARENT: g_value_set_object (value, seahorse_object_get_parent (self)); break; case PROP_ID: g_value_set_uint (value, seahorse_object_get_id (self)); break; case PROP_TAG: g_value_set_uint (value, seahorse_object_get_tag (self)); break; case PROP_LABEL: g_value_set_string (value, seahorse_object_get_label (self)); break; case PROP_NICKNAME: g_value_set_string (value, seahorse_object_get_nickname (self)); break; case PROP_MARKUP: g_value_set_string (value, seahorse_object_get_markup (self)); break; case PROP_DESCRIPTION: g_value_set_string (value, seahorse_object_get_description (self)); break; case PROP_ICON: g_value_set_string (value, seahorse_object_get_icon (self)); break; case PROP_IDENTIFIER: g_value_set_string (value, seahorse_object_get_identifier (self)); break; case PROP_LOCATION: g_value_set_enum (value, seahorse_object_get_location (self)); break; case PROP_USAGE: g_value_set_enum (value, seahorse_object_get_usage (self)); break; case PROP_FLAGS: g_value_set_uint (value, seahorse_object_get_flags (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec); break; } }
guint seahorse_pgp_signature_get_sigtype (SeahorsePgpSignature *self) { SeahorseObject *sobj; GQuark id; g_return_val_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self), 0); id = seahorse_pgp_key_canonize_id (self->pv->keyid); sobj = seahorse_context_find_object (SCTX_APP (), id, SEAHORSE_LOCATION_LOCAL); if (sobj) { if (seahorse_object_get_usage (sobj) == SEAHORSE_USAGE_PRIVATE_KEY) return SKEY_PGPSIG_TRUSTED | SKEY_PGPSIG_PERSONAL; if (seahorse_object_get_flags (sobj) & SEAHORSE_FLAG_TRUSTED) return SKEY_PGPSIG_TRUSTED; } return 0; }
guint seahorse_pgp_signature_get_sigtype (SeahorsePgpSignature *self) { SeahorseGpgmeKeyring *keyring; SeahorseGpgmeKey *key; SeahorseObject *obj; g_return_val_if_fail (SEAHORSE_IS_PGP_SIGNATURE (self), 0); keyring = seahorse_pgp_backend_get_default_keyring (NULL); key = seahorse_gpgme_keyring_lookup (keyring, self->pv->keyid); if (key != NULL) { obj = SEAHORSE_OBJECT (key); if (seahorse_object_get_usage (obj) == SEAHORSE_USAGE_PRIVATE_KEY) return SKEY_PGPSIG_TRUSTED | SKEY_PGPSIG_PERSONAL; if (seahorse_object_get_flags (obj) & SEAHORSE_FLAG_TRUSTED) return SKEY_PGPSIG_TRUSTED; } return 0; }