summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtranslator.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use unsigned variable for size and indexJoão Abecasis2012-03-301-2/+2
| | | | | | | | rulesSize is passed from unsigned variable numerusRulesLength, so don't bring sign bit into equation; array index variable i also made unsigned. Change-Id: I0cb4e8483272c1e60339298149fb118215aa2183 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix comments out of touch with realityJoão Abecasis2012-03-301-3/+3
| | | | | Change-Id: Id060626b0bb6c28f4e67c9b3c7a0fbc456f7dcc6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Clean up and make robust the file loading codeJoão Abecasis2012-03-281-37/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The used_mmap variable was set to true the first time an mmap operation was successful, but it was never reset back to false. While that can be a good indicator that future calls might succeed it is not a guarantee. Not properly resetting could mean we'd unmap memory allocated with new, instead of deleting it. Since that variable is only used inside defined(QT_USE_MMAP) blocks, its declaration is scoped the same way. While mmap is still handled "by hand", use QFile for the other operations. Calling mmap here is less than ideal, as it prevents use of other memory mapping methods, such as native Windows APIs, but is less intrusive as it allows QTranslator to retain control over lifetime of the map. Using QFile for remaining operations reduces the number of filesystem operations. The file size is now checked to be minimally sane (<4GB), the limit of the 32-bit variable that will hold mapping's length. Translation files should be expected to be much smaller in practice, but there isn't a sane hard-limit. The file format is broken down to sections, each of which has a 32-bit length. Finally, when loading a file fails, release resources immediately, instead of delaying to next load attempt or the destructor. Change-Id: I5cc1b626a99d229e8861eb0fbafc42b928b6a122 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fail when no translations found, reset pointers on failureJoão Abecasis2012-03-281-0/+14
| | | | | | | We don't want to be using or trusting partial loads. Change-Id: I3934d6cf54cd99eaab2fa7aee9a0e9968d9f3c13 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Use Big-Endian conversion functions from qendian.hJoão Abecasis2012-03-281-6/+4
| | | | | | | | These avoids repeating code and documents that the underlying format is compacted big-endian. Change-Id: I5a2dc0084945d99368183203a0a9b7c116874620 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove unused argumentJoão Abecasis2012-03-281-7/+1
| | | | | | | | | The mode argument (third argument to (_)open) is only used when (_)O_CREAT is also specified. As we're opening the file read-only it is unused and unnecessary. Change-Id: Icc16edec5a7d44c57ad02865048c56114c39d4bc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* There's no need to check pre-validated inputJoão Abecasis2012-03-281-8/+6
| | | | | | | | elfHash and friends are used solely from do_translate, which already checks for null strings. There's no need to do it again here. Change-Id: I90a16d2623ca753a444e53952539001988568bdb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Use accumulating hash, instead of allocating intermediate stringJoão Abecasis2012-03-281-4/+17
| | | | | Change-Id: Ie93ac8df3066159ad11ff7f68c7ba85e7f5aa8bc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Avoid overflow in boundary checkJoão Abecasis2012-03-271-1/+1
| | | | | Change-Id: I4f397795a65d5d6ea237a6751588a8dc6be15bdc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-28/+28
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove Symbian specific code from QtCore.Xizhi Zhu2012-01-301-2/+2
| | | | | Change-Id: I131303e28a12dccb96de3de4ca0073b389a9bbae Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* 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>
* Remove stale documentation and fix qdoc errors.Casper van Donderen2011-10-111-6/+0
| | | | | | | Change-Id: I51bb0c52eb32d9d672d115f31b16d414f81708e2 Reviewed-on: http://codereview.qt-project.org/6433 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* merge translate() overloadsOswald Buddenhagen2011-09-211-21/+4
| | | | | | | | Change-Id: I58f0d2c2ec6da751860a90096c49c662658643c1 Reviewed-on: http://codereview.qt-project.org/5164 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: hjk <qthjk@ovi.com>
* Remove the remaining QT3_SUPPORT code in corelibLars Knoll2011-06-291-12/+0
| | | | | | | Change-Id: I6641c62d75d2034a46ea7cc869ae65285ae8b8f4 Reviewed-on: http://codereview.qt.nokia.com/866 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@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
* Doc: Applied pending fixes to API documentation.David Boddie2011-05-231-4/+4
|
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+979
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