File: 0031-Accessors-should-be-const.patch

package info (click to toggle)
qtpim-opensource-src 5.0~git20201102.f9a8f0fc%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 17,540 kB
  • sloc: cpp: 82,710; xml: 91; makefile: 86; javascript: 67
file content (287 lines) | stat: -rw-r--r-- 16,230 bytes parent folder | download
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
From 7feeeab6dfa98a055a9fcd1ab37e399c3427f26a Mon Sep 17 00:00:00 2001
From: Chris Adams <chris.adams@qinetic.com.au>
Date: Wed, 1 Jul 2020 10:45:27 +1000
Subject: [PATCH 30/32] Accessors should be const

Change-Id: I5316640c5645eddc4078898a67f54dd984ffd29a
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Signed-off-by: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
---
 src/contacts/qcontactmanager.cpp                             | 4 ++--
 src/contacts/qcontactmanager.h                               | 4 ++--
 src/contacts/qcontactmanagerengine.cpp                       | 4 ++--
 src/contacts/qcontactmanagerengine.h                         | 4 ++--
 src/organizer/qorganizermanager.cpp                          | 4 ++--
 src/organizer/qorganizermanager.h                            | 4 ++--
 src/organizer/qorganizermanagerengine.cpp                    | 4 ++--
 src/organizer/qorganizermanagerengine.h                      | 4 ++--
 src/plugins/contacts/memory/qcontactmemorybackend.cpp        | 4 ++--
 src/plugins/contacts/memory/qcontactmemorybackend_p.h        | 4 ++--
 src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp | 4 ++--
 src/plugins/organizer/memory/qorganizeritemmemorybackend_p.h | 4 ++--
 src/plugins/organizer/skeleton/qorganizerskeleton.cpp        | 4 ++--
 src/plugins/organizer/skeleton/qorganizerskeleton_p.h        | 4 ++--
 14 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/contacts/qcontactmanager.cpp b/src/contacts/qcontactmanager.cpp
index 5d7b4347..919a7325 100644
--- a/src/contacts/qcontactmanager.cpp
+++ b/src/contacts/qcontactmanager.cpp
@@ -821,7 +821,7 @@ QContactCollectionId QContactManager::defaultCollectionId() const
 /*!
   Returns the collection identified by the given \a collectionId which is managed by this manager.
  */
-QContactCollection QContactManager::collection(const QContactCollectionId& collectionId)
+QContactCollection QContactManager::collection(const QContactCollectionId& collectionId) const
 {
     QContactManagerSyncOpErrorHolder h(this);
     return d->m_engine->collection(collectionId, &h.error);
@@ -830,7 +830,7 @@ QContactCollection QContactManager::collection(const QContactCollectionId& colle
 /*!
   Returns a list of all of the collections managed by this manager.
  */
-QList<QContactCollection> QContactManager::collections()
+QList<QContactCollection> QContactManager::collections() const
 {
     QContactManagerSyncOpErrorHolder h(this);
     return d->m_engine->collections(&h.error);
diff --git a/src/contacts/qcontactmanager.h b/src/contacts/qcontactmanager.h
index a971be69..7b6302af 100644
--- a/src/contacts/qcontactmanager.h
+++ b/src/contacts/qcontactmanager.h
@@ -157,8 +157,8 @@ public:
 
     // collections
     QContactCollectionId defaultCollectionId() const;
-    QContactCollection collection(const QContactCollectionId& collectionId);
-    QList<QContactCollection> collections();
+    QContactCollection collection(const QContactCollectionId& collectionId) const;
+    QList<QContactCollection> collections() const;
     bool saveCollection(QContactCollection* collection);
     bool removeCollection(const QContactCollectionId& collectionId);
 
diff --git a/src/contacts/qcontactmanagerengine.cpp b/src/contacts/qcontactmanagerengine.cpp
index 670fb0ec..0704430e 100644
--- a/src/contacts/qcontactmanagerengine.cpp
+++ b/src/contacts/qcontactmanagerengine.cpp
@@ -464,7 +464,7 @@ QContactCollectionId QContactManagerEngine::defaultCollectionId() const
     \c QContactManager::DoesNotExistError.
 
 */
-QContactCollection QContactManagerEngine::collection(const QContactCollectionId& collectionId, QContactManager::Error* error)
+QContactCollection QContactManagerEngine::collection(const QContactCollectionId& collectionId, QContactManager::Error* error) const
 {
     Q_UNUSED(collectionId);
     *error = QContactManager::NotSupportedError;
@@ -475,7 +475,7 @@ QContactCollection QContactManagerEngine::collection(const QContactCollectionId&
     This function should be reimplemented to support synchronous calls to fetch all the collections
     managed by this backend. Any errors encountered during this operation should be stored to \a error.
  */
-QList<QContactCollection> QContactManagerEngine::collections(QContactManager::Error* error)
+QList<QContactCollection> QContactManagerEngine::collections(QContactManager::Error* error) const
 {
     *error = QContactManager::NotSupportedError;
     return QList<QContactCollection>();
diff --git a/src/contacts/qcontactmanagerengine.h b/src/contacts/qcontactmanagerengine.h
index dfac61c8..be3c4862 100644
--- a/src/contacts/qcontactmanagerengine.h
+++ b/src/contacts/qcontactmanagerengine.h
@@ -107,8 +107,8 @@ public:
 
     // collections
     virtual QContactCollectionId defaultCollectionId() const;
-    virtual QContactCollection collection(const QContactCollectionId &collectionId, QContactManager::Error *error);
-    virtual QList<QContactCollection> collections(QContactManager::Error *error);
+    virtual QContactCollection collection(const QContactCollectionId &collectionId, QContactManager::Error *error) const;
+    virtual QList<QContactCollection> collections(QContactManager::Error *error) const;
     virtual bool saveCollection(QContactCollection *collection, QContactManager::Error *error);
     virtual bool removeCollection(const QContactCollectionId &collectionId, QContactManager::Error *error);
 
diff --git a/src/organizer/qorganizermanager.cpp b/src/organizer/qorganizermanager.cpp
index 8176b05a..8abdae2b 100644
--- a/src/organizer/qorganizermanager.cpp
+++ b/src/organizer/qorganizermanager.cpp
@@ -655,7 +655,7 @@ QOrganizerCollectionId QOrganizerManager::defaultCollectionId() const
 /*!
   Returns the collection identified by the given \a collectionId which is managed by this manager.
  */
-QOrganizerCollection QOrganizerManager::collection(const QOrganizerCollectionId& collectionId)
+QOrganizerCollection QOrganizerManager::collection(const QOrganizerCollectionId& collectionId) const
 {
     QOrganizerManagerSyncOpErrorHolder h(this);
     return d->m_engine->collection(collectionId, &h.error);
@@ -664,7 +664,7 @@ QOrganizerCollection QOrganizerManager::collection(const QOrganizerCollectionId&
 /*!
   Returns a list of all of the collections managed by this manager.
  */
-QList<QOrganizerCollection> QOrganizerManager::collections()
+QList<QOrganizerCollection> QOrganizerManager::collections() const
 {
     QOrganizerManagerSyncOpErrorHolder h(this);
     return d->m_engine->collections(&h.error);
diff --git a/src/organizer/qorganizermanager.h b/src/organizer/qorganizermanager.h
index 7b17e1fe..70ff0869 100644
--- a/src/organizer/qorganizermanager.h
+++ b/src/organizer/qorganizermanager.h
@@ -149,8 +149,8 @@ public:
 
     // collections
     QOrganizerCollectionId defaultCollectionId() const;
-    QOrganizerCollection collection(const QOrganizerCollectionId& collectionId);
-    QList<QOrganizerCollection> collections();
+    QOrganizerCollection collection(const QOrganizerCollectionId& collectionId) const;
+    QList<QOrganizerCollection> collections() const;
     bool saveCollection(QOrganizerCollection* collection);
     bool removeCollection(const QOrganizerCollectionId& collectionId);
 
diff --git a/src/organizer/qorganizermanagerengine.cpp b/src/organizer/qorganizermanagerengine.cpp
index 28183c75..7ecdc81d 100644
--- a/src/organizer/qorganizermanagerengine.cpp
+++ b/src/organizer/qorganizermanagerengine.cpp
@@ -540,7 +540,7 @@ QOrganizerCollectionId QOrganizerManagerEngine::defaultCollectionId() const
     \c QOrganizerManager::DoesNotExistError.
 
 */
-QOrganizerCollection QOrganizerManagerEngine::collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error)
+QOrganizerCollection QOrganizerManagerEngine::collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error) const
 {
     Q_UNUSED(collectionId);
     *error = QOrganizerManager::NotSupportedError;
@@ -551,7 +551,7 @@ QOrganizerCollection QOrganizerManagerEngine::collection(const QOrganizerCollect
     This function should be reimplemented to support synchronous calls to fetch all the collections
     managed by this backend. Any errors encountered during this operation should be stored to \a error.
  */
-QList<QOrganizerCollection> QOrganizerManagerEngine::collections(QOrganizerManager::Error* error)
+QList<QOrganizerCollection> QOrganizerManagerEngine::collections(QOrganizerManager::Error* error) const
 {
     *error = QOrganizerManager::NotSupportedError;
     return QList<QOrganizerCollection>();
diff --git a/src/organizer/qorganizermanagerengine.h b/src/organizer/qorganizermanagerengine.h
index 82830767..4c80a667 100644
--- a/src/organizer/qorganizermanagerengine.h
+++ b/src/organizer/qorganizermanagerengine.h
@@ -109,8 +109,8 @@ public:
 
     // collections
     virtual QOrganizerCollectionId defaultCollectionId() const;
-    virtual QOrganizerCollection collection(const QOrganizerCollectionId &collectionId, QOrganizerManager::Error *error);
-    virtual QList<QOrganizerCollection> collections(QOrganizerManager::Error *error);
+    virtual QOrganizerCollection collection(const QOrganizerCollectionId &collectionId, QOrganizerManager::Error *error) const;
+    virtual QList<QOrganizerCollection> collections(QOrganizerManager::Error *error) const;
     virtual bool saveCollection(QOrganizerCollection *collection, QOrganizerManager::Error *error);
     virtual bool removeCollection(const QOrganizerCollectionId &collectionId, QOrganizerManager::Error *error);
 
diff --git a/src/plugins/contacts/memory/qcontactmemorybackend.cpp b/src/plugins/contacts/memory/qcontactmemorybackend.cpp
index 5cba6762..9a831bab 100644
--- a/src/plugins/contacts/memory/qcontactmemorybackend.cpp
+++ b/src/plugins/contacts/memory/qcontactmemorybackend.cpp
@@ -525,7 +525,7 @@ QContactCollectionId QContactMemoryEngine::defaultCollectionId() const
     return collectionId(id);
 }
 
-QContactCollection QContactMemoryEngine::collection(const QContactCollectionId &collectionId, QContactManager::Error *error)
+QContactCollection QContactMemoryEngine::collection(const QContactCollectionId &collectionId, QContactManager::Error *error) const
 {
     if (d->m_idToCollectionHash.contains(collectionId)) {
         *error = QContactManager::NoError;
@@ -536,7 +536,7 @@ QContactCollection QContactMemoryEngine::collection(const QContactCollectionId &
     return QContactCollection();
 }
 
-QList<QContactCollection> QContactMemoryEngine::collections(QContactManager::Error *error)
+QList<QContactCollection> QContactMemoryEngine::collections(QContactManager::Error *error) const
 {
     Q_ASSERT(!d->m_idToCollectionHash.isEmpty());
     *error = QContactManager::NoError;
diff --git a/src/plugins/contacts/memory/qcontactmemorybackend_p.h b/src/plugins/contacts/memory/qcontactmemorybackend_p.h
index 22ce7a65..4e9b2726 100644
--- a/src/plugins/contacts/memory/qcontactmemorybackend_p.h
+++ b/src/plugins/contacts/memory/qcontactmemorybackend_p.h
@@ -165,8 +165,8 @@ public:
 
     // collections
     QContactCollectionId defaultCollectionId() const;
-    QContactCollection collection(const QContactCollectionId &collectionId, QContactManager::Error *error);
-    QList<QContactCollection> collections(QContactManager::Error* error);
+    QContactCollection collection(const QContactCollectionId &collectionId, QContactManager::Error *error) const;
+    QList<QContactCollection> collections(QContactManager::Error* error) const;
     bool saveCollection(QContactCollection* collection, QContactManager::Error* error);
     bool removeCollection(const QContactCollectionId& collectionId, QContactManager::Error* error);
 
diff --git a/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp b/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp
index aba5f083..42d872f7 100644
--- a/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp
+++ b/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp
@@ -1052,7 +1052,7 @@ QOrganizerCollectionId QOrganizerItemMemoryEngine::defaultCollectionId() const
     return collectionId(QByteArray(reinterpret_cast<const char *>(&id), sizeof(uint)));
 }
 
-QOrganizerCollection QOrganizerItemMemoryEngine::collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error)
+QOrganizerCollection QOrganizerItemMemoryEngine::collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error) const
 {
     if (d->m_idToCollectionHash.contains(collectionId)) {
         *error = QOrganizerManager::NoError;
@@ -1063,7 +1063,7 @@ QOrganizerCollection QOrganizerItemMemoryEngine::collection(const QOrganizerColl
     return QOrganizerCollection();
 }
 
-QList<QOrganizerCollection> QOrganizerItemMemoryEngine::collections(QOrganizerManager::Error* error)
+QList<QOrganizerCollection> QOrganizerItemMemoryEngine::collections(QOrganizerManager::Error* error) const
 {
     Q_ASSERT(!d->m_idToCollectionHash.isEmpty());
     *error = QOrganizerManager::NoError;
diff --git a/src/plugins/organizer/memory/qorganizeritemmemorybackend_p.h b/src/plugins/organizer/memory/qorganizeritemmemorybackend_p.h
index 1bfbfb22..4199140c 100644
--- a/src/plugins/organizer/memory/qorganizeritemmemorybackend_p.h
+++ b/src/plugins/organizer/memory/qorganizeritemmemorybackend_p.h
@@ -153,8 +153,8 @@ public:
 
     // collections
     QOrganizerCollectionId defaultCollectionId() const;
-    QOrganizerCollection collection(const QOrganizerCollectionId &collectionId, QOrganizerManager::Error *error);
-    QList<QOrganizerCollection> collections(QOrganizerManager::Error* error);
+    QOrganizerCollection collection(const QOrganizerCollectionId &collectionId, QOrganizerManager::Error *error) const;
+    QList<QOrganizerCollection> collections(QOrganizerManager::Error* error) const;
     bool saveCollection(QOrganizerCollection* collection, QOrganizerManager::Error* error);
     bool removeCollection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error);
 
diff --git a/src/plugins/organizer/skeleton/qorganizerskeleton.cpp b/src/plugins/organizer/skeleton/qorganizerskeleton.cpp
index 65ad696e..f551029e 100644
--- a/src/plugins/organizer/skeleton/qorganizerskeleton.cpp
+++ b/src/plugins/organizer/skeleton/qorganizerskeleton.cpp
@@ -264,7 +264,7 @@ QOrganizerCollectionId QOrganizerItemSkeletonEngine::defaultCollectionId() const
     return QOrganizerManagerEngine::defaultCollectionId();
 }
 
-QOrganizerCollection QOrganizerItemSkeletonEngine::collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error)
+QOrganizerCollection QOrganizerItemSkeletonEngine::collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error) const
 {
     /*
         TODO
@@ -276,7 +276,7 @@ QOrganizerCollection QOrganizerItemSkeletonEngine::collection(const QOrganizerCo
     return QOrganizerManagerEngine::collection(collectionId, error);
 }
 
-QList<QOrganizerCollection> QOrganizerItemSkeletonEngine::collections(QOrganizerManager::Error* error)
+QList<QOrganizerCollection> QOrganizerItemSkeletonEngine::collections(QOrganizerManager::Error* error) const
 {
     /*
         TODO
diff --git a/src/plugins/organizer/skeleton/qorganizerskeleton_p.h b/src/plugins/organizer/skeleton/qorganizerskeleton_p.h
index 3deea2a6..a89487e1 100644
--- a/src/plugins/organizer/skeleton/qorganizerskeleton_p.h
+++ b/src/plugins/organizer/skeleton/qorganizerskeleton_p.h
@@ -141,8 +141,8 @@ public:
 
     // collections
     QOrganizerCollectionId defaultCollectionId() const;
-    QOrganizerCollection collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error);
-    QList<QOrganizerCollection> collections(QOrganizerManager::Error* error);
+    QOrganizerCollection collection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error) const;
+    QList<QOrganizerCollection> collections(QOrganizerManager::Error* error) const;
     bool saveCollection(QOrganizerCollection* collection, QOrganizerManager::Error* error);
     bool removeCollection(const QOrganizerCollectionId& collectionId, QOrganizerManager::Error* error);
 
-- 
2.30.2