Commit Graph

6441 Commits

Author SHA1 Message Date
Thiago Macieira
e6a1675da5 Make plugin linking fail if some references aren't present
It's better to fail at linking time than to try and figure out later why
QPluginLoader refuses to load the plugin.

Change-Id: I439bad9dcdbfff9f76efe40381fd7ccfffe738bc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-04-10 18:22:51 +02:00
Oswald Buddenhagen
143c4d3e13 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	configure
	src/widgets/styles/qwindowsxpstyle.cpp
	tests/auto/gui/kernel/qwindow/qwindow.pro
	tests/auto/gui/kernel/qwindow/tst_qwindow.cpp

Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
2012-04-10 15:31:45 +02:00
Konstantin Ritt
933a1d2274 remove CODEC_FOR_C_STRINGS leftovers
Change-Id: Iaafb945882e3f6ad6d39f7eefb62b83ff50a9ba8
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-10 15:03:16 +02:00
Olivier Goffart
2dca19b44e Document QEvent::ThreadChange
That event is mentioned in the documentation of QObject::moveToThread,
but not in the documentation of QEvent::Type

Task-number: QTBUG-16787

Change-Id: Iab769307d3de54881a82e59bed63b3831a3ffb29
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-04-10 15:03:16 +02:00
Jason McDonald
a869234593 Remove Qt5 to-do comments in qtextformat.cpp.
These won't be done for Qt 5.0 and to-do tasks really belong in a
bug-tracker not in the code.

Task-number: QTBUG-25072
Change-Id: Ife4ff148167e0f0c66a58233548f4011b0b10784
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-10 15:03:16 +02:00
Miikka Heikkinen
ef4783d297 Make it possible to enable non-scalable font scaling
Windows native font engine supports scaling of non-scalalble fonts, so
make it possible to do so.
Added two functions to QPlatformFontDatabase: fontsAlwaysScalable() and
standardSizes(), and made fontsAlwaysScalable() to return true for
Windows native font database.

Windows Freetype font engine doesn't seem to support scaling of
non-scalable fonts, so didn't enable it in there.

Added implementation of standardSizes() for Mac OS.

Task-number: QTBUG-24970
Change-Id: I41c9356ede8a37b7c61db94340dbeb5b629f34b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-04-10 12:49:34 +02:00
Pierre Rossi
a159ca80d7 Don't hardcode the default families in qfont_qpa.cpp
Since different platforms come with different fonts, we should
probably leave it up to the platform to decide which family to use.

Change-Id: I18bb81c0ce87cc7e9ac7f3abaeae1b41c0ce8410
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-04-10 12:49:34 +02:00
Andrew den Exter
5a02c2115c Fix crash with invalid pre-edit position.
Ensure the script item position is within the bounds of the text block
when adjusted to compensate for pre-edit text.

Change-Id: I2c745bf08afc0d9bc3aba27c24c2a123af017dc6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-10 10:38:10 +02:00
Girish Ramakrishnan
efdadbb3d6 Remove unused signal QWindow::backBufferReady
backBufferReady is not used anywhere

Change-Id: Ic5c8f6a89e031b3bd757b03f60737d55be969ee5
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-10 10:38:10 +02:00
Rafael Roquetto
00f3299e8b Blackberry OS implementation of QStandardPaths
Change-Id: I31427b896ca691de7071da17af4863d16348df7b
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-10 10:38:10 +02:00
Andy Nichols
2756101d0e Fixed build issue when using GLEW with MSVC
MSVC does not support the #warning precompiler command and
is considered an error when used. This change checks for
GCC before issuing the warning.

Change-Id: Iee1e27841fe77b0289e88b7b4ccaa176ab56a39d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-10 10:38:10 +02:00
Girish Ramakrishnan
673ce6c84e eglfs: Implement xlib based hook for testing
Add a hook implementation for X11 using xlib. This is primarily for testing.
xcb is not used since the x11/egl-mesa integration appears to be done through
xlib.

Currently, there is no input mechanism. The size can be adjusted using
EGLFS_X11_SIZE environment variable.

Change-Id: Ifcfbfd958d9d110d94e22f04dfad1f6c29818103
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-10 10:38:10 +02:00
Donald Carr
2ee8b98cae Remove QWS era pvr headers
The QWS powervr plugin ceased to exist with the move to QPA; these headers
are therefore entirely redundant

Change-Id: I28c7baae15df5bb9d7ea3763e3a018e9e1ae1fc6
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-10 10:38:10 +02:00
Girish Ramakrishnan
c75ef6e223 Fix header inclusion guards
The inclusion guards refer to the old graphics system code

Change-Id: Ifa72e3030c83797e471735a9a696bf12c0f75b08
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-04-10 08:26:10 +02:00
Girish Ramakrishnan
300ce31d70 Fix constness of QPlatformCursorImage::hostpot()
QPlatformCursorImage::hotspot() should be const.

Change-Id: I2b517098e75b013947386a5a620a15dc48e76cec
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-04-10 08:25:51 +02:00
Marc Mutz
39b4578156 QTypeInfo: document Q_PRIMITIVE_TYPE existing practice
Despite the documentation requiring Q_PRIMITIVE_TYPEs to
be PODs, existing practice in Qt (QFixed, QFlags, QUuid)
is to allow constructors on primitive types as long as
every bit pattern represents a valid object (ie. memory
doesn't have to be initialised to hold an object of the
type) and memcpy() can be used to create an independent
copy of the object (memcpy()ing QString, e.g., while
creating two valid objects, doesn't create independent
copies).

Change-Id: Ia85d48b89f6cc84e69ea76719eab9a858d247ad6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-09 12:54:49 +02:00
Marcel Krems
a7ed81b557 Removed QApplication overloads used solely for documentation.
Also removed a define which was used only for this purpose.

This change brings the constructors in line with Q{Core,Gui}Application.

Change-Id: I1134ca5611453e8445c1a4f3226846621fa8872c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-09 12:54:29 +02:00
Giuseppe D'Angelo
4893a5422e New qHash algorithm for uchar/ushort arrays (QString, QByteArray, etc.)
Port of Robin's work from I0a53aa4581e25b351b9cb5033415b5163d05fe71
on top of the new qHash patches (the original commit just introduced
lots of conflicts, so I redid it from scratch).

This is based on the work done in the QHash benchmark over the past
few months experimenting with the performance of the string hashing
algorithm used by Java.

The Java algorithm, in turn, appears to have been based off a
variant of djb's work at http://cr.yp.to/cdb/cdb.txt.

This commit provides a performance boost of ~12-33% on the
QHash benchmark.

Unfortunately, the rcc test depends on QHash ordering.
Randomizing QHash or changing qHash will cause the test to fail
(see QTBUG-25078), so for now the testdata is changed as well.

Done-with: Robin Burchell
Change-Id: Ie05d8e21588d1b2d4bd555ef254e1eb101864b75
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-09 10:16:09 +02:00
Giuseppe D'Angelo
ddb70bee2f Stop relying on qHash always giving the same results
The implementation of the various qHash overloads offered by
Qt can change at any time for any reason
(speed, quality, security, ...).

Therefore, relying on the fact that qHash will always give
an identical result across Qt versions (... across different
processes, etc.), given identical input, is wrong.
Note that this also implies that one cannot rely on QHash
having a stable ordering (even without the random qHash seed).

For such use cases, one must use f.i. a private hash function
that will never change outside his own control.

This patch adds a private hash function for QStrings,
which is identical to the Qt(4) qHash(QString) implementation.
A couple of spots in Qt where the results of a qHash call were
actually saved on disk are ported to use the new function,
and a bit of documentation is added to QHash docs.

Change-Id: Ia3731ea26ac68649b535b95e9f36fbec3df693c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-08 21:44:26 +02:00
Giuseppe D'Angelo
ea17c21fd8 QHostAddress: improve qHash implementation
Avoid the conversion to a temporary QString -- just hash the address
as a byte array.

Change-Id: Ic35cdbbc3ee66c32a28d911bd27de0092395979f
Done-with: Shane Kearns
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-08 18:25:10 +02:00
Giuseppe D'Angelo
9166163f10 QUrl: added two-arguments qHash support
An unnecessary #include <QHash> was also removed, and other
includes refactored.

Change-Id: Ifcd3e37d75029c142a2e55ab492b88624505670a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-08 18:25:04 +02:00
Giuseppe D'Angelo
c3b9a67cf0 More qHash(T, uint) overloads for Qt types
The more we get in 5.0, the better.

Change-Id: If00084477709db4fc3f6b2e15024d046491be2ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-07 22:20:19 +02:00
Giuseppe D'Angelo
e6e4456de0 QFileSystemModel: fix sorting
When sorting a model recursively, the children of a QFileSystemNode
are extracted from their parent in a QHash order; then filtered,
then sorted (using a stable sort) depending on the sorting column.

This means that the order of the children comparing to equal for
the chosen sort are shown in the order they were picked from the
iteration on the QHash, which isn't reliable at all.

Moreover, the criteria used in QFileSystemModelSorter for sorting
are too loose: when sorting by any column but the name, if the result
is "equality", then the file names should be used to determine
the sort order.

This patch removes the stable sort in favour of a full sort,
and fixes the criteria of soring inside QFileSystemModelSorter.

Change-Id: Idd9aece22f2ebbe77ec40d372b43cde4c200ff38
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-07 19:45:39 +02:00
Thiago Macieira
7ae76153cb Remove -DQT_NO_STL from the bootstrapped builds
Change-Id: I37ea06426b66e617a49ec46952abdaad8814eadf
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-04-07 05:19:56 +02:00
Thiago Macieira
9dde45722b Remove references to QT_NO_STL from QtConcurrent
Same as with QtCore, remove the #ifdef and #ifndef and select the side
with STL.

Change-Id: If1440080328c7c51afe35f5944a19dafc4761ee5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-04-07 05:19:50 +02:00
Thiago Macieira
6f51fee995 Remove references to QT_NO_STL from QtCore
QT_NO_STL is now no longer defined, so remove the conditionals and
select the STL side.

Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-07 05:19:42 +02:00
Giuseppe D'Angelo
1241a02a01 qHash: always use the seed in the catch-all template
This pertubates the results of the calls to the one-argument
version of qHash through the catch-all template.

Change-Id: I7037b25d545e6f1360384a83ff895f4bb62ed195
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-06 22:51:24 +02:00
Giuseppe D'Angelo
9ddb822a86 Add test for qHash(QByteArray)
Two equal QByteArrays must return the same hash.

Change-Id: Iddd45b0c420213ca2b82bbcb164367acb6104ec8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-06 15:16:40 +02:00
Giuseppe D'Angelo
10747da77d Add test for qHash(QString) / qHash(QStringRef)
Two equal strings / stringrefs must return the same hash.

Change-Id: I2af9a11ab721ca25f4039048a7e5f260e6ff0148
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-06 15:16:23 +02:00
Sean Harmer
1c20c3f294 Moving stack-smashing protection to the Blackberry mkspecs
It transpires that QNX 6.5.0 does not yet have libc support for the
gcc stack smashing protection.

Change-Id: Ic635662b6aa3ce2fad5f69e236386ae9ace420db
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-06 00:02:45 +02:00
Marcel Krems
4bdb7a0780 Fix compilation with MinGW.
Change-Id: I494c84e8e6889a7d7bb3b29669337483732d02c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 23:54:37 +02:00
Giuseppe D'Angelo
538386f36f QLatin1String: add qHash overload
It was never introduced in Qt 4, probably because of the implicit
conversion to QString (that is, adding the qHash overload for
QLatin1String in Qt 4 would have been a BIC).

Change-Id: I2ebc8e73a85be497866820e0ca416dd11167bb53
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-05 20:48:53 +02:00
Debao Zhang
bdfff4d825 Fix compilation with MinGW-W64.
These types and values and been defined propsys.h from MinGW-W64
Version2 on.

Change-Id: If74b7cf07a0fce414009c86519494a782508d8fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-05 20:45:02 +02:00
Friedemann Kleint
fddbe8beec Windows: Send empty region in expose event from setVisible(false).
Fixing a crash in tst_qwidget.cpp, trying to redraw on destroying
the platform window.

Change-Id: I6b6e9a063a1c72dff8110c379f8392605aadbdd6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-05 17:48:15 +02:00
Joerg Bornemann
0174c966f7 qmake vcxproj generator: properly escape XML attributes
Task-number: QTBUG-24954

Change-Id: I21299440ba3f268c2fa1e14d37003cdc3e6a35ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-05 17:48:15 +02:00
Shane Kearns
e5337ad1b1 Find libssl on linux using paths of loaded libraries
The installed path of libssl may include an element describing the
architecture, e.g. x86_64-linux-gnu or i386-linux-gnu.
In most cases, the libraries already loaded (static dependencies of
Qt, such as libc) will include the path where libssl is installed.

Use dl_iterate_phdr to find the paths. This is a linux specific
function, but it does provide "/lib/<arch>" and "/usr/lib/<arch>"
at the point ssl symbols are being resolved when running the
qsslsocket autotest (which has less dependencies than a typical
Qt app).

Task-number: QTBUG-24694
Change-Id: I9af8081f41bb85c2fcff450a2acda5672a7f7518
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2012-04-05 15:37:53 +02:00
João Abecasis
2d89850b23 Enable variadic macros for MSVC >= 2005
Change-Id: I8793ea0f6e3a640276b073321d29373b2ed18d63
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-05 15:23:30 +02:00
Friedemann Kleint
76ae64abb5 Windows: Use native font engine by default.
Turn around the meaning of the command line parameter.
The FreeType engine can now be activated by passing freetype.

Change-Id: I9da6cd4a127603f9cfb91f0ce8450088c0883faa
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-05 12:46:31 +02:00
Pekka Vuorela
95c71cef20 Include with qt module to avoid configure warning
Change-Id: I8d338f22c4b0dabcca33878b33c6a203828d84c5
Reviewed-by: David Faure <faure@kde.org>
2012-04-05 10:18:41 +02:00
David Faure
4a11611c8a Fix unittest for QStandardPaths::enableTestMode
It was confusing DataLocation and GenericDataLocation, and the same
for CacheLocation and GenericCacheLocation. The test was passing in
the api_changes branch because these were giving the same result
(empty app name), but the QCoreApplication::applicationName fix in master
makes these different, so the bug in the test showed up after merging.

Change-Id: I80ef6883c96cfd02b8c277d9d686717028d396bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 10:15:21 +02:00
João Abecasis
b143a65728 Add zero-termination checks to QString and QByteArray tests
This uses an alternative approach to the testing formerly introduced
in 4ef5a626. Zero-termination tests are injected into all QCOMPARE/QTEST
invocations. This makes such testing more thorough and widespread, and
gets seamlessly extended by future tests.

It also fixes an issue uncovered by the test where using a past-the-end
position with QString::insert(pos, char), could move uninitialized data
and clobber the null-terminator.

Change-Id: I7392580245b419ee65c3ae6f261b6e851d66dd4f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-05 08:19:14 +02:00
João Abecasis
e1626bf038 Revert "Add tests to verify QByteArray's zero termination"
The approach used to verify for zero-termination is too intrusive and
requires additional maintenance work to ensure new zero-termination
tests are added with new functionality.

Zero-termination testing will be re-established in a subsequent commit.

This reverts commit 4ef5a6269c.

Change-Id: I862434a072f447f7f0c4bbf8f757ba216212db3c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-04-05 08:19:03 +02:00
Charles Yin
e90304387b Fixed an exit crash that could occur in QQuickPixmap.
The global destructor for the clean up hooks might be called before the
global destructor for QQuickPixmapCache objects.

This is an additional fix for QTBUG-8681

Task-number: QTBUG-8681
Change-Id: I8694a7a246980f488aef78071c613e3a908c7db3
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-05 08:14:36 +02:00
Thiago Macieira
5a1cd3dcfa Make QLocale::toULongLong return the proper type: qulonglong
Task-number: QTBUG-25143
Change-Id: Ia8fd588c25d11fe31acd57fd34a90d51dace248c
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-04-05 05:21:58 +02:00
Thiago Macieira
e915d31010 Get rid of QKeyEventEx
This class was added when we needed more information in QKeyEvent but
couldn't extend it. And we couldn't use the d pointer because the copy
constructor and copy assignment operators in QEvent were
implicit. That is now fixed.

But since this is Qt 5, we can change QKeyEvent to include the extra
information.

Task-number: QTBUG-25070
Change-Id: Iba4ac3378ca70583fcaa8caf96bca8ef75e30701
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-04-05 05:21:42 +02:00
Debao Zhang
8c4a17aace Remove macro _POSIX_ from Win32 special file
Macro _POSIX_ doesn't used by this two files. And it will casued compile
errors under VS2005/VS2008/VS2010 such as:

Error 19 error C3861: ‘_fileno’: identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 443
Error 20 error C3861: ‘_fileno’: identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 468
Error 21 error C3861: ‘_fileno’: identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 607

when we don't use precompiled headers. And this error will triggered when
we reomve QT_NO_STL from QtCore.

Because stdio.h declares fileno instead of _fileno when _POSIX_ is
defined.

Change-Id: I9d9031578dac7b7c5f7b77098839723a4bc8bfdf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 05:21:04 +02:00
João Abecasis
b3f12ea1d4 Don't allocate space for null when using fromRawData
In this case we only need to allocate space for the "header" data.

Change-Id: I059627e47a5bae7a02c82d837c826a6ed0fd20fd
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 01:45:24 +02:00
João Abecasis
98e50a18ed Simplify conditionals
alloc >= size is an invariant of both QString and QByteArray, unless
string data is immutable (e.g., when using fromRawData()), in which case
alloc will be 0, regardless of size, That's what needs to be checked
here.

Change-Id: Ief9e6a52a1d5ea1941d23ed3c141edfd15d2a6a7
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 01:45:10 +02:00
João Abecasis
3669ceb779 Rename realloc -> reallocData
This avoids confusion with standard ::realloc.

Change-Id: Ibeccf2f702ec37161033febf4f3926bee8f7aea6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 01:44:46 +02:00
João Abecasis
e5d10b2a3b Move growth computation to re-allocation function
Callers of QByteArray/QString::realloc() are still responsible for the
heuristics and decide whether to provide the "grow" hint, but
computation is centralized there.

With this change we also ensure growth takes into account the
terminating null. Previously, calls to qAllocMore took into account
header and string size, for left out the null, meaning we ended up
allocating ("nice-size" + Null).

Change-Id: Iad1536e7706cd2d446daee96859db9b01c5f9680
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-05 01:44:34 +02:00