Skip to content

Commit

Permalink
a signal when the skill gets blacklisted
Browse files Browse the repository at this point in the history
  • Loading branch information
notmart committed Dec 13, 2019
1 parent 1576989 commit 9ae5011
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions import/activeskillsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void ActiveSkillsModel::setWhiteList(const QStringList &list)
}

void ActiveSkillsModel::insertSkills(int position, const QStringList &skillList)
{qWarning()<<"AAAAAAAAAAAAA"<<skillList<<m_whiteList;
{
if (position < 0 || position > m_skills.count()) {
return;
}
Expand All @@ -75,7 +75,11 @@ void ActiveSkillsModel::insertSkills(int position, const QStringList &skillList)
std::back_inserter(filteredList),
[this](const QString &val)
{
return !m_skills.contains(val) && !m_blackList.contains(val) && (m_whiteList.isEmpty() || m_whiteList.contains(val));
const bool blacklisted = m_blackList.contains(val);
if (blacklisted) {
emit skillBlackListed(val);
}
return !m_skills.contains(val) && !blacklisted && (m_whiteList.isEmpty() || m_whiteList.contains(val));
});

if (filteredList.isEmpty()) {
Expand Down
1 change: 1 addition & 0 deletions import/activeskillsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class ActiveSkillsModel : public QAbstractListModel
Q_SIGNALS:
void blackListChanged();
void whiteListChanged();
void skillBlackListed(const QString &id);

private:
QList<QString> m_skills;
Expand Down

0 comments on commit 9ae5011

Please sign in to comment.