summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc
Commit message (Collapse)AuthorAgeFilesLines
* uic & rcc: use the public API to set the hash seedThiago Macieira2017-03-161-4/+6
| | | | | | | | Instead of relying on a private symbol exported from QtCore. Task-number: QTBUG-47566 Change-Id: I4a7dc1fe14154695b968fffd14abd2b21a18203b Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-133-13/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-283-13/+38
| | | | | | | | | | | | | | | | | | | | 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-122-4/+6
|/ | | | | | | | | | | | | 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-222-4/+43
| | | | | | | | | 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>
* qmake/tools: port the last remaining Q_FOREACH loops and add QT_NO_FOREACHMarc Mutz2016-05-111-1/+1
| | | | | | | | | | Port the last four remaining Q_FOREACH users in qmake and uic to C++11 range-for and mark all qtbase tools (incl. qmake) as Q_FOREACH-free, using QT_NO_FOREACH. Change-Id: Ief4e5877269e7a853e4cf05e58861a448e822d3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-131-0/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/testlib/qtestcase.cpp src/testlib/qtestcase.qdoc Change-Id: Ied3c471dbc9a076c8de33d673bd557e88575609d
| * rcc compiler with -list on Windows (newline symbols)Timur Pocheptsov2016-04-081-0/+5
| | | | | | | | | | | | | | | | | | | | Suppress '\n' -> '\r\n' replacement done by QIODevice, on Windows fwrite to stdout will end up in such replacement, no need in \r\r\n (reported as a bug in QtQuickCompiler originally).) Task-number: QTRD-3497 Change-Id: I61010831b49e41b3e4fa6626054f9fb53c63bb8a Reviewed-by: hjk <hjk@theqtcompany.com>
* | rcc: eradicate all Q_FOREACH loopsMarc Mutz2016-01-262-5/+6
| | | | | | | | | | | | | | ... by replacing them with C++11 ramge-for loops. Change-Id: I95a91ac36c2b2bef17bf12cf7f1676653a2d807d Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-213-51/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* tools: mark some types movable/primitiveMarc Mutz2015-07-221-0/+1
| | | | | | | They are held in QList or QVector. Change-Id: Ic0e379560e554e5cd3de4319e402ec1655e77874 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-07-171-1/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
| * Rcc: Do not output empty lines when listing .qrc contentshjk2015-07-081-1/+2
| | | | | | | | | | | | | | | | | | Previously, directory nodes in the resource tree generated empty file names in the --list output. They do not add value. Change-Id: I04ac495ba5f57802de9796ec663c28facfee89f2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Warta
* | rcc: make qt_rcc_compare_hash a functorMarc Mutz2015-07-131-5/+9
|/ | | | | | | | This allows the compiler to inline the function call into the std::sort instantiation. Change-Id: If2b948c1d7202d6a81afd8a58cc9fab50a9709c1 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Update copyright headersJani Heikkinen2015-02-113-21/+21
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4.1' into 5.4Frederik Gladhorn2015-01-291-0/+1
|\ | | | | | | Change-Id: Idadb5639da6e55e7ac8cc30eedf76d147d8d5d23
| * rcc: fix build failure on Windows XP / MinGW 4.9Giuseppe D'Angelo2015-01-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The code makes usage of _fileno without including the appropriate header, which is stdio.h according to Microsoft: http://msdn.microsoft.com/en-us/library/zs6wbdhx%28v=vs.120%29.aspx Task-number: QTBUG-43900 Change-Id: Ic9d407c66243d64823353a1c7e79cf0825c735db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Make it possible to generate rcc files from stdinAleix Pol2015-01-211-1/+3
|/ | | | | | | | | | | | There's already some code to be able to generate the rcc files from stdin, only problem being that the input sanity check was not allowing the code path to proceed being left unreachable. This patch fixes it by allowing "-" as an acceptable argument and the process proceeds as expected. Change-Id: Icd47c7a65373ff1ea3f98d9528736f8a1b21b707 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into 5.4.0" into ↵Jani Heikkinen2014-11-111-0/+2
|\ | | | | | | refs/staging/5.4.0
| * Rcc: ensure enough space for the embeddedhjk2014-11-051-0/+2
| | | | | | | | | | | | | | | | | | The two-pass feature depends on the QRC_DATA signature that needs to be stored in the array later overwritten by the embedded data. Task-number: QTBUG-42359 Change-Id: Ida1ccff40dda28f92a4267f86f48ee96d62bd214 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* | rcc: Replace all occurrences of the marker in two-pass modehjk2014-11-111-23/+27
|/ | | | | | | | | The marker can occur legitimately twice e.g. on iOS with universal binaries. Change-Id: Ie334bcd104d45140ff969f44230e6de2212e8e25 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
* Add extra declarations to make rcc output pass -Wmissing-declarationshjk2014-10-251-0/+12
| | | | | | | | | | The previously produced code was valid C++. Add the declaration nevertheless to help people who want to use the switch in their own code. Task-number: QTBUG-42119 Change-Id: Ia47cf3930684474ff65e5cf37335d7d7f57a1d31 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Account for the country/language settings when checking for duplicatesAndy Shaw2014-10-101-4/+11
| | | | | | | | | When a file has the same alias but a different country or language setting then it should not warn about it being a potential duplicate. Task-number: QTBUG-19286 Change-Id: I60a9c422ff02214399bdea3791374a65c9f6c604 Reviewed-by: hjk <hjk121@nokiamail.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-2/+2
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-243-54/+30
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* rcc: String literal conversion cleanupKai Koehne2014-07-232-8/+8
| | | | | | | | Replace QString::fromUtf8 with QString::fromLatin1 for ascii strings. Also optimize use of QT_VERSION_STR. Change-Id: I13c683499c56cb4ac4d2bbd9b6b53c337917e347 Reviewed-by: hjk <hjk121@nokiamail.com>
* RCC: Use macros not defined in qglobal.hhjk2014-07-161-12/+12
| | | | | | | | | This prevents conflicts in case of link time optimizations or precompiled headers are used since we don't include qglobal.h in the generated code. Change-Id: I4266c8ae38e6eafefd28b3bde5cb725a24d67ea0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* rcc: Prevent CRLF conversion on Windows for -binaryKai Koehne2014-07-161-0/+9
| | | | | | | | | | | | | | | | | | | | Fix an issue on Windows where rcc -binary project.qrc >project.rcc resulted in a corrupted file (\n was automatically replaced with \r\n). This is caused by Qt using fwrite internally, which will automatically replace linefeed with carriage-return for streams opened in text mode. The fix forces stdout to binary mode in this case. Task-number: QTBUG-39422 Change-Id: Ib5b5e82db922dc389d160b0115dbafe8641c95fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Remove the rcc output file if we failed to write itThiago Macieira2014-07-011-1/+7
| | | | | | | | | | | | This happens if the second pass failed to find the signature data in the compiled output, which can happen if the compiler is not *actually* compiling anything (LTO / LTCG mode). If we left the unmodified file in the output, make would continue running next time it was invoked, resulting in bad data. Change-Id: I97f23a89a1ca1f8b8c449b0744de3f0c78daa706 Reviewed-by: hjk <hjk121@nokiamail.com>
* Make RCC handle bigger binarieshjk2014-06-063-53/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, RCC in "C mode" was meant to bundle small resources into a binary, like help texts or an occasional icon. RCC produces a .cpp file containing the actual data in a char array which is then passed to the compiler and linker as a normal source file. Larger resources should be compiled in RCC's binary mode and loaded at run time. Current Qt Quick use tries to deploy large hunks of data in "C mode", causing heavy compiler/system load. This patch works around the issue by splitting the process into three parts: 1. Create a C++ skeleton, as usual, but use a placeholder array with "easily compilable" (mostly NULs) data instead. 2. Compile the skeleton file. 3. Replace the placeholder data with the real binary data. time (qmake5 ; make clean ; make) takes 1.3 s real time for a 100 MB resource here, and there is still room for improving patching performance if really needed. Change-Id: I10a1645fd86a95a7d5663c89e19b05cb3b43ed1b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* RCC: Avoid some needless to/fromLatin1 cyclehjk2014-06-031-10/+11
| | | | | Change-Id: I70f330ee5ce083fb90f0c6d70e5b99063bc6e974 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* rcc: Remove compile dependency on private headers.hjk2013-09-262-2/+0
| | | | | | | Not needed anymore now that it's using the new commandline parser. Change-Id: I1a44c8658d128e4fbb9a6fc5000025f55e5293c2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove qSort usage from rccGiuseppe D'Angelo2013-09-031-2/+4
| | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I09dc82b7f9509f73c7b8b9c16a08fefb8ca0b8a5 Reviewed-by: hjk <hjk121@nokiamail.com>
* Port rcc to QCommandLineParser.David Faure2013-08-291-98/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ======= Qt resource compiler Usage: rcc [options] <inputs> Options: -o file write output to file rather than stdout -name name create an external initialization function with name -threshold level threshold to consider compressing files -compress level compress input files by level -root path prefix resource access path with root path -no-compress disable all compression -binary output a binary file for use as a dynamic resource -namespace turn off namespace macros -project Output a resource file containing all files from the current directory -version display version -help display this information Undocumented: -verbose and -list ! After: ====== Usage: rcc [options] inputs Qt Resource Compiler version 5.2.0 Options: -h, --help Displays this help. -v, --version Displays version information. -o, --output <file> Write output to <file> rather than stdout. --name <name> Create an external initialization function with <name>. --root <path> Prefix resource access path with root path. --compress <level> Compress input files by <level>. --no-compress Disable all compression. --threshold <level> Threshold to consider compressing files. --binary Output a binary file for use as a dynamic resource. --namespace Turn off namespace macros. --verbose Enable verbose mode. --list Only list the files, do not generate code. --project Output a resource file containing all files from the current directory. Arguments: inputs Input files (*.qrc). Change-Id: If20958afd6c01df5d0d755e13e8581bc1cb9af51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* RCC: Mention -list command line option in -help outputhjk2013-08-131-0/+1
| | | | | | Change-Id: I98066aba55f5ac699efc210360a60871042f4083 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-162-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* don't bootstrap tools when not necessaryOswald Buddenhagen2013-03-141-0/+1
| | | | | | | | bootstrapping is only necessary if we are cross-compiling or have a circular build dependency. Change-Id: I17244457652ca9d4fc797043e57070c2ae3ee5d1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-183-3/+3
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove the timestamp info in genarated filesLiang Qi2012-12-151-3/+1
| | | | | | | | | | | | | For moc, rcc and uic, then it's friendly for tools like ccache. ccache is using md5 to check file modification, but the different timestamp info will cause different md5 for same meaningful contents, it will disabled ccache. Updated the autotest for uic and rcc. Task-number: QTBUG-26589 Change-Id: I9f1dcf6cd826ad9603af6e183757bcd748c32bd1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* make qt_tool support building bootstrapped toolsOswald Buddenhagen2012-11-161-6/+1
| | | | | | | | | | as a "side effect", this fixes the build of bootstrapped tools when doing a debug build under msvc: qt.prf would add CONFIG+=release after default_post.prf already loaded debug.prf. Change-Id: Idd17cf28d358950fd90bb18ca7a8d67e06953bc1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* remove pointless TARGET assignmentsOswald Buddenhagen2012-11-161-1/+0
| | | | | | | TARGET defaults to the project file's basename Change-Id: I0cd204ae6559e6c51d3c987bc38ae372e2b4a3dd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Generate a proper static QtBootstrap moduleOswald Buddenhagen2012-11-081-2/+2
| | | | | | | | | | | Making a properly installed libQtBootstrap simplifies our tools build process a little and in addition allows other comand line tools to use the bootstrap lib and link against it. Initial-version-by: Lars Knoll Change-Id: Iddf4568a5505bc24898ec1abf7e7022e19f0a454 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Set the Directory flag when we find a directory.Stephen Kelly2012-10-261-1/+1
| | | | | Change-Id: I103a0b8e7b7ba673d00f920944026d7d04fac193 Reviewed-by: hjk <qthjk@ovi.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-223-72/+72
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* make src/tools/ compile without CamelCase headersOswald Buddenhagen2012-09-193-20/+20
| | | | | | | | so the build works with syncqt -minimal Change-Id: Ief5e8eb9a504dd6c84cff76cc3e5257450386a0f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rcc: use new qEnvironmentVariableIsEmpty()Marc Mutz2012-08-141-1/+1
| | | | | Change-Id: I48dd9b7b8dd51e1c662273eb37ac2e1f4c1c4d15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Generate a fatal error as appropriate.Stephen Kelly2012-07-161-1/+3
| | | | | | | | | | | | | | Otherwise, subdirectories under directories which are added to a resource file generate garbage in the binary. The easiest way to see this is cd tests/auto/corelib/kernel/qvariant mkdir stream/qt4.9/somedir make && ./tst_qvariant loadQt4Stream Change-Id: I32630ecb6d515db1d135f0ffc5cf14fd8caa0a4f Reviewed-by: hjk <qthjk@ovi.com>
* Fix typo qith -> with.Stephen Kelly2012-07-141-1/+1
| | | | | | Change-Id: Ie9eaa016c61f929be17fd1687517540c2ae1f3d2 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>