[folks] Ensure private and internal methods begin with a _
- From: Travis Reitter <treitter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [folks] Ensure private and internal methods begin with a _
- Date: Thu, 30 Dec 2010 01:24:28 +0000 (UTC)
commit 531ad2e2bab35e5aaa0be7fdb0eb12c8f6b5bcff
Author: Travis Reitter <travis reitter collabora co uk>
Date: Mon Dec 27 17:14:45 2010 -0800
Ensure private and internal methods begin with a _
Helps bgo#629083
HACKING | 4 +
backends/key-file/kf-backend.vala | 4 +-
backends/telepathy/lib/tpf-persona-store.vala | 176 ++++++++++++------------
backends/telepathy/lib/tpf-persona.vala | 28 ++--
backends/telepathy/tp-backend.vala | 20 ++--
folks/backend-store.vala | 42 +++---
folks/debug.vala | 2 +-
folks/has-presence.vala | 6 +-
folks/individual-aggregator.vala | 71 +++++-----
folks/individual.vala | 114 ++++++++--------
folks/persona.vala | 16 +-
11 files changed, 244 insertions(+), 239 deletions(-)
---
diff --git a/HACKING b/HACKING
index 8fd23e8..7e9e433 100644
--- a/HACKING
+++ b/HACKING
@@ -78,3 +78,7 @@ Vala-specific rules
members and local variables should not begin with a _). This is to make
non-public data members instantly recognizable as such (which helps
readability).
+
+6. Private and internal class functions should begin with a _ (public functions
+ should not begin with a _). This is to make non-public functions instantly
+ recognizable as such (which helps readability).
diff --git a/backends/key-file/kf-backend.vala b/backends/key-file/kf-backend.vala
index c050f79..4f1f4c9 100644
--- a/backends/key-file/kf-backend.vala
+++ b/backends/key-file/kf-backend.vala
@@ -102,7 +102,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
PersonaStore store = new Kf.PersonaStore (file);
this._persona_stores.insert (store.id, store);
- store.removed.connect (this.store_removed_cb);
+ store.removed.connect (this._store_removed_cb);
this.notify_property ("persona-stores");
this.persona_store_added (store);
@@ -130,7 +130,7 @@ public class Folks.Backends.Kf.Backend : Folks.Backend
this.notify_property ("is-prepared");
}
- private void store_removed_cb (Folks.PersonaStore store)
+ private void _store_removed_cb (Folks.PersonaStore store)
{
this.persona_store_removed (store);
this._persona_stores.remove (store.id);
diff --git a/backends/telepathy/lib/tpf-persona-store.vala b/backends/telepathy/lib/tpf-persona-store.vala
index 3301ac2..fd92d14 100644
--- a/backends/telepathy/lib/tpf-persona-store.vala
+++ b/backends/telepathy/lib/tpf-persona-store.vala
@@ -182,10 +182,10 @@ public class Tpf.PersonaStore : Folks.PersonaStore
display_name: account.display_name,
id: account.get_object_path ());
- this.reset ();
+ this._reset ();
}
- private void reset ()
+ private void _reset ()
{
/* We do not trust local-xmpp or IRC at all, since Persona UIDs can be
* faked by just changing hostname/username or nickname. */
@@ -259,7 +259,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
});
this.account.status_changed.connect (
- this.account_status_changed_cb);
+ this._account_status_changed_cb);
TelepathyGLib.ConnectionStatusReason reason;
var status = this.account.get_connection_status (out reason);
@@ -267,7 +267,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
* disconnected */
if (status != TelepathyGLib.ConnectionStatus.DISCONNECTED)
{
- this.account_status_changed_cb (
+ this._account_status_changed_cb (
TelepathyGLib.ConnectionStatus.DISCONNECTED, status,
reason, null, null);
}
@@ -282,7 +282,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
this._logger = null;
});
this._logger.favourite_contacts_changed.connect (
- this.favourite_contacts_changed_cb);
+ this._favourite_contacts_changed_cb);
}
catch (DBus.Error e)
{
@@ -297,7 +297,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private async void initialise_favourite_contacts ()
+ private async void _initialise_favourite_contacts ()
{
if (this._logger == null)
return;
@@ -319,7 +319,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
{
try
{
- this.change_favourites_by_request_handles ((Handle[]) h, i,
+ this._change_favourites_by_request_handles ((Handle[]) h, i,
e, true);
}
catch (GLib.Error e)
@@ -341,7 +341,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private void change_favourites_by_request_handles (Handle[] handles,
+ private void _change_favourites_by_request_handles (Handle[] handles,
string[] ids, GLib.Error? error, bool add) throws GLib.Error
{
if (error != null)
@@ -384,7 +384,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private void favourite_contacts_changed_cb (string[] added, string[] removed)
+ private void _favourite_contacts_changed_cb (string[] added, string[] removed)
{
/* Don't listen to favourites updates if the account is disconnected. */
if (this._conn == null)
@@ -398,7 +398,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
{
try
{
- this.change_favourites_by_request_handles ((Handle[]) h,
+ this._change_favourites_by_request_handles ((Handle[]) h,
i, e, true);
}
catch (GLib.Error e)
@@ -419,7 +419,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
{
try
{
- this.change_favourites_by_request_handles ((Handle[]) h,
+ this._change_favourites_by_request_handles ((Handle[]) h,
i, e, false);
}
catch (GLib.Error e)
@@ -435,7 +435,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
/* FIXME: the second generic type for details is "weak GLib.Value", but Vala
* doesn't accept it as a generic type */
- private void account_status_changed_cb (uint old_status, uint new_status,
+ private void _account_status_changed_cb (uint old_status, uint new_status,
uint reason, string? dbus_error_name,
GLib.HashTable<weak string, weak void*>? details)
{
@@ -449,14 +449,14 @@ public class Tpf.PersonaStore : Folks.PersonaStore
* to be destroyed, as that makes coming back online hard. */
this.personas_changed (null, this._personas.get_values (), null, null,
0);
- this.reset ();
+ this._reset ();
return;
}
else if (new_status != TelepathyGLib.ConnectionStatus.CONNECTED)
return;
var conn = this.account.connection;
- conn.notify["connection-ready"].connect (this.connection_ready_cb);
+ conn.notify["connection-ready"].connect (this._connection_ready_cb);
/* Deal with the case where the connection is already ready
* FIXME: We have to access the property manually until bgo#571348 is
@@ -465,16 +465,16 @@ public class Tpf.PersonaStore : Folks.PersonaStore
conn.get ("connection-ready", out connection_ready);
if (connection_ready == true)
- this.connection_ready_cb (conn, null);
+ this._connection_ready_cb (conn, null);
else
conn.prepare_async.begin (null);
}
- private void connection_ready_cb (Object s, ParamSpec? p)
+ private void _connection_ready_cb (Object s, ParamSpec? p)
{
Connection c = (Connection) s;
this._ll.connection_connect_to_new_group_channels (c,
- this.new_group_channels_cb);
+ this._new_group_channels_cb);
this._ll.connection_get_alias_flags_async.begin (c, (s2, res) =>
{
@@ -554,27 +554,27 @@ public class Tpf.PersonaStore : Folks.PersonaStore
this.notify_property ("can-group-personas");
});
- this.add_standard_channel (c, "publish");
- this.add_standard_channel (c, "stored");
- this.add_standard_channel (c, "subscribe");
+ this._add_standard_channel (c, "publish");
+ this._add_standard_channel (c, "stored");
+ this._add_standard_channel (c, "subscribe");
this._conn = c;
/* Add the local user */
- _conn.notify["self-handle"].connect (this.self_handle_changed_cb);
+ _conn.notify["self-handle"].connect (this._self_handle_changed_cb);
if (_conn.self_handle != 0)
- this.self_handle_changed_cb (_conn, null);
+ this._self_handle_changed_cb (_conn, null);
/* We can only initialise the favourite contacts once _conn is prepared */
- this.initialise_favourite_contacts.begin ();
+ this._initialise_favourite_contacts.begin ();
}
- private void self_handle_changed_cb (Object s, ParamSpec? p)
+ private void _self_handle_changed_cb (Object s, ParamSpec? p)
{
Connection c = (Connection) s;
/* Remove the old self persona */
if (this._self_contact != null)
- this.ignore_by_handle (this._self_contact.handle, null, null, 0);
+ this._ignore_by_handle (this._self_contact.handle, null, null, 0);
if (c.self_handle == 0)
return;
@@ -599,7 +599,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
/* Add the local user */
Contact contact = contacts[0];
- Persona persona = this.add_persona_from_contact (contact);
+ Persona persona = this._add_persona_from_contact (contact);
GLib.List<Persona> personas = new GLib.List<Persona> ();
personas.prepend (persona);
@@ -610,7 +610,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
this);
}
- private void new_group_channels_cb (TelepathyGLib.Channel? channel,
+ private void _new_group_channels_cb (TelepathyGLib.Channel? channel,
GLib.AsyncResult? result)
{
if (channel == null)
@@ -621,11 +621,11 @@ public class Tpf.PersonaStore : Folks.PersonaStore
return;
}
- this.set_up_new_group_channel (channel);
- this.channel_group_changes_resolve (channel);
+ this._set_up_new_group_channel (channel);
+ this._channel_group_changes_resolve (channel);
}
- private void channel_group_changes_resolve (Channel channel)
+ private void _channel_group_changes_resolve (Channel channel)
{
var group = channel.get_identifier ();
@@ -674,7 +674,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private void set_up_new_standard_channel (Channel channel)
+ private void _set_up_new_standard_channel (Channel channel)
{
debug ("Setting up new standard channel '%s'.",
channel.get_identifier ());
@@ -695,43 +695,43 @@ public class Tpf.PersonaStore : Folks.PersonaStore
this._publish = c;
c.group_members_changed_detailed.connect (
- this.publish_channel_group_members_changed_detailed_cb);
+ this._publish_channel_group_members_changed_detailed_cb);
}
else if (name == "stored")
{
this._stored = c;
c.group_members_changed_detailed.connect (
- this.stored_channel_group_members_changed_detailed_cb);
+ this._stored_channel_group_members_changed_detailed_cb);
}
else if (name == "subscribe")
{
this._subscribe = c;
c.group_members_changed_detailed.connect (
- this.subscribe_channel_group_members_changed_detailed_cb);
+ this._subscribe_channel_group_members_changed_detailed_cb);
c.group_flags_changed.connect (
- this.subscribe_channel_group_flags_changed_cb);
+ this._subscribe_channel_group_flags_changed_cb);
- this.subscribe_channel_group_flags_changed_cb (c,
+ this._subscribe_channel_group_flags_changed_cb (c,
c.group_get_flags (), 0);
}
this._standard_channels_unready.unset (name);
- c.invalidated.connect (this.channel_invalidated_cb);
+ c.invalidated.connect (this._channel_invalidated_cb);
unowned Intset? members = c.group_get_members ();
if (members != null)
{
- this.channel_group_pend_incoming_adds.begin (c,
+ this._channel_group_pend_incoming_adds.begin (c,
members.to_array (), true);
}
});
}
- private void publish_channel_group_members_changed_detailed_cb (
+ private void _publish_channel_group_members_changed_detailed_cb (
Channel channel,
/* FIXME: Array<uint> => Array<Handle>; parser bug */
Array<uint> added,
@@ -741,19 +741,19 @@ public class Tpf.PersonaStore : Folks.PersonaStore
HashTable details)
{
if (added.length > 0)
- this.channel_group_pend_incoming_adds.begin (channel, added, true);
+ this._channel_group_pend_incoming_adds.begin (channel, added, true);
/* we refuse to send these contacts our presence, so remove them */
for (var i = 0; i < removed.length; i++)
{
var handle = removed.index (i);
- this.ignore_by_handle_if_needed (handle, details);
+ this._ignore_by_handle_if_needed (handle, details);
}
/* FIXME: continue for the other arrays */
}
- private void stored_channel_group_members_changed_detailed_cb (
+ private void _stored_channel_group_members_changed_detailed_cb (
Channel channel,
/* FIXME: Array<uint> => Array<Handle>; parser bug */
Array<uint> added,
@@ -763,30 +763,30 @@ public class Tpf.PersonaStore : Folks.PersonaStore
HashTable details)
{
if (added.length > 0)
- this.channel_group_pend_incoming_adds.begin (channel, added, true);
+ this._channel_group_pend_incoming_adds.begin (channel, added, true);
for (var i = 0; i < removed.length; i++)
{
var handle = removed.index (i);
- this.ignore_by_handle_if_needed (handle, details);
+ this._ignore_by_handle_if_needed (handle, details);
}
}
- private void subscribe_channel_group_flags_changed_cb (
+ private void _subscribe_channel_group_flags_changed_cb (
Channel? channel,
uint added,
uint removed)
{
- this.update_capability ((ChannelGroupFlags) added,
+ this._update_capability ((ChannelGroupFlags) added,
(ChannelGroupFlags) removed, ChannelGroupFlags.CAN_ADD,
ref this._can_add_personas, "can-add-personas");
- this.update_capability ((ChannelGroupFlags) added,
+ this._update_capability ((ChannelGroupFlags) added,
(ChannelGroupFlags) removed, ChannelGroupFlags.CAN_REMOVE,
ref this._can_remove_personas, "can-remove-personas");
}
- private void update_capability (
+ private void _update_capability (
ChannelGroupFlags added,
ChannelGroupFlags removed,
ChannelGroupFlags tp_flag,
@@ -808,7 +808,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private void subscribe_channel_group_members_changed_detailed_cb (
+ private void _subscribe_channel_group_members_changed_detailed_cb (
Channel channel,
/* FIXME: Array<uint> => Array<Handle>; parser bug */
Array<uint> added,
@@ -819,13 +819,13 @@ public class Tpf.PersonaStore : Folks.PersonaStore
{
if (added.length > 0)
{
- this.channel_group_pend_incoming_adds.begin (channel, added, true);
+ this._channel_group_pend_incoming_adds.begin (channel, added, true);
/* expose ourselves to anyone we can see */
if (this._publish != null)
{
- this.channel_group_pend_incoming_adds.begin (this._publish, added,
- true);
+ this._channel_group_pend_incoming_adds.begin (this._publish,
+ added, true);
}
}
@@ -833,13 +833,13 @@ public class Tpf.PersonaStore : Folks.PersonaStore
for (var i = 0; i < removed.length; i++)
{
var handle = removed.index (i);
- this.ignore_by_handle_if_needed (handle, details);
+ this._ignore_by_handle_if_needed (handle, details);
}
/* FIXME: continue for the other arrays */
}
- private void channel_invalidated_cb (TelepathyGLib.Proxy proxy, uint domain,
+ private void _channel_invalidated_cb (TelepathyGLib.Proxy proxy, uint domain,
int code, string message)
{
var channel = (Channel) proxy;
@@ -862,7 +862,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private void ignore_by_handle_if_needed (uint handle,
+ private void _ignore_by_handle_if_needed (uint handle,
HashTable<string, HashTable<string, Value?>> details)
{
unowned TelepathyGLib.Intset members;
@@ -897,17 +897,17 @@ public class Tpf.PersonaStore : Folks.PersonaStore
uint32 tp_reason = TelepathyGLib.asv_get_uint32 (details, "change-reason",
out valid);
if (valid)
- reason = change_reason_from_tp_reason (tp_reason);
+ reason = _change_reason_from_tp_reason (tp_reason);
- this.ignore_by_handle (handle, message, actor, reason);
+ this._ignore_by_handle (handle, message, actor, reason);
}
- private Groupable.ChangeReason change_reason_from_tp_reason (uint reason)
+ private Groupable.ChangeReason _change_reason_from_tp_reason (uint reason)
{
return (Groupable.ChangeReason) reason;
}
- private void ignore_by_handle (uint handle, string? message, Persona? actor,
+ private void _ignore_by_handle (uint handle, string? message, Persona? actor,
Groupable.ChangeReason reason)
{
var persona = this._handle_persona_map[handle];
@@ -1021,7 +1021,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
/* Only non-group contact list channels should use create_personas == true,
* since the exposed set of Personas are meant to be filtered by them */
- private async void channel_group_pend_incoming_adds (Channel channel,
+ private async void _channel_group_pend_incoming_adds (Channel channel,
Array<uint> adds,
bool create_personas)
{
@@ -1030,7 +1030,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
{
if (create_personas)
{
- yield this.create_personas_from_channel_handles_async (channel,
+ yield this._create_personas_from_channel_handles_async (channel,
adds);
}
@@ -1055,10 +1055,10 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- this.channel_groups_add_new_personas ();
+ this._channel_groups_add_new_personas ();
}
- private void set_up_new_group_channel (Channel channel)
+ private void _set_up_new_group_channel (Channel channel)
{
/* hold a ref to the channel here until it's ready, so it doesn't
* disappear */
@@ -1072,20 +1072,20 @@ public class Tpf.PersonaStore : Folks.PersonaStore
this._groups[name] = c;
this._group_channels_unready.unset (name);
- c.invalidated.connect (this.channel_invalidated_cb);
+ c.invalidated.connect (this._channel_invalidated_cb);
c.group_members_changed_detailed.connect (
- this.channel_group_members_changed_detailed_cb);
+ this._channel_group_members_changed_detailed_cb);
unowned Intset members = c.group_get_members ();
if (members != null)
{
- this.channel_group_pend_incoming_adds.begin (c,
+ this._channel_group_pend_incoming_adds.begin (c,
members.to_array (), false);
}
});
}
- private void channel_group_members_changed_detailed_cb (Channel channel,
+ private void _channel_group_members_changed_detailed_cb (Channel channel,
/* FIXME: Array<uint> => Array<Handle>; parser bug */
Array<uint> added,
Array<uint> removed,
@@ -1094,12 +1094,12 @@ public class Tpf.PersonaStore : Folks.PersonaStore
HashTable details)
{
if (added != null)
- this.channel_group_pend_incoming_adds.begin (channel, added, false);
+ this._channel_group_pend_incoming_adds.begin (channel, added, false);
/* FIXME: continue for the other arrays */
}
- internal async void change_group_membership (Folks.Persona persona,
+ internal async void _change_group_membership (Folks.Persona persona,
string group, bool is_member)
{
var tp_persona = (Tpf.Persona) persona;
@@ -1125,11 +1125,11 @@ public class Tpf.PersonaStore : Folks.PersonaStore
else
{
/* the channel is already ready, so resolve immediately */
- this.channel_group_changes_resolve (channel);
+ this._channel_group_changes_resolve (channel);
}
}
- private void change_standard_contact_list_membership (
+ private void _change_standard_contact_list_membership (
TelepathyGLib.Channel channel, Folks.Persona persona, bool is_member)
{
var tp_persona = (Tpf.Persona) persona;
@@ -1162,7 +1162,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private async Channel? add_standard_channel (Connection conn, string name)
+ private async Channel? _add_standard_channel (Connection conn, string name)
{
Channel? channel = null;
@@ -1183,13 +1183,13 @@ public class Tpf.PersonaStore : Folks.PersonaStore
return null;
}
- this.set_up_new_standard_channel (channel);
+ this._set_up_new_standard_channel (channel);
return channel;
}
/* FIXME: Array<uint> => Array<Handle>; parser bug */
- private async void create_personas_from_channel_handles_async (
+ private async void _create_personas_from_channel_handles_async (
Channel channel,
Array<uint> channel_handles)
{
@@ -1224,7 +1224,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
j++;
}
- this.add_new_personas_from_contacts (contacts_array);
+ this._add_new_personas_from_contacts (contacts_array);
}
catch (GLib.Error e)
{
@@ -1236,7 +1236,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private async GLib.List<Tpf.Persona>? create_personas_from_contact_ids (
+ private async GLib.List<Tpf.Persona>? _create_personas_from_contact_ids (
string[] contact_ids) throws GLib.Error
{
if (contact_ids.length > 0)
@@ -1255,7 +1255,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
debug ("Creating persona from contact '%s'", contact.identifier);
- var persona = this.add_persona_from_contact (contact);
+ var persona = this._add_persona_from_contact (contact);
if (persona != null)
personas.prepend (persona);
}
@@ -1281,7 +1281,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
return null;
}
- private Tpf.Persona? add_persona_from_contact (Contact contact)
+ private Tpf.Persona? _add_persona_from_contact (Contact contact)
{
var h = contact.get_handle ();
@@ -1306,23 +1306,23 @@ public class Tpf.PersonaStore : Folks.PersonaStore
return null;
}
- private void add_new_personas_from_contacts (Contact[] contacts)
+ private void _add_new_personas_from_contacts (Contact[] contacts)
{
GLib.List<Persona> personas = new GLib.List<Persona> ();
foreach (Contact contact in contacts)
{
- var persona = this.add_persona_from_contact (contact);
+ var persona = this._add_persona_from_contact (contact);
if (persona != null)
personas.prepend (persona);
}
- this.channel_groups_add_new_personas ();
+ this._channel_groups_add_new_personas ();
if (personas != null)
this.personas_changed (personas, null, null, null, 0);
}
- private void channel_groups_add_new_personas ()
+ private void _channel_groups_add_new_personas ()
{
foreach (var entry in this._channel_group_incoming_adds.entries)
{
@@ -1359,7 +1359,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
this._channel_group_personas_map[channel] = members;
var name = channel.get_identifier ();
- if (this.group_is_display_group (name) &&
+ if (this._group_is_display_group (name) &&
members_added.length () > 0)
{
members_added.reverse ();
@@ -1368,7 +1368,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
}
}
- private bool group_is_display_group (string group)
+ private bool _group_is_display_group (string group)
{
for (var i = 0; i < this._undisplayed_groups.length; i++)
{
@@ -1411,7 +1411,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
try
{
- var personas = yield create_personas_from_contact_ids (
+ var personas = yield _create_personas_from_contact_ids (
contact_ids);
if (personas == null)
@@ -1424,7 +1424,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
var persona = personas.data;
if (this._subscribe != null)
- change_standard_contact_list_membership (_subscribe, persona,
+ _change_standard_contact_list_membership (_subscribe, persona,
true);
if (this._publish != null)
@@ -1433,7 +1433,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
if ((flags & ChannelGroupFlags.CAN_ADD) ==
ChannelGroupFlags.CAN_ADD)
{
- change_standard_contact_list_membership (_publish,
+ _change_standard_contact_list_membership (_publish,
persona, true);
}
}
@@ -1474,7 +1474,7 @@ public class Tpf.PersonaStore : Folks.PersonaStore
bool is_favourite)
{
/* It's possible for us to not be able to connect to the logger;
- * see connection_ready_cb() */
+ * see _connection_ready_cb() */
if (this._logger == null)
{
warning (
diff --git a/backends/telepathy/lib/tpf-persona.vala b/backends/telepathy/lib/tpf-persona.vala
index 7829b35..26e1944 100644
--- a/backends/telepathy/lib/tpf-persona.vala
+++ b/backends/telepathy/lib/tpf-persona.vala
@@ -171,7 +171,7 @@ public class Tpf.Persona : Folks.Persona,
if (_change_group (group, is_member))
{
Tpf.PersonaStore store = (Tpf.PersonaStore) this.store;
- yield store.change_group_membership (this, group, is_member);
+ yield store._change_group_membership (this, group, is_member);
}
}
@@ -214,7 +214,7 @@ public class Tpf.Persona : Folks.Persona,
{
unowned string id = contact.get_identifier ();
unowned Connection connection = contact.connection;
- var account = account_for_connection (connection);
+ var account = _account_for_connection (connection);
string uid = this.build_uid ("telepathy", account.get_protocol (), id);
Object (alias: contact.get_alias (),
@@ -264,20 +264,20 @@ public class Tpf.Persona : Folks.Persona,
contact.notify["avatar-file"].connect ((s, p) =>
{
- this.contact_notify_avatar ();
+ this._contact_notify_avatar ();
});
- this.contact_notify_avatar ();
+ this._contact_notify_avatar ();
contact.notify["presence-message"].connect ((s, p) =>
{
- this.contact_notify_presence_message ();
+ this._contact_notify_presence_message ();
});
contact.notify["presence-type"].connect ((s, p) =>
{
- this.contact_notify_presence_type ();
+ this._contact_notify_presence_type ();
});
- this.contact_notify_presence_message ();
- this.contact_notify_presence_type ();
+ this._contact_notify_presence_message ();
+ this._contact_notify_presence_type ();
((Tpf.PersonaStore) this.store).group_members_changed.connect (
(s, group, added, removed) =>
@@ -311,7 +311,7 @@ public class Tpf.Persona : Folks.Persona,
debug ("Destroying Tpf.Persona '%s': %p", this.uid, this);
}
- private static Account? account_for_connection (Connection conn)
+ private static Account? _account_for_connection (Connection conn)
{
var manager = AccountManager.dup ();
GLib.List<unowned Account> accounts = manager.get_valid_accounts ();
@@ -330,18 +330,18 @@ public class Tpf.Persona : Folks.Persona,
return account_found;
}
- private void contact_notify_presence_message ()
+ private void _contact_notify_presence_message ()
{
this.presence_message = this.contact.get_presence_message ();
}
- private void contact_notify_presence_type ()
+ private void _contact_notify_presence_type ()
{
- this.presence_type = folks_presence_type_from_tp (
+ this.presence_type = _folks_presence_type_from_tp (
this.contact.get_presence_type ());
}
- private static PresenceType folks_presence_type_from_tp (
+ private static PresenceType _folks_presence_type_from_tp (
TelepathyGLib.ConnectionPresenceType type)
{
switch (type)
@@ -369,7 +369,7 @@ public class Tpf.Persona : Folks.Persona,
}
}
- private void contact_notify_avatar ()
+ private void _contact_notify_avatar ()
{
var file = this.contact.avatar_file;
if (this.avatar != file)
diff --git a/backends/telepathy/tp-backend.vala b/backends/telepathy/tp-backend.vala
index c5f16a4..3d32e87 100644
--- a/backends/telepathy/tp-backend.vala
+++ b/backends/telepathy/tp-backend.vala
@@ -79,19 +79,19 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
this._account_manager = AccountManager.dup ();
yield this._account_manager.prepare_async (null);
this._account_manager.account_enabled.connect (
- this.account_enabled_cb);
+ this._account_enabled_cb);
this._account_manager.account_validity_changed.connect (
(a, valid) =>
{
if (valid)
- this.account_enabled_cb (a);
+ this._account_enabled_cb (a);
});
GLib.List<unowned Account> accounts =
this._account_manager.get_valid_accounts ();
foreach (Account account in accounts)
{
- this.account_enabled_cb (account);
+ this._account_enabled_cb (account);
}
this._is_prepared = true;
@@ -106,9 +106,9 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
public override async void unprepare () throws GLib.Error
{
this._account_manager.account_enabled.disconnect (
- this.account_enabled_cb);
+ this._account_enabled_cb);
this._account_manager.account_validity_changed.disconnect (
- this.account_validity_changed_cb);
+ this._account_validity_changed_cb);
this._account_manager = null;
this._persona_stores.foreach ((k, v) =>
@@ -123,13 +123,13 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
this.notify_property ("is-prepared");
}
- private void account_validity_changed_cb (Account account, bool valid)
+ private void _account_validity_changed_cb (Account account, bool valid)
{
if (valid)
- this.account_enabled_cb (account);
+ this._account_enabled_cb (account);
}
- private void account_enabled_cb (Account account)
+ private void _account_enabled_cb (Account account)
{
PersonaStore store = this._persona_stores.lookup (
account.get_object_path ());
@@ -140,13 +140,13 @@ public class Folks.Backends.Tp.Backend : Folks.Backend
store = new Tpf.PersonaStore (account);
this._persona_stores.insert (store.id, store);
- store.removed.connect (this.store_removed_cb);
+ store.removed.connect (this._store_removed_cb);
this.notify_property ("persona-stores");
this.persona_store_added (store);
}
- private void store_removed_cb (PersonaStore store)
+ private void _store_removed_cb (PersonaStore store)
{
this.persona_store_removed (store);
this._persona_stores.remove (store.id);
diff --git a/folks/backend-store.vala b/folks/backend-store.vala
index af84ab7..8406023 100644
--- a/folks/backend-store.vala
+++ b/folks/backend-store.vala
@@ -119,7 +119,7 @@ public class Folks.BackendStore : Object {
private BackendStore ()
{
/* Treat this as a library init function */
- Debug.set_flags (Environment.get_variable ("FOLKS_DEBUG"));
+ Debug._set_flags (Environment.get_variable ("FOLKS_DEBUG"));
this.modules = new HashMap<string,unowned Module> (str_hash, str_equal);
this._backend_hash = new HashMap<string,Backend> (str_hash, str_equal);
@@ -156,7 +156,7 @@ public class Folks.BackendStore : Object {
public async void prepare ()
{
/* (re-)load the list of disabled backends */
- yield this.load_disabled_backend_names ();
+ yield this._load_disabled_backend_names ();
if (this._is_prepared == true)
return;
@@ -181,7 +181,7 @@ public class Folks.BackendStore : Object {
/* unload backends that have been disabled since they were loaded */
foreach (var backend_existing in this._backend_hash.values)
{
- yield this.backend_unload_if_needed (backend_existing);
+ yield this._backend_unload_if_needed (backend_existing);
}
var path = Environment.get_variable ("FOLKS_BACKEND_PATH");
@@ -207,14 +207,14 @@ public class Folks.BackendStore : Object {
bool is_file;
bool is_dir;
- yield get_file_info (file, out is_file, out is_dir);
+ yield _get_file_info (file, out is_file, out is_dir);
if (is_file)
{
modules.set (subpath, file);
}
else if (is_dir)
{
- var cur_modules = yield this.get_modules_from_dir (file);
+ var cur_modules = yield this._get_modules_from_dir (file);
foreach (var entry in cur_modules.entries)
modules.set (entry.key, entry.value);
}
@@ -231,16 +231,16 @@ public class Folks.BackendStore : Object {
* prepare and unprepare backends such that they match the state in the
* backend store key file */
foreach (var module in modules.values)
- this.load_module_from_file (module);
+ this._load_module_from_file (module);
- /* this is populated indirectly from load_module_from_file(), above */
+ /* this is populated indirectly from _load_module_from_file(), above */
foreach (var backend in this._backend_hash.values)
- yield this.backend_load_if_needed (backend);
+ yield this._backend_load_if_needed (backend);
}
- private async void backend_load_if_needed (Backend backend)
+ private async void _backend_load_if_needed (Backend backend)
{
- if (this.backend_is_enabled (backend.name))
+ if (this._backend_is_enabled (backend.name))
{
if (!this._prepared_backends.has_key (backend.name))
{
@@ -263,11 +263,11 @@ public class Folks.BackendStore : Object {
}
}
- private async bool backend_unload_if_needed (Backend backend)
+ private async bool _backend_unload_if_needed (Backend backend)
{
bool unloaded = false;
- if (!this.backend_is_enabled (backend.name))
+ if (!this._backend_is_enabled (backend.name))
{
var backend_existing = this._backend_hash.get (backend.name);
if (backend_existing != null)
@@ -309,7 +309,7 @@ public class Folks.BackendStore : Object {
this._backend_hash.set (backend.name, backend);
}
- private bool backend_is_enabled (string name)
+ private bool _backend_is_enabled (string name)
{
bool enabled = true;
try
@@ -365,7 +365,7 @@ public class Folks.BackendStore : Object {
public async void enable_backend (string name)
{
this.backends_key_file.set_boolean (name, "enabled", true);
- yield this.save_key_file ();
+ yield this._save_key_file ();
}
/**
@@ -381,10 +381,10 @@ public class Folks.BackendStore : Object {
public async void disable_backend (string name)
{
this.backends_key_file.set_boolean (name, "enabled", false);
- yield this.save_key_file ();
+ yield this._save_key_file ();
}
- private async HashMap<string, File>? get_modules_from_dir (File dir)
+ private async HashMap<string, File>? _get_modules_from_dir (File dir)
{
debug ("Searching for modules in folder '%s' ..", dir.get_path ());
@@ -433,7 +433,7 @@ public class Folks.BackendStore : Object {
if (file_type == FileType.DIRECTORY)
{
- var modules = yield this.get_modules_from_dir (file);
+ var modules = yield this._get_modules_from_dir (file);
foreach (var entry in modules.entries)
modules_final.set (entry.key, entry.value);
}
@@ -456,7 +456,7 @@ public class Folks.BackendStore : Object {
return modules_final;
}
- private void load_module_from_file (File file)
+ private void _load_module_from_file (File file)
{
string file_path = file.get_path ();
@@ -504,7 +504,7 @@ public class Folks.BackendStore : Object {
debug ("Loaded module source: '%s'", module.name ());
}
- private async static void get_file_info (File file,
+ private async static void _get_file_info (File file,
out bool is_file,
out bool is_dir)
{
@@ -541,7 +541,7 @@ public class Folks.BackendStore : Object {
is_dir = (file_info.get_file_type () == FileType.DIRECTORY);
}
- private async void load_disabled_backend_names ()
+ private async void _load_disabled_backend_names ()
{
File file;
string path =
@@ -591,7 +591,7 @@ public class Folks.BackendStore : Object {
}
}
- private async void save_key_file ()
+ private async void _save_key_file ()
{
string key_file_data = this.backends_key_file.to_data ();
diff --git a/folks/debug.vala b/folks/debug.vala
index 27ced0c..f9c6cd3 100644
--- a/folks/debug.vala
+++ b/folks/debug.vala
@@ -29,7 +29,7 @@ namespace Folks.Debug
KEY_FILE_BACKEND = 1 << 2
}
- internal static void set_flags (string? debug_flags)
+ internal static void _set_flags (string? debug_flags)
{
GLib.DebugKey keys[3] =
{
diff --git a/folks/has-presence.vala b/folks/has-presence.vala
index 9d88943..842313f 100644
--- a/folks/has-presence.vala
+++ b/folks/has-presence.vala
@@ -101,7 +101,7 @@ public interface Folks.HasPresence : Object
/* Rank the presence types for comparison purposes, with higher numbers
* meaning more available */
- private static uint type_availability (PresenceType type)
+ private static uint _type_availability (PresenceType type)
{
switch (type)
{
@@ -142,8 +142,8 @@ public interface Folks.HasPresence : Object
*/
public static int typecmp (PresenceType type_a, PresenceType type_b)
{
- return (int) type_availability (type_a) -
- (int) type_availability (type_b);
+ return (int) _type_availability (type_a) -
+ (int) _type_availability (type_b);
}
/**
diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala
index 8ed8c23..4336f89 100644
--- a/folks/individual-aggregator.vala
+++ b/folks/individual-aggregator.vala
@@ -155,7 +155,8 @@ public class Folks.IndividualAggregator : Object
disable_linking == "no" || disable_linking == "0");
this._backend_store = BackendStore.dup ();
- this._backend_store.backend_available.connect (this.backend_available_cb);
+ this._backend_store.backend_available.connect (
+ this._backend_available_cb);
}
/**
@@ -188,36 +189,36 @@ public class Folks.IndividualAggregator : Object
}
}
- private async void add_backend (Backend backend)
+ private async void _add_backend (Backend backend)
{
if (!this._backends.contains (backend))
{
this._backends.add (backend);
backend.persona_store_added.connect (
- this.backend_persona_store_added_cb);
+ this._backend_persona_store_added_cb);
backend.persona_store_removed.connect (
- this.backend_persona_store_removed_cb);
+ this._backend_persona_store_removed_cb);
/* handle the stores that have already been signaled */
backend.persona_stores.foreach ((k, v) =>
{
- this.backend_persona_store_added_cb (backend,
+ this._backend_persona_store_added_cb (backend,
(PersonaStore) v);
});
}
}
- private void backend_available_cb (BackendStore backend_store,
+ private void _backend_available_cb (BackendStore backend_store,
Backend backend)
{
- this.add_backend.begin (backend);
+ this._add_backend.begin (backend);
}
- private void backend_persona_store_added_cb (Backend backend,
+ private void _backend_persona_store_added_cb (Backend backend,
PersonaStore store)
{
- string store_id = this.get_store_full_id (store.type_id, store.id);
+ string store_id = this._get_store_full_id (store.type_id, store.id);
/* FIXME: We hardcode the key-file backend's singleton PersonaStore as the
* only trusted and writeable PersonaStore for now. */
@@ -229,9 +230,9 @@ public class Folks.IndividualAggregator : Object
}
this._stores.set (store_id, store);
- store.personas_changed.connect (this.personas_changed_cb);
- store.notify["is-writeable"].connect (this.is_writeable_changed_cb);
- store.notify["trust-level"].connect (this.trust_level_changed_cb);
+ store.personas_changed.connect (this._personas_changed_cb);
+ store.notify["is-writeable"].connect (this._is_writeable_changed_cb);
+ store.notify["trust-level"].connect (this._trust_level_changed_cb);
store.prepare.begin ((obj, result) =>
{
@@ -249,12 +250,12 @@ public class Folks.IndividualAggregator : Object
});
}
- private void backend_persona_store_removed_cb (Backend backend,
+ private void _backend_persona_store_removed_cb (Backend backend,
PersonaStore store)
{
- store.personas_changed.disconnect (this.personas_changed_cb);
- store.notify["trust-level"].disconnect (this.trust_level_changed_cb);
- store.notify["is-writeable"].disconnect (this.is_writeable_changed_cb);
+ store.personas_changed.disconnect (this._personas_changed_cb);
+ store.notify["trust-level"].disconnect (this._trust_level_changed_cb);
+ store.notify["is-writeable"].disconnect (this._is_writeable_changed_cb);
/* no need to remove this store's personas from all the individuals, since
* they'll do that themselves (and emit their own 'removed' signal if
@@ -262,15 +263,15 @@ public class Folks.IndividualAggregator : Object
if (this._writeable_store == store)
this._writeable_store = null;
- this._stores.unset (this.get_store_full_id (store.type_id, store.id));
+ this._stores.unset (this._get_store_full_id (store.type_id, store.id));
}
- private string get_store_full_id (string type_id, string id)
+ private string _get_store_full_id (string type_id, string id)
{
return type_id + ":" + id;
}
- private void add_personas (GLib.List<Persona> added,
+ private void _add_personas (GLib.List<Persona> added,
ref GLib.List<Individual> added_individuals,
ref HashMap<Individual, Individual> replaced_individuals,
ref Individual user)
@@ -487,13 +488,13 @@ public class Folks.IndividualAggregator : Object
foreach (Individual i in almost_added_individuals)
{
/* Add the new Individual to the aggregator */
- i.removed.connect (this.individual_removed_cb);
+ i.removed.connect (this._individual_removed_cb);
added_individuals.prepend (i);
this.individuals.insert (i.id, i);
}
}
- private void remove_persona_from_link_map (Persona persona)
+ private void _remove_persona_from_link_map (Persona persona)
{
this._link_map.remove (persona.iid);
@@ -527,7 +528,7 @@ public class Folks.IndividualAggregator : Object
}
}
- private void personas_changed_cb (PersonaStore store,
+ private void _personas_changed_cb (PersonaStore store,
GLib.List<Persona>? added,
GLib.List<Persona>? removed,
string? message,
@@ -551,7 +552,7 @@ public class Folks.IndividualAggregator : Object
if (added != null)
{
- this.add_personas (added, ref added_individuals,
+ this._add_personas (added, ref added_individuals,
ref replaced_individuals, ref user);
}
@@ -576,14 +577,14 @@ public class Folks.IndividualAggregator : Object
removed_individuals.prepend (ind);
/* Remove the Persona's links from the link map */
- this.remove_persona_from_link_map (persona);
+ this._remove_persona_from_link_map (persona);
});
/* Remove the Individuals which were pointed to by the linkable properties
* of the removed Personas. We can then re-link the other Personas in
* those Individuals, since their links may have changed.
* Note that we remove the Individual from this.individuals, meaning that
- * individual_removed_cb() ignores this Individual. This allows us to
+ * _individual_removed_cb() ignores this Individual. This allows us to
* group together the IndividualAggregator.individuals_changed signals
* for all the removed Individuals. */
debug ("Removing Individuals due to removed links:");
@@ -607,7 +608,7 @@ public class Folks.IndividualAggregator : Object
relinked_personas_set.add (persona);
/* Remove links to the Persona */
- this.remove_persona_from_link_map (persona);
+ this._remove_persona_from_link_map (persona);
}
if (user == individual)
@@ -624,7 +625,7 @@ public class Folks.IndividualAggregator : Object
persona.is_user ? "yes" : "no", persona.iid);
}
- this.add_personas (relinked_personas, ref added_individuals,
+ this._add_personas (relinked_personas, ref added_individuals,
ref replaced_individuals, ref user);
/* Signal the removal of the replaced_individuals at the same time as the
@@ -661,7 +662,7 @@ public class Folks.IndividualAggregator : Object
}
}
- private void is_writeable_changed_cb (Object object, ParamSpec pspec)
+ private void _is_writeable_changed_cb (Object object, ParamSpec pspec)
{
/* Ensure that we only have one writeable PersonaStore */
unowned PersonaStore store = (PersonaStore) object;
@@ -669,7 +670,7 @@ public class Folks.IndividualAggregator : Object
(store.is_writeable == false && store != this._writeable_store));
}
- private void trust_level_changed_cb (Object object, ParamSpec pspec)
+ private void _trust_level_changed_cb (Object object, ParamSpec pspec)
{
/* FIXME: For the moment, assert that only the key-file backend's
* singleton PersonaStore is trusted. */
@@ -680,10 +681,10 @@ public class Folks.IndividualAggregator : Object
assert (store.trust_level != PersonaStoreTrust.FULL);
}
- private void individual_removed_cb (Individual i, Individual? replacement)
+ private void _individual_removed_cb (Individual i, Individual? replacement)
{
/* Only signal if the individual is still in this.individuals. This allows
- * us to group removals together in, e.g., personas_changed_cb(). */
+ * us to group removals together in, e.g., _personas_changed_cb(). */
if (this.individuals.lookup (i.id) == null)
return;
@@ -741,7 +742,7 @@ public class Folks.IndividualAggregator : Object
string persona_store_id,
HashTable<string, Value?> details) throws IndividualAggregatorError
{
- var full_id = this.get_store_full_id (persona_store_type,
+ var full_id = this._get_store_full_id (persona_store_type,
persona_store_id);
var store = this._stores[full_id];
@@ -756,7 +757,7 @@ public class Folks.IndividualAggregator : Object
Persona persona = null;
try
{
- var details_copy = asv_copy (details);
+ var details_copy = _asv_copy (details);
persona = yield store.add_persona_from_details (details_copy);
}
catch (PersonaStoreError e)
@@ -786,7 +787,7 @@ public class Folks.IndividualAggregator : Object
return persona;
}
- private HashTable<string, Value?> asv_copy (HashTable<string, Value?> asv)
+ private HashTable<string, Value?> _asv_copy (HashTable<string, Value?> asv)
{
var retval = new HashTable<string, Value?> (str_hash, str_equal);
@@ -970,7 +971,7 @@ public class Folks.IndividualAggregator : Object
debug ("Unlinking Individual '%s', deleting Personas:", individual.id);
/* We have to take a copy of the Persona list before removing the
- * Personas, as personas_changed_cb() (which is called as a result of
+ * Personas, as _personas_changed_cb() (which is called as a result of
* calling _writeable_store.remove_persona()) messes around with Persona
* lists. */
GLib.List<Persona> personas = individual.personas.copy ();
diff --git a/folks/individual.vala b/folks/individual.vala
index 3f68c8a..65356d0 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -237,10 +237,10 @@ public class Folks.Individual : Object,
if (p is Favouritable)
{
SignalHandler.block_by_func (p,
- (void*) this.notify_is_favourite_cb, this);
+ (void*) this._notify_is_favourite_cb, this);
((Favouritable) p).is_favourite = value;
SignalHandler.unblock_by_func (p,
- (void*) this.notify_is_favourite_cb, this);
+ (void*) this._notify_is_favourite_cb, this);
}
});
}
@@ -303,19 +303,19 @@ public class Folks.Individual : Object,
public signal void personas_changed (GLib.List<Persona>? added,
GLib.List<Persona>? removed);
- private void notify_alias_cb (Object obj, ParamSpec ps)
+ private void _notify_alias_cb (Object obj, ParamSpec ps)
{
- this.update_alias ();
+ this._update_alias ();
}
- private void notify_avatar_cb (Object obj, ParamSpec ps)
+ private void _notify_avatar_cb (Object obj, ParamSpec ps)
{
- this.update_avatar ();
+ this._update_avatar ();
}
- private void persona_group_changed_cb (string group, bool is_member)
+ private void _persona_group_changed_cb (string group, bool is_member)
{
- this.update_groups ();
+ this._update_groups ();
}
/**
@@ -343,19 +343,19 @@ public class Folks.Individual : Object,
* yet; react to that directly */
}
- private void notify_presence_cb (Object obj, ParamSpec ps)
+ private void _notify_presence_cb (Object obj, ParamSpec ps)
{
- this.update_presence ();
+ this._update_presence ();
}
- private void notify_im_addresses_cb (Object obj, ParamSpec ps)
+ private void _notify_im_addresses_cb (Object obj, ParamSpec ps)
{
- this.update_im_addresses ();
+ this._update_im_addresses ();
}
- private void notify_is_favourite_cb (Object obj, ParamSpec ps)
+ private void _notify_is_favourite_cb (Object obj, ParamSpec ps)
{
- this.update_is_favourite ();
+ this._update_is_favourite ();
}
/**
@@ -378,7 +378,7 @@ public class Folks.Individual : Object,
this.personas = personas;
}
- private void store_removed_cb (PersonaStore store)
+ private void _store_removed_cb (PersonaStore store)
{
GLib.List<Persona> removed_personas = null;
Iterator<Persona> iter = this._persona_set.iterator ();
@@ -403,10 +403,10 @@ public class Folks.Individual : Object,
return;
}
- this.update_fields ();
+ this._update_fields ();
}
- private void store_personas_changed_cb (PersonaStore store,
+ private void _store_personas_changed_cb (PersonaStore store,
GLib.List<Persona>? added,
GLib.List<Persona>? removed,
string? message,
@@ -434,21 +434,21 @@ public class Folks.Individual : Object,
return;
}
- this.update_fields ();
+ this._update_fields ();
}
- private void update_fields ()
+ private void _update_fields ()
{
- this.update_groups ();
- this.update_presence ();
- this.update_is_favourite ();
- this.update_avatar ();
- this.update_alias ();
- this.update_trust_level ();
- this.update_im_addresses ();
+ this._update_groups ();
+ this._update_presence ();
+ this._update_is_favourite ();
+ this._update_avatar ();
+ this._update_alias ();
+ this._update_trust_level ();
+ this._update_im_addresses ();
}
- private void update_groups ()
+ private void _update_groups ()
{
var new_groups = new HashTable<string, bool> (str_hash, str_equal);
@@ -507,7 +507,7 @@ public class Folks.Individual : Object,
});
}
- private void update_presence ()
+ private void _update_presence ()
{
var presence_message = "";
var presence_type = Folks.PresenceType.UNSET;
@@ -539,11 +539,11 @@ public class Folks.Individual : Object,
this.presence_type = presence_type;
}
- private void update_is_favourite ()
+ private void _update_is_favourite ()
{
bool favourite = false;
- debug ("Running update_is_favourite() on '%s'", this.id);
+ debug ("Running _update_is_favourite() on '%s'", this.id);
this._persona_list.foreach ((p) =>
{
@@ -565,7 +565,7 @@ public class Folks.Individual : Object,
}
}
- private void update_alias ()
+ private void _update_alias ()
{
string alias = null;
bool alias_is_display_id = false;
@@ -649,7 +649,7 @@ public class Folks.Individual : Object,
}
}
- private void update_avatar ()
+ private void _update_avatar ()
{
File avatar = null;
@@ -667,7 +667,7 @@ public class Folks.Individual : Object,
this.avatar = avatar;
}
- private void update_trust_level ()
+ private void _update_trust_level ()
{
TrustLevel trust_level = TrustLevel.PERSONAS;
@@ -683,7 +683,7 @@ public class Folks.Individual : Object,
this.trust_level = trust_level;
}
- private void update_im_addresses ()
+ private void _update_im_addresses ()
{
/* populate the IM addresses as the union of our Personas' addresses */
foreach (var persona in this.personas)
@@ -721,38 +721,38 @@ public class Folks.Individual : Object,
this.notify_property ("im-addresses");
}
- private void connect_to_persona (Persona persona)
+ private void _connect_to_persona (Persona persona)
{
- persona.notify["alias"].connect (this.notify_alias_cb);
- persona.notify["avatar"].connect (this.notify_avatar_cb);
- persona.notify["presence-message"].connect (this.notify_presence_cb);
- persona.notify["presence-type"].connect (this.notify_presence_cb);
- persona.notify["im-addresses"].connect (this.notify_im_addresses_cb);
- persona.notify["is-favourite"].connect (this.notify_is_favourite_cb);
+ persona.notify["alias"].connect (this._notify_alias_cb);
+ persona.notify["avatar"].connect (this._notify_avatar_cb);
+ persona.notify["presence-message"].connect (this._notify_presence_cb);
+ persona.notify["presence-type"].connect (this._notify_presence_cb);
+ persona.notify["im-addresses"].connect (this._notify_im_addresses_cb);
+ persona.notify["is-favourite"].connect (this._notify_is_favourite_cb);
if (persona is Groupable)
{
((Groupable) persona).group_changed.connect (
- this.persona_group_changed_cb);
+ this._persona_group_changed_cb);
}
}
- private void disconnect_from_persona (Persona persona)
+ private void _disconnect_from_persona (Persona persona)
{
- persona.notify["alias"].disconnect (this.notify_alias_cb);
- persona.notify["avatar"].disconnect (this.notify_avatar_cb);
+ persona.notify["alias"].disconnect (this._notify_alias_cb);
+ persona.notify["avatar"].disconnect (this._notify_avatar_cb);
persona.notify["presence-message"].disconnect (
- this.notify_presence_cb);
- persona.notify["presence-type"].disconnect (this.notify_presence_cb);
+ this._notify_presence_cb);
+ persona.notify["presence-type"].disconnect (this._notify_presence_cb);
persona.notify["im-addresses"].disconnect (
- this.notify_im_addresses_cb);
+ this._notify_im_addresses_cb);
persona.notify["is-favourite"].disconnect (
- this.notify_is_favourite_cb);
+ this._notify_is_favourite_cb);
if (persona is Groupable)
{
((Groupable) persona).group_changed.disconnect (
- this.persona_group_changed_cb);
+ this._persona_group_changed_cb);
}
}
@@ -775,7 +775,7 @@ public class Folks.Individual : Object,
added.prepend (p);
this._persona_set.add (p);
- this.connect_to_persona (p);
+ this._connect_to_persona (p);
/* Increment the Persona count for this PersonaStore */
unowned PersonaStore store = p.store;
@@ -788,9 +788,9 @@ public class Folks.Individual : Object,
{
this._stores.set (store, 1);
- store.removed.connect (this.store_removed_cb);
+ store.removed.connect (this._store_removed_cb);
store.personas_changed.connect (
- this.store_personas_changed_cb);
+ this._store_personas_changed_cb);
}
}
@@ -817,14 +817,14 @@ public class Folks.Individual : Object,
}
else
{
- store.removed.disconnect (this.store_removed_cb);
+ store.removed.disconnect (this._store_removed_cb);
store.personas_changed.disconnect (
- this.store_personas_changed_cb);
+ this._store_personas_changed_cb);
this._stores.unset (store);
}
- this.disconnect_from_persona (p);
+ this._disconnect_from_persona (p);
this._persona_set.remove (p);
}
}
@@ -853,7 +853,7 @@ public class Folks.Individual : Object,
this.id = this._persona_list.data.uid;
/* Update our aggregated fields and notify the changes */
- this.update_fields ();
+ this._update_fields ();
}
internal void replace (Individual replacement_individual)
diff --git a/folks/persona.vala b/folks/persona.vala
index 0c68347..80e8dd8 100644
--- a/folks/persona.vala
+++ b/folks/persona.vala
@@ -161,14 +161,14 @@ public abstract class Folks.Persona : Object
assert_not_reached ();
}
- private static string escape_uid_component (string component)
+ private static string _escape_uid_component (string component)
{
/* Escape colons with backslashes */
string escaped = component.replace ("\\", "\\\\");
return escaped.replace (":", "\\:");
}
- private static string unescape_uid_component (string component)
+ private static string _unescape_uid_component (string component)
{
/* Unescape colons and backslashes */
string unescaped = component.replace ("\\:", ":");
@@ -190,9 +190,9 @@ public abstract class Folks.Persona : Object
public static string build_uid (string backend_name,
string persona_store_id, string persona_id)
{
- return "%s:%s:%s".printf (Persona.escape_uid_component (backend_name),
- Persona.escape_uid_component (persona_store_id),
- Persona.escape_uid_component (persona_id));
+ return "%s:%s:%s".printf (Persona._escape_uid_component (backend_name),
+ Persona._escape_uid_component (persona_store_id),
+ Persona._escape_uid_component (persona_id));
}
/**
@@ -231,12 +231,12 @@ public abstract class Folks.Persona : Object
assert (backend_name_length != 0 && persona_store_id_length != 0);
- backend_name = Persona.unescape_uid_component (
+ backend_name = Persona._unescape_uid_component (
uid.ndup (backend_name_length));
- persona_store_id = Persona.unescape_uid_component (
+ persona_store_id = Persona._unescape_uid_component (
((string) ((char*) uid + backend_name_length + 1)).ndup (
persona_store_id_length));
- persona_id = Persona.unescape_uid_component (
+ persona_id = Persona._unescape_uid_component (
((string) ((char*) uid + backend_name_length +
persona_store_id_length + 2)));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]