soylent r115 - trunk/src
- From: treitter svn gnome org
- To: svn-commits-list gnome org
- Subject: soylent r115 - trunk/src
- Date: Tue, 1 Apr 2008 07:32:37 +0100 (BST)
Author: treitter
Date: Tue Apr 1 07:32:37 2008
New Revision: 115
URL: http://svn.gnome.org/viewvc/soylent?rev=115&view=rev
Log:
Rename 'live_contact' 'empathy_contact' -- there's not point in pretending we're abstracting libempathy
Modified:
trunk/src/soylent-browser-eds.c
trunk/src/soylent-browser-person-view.c
trunk/src/soylent-browser.c
trunk/src/soylent-person.c
trunk/src/soylent-person.h
Modified: trunk/src/soylent-browser-eds.c
==============================================================================
--- trunk/src/soylent-browser-eds.c (original)
+++ trunk/src/soylent-browser-eds.c Tue Apr 1 07:32:37 2008
@@ -115,8 +115,8 @@
const GList *e_contacts,
SoylentBrowser *browser)
{
- /* FIXME FIXME: we need to block the live_contacts callbacks for the body of
- * these EContact callbacks */
+ /* FIXME FIXME: we need to block the empathy_contacts callbacks for the body
+ * of these EContact callbacks */
gboolean retval = FALSE;
GList *c = NULL;
Modified: trunk/src/soylent-browser-person-view.c
==============================================================================
--- trunk/src/soylent-browser-person-view.c (original)
+++ trunk/src/soylent-browser-person-view.c Tue Apr 1 07:32:37 2008
@@ -1363,29 +1363,30 @@
person = soylent_browser_get_selected_person (browser);
if (person)
{
- GList *live_contacts = NULL;
- EmpathyContact *live_contact = NULL;
+ GList *empathy_contacts = NULL;
+ EmpathyContact *empathy_contact = NULL;
- live_contacts = soylent_person_get_live_contacts
- (person);
- for (; live_contacts;
- live_contacts = g_list_next (live_contacts))
+ empathy_contacts = soylent_person_get_empathy_contacts
+ (person);
+ for (; empathy_contacts;
+ empathy_contacts = g_list_next
+ (empathy_contacts))
{
- live_contact = EMPATHY_CONTACT
- (live_contacts->data);
- if (live_contact
+ empathy_contact = EMPATHY_CONTACT
+ (empathy_contacts->data);
+ if (empathy_contact
&& g_str_equal (empathy_contact_get_id
- (live_contact),
+ (empathy_contact),
im_handle))
{
break;
}
}
- if (live_contact)
+ if (empathy_contact)
{
account = empathy_contact_get_account
- (live_contact);
+ (empathy_contact);
if (account)
{
mission_control_request_channel_with_string_handle
@@ -1554,20 +1555,23 @@
person = people->data;
if (person)
{
- const GList *live_contacts = NULL;
- EmpathyContact *live_contact_cur = NULL;
+ const GList *empathy_contacts = NULL;
+ EmpathyContact *empathy_contact_cur = NULL;
/* FIXME: this needs to be sync'd for presence updates, and must
* only contain online IM names */
- for (live_contacts = soylent_person_get_live_contacts (person);
- live_contacts && (live_contact_cur = live_contacts->data);
- live_contacts = g_list_next (live_contacts))
+ for (empathy_contacts = soylent_person_get_empathy_contacts
+ (person);
+ empathy_contacts
+ && (empathy_contact_cur = empathy_contacts->data);
+ empathy_contacts = g_list_next (empathy_contacts))
{
GtkWidget *item = NULL;
item = gtk_menu_item_new_with_label
- (empathy_contact_get_id (live_contact_cur));
+ (empathy_contact_get_id
+ (empathy_contact_cur));
g_signal_connect
(G_OBJECT (item), "activate",
G_CALLBACK
Modified: trunk/src/soylent-browser.c
==============================================================================
--- trunk/src/soylent-browser.c (original)
+++ trunk/src/soylent-browser.c Tue Apr 1 07:32:37 2008
@@ -47,7 +47,7 @@
EmpathyContactManager *live_manager;
EmpathyIdle *live_idle;
/* Any EmpathyContacts unattached to e-d-s entries */
- GList *live_contacts_pending;
+ GList *empathy_contacts_pending;
guint icon_width_max;
guint icon_height_max;
@@ -62,14 +62,14 @@
GtkTreePath *path,
gpointer user_data);
-static SoylentPerson* soylent_browser_live_contact_find_owner_person
+static SoylentPerson* soylent_browser_empathy_contact_find_owner_person
(SoylentBrowser *browser,
EmpathyContact *empathy_contact);
-static gboolean soylent_browser_person_associate_live_contact
+static gboolean soylent_browser_person_associate_empathy_contact
(SoylentBrowser *browser,
SoylentPerson *person,
EmpathyContact *empathy_contact);
-static gboolean soylent_browser_person_dissociate_live_contact
+static gboolean soylent_browser_person_dissociate_empathy_contact
(SoylentBrowser *browser,
SoylentPerson *person,
EmpathyContact *empathy_contact);
@@ -108,7 +108,7 @@
{
GtkIconTheme *gtk_icon_theme = NULL;
browser->live_manager = NULL;
- browser->live_contacts_pending = NULL;
+ browser->empathy_contacts_pending = NULL;
browser->icon_width_max = ICON_MAX_WIDTH;
browser->icon_height_max = ICON_MAX_HEIGHT;
@@ -239,9 +239,9 @@
*/
/*
FIXME: actually do this
- g_hash_table_foreach (browser->live_contacts_pending,
- free_live_contacts_pending_key_value);
- g_hash_table_destroy (browser->live_contacts_pending);
+ g_hash_table_foreach (browser->empathy_contacts_pending,
+ free_empathy_contacts_pending_key_value);
+ g_hash_table_destroy (browser->empathy_contacts_pending);
*/
/* XXX: is anything else missing here? */
g_object_unref (browser->icon_stock_person);
@@ -694,8 +694,9 @@
/* Find the given EmpathyContact among the SoylentBrowser's IM contacts */
static SoylentPerson*
-soylent_browser_live_contact_find_owner_person (SoylentBrowser *browser,
- EmpathyContact *empathy_contact)
+soylent_browser_empathy_contact_find_owner_person
+ (SoylentBrowser *browser,
+ EmpathyContact *empathy_contact)
{
SoylentPerson *retval = NULL;
const gchar *live_name = NULL;
@@ -950,16 +951,16 @@
browser->live_manager = empathy_contact_manager_new ();
if (browser->live_manager)
{
- GList *live_contacts = NULL;
+ GList *empathy_contacts = NULL;
GList *l = NULL;
/* Manually call the "members-changed" callback to ensure we initialize
* our associations for each EmpathyContact (in case we missed the only
* "members-changed" signal instance we will get for some people for a
* while) */
- live_contacts = empathy_contact_list_get_members
+ empathy_contacts = empathy_contact_list_get_members
(EMPATHY_CONTACT_LIST (browser->live_manager));
- for (l = live_contacts;
+ for (l = empathy_contacts;
l && l->data && EMPATHY_CONTACT (l->data);
l = g_list_next (l))
{
@@ -986,7 +987,7 @@
* invocation above and rely on the callback to handle this stuff? */
/* Consider this function successful if we handled an empty roster (which
* can happen if Empathy hasn't populated it by this point) */
- if (!live_contacts)
+ if (!empathy_contacts)
{
retval = TRUE;
}
@@ -998,7 +999,7 @@
G_CALLBACK (soylent_browser_live_members_changed_cb),
browser);
- g_list_free (live_contacts);
+ g_list_free (empathy_contacts);
}
else
{
@@ -1310,8 +1311,8 @@
gboolean retval = FALSE;
SoylentPerson *person = NULL;
- person = soylent_browser_live_contact_find_owner_person (browser,
- empathy_contact);
+ person = soylent_browser_empathy_contact_find_owner_person (browser,
+ empathy_contact);
/* If we are being notified this contact is a new member to the roster, hook
* up signal callbacks and attach the EmpathyContact to the SoylentPerson */
@@ -1327,9 +1328,9 @@
G_CALLBACK (soylent_person_live_groups_updated_cb),
(gpointer) person);
g_signal_connect
- (empathy_contact, "notify::presence",
- G_CALLBACK (soylent_person_live_presence_updated_cb),
- (gpointer) person);
+ (empathy_contact, "notify::presence",
+ G_CALLBACK (soylent_person_live_presence_updated_cb),
+ (gpointer) person);
g_signal_connect (empathy_contact, "notify::name",
G_CALLBACK (soylent_person_live_name_updated_cb),
(gpointer) person);
@@ -1343,8 +1344,9 @@
/* this handles NULL person pointers (adds the contact to a browser-wide
* pool) */
- retval = soylent_browser_person_associate_live_contact (browser, person,
- empathy_contact);
+ retval = soylent_browser_person_associate_empathy_contact
+ (browser, person,
+ empathy_contact);
}
/* Otherwise, this EmpathyContact was removed from our roster; drop them from
* our own structures */
@@ -1373,7 +1375,8 @@
/* this handles NULL person pointers (adds the contact to a browser-wide
* pool) */
- retval = soylent_browser_person_dissociate_live_contact (browser, person,
+ retval = soylent_browser_person_dissociate_empathy_contact
+ (browser, person,
empathy_contact);
}
@@ -1443,7 +1446,8 @@
*
* Return TRUE for success, FALSE for any failure. */
static gboolean
-soylent_browser_person_associate_live_contact (SoylentBrowser *browser,
+soylent_browser_person_associate_empathy_contact
+ (SoylentBrowser *browser,
SoylentPerson *person,
EmpathyContact *empathy_contact)
{
@@ -1459,13 +1463,13 @@
/* FIXME: once SoylentPerson is a GObject, check SOYLENT_IS_PERSON */
if (person)
{
- retval = soylent_person_add_live_contact (person, empathy_contact);
+ retval = soylent_person_add_empathy_contact (person, empathy_contact);
}
else
{
- browser->live_contacts_pending = g_list_prepend
- (browser->live_contacts_pending,
- empathy_contact);
+ browser->empathy_contacts_pending = g_list_prepend
+ (browser->empathy_contacts_pending,
+ empathy_contact);
retval = TRUE;
}
@@ -1477,9 +1481,10 @@
*
* Return TRUE for success, FALSE for any failure. */
static gboolean
-soylent_browser_person_dissociate_live_contact (SoylentBrowser *browser,
- SoylentPerson *person,
- EmpathyContact *empathy_contact)
+soylent_browser_person_dissociate_empathy_contact
+ (SoylentBrowser *browser,
+ SoylentPerson *person,
+ EmpathyContact *empathy_contact)
{
gboolean retval = FALSE;
@@ -1493,13 +1498,13 @@
/* FIXME: once SoylentPerson is a GObject, check SOYLENT_IS_PERSON */
if (person)
{
- retval = soylent_person_remove_live_contact (person, empathy_contact);
+ retval = soylent_person_remove_empathy_contact (person, empathy_contact);
}
else
{
- browser->live_contacts_pending = g_list_remove_all
- (browser->live_contacts_pending,
- empathy_contact);
+ browser->empathy_contacts_pending = g_list_remove_all
+ (browser->empathy_contacts_pending,
+ empathy_contact);
retval = TRUE;
}
Modified: trunk/src/soylent-person.c
==============================================================================
--- trunk/src/soylent-person.c (original)
+++ trunk/src/soylent-person.c Tue Apr 1 07:32:37 2008
@@ -40,7 +40,7 @@
/* XXX: We'll need to be careful to keep this sync'd. Also, we'll be doing a
* lot of linear searches through this - but it really shouldn't be that long
*/
- GList *live_contacts;
+ GList *empathy_contacts;
SoylentPresence presence;
GtkTreeIter *iter;
@@ -68,7 +68,7 @@
retval->iter->stamp = SP_ITER_UNSET;
retval->e_contact = g_object_ref (e_contact);
retval->presence = SP_PRESENCE_UNSET;
- retval->live_contacts = NULL;
+ retval->empathy_contacts = NULL;
retval->browser = browser;
}
else
@@ -99,14 +99,14 @@
}
GList*
-soylent_person_get_live_contacts (SoylentPerson *person)
+soylent_person_get_empathy_contacts (SoylentPerson *person)
{
g_return_val_if_fail (person, NULL);
/* FIXME: uncomment once SoylentPerson is a GObject:
g_return_val_if_fail (SOYLENT_IS_PERSON (person), NULL);
* */
- return person->live_contacts;
+ return person->empathy_contacts;
}
SoylentPresence
@@ -178,15 +178,15 @@
}
else
{
- GList *live_contacts = NULL;
+ GList *empathy_contacts = NULL;
- live_contacts = soylent_person_get_live_contacts (person);
- if (live_contacts)
+ empathy_contacts = soylent_person_get_empathy_contacts (person);
+ if (empathy_contacts)
{
GList *c = NULL;
EmpathyContact *empathy_contact = NULL;
- for (c = live_contacts;
+ for (c = empathy_contacts;
c && c->data && EMPATHY_IS_CONTACT (c->data) && !retval;
c = g_list_next (c))
{
@@ -297,7 +297,8 @@
/* Returns TRUE upon success, FALSE otherwise */
gboolean
-soylent_person_set_live_contacts (SoylentPerson *person, GList *live_contacts)
+soylent_person_set_empathy_contacts (SoylentPerson *person,
+ GList *empathy_contacts)
{
gboolean retval = FALSE;
@@ -305,9 +306,9 @@
/* FIXME: uncomment once SoylentPerson is a GObject:
g_return_val_if_fail (SOYLENT_IS_PERSON (person), retval);
* */
- g_return_val_if_fail (live_contacts, retval);
+ g_return_val_if_fail (empathy_contacts, retval);
- person->live_contacts = live_contacts;
+ person->empathy_contacts = empathy_contacts;
/* XXX: check that each entry in the GList is an EmpathyContact? */
retval = TRUE;
@@ -317,11 +318,11 @@
/* Returns TRUE upon success, FALSE otherwise */
gboolean
-soylent_person_add_live_contact (SoylentPerson *person,
- EmpathyContact *empathy_contact)
+soylent_person_add_empathy_contact (SoylentPerson *person,
+ EmpathyContact *empathy_contact)
{
gboolean retval = FALSE;
- GList *live_contact_existing = NULL;
+ GList *empathy_contact_existing = NULL;
gboolean update_presence_retval = FALSE;
g_return_val_if_fail (person, retval);
@@ -332,11 +333,12 @@
g_return_val_if_fail (EMPATHY_IS_CONTACT (empathy_contact), retval);
/* Only add the contact if they aren't already among our live contacts */
- live_contact_existing = g_list_find (person->live_contacts, empathy_contact);
- if (!live_contact_existing)
+ empathy_contact_existing = g_list_find (person->empathy_contacts,
+ empathy_contact);
+ if (!empathy_contact_existing)
{
- person->live_contacts = g_list_prepend (person->live_contacts,
- empathy_contact);
+ person->empathy_contacts = g_list_prepend (person->empathy_contacts,
+ empathy_contact);
}
update_presence_retval = soylent_person_live_presence_updated_cb
@@ -356,8 +358,8 @@
/* Returns TRUE upon success, FALSE otherwise */
gboolean
-soylent_person_remove_live_contact (SoylentPerson *person,
- EmpathyContact *empathy_contact)
+soylent_person_remove_empathy_contact (SoylentPerson *person,
+ EmpathyContact *empathy_contact)
{
gboolean retval = FALSE;
gboolean update_presence_retval = FALSE;
@@ -369,8 +371,8 @@
g_return_val_if_fail (empathy_contact, retval);
g_return_val_if_fail (EMPATHY_IS_CONTACT (empathy_contact), retval);
- person->live_contacts = g_list_remove_all (person->live_contacts,
- empathy_contact);
+ person->empathy_contacts = g_list_remove_all (person->empathy_contacts,
+ empathy_contact);
update_presence_retval = soylent_person_live_presence_updated_cb
(empathy_contact,
@@ -466,7 +468,7 @@
g_return_val_if_fail (SOYLENT_IS_PERSON (person), retval);
*/
- for (l = person->live_contacts;
+ for (l = person->empathy_contacts;
l && l->data && EMPATHY_IS_CONTACT (l->data);
l = g_list_next (l))
{
@@ -600,11 +602,11 @@
gtk_list_store_remove (model, value->iter);
g_object_unref (value->e_contact);
- for (l = value->live_contacts; l && l->data; l = g_list_next (l))
+ for (l = value->empathy_contacts; l && l->data; l = g_list_next (l))
{
g_object_unref (l->data);
}
- g_list_free (value->live_contacts);
+ g_list_free (value->empathy_contacts);
g_free (value->iter);
g_free (value);
Modified: trunk/src/soylent-person.h
==============================================================================
--- trunk/src/soylent-person.h (original)
+++ trunk/src/soylent-person.h Tue Apr 1 07:32:37 2008
@@ -54,7 +54,7 @@
SoylentPerson* soylent_person_new (SoylentBrowser *sb, EContact *e_contact);
EContact* soylent_person_get_e_contact (SoylentPerson *person);
-GList* soylent_person_get_live_contacts (SoylentPerson *person);
+GList* soylent_person_get_empathy_contacts (SoylentPerson *person);
SoylentPresence soylent_person_get_presence (SoylentPerson *person);
GtkTreeIter* soylent_person_get_icon_view_iter (SoylentPerson *person);
SoylentBrowser* soylent_person_get_browser (SoylentPerson *person);
@@ -64,12 +64,13 @@
gchar* soylent_person_get_display_name_with_presence (SoylentPerson *person);
gboolean soylent_person_set_e_contact (SoylentPerson *person,
EContact *e_contact);
-gboolean soylent_person_set_live_contacts (SoylentPerson *person,
- GList *live_contacts);
-gboolean soylent_person_add_live_contact (SoylentPerson *person,
- EmpathyContact *live_contact);
-gboolean soylent_person_remove_live_contact (SoylentPerson *person,
- EmpathyContact *live_contact);
+gboolean soylent_person_set_empathy_contacts (SoylentPerson *person,
+ GList *empathy_contacts);
+gboolean soylent_person_add_empathy_contact (SoylentPerson *person,
+ EmpathyContact *empathy_contact);
+gboolean soylent_person_remove_empathy_contact
+ (SoylentPerson *person,
+ EmpathyContact *empathy_contact);
gint soylent_person_live_presence_compare (SoylentPresence presence1,
SoylentPresence presence2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]