Handle resources with dots in the qrc file name

We were removing the .qrc suffix of resources in a way that assumed the
filenames would not have any dots in them, but this is not always the
case, and we would end up resolving an empty resource name for file
names such as .rcc-bar.qrc (e.g. as produced by the qmlcache system).

We now remove the .qrc extension explicitly.

Change-Id: I50e1d88ac71ca1335bb05f3dbbb2d9bb441a8d64
Fixes: QTBUG-81255
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-01-14 16:52:54 +01:00
parent a4fb128b73
commit 457ab46936

View File

@ -30,7 +30,7 @@ qtFlattenResources()
"{" \
for (resource, RESOURCES) {
resource_name = $$section($$list($$basename(resource)), ., 0, 0)
resource_name = $$replace($$list($$basename(resource)),\.qrc$, )
resource_name = $$replace(resource_name, [^a-zA-Z0-9_], _)
RESOURCE_INIT_CONT += " Q_INIT_RESOURCE($$resource_name);"
}