summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc/rcc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rcc: don't track source file locationSamuli Piippo11 days1-1/+1
| | | | | | | | | | | | Generate source code without information about original location of the source file. Useful for reproducible builds. Task-number: QTBUG-105926 Task-number: QTBUG-105913 Change-Id: Ia4ca8d1b22751d0bf110082872b6b4228d01ff9a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Ari Parkkila <ari.parkkila@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Add support for using an inline namespaces for -qtnamespaceFriedemann Kleint2024-04-031-1/+3
| | | | | | | | | | | | | | | Inline namespaces serve the purpose for which the original -qtnamespace option was added and allow for macro simplification (no need for any using directives). This makes it possible to use namespaced builds of Qt also for Qt for Python and similar use cases which have issues with the additional namespace. [ChangeLog][QtCore] It is now possible to use an inline namespace for -qtnamespace (option -qtinlinenamespace). Task-number: PYSIDE-2590 Change-Id: Ia0cecf041321933a2e02d1fd8ae0e9cda699cd1e Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Port to QDirListingAhmad Samir2024-03-031-6/+6
| | | | | | | | | | | Use QDirListing in the Bootstrap build instead of QDirIterator. Drive-by changes: - more const variables - use emplace_back() instead of append() where appropriate Change-Id: Ie1f0d03856e557c4bfabfff38a87edc7da86d091 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rcc: Suppress MSVC warning C4711 in generated codehjk2024-02-191-0/+4
| | | | | | | | | | | | | The informational message Warning C471 1function 'int __cdecl qInitResources_qrc(void)' selected for automatic inline expansion is triggered by /W4. Fixes: QTBUG-122176 Change-Id: Ifbd2e969b1bb7d25e1b83a4c5d8b305e7b6883a2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* rcc: Fix bad data signature recognitionhjk2023-06-091-3/+7
| | | | | | | | Done-by: Mathias Hasselmann Fixes: QTBUG-73834 Change-Id: I99c480a2ef50ed110e0d98a9dd56661ea851397a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* RCCFileInfo: refactorAhmad Samir2023-01-071-47/+50
| | | | | | | | | | | | | | | - Initialize members in-class, and in ctor init-list as needed. This simplifies the constructor and is generally safer as one can't forget to initialize a member, especially built-in types - Add copy control members, this is actually a move only class because of the QMultiHash<QString, RCCFileInfo*> member and the destructor calling qDeleteAll - Minor, save a couple of bytes by reordering the members so that they are in 8 byte chunks as much as possible, sizeof(*this) is now 104, was 120 Change-Id: Idcf7c5a99fdf02854e09e3c1cade6c8d238ed492 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* RCCFileInfo: get lastModified file time in UTC directlyAhmad Samir2023-01-051-1/+1
| | | | | | | | | These are time stamps, and they use toMsecsSinceEpoch(), no point getting the time in Local time zone then converting it. Change-Id: I2db2db5f9ebc062e65514a592fa7fa00cf1d179d Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* RCCFileInfo: use QString prepend optimizationAhmad Samir2022-12-191-1/+2
| | | | | | | | | | Instead of using QStringBuilder (which always allocates a new QString to hold the result of the concatenation), reuse the existing QString, and use prepend which will typically have allocated extra space, reducing the chances it will reallocate. Change-Id: Ic4ef775246db58e56152a6ede1a75f7621950dd9 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* CMake: Allow contents of resources to be replaced by empty filesUlf Hermann2022-12-171-10/+35
| | | | | | | | | | | | | | | This makes it possible to process QML files using qmlcachegen, and retain the file nodes in the resource file system, but remove their actual content from the binary. To do so, you need to mark your files with the QT_DISCARD_FILE_CONTENTS source file property. Fixes: QTBUG-87676 Fixes: QTBUG-103481 Fixes: QTBUG-102024 Fixes: QTBUG-102785 Change-Id: I93d5a2bfca1739ff1e0f74c8082eb8aa451b9815 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-1/+1
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* rcc: Drop extra QString()Mate Barany2022-09-281-1/+1
| | | | | | | | | Addressing a comment from the review of QTBUG-98434. Drop the exta QString() call, it is unnecessary. Task-number: QTBUG-103100 Change-Id: I5a13deb5d3c52166919302bc4bb45bd0b6b5c770 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* RCC: fix zlib compression when --no-zstd was specifiedThiago Macieira2022-08-311-10/+2
| | | | | | | | | | | | | Since we had code to default to zstd as the default algorithm instead of "Best", we ended up not compressing anything. [ChangeLog][rcc] Fixed a bug that caused rcc not to compress files with any compression algorithm if the --no-zstd option was present. Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-106012 Change-Id: Ic6547f8247454b47baa8fffd170fddae429f82d2 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* rcc: Suppress clang's -Wexit-time-destructorshjk2022-07-071-1/+11
| | | | | | | | | | | | | | It's an opt-in warning that some people like to use. It was introduced to clang 3.0.0 in 2011 by https://github.com/llvm/llvm-project/commit/98766db7858379f61d24d5d93b1b7be39fda0913 However, the feature is intentionally used here and the generated code is legit. Make both sides happy. Change-Id: I79335cd3a6a6cc128fa65f77d201a12f67424260 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Tools: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-031-27/+28
| | | | | | | | | As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I6d4712a71b5ebf3f379f1f98ea476557bce963ef Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Tools: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-05-021-8/+8
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: Ib9e01ede4e0d7869fc95414d36f37df4a30b16b4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add the "Territory" enumerated type for QLocaleJiDe Zhang2021-04-151-16/+16
| | | | | | | | | | | | | | | | | | | The use of "Country" is misleading as some entries in the enumeration are not countries (eg, HongKong), for all that most are. The Unicode Consortium's Common Locale Data Repository (CLDR, from which QLocale's data is taken) calls these territories, so introduce territory-based names and prepare to deprecate the country-based ones in due course. [ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for its Country enumeration, and associated territory-based names to match its country-named methods, to better match the usage in relevant standards. The country-based names shall in due course be deprecated in favor of the territory-based names. Fixes: QTBUG-91686 Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rcc: Remove support for Python2Friedemann Kleint2020-12-071-32/+13
| | | | | | | Qt for Python only supports Python3. Change-Id: I7b13b1f9482579b1e1128d15ee5734d063a7c4b8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic/rcc: Use QT_VERSION_MAJOR for major versionFriedemann Kleint2020-12-071-1/+3
| | | | | | | | Amends 539a16a69fa1ef302cf4eb97ff5a7f8afb606d15. Task-number: QTBUG-89124 Change-Id: I68c9ab2179d464d83c3fd9eefc5609b7a5a58e27 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix uic/rcc generating outdated export for Qt for PythonFriedemann Kleint2020-12-041-1/+1
| | | | | | | | | | Bump version to 6. Fixes: QTBUG-89124 Change-Id: Ifcf60552b5b6efb86f79da34da9c34b8efae9fa4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit fc9cda5f08ac848e88f63dd4a07c08b2fbc6bf17) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rcc: Make output deterministic for directoriesKai Koehne2020-09-191-16/+21
| | | | | | | | | QDirIterator is documented to be non-deterministic. Fixes: QTBUG-86675 Pick-to: 5.15 Change-Id: I4161871a409bbaf85347ee6a60ef1189f56a1b22 Reviewed-by: hjk <hjk@qt.io>
* Another round of 0->nullptr cleanupAllan Sandfeld Jensen2020-07-311-7/+7
| | | | | Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Get rid of QRegExp usage in rccLars Knoll2020-03-251-2/+11
| | | | | | | | As a drive-by, enable testing of rcc in the cmake build. Change-Id: I4150ff3ffe7404bab0cbc72f80b23b47a60cf33d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* rcc: Teach rcc the --no-zstd optionAlexandru Croitor2020-03-121-7/+14
| | | | | | | | | | | | It is needed when cross-building Qt using CMake, where the zstd feature might have different values between the host and target, in which case the build system tells rcc not to use zstd when the feature is disabled. Amends d20c9805763ab3dc504ebf2cefd33499d89ef22c Change-Id: I9dc55b59b1be5272b79aa5f1e2daf2b516a157d6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Cleanup code where we mixed QHash and QMultiHash iterator codeLars Knoll2020-02-031-12/+8
| | | | | Change-Id: Ib229cad13ca21d6288e009c6ee1c39fa974f80b8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use a QMultiHash explicitly if insertMulti() is being usedLars Knoll2019-12-121-3/+3
| | | | | | | | This is a step towards deprecating QHash::insertMulti() and clearly separating QHash and QMultiHash. Change-Id: Ic2c7665673ff00d4f2186e94850710b70330f8ba Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* rcc: Fix namespace handling for initializerSamuel Gaist2019-12-101-7/+13
| | | | | | | | | | | | | rcc currently always writes the namespace mangling macros in both the initializer constructor and destructor. This patch add the missing handling of the --namespace option for that part of the generated code. [ChangeLog][Tools][rcc] rcc now generates correct code when using the --namespace option. Change-Id: I7e5e608eb0ad267d11d601fc69c1a87d3f655a6e Fixes: QTBUG-80649 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-271-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/network/ssl/qsslsocket_openssl.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
| * RCC: Change the default compression to ZlibThiago Macieira2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Codebases using QResource::isCompressed() and assuming it is Zlib break if zstd is enabled. So change the default back to Zlib until Qt 6.0. [ChangeLog][Important Behavior Changes] RCC's default compression algorithm was changed back to Zlib, as it was in all previous releases until 5.13.0. The default will remain Zlib for all Qt 5.x releases but will change in Qt 6.0. To activate Zstd compression for your resources, either pass the --compress-algo=zstd option to the rcc tool or add the XML attribute compression-algorithm="zstd" to the <file> tags in the .qrc file. Task-number: QTBUG-76521 Change-Id: Ief874765cd7b43798de3fffd15a9f56fd9ad1ad4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | rcc: Avoid needless use of macrohjk2019-05-281-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strlen on literals gets typically optimized out nowadays. Adjust callee side to handle the off-by-one between sizeof(literal) and strlen(). Change-Id: I1551f69a160922681d66024701ba1bd8f6dc03bf Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | QRegExp include cleanupSamuel Gaist2019-04-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRegExp includes can be found in several files where there's not even a use of the class. This patch aims to avoid needless includes as well as follow the "include only what you use" moto. This patch removes a QRegExp include from the QStringList header which means that there is likely going to be code breaking since QStringList is used in many places and would get QRegExp in. [ChangeLog][Potentially Source-Incompatible Changes] qstringlist.h no longer includes qregexp.h. Change-Id: I32847532f16e419d4cb735ddc11a26551127e923 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | rcc: Avoid raw string literalshjk2019-03-201-23/+12
| | | | | | | | | | | | | | | | Subjective, but for me its easier to follow code flow if indentation is not interrupted. Change-Id: If811ba1b975189c94a671627be8eb3a1fd67aeb9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | rcc: Support Python as output formathjk2019-03-071-25/+176
|/ | | | | | | | | | | | Start with rcc -g python|python2 $name.qrc. [ChangeLog][rcc] Added support for Python as output format. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Fixes: PYSIDE-855 Change-Id: I97a642c3721d6d95b7cd0972d21abb0b2752fd4f Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix compilation with QT_NO_COMPRESSAlbert Astals Cid2018-12-211-1/+1
| | | | | Change-Id: Iabd57782458874abbc6b553b5e255a6b614de023 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rcc: Use SOURCE_DATE_EPOCH for mtimeBernhard M. Wiedemann2018-12-141-0/+3
| | | | | | | | | | | | | | Use the standard variable name in addition to the QT-specific one to make builds reproducible out-of-the-box. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. Task-number: QTBUG-62511 Change-Id: I401a2a9d258e751b83ae7b83f4100d9088b9ad71 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Resources: reject compressed content we can't decompressThiago Macieira2018-12-121-10/+68
| | | | | | | | | | | | | | | | | | | This solution is composed of two features: 1) C++ code generated by RCC uses two symbols exported from QtCore that are only present if the feature was compiled in. If the feature was not compiled in, this will cause a linker error either at build time or at load time (if they were functions, the error could be at runtime). 2) Binary files generated by RCC have a new header field containing flags. We're currently using two flags, one for Zlib and one for Zstandard. This means we now have binary RCC format version 3. Change-Id: I42a48bd64ccc41aebf84fffd156545fb6a4f72d9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* RCC: introduce compression algorithm "best"Thiago Macieira2018-12-111-0/+11
| | | | | | | | | | | | | | | | | | | This compression algorithm is permitted in the XML sources, which instructs RCC to apply the best compression algorithm it has available. If we have Zstandard available, that's its level 19 (levels 20 and up are experimental). If not, we apply zlib compression level 9. And apply this technique for the XDG MIME database that is built-in to QtCore. Payload size Compr. time Previously 313916 17.9ms Zlib -9 310899 53.6ms Zstd -14 253364 63.3ms (plus 4.0 ms on L1 heuristic check) Zstd -19 230647 642.5ms Change-Id: I343f2beed55440a7ac0bfffd1562de44dbaf09cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* RCC: Add support for Zstandard compressionThiago Macieira2018-12-111-2/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][RCC] RCC now supports compressing content using the Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses better for the same CPU time, so this algorithm is the default. To go back to the previous algorithm, pass command-line option --compress-algo=zlib. Compression levels range from 1 (fastest, least compression) to 19 (slowest, best compression). Level 0 tells the library to choose an implementation-defined default. \ The default compression level is "heuristic" (level -1): under this mode, RCC will attempt a very fast compression (level 1) and check if the file was sufficiently compressed. If it was, then RCC will compress again using an implementation-defined level. The following are the 4 biggest files we store as resources in qtbase: Orig Size Name 2197605 src/corelib/mimetypes/mime/packages/freedesktop.org.xml 2462423 tests/auto/corelib/tools/qchar/data/NormalizationTest.txt 6878748 tests/auto/other/qcomplextext/data/BidiCharacterTest.txt 7959972 tests/auto/other/qcomplextext/data/BidiTest.txt The current RCC (zlib, level -1 "default" and level 9), produces for those files: L(-1) Compr. L9 Compr. Decomp. Name Ratio CPU time Ratio CPU time CPU time BidiCharacterTest.txt 16.9:1 106.1ms 17.2:1 789.3ms 5.1ms BidiTest.txt 6.3:1 228.0ms 6.1:1 1646.3ms 10.9ms freedesktop.org.xml 7.0:1 17.5ms 7.1:1 53.6ms 2.6ms NormalizationTest.txt 5.8:1 41.2ms 5.9:1 256.4ms 3.4ms Zstandard produces the following for levels 1 ("check"), 14 ("store") and 19 ("best"): L1 Compr. L14 Compr. L19 Compr. Decomp Name Ratio time Ratio time Ratio CPU time time BidiCharacterTest.txt 15.8:1 8.0ms 26.1:1 168.9ms 49.2:1 2504.7ms 3.8ms BidiTest.txt 8.2:1 17.0ms 8.7:1 323.9ms 14.9:1 1700.9ms 12.1ms freedesktop.org.xml 6.7:1 4.0ms 8.7:1 63.3ms 9.5:1 642.5ms 1.7ms NormalizationTest.txt 5.7:1 5.0ms 7.5:1 54.0ms 8.4:1 447.3ms 3.0ms This shows use of zstd at the default RCC level settings always produce smaller outputs compared to the current zlib-based defaults, with roughly 50% CPU increase. It also produces better results at less CPU time than the best compression zlib has to offer. More importantly, the decompression time reduces in all cases (the numbers listed are for max compression, with slightly better results for the defaults). For the sake of comparison, the same files compressed with libxz at levels 3 and 6: Level 3 Level 6 Decompr. Name Ratio CPU Ratio CPU time BidiCharacterTest.txt 28.5:1 109.1ms 42.9:1 1390.5ms 16.7ms BidiTest.txt 10.7:1 281.0ms 18.4:1 2333.1ms 43.6ms freedesktop.org.xml 9.1:1 62.0ms 10.2:1 499.1ms 12.0ms NormalizationTest.txt 10.2:1 75.5ms 13.2:1 417.6ms 14.7ms LZMA at level 3 consumes roughly the same CPU time as Zstd at level 14 and produces incrementally smaller results, but the decompression time increases considerably. It's not a good trade-off for the Qt resource system. Change-Id: I343f2beed55440a7ac0bfffd1562d754bd71d964 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QResource: add support for resources compressed with ZstandardThiago Macieira2018-12-111-0/+1
| | | | | | | | | | | | | | | | | See next commit for details on why this is a good idea. [ChangeLog][Important Behavior Changes] The Qt resource system now supports compressing content using the Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses better for the same CPU time, so this algorithm is the default. QResource::isCompressed() returns true for either compression algorithm. Use QResource::compressionAlgorithm() to find out which algorithm to decompress. QFile will automatically decompress using the correct algorithm. Change-Id: I343f2beed55440a7ac0bfffd1562e9a8f94933a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* RCC: Modernize the compression algorithm selectionThiago Macieira2018-12-111-18/+86
| | | | | | | | | | | Instead of using compression level -2 to indicate no compression, introduce CompressionAlgorithm::None and an equivalent XML attribute. This commit includes some extra error checking for RCC. Change-Id: I343f2beed55440a7ac0bfffd1562d64b024463ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* rcc: don't drop entries with missing files in -list modeOswald Buddenhagen2018-05-071-11/+7
| | | | | | | | | | | | | the files may not exist _yet_. this change allows dynamically generating the resource contents. the ignoreErrors parameter is renamed to listMode and made less aggressive, to better reflect the actual usage. Change-Id: I2f6a75a23f1ef903f0d957f9a09f4df0ce2a2b35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* rcc: prune dead wildcard matching codeOswald Buddenhagen2018-03-291-32/+29
| | | | | | | | | | | | | | | | clearly, rcc was meant to support wildcard patterns in <file> entries. however, since its inception, this code was broken: the exists() check was done first, so the decomposition into path and wildcard would never happen. as actually supporting wildcards woulds just complicate matters, simply remove that dead code. on the way, re-arrange the code in a way that is advantageous for subsequent changes, and insert a case that catches non-regular file nodes (this would have previously run into the wildcard code). Change-Id: Iac1a168b844ef5b176f6cc45d6a779fde0bec6f7 Reviewed-by: hjk <hjk@qt.io>
* Allow to override resource file dateBernhard M. Wiedemann2017-11-131-1/+5
| | | | | | | | | | | | | | because some packages create resource input files at build time and thus get the build date embedded in binaries, so that they differ for each build. See https://reproducible-builds.org/ for why this matters and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. Task-number: QTBUG-62511 Change-Id: I8908ac6182fab066e6ea398df2567f6d050c77e7 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-131-11/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| * Make it possible to specify the RCC data version formatSimon Hausmann2017-02-281-11/+18
| | | | | | | | | | | | | | | | | | | | After commit d20773824529d191e7b483b505107dce6c1b1c3d we unconditionally write version two, but it seems useful to allow users to specify the version explicitly. Change-Id: I81d3de3d7f87318653f89bf10e3618becd8329d6 Task-number: QTBUG-58769 Reviewed-by: hjk <hjk@qt.io>
* | Use QString::asprintf(), QStringBuilder, and the multi-arg overload of ↵Alexander Volkov2017-01-121-2/+3
|/ | | | | | | | | | | | | QString::arg() ... instead of sequential .arg(const QString &) callings. It saves memory allocations and prevents unexpected results if replacing strings contain place markers. Found with clazy's qstring-arg check. Change-Id: I3912275a6e11c6fb7559ff5623f2e8cde9b7f07a Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix missing last modification time stamp in qrc contentSimon Hausmann2016-11-221-4/+42
| | | | | | | | | The time stamp is added at the end of the node information and consequently this also bumps the version. Task-number: QTBUG-57182 Change-Id: Ia10e006f28c0b168b2bcd74ed8b7098f84d10af3 Reviewed-by: hjk <hjk@qt.io>
* Use QStringBuilder more to optimize memory allocationsAnton Kudryavtsev2016-09-151-3/+1
| | | | | Change-Id: I2939ffa10496fdc59e0402a9cb54458565ccd657 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rcc: eradicate all Q_FOREACH loopsMarc Mutz2016-01-261-1/+2
| | | | | | | ... by replacing them with C++11 ramge-for loops. Change-Id: I95a91ac36c2b2bef17bf12cf7f1676653a2d807d Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>