diff options
author | Gustavo Pichorim Boiko <gustavo.boiko@collabora.co.uk> | 2010-11-29 10:46:35 -0800 |
---|---|---|
committer | Gustavo Pichorim Boiko <gustavo.boiko@collabora.co.uk> | 2011-01-14 04:41:04 -0800 |
commit | cc9cf314f211b0716e2d30b4d20856e6a7d70450 (patch) | |
tree | 6d985f831ef743bd8a9ecc136711d038c18bd209 /examples | |
parent | 6e94ae42f62754d942cce1a66639e4d5e745d7cf (diff) |
Fix the models after the API breakage
Diffstat (limited to 'examples')
-rw-r--r-- | examples/accounts-model/telepathy-initializer.cpp | 10 | ||||
-rw-r--r-- | examples/conversation-model/chatwindow.cpp | 9 | ||||
-rw-r--r-- | examples/conversation-model/chatwindow.h | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/examples/accounts-model/telepathy-initializer.cpp b/examples/accounts-model/telepathy-initializer.cpp index c86711b..b36c881 100644 --- a/examples/accounts-model/telepathy-initializer.cpp +++ b/examples/accounts-model/telepathy-initializer.cpp @@ -68,9 +68,9 @@ void TelepathyInitializer::onAMReady(Tp::PendingOperation *) void TelepathyInitializer::onAccountReady(Tp::PendingOperation *op) { Tp::PendingReady *pr = qobject_cast<Tp::PendingReady *>(op); - Tp::AccountPtr account = Tp::AccountPtr(qobject_cast<Tp::Account *>(pr->object())); + Tp::AccountPtr account = Tp::AccountPtr::dynamicCast(pr->object()); - if (account->haveConnection()) { + if (!account->connection().isNull()) { Tp::Features features; features << Tp::Connection::FeatureCore << Tp::Connection::FeatureSelfContact @@ -91,12 +91,12 @@ void TelepathyInitializer::onAccountReady(Tp::PendingOperation *op) void TelepathyInitializer::onConnectionReady(Tp::PendingOperation *op) { Tp::PendingReady *pr = qobject_cast<Tp::PendingReady *>(op); - Tp::ConnectionPtr connection(qobject_cast<Tp::Connection *>(pr->object())); + Tp::ConnectionPtr connection = Tp::ConnectionPtr::dynamicCast(pr->object()); - Tp::ContactManager *manager = connection->contactManager(); + Tp::ContactManagerPtr manager = connection->contactManager(); QList<Tp::ContactPtr> contacts = manager->allKnownContacts().toList(); - QSet<Tp::Contact::Feature> features; + Tp::Features features; features << Tp::Contact::FeatureAlias << Tp::Contact::FeatureAvatarToken << Tp::Contact::FeatureSimplePresence diff --git a/examples/conversation-model/chatwindow.cpp b/examples/conversation-model/chatwindow.cpp index 3c25a18..63ca7b6 100644 --- a/examples/conversation-model/chatwindow.cpp +++ b/examples/conversation-model/chatwindow.cpp @@ -21,6 +21,7 @@ #include "chatwindow.h" #include "examples/conversation-model/_gen/chatwindow.moc.hpp" +#include <TelepathyQt4/ChannelClassSpecList> #include <TelepathyQt4/Connection> #include <TelepathyQt4/ContactManager> #include <TelepathyQt4/TextChannel> @@ -34,7 +35,7 @@ ChatWindow::ChatWindow(QWidget *parent) : QWidget(parent), - AbstractClientHandler(channelClassList()) + AbstractClientHandler(Tp::ChannelClassSpecList(channelClassList())) { resize(800, 500); } @@ -65,7 +66,7 @@ void ChatWindow::handleChannels(const Tp::MethodInvocationContextPtr<> &context, const QList<Tp::ChannelPtr> &channels, const QList<Tp::ChannelRequestPtr> &requestsSatisfied, const QDateTime &userActionTime, - const QVariantMap &handlerInfo) + const Tp::AbstractClientHandler::HandlerInfo &handlerInfo) { if (channels.size() == 1) { Tp::TextChannelPtr channel = Tp::TextChannelPtr::dynamicCast(channels[0]); @@ -139,11 +140,11 @@ void TelepathyInitializer::initializeConnection() void TelepathyInitializer::initializeContacts() { - Tp::ContactManager *contactManager = mConnection->contactManager(); + Tp::ContactManagerPtr contactManager = mConnection->contactManager(); QList<Tp::ContactPtr> contacts = mChannel->groupContacts().toList(); - QSet<Tp::Contact::Feature> features; + Tp::Features features; features << Tp::Contact::FeatureAlias << Tp::Contact::FeatureAvatarToken << Tp::Contact::FeatureSimplePresence diff --git a/examples/conversation-model/chatwindow.h b/examples/conversation-model/chatwindow.h index a4f992a..e7c4e2b 100644 --- a/examples/conversation-model/chatwindow.h +++ b/examples/conversation-model/chatwindow.h @@ -44,7 +44,7 @@ public: const QList<Tp::ChannelPtr> &channels, const QList<Tp::ChannelRequestPtr> &requestsSatisfied, const QDateTime &userActionTime, - const QVariantMap &handlerInfo); + const Tp::AbstractClientHandler::HandlerInfo &handlerInfo); bool bypassApproval() const { return false; } |