mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-02-01 11:39:26 +00:00
feat(app): little fixes
This commit is contained in:
parent
8240c265e3
commit
7e13551cab
5 changed files with 3 additions and 11 deletions
|
|
@ -40,7 +40,7 @@ QHash<int, QByteArray> ContactsListModel::roleNames () const {
|
|||
QVariant ContactsListModel::data (const QModelIndex &index, int role) const {
|
||||
int row = index.row();
|
||||
|
||||
if (row < 0 || row >= m_list.count())
|
||||
if (!index.isValid() || row < 0 || row >= m_list.count())
|
||||
return QVariant();
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
// =============================================================================
|
||||
|
||||
class ContactsListModel : public QAbstractListModel {
|
||||
friend class ContactsListProxyModel;
|
||||
friend class SipAddressesModel;
|
||||
|
||||
Q_OBJECT;
|
||||
|
|
|
|||
|
|
@ -32,13 +32,7 @@ const QRegExp ContactsListProxyModel::m_search_separators("^[^_.-;@ ][_.-;@ ]");
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
ContactsListProxyModel::ContactsListProxyModel (QObject *parent) : QSortFilterProxyModel(parent) {
|
||||
m_list = CoreManager::getInstance()->getContactsListModel();
|
||||
|
||||
setSourceModel(m_list);
|
||||
|
||||
for (const ContactModel *contact : m_list->m_list)
|
||||
m_weights[contact] = 0;
|
||||
|
||||
setSourceModel(CoreManager::getInstance()->getContactsListModel());
|
||||
sort(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ private:
|
|||
|
||||
void setConnectedFilter (bool use_connected_filter);
|
||||
|
||||
ContactsListModel *m_list;
|
||||
QString m_filter;
|
||||
bool m_use_connected_filter = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ QHash<int, QByteArray> SipAddressesModel::roleNames () const {
|
|||
QVariant SipAddressesModel::data (const QModelIndex &index, int role) const {
|
||||
int row = index.row();
|
||||
|
||||
if (row < 0 || row >= m_refs.count())
|
||||
if (!index.isValid() || row < 0 || row >= m_refs.count())
|
||||
return QVariant();
|
||||
|
||||
if (role == Qt::DisplayRole)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue