diff --git a/src/contactmethod.cpp b/src/contactmethod.cpp index 342ac374d9a0d2520539887a6142fc24e04fdd26..c46c82d2926d3f80459427de2d87b118cc457d5a 100644 --- a/src/contactmethod.cpp +++ b/src/contactmethod.cpp @@ -588,6 +588,10 @@ void ContactMethod::addCall(Call* call) d_ptr->m_Type = ContactMethod::Type::USED; d_ptr->m_lCalls << call; + // call setLastUsed first so that we emit lastUsedChanged() + auto time = call->startTimeStamp(); + setLastUsed(time); + //Update the contact method statistics d_ptr->m_UsageStats.update(call->startTimeStamp(), call->stopTimeStamp()); if (d_ptr->m_pAccount) @@ -599,10 +603,8 @@ void ContactMethod::addCall(Call* call) d_ptr->m_pAccount->usageStats.setHaveCalled(); } - auto time = call->startTimeStamp(); if (d_ptr->m_pAccount) d_ptr->m_pAccount->usageStats.setLastUsed(time); - setLastUsed(time); d_ptr->callAdded(call); d_ptr->changed();