summaryrefslogtreecommitdiffstats
path: root/src/tools/rcc/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-131-1/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+16
| | | | | | | | | | | | | | | | | | | | 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>
* 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-261-4/+4
| | | | | | | | | | | | | | ... 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-211-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* 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-241-18/+10
| | | | | | | | | - 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-231-3/+3
| | | | | | | | 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: 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-061-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Remove compile dependency on private headers.hjk2013-09-261-1/+0
| | | | | | | Not needed anymore now that it's using the new commandline parser. Change-Id: I1a44c8658d128e4fbb9a6fc5000025f55e5293c2 Reviewed-by: Marc Mutz <marc.mutz@kdab.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-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | 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-191-7/+7
| | | | | | | | 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>
* Add const & to foreach 'iterators'Albert Astals Cid2012-06-271-1/+1
| | | | | | | Change-Id: I8c0600dfd919f45d14a0011f2da9b9fe0b9a0df3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Stop relying on QHash orderingGiuseppe D'Angelo2012-04-031-0/+9
| | | | | | | | | | | | | tst_rcc and tst_qdom rely on specific QHash orderings inside rcc and QDom respectively (see QTBUG-25078 and QTBUG-25071). A workaround is added to make them succeed: QDom checks for all possible orderings, and rcc initializes the hash seed to 0 if the QT_RCC_TEST environment variable is set. Change-Id: I5ed6b50602fceba731c797aec8dffc9cc1d6a1ce Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+262
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12