Rename AccountStickerModel to AccountEmoticonModel
In preparation for using it for custom emojis as well
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "emoticonfiltermodel.h"
|
||||
|
||||
#include "accountstickermodel.h"
|
||||
#include "accountemoticonmodel.h"
|
||||
|
||||
EmoticonFilterModel::EmoticonFilterModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
@@ -12,8 +12,8 @@ EmoticonFilterModel::EmoticonFilterModel(QObject *parent)
|
||||
|
||||
bool EmoticonFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
auto stickerUsage = sourceModel()->data(sourceModel()->index(sourceRow, 0), AccountStickerModel::IsStickerRole).toBool();
|
||||
auto emojiUsage = sourceModel()->data(sourceModel()->index(sourceRow, 0), AccountStickerModel::IsEmojiRole).toBool();
|
||||
auto stickerUsage = sourceModel()->data(sourceModel()->index(sourceRow, 0), AccountEmoticonModel::IsStickerRole).toBool();
|
||||
auto emojiUsage = sourceModel()->data(sourceModel()->index(sourceRow, 0), AccountEmoticonModel::IsEmojiRole).toBool();
|
||||
return (stickerUsage && m_showStickers) || (emojiUsage && m_showEmojis);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@ bool EmoticonFilterModel::showStickers() const
|
||||
|
||||
void EmoticonFilterModel::setShowStickers(bool showStickers)
|
||||
{
|
||||
beginResetModel();
|
||||
m_showStickers = showStickers;
|
||||
endResetModel();
|
||||
Q_EMIT showStickersChanged();
|
||||
}
|
||||
|
||||
@@ -35,6 +37,8 @@ bool EmoticonFilterModel::showEmojis() const
|
||||
|
||||
void EmoticonFilterModel::setShowEmojis(bool showEmojis)
|
||||
{
|
||||
beginResetModel();
|
||||
m_showEmojis = showEmojis;
|
||||
endResetModel();
|
||||
Q_EMIT showEmojisChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user