/soc/2013/ankitkv/gobjectification: 307195f879f3: gtalk: Use G_P...
Ankit Vani
a at nevitus.org
Sat Nov 16 17:08:18 EST 2013
Changeset: 307195f879f332475fe06a6d20ab1c29e751cecb
Author: Ankit Vani <a at nevitus.org>
Date: 2013-11-17 03:37 +0530
Branch: soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/307195f879f3
Description:
gtalk: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
diffstat:
libpurple/protocols/jabber/google/google_p2p.c | 4 ++--
libpurple/protocols/jabber/jingle/content.c | 22 ++++++++++++++--------
libpurple/protocols/jabber/jingle/iceudp.c | 4 ++--
libpurple/protocols/jabber/jingle/rawudp.c | 4 ++--
libpurple/protocols/jabber/jingle/rtp.c | 6 ++++--
libpurple/protocols/jabber/jingle/session.c | 26 ++++++++++++++++++--------
6 files changed, 42 insertions(+), 24 deletions(-)
diffs (293 lines):
diff --git a/libpurple/protocols/jabber/google/google_p2p.c b/libpurple/protocols/jabber/google/google_p2p.c
--- a/libpurple/protocols/jabber/google/google_p2p.c
+++ b/libpurple/protocols/jabber/google/google_p2p.c
@@ -162,13 +162,13 @@ jingle_google_p2p_class_init(JingleGoogl
g_param_spec_pointer("local-candidates",
"Local candidates",
"The local candidates for this transport.",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_REMOTE_CANDIDATES,
g_param_spec_pointer("remote-candidates",
"Remote candidates",
"The remote candidates for this transport.",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(JingleGoogleP2PPrivate));
}
diff --git a/libpurple/protocols/jabber/jingle/content.c b/libpurple/protocols/jabber/jingle/content.c
--- a/libpurple/protocols/jabber/jingle/content.c
+++ b/libpurple/protocols/jabber/jingle/content.c
@@ -105,49 +105,49 @@ jingle_content_class_init (JingleContent
"Jingle Session",
"The jingle session parent of this content.",
JINGLE_TYPE_SESSION,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_CREATOR,
g_param_spec_string("creator",
"Creator",
"The participant that created this content.",
NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_DISPOSITION,
g_param_spec_string("disposition",
"Disposition",
"The disposition of the content.",
NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_NAME,
g_param_spec_string("name",
"Name",
"The name of this content.",
NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_SENDERS,
g_param_spec_string("senders",
"Senders",
"The sender of this content.",
NULL,
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_TRANSPORT,
g_param_spec_object("transport",
"transport",
"The transport of this content.",
JINGLE_TYPE_TRANSPORT,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_PENDING_TRANSPORT,
g_param_spec_object("pending-transport",
"Pending transport",
"The pending transport contained within this content",
JINGLE_TYPE_TRANSPORT,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(JingleContentPrivate));
}
@@ -343,7 +343,7 @@ JingleTransport *
jingle_content_get_pending_transport(JingleContent *content)
{
JingleTransport *pending_transport;
- g_object_get(content, "pending_transport", &pending_transport, NULL);
+ g_object_get(content, "pending-transport", &pending_transport, NULL);
return pending_transport;
}
@@ -358,8 +358,12 @@ jingle_content_accept_transport(JingleCo
{
if (content->priv->transport)
g_object_unref(content->priv->transport);
+
content->priv->transport = content->priv->pending_transport;
content->priv->pending_transport = NULL;
+
+ g_object_notify(G_OBJECT(content), "transport");
+ g_object_notify(G_OBJECT(content), "pending-transport");
}
void
@@ -369,6 +373,8 @@ jingle_content_remove_pending_transport(
g_object_unref(content->priv->pending_transport);
content->priv->pending_transport = NULL;
}
+
+ g_object_notify(G_OBJECT(content), "pending-transport");
}
void
diff --git a/libpurple/protocols/jabber/jingle/iceudp.c b/libpurple/protocols/jabber/jingle/iceudp.c
--- a/libpurple/protocols/jabber/jingle/iceudp.c
+++ b/libpurple/protocols/jabber/jingle/iceudp.c
@@ -175,13 +175,13 @@ jingle_iceudp_class_init (JingleIceUdpCl
g_param_spec_pointer("local-candidates",
"Local candidates",
"The local candidates for this transport.",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_REMOTE_CANDIDATES,
g_param_spec_pointer("remote-candidates",
"Remote candidates",
"The remote candidates for this transport.",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(JingleIceUdpPrivate));
}
diff --git a/libpurple/protocols/jabber/jingle/rawudp.c b/libpurple/protocols/jabber/jingle/rawudp.c
--- a/libpurple/protocols/jabber/jingle/rawudp.c
+++ b/libpurple/protocols/jabber/jingle/rawudp.c
@@ -146,13 +146,13 @@ jingle_rawudp_class_init (JingleRawUdpCl
g_param_spec_pointer("local-candidates",
"Local candidates",
"The local candidates for this transport.",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_REMOTE_CANDIDATES,
g_param_spec_pointer("remote-candidates",
"Remote candidates",
"The remote candidates for this transport.",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(JingleRawUdpPrivate));
}
diff --git a/libpurple/protocols/jabber/jingle/rtp.c b/libpurple/protocols/jabber/jingle/rtp.c
--- a/libpurple/protocols/jabber/jingle/rtp.c
+++ b/libpurple/protocols/jabber/jingle/rtp.c
@@ -114,13 +114,13 @@ jingle_rtp_class_init (JingleRtpClass *k
"Media Type",
"The media type (\"audio\" or \"video\") for this rtp session.",
NULL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_SSRC,
g_param_spec_string("ssrc",
"ssrc",
"The ssrc for this rtp session.",
NULL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(JingleRtpPrivate));
}
@@ -882,6 +882,7 @@ jingle_rtp_initiate_media(JabberStream *
jingle_session_add_content(session, content);
JINGLE_RTP(content)->priv->media_type = g_strdup("audio");
jingle_rtp_init_media(content);
+ g_object_notify(G_OBJECT(content), "media-type");
}
if (type & PURPLE_MEDIA_VIDEO) {
transport = jingle_transport_create(transport_type);
@@ -890,6 +891,7 @@ jingle_rtp_initiate_media(JabberStream *
jingle_session_add_content(session, content);
JINGLE_RTP(content)->priv->media_type = g_strdup("video");
jingle_rtp_init_media(content);
+ g_object_notify(G_OBJECT(content), "media-type");
}
g_free(me);
diff --git a/libpurple/protocols/jabber/jingle/session.c b/libpurple/protocols/jabber/jingle/session.c
--- a/libpurple/protocols/jabber/jingle/session.c
+++ b/libpurple/protocols/jabber/jingle/session.c
@@ -103,53 +103,53 @@ jingle_session_class_init (JingleSession
"Session ID",
"The unique session ID of the Jingle Session.",
NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_JS,
g_param_spec_pointer("js",
"JabberStream",
"The Jabber stream associated with this session.",
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_REMOTE_JID,
g_param_spec_string("remote-jid",
"Remote JID",
"The JID of the remote participant.",
NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_LOCAL_JID,
g_param_spec_string("local-jid",
"Local JID",
"The JID of the local participant.",
NULL,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_IS_INITIATOR,
g_param_spec_boolean("is-initiator",
"Is Initiator",
"Whether or not the local JID is the initiator of the session.",
FALSE,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_STATE,
g_param_spec_boolean("state",
"State",
"The state of the session (PENDING=FALSE, ACTIVE=TRUE).",
FALSE,
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_CONTENTS,
g_param_spec_pointer("contents",
"Contents",
"The active contents contained within this session",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(gobject_class, PROP_PENDING_CONTENTS,
g_param_spec_pointer("pending-contents",
"Pending contents",
"The pending contents contained within this session",
- G_PARAM_READABLE));
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(JingleSessionPrivate));
}
@@ -563,6 +563,8 @@ jingle_session_add_content(JingleSession
session->priv->contents =
g_list_append(session->priv->contents, content);
jingle_content_set_session(content, session);
+
+ g_object_notify(G_OBJECT(session), "contents");
}
void
@@ -575,6 +577,8 @@ jingle_session_remove_content(JingleSess
session->priv->contents =
g_list_remove(session->priv->contents, content);
g_object_unref(content);
+
+ g_object_notify(G_OBJECT(session), "contents");
}
}
@@ -584,6 +588,8 @@ jingle_session_add_pending_content(Jingl
session->priv->pending_contents =
g_list_append(session->priv->pending_contents, content);
jingle_content_set_session(content, session);
+
+ g_object_notify(G_OBJECT(session), "pending-contents");
}
void
@@ -595,6 +601,8 @@ jingle_session_remove_pending_content(Ji
session->priv->pending_contents =
g_list_remove(session->priv->pending_contents, content);
g_object_unref(content);
+
+ g_object_notify(G_OBJECT(session), "pending-contents");
}
}
@@ -614,6 +622,8 @@ void
jingle_session_accept_session(JingleSession *session)
{
session->priv->state = TRUE;
+
+ g_object_notify(G_OBJECT(session), "state");
}
JabberIq *
More information about the Commits
mailing list