Skip to content
Snippets Groups Projects
Commit 1a61af02 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

resources: remove unused images and icons

gen-resources.py should be used to generate resources.qrc and
JamiResources.qml. Steps to add an image resource:
- add the resource file to the appropriate path under resources/
- run gen-resources.py
- use the newly available resource

Note: only icons and images will be represented by Qml properties.

The resource file generation may be made to run during CMake
configuration in a subsequent commit.

Some unused components were also removed during the refactor.

Gitlab: #477
Change-Id: I8e7f13d465031666be2bbadd5f29f9afc94d210d
parent 6e4fadcf
No related branches found
Tags beta/202402071743
No related merge requests found
Showing
with 39 additions and 22 deletions
......@@ -94,7 +94,6 @@ set(COMMON_HEADERS
${SRC_DIR}/qrimageprovider.h
${SRC_DIR}/messagesadapter.h
${SRC_DIR}/accountadapter.h
${SRC_DIR}/tintedbuttonimageprovider.h
${SRC_DIR}/calladapter.h
${SRC_DIR}/conversationsadapter.h
${SRC_DIR}/distantrenderer.h
......@@ -436,14 +435,14 @@ else()
target_compile_definitions(jami-qt PRIVATE JAMI_INSTALL_PREFIX="${JAMI_DATA_PREFIX}")
# logos
install(FILES images/jami.svg
install(FILES resources/images/jami.svg
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps)
install(FILES images/jami-48px.png
install(FILES resources/images/jami-48px.png
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps
RENAME jami.png)
install(FILES images/jami-32px.xpm
install(FILES resources/images/jami-32px.xpm
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps
RENAME jami.xpm)
......
......@@ -12,7 +12,7 @@ else()
"${DRING_PATH}/contrib/build/openssl/libcrypto-1_1-x64.dll"
"${DRING_PATH}/contrib/build/openssl/libssl-1_1-x64.dll"
"${PROJECT_ROOT_DIR}/qt.conf"
"${PROJECT_ROOT_DIR}/images/jami.ico"
"${PROJECT_ROOT_DIR}/resources/images/jami.ico"
"${PROJECT_ROOT_DIR}/License.rtf"
DESTINATION ${COPY_TO_PATH})
endif()
\ No newline at end of file
endif()
import os
import sys
import re
resdir = 'resources'
qmlfile = os.path.join('src', 'constant', 'JamiResources.qml')
sep = '_'
# replace characters that aren't valid within QML property names
formatProp = lambda str: (
"".join([{".": sep, "-": sep, " ": sep}
.get(c, c) for c in str]
).lower())
with open('resources.qrc', 'w') as qrc, open(qmlfile, 'w') as qml:
qrc.write('<RCC>\n')
qml.write('pragma Singleton\nimport QtQuick 2.14\nQtObject {\n')
for root, _, files in os.walk(resdir):
if len(files):
prefix = root.rsplit(os.sep, 1)[-1]
qrc.write('\t<qresource prefix="/%s">\n' % prefix)
for filename in files:
# use posix separators in the resource path
filepath = os.path.join(root, filename).replace(os.sep, '/')
qrc.write('\t\t<file alias="%s">%s</file>\n'
% (filename, filepath))
# only record images/icons as properties
if (re.match("icons|images", prefix)):
qml.write(' readonly property string %s: "qrc:/%s"\n'
% (formatProp(filename), filepath.split('/', 1)[1]))
qrc.write('\t</qresource>\n')
qml.write('}')
qrc.write('</RCC>')
\ No newline at end of file
IDI_ICON1 ICON DISCARDABLE "images/jami.ico"
IDI_ICON1 ICON DISCARDABLE "resources/images/jami.ico"
images/ajax-loader.gif

673 B

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white" width="24px" height="24px"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Garbage</title>
<g id="Icones_Outline" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Garbage" fill="#000000" fill-rule="nonzero" stroke="#000000" stroke-width="0.75">
<g id="noun_Garbage_2034095" transform="translate(2.000000, 2.000000)">
<path d="M18.5416667,2.66666667 L12.4791667,2.66666667 L12.4791667,2.1875 C12.4791667,1.04166667 11.5416667,0.104166667 10.3958333,0.104166667 L8.77083333,0.104166667 C7.625,0.104166667 6.6875,1.04166667 6.6875,2.1875 L6.6875,2.66666667 L0.625,2.66666667 C0.333333333,2.66666667 0.0833333333,2.91666667 0.0833333333,3.20833333 C0.0833333333,3.5 0.333333333,3.75 0.625,3.75 L2.14583333,3.75 L2.85416667,17.7291667 C2.91666667,18.9375 3.91666667,19.8958333 5.14583333,19.8958333 L14.0625,19.8958333 C15.2708333,19.8958333 16.2916667,18.9375 16.3541667,17.7291667 L17.0208333,3.75 L18.5416667,3.75 C18.8333333,3.75 19.0833333,3.5 19.0833333,3.20833333 C19.0833333,2.91666667 18.8333333,2.66666667 18.5416667,2.66666667 Z M7.77083333,2.1875 C7.77083333,1.64583333 8.20833333,1.1875 8.77083333,1.1875 L10.3958333,1.1875 C10.9375,1.1875 11.3958333,1.625 11.3958333,2.1875 L11.3958333,2.66666667 L7.77083333,2.66666667 L7.77083333,2.1875 Z M15.2291667,17.6666667 C15.1875,18.3125 14.6666667,18.7916667 14.0416667,18.7916667 L5.125,18.7916667 C4.47916667,18.7916667 3.95833333,18.2916667 3.9375,17.6666667 L3.22916667,3.75 L15.9166667,3.75 L15.2291667,17.6666667 Z" id="Shape"></path>
</g>
</g>
</g>
</svg>
\ No newline at end of file
images/icons/ic_add_black_18dp_2x.png

237 B

images/icons/ic_arrow_drop_down_black_18dp_2x.png

205 B

images/icons/ic_arrow_drop_down_black_9dp_2x.png

193 B

images/icons/ic_arrow_drop_up_black_18dp_2x.png

198 B

images/icons/ic_arrow_drop_up_black_9dp_2x.png

186 B

images/icons/ic_arrow_forward_white_48dp_2x.png

235 B

images/icons/ic_arrow_tab_next_black_9dp_2x.png

209 B

images/icons/ic_arrow_tab_previous_black_9dp_2x.png

202 B

images/icons/ic_chat_black_24dp_2x.png

193 B

images/icons/ic_chat_white_24dp.png

205 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment