Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb44742-notify' into 'master'
[lib] Add RecentContactsModel missing property change signals. Contributes to JB#44742

See merge request mer-core/libcommhistory!29
  • Loading branch information
blam committed Mar 12, 2019
2 parents 647bd7b + 062cdfa commit d792e65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/recentcontactsmodel.cpp
Expand Up @@ -341,8 +341,11 @@ void RecentContactsModel::setRequiredProperty(int requiredProperty)
if (requiredProperty & RecentContactsModel::AccountUriRequired)
addressFlags |= QContactStatusFlags::HasOnlineAccount;

d->requiredProperty = requiredProperty;
d->addressFlags = addressFlags;
if (d->requiredProperty != requiredProperty) {
d->requiredProperty = requiredProperty;
emit requiredPropertyChanged();
}
}

bool RecentContactsModel::excludeFavorites() const
Expand All @@ -354,7 +357,10 @@ bool RecentContactsModel::excludeFavorites() const
void RecentContactsModel::setExcludeFavorites(bool exclude)
{
Q_D(RecentContactsModel);
d->excludeFavorites = exclude;
if (d->excludeFavorites != exclude) {
d->excludeFavorites = exclude;
emit excludeFavoritesChanged();
}
}

bool RecentContactsModel::resolving() const
Expand Down
6 changes: 4 additions & 2 deletions src/recentcontactsmodel.h
Expand Up @@ -40,8 +40,8 @@ class LIBCOMMHISTORY_EXPORT RecentContactsModel : public EventModel
{
Q_OBJECT

Q_PROPERTY(int requiredProperty READ requiredProperty WRITE setRequiredProperty)
Q_PROPERTY(bool excludeFavorites READ excludeFavorites WRITE setExcludeFavorites)
Q_PROPERTY(int requiredProperty READ requiredProperty WRITE setRequiredProperty NOTIFY requiredPropertyChanged)
Q_PROPERTY(bool excludeFavorites READ excludeFavorites WRITE setExcludeFavorites NOTIFY excludeFavoritesChanged)
Q_PROPERTY(bool resolving READ resolving NOTIFY resolvingChanged)
Q_ENUMS(RequiredPropertyType)

Expand Down Expand Up @@ -108,6 +108,8 @@ class LIBCOMMHISTORY_EXPORT RecentContactsModel : public EventModel
bool resolving() const;

Q_SIGNALS:
void requiredPropertyChanged();
void excludeFavoritesChanged();
void resolvingChanged();

private:
Expand Down

0 comments on commit d792e65

Please sign in to comment.