Skip to content
Snippets Groups Projects
Commit 4e3e9204 authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Guillaume Roguez
Browse files

fix RecentModel ordering


UsageStatistics::update() was being called before setLastUsed()
in the ContactMethod which resulted in the lastUsedChanged signal
not being emitted and so the RecentModel was not being re-ordered.

Change-Id: I866b213ae97aacd5bd6ef6157fb136a436952b08
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 3cd006d4
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment