[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:05:05 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=b77671d
The following commit has been merged in the master branch:
commit b77671d94b924cd6997fd7c5d8eff29f7ff15a19
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Wed Mar 14 19:13:53 2012 +0000
Fix crash, initialise models at the start. Removed code duplication of FlatProxyModel.
---
KTp/Declarative/contact-list.cpp | 12 +++++++-----
KTp/Declarative/contact-list.h | 3 +++
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/KTp/Declarative/contact-list.cpp b/KTp/Declarative/contact-list.cpp
index b07cfa3..2d844df 100644
--- a/KTp/Declarative/contact-list.cpp
+++ b/KTp/Declarative/contact-list.cpp
@@ -30,9 +30,8 @@
#include <TelepathyQt/AccountManager>
#include <TelepathyQt/PendingReady>
-#include "flat-model-proxy.h"
-
#include <KTp/Models/accounts-model.h>
+#include <KTp/Models/flat-model-proxy.h>
@@ -79,6 +78,11 @@ TelepathyContactList::TelepathyContactList(QObject* parent, const QVariantList&
connect(m_accountManager->becomeReady(),
SIGNAL(finished(Tp::PendingOperation*)),
SLOT(onAccountManagerReady(Tp::PendingOperation*)));
+
+ m_model = new AccountsModel(this);
+ m_proxyModel = new FlatModelProxy(m_model);
+
+
}
TelepathyContactList::~TelepathyContactList()
@@ -108,8 +112,7 @@ void TelepathyContactList::init()
// make C++ Plasma::Applet available to QML for resize signal
m_declarative->engine()->rootContext()->setContextProperty("TelepathyContactList", this);
- FlatModelProxy *proxyModel = new FlatModelProxy(m_model);
- m_declarative->engine()->rootContext()->setContextProperty("contactListModel", proxyModel);
+ m_declarative->engine()->rootContext()->setContextProperty("contactListModel", m_proxyModel);
// setup qml object so that we can talk to the declarative part
m_qmlObject = dynamic_cast<QObject*>(m_declarative->rootObject());
@@ -129,7 +132,6 @@ K_EXPORT_PLASMA_APPLET(telepathy-contact-list, TelepathyContactList)
void TelepathyContactList::onAccountManagerReady(Tp::PendingOperation *op)
{
- m_model = new AccountsModel(this);
m_model->setAccountManager(m_accountManager);
init();
}
diff --git a/KTp/Declarative/contact-list.h b/KTp/Declarative/contact-list.h
index 6054801..f2ae467 100644
--- a/KTp/Declarative/contact-list.h
+++ b/KTp/Declarative/contact-list.h
@@ -26,6 +26,7 @@
#include <TelepathyQt/Types>
class AccountsModel;
+class FlatModelProxy;
namespace Tp {
class PendingOperation;
@@ -53,7 +54,9 @@ private:
Plasma::DeclarativeWidget *m_declarative;
QObject *m_qmlObject;
Tp::AccountManagerPtr m_accountManager;
+
AccountsModel *m_model;
+ FlatModelProxy *m_proxyModel;
};
#endif // TELEPATHY_CONTACT_LIST_H
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list