[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:24:24 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=6006557
The following commit has been merged in the master branch:
commit 6006557489bb5256f6c7a12c101c1894387bc2ca
Author: David Edmundson <david at davidedmundson.co.uk>
Date: Mon Dec 30 10:32:19 2013 +0100
Use singleton factory classes from K-C-I
REVIEW: 114527
This delays creating an AccountFactory till it's needed, such as
clicking "invite to chat". AccountManager calls becomeReady
immediately which loaded all accounts when we start.
This approach should reduce DBus traffic and get faster load times
---
app/chat-window.cpp | 3 +--
app/main.cpp | 27 +++------------------------
app/telepathy-chat-ui.cpp | 10 ++--------
app/telepathy-chat-ui.h | 4 +---
4 files changed, 7 insertions(+), 37 deletions(-)
diff --git a/app/chat-window.cpp b/app/chat-window.cpp
index 3d6ee7d..5180c02 100644
--- a/app/chat-window.cpp
+++ b/app/chat-window.cpp
@@ -429,8 +429,7 @@ void ChatWindow::onInviteToChatTriggered()
{
ChatTab *currChat = qobject_cast<ChatTab*>(m_tabWidget->currentWidget());
- TelepathyChatUi *app = qobject_cast<TelepathyChatUi*>(KApplication::instance());
- InviteContactDialog *dialog = new InviteContactDialog(app->accountManager(), currChat->account(), currChat->textChannel(), this);
+ InviteContactDialog *dialog = new InviteContactDialog(KTp::accountManager(), currChat->account(), currChat->textChannel(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
diff --git a/app/main.cpp b/app/main.cpp
index bacd931..7e5fa9f 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -31,8 +31,7 @@
#include <TelepathyQt/OutgoingFileTransferChannel>
#include <TelepathyQt/AccountManager>
-
-#include <KTp/contact-factory.h>
+#include <KTp/core.h>
#include <KAboutData>
#include <KCmdLineArgs>
@@ -52,16 +51,6 @@ int main(int argc, char *argv[])
Tp::registerTypes();
- Tp::AccountFactoryPtr accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
- Tp::Features() << Tp::Account::FeatureCore
- << Tp::Account::FeatureProfile);
-
- Tp::ConnectionFactoryPtr connectionFactory = Tp::ConnectionFactory::create(
- QDBusConnection::sessionBus(),
- Tp::Features() << Tp::Connection::FeatureSelfContact
- << Tp::Connection::FeatureCore
- );
-
Tp::ChannelFactoryPtr channelFactory = Tp::ChannelFactory::create(QDBusConnection::sessionBus());
channelFactory->addCommonFeatures(Tp::Channel::FeatureCore);
@@ -73,19 +62,9 @@ int main(int argc, char *argv[])
channelFactory->addFeaturesForTextChatrooms(textFeatures);
channelFactory->addFeaturesForOutgoingFileTransfers(Tp::OutgoingFileTransferChannel::FeatureCore);
- Tp::ContactFactoryPtr contactFactory = KTp::ContactFactory::create(
- Tp::Features() << Tp::Contact::FeatureAlias
- << Tp::Contact::FeatureAvatarToken
- << Tp::Contact::FeatureAvatarData
- << Tp::Contact::FeatureCapabilities
- << Tp::Contact::FeatureSimplePresence
- );
-
- Tp::AccountManagerPtr accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(), accountFactory, connectionFactory, channelFactory, contactFactory);
-
- Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(accountManager);
+ Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(KTp::accountFactory(), KTp::connectionFactory(), channelFactory, KTp::contactFactory());
- Tp::SharedPtr<TelepathyChatUi> app = Tp::SharedPtr<TelepathyChatUi>(new TelepathyChatUi(accountManager));
+ Tp::SharedPtr<TelepathyChatUi> app = Tp::SharedPtr<TelepathyChatUi>(new TelepathyChatUi);
Tp::AbstractClientPtr handler = Tp::AbstractClientPtr(app);
registrar->registerClient(handler, QLatin1String(KTP_TEXTUI_CLIENT_NAME));
diff --git a/app/telepathy-chat-ui.cpp b/app/telepathy-chat-ui.cpp
index b0cf7fc..33150b8 100644
--- a/app/telepathy-chat-ui.cpp
+++ b/app/telepathy-chat-ui.cpp
@@ -40,9 +40,8 @@ inline Tp::ChannelClassSpecList channelClassList()
}
-TelepathyChatUi::TelepathyChatUi(const Tp::AccountManagerPtr &accountManager)
- : KTp::TelepathyHandlerApplication(true, -1, -1), AbstractClientHandler(channelClassList()),
- m_accountManager(accountManager)
+TelepathyChatUi::TelepathyChatUi()
+ : KTp::TelepathyHandlerApplication(true, -1, -1), AbstractClientHandler(channelClassList())
{
kDebug();
ChatWindow *window = createWindow();
@@ -182,8 +181,3 @@ bool TelepathyChatUi::bypassApproval() const
return false;
}
-Tp::AccountManagerPtr TelepathyChatUi::accountManager() const
-{
- return m_accountManager;
-}
-
diff --git a/app/telepathy-chat-ui.h b/app/telepathy-chat-ui.h
index 735a203..97bc4b7 100644
--- a/app/telepathy-chat-ui.h
+++ b/app/telepathy-chat-ui.h
@@ -33,7 +33,7 @@ class TelepathyChatUi : public KTp::TelepathyHandlerApplication, public Tp::Abst
{
Q_OBJECT
public:
- TelepathyChatUi(const Tp::AccountManagerPtr &accountManager);
+ TelepathyChatUi();
~TelepathyChatUi();
virtual void handleChannels(const Tp::MethodInvocationContextPtr<> & context,
@@ -46,8 +46,6 @@ public:
virtual bool bypassApproval() const;
- Tp::AccountManagerPtr accountManager() const;
-
private Q_SLOTS:
void removeWindow(ChatWindow *window);
void dettachTab(ChatTab *tab);
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list