Skip to content
Snippets Groups Projects
Commit d27b11fb authored by Alexandre Lision's avatar Alexandre Lision Committed by gerrit2
Browse files

phonedirectorymodel: regroup getNumber() implementations

getNumber is vastly used across LRC, and has three variants. This commits
regroups them for readbility.

Issue: #75334
Change-Id: If1348a6079d721e751e38a88f8cb464bc425296e
parent 0d06b1ef
No related branches found
No related tags found
No related merge requests found
...@@ -328,16 +328,6 @@ void PhoneDirectoryModelPrivate::setAccount(ContactMethod* number, Account* acco ...@@ -328,16 +328,6 @@ void PhoneDirectoryModelPrivate::setAccount(ContactMethod* number, Account* acco
} }
} }
/**
* This version of getNumber() try to get a phone number with a contact from an URI and account
* It will also try to attach an account to existing numbers. This is not 100% reliable, but
* it is correct often enough to do it.
*/
ContactMethod* PhoneDirectoryModel::getNumber(const QString& uri, Account* account, const QString& type)
{
return getNumber(uri,nullptr,account,type);
}
///Add new information to existing numbers and try to merge ///Add new information to existing numbers and try to merge
ContactMethod* PhoneDirectoryModelPrivate::fillDetails(NumberWrapper* wrap, const URI& strippedUri, Account* account, Person* contact, const QString& type) ContactMethod* PhoneDirectoryModelPrivate::fillDetails(NumberWrapper* wrap, const URI& strippedUri, Account* account, Person* contact, const QString& type)
{ {
...@@ -413,6 +403,16 @@ ContactMethod* PhoneDirectoryModelPrivate::fillDetails(NumberWrapper* wrap, cons ...@@ -413,6 +403,16 @@ ContactMethod* PhoneDirectoryModelPrivate::fillDetails(NumberWrapper* wrap, cons
return nullptr; return nullptr;
} }
/**
* This version of getNumber() try to get a phone number with a contact from an URI and account
* It will also try to attach an account to existing numbers. This is not 100% reliable, but
* it is correct often enough to do it.
*/
ContactMethod* PhoneDirectoryModel::getNumber(const QString& uri, Account* account, const QString& type)
{
return getNumber(uri,nullptr,account,type);
}
///Return/create a number when no information is available ///Return/create a number when no information is available
ContactMethod* PhoneDirectoryModel::getNumber(const QString& uri, const QString& type) ContactMethod* PhoneDirectoryModel::getNumber(const QString& uri, const QString& type)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment