diff --git a/src/person.cpp b/src/person.cpp index 7b4d43f2cc240e057d002fd222d607c222932617..56430cebcb899c62e093bcfb1f9a751b9b115725 100644 --- a/src/person.cpp +++ b/src/person.cpp @@ -184,6 +184,7 @@ void PersonPrivate::registerContactMethod(ContactMethod* m) { m_HiddenContactMethods << m; connect(m, &ContactMethod::lastUsedChanged, this, &PersonPrivate::slotLastUsedTimeChanged); + connect(m, &ContactMethod::callAdded, this, &PersonPrivate::slotCallAdded); if (m->lastUsed() > m_LastUsed) slotLastUsedTimeChanged(m->lastUsed()); @@ -360,6 +361,7 @@ void Person::setContactMethods(ContactMethods numbers) disconnect(n,SIGNAL(presentChanged(bool)),this,SLOT(slotPresenceChanged())); disconnect(n, &ContactMethod::lastUsedChanged, d_ptr, &PersonPrivate::slotLastUsedTimeChanged); disconnect(n, &ContactMethod::unreadTextMessageCountChanged, d_ptr, &PersonPrivate::changed); + disconnect(n, &ContactMethod::callAdded, d_ptr, &PersonPrivate::slotCallAdded); } d_ptr->m_Numbers = numbers; @@ -367,6 +369,7 @@ void Person::setContactMethods(ContactMethods numbers) connect(n,SIGNAL(presentChanged(bool)),this,SLOT(slotPresenceChanged())); connect(n, &ContactMethod::lastUsedChanged, d_ptr, &PersonPrivate::slotLastUsedTimeChanged); connect(n, &ContactMethod::unreadTextMessageCountChanged, d_ptr, &PersonPrivate::changed); + connect(n, &ContactMethod::callAdded, d_ptr, &PersonPrivate::slotCallAdded); } d_ptr->phoneNumbersChanged(); @@ -747,3 +750,10 @@ void PersonPrivate::slotLastUsedTimeChanged(::time_t t) emit c->lastUsedTimeChanged(t); } } + +void PersonPrivate::slotCallAdded(Call *call) +{ + foreach (Person* c,m_lParents) { + emit c->callAdded(call); + } +} diff --git a/src/person.h b/src/person.h index ea236a75d601ef2b86c378654845a7d3204ce8e3..8520a3829b12559b0fdf4c888e24e555c1343f22 100644 --- a/src/person.h +++ b/src/person.h @@ -196,6 +196,8 @@ Q_SIGNALS: void rebased ( Person* ); ///The last time there was an interaction with this person changed void lastUsedTimeChanged ( long long ) const; + ///A new call used a ContactMethod associated with this Person + void callAdded ( Call* ); protected: //Presence secret methods diff --git a/src/private/person_p.h b/src/private/person_p.h index 1dea83e9c7dbea06623ced0e067bbc14188bc571..9ed62aaf306323f811cbe3c13d792c7a28dba467 100644 --- a/src/private/person_p.h +++ b/src/private/person_p.h @@ -84,5 +84,5 @@ public: public Q_SLOTS: void slotLastUsedTimeChanged(::time_t t); + void slotCallAdded (Call *call); }; -