Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
535ad22b
Verified
Commit
535ad22b
authored
2 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Fixup some small emoji things
parent
d4b7712a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
resources/shortcodes.txt
+2
-0
2 additions, 0 deletions
resources/shortcodes.txt
scripts/emoji_codegen.py
+22
-24
22 additions, 24 deletions
scripts/emoji_codegen.py
src/emoji/EmojiModel.cpp
+2
-0
2 additions, 0 deletions
src/emoji/EmojiModel.cpp
src/emoji/Provider.cpp
+2
-2
2 additions, 2 deletions
src/emoji/Provider.cpp
with
28 additions
and
26 deletions
resources/shortcodes.txt
+
2
−
0
View file @
535ad22b
...
...
@@ -53,3 +53,5 @@
0038 FE0F 20E3:eight
0039 FE0F 20E3:nine
1F51F:ten
1F4A5:boom
1F389:tada
This diff is collapsed.
Click to expand it.
scripts/emoji_codegen.py
+
22
−
24
View file @
535ad22b
...
...
@@ -76,63 +76,61 @@ if __name__ == '__main__':
# skip unqualified versions of same unicode
if
qualification
!=
'
fully-qualified
'
:
continue
char
,
name
=
re
.
match
(
r
'
^(\S+) E\d+\.\d+ (.*)$
'
,
charAndName
).
groups
()
shortname
=
name
# until skin tone is handled, keep them around
# discard skin tone variants for sanity
# __contains__ is so stupid i hate prototype languages
# if name.__contains__("skin tone") and qualification != 'component':
## discard skin tone variants for sanity
# if "skin tone" in name and qualification != 'component':
# continue
# if qualification == 'component' and not
name.__contains__(
"skin tone"
):
# if qualification == 'component' and not "skin tone"
in name:
# continue
#TODO: Handle skintone modifiers in a sane way
basicallyTheSame
=
False
if
code
in
shortcodeDict
:
if
code
in
shortcodeDict
:
shortname
=
shortcodeDict
[
code
]
else
:
shortname
=
shortname
.
lower
()
if
shortname
.
endswith
(
'
(blood type)
'
):
if
shortname
.
endswith
(
'
(blood type)
'
):
shortname
=
shortname
[:
-
13
]
if
shortname
.
endswith
(
'
: red hair
'
):
if
shortname
.
endswith
(
'
: red hair
'
):
shortname
=
"
red_haired_
"
+
shortname
[:
-
10
]
if
shortname
.
endswith
(
'
: curly hair
'
):
if
shortname
.
endswith
(
'
: curly hair
'
):
shortname
=
"
curly_haired_
"
+
shortname
[:
-
12
]
if
shortname
.
endswith
(
'
: white hair
'
):
if
shortname
.
endswith
(
'
: white hair
'
):
shortname
=
"
white_haried_
"
+
shortname
[:
-
12
]
if
shortname
.
endswith
(
'
: bald
'
):
if
shortname
.
endswith
(
'
: bald
'
):
shortname
=
"
bald_
"
+
shortname
[:
-
6
]
if
shortname
.
endswith
(
'
: beard
'
):
if
shortname
.
endswith
(
'
: beard
'
):
shortname
=
"
bearded_
"
+
shortname
[:
-
7
]
if
shortname
.
endswith
(
'
face
'
):
if
shortname
.
endswith
(
'
face
'
):
shortname
=
shortname
[:
-
5
]
if
shortname
.
endswith
(
'
button
'
):
shortname
=
shortname
[:
-
7
]
if
shortname
.
endswith
(
'
banknote
'
):
if
shortname
.
endswith
(
'
button
'
):
shortname
=
shortname
[:
-
7
]
if
shortname
.
endswith
(
'
banknote
'
):
shortname
=
shortname
[:
-
9
]
# FIXME: Is there a better way to do this?
matchobj
=
re
.
match
(
r
'
^flag: (.*)$
'
,
shortname
)
if
shortname
.
startswith
(
"
flag:
"
):
matchobj
=
re
.
match
(
r
'
^flag: (.*)$
'
,
shortname
)
if
shortname
.
startswith
(
"
flag:
"
):
country
=
shortname
[
5
:]
shortname
=
country
+
"
flag
"
shortname
=
shortname
.
replace
(
"
u.s.
"
,
"
us
"
)
shortname
=
shortname
.
replace
(
"
&
"
,
"
and
"
)
if
shortname
==
name
.
lower
():
if
shortname
==
name
.
lower
():
basicallyTheSame
=
True
shortname
=
shortname
.
replace
(
"
-
"
,
"
_
"
)
shortname
=
re
.
sub
(
r
'
\W
'
,
'
_
'
,
shortname
)
shortname
,
=
re
.
match
(
r
'
^_*(.+)_*$
'
,
shortname
).
groups
()
shortname
=
re
.
sub
(
r
'
_{2,}
'
,
'
_
'
,
shortname
)
shortname
=
re
.
sub
(
r
'
_{2,}
'
,
'
_
'
,
shortname
)
shortname
=
unidecode
(
shortname
)
# if basicallyTheSame:
# shortname = ""
categories
[
current_category
].
append
(
Emoji
(
code
,
shortname
,
name
))
# Use xclip to pipe the output to clipboard.
# e.g ./codegen.py emoji.json | xclip -sel clip
# alternatively - delete the var from src/emoji/Provider.cpp, and do ./codegen.
py
emojis shortcodes >> src/emoji/Provider.cpp
# e.g ./
emoji_
codegen.py emoji.json | xclip -sel clip
# alternatively - delete the var from src/emoji/Provider.cpp, and do ./codegen.
sh
emojis shortcodes >>
../
src/emoji/Provider.cpp
generate_qml_list
(
people
=
people
,
nature
=
nature
,
food
=
food
,
activity
=
activity
,
travel
=
travel
,
objects
=
objects
,
symbols
=
symbols
,
flags
=
flags
)
This diff is collapsed.
Click to expand it.
src/emoji/EmojiModel.cpp
+
2
−
0
View file @
535ad22b
...
...
@@ -59,6 +59,8 @@ EmojiModel::data(const QModelIndex &index, int role) const
return
Provider
::
emoji
[
index
.
row
()].
unicode
;
case
Qt
::
ToolTipRole
:
return
Provider
::
emoji
[
index
.
row
()].
shortName
+
", "
+
Provider
::
emoji
[
index
.
row
()].
unicodeName
;
case
CompletionModel
::
SearchRole2
:
case
static_cast
<
int
>
(
EmojiModel
::
Roles
::
UnicodeName
):
return
Provider
::
emoji
[
index
.
row
()].
unicodeName
;
...
...
This diff is collapsed.
Click to expand it.
src/emoji/Provider.cpp
+
2
−
2
View file @
535ad22b
...
...
@@ -614,7 +614,7 @@ const QVector<Emoji> emoji::Provider::emoji = {
QStringLiteral(u"anger symbol"),
emoji::Emoji::Category::People},
Emoji{QStringLiteral(u"\U0001F4A5"),
QStringLiteral(u"
collision
"),
QStringLiteral(u"
boom
"),
QStringLiteral(u"collision"),
emoji::Emoji::Category::People},
Emoji{QStringLiteral(u"\U0001F4AB"),
...
...
@@ -10560,7 +10560,7 @@ const QVector<Emoji> emoji::Provider::emoji = {
QStringLiteral(u"balloon"),
emoji::Emoji::Category::Activity},
Emoji{QStringLiteral(u"\U0001F389"),
QStringLiteral(u"
party_popper
"),
QStringLiteral(u"
tada
"),
QStringLiteral(u"party popper"),
emoji::Emoji::Category::Activity},
Emoji{QStringLiteral(u"\U0001F38A"),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment