[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:08:06 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=746a0b5

The following commit has been merged in the master branch:
commit 746a0b51b7e744af3f9f2241c663b911aa8f7454
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Sat Mar 29 00:04:37 2014 +0100

    Add 'bool success' argument to ContactsListModel::modelInitialized()
    
    This patch makes sure that the success state from KPeople gets propagated up to
    KTp::ContactsListModel and makes K-C-I compile with the API changes in KPeople.
    
    REVIEW: 117142
---
 KTp/Models/contacts-list-model.cpp                  | 6 +++---
 KTp/Models/contacts-list-model.h                    | 2 +-
 KTp/Models/contacts-model.cpp                       | 8 ++++----
 KTp/Models/contacts-model.h                         | 2 +-
 kpeople/datasourceplugin/im-persons-data-source.cpp | 9 ++++++---
 5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/KTp/Models/contacts-list-model.cpp b/KTp/Models/contacts-list-model.cpp
index d5d01c2..adf2e09 100644
--- a/KTp/Models/contacts-list-model.cpp
+++ b/KTp/Models/contacts-list-model.cpp
@@ -66,7 +66,7 @@ void KTp::ContactsListModel::setAccountManager(const Tp::AccountManagerPtr &acco
     const QList<Tp::AccountPtr> accounts = accountManager->enabledAccounts()->accounts();
     if (accounts.isEmpty()) {
         d->initialized = true;
-        Q_EMIT modelInitialized();
+        Q_EMIT modelInitialized(true);
     } else {
         Q_FOREACH (const Tp::AccountPtr &account, accounts) {
             if (account->isOnline()) {
@@ -75,7 +75,7 @@ void KTp::ContactsListModel::setAccountManager(const Tp::AccountManagerPtr &acco
         }
 
         d->initialized = true;
-        Q_EMIT modelInitialized();
+        Q_EMIT modelInitialized(true);
     }
 }
 
@@ -225,7 +225,7 @@ void KTp::ContactsListModel::onContactsChanged(const Tp::Contacts &added, const
     }
 
     if (!d->initialized) {
-        Q_EMIT modelInitialized();
+        Q_EMIT modelInitialized(true);
         d->initialized = true;
     }
 }
diff --git a/KTp/Models/contacts-list-model.h b/KTp/Models/contacts-list-model.h
index dc3e63f..5e21526 100644
--- a/KTp/Models/contacts-list-model.h
+++ b/KTp/Models/contacts-list-model.h
@@ -41,7 +41,7 @@ public:
     QVariant data(const QModelIndex &index, int role) const;
 
 Q_SIGNALS:
-    void modelInitialized();
+    void modelInitialized(bool success);
 
 private Q_SLOTS:
     void onContactsChanged(const Tp::Contacts &added, const Tp::Contacts &removed);
diff --git a/KTp/Models/contacts-model.cpp b/KTp/Models/contacts-model.cpp
index df1d487..32e21ab 100644
--- a/KTp/Models/contacts-model.cpp
+++ b/KTp/Models/contacts-model.cpp
@@ -64,8 +64,8 @@ KTp::ContactsModel::ContactsModel(QObject *parent)
         kDebug() << "Built with kpeople support, using kpeople model";
         KPeople::PersonsModel *personsModel = new KPeople::PersonsModel(this);
 
-        connect(personsModel, SIGNAL(modelInitialized()),
-                this, SIGNAL(modelInitialized()));
+        connect(personsModel, SIGNAL(modelInitialized(bool)),
+                this, SIGNAL(modelInitialized(bool)));
 
         d->source = new KPeopleTranslationProxy(this);
         qobject_cast<KPeopleTranslationProxy*>(d->source)->setSourceModel(personsModel);
@@ -75,8 +75,8 @@ KTp::ContactsModel::ContactsModel(QObject *parent)
     {
         kDebug() << "KPeople support not built-in, using normal model";
         d->source = new KTp::ContactsListModel(this);
-        connect(d->source, SIGNAL(modelInitialized()),
-                this, SIGNAL(modelInitialized()));
+        connect(d->source, SIGNAL(modelInitialized(bool)),
+                this, SIGNAL(modelInitialized(bool)));
     }
 
 }
diff --git a/KTp/Models/contacts-model.h b/KTp/Models/contacts-model.h
index e6fb7b1..529ee54 100644
--- a/KTp/Models/contacts-model.h
+++ b/KTp/Models/contacts-model.h
@@ -79,7 +79,7 @@ protected:
     virtual void setSourceModel(QAbstractItemModel *sourceModel);
 
 Q_SIGNALS:
-    void modelInitialized();
+    void modelInitialized(bool success);
     void groupModeChanged();
     void trackUnreadMessagesChanged();
 
diff --git a/kpeople/datasourceplugin/im-persons-data-source.cpp b/kpeople/datasourceplugin/im-persons-data-source.cpp
index 94d8de1..e1261ab 100644
--- a/kpeople/datasourceplugin/im-persons-data-source.cpp
+++ b/kpeople/datasourceplugin/im-persons-data-source.cpp
@@ -88,7 +88,10 @@ void KTpAllContacts::loadCache()
 
     QSqlQuery query(QLatin1String("SELECT accountId, contactId, alias, avatarFileName FROM contacts"), db);
 
-    query.exec();
+    if (!query.exec()) {
+        emitInitialFetchComplete(false);
+        return;
+    }
 
     while (query.next()) {
         KABC::Addressee addressee;
@@ -112,7 +115,7 @@ void KTpAllContacts::loadCache()
     connect(KTp::accountManager()->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)),
         this, SLOT(onAccountManagerReady(Tp::PendingOperation*)));
 
-    emitInitialFetchComplete();
+    emitInitialFetchComplete(true);
 }
 
 
@@ -257,4 +260,4 @@ K_PLUGIN_FACTORY( IMPersonsDataSourceFactory, registerPlugin<IMPersonsDataSource
 K_EXPORT_PLUGIN( IMPersonsDataSourceFactory("im_persons_data_source_plugin") )
 
 
-#include "im-persons-data-source.moc"
\ No newline at end of file
+#include "im-persons-data-source.moc"

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list