object-interest: remove unused _copy() method

object-interest is now ref-counted, so we can use _ref()
This commit is contained in:
George Kiagiadakis 2021-06-07 17:56:32 +03:00
parent 12f9e621e1
commit ac5c2ebbba
2 changed files with 1 additions and 36 deletions

View file

@ -48,7 +48,7 @@ struct _WpObjectInterest
};
G_DEFINE_BOXED_TYPE (WpObjectInterest, wp_object_interest,
wp_object_interest_copy, wp_object_interest_unref)
wp_object_interest_ref, wp_object_interest_unref)
/*!
* \brief Creates a new interest that declares interest in objects of the specified
@ -244,38 +244,6 @@ wp_object_interest_add_constraint (WpObjectInterest * self,
self->valid = FALSE;
}
/*!
* \brief Creates a deep copy of an object interest
* \ingroup wpobjectinterest
* \param self the object interest to copy
* \returns (transfer full): a deep copy of \a self
*/
WpObjectInterest *
wp_object_interest_copy (WpObjectInterest * self)
{
WpObjectInterest *copy;
struct constraint *c, *cc;
g_return_val_if_fail (self != NULL, NULL);
copy = wp_object_interest_new_type (self->gtype);
g_return_val_if_fail (copy != NULL, NULL);
pw_array_ensure_size (&copy->constraints, self->constraints.size);
pw_array_for_each (c, &self->constraints) {
cc = pw_array_add (&self->constraints, sizeof (struct constraint));
g_return_val_if_fail (cc != NULL, NULL);
cc->type = c->type;
cc->verb = c->verb;
cc->subject_type = c->subject_type;
cc->subject = g_strdup (c->subject);
cc->value = c->value ? g_variant_ref (c->value) : NULL;
}
copy->valid = self->valid;
return copy;
}
/*!
* \brief Increases the reference count of an object interest
* \ingroup wpobjectinterest

View file

@ -114,9 +114,6 @@ void wp_object_interest_add_constraint (WpObjectInterest * self,
WpConstraintType type, const gchar * subject,
WpConstraintVerb verb, GVariant * value);
WP_API
WpObjectInterest * wp_object_interest_copy (WpObjectInterest * self);
WP_API
WpObjectInterest * wp_object_interest_ref (WpObjectInterest *self);