Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb49469' into 'master'
[libcontacts] Avoid crash from null ContactManagerEngine

See merge request mer-core/libcontacts!19
  • Loading branch information
kende committed Jun 25, 2020
2 parents 0fdde72 + 416b2d7 commit d5f27cc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/seasidecache.cpp
Expand Up @@ -571,17 +571,21 @@ SeasideCache::SeasideCache()
// need to find it from the manager's engine object
typedef QtContactsSqliteExtensions::ContactManagerEngine EngineType;
EngineType *cme = dynamic_cast<EngineType *>(QContactManagerData::managerData(mgr)->m_engine);
connect(cme, SIGNAL(displayLabelGroupsChanged(QStringList)),
this, SLOT(displayLabelGroupsChanged(QStringList)));
displayLabelGroupsChanged(cme->displayLabelGroups());
if (cme) {
connect(cme, SIGNAL(displayLabelGroupsChanged(QStringList)),
this, SLOT(displayLabelGroupsChanged(QStringList)));
displayLabelGroupsChanged(cme->displayLabelGroups());
connect(cme, SIGNAL(contactsPresenceChanged(QList<QContactId>)),
this, SLOT(contactsPresenceChanged(QList<QContactId>)));
} else {
qWarning() << "Unable to retrieve contact manager engine";
}

connect(mgr, SIGNAL(dataChanged()), this, SLOT(dataChanged()));
connect(mgr, SIGNAL(contactsAdded(QList<QContactId>)),
this, SLOT(contactsAdded(QList<QContactId>)));
connect(mgr, SIGNAL(contactsChanged(QList<QContactId>)),
this, SLOT(contactsChanged(QList<QContactId>)));
connect(cme, SIGNAL(contactsPresenceChanged(QList<QContactId>)),
this, SLOT(contactsPresenceChanged(QList<QContactId>)));
connect(mgr, SIGNAL(contactsRemoved(QList<QContactId>)),
this, SLOT(contactsRemoved(QList<QContactId>)));

Expand Down

0 comments on commit d5f27cc

Please sign in to comment.