mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
Fix contact shortcut in searchbar
This commit is contained in:
parent
b82f6fd13b
commit
8cb167978e
2 changed files with 10 additions and 8 deletions
|
|
@ -107,18 +107,20 @@ QVariant SipAddressesModel::data (const QModelIndex &index, int role) const {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QVariantMap SipAddressesModel::find (const QString &sipAddress) const {
|
||||
auto it = mPeerAddressToSipAddressEntry.find(sipAddress);
|
||||
if (it == mPeerAddressToSipAddressEntry.end())
|
||||
return QVariantMap();
|
||||
QString cleanedAddress = Utils::cleanSipAddress(sipAddress);
|
||||
auto it = mPeerAddressToSipAddressEntry.find(cleanedAddress);
|
||||
if (it == mPeerAddressToSipAddressEntry.end())
|
||||
return QVariantMap();
|
||||
|
||||
return buildVariantMap(*it);
|
||||
return buildVariantMap(*it);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ContactModel *SipAddressesModel::mapSipAddressToContact (const QString &sipAddress) const {
|
||||
auto it = mPeerAddressToSipAddressEntry.find(sipAddress);
|
||||
return it == mPeerAddressToSipAddressEntry.end() ? nullptr : it->contact;
|
||||
QString cleanedAddress = Utils::cleanSipAddress(sipAddress);
|
||||
auto it = mPeerAddressToSipAddressEntry.find(cleanedAddress);
|
||||
return it == mPeerAddressToSipAddressEntry.end() ? nullptr : it->contact;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ ApplicationWindow {
|
|||
})
|
||||
|
||||
onEntryClicked: {
|
||||
if (entry.contact && SettingsModel.contactsEnabled) {
|
||||
window.setView('ContactEdit', { sipAddress: entry.sipAddress })
|
||||
if (SettingsModel.contactsEnabled) {
|
||||
window.setView('ContactEdit', { sipAddress: entry })
|
||||
} else {
|
||||
CallsListModel.createChatRoom( "", false, [entry], true )
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue