mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-07 15:08:24 +00:00
fix(ui/views/App/MainWindow/Contacts): $contact was undefined in some cases
This commit is contained in:
parent
31321a4db7
commit
ceef883d6f
3 changed files with 11 additions and 19 deletions
|
|
@ -7,8 +7,8 @@
|
|||
#include "ContactsListProxyModel.hpp"
|
||||
|
||||
#define USERNAME_WEIGHT 50.0
|
||||
#define MAIN_SIP_ADDRESS_WEIGHT 30.0
|
||||
#define OTHER_SIP_ADDRESSES_WEIGHT 20.0
|
||||
#define MAIN_SIP_ADDRESS_WEIGHT 25.0
|
||||
#define OTHER_SIP_ADDRESSES_WEIGHT 25.0
|
||||
|
||||
#define FACTOR_POS_1 0.90
|
||||
#define FACTOR_POS_2 0.80
|
||||
|
|
@ -44,6 +44,7 @@ ContactsListProxyModel::ContactsListProxyModel (QObject *parent) : QSortFilterPr
|
|||
for (const ContactModel *contact : m_list->m_list)
|
||||
m_weights[contact] = 0;
|
||||
|
||||
setDynamicSortFilter(false);
|
||||
sort(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ public:
|
|||
return m_list;
|
||||
}
|
||||
|
||||
public slots:
|
||||
void setFilter (const QString &pattern) {
|
||||
setFilterFixedString(pattern);
|
||||
sort(0);
|
||||
}
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const;
|
||||
bool lessThan (const QModelIndex &left, const QModelIndex &right) const;
|
||||
|
|
|
|||
|
|
@ -10,21 +10,6 @@ import App.Styles 1.0
|
|||
// ===================================================================
|
||||
|
||||
ColumnLayout {
|
||||
function _filter (text) {
|
||||
Utils.assert(
|
||||
contacts.setFilterFixedString != null,
|
||||
'`contacts.setFilterFixedString` must be defined.'
|
||||
)
|
||||
|
||||
Utils.assert(
|
||||
contacts.invalidate != null,
|
||||
'`contacts.invalidate` must be defined.'
|
||||
)
|
||||
|
||||
contacts.setFilterFixedString(text)
|
||||
contacts.invalidate()
|
||||
}
|
||||
|
||||
function _removeContact (contact) {
|
||||
Utils.openConfirmDialog(window, {
|
||||
descriptionText: qsTr('removeContactDescription'),
|
||||
|
|
@ -62,7 +47,7 @@ ColumnLayout {
|
|||
icon: 'filter'
|
||||
placeholderText: qsTr('searchContactPlaceholder')
|
||||
|
||||
onTextChanged: _filter(text)
|
||||
onTextChanged: contacts.setFilter(text)
|
||||
}
|
||||
|
||||
ExclusiveButtons {
|
||||
|
|
@ -71,7 +56,7 @@ ColumnLayout {
|
|||
qsTr('selectConnectedContacts')
|
||||
]
|
||||
|
||||
onClicked: contacts.useConnectedFilter = (button === 1)
|
||||
onClicked: contacts.useConnectedFilter = !!button
|
||||
}
|
||||
|
||||
TextButtonB {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue