Skip to content

Commit

Permalink
[contacts] Fix return type for SeasideAddressBookModel::addressBookAt…
Browse files Browse the repository at this point in the history
…(). JB#51940

This should return a QVariant instead as the SeasideAddressBook
may be accessed in a context where the type is not registered.
  • Loading branch information
blammit committed Nov 9, 2020
1 parent 7add33b commit 8b08724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/seasideaddressbookmodel.cpp
Expand Up @@ -72,9 +72,9 @@ int SeasideAddressBookModel::contactId() const
return m_contactId;
}

SeasideAddressBook SeasideAddressBookModel::addressBookAt(int index) const
QVariant SeasideAddressBookModel::addressBookAt(int index) const
{
return m_filteredAddressBooks.value(index);
return QVariant::fromValue(m_filteredAddressBooks.value(index));
}

QHash<int, QByteArray> SeasideAddressBookModel::roleNames() const
Expand Down
2 changes: 1 addition & 1 deletion src/seasideaddressbookmodel.h
Expand Up @@ -60,7 +60,7 @@ class SeasideAddressBookModel : public QAbstractListModel, public QQmlParserStat
void setContactId(int contactId);
int contactId() const;

Q_INVOKABLE SeasideAddressBook addressBookAt(int index) const;
Q_INVOKABLE QVariant addressBookAt(int index) const;

int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
Expand Down

0 comments on commit 8b08724

Please sign in to comment.