summaryrefslogtreecommitdiff
path: root/src/linguist/shared
Commit message (Collapse)AuthorAgeFilesLines
* don't pretend that break()/next()/return() are functionsOswald Buddenhagen2013-05-216-37/+77
| | | | | | | | | | | | | | | | it's a pretty braindead thing to implement control flow statements as (built-in) functions. as a "side effect", this fixes return() value handling for lists. (cherry picked from qtcreator/f53ed6c4b3feca59a94d4f0de8b1a7411122e30e) (cherry picked from qtcreator/f529e22ec38fb9a656d74394e484d2453cf42c69) Change-Id: I59c8efa0e4d65329327115f7f8ed20719e7f7546 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from qtbase/8400896cfe3fbef7666329a2920bd0dbdd5890af) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* improve parse error recovery pathsOswald Buddenhagen2013-05-211-4/+7
| | | | | | | | | | | | to reduce collateral damage from parse errors. (cherry picked from qtcreator/00c0d0d5e42d28e03c2846c17d3acbcd8420859d) Change-Id: Ic59700d657069d3b15372509b4bff966057d27a9 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from qtbase/ae3f95a951334dee001e37c305e4d7bf91c0d1b3) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* make lrelease only optionally bootstrappedOswald Buddenhagen2013-03-191-1/+1
| | | | | | | qt_tool.prf handles the magic for us. Change-Id: Ifb8e7fd7ff0e46b9b274c9d156e048e89586ab2c Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix translation contextsOswald Buddenhagen2013-03-197-27/+9
| | | | | | | | the bootstrapped library now fakes the translation api sufficiently well to enable unifying the usage. Change-Id: I6a5d7cb1bb67830f1ea0a732566ebee354d62e7e Reviewed-by: hjk <hjk121@nokiamail.com>
* support only utf-8 and utf-16 for source codeOswald Buddenhagen2013-03-191-1/+1
| | | | | | | | | utf-16 is optionally used by java and msvc. it doesn't hurt to support it. all other encodings are not used anyway (other than 8-bit pass-through, but this is a matter for (the also removed) CodecForTr). Change-Id: Ie6482e187a9a8276918b53e97faeac88a40eb52c Reviewed-by: hjk <hjk121@nokiamail.com>
* purge CODECFORTR & -codecfortr supportOswald Buddenhagen2013-03-127-194/+31
| | | | | | | | qt-based code is expected to be utf8-encoded nowadays. the respective c++ interfaces have been purged in 5.0 already. Change-Id: I592b49f198aae05212afbf8d3aa2b01b1e9369dd Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* purge TS 1.1 supportOswald Buddenhagen2013-03-121-102/+15
| | | | | | | | | | at the time of release it will be almost five years since we introduced TS 2.0 and stopped writing 1.1 by default, so there shouldn't be much of a need to write such files any more - and this commit doesn't even remove 1.1 reading capability (because it comes for free so far). Change-Id: Ie54fe31f83733ef944306c01301c0ec0e9bcb8bf Reviewed-by: hjk <hjk121@nokiamail.com>
* QMakeParser: save one ByteArray constructionhjk2013-02-061-1/+1
| | | | | | | Change-Id: I2845fdefb8b32de227f08017e0e3ad98923d1c87 Reviewed-by: hjk <hjk121@nokiamail.com> (cherry picked from qtcreator/52be02d1cbbf69d4f82c517c7b633ed3d13b1007) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Remove braces for single lines of conditionsOrgad Shaneh2013-02-063-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!/usr/bin/env ruby Dir.glob('**/*.cpp') { |file| # skip ast (excluding paste, astpath, and canv'ast'imer) next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i s = File.read(file) next if s.include?('qlalr') orig = s.dup s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m| res = $& if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces res else res.gsub!('} else', 'else') res.gsub!(/\n +} *\n/m, "\n") res.gsub(/ *{$/, '') end } s.gsub!(/ *$/, '') File.open(file, 'wb').write(s) if s != orig } Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc Reviewed-by: hjk <qthjk@ovi.com> (cherry picked from qtcreator/29a93998df8405e8799ad23934a56cd99fb36403) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* support alternative and multiple suffixes in $$resolve_depends()Oswald Buddenhagen2013-02-062-6/+11
| | | | | | | | | this is undeniably a new feature, but it's needed for a bugfix. Change-Id: I951a3128eb580404ee0c7e3cdcb4d6170e899f70 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> (cherry picked from qtbase/87054805872429c1c17135f9ae5364b050d3fdff) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* don't flush qmake command line twiceOswald Buddenhagen2013-02-061-0/+2
| | | | | | | | | | otherwise variable assignments (including -config options) from $QMAKEFLAGS are lost. Change-Id: I818e9372d2b0ff44333dc3eb8fc3420f84ab01c5 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qtbase/864e1ceaf628e823103ae2d28d2c983400ba38c7)
* qmake:Add a case sensitivity flag to ProString::{starts,ends}With()Debao Zhang2013-02-061-8/+8
| | | | | | | Change-Id: I457cd8288ae8a0138f7b28321fe87be3308b5215 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qtbase/4d55b473b3a1514c53dc5ee8116e2c86e4f62eb6) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* add base parameter to ProString::toInt and ProString::toShortJoerg Bornemann2013-02-061-2/+2
| | | | | | | Change-Id: I0c8b48e6491486ca829ce24ca2e284294ba0138a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qtbase/9a1183b400748aa51132dd17d004d9d6e560b5b8) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1027-27/+27
| | | | | | | Change-Id: I9b11dc8309c9739955e3acea12b564d6ad608f59 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix build after QLocale enums updateKonstantin Ritt2012-11-261-23/+24
| | | | | | | | Uncomment "Missing" languages that were added recently. Use modern language names instead of compat ones. Change-Id: I1f4669ed17e4c814607d93fdae16eff20485d98e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix linguist build after updating QLocale up to CLDR 22.1.Friedemann Kleint2012-11-221-3/+3
| | | | | | Change-Id: Ie03060fe59db43fef83f055b7000240368fe9d46 qtbase: 3791d21f72a4c7035cd1db42c36dbd1dc7efd0f6 Reviewed-by: hjk <qthjk@ovi.com>
* re-bootstrap lreleaseOswald Buddenhagen2012-11-131-1/+1
| | | | | | | this is needed for being able to x-compile translations. Change-Id: Ia2a00e8195f84feaedd036e6b7b83df373425b38 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix bootstrapped buildOswald Buddenhagen2012-11-131-2/+2
| | | | | Change-Id: I8c987e8eed555c9c976732e216553d8002ee2b87 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* adjust fake QCoreApplication::translate() to qtcore changesOswald Buddenhagen2012-11-131-2/+1
| | | | | Change-Id: I52a74c7ad499312b35b3a25c6ad6d571e0dedb61 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove stale QT_NO_TRANSLATION ifdefsOswald Buddenhagen2012-11-132-8/+0
| | | | | | | they are from the times when these files were part of the qt api Change-Id: Ic4b0d6af68e4cbba14e7efe0ca0bb901641e021b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* fix non-qmake build of the evaluatorv5.0.0-beta2Oswald Buddenhagen2012-11-051-1/+1
| | | | | Change-Id: I024031a03e44151b0b350dea83bd5bae1740568f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* rewrite default spec handlingOswald Buddenhagen2012-11-051-3/+11
| | | | | | | | | | | instead of symlinking (on unix) or creating a forwarding spec (on windows), just put the default specs into (the bootstrapped) QLibraryInfo. Change-Id: I595500ef7399f77cb8ec117c4303bc0a2ffe505f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from qtbase/7d20f3dd1065a20b40cb4689783fba05190fe317)
* Fix qmake's pro file cache to interact correctly with write_fileSimon Hausmann2012-11-053-0/+9
| | | | | | | | | | | | When writing a file with write_file() we have to inform the pro file parser cache to discard the file if it's existant in the cache, to ensure that calling include() after write_file() always works. Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qtbase/f45d6414ad6ef1d75f049a61411cd954bcae29c3) Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Use QStringList::join(QChar) overload where applicable [qmake]Marc Mutz2012-11-051-2/+2
| | | | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: I9c9964703dedfdab6e7bfac80be22bd5570e2e49 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qtbase/f4d47945ba17db276e94046473816014ed0342e9) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: add ProStringList::join(QChar)Marc Mutz2012-11-052-8/+20
| | | | | | | | | | | | | Same reasoning as for 68e04c3ac148bcbe71f2deeb7288563f6cdbcab5 applies. Adding the overload was easier than to teach a Perl script to distinguish between QStringList and ProStringList instances... Change-Id: I6de6ecf21fdad135ac213b5c794927a9bc120a92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qtbase/cbf447069cfeb799ff5e09902be065d77f2e7707) Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* resolve only one level of symlinks, and only for the default specsOswald Buddenhagen2012-11-051-1/+6
| | | | | | | | | otherwise we end up in the source tree, which is counterproductive. Task-number: QTBUG-26869 Change-Id: Id44a94f827dc285c75b9b243c8ef6478e668e3ff Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> (cherry picked from qtbase/04cd23428a4f2cfa5ee02b70f2086ff832aae925)
* fold m_qmakespecFull back into m_qmakespecOswald Buddenhagen2012-11-052-9/+8
| | | | | | | | the original value is not used any more after the final resolution. Change-Id: Icadc219f045a1bbfd20506c4c72c53d1fb352969 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> (cherry picked from qtbase/cc2cd0db5d0c53605ab93f796765667ead1920e8)
* fetch all properties from qmakeOswald Buddenhagen2012-11-051-2/+1
| | | | | | | | | | | | don't filter out ^QMAKE_.*: - QMAKE_MKSPECS is not printed any more, so needs no filtering - QMAKE_VERSION can be simply used now, as we are now rather close to the real qmake - QMAKE_SPEC and QMAKE_XSPEC need to be fetched - this fixes the default spec resolution Change-Id: Ifcfa8b5b9e2bbf5d995940e1bb7f55e7d67aed3e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2527-648/+648
| | | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If89e41b25a242ff376eacdf8790957bcf499cc66 Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* implement stand-alone getSimilarityScore() with StringSimilarityMatcher()Oswald Buddenhagen2012-09-202-20/+11
| | | | | | | now that the instantiation is cheap, we can do that. Change-Id: Ifd2c3155aa976ec634d4ed96ae796a60584ca9a4 Reviewed-by: hjk <qthjk@ovi.com>
* make StringSimilarityMatcher instantiation cheapOswald Buddenhagen2012-09-202-51/+47
| | | | | | | | | ... by removing an allocation. move some of the functions out of the class to avoid polluting the header. Change-Id: If0d3638215e59f7d88be7217e4d3abcbfd7a201e Reviewed-by: hjk <qthjk@ovi.com>
* optimize similarTextHeuristicCandidates()Oswald Buddenhagen2012-09-201-1/+2
| | | | | | | no need to re-calculate the matrix for the reference string every time. Change-Id: Id4432d9fa78d5a065cfe1549a908454710e0ae26 Reviewed-by: hjk <qthjk@ovi.com>
* update qmake evaluator to newest version from qt creatorOswald Buddenhagen2012-09-2016-3761/+5358
| | | | | | Change-Id: I66ec46dd87f922094f6937b50cc40e02ef08cc86 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* sort <extra-*> tagsOswald Buddenhagen2012-09-201-3/+7
| | | | | | | relying on hash sort order is no good idea Change-Id: I314222bbfd94d29bad1cb7e8b6823b320a88ea75 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* Non-UTF8 encoding for source code is deprecated.Thiago Macieira2012-08-011-4/+4
| | | | | | | | So the encoding marker for translations is unnecessary. It's always UTF-8 now. Change-Id: I2013451f917fa6b58125a6cf3cd5db6c99ab0ff2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Enable modularization of translation files.Jan-Arve Saether2012-07-124-3/+76
| | | | | | | | This is accomplished by introducing dependencies to catalogs. Task-number: QTBUG-26138 Change-Id: Ia05918e1e043366ae0bf992f461275592f566c61 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix cross compilationYuchen Deng2012-07-021-1/+1
| | | | | | Change-Id: I1c9fba9bcbec9cc2b9bcca7bbb77525173937a16 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Change uses of {to,from}Ascii to {to,from}Latin1 [Linguist]Thiago Macieira2012-05-031-5/+5
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ibb3c04114e1a311ff70ef649d977524a6dfec0aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Don't use the QRegExp methods that modify the object [Linguist]Thiago Macieira2012-04-253-4/+4
| | | | | | | | | | | | | QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: I181d37fd98b00550dd98d418a33183a4bde0c532 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Compile fix (lupdate).Friedemann Kleint2012-03-082-6/+6
| | | | | | | - Adapt lupdate to removal of QCoreApplication::CodecForTr. Change-Id: Id26c49f024966d93a9845ecb69a3be46d46b5f21 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3021-21/+21
| | | | | | | | | | | 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: Ib4b7580dda53886247ad6eb10d17d8e67c51980d Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-2321-21/+21
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I3841a7c154b90b73fe8f498fda035c8b3545c692 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0621-21/+21
| | | | | | Change-Id: I89fb3609f49f9a4f1e7d658b05e212febcb14c94 Sanity-Review: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* make $$join() implementation qmake-compliantOswald Buddenhagen2011-12-131-1/+1
| | | | | | | | | Task-number: QTCREATORBUG-6441 Change-Id: I1d18c81f76cda71654a85c23b7b53b4aae0d51c6 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 555e539760998fcff1e3117abc5080c4fee47275) Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Make sysrootify case-insensitive on windowsDaniel Teske2011-12-131-2/+8
| | | | | | | | | Task-Number: QTCREATORBUG-6419 Change-Id: If3ab035ee3a117744213d5e3db3ffa41f7283d53 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit e7c6b9dbbbba8224dd7abaa2b513bec66fbf3abf) Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Work around MinGW GCC version >=4.5 always_inline+dllexport bug.Ruben Van Boxem2011-12-131-1/+2
| | | | | | | | | | | Use regular inline instead of always_inline for MinGW GCC build. GCC 4.5 and later spit out an error on always_inline dllexport functions, which breaks the build for these versions of GCC (see bug 5938). Change-Id: I444380ff98071b4653a91d074494ace579b4a622 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 310b446a81dd927739e503b03389641f1aa13ab4) Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Removed dead assignmentsRobert Loehning2011-12-132-3/+2
| | | | | | | Change-Id: I1368cb534284016479211160cd8bf3cbc2f738e4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit 75719f04ee2c41312c70fee2271796d05ea08c0e) Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* implement qt5 $$sort_depends() and $$resolve_depends()Oswald Buddenhagen2011-12-131-2/+55
| | | | | | | | | | | | Task-number: QTCREATORBUG-5289 Change-Id: I15e08005c13d12afd5791796d676b30c726fadc3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com> (cherry picked from commit 330e118424f67d7e9de764b2d1fb1dad8000974e) (cherry picked from commit 7cd17f3f41dfbcf6c7cb791dd4db890815f8468c) Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* add -list-languages option to lupdateOswald Buddenhagen2011-11-092-0/+25
| | | | | | | | (cherry picked from commit 3b3788a25f58fc443a48672c8e852e1c8658ac4e) Change-Id: I4523cde9b12268790c32d4a129c962c3d48ed1b9 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* remove dead codeOswald Buddenhagen2011-11-091-7/+0
| | | | | | | | (cherry picked from commit a3e91910e6eed7f5523009eb0a5439f4019d16ed) Change-Id: I8b7cac5a65c9ee17f58562d1951496ede86c71a0 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>