Merge branch 'master' of https://github.com/TheDrawingCoder-Gamer/nheko into TheDrawingCoder-Gamer-master

This commit is contained in:
Nicolas Werner 2022-05-06 15:41:51 +02:00
commit d4b7712a66
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
12 changed files with 5058 additions and 2967 deletions

View file

@ -31,11 +31,12 @@ EmojiModel::roleNames() const
static QHash<int, QByteArray> roles;
if (roles.isEmpty()) {
roles = QAbstractListModel::roleNames();
roles[static_cast<int>(EmojiModel::Roles::Unicode)] = QByteArrayLiteral("unicode");
roles[static_cast<int>(EmojiModel::Roles::ShortName)] = QByteArrayLiteral("shortName");
roles[static_cast<int>(EmojiModel::Roles::Category)] = QByteArrayLiteral("category");
roles[static_cast<int>(EmojiModel::Roles::Emoji)] = QByteArrayLiteral("emoji");
roles = QAbstractListModel::roleNames();
roles[static_cast<int>(EmojiModel::Roles::Unicode)] = QByteArrayLiteral("unicode");
roles[static_cast<int>(EmojiModel::Roles::ShortName)] = QByteArrayLiteral("shortName");
roles[static_cast<int>(EmojiModel::Roles::UnicodeName)] = QByteArrayLiteral("unicodeName");
roles[static_cast<int>(EmojiModel::Roles::Category)] = QByteArrayLiteral("category");
roles[static_cast<int>(EmojiModel::Roles::Emoji)] = QByteArrayLiteral("emoji");
}
return roles;
@ -58,10 +59,12 @@ EmojiModel::data(const QModelIndex &index, int role) const
return Provider::emoji[index.row()].unicode;
case Qt::ToolTipRole:
case CompletionModel::SearchRole2:
case static_cast<int>(EmojiModel::Roles::UnicodeName):
return Provider::emoji[index.row()].unicodeName;
case CompletionModel::SearchRole:
case static_cast<int>(EmojiModel::Roles::ShortName):
return Provider::emoji[index.row()].shortName;
case static_cast<int>(EmojiModel::Roles::Category):
return QVariant::fromValue(Provider::emoji[index.row()].category);

View file

@ -26,6 +26,7 @@ public:
Unicode = Qt::UserRole, // unicode of emoji
Category, // category of emoji
ShortName, // shortext of the emoji
UnicodeName, // true unicode name of the emoji
Emoji, // Contains everything from the Emoji
};

File diff suppressed because it is too large Load diff

View file

@ -35,11 +35,13 @@ public:
Q_PROPERTY(const QString &unicode MEMBER unicode)
Q_PROPERTY(const QString &shortName MEMBER shortName)
Q_PROPERTY(const QString &unicodeName MEMBER unicodeName)
Q_PROPERTY(emoji::Emoji::Category category MEMBER category)
public:
QString unicode;
QString shortName;
QString unicodeName;
Category category;
};