Skip to content

Commit

Permalink
feat: Add many missing emojis from the smiley packs.
Browse files Browse the repository at this point in the history
These could never be reached and thus were never rendered, because they
weren't configured.
  • Loading branch information
iphydf committed Dec 18, 2024
1 parent abca9fc commit 2897ee5
Show file tree
Hide file tree
Showing 16 changed files with 6,054 additions and 2,787 deletions.
2 changes: 1 addition & 1 deletion .ci-scripts/build-qtox-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if [ "$MINIMAL" -eq 1 ]; then
-DSTRICT_OPTIONS=ON \
-DUBSAN=ON \
-GNinja \
-DSMILEYS=DISABLED \
-DSMILEYS=OFF \
-DUPDATE_CHECK=OFF \
-DSPELL_CHECK=OFF \
"${CMAKE_ARGS[@]}"
Expand Down
2 changes: 2 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ exclude:
restylers:
- astyle:
enabled: false
- pyment:
enabled: false
- "*"
19 changes: 13 additions & 6 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("//third_party/python:build_defs.bzl", "mypy_test")
load("//third_party/qt:build_defs.bzl", "qt_binary", "qt_lconvert", "qt_rcc")
load("//tools/project:build_defs.bzl", "project")

project(license = "gpl3-https")

mypy_test(
name = "mypy_test",
srcs = glob(
["**/*.py"],
exclude = ["flatpak/update_flathub_descriptor_dependencies.py"],
),
)

qt_lconvert(
name = "qtox_qms",
srcs = glob(["translations/*.ts"]),
Expand All @@ -27,15 +36,13 @@ qt_rcc(

qt_rcc(
name = "res",
srcs = [
"res.qrc",
"smileys/emojione.qrc",
"smileys/smileys.qrc",
],
srcs = ["res.qrc"] + glob(["smileys/*/emoticons.qrc"]),
data = glob([
"img/**/*",
"res/**/*",
"smileys/*/*",
"smileys/*/*.png",
"smileys/*/*.svg",
"smileys/*/*.xml",
"themes/**/*",
]),
tags = ["qt"],
Expand Down
38 changes: 25 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ cmake_policy(VERSION 3.16)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

option(SMILEYS "Enable smileys support (will greatly increase the binary size)"
ON)
option(PLATFORM_EXTENSIONS
"Enable platform specific extensions, requires extra dependencies" ON)
option(UPDATE_CHECK "Enable automatic update check" ON)
Expand Down Expand Up @@ -150,9 +152,9 @@ if(USE_CCACHE)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
message(STATUS "using ccache")
message(STATUS "Using ccache")
else()
message(STATUS "ccache not found")
message(STATUS "Not using ccache (not found)")
endif()
else()
message(
Expand Down Expand Up @@ -194,17 +196,27 @@ qt6_wrap_ui(

set(${PROJECT_NAME}_RESOURCES res.qrc)

if(NOT SMILEYS)
set(SMILEYS "")
endif()

set(SMILEY_RESOURCES "")
if(NOT "${SMILEYS}" STREQUAL "DISABLED")
set(SMILEY_RESOURCES smileys/emojione.qrc)

if(NOT "${SMILEYS}" STREQUAL "MIN")
set(SMILEY_RESOURCES ${SMILEY_RESOURCES} smileys/smileys.qrc)
if(SMILEYS)
if(NOT SMILEY_PACKS)
file(
GLOB SMILEY_QRCS
RELATIVE ${CMAKE_SOURCE_DIR}
smileys/*/emoticons.qrc)
# smileys/$PACK/emoticons.qrc -> $PACK
set(SMILEY_PACKS "")
foreach(SMILEY_PACK ${SMILEY_QRCS})
get_filename_component(SMILEY_PACK ${SMILEY_PACK} DIRECTORY)
get_filename_component(SMILEY_PACK ${SMILEY_PACK} NAME)
list(APPEND SMILEY_PACKS ${SMILEY_PACK})
endforeach()
endif()
message(STATUS "Using smiley packs ${SMILEY_PACKS}")

set(SMILEY_RESOURCES "")
foreach(SMILEY_PACK ${SMILEY_PACKS})
set(SMILEY_RESOURCES ${SMILEY_RESOURCES}
smileys/${SMILEY_PACK}/emoticons.qrc)
endforeach()
endif()

set(${PROJECT_NAME}_SOURCES
Expand Down Expand Up @@ -594,7 +606,7 @@ endif()

if(${UPDATE_CHECK})
add_definitions(-DUPDATE_CHECK_ENABLED=1)
message(STATUS "using update check")
message(STATUS "Using update check")
else()
message(STATUS "NOT using update check")
endif()
Expand Down
14 changes: 4 additions & 10 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,20 +423,14 @@ See [`windows/cross-compile`](windows/cross-compile).
## Compile-time switches

They are passed as an argument to `cmake` command. E.g. with a switch `SWITCH`
that has value `YES` it would be passed to `cmake` in a following manner:
that has value `ON` it would be passed to `cmake` in a following manner:

```bash
cmake -DSWITCH=yes
cmake -DSWITCH=ON
```

Switches:

- `SMILEYS`, values:
- if not defined or an unsupported value is passed, all emoticon packs are
included
- `DISABLED` – don't include any emoticon packs, custom ones are still loaded
- `MIN` – minimal support for emoticons, only a single emoticon pack is
included
Look at the beginning of `CMakeLists.txt` for a list of options. Options that
are `ON` by default can be turned off by passing `-DSWITCH=OFF`.

[AppArmor]: /security/apparmor/README.md
[Atk]: https://wiki.gnome.org/Accessibility
Expand Down
2 changes: 1 addition & 1 deletion cmake/Testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ auto_test(persistence paths "" "")
auto_test(persistence dbschema "" "dbutility_library")
auto_test(persistence/dbupgrade dbTo11 "" "dbutility_library")
auto_test(persistence offlinemsgengine "" "")
if(NOT "${SMILEYS}" STREQUAL "DISABLED")
if("EmojiOne" IN_LIST SMILEY_PACKS)
auto_test(persistence smileypack "${SMILEY_RESOURCES}" "") # needs emojione
endif()
auto_test(model friendlistmanager "" "")
Expand Down
19 changes: 19 additions & 0 deletions smileys/Classic/emoticons.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<RCC>
<qresource prefix="/smileys/Classic">
<file>angry.png</file>
<file>cool.png</file>
<file>crying.png</file>
<file>emoticons.xml</file>
<file>happy.png</file>
<file>laugh_closed_eyes.png</file>
<file>laugh.png</file>
<file>plain.png</file>
<file>sad.png</file>
<file>scared.png</file>
<file>smile.png</file>
<file>stunned.png</file>
<file>tongue.png</file>
<file>uncertain.png</file>
<file>wink.png</file>
</qresource>
</RCC>
28 changes: 14 additions & 14 deletions smileys/Classic/emoticons.xml
Original file line number Diff line number Diff line change
@@ -1,81 +1,81 @@
<?xml version='1.0'?>
<messaging-emoticon-map>
<messaging-emoticon-map xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../messaging-emoticon-map.xsd">
<emoticon file="happy.png">
<string>:)</string>
<string>:-)</string>
<string>😊</string>
</emoticon>

<emoticon file="cool.png">
<string>8-)</string>
<string>8)</string>
<string>😎</string>
</emoticon>

<emoticon file="stunned.png">
<string>:O</string>
<string>:-O</string>
<string>😲</string>
</emoticon>

<emoticon file="tongue.png">
<string>:p</string>
<string>:P</string>
<string>😋</string>
</emoticon>

<emoticon file="uncertain.png">
<string>:/</string>
<string>:-/</string>
<string>😕</string>
</emoticon>

<emoticon file="wink.png">
<string>;)</string>
<string>;-)</string>
<string>😉</string>
</emoticon>

<emoticon file="sad.png">
<string>:(</string>
<string>:-(</string>
<string>😖</string>
</emoticon>

<emoticon file="crying.png">
<string>;(</string>
<string>;-(</string>
<string>😢</string>
</emoticon>

<emoticon file="smile.png">
<string>:D</string>
<string>:-D</string>
<string>😃</string>
</emoticon>

<emoticon file="plain.png">
<string>:|</string>
<string>:-|</string>
<string>😐</string>
</emoticon>

<emoticon file="laugh.png">
<string>;D</string>
<string>;-D</string>
<string>😄</string>
</emoticon>

<emoticon file="angry.png">
<string>:@</string>
<string>😠</string>
</emoticon>

<emoticon file="scared.png">
<string>D:</string>
<string>😨</string>
</emoticon>

<emoticon file="laugh_closed_eyes">
<string>xD</string>
<string>XD</string>
Expand Down
Loading

0 comments on commit 2897ee5

Please sign in to comment.