Use G_SIGNAL_MUST_COLLECT for VARIANT signals

Bug #643624.
This commit is contained in:
Christian Persch 2011-03-04 18:21:51 +01:00 committed by Matthias Clasen
parent 122a53a9bc
commit 71c7e49058
3 changed files with 8 additions and 8 deletions

View File

@ -141,7 +141,9 @@ g_action_group_default_init (GActionGroupInterface *class)
g_action_group_signals[SIGNAL_ACTION_STATE_CHANGED] = g_action_group_signals[SIGNAL_ACTION_STATE_CHANGED] =
g_signal_new (I_("action-state-changed"), g_signal_new (I_("action-state-changed"),
G_TYPE_ACTION_GROUP, G_TYPE_ACTION_GROUP,
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, G_SIGNAL_RUN_LAST |
G_SIGNAL_DETAILED |
G_SIGNAL_MUST_COLLECT,
G_STRUCT_OFFSET (GActionGroupInterface, G_STRUCT_OFFSET (GActionGroupInterface,
action_state_changed), action_state_changed),
NULL, NULL, NULL, NULL,

View File

@ -497,7 +497,7 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
*/ */
signals[PROPERTIES_CHANGED_SIGNAL] = g_signal_new ("g-properties-changed", signals[PROPERTIES_CHANGED_SIGNAL] = g_signal_new ("g-properties-changed",
G_TYPE_DBUS_PROXY, G_TYPE_DBUS_PROXY,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
G_STRUCT_OFFSET (GDBusProxyClass, g_properties_changed), G_STRUCT_OFFSET (GDBusProxyClass, g_properties_changed),
NULL, NULL,
NULL, NULL,
@ -520,7 +520,7 @@ g_dbus_proxy_class_init (GDBusProxyClass *klass)
*/ */
signals[SIGNAL_SIGNAL] = g_signal_new ("g-signal", signals[SIGNAL_SIGNAL] = g_signal_new ("g-signal",
G_TYPE_DBUS_PROXY, G_TYPE_DBUS_PROXY,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
G_STRUCT_OFFSET (GDBusProxyClass, g_signal), G_STRUCT_OFFSET (GDBusProxyClass, g_signal),
NULL, NULL,
NULL, NULL,
@ -1029,14 +1029,13 @@ on_name_owner_changed (GDBusConnection *connection,
g_hash_table_size (proxy->priv->properties) > 0) g_hash_table_size (proxy->priv->properties) > 0)
{ {
GVariantBuilder builder; GVariantBuilder builder;
GVariant *changed_properties;
GPtrArray *invalidated_properties; GPtrArray *invalidated_properties;
GHashTableIter iter; GHashTableIter iter;
const gchar *key; const gchar *key;
/* Build changed_properties (always empty) and invalidated_properties ... */ /* Build changed_properties (always empty) and invalidated_properties ... */
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
changed_properties = g_variant_builder_end (&builder);
invalidated_properties = g_ptr_array_new_with_free_func (g_free); invalidated_properties = g_ptr_array_new_with_free_func (g_free);
g_hash_table_iter_init (&iter, proxy->priv->properties); g_hash_table_iter_init (&iter, proxy->priv->properties);
while (g_hash_table_iter_next (&iter, (gpointer) &key, NULL)) while (g_hash_table_iter_next (&iter, (gpointer) &key, NULL))
@ -1049,9 +1048,8 @@ on_name_owner_changed (GDBusConnection *connection,
/* ... and finally emit the ::g-properties-changed signal */ /* ... and finally emit the ::g-properties-changed signal */
g_signal_emit (proxy, signals[PROPERTIES_CHANGED_SIGNAL], g_signal_emit (proxy, signals[PROPERTIES_CHANGED_SIGNAL],
0, 0,
changed_properties, g_variant_builder_end (&builder) /* consumed */,
(const gchar* const *) invalidated_properties->pdata); (const gchar* const *) invalidated_properties->pdata);
g_variant_unref (changed_properties);
g_ptr_array_unref (invalidated_properties); g_ptr_array_unref (invalidated_properties);
} }
g_object_notify (G_OBJECT (proxy), "g-name-owner"); g_object_notify (G_OBJECT (proxy), "g-name-owner");

View File

@ -323,7 +323,7 @@ g_simple_action_class_init (GSimpleActionClass *class)
g_simple_action_signals[SIGNAL_ACTIVATE] = g_simple_action_signals[SIGNAL_ACTIVATE] =
g_signal_new (I_("activate"), g_signal_new (I_("activate"),
G_TYPE_SIMPLE_ACTION, G_TYPE_SIMPLE_ACTION,
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
G_STRUCT_OFFSET (GSimpleActionClass, activate), G_STRUCT_OFFSET (GSimpleActionClass, activate),
NULL, NULL, NULL, NULL,
g_cclosure_marshal_VOID__VARIANT, g_cclosure_marshal_VOID__VARIANT,