summaryrefslogtreecommitdiffstats
path: root/tools/linguist/lupdate
Commit message (Collapse)AuthorAgeFilesLines
* make HashString and HashStringList objects smallerOswald Buddenhagen2010-04-151-13/+10
| | | | | | | | | | qHash(QString) has only 28 bits, so we can use the upper bits for flagging whether the hash is valid. size effect: LP32: align(4, 4 + 4 + 1) = 12 vs. align(4, 4 + 4) = 8 LP64: align(8, 8 + 8 + 1) = 24 vs. align(8, 8 + 8) = 16 P64: align(8, 8 + 4 + 1) = 16 vs. align(8, 8 + 4) = 16
* remove pointless manual assignments from token type enumOswald Buddenhagen2010-04-151-6/+6
| | | | | making the range discontiguous just makes the switch() jump table bigger or not applicable at all.
* fix "using namespace" recursion crashOswald Buddenhagen2010-03-051-8/+20
| | | | Task-number: QTBUG-8360
* don't falsely complain about mismatched codecfortrOswald Buddenhagen2010-01-271-13/+13
| | | | normalize the user input first
* add directories with sources to list of project rootsOswald Buddenhagen2010-01-271-3/+12
| | | | | | | | if the pro file for the translations lives in a sibling tree of the actual source tree, messages from included headers wouldn't have been collected, as they were not considered part of the project. Task-number: QTBUG-7495
* add -codecfortr optionOswald Buddenhagen2010-01-271-2/+17
| | | | this has always been kind of an omission ...
* sanitize lupdate's behavior regarding SUBDIRS projectsOswald Buddenhagen2010-01-271-95/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | previously, the semantics of nesting projects were pretty bizarre: the list of TS files grew ever as the subdirs were visited. the source files otoh were cleared for every project. this meant that some TS files were updated over and over again, each time with different data. this is obviously total nonsense, so there is no compatibilty to keep. so here come the new semantics: - each project is scanned separately. it has separate include paths and may override the inherited CODECFORSRC. - the messages from all sub-projects are merged - if a sub-project has a TRANSLATIONS entry, it is "detached" from its parent project, thus starting an own merged translator. it is also possible to name an empty set of TS files to simply exclude the sub-project. - CODECFORTR can be specified in each project with TRANSLATIONS - if TS files are specified on the command line, they override TRANSLATIONS from the top level project and stop processing of detached projects alltogether. if multiple top-level projects are specified, they are all merged. this is somewhat slower, as now includes are re-scanned per project, while previously all sources were simply accumulated and scanned as one project. this can be fixed retroactively if needed.
* unshare pro post-processing codeOswald Buddenhagen2010-01-271-12/+48
| | | | | lrelease needs only the TRANSLATIONS value anyway, so there is hardly anything to share for real
* complain if both sources and projects are given on the cmdlineOswald Buddenhagen2010-01-271-0/+4
|
* still complain if only ts files where specified on the cmdlineOswald Buddenhagen2010-01-271-7/+7
|
* do not sort the TS filesOswald Buddenhagen2010-01-271-1/+0
| | | | really no point in doing so ...
* Merge remote branch 'mainline/4.6' into 4.6Oswald Buddenhagen2010-01-139-9/+9
|\ | | | | | | | | Conflicts: tests/auto/linguist/lupdate/testlupdate.cpp
| * Update copyright year to 2010Jason McDonald2010-01-069-9/+9
| | | | | | | | Reviewed-by: Trust Me
* | don't complain about unresolved base when the reference is absoluteOswald Buddenhagen2010-01-071-1/+1
| | | | | | | | Task-number: QTBUG-6072
* | fix sametext and number heuristicsOswald Buddenhagen2010-01-061-45/+46
| | | | | | | | | | | | | | 92e9a48 ("eliminate Translator::replace()") eliminated the correctness as well. whoops. this code should be more efficient as well ...
* | fix number heuristics, part 1Oswald Buddenhagen2010-01-061-2/+2
| | | | | | | | Reviewed-by: TrustMe
* | remove dead codeOswald Buddenhagen2010-01-061-8/+0
|/
* don't use qWarning for things which are not really warningsOswald Buddenhagen2009-11-201-4/+11
| | | | | | | | | ... so the tools are usable with QT_FATAL_WARNINGS. it may be sensible to "degrade" the c++ parser warnings to info messages. possibly later ... Task-number: QTBUG-5683
* fix encodings, take NOswald Buddenhagen2009-11-201-12/+10
| | | | | Task-number: QTBUG-4499 Task-number: QTBUG-5276
* don't overwrite explicitly specified CODECFORTR on UTF-16 inputOswald Buddenhagen2009-11-192-1/+2
|
* fix potentially wrong output codec for UTF-16 input filesOswald Buddenhagen2009-11-191-1/+1
| | | | querying the actual codec before the file has been read is pointless
* record id-based messages even if they have an empty sourceOswald Buddenhagen2009-11-062-18/+14
| | | | | | this makes sense if one uses lupdate only for validation purposes, i.e. to find out if the code uses only ids which are defined in some external specification.
* handle messages with ids (more) correctlyOswald Buddenhagen2009-11-061-15/+29
| | | | | when comparing two messages which both have ids, compare only the ids. this affects finding/reporting duplicates and merging.
* kill TranslatorMessage::operator==() and qHash(TranslatorMessage)Oswald Buddenhagen2009-11-061-2/+2
| | | | preparation work ...
* eliminate Translator::replace()Oswald Buddenhagen2009-11-061-7/+3
|
* use right method to record new messagesOswald Buddenhagen2009-11-061-1/+1
| | | | consistent with all other source parsers
* cut code dupe ...Oswald Buddenhagen2009-11-061-12/+5
| | | | ... with gotos :)
* don't construct a new message for look-up purposes onlyOswald Buddenhagen2009-11-061-3/+5
|
* don't break on unterminated C commentsOswald Buddenhagen2009-11-041-1/+1
|
* introduce delayed resolution of aliasesOswald Buddenhagen2009-11-041-16/+41
| | | | | | | | this has two effects: - using-declarations which use forward-declared classes work without collecting the forward declarations, as the resolution happens at a place where the class definition must have been encountered already - it should be a bit faster
* fix bogus "Class '<foo>' lacks Q_OBJECT macro"Oswald Buddenhagen2009-11-041-3/+3
| | | | | | the optimization not to look for parent definitions if we already knew that there would be none did not consider that we only know that the leaf node is missing, not any intermediate nodes.
* namespaces can have parents, tooOswald Buddenhagen2009-11-041-5/+10
|
* do not crashOswald Buddenhagen2009-10-291-5/+7
|
* make magic comment parsing stricterOswald Buddenhagen2009-10-281-9/+9
| | | | | | there must be a space after the //: and similar comments, otherwise harmless comments of the sort of //====== foo here ===== will be parsed as message ids, etc.
* actually guess the target language from the file nameOswald Buddenhagen2009-10-221-0/+2
| | | | --help says it does, but it didn't really.
* Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2009-10-011-5/+4
|\
| * make -help reflect realityOswald Buddenhagen2009-10-011-5/+4
| |
| * Update license headers again.Jason McDonald2009-09-082-8/+8
| | | | | | | | Reviewed-by: Trust Me
* | fix solaris buildOswald Buddenhagen2009-09-291-1/+5
| | | | | | | | "A class with a reference member must have a user-defined constructor."
* | detect and eliminate forwarding headersOswald Buddenhagen2009-09-231-7/+20
| | | | | | | | | | this will save quite some hash lookups (even if in empty hashes) and make the VisitRecorder bitmap smaller.
* | reduce peak memory consumptionOswald Buddenhagen2009-09-231-30/+70
| | | | | | | | | | drop the parse results of files which are unlikely to be included (i.e., which are not headers).
* | actually use the argument of Q_DECLARE_TR_FUNCTIONSOswald Buddenhagen2009-09-231-9/+59
| | | | | | | | | | | | which means that one can set an arbitrary context. as a side effect, this caches the stringified context of Q_OBJECT-derived classes.
* | namespaces *can* have tr() functions, after allOswald Buddenhagen2009-09-231-11/+8
| | | | | | | | | | | | ... by virtue of the Q_DECLARE_TR_FUNCTIONS macro. so remove the artificial limitation to classes (which was mostly an optimization anyway).
* | drastically improve lupdate's scalabilityOswald Buddenhagen2009-09-231-197/+280
| | | | | | | | | | | | | | do not import all data from included files into the current file (which turned out to be extremely expensive for 3rdparty/webkit), but do hierarchical lookups on demand. this makes the lookups as such much slower, of course, but it still pays off.
* | optimize/clarify function context stringificationOswald Buddenhagen2009-09-231-5/+6
| |
* | do not record class forward declarationsOswald Buddenhagen2009-09-231-28/+27
| | | | | | | | | | they don't create useful namespaces and don't hold flags, so it is pointless to clutter the namespace maps with them.
* | remove more dead codeOswald Buddenhagen2009-09-231-2/+1
| | | | | | | | no need for parameter "unresolved"
* | remove dead codeOswald Buddenhagen2009-09-231-13/+2
| | | | | | | | needsTrFunctions was never set any more
* | move static objects out of function scopeOswald Buddenhagen2009-09-231-6/+6
| | | | | | | | | | cuts away a few thousand instructions. need to revisit this in case of making the parser a dynamic library.
* | use a source char pointer instead of a string + indexOswald Buddenhagen2009-09-231-13/+18
| |