Commit e9ed37e0 authored by chriadam's avatar chriadam

Accessors should be const

parent 8a35584a
......@@ -815,7 +815,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);
......@@ -824,7 +824,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);
......
......@@ -151,8 +151,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);
......
......@@ -133,6 +133,7 @@ void QContactManagerData::createEngine(const QString &managerName, const QMap<QS
while (!found) {
foreach (QContactManagerEngineFactory* f, factories) {
if (!f) continue;
QList<int> versions = f->supportedImplementationVersions();
if (implementationVersion == -1 ||//no given implementation version required
versions.isEmpty() || //the manager engine factory does not report any version
......
......@@ -458,7 +458,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;
......@@ -469,7 +469,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>();
......
......@@ -101,8 +101,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);
......
......@@ -649,7 +649,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);
......@@ -658,7 +658,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);
......
......@@ -143,8 +143,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);
......
......@@ -534,7 +534,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;
......@@ -545,7 +545,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>();
......
......@@ -103,8 +103,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);
......
......@@ -519,7 +519,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;
......@@ -530,7 +530,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;
......
......@@ -159,8 +159,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);
......
......@@ -1045,7 +1045,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;
......@@ -1056,7 +1056,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;
......
......@@ -147,8 +147,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);
......
......@@ -258,7 +258,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
......@@ -270,7 +270,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
......
......@@ -135,8 +135,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment