aboutsummaryrefslogtreecommitdiffstats
path: root/community/libcontacts/0001-update-api-for-qtpim-5.9.patch
blob: ed9ef7e3f5ded8e743bdf3d99e95246cb3a39850 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
From 96628d329085ff2d9df9a1341045246868cc2bd5 Mon Sep 17 00:00:00 2001
From: Sergey Chupligin <s.chupligin@omprussia.ru>
Date: Tue, 15 Oct 2019 12:18:12 +0300
Subject: [PATCH] [libcontacts] Update API for QtPim 5.9

---
 src/seasidecache.cpp           | 24 +++++++++---------------
 src/seasidecontactbuilder.cpp  |  2 ++
 src/seasideimport.cpp          |  2 ++
 src/seasidepropertyhandler.cpp |  1 +
 5 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/seasidecache.cpp b/src/seasidecache.cpp
index 035ab44..6a347b8 100644
--- a/src/seasidecache.cpp
+++ b/src/seasidecache.cpp
@@ -1717,11 +1717,7 @@ void SeasideCache::startRequest(bool *idleProcessing)
             requestPending = true;
         } else {
             QContactId aggregateId = m_contactsToFetchConstituents.first();
-
-            // Find the constituents of this contact
-            QContact first;
-            first.setId(aggregateId);
-            m_relationshipsFetchRequest.setFirst(first);
+            m_relationshipsFetchRequest.setFirst(aggregateId);
             m_relationshipsFetchRequest.setRelationshipType(QContactRelationship::Aggregates());
             m_relationshipsFetchRequest.start();
         }
@@ -2566,7 +2562,7 @@ void SeasideCache::relationshipsAvailable()
 
     foreach (const QContactRelationship &rel, m_relationshipsFetchRequest.relationships()) {
         if (rel.relationshipType() == aggregatesRelationship) {
-            m_constituentIds.insert(apiId(rel.second()));
+            m_constituentIds.insert(rel.second());
         }
     }
 }
@@ -2779,7 +2775,7 @@ void SeasideCache::requestStateChanged(QContactAbstractRequest::State state)
         }
 
         foreach (const QContactRelationship &relationship, relationships) {
-            m_aggregatedContacts.insert(SeasideCache::apiId(relationship.first()));
+            m_aggregatedContacts.insert(relationship.first());
         }
 
         if (completed) {
@@ -2839,13 +2835,14 @@ void SeasideCache::requestStateChanged(QContactAbstractRequest::State state)
                 QContactRelationshipFetchRequest *rfr = new QContactRelationshipFetchRequest(this);
                 rfr->setManager(m_saveRequest.manager());
                 rfr->setRelationshipType(QContactRelationship::Aggregates());
-                rfr->setSecond(c);
+                rfr->setSecond(c.id());
+
                 connect(rfr, &QContactAbstractRequest::stateChanged, this, [this, c, rfr] {
                     if (rfr->state() == QContactAbstractRequest::FinishedState) {
                         rfr->deleteLater();
                         if (rfr->relationships().size()) {
-                            const quint32 constituentId = internalId(apiId(rfr->relationships().at(0).second()));
-                            const quint32 aggregateId = internalId(apiId(rfr->relationships().at(0).first()));
+                            const quint32 constituentId = internalId(rfr->relationships().at(0).second());
+                            const quint32 aggregateId = internalId(rfr->relationships().at(0).first());
                             this->notifySaveContactComplete(constituentId, aggregateId);
                         } else {
                             // error: cannot retrieve aggregate for newly created constituent.
@@ -3384,13 +3381,10 @@ int SeasideCache::contactIndex(quint32 iid, FilterType filterType)
 
 QContactRelationship SeasideCache::makeRelationship(const QString &type, const QContactId &id1, const QContactId &id2)
 {
-    QContact first, second;
-    first.setId(id1);
-    second.setId(id2);
     QContactRelationship relationship;
     relationship.setRelationshipType(type);
-    relationship.setFirst(first);
-    relationship.setSecond(second);
+    relationship.setFirst(id1);
+    relationship.setSecond(id2);
     return relationship;
 }
 
diff --git a/src/seasidecontactbuilder.cpp b/src/seasidecontactbuilder.cpp
index c3718f0..d518b85 100644
--- a/src/seasidecontactbuilder.cpp
+++ b/src/seasidecontactbuilder.cpp
@@ -72,6 +72,8 @@
 #include <QString>
 #include <QList>
 
+#include <QDebug>
+
 namespace {
 
 QContactFetchHint basicFetchHint()
diff --git a/src/seasideimport.cpp b/src/seasideimport.cpp
index 40e3c67..dc4cfe2 100644
--- a/src/seasideimport.cpp
+++ b/src/seasideimport.cpp
@@ -35,6 +35,8 @@
 #include <QContact>
 #include <QContactManager>
 
+#include <QDebug>
+
 namespace {
     QContactFetchHint basicFetchHint()
     {
diff --git a/src/seasidepropertyhandler.cpp b/src/seasidepropertyhandler.cpp
index 8bf0a12..0ddc128 100644
--- a/src/seasidepropertyhandler.cpp
+++ b/src/seasidepropertyhandler.cpp
@@ -39,6 +39,7 @@
 #include <QCryptographicHash>
 #include <QDir>
 #include <QImage>
+#include <QDebug>
 
 #include <qtcontacts-extensions.h>