Commit Graph

16882 Commits

Author SHA1 Message Date
Friedemann Kleint
a5c288ea56 QWindowsVistaStyle: Fixed position of menu gutter when using a custom widget action.
The gutter position was hardcoded to 28 which fits when drawing
on the QMenu with a left margin of 3. It became offset when drawing
on a custom widget with no margin. Calculate position relative
to margin for left to right.

[ChangeLog][QtWidgets][QMenu][Windows] Fixed position of menu gutter when using a custom widget action.

Task-number: QTBUG-36218

Change-Id: Ibb34a9fba2bab7257482b80d2e51e76a9755345c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-22 12:12:04 +01:00
Jędrzej Nowacki
9a9e7a8215 Fix lack of deterministic behavior in moc.
Moc should check full scope of any related objects or
gadget when it constructs extra data.

Change-Id: Ibd1b607a389cd4e788c0916984464cd9103d9c59
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-22 08:27:50 +01:00
Frederik Gladhorn
46791c08e1 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-01-21 17:57:54 +01:00
Kai Koehne
b8a38a6737 Allow printf style for qCDebug, qCWarning, qCCritical macros
Add support for using qCDebug and friends in the 'printf style' way.
This allows an almost mechanical conversion of existing qDebug, qWarning,
qCritical macros, and allows avoiding the size overhead the streaming
style incurs (mostly due to inlined QDebug code).

To handle this gracefully we require variadic macros (part of
C++11/C99). For compilers not supporting variadic macros we fall back
to checking the category in QMessageLogger.

[ChangeLog][QtCore][Logging] Allow qCDebug macros to be used in a printf
style.

Change-Id: I5a8fb135dca504e1d621bb67bf4b2a50c73d41b9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 14:58:03 +01:00
Friedemann Kleint
b152b425f7 QWindowVistaStyle: Always initialize text color of menu items.
[ChangeLog][QtWidgets][QMenu][Windows] Correctly use text color set by style sheet for menu items.

Task-number: QTBUG-36142

Change-Id: I142f2fd82164771b45bf599a6afa1121fcfd2187
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2014-01-21 14:47:45 +01:00
Eskil Abrahamsen Blomfeldt
4c4f336160 Android: Remove debug output from platform window
Some debug info and a #warning had somehow made it through :)

Change-Id: I420a7637bfd5d1a79a342eacefcc35430994feff
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-01-21 14:08:09 +01:00
Friedemann Kleint
afe3902a30 Testlib: Use QString for messages in QAbstractTestLogger::addMessage()
Task-number: QTBUG-35743

[ChangeLog][QtTest][Windows] Use correct UTF-8 encoding for XML test results on platforms with different console encoding.
Change-Id: Ice9d03192098f931e5dac358928e0c4421ab715e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-21 06:28:23 +01:00
Richard J. Moore
5c19fad8c1 Ensure weak ciphers are not part of the default SSL configuration.
Any cipher that is < 128 bits is excluded from the default SSL
configuration. These ciphers are still included in the list
of availableCiphers() and can be used by applications if required.
Calling QSslSocket::setDefaultCiphers(QSslSocket::availableCiphers())
will restore the old behavior.

Note that in doing so I spotted that calling defaultCiphers() before
doing other actions with SSL had an existing bug that I've addressed
as part of the change.

[ChangeLog][Important Behavior Changes] The default set of
ciphers used by QSslSocket has been changed to exclude ciphers that are
using key lengths smaller than 128 bits. These ciphers are still available
and can be enabled by applications if required.

Change-Id: If2241dda67b624e5febf788efa1369f38c6b1dba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 03:41:34 +01:00
Robin Burchell
f81de3944d Support logging direct to journald, if enabled.
Instead of merely intercepting logging output from stdout/stderr from the
journal side of started processes, this has the advantage of meaning that the
origin process name will be correct.

fprintf won't work, because if a process starts children (like e.g. a
homescreen does), then their stdout/stderr are merged into their parent, and
journal has no way of differentiating the origin.

We are also able to store information about the context of logging, which might
be useful in post-mortem cases.

[ChangeLog][Platform Specific Changes][Linux] Systems with systemd may now pass
-journald to configure to send logging output to journald. Logging will still be
sent to stderr for interactive applications (run from a tty) or with
QT_NO_JOURNALD_LOG set to a non-empty value.

Change-Id: Ib260cec1ea87390bf44f267d217d795583407d00
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 01:59:37 +01:00
Gabriel de Dietrich
91d3298eab Fix compilation error on FreeBSD
timezone is defined differently in FreeBSD compared to other
(more or less) POSIX-compliant Unices.

Task-number: QTBUG-36080
Change-Id: I4ad1a5ccd0b9ddbadb9fdd90edc26cf0c7252dfb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-21 01:24:02 +01:00
Laszlo Agocs
6ae1c87c75 xcb: Do not leak when compressing events
The event must be freed in all cases, also when a motion or configure
notify is skipped.

Change-Id: Ie55e62d0c3ab25bd9b20cc85098ea337d0b1ac5d
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-20 19:35:06 +01:00
Laszlo Agocs
ad5577df06 Fix eglfs compilation on raspi
For some reason the Raspberry Pi hook includes qeglfscursor.h even
though it is not necessary. Remove this because the file got moved to
eglconvenience.

Change-Id: Ia65f5a8366d750f93eacee49004219e664b52af2
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2014-01-20 19:34:58 +01:00
Gabriel de Dietrich
38813a3b32 Use pkg-config to find the prefix for X11 install
Needed to run the XKB extension where we used to expect X11 to be
installed in /usr. In FreeBSD, for instance, X11 is installed in
/usr/local like all the other not out-of-the-box packages.

Same thing goes for the compose platform input context plugin.

Change-Id: Ib7ace3117eaacc6e150394450d1330cba654ba8a
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2014-01-20 19:24:39 +01:00
Frederik Gladhorn
9033977d39 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/tools/qstring.cpp
	src/gui/image/image.pri
	src/gui/image/qimage.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
	tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp

Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
2014-01-20 18:18:59 +01:00
Jędrzej Nowacki
260b0b4ed6 Rename a test class to a bit more verbose name.
That way we can avoid name conflict with a namespace defined in
a different moc test

Change-Id: Id631d7c5556c9d6940e16dc53eb438dbcd0095eb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 17:08:28 +01:00
Jędrzej Nowacki
71d265f592 Add missing header guards
Change-Id: I515313289c0a4af0f675131760ad4ccd0c6e6149
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 17:08:24 +01:00
Bartosz Brachaczek
4dfc27728e Document qRemovePostRoutine() function and update qAddPostRoutine() doc
The qRemovePostRoutine() function has been added as publicly exported
function in Qt 2.2.0 with behavior equivalent to that of today. It has
never been documented for unknown reasons, possibly simply forgotten.

This function provides needed symmetry for the already documented
qAddPostRoutine() function and is used in some real world applications.

Change-Id: Ied4709505d8335c883e9791ea634df8fb406d995
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
2014-01-20 17:06:54 +01:00
Jędrzej Nowacki
4a8ce53ad6 Remove duplicated code from moc generator
Change-Id: I0d603ac39068f796fc7397a74230d544a16e0371
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-20 16:56:13 +01:00
Jędrzej Nowacki
a88d97174e Do not close string data by a double null terminator.
There is no point in saving \0 twice. Any code that could relay on it
is broken anyway, because moc saves \0\0 for an empty string.

Change-Id: I28fa4f78aae8c883c088df43ec89d608a99b3bdd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 16:55:35 +01:00
Morten Johan Sørvig
03b6a2f0f9 Mac: Improve transformed QGraphicsProxyWidgets
Restore Mac code paths from Qt 4.

Task-number: QTBUG-29139
Change-Id: I2893ddf6015e2bda92d4a16980dbe2c9021eeef7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-01-20 14:58:48 +01:00
Christian Kandeler
bbee8ca485 Fix warning in QVariant test.
Values from different enums were compared.

Change-Id: I2faf73976e4b24abbdc915e8445256fe7a5be5bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-01-20 14:58:48 +01:00
Oswald Buddenhagen
f2d76cb524 clear OBJECTIVE_SOURCES as well
the newly added mac examples use it, so it needs to be grounded.

a more generic solution would be clearing out QMAKE_EXTRA_COMPILERS, but
many prf files will be loaded after us, possibly nullifying our effort.

Task-number: QTBUG-35680
Change-Id: I3aba7595898baac14bd41e9fae2ff24507187c6a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-01-20 14:58:48 +01:00
Eskil Abrahamsen Blomfeldt
e5e43a2386 Android: Don't crash on 100+ combo box items
Local references are valid until the original native method
returns (if it's a Java thread), or until the current thread
is detached from the VM. This means that we have to manually
manage local references and delete them when they are no longer
in use, otherwise we will leak memory and flood JNI's local
reference array.

[ChangeLog][Android] Fixed crash on populating large combo boxes
or menus.

Task-number: QTBUG-36074
Change-Id: I7095bd1472f759be98183737a8d3912fa9763f30
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-01-20 14:38:53 +01:00
Bartosz Brachaczek
7ffce3fb0b Fix cd(), cdUp() QDir member functions docs regarding nonreadable dirs
The documentation implies that cd() and cdUp() functions return false if
the new directory is not readable, but that is not the case. It is an
obvious mistake in the documentation, because cd'ing into a nonreadable
directory is perfectly valid.

Provided also with a test to verify that cd() actually returns true with
nonreadable directories.

Change-Id: I4aa3e859b35c64266df510a203574e3701aea77c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 12:20:45 +01:00
Gabriel de Dietrich
1e20115cf0 Make xcb QPA plugin link on FreeBSD
dlopen, etc. are defined in libc on FreeBSD.

Change-Id: Iad47113ec77029f8e300e4f08f454d70b3070b5a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-20 11:30:09 +01:00
Louai Al-Khanji
38d6149644 Revert commit 0893d2d7e5
Commit 0893d2d7e5 causes a lot of build
warnings on Windows with MSVC.

Change-Id: Ic857b36bf77d4f536a45cec337f4b813b9974107
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-01-20 09:45:25 +01:00
Oswald Buddenhagen
2dc98de474 introduce qlalr feature
this makes it possible to compile grammars at build time.

Change-Id: Ia74383c4f29873ee7324bd5f14d72ef14faef460
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 09:26:54 +01:00
Oswald Buddenhagen
11476aaa19 move and build qlalr
Change-Id: I852e1a33fc056a52f6dbba8aaf7dd75274bbe815
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 09:26:47 +01:00
Oswald Buddenhagen
327424d608 port to std::algorithm
Change-Id: I537b9ffc3eed0891bed0fcae3e0d79d70cc46cec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 09:26:43 +01:00
Oswald Buddenhagen
f98a96fded fix includes
use style suitable for bootstrapping. while we're at it, order the
includes the usual way.

Change-Id: I4fe96bfb73442c8a5de6dfe52d1a8c7eb22104c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 09:26:40 +01:00
Oswald Buddenhagen
e06557b596 re-import qlalr into qtbase
we have a bunch of qlalr-generated sources all over the place. it would
be much nicer to actually generate them at build time, rather than
checking them in. this obviously requires building qlalr early on ...

this commit restores the sources at their pre-modularization location
and makes no attempt at integrating them into the build process yet.
this is a measure to overcome git stupidity.

this imports qt/qlalr at commit 4071d86e82b299f26e335a7faf662b5a676e2279
with some style fixes on top.

Change-Id: I83472bc492440ecb96a8a0d5bf74cf968a1e17d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-20 09:26:37 +01:00
Thiago Macieira
08841c1c2f Don't scan system includes for dependencies and don't list them
Assume that C and C++ headers found in system paths will not change,
so we don't need to tell Make about them, nor do we need to scan their
contents either.

The previous qmake behavior matched gcc's -M switch; it now matches
the -MM switch:

       -M  Instead of outputting the result of preprocessing, output a
           rule suitable for make describing the dependencies of the
           main source file.

       -MM Like -M but do not mention header files that are found in
           system header directories, nor header files that are
           included, directly or indirectly, from such a header.

This goes hand-in-hand with our use of -isystem to pass system paths
to the compiler.

Change-Id: I3346b6da496fe6495ac89c5286d066b343116f0e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-20 02:42:31 +01:00
Thiago Macieira
0b144bc76a Add support for using -isystem in qmake
This commit will make qmake use -isystem automatically for any
compilers that declare support for it for any paths that are listed in
QMAKE_DEFAULT_INCDIRS.

Change-Id: I36fefc6d5bba61671f65669f0ea42704b3c3cf31
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-20 02:42:31 +01:00
Allan Sandfeld Jensen
6f7d370ade Make conversion of semi-transparency to opaque formats consistent
Currently the non-standard opaque formats all perform inverse premultiply
on semi transparent pixels when saving. This is only performed on RGB16
and RGB32 when explicitly converting to the formats, but not when drawing.

This patch changes the conversion to be consistent across the board so
less common formats are treated the same as the most common ones. This
also makes drawing and converting to the these formats much faster.

Task-number: QTBUG-36143
Change-Id: I877ddb1c1dbb4d2dd9b4b9192525e50375a1ae60
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-20 02:42:31 +01:00
Konstantin Ritt
31a40e5ca2 Reduce code duplication
Change-Id: I077963fcb910fa705b087e35e99cd07436c034b1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-20 02:42:31 +01:00
Konstantin Ritt
e52dca3655 Add convenience method QTextFormat::isEmpty()
Change-Id: I30e74de6853908d1fec399131637848e3c2faabe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-01-20 02:42:31 +01:00
Tor Arne Vestbø
c5192b300e iOS: Fix simulator build by enabling SSE2 code paths
Commit 3c375a76a1 enabled SSE2 in Qt,
but we failed to build the files that implemented the SSE2 specific
drawhelpers and image functions. Since we know what the iOS simulator
supports and the platforms it runs on we can safely enable this
ourselves without it being based on a configure test.

Change-Id: I0cfc43de80068b89aa47c34ffa84ee1c1734886c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-01-18 18:50:14 +01:00
Allan Sandfeld Jensen
b157a57953 Add generic inplace converter
The generic converter can easily be modified to work inplace. Such
an inplace converter can ensure we can do direct conversion between
formats of similar pixel depth.

Inplace conversion is currently only used by QPixmaps, but will be used
by ref qualified versions of QImage::convertToFormat in a future patch.

Change-Id: Idbdaf087b53deecdee8258ba0b5d80edd37cfe79
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-18 18:31:01 +01:00
Sami Liedes
0e65cec6b4 Optimize blend_transformed_tiled_argb().
Profiling indicates that this function is one of two hot spots causing
a noticeable latency when changing KDE virtual desktops.

Instead of computing two modulos per pixel in the inner loop, it is
possible to compute the modulos outside the loop and compute a modulo
sum in the inner loop for a reasonable speedup.

Change-Id: Ic4217b7686e031d7673b3e10aa977dae263096dc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-01-18 18:30:43 +01:00
Wolfgang Bremer
18c04d0ab6 QNX: Fix build on BB10 caused by missing linux fb
QNX/BB10 does not support linux framebuffer

Change-Id: Ic25f69fc16cbcd27cbaa6db08c2b6556e4def965
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-01-18 18:16:04 +01:00
Aleix Pol
446f9f2812 Fix QPixmap and OpenGL threading warnings when painting
If the QPA supports threaded pixmaps, don't print out a message warning
the user about painting a pixmap in the non-main thread.
Likewise, if the QPA supports threaded OpenGL, don't print out a warning
when the user is about to paint on OpenGL from a non-main thread.

Change-Id: I5b4928ee49b1d6c1b638b036fade12dc794258df
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-01-18 15:35:40 +01:00
Mitch Curtis
b095479d14 Fix typos in QUrl::toAce() documentation.
Change-Id: I6b101c57c537523fb48e57985e1d69c4327a67aa
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-01-18 13:21:23 +01:00
Volker Krause
ec77f93b38 Fix crash when constructing a QVector with an empty initializer list.
Data::allocate(0) returns a pointer to read-only memory, updating d->size
will segfault. The safety check for this exists in all other QVector ctors
already.

Change-Id: Ida0fe4182de56ee62c7f91e8652cfafbfd7b8410
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-18 11:16:40 +01:00
Friedemann Kleint
ab2c90cc52 Introduce function for standard button texts to QPlatformTheme.
Change-Id: I91eec04a95b5047d893490a70152237b2991f662
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-01-18 09:23:38 +01:00
Friedemann Kleint
d5912b2a47 Testlib/generate_expected_output.py: Fix encoding.
Do not apply additional encoding when reading process output.
Fixes errors when encountering UTF-8:

Traceback (most recent call last):
  File "./generate_expected_output.py", line 117, in <module>
    generateTestData(path)
  File "./generate_expected_output.py", line 106, in generateTestData
    out.write(data.decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 5485: ordinal not in range(128)

Change-Id: Ib827787a59a18b4d3d0601645856517f43c01fc3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-18 09:20:24 +01:00
Friedemann Kleint
f504287e80 Testlib/generate_expected_output.py: Pass tests as command line arguments.
Evaluate command line arguments and use directories only when empty.

Change-Id: I818ec13c686018a3f607e91174e57d8f8bbf15f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-01-18 09:19:38 +01:00
Olivier Goffart
eae8abbc18 Fix detecting the system path
The normalize function don't do well it's job.
Given a path like that,  the regexp "/[^/]+/.."  will match 3 times
 /usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../include/c++/4.8.2
                                      [       ][    ][         ]
The second match is wrong as it will remove /../..

Use sub instead of gsub which only remove one match at the time.

Change-Id: I0657bc603e521c9e53b9f50d2481dce184b64bad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-01-18 09:18:01 +01:00
Sergio Ahumada
e0484dca75 QNX: Fix compilation of qdatetime.cpp
Adding std:: to pow() to make it compile for BlackBerry 10.

Change-Id: I9ab3cc626eb2ba872c09df33cdb820b50d075428
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-18 07:19:31 +01:00
Roger Maclean
30e677e2bb QNX: Allow creation of parentless child windows
There is no reason why a parentless window from a Qt perspective needs
to be a screen application window.  There are some cases, such as the
BB10 dialog service whose windows are always parented by a window in
another process.

Ideally one would have a means to indicate a child window was wanted that
had no other side effect (i.e. the rest of Qt would ignore).  The use of
Qt::Dialog is not ideal as some code does pay attention to this type given
the number of bits available for window type, it is not reasonable to add a
new one.  The use of Qt::Dialog seems safe since it is hard to conceive of
a window of type Qt::Dialog wanting to be a top level window.  If in future
it is required to have a parentless, child window that is not of type
Qt::Dialog one can simply define some additional way of signalling this.

Change-Id: Ie7035980ac2efd5bc722a8371c834f21ea7755f4
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-01-18 04:39:25 +01:00
Thiago Macieira
5fcee88097 Abuse const_cast in QStringBuilder to get a little more performance
Without this const_cast, the call to QString::data() or
QByteArray::data() will cause a call to detach(), which is totally
unnecessary since we've just allocated data a couple of lines before.
Since we know we're the owner of the only reference, we can skip the
detach attempt.

Change-Id: If40f66100f85cc9b405025f21c562828ead23475
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-01-18 04:39:23 +01:00