[telepathy-qt4/master] Connection/ContactManager: Use proper english when naming contact list channels and contact list group channels.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Thu Jul 23 09:55:58 PDT 2009
---
TelepathyQt4/connection.cpp | 34 ++++++++++----------
TelepathyQt4/contact-manager.cpp | 64 +++++++++++++++++++-------------------
TelepathyQt4/contact-manager.h | 8 ++--
3 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/TelepathyQt4/connection.cpp b/TelepathyQt4/connection.cpp
index f01fff6..9d65c91 100644
--- a/TelepathyQt4/connection.cpp
+++ b/TelepathyQt4/connection.cpp
@@ -115,9 +115,9 @@ struct Connection::Private
ContactPtr selfContact;
QStringList contactAttributeInterfaces;
uint selfHandle;
- QMap<uint, ContactManager::ContactListChannel> contactListsChannels;
- uint contactListsChannelsReady;
- QList<ChannelPtr> contactListGroupsChannels;
+ QMap<uint, ContactManager::ContactListChannel> contactListChannels;
+ uint contactListChannelsReady;
+ QList<ChannelPtr> contactListGroupChannels;
uint featureRosterGroupsTodo;
// (Bus connection name, service name) -> HandleContext
@@ -167,7 +167,7 @@ Connection::Private::Private(Connection *parent)
status(Connection::StatusUnknown),
statusReason(ConnectionStatusReasonNoneSpecified),
selfHandle(0),
- contactListsChannelsReady(0),
+ contactListChannelsReady(0),
featureRosterGroupsTodo(0),
handleContext(0),
contactManager(0)
@@ -384,7 +384,7 @@ void Connection::Private::introspectRoster(Connection::Private *self)
debug() << "Requesting handles for contact lists";
for (uint i = 0; i < ContactManager::ContactListChannel::LastType; ++i) {
- self->contactListsChannels.insert(i,
+ self->contactListChannels.insert(i,
ContactManager::ContactListChannel(
(ContactManager::ContactListChannel::Type) i));
@@ -431,11 +431,11 @@ void Connection::Private::checkFeatureRosterGroupsReady()
}
debug() << "FeatureRosterGroups ready";
- contactManager->setContactListGroupsChannels(
- contactListGroupsChannels);
+ contactManager->setContactListGroupChannels(
+ contactListGroupChannels);
readinessHelper->setIntrospectCompleted(
FeatureRosterGroups, true);
- contactListGroupsChannels.clear();
+ contactListGroupChannels.clear();
}
Connection::PendingConnect::PendingConnect(Connection *parent, const Features &requestedFeatures)
@@ -1010,7 +1010,7 @@ void Connection::gotContactListsHandles(PendingOperation *op)
uint type = ContactManager::ContactListChannel::typeForIdentifier(
pending->namesRequested().first());
Q_ASSERT(type != (uint) -1 && type < ContactManager::ContactListChannel::LastType);
- mPriv->contactListsChannels[type].handle = handle;
+ mPriv->contactListChannels[type].handle = handle;
request[QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetHandle")] = handle[0];
connect(ensureChannel(request),
SIGNAL(finished(Tp::PendingOperation*)),
@@ -1030,10 +1030,10 @@ void Connection::gotContactListChannel(PendingOperation *op)
Q_ASSERT(channel);
Q_ASSERT(handle);
for (int i = 0; i < ContactManager::ContactListChannel::LastType; ++i) {
- if (mPriv->contactListsChannels[i].handle.size() > 0 &&
- mPriv->contactListsChannels[i].handle[0] == handle) {
- Q_ASSERT(!mPriv->contactListsChannels[i].channel);
- mPriv->contactListsChannels[i].channel = channel;
+ if (mPriv->contactListChannels[i].handle.size() > 0 &&
+ mPriv->contactListChannels[i].handle[0] == handle) {
+ Q_ASSERT(!mPriv->contactListChannels[i].channel);
+ mPriv->contactListChannels[i].channel = channel;
connect(channel->becomeReady(),
SIGNAL(finished(Tp::PendingOperation *)),
SLOT(contactListChannelReady()));
@@ -1043,10 +1043,10 @@ void Connection::gotContactListChannel(PendingOperation *op)
void Connection::contactListChannelReady()
{
- if (++mPriv->contactListsChannelsReady ==
+ if (++mPriv->contactListChannelsReady ==
ContactManager::ContactListChannel::LastType) {
debug() << "FeatureRoster ready";
- mPriv->contactManager->setContactListsChannels(mPriv->contactListsChannels);
+ mPriv->contactManager->setContactListChannels(mPriv->contactListChannels);
mPriv->readinessHelper->setIntrospectCompleted(FeatureRoster, true);
}
}
@@ -1071,7 +1071,7 @@ void Connection::onNewChannels(const Tp::ChannelDetailsList &channelDetailsList)
++mPriv->featureRosterGroupsTodo;
ChannelPtr channel = Channel::create(ConnectionPtr(this),
channelDetails.channel.path(), channelDetails.properties);
- mPriv->contactListGroupsChannels.append(channel);
+ mPriv->contactListGroupChannels.append(channel);
connect(channel->becomeReady(),
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onContactListGroupChannelReady(Tp::PendingOperation*)));
@@ -1088,7 +1088,7 @@ void Connection::onContactListGroupChannelReady(Tp::PendingOperation *op)
PendingReady *pr = qobject_cast<PendingReady*>(op);
ChannelPtr channel = ChannelPtr(qobject_cast<Channel*>(pr->object()));
mPriv->contactManager->addContactListGroupChannel(channel);
- mPriv->contactListGroupsChannels.removeOne(channel);
+ mPriv->contactListGroupChannels.removeOne(channel);
}
}
diff --git a/TelepathyQt4/contact-manager.cpp b/TelepathyQt4/contact-manager.cpp
index 1bc82ea..a1416e9 100644
--- a/TelepathyQt4/contact-manager.cpp
+++ b/TelepathyQt4/contact-manager.cpp
@@ -75,7 +75,7 @@ struct ContactManager::Private
{
QString id = contactListGroupChannel->immutableProperties().value(
QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetID")).toString();
- contactListGroupsChannels.insert(id, contactListGroupChannel);
+ contactListGroupChannels.insert(id, contactListGroupChannel);
parent->connect(contactListGroupChannel.data(),
SIGNAL(groupMembersChanged(
const Tp::Contacts &,
@@ -108,12 +108,12 @@ struct ContactManager::Private
QSet<Contact::Feature> supportedFeatures;
- QMap<uint, ContactListChannel> contactListsChannels;
+ QMap<uint, ContactListChannel> contactListChannels;
ChannelPtr subscribeChannel;
ChannelPtr publishChannel;
ChannelPtr storedChannel;
ChannelPtr denyChannel;
- QMap<QString, ChannelPtr> contactListGroupsChannels;
+ QMap<QString, ChannelPtr> contactListGroupChannels;
Contacts allKnownContacts() const;
void updateContactsPresenceState();
@@ -197,7 +197,7 @@ Contacts ContactManager::allKnownContacts() const
*/
QStringList ContactManager::allKnownGroups() const
{
- return mPriv->contactListGroupsChannels.keys();
+ return mPriv->contactListGroupChannels.keys();
}
/**
@@ -253,12 +253,12 @@ PendingOperation *ContactManager::addGroup(const QString &group)
*/
PendingOperation *ContactManager::removeGroup(const QString &group)
{
- if (!mPriv->contactListGroupsChannels.contains(group)) {
+ if (!mPriv->contactListGroupChannels.contains(group)) {
return new PendingFailure(this, TELEPATHY_ERROR_INVALID_ARGUMENT,
"Invalid group");
}
- ChannelPtr channel = mPriv->contactListGroupsChannels[group];
+ ChannelPtr channel = mPriv->contactListGroupChannels[group];
return channel->requestClose();
}
@@ -275,11 +275,11 @@ PendingOperation *ContactManager::removeGroup(const QString &group)
*/
Contacts ContactManager::groupContacts(const QString &group) const
{
- if (!mPriv->contactListGroupsChannels.contains(group)) {
+ if (!mPriv->contactListGroupChannels.contains(group)) {
return Contacts();
}
- ChannelPtr channel = mPriv->contactListGroupsChannels[group];
+ ChannelPtr channel = mPriv->contactListGroupChannels[group];
return channel->groupContacts();
}
@@ -297,12 +297,12 @@ Contacts ContactManager::groupContacts(const QString &group) const
PendingOperation *ContactManager::groupAddContacts(const QString &group,
const QList<ContactPtr> &contacts)
{
- if (!mPriv->contactListGroupsChannels.contains(group)) {
+ if (!mPriv->contactListGroupChannels.contains(group)) {
return new PendingFailure(this, TELEPATHY_ERROR_INVALID_ARGUMENT,
"Invalid group");
}
- ChannelPtr channel = mPriv->contactListGroupsChannels[group];
+ ChannelPtr channel = mPriv->contactListGroupChannels[group];
return channel->groupAddContacts(contacts);
}
@@ -320,12 +320,12 @@ PendingOperation *ContactManager::groupAddContacts(const QString &group,
PendingOperation *ContactManager::groupRemoveContacts(const QString &group,
const QList<ContactPtr> &contacts)
{
- if (!mPriv->contactListGroupsChannels.contains(group)) {
+ if (!mPriv->contactListGroupChannels.contains(group)) {
return new PendingFailure(this, TELEPATHY_ERROR_INVALID_ARGUMENT,
"Invalid group");
}
- ChannelPtr channel = mPriv->contactListGroupsChannels[group];
+ ChannelPtr channel = mPriv->contactListGroupChannels[group];
return channel->groupRemoveContacts(contacts);
}
@@ -898,7 +898,7 @@ void ContactManager::onContactListGroupRemoved(Tp::DBusProxy *proxy,
ChannelPtr contactListGroupChannel = ChannelPtr(qobject_cast<Channel*>(proxy));
QString id = contactListGroupChannel->immutableProperties().value(
QLatin1String(TELEPATHY_INTERFACE_CHANNEL ".TargetID")).toString();
- mPriv->contactListGroupsChannels.remove(id);
+ mPriv->contactListGroupChannels.remove(id);
emit groupRemoved(id);
}
@@ -929,32 +929,32 @@ ContactPtr ContactManager::ensureContact(const ReferencedHandles &handle,
return contact;
}
-void ContactManager::setContactListsChannels(
- const QMap<uint, ContactListChannel> &contactListsChannels)
+void ContactManager::setContactListChannels(
+ const QMap<uint, ContactListChannel> &contactListChannels)
{
- Q_ASSERT(mPriv->contactListsChannels.isEmpty());
- mPriv->contactListsChannels = contactListsChannels;
+ Q_ASSERT(mPriv->contactListChannels.isEmpty());
+ mPriv->contactListChannels = contactListChannels;
- if (mPriv->contactListsChannels.contains(ContactListChannel::TypeSubscribe)) {
- mPriv->subscribeChannel = mPriv->contactListsChannels[ContactListChannel::TypeSubscribe].channel;
+ if (mPriv->contactListChannels.contains(ContactListChannel::TypeSubscribe)) {
+ mPriv->subscribeChannel = mPriv->contactListChannels[ContactListChannel::TypeSubscribe].channel;
}
- if (mPriv->contactListsChannels.contains(ContactListChannel::TypePublish)) {
- mPriv->publishChannel = mPriv->contactListsChannels[ContactListChannel::TypePublish].channel;
+ if (mPriv->contactListChannels.contains(ContactListChannel::TypePublish)) {
+ mPriv->publishChannel = mPriv->contactListChannels[ContactListChannel::TypePublish].channel;
}
- if (mPriv->contactListsChannels.contains(ContactListChannel::TypeStored)) {
- mPriv->storedChannel = mPriv->contactListsChannels[ContactListChannel::TypeStored].channel;
+ if (mPriv->contactListChannels.contains(ContactListChannel::TypeStored)) {
+ mPriv->storedChannel = mPriv->contactListChannels[ContactListChannel::TypeStored].channel;
}
- if (mPriv->contactListsChannels.contains(ContactListChannel::TypeDeny)) {
- mPriv->denyChannel = mPriv->contactListsChannels[ContactListChannel::TypeDeny].channel;
+ if (mPriv->contactListChannels.contains(ContactListChannel::TypeDeny)) {
+ mPriv->denyChannel = mPriv->contactListChannels[ContactListChannel::TypeDeny].channel;
}
mPriv->updateContactsPresenceState();
- QMap<uint, ContactListChannel>::const_iterator i = contactListsChannels.constBegin();
- QMap<uint, ContactListChannel>::const_iterator end = contactListsChannels.constEnd();
+ QMap<uint, ContactListChannel>::const_iterator i = contactListChannels.constBegin();
+ QMap<uint, ContactListChannel>::const_iterator end = contactListChannels.constEnd();
uint type;
ChannelPtr channel;
const char *method;
@@ -1002,12 +1002,12 @@ void ContactManager::setContactListsChannels(
}
}
-void ContactManager::setContactListGroupsChannels(
- const QList<ChannelPtr> &contactListGroupsChannels)
+void ContactManager::setContactListGroupChannels(
+ const QList<ChannelPtr> &contactListGroupChannels)
{
- Q_ASSERT(mPriv->contactListGroupsChannels.isEmpty());
+ Q_ASSERT(mPriv->contactListGroupChannels.isEmpty());
- foreach (const ChannelPtr &contactListGroupChannel, contactListGroupsChannels) {
+ foreach (const ChannelPtr &contactListGroupChannel, contactListGroupChannels) {
mPriv->addContactListGroupChannel(contactListGroupChannel);
}
}
@@ -1078,7 +1078,7 @@ void ContactManager::Private::ensureTracking(Contact::Feature feature)
Contacts ContactManager::Private::allKnownContacts() const
{
Contacts contacts;
- foreach (const ContactListChannel &contactListChannel, contactListsChannels) {
+ foreach (const ContactListChannel &contactListChannel, contactListChannels) {
ChannelPtr channel = contactListChannel.channel;
if (!channel) {
continue;
diff --git a/TelepathyQt4/contact-manager.h b/TelepathyQt4/contact-manager.h
index 8f1ac7e..56555b0 100644
--- a/TelepathyQt4/contact-manager.h
+++ b/TelepathyQt4/contact-manager.h
@@ -190,10 +190,10 @@ private:
const QSet<Contact::Feature> &features,
const QVariantMap &attributes);
- void setContactListsChannels(
- const QMap<uint, ContactListChannel> &contactListsChannels);
- void setContactListGroupsChannels(
- const QList<ChannelPtr> &contactListGroupsChannels);
+ void setContactListChannels(
+ const QMap<uint, ContactListChannel> &contactListChannels);
+ void setContactListGroupChannels(
+ const QList<ChannelPtr> &contactListGroupChannels);
void addContactListGroupChannel(const ChannelPtr &contactListGroupChannel);
struct Private;
--
1.5.6.5
More information about the telepathy-commits
mailing list