From 209865e8826e9107cba5b41eed9e9ca00e1b1276 Mon Sep 17 00:00:00 2001 From: BulbyVR <26726264+TheDrawingCoder-Gamer@users.noreply.github.com> Date: Fri, 22 Apr 2022 21:42:29 -0400 Subject: [PATCH] Add more aliases, start on regional indicators --- resources/extra_emoji.txt | 27 +++++++++++++++++++++++++++ resources/shortcodes.txt | 3 +++ scripts/codegen.sh | 2 +- scripts/emoji_codegen.py | 2 +- src/emoji/EmojiModel.cpp | 4 ++-- src/emoji/Provider.cpp | 6 +++--- 6 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 resources/extra_emoji.txt diff --git a/resources/extra_emoji.txt b/resources/extra_emoji.txt new file mode 100644 index 00000000..ecb6ab04 --- /dev/null +++ b/resources/extra_emoji.txt @@ -0,0 +1,27 @@ +# group: Symbols +1F1E6 ; fully-qualified # 🇦 E6.0 regional indicator a +1F1E7 ; fully-qualified # 🇧 E6.0 regional indicator b +1F1E8 ; fully-qualified # 🇨 E6.0 regional indicator c +1F1E9 ; fully-qualified # 🇩 E6.0 regional indicator d +1F1EA ; fully-qualified # 🇪 E6.0 regional indicator e +1F1EB ; fully-qualified # 🇫 E6.0 regional indicator f +1F1EC ; fully-qualified # 🇬 E6.0 regional indicator g +1F1ED ; fully-qualified # 🇭 E6.0 regional indicator h +1F1EE ; fully-qualified # 🇮 E6.0 regional indicator i +1F1EF ; fully-qualified # 🇯 E6.0 regional indicator j +1F1F0 ; fully-qualified # 🇰 E6.0 regional indicator k +1F1F1 ; fully-qualified # 🇱 E6.0 regional indicator l +1F1F2 ; fully-qualified # 🇲 E6.0 regional indicator m +1F1F3 ; fully-qualified # 🇳 E6.0 regional indicator n +1F1F4 ; fully-qualified # 🇴 E6.0 regional indicator o +1F1F5 ; fully-qualified # 🇵 E6.0 regional indicator p +1F1F6 ; fully-qualified # 🇶 E6.0 regional indicator q +1F1F7 ; fully-qualified # 🇷 E6.0 regional indicator r +1F1F8 ; fully-qualified # 🇸 E6.0 regional indicator s +1F1F9 ; fully-qualified # 🇹 E6.0 regional indicator t +1F1FA ; fully-qualified # 🇺 E6.0 regional indicator u +1F1FB ; fully-qualified # 🇻 E6.0 regional indicator v +1F1FC ; fully-qualified # 🇼 E6.0 regional indicator w +1F1FD ; fully-qualified # 🇽 E6.0 regional indicator x +1F1FE ; fully-qualified # 🇾 E6.0 regional indicator y +1F1FF ; fully-qualified # 🇿 E6.0 regional indicator z diff --git a/resources/shortcodes.txt b/resources/shortcodes.txt index 2aa79ae3..62d5d44e 100644 --- a/resources/shortcodes.txt +++ b/resources/shortcodes.txt @@ -4,3 +4,6 @@ downcast face with sweat:sweat grinning face with sweat:sweat_smile grinning face with smiling eyes:smile rolling on the floor laughing:rofl +face savoring food:yum +smiling face with halo:innocent +smiling face with open hands:hugging_face diff --git a/scripts/codegen.sh b/scripts/codegen.sh index 77fa3ab1..24fbc6be 100644 --- a/scripts/codegen.sh +++ b/scripts/codegen.sh @@ -2,6 +2,6 @@ ROOT=$(realpath "$PWD/$(dirname "$0")/..") cd $ROOT cat resources/provider-header.txt > src/emoji/Provider.cpp - +# cat resources/extra_emoji.txt resources/emoji-test.txt > resources/complete-emoji.txt scripts/emoji_codegen.py resources/emoji-test.txt resources/shortcodes.txt >> src/emoji/Provider.cpp cd - > /dev/null diff --git a/scripts/emoji_codegen.py b/scripts/emoji_codegen.py index 9dae1544..05b1d764 100755 --- a/scripts/emoji_codegen.py +++ b/scripts/emoji_codegen.py @@ -78,7 +78,7 @@ if __name__ == '__main__': continue - char, name = re.match(r'^(\S+) E\d+\.\d+ (.*)$', charAndName).groups() + char, name = re.match(r'^(\S+) E\d+\.\d+ (.*)$', charAndName.strip()).groups() shortname = name #TODO: Handle skintone modifiers in a sane way diff --git a/src/emoji/EmojiModel.cpp b/src/emoji/EmojiModel.cpp index 3cb13ff4..45b3b432 100644 --- a/src/emoji/EmojiModel.cpp +++ b/src/emoji/EmojiModel.cpp @@ -59,10 +59,10 @@ EmojiModel::data(const QModelIndex &index, int role) const return Provider::emoji[index.row()].unicode; case Qt::ToolTipRole: - case CompletionModel::SearchRole: + case CompletionModel::SearchRole2: case static_cast(EmojiModel::Roles::UnicodeName): return Provider::emoji[index.row()].unicodeName; - case CompletionModel::SearchRole2: + case CompletionModel::SearchRole: case static_cast(EmojiModel::Roles::ShortName): return Provider::emoji[index.row()].shortName; case static_cast(EmojiModel::Roles::Category): diff --git a/src/emoji/Provider.cpp b/src/emoji/Provider.cpp index ab0b1016..9df0f4a5 100644 --- a/src/emoji/Provider.cpp +++ b/src/emoji/Provider.cpp @@ -62,7 +62,7 @@ const QVector emoji::Provider::emoji = { QStringLiteral(u"smiling face with smiling eyes"), emoji::Emoji::Category::People}, Emoji{QStringLiteral(u"\U0001F607"), - QStringLiteral(u"smiling_face_with_halo"), + QStringLiteral(u"innocent"), QStringLiteral(u"smiling face with halo"), emoji::Emoji::Category::People}, Emoji{QStringLiteral(u"\U0001F970"), @@ -102,7 +102,7 @@ const QVector emoji::Provider::emoji = { QStringLiteral(u"smiling face with tear"), emoji::Emoji::Category::People}, Emoji{QStringLiteral(u"\U0001F60B"), - QStringLiteral(u"face_savoring_food"), + QStringLiteral(u"yum"), QStringLiteral(u"face savoring food"), emoji::Emoji::Category::People}, Emoji{QStringLiteral(u"\U0001F61B"), @@ -126,7 +126,7 @@ const QVector emoji::Provider::emoji = { QStringLiteral(u"money-mouth face"), emoji::Emoji::Category::People}, Emoji{QStringLiteral(u"\U0001F917"), - QStringLiteral(u"smiling_face_with_open_hands"), + QStringLiteral(u"hugging_face"), QStringLiteral(u"smiling face with open hands"), emoji::Emoji::Category::People}, Emoji{QStringLiteral(u"\U0001F92D"),