Commit Graph

14540 Commits

Author SHA1 Message Date
Peter Seiderer
72ecf5a7ec Remove QDBusPendingCallPrivate::autoDelete logic.
First step to fix race condition about deleting QDBusPendingCallPrivate.

In a multithreaded application on a slow/single core cpu the following
race (and segmentation fault) can occur:

First thread A is running:
A:  QDBusPendingReply<> reply = pi->asyncCallWithArgumentList(method, argumentList);

Then when the dbus answer arrives thread B will call:

B:  QDBusConnectionPrivate::processFinishedCall()
B:      ...
B:      locker.unlock()

and runs until here, go on with thread A:

A:  reply.waitForFinished();
A:    QDBusPendingCallPrivate::waitForFinished()
A:    {
A:        QMutexLocker locker(&mutex);
A:        if (replyMessage.type() != QDBusMessage::InvalidMessage)
A:            return;

which returns immediately (mutex acquired, replyMessage alread set), now
reply goes out of scope (destructor called) and QDBusPendingCall::d's
destructor of type QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
deletes the reference counted object QDBusPendingCallPrivate.

Now thread B continues, still in processFinishedCall()

B:      if (call->watcherHelper)
B:          call->watcherHelper->emitSignals(msg, call->sentMessage);
B:
B:      if (msg.type() == QDBusMessage::ErrorMessage)
B:          emit connection->callWithCallbackFailed(QDBusError(msg),
B:              call->sentMessage);

accessing alread deleted object QDBusPendingCallPrivate via call->...

Fixed QDBusPendingCallPrivate deletion by proper reference counting
will be done in the next commit.

Task-number: QTBUG-27809
Change-Id: I15b3f0242471b62eaafadc763fb6a33339ff2fe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-29 22:28:41 +02:00
Peter Seiderer
64e3bd481e Fix unprotected access to QDBusPendingCallPrivate::pending.
In QDBusConnectionPrivate::waitForFinished() pcall->pending was used
after the protection by pcall->mutex was released. A simultaneous
call to QDBusConnectionPrivate::processFinishedCall() was able
to reset pcall->pending to null before it was used for the
q_dbus_pending_call_block(pcall->pending) call.

Fixed by releasing (and setting to 0) of pcall->pending in
processFinishedCall() only in case no one is waiting yet, otherwise
release pcall->pending by the first thread waiting in waitForFinished().

There is still a race condition about deleting QDBusPendingCallPrivate
(too early) which will be fixed in the next two commits.

Task-number: QTBUG-27809
Change-Id: I040173810ad90653fe1bd1915f22d8dd70d47d8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-29 22:28:12 +02:00
Bernd Weimer
cebac1ae2f Avoided zero devision in cube root approximation
Halley's method to get a better approximation is omitted, if it
would include a devision by zero (INFINITY/NaN is worse).

Change-Id: Ida09326e2b5892d7cb21bcb956631c289e5b56ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-29 19:29:15 +02:00
David Faure
4237faf580 Uic: remove unused option -3
Change-Id: I2ded3a3c90eea0ae37619ff39a8111a589c4573b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-07-29 19:10:25 +02:00
Peter Hartmann
af96c6fed9 QHttpMultiPart: fix data corruption in readData method
When readData() is called repeatedly, we need to keep track which
part of the multipart message we are currently reading from.
Hereby we also need to take the boundary size into account, and not
only the size of the multipart; otherwise we would skip a not
completely read part. This would then later lead to advancing the
read pointer by negative indexes and data loss.

Task-number: QTBUG-32534
Change-Id: Ibb6dff16adaf4ea67181d23d1d0c8459e33a0ed0
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2013-07-29 18:08:59 +02:00
Eskil Abrahamsen Blomfeldt
9eeb1bd4d4 Add workaround for GL on Android emulator
On the Android Emulator, the shaders will be compiled by a desktop
GL driver, since the GL driver in the emulator is just a thin
wrapper. The GL driver does not necessarily support the precision
qualifiers, which can cause applications to break. We detect this
at runtime in the platform plugin and set a workaround flag to

Task-number: QTBUG-32557
Change-Id: Ied00cfe8e804d1f7862697dd379a14f3bed3d980
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-07-29 17:58:30 +02:00
Frederik Gladhorn
32e6778bda Stop unconditional synth of mouse events on Android
Before this patch we always send mouse events for each
touch event that happens.
This is redundant (we already synthesize in
QGuiApplicatioin) and breaks some touch handling
in QtQuick2.

Change-Id: I4bc1686a7a46039901315619a0acdf2888ad6775
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-07-29 17:58:30 +02:00
Allan Sandfeld Jensen
de8567991f Fix fillRect on RGBA8888 images
The fill color was not correctly converted before being filled into
RGBA8888 images. This patch adds a function with convertion and
adds tests for it to tst_qpainter.

Change-Id: If8b0e6db38b2794a60301842e25f377eb7216796
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-07-29 16:10:53 +02:00
Paul Olav Tvete
591584d9a9 Android: Get SSL root certificates from TrustManager
On Android, when not using Ministro, we cannot read certificates
from the file system, so we have to get them through Java APIs instead.

Change-Id: I415329fcb45836735c1112dbe832214b3c73dc9a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-07-29 15:38:51 +02:00
Friedemann Kleint
71535ad6bc Build offscreen plugin only if freetype is available on Windows.
Task-number: QTBUG-29685

Change-Id: I0d80437d07ad7f9e11343bfa7afbdeb30583f8c5
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2013-07-29 15:38:51 +02:00
Michael Brüning
3693ada1a6 Fix text being cut off at the right side in print preview.
This patch now also copies the state of the QPainter returned from
QPaintEngine::painter for the first page of a print preview, as it is
done for all other pages of a preview in QPreviewPaintEngine::newPage().

Task-number: QTBUG-30621
Change-Id: I50001231c4006b9627ff80504618cbe0fa6d9f65
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-07-29 15:38:51 +02:00
Topi Reinio
ee8b7466bc Doc: Re-highlight Tweet Search demo
The Qt Quick demo Tweet Search works again, add it back as
one of the highlighted examples.

Task-number: QTBUG-31745
Change-Id: I4fc7d1a836159e9bb54fcd9e1a9c2760d97aa80a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-07-29 15:08:58 +02:00
Mitch Curtis
4f7727d861 Correct QHash::values() documentation.
Change-Id: Ia19bd0578591f77e5aee1c7e3e619ba97754f384
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-07-29 12:08:23 +02:00
Simo Fält
456a4740cc Mark tst_exceptionsafety as insignificant
We're rolling back exception safety support

Task-number: QTBUG-32642
Change-Id: I25f20b554a93f25d00cca19b3e308d6cc8fe85e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-29 05:19:12 +02:00
Giuseppe D'Angelo
5b9006bbdb Implement move-ctor and move-assignment-op for QScopedPointer
It makes sense for a QScopedPointer to be movable, for instance
for allowing instances to be returned from a function.
Ownwership of the managed pointer is still tied to one (and one only)
QScopedPointer instance.

Moreover, a move assignment operator makes sense as well, as it
implementing the equivalent of

  this->reset(other.take());

only when other is a rvalue and not a lvalue (so either it's a temporary
or it's getting explicitly moved in with std::move).

This makes QScopedPointer API's a bit closer to std::unique_ptr's one.

Task-number: QTBUG-29754
Change-Id: If1ac0c688327a67af4ad5b7ad45b439b022ed1c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-28 23:09:10 +02:00
Marcel Krems
64dd24ae07 Remove duplicated call to QGraphicsSceneMouseEvent::setButtons.
Task-number: QTBUG-8061
Change-Id: I1326d6b3d6c6b7c3f6dc383aa5fe66d5e1f0b229
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2013-07-28 18:24:42 +02:00
Sergio Ahumada
d013eb055c Merge remote-tracking branch 'origin/release' into stable
Change-Id: Ic5a232260a6c8ee71f9ff91e820f54c36ab6b15a
2013-07-26 21:49:42 +02:00
Peter Hartmann
69b31f7b65 QNX: adapt SSL lib file name lookup heuristics
I.e. do not try to load file names that are not there anyhow. The
code would search for libcrypto.so.1.0.0 and libssl.so.1.0.0, while
on QNX the libs are called libcrypto.so and libssl.so, and there
are no symlinks with version numbers.

This saves ~ 45 ms in real apps (tested with Facebook, Twitter and
Foursquare), and ~ 24 ms at app startup in an isolated app without
GUI (difference maybe because threads are fighting for CPU or so).

Task-number: QTBUG-32548
Change-Id: I25869538bbfa3c2848541415e8361e0bd7a8fd50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-26 17:14:44 +02:00
Allan Sandfeld Jensen
9fabb548da EGLFS and MinimalEGL windows are not marked as OpenGL surfaces
Several QOpenGLContext methods fails incorrectly on QWindows from EGL or
MinimalEGL. This is happens because they are incorrectly marked as raster
surfaces instead of OpenGL surfaces.

Change-Id: Ic9b3859915a9049fce442216b01dce89521fa5ee
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-07-26 16:59:48 +02:00
Sergio Ahumada
06b6061b43 test: Remove insignificant mark from tst_qfilesystemmodel
Tests are passing nowaways on OS X.

Task-number: QTBUG-27890
Change-Id: I6a0a881ece844ef931cb8af51b58d33c40be4d2c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-07-26 14:47:47 +02:00
Sergio Ahumada
5d51634b4e Android: Add QT_NO_PRINTER to DEFINES
Printing is not enabled for Android.

Change-Id: I5f589a036355fd63a7616fd57eeba1354d91281b
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2013-07-26 12:21:35 +02:00
Peter Hartmann
28ff65f4dc QNX: hardcode on-demand SSL root cert loading
The c_rehash'ed symlinks are always there on QNX, so no need to check
at every app start for the feature. This saves ~ 17ms at each app
start.

Task-number: QTBUG-32549
Change-Id: Ia9df60aba9d1bd70868b7004b847867a2128f600
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-07-26 09:52:29 +02:00
Friedemann Kleint
4b33461455 Fix updating of screens in QDesktopWidget.
Task-number: QTBUG-32567

Change-Id: Ib7442aed518427aa995cfc365ade6e6ffaf9c428
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-07-26 06:31:33 +02:00
David Faure
1aa4ad46e4 QUrl: add matches(url, options) method.
Change-Id: I534f494aecc48cc2accfcfcb692f35046250b493
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-26 04:47:18 +02:00
Friedemann Kleint
15b45c608f XCB: Readd support for -name command line argument.
Task-number: QTBUG-27349

Change-Id: I85390942927cd1c54f76fd7ddc0f3487c7205b57
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-07-25 15:09:51 +02:00
Friedemann Kleint
d7e37537d4 Reintroduce -geometry command line argument for X11/XCB.
Add parsing for the window geometry specification to
QGuiApplicationPrivate. Enable the argument under a different
name for the other platforms as well.

Task-number: QTBUG-27349
Change-Id: I973b2c69f5172f7d0bc983b8ba4b0d164649ef02
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-07-25 15:06:46 +02:00
Martin Smith
5ec0804583 qdoc: Don't try to output from index nodes
When qdoc traverses its internal node tree to generate
either the html docs or the help file, it no longer
traverses nodes that were added to the tree as the result
of reading an index file.

Task-number: QTBUG-32622
Change-Id: Iac63ac2ce177b15b85a2aa73850c45891cbbc624
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-07-25 12:23:22 +02:00
Simo Fält
34d2abe309 Fix for tst_qundogroup autotest in shadow build
Added full path to src dir for testdata.

Task-number: QTBUG-32535
Change-Id: I38e96216e9a016869151adf0ae995e068b8b5354
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2013-07-25 11:32:29 +02:00
Simo Fält
651a03b0dd Fix for tst_qundostack autotest in shadow build
Added full path to src dir for testdata.

Task-number: QTBUG-32536
Change-Id: I5ef215d451a6407c277d2c98f21ffc35a8657e28
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-07-25 11:32:19 +02:00
Uli Schlachter
ec2aa7d282 xcb: Fix minor leaks in XSettings code
If some of the X11 requests fail, QXcbXSettings::QXcbXSettings() prints a
warning and returns. These error paths all caused memory leaks.

Change-Id: Idfecf03dd412c35552c3bbbebdda9c039aeadc13
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-07-25 11:25:42 +02:00
Wouter Huysentruit
4acff670c5 Configure: add -no-wmf-backend option
This option is required to build qtmultimedia without
Windows Media Foundation backend. In this case,
a full DirectShow backend will be build instead.

Change-Id: Ib29ba81ca6cbb00b609cc97fab7da29e61d31d6d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
2013-07-25 07:59:40 +02:00
Shawn Rutledge
03855decfc QPrintDialog OSX: don't crash if ApplicationModal and no parent
Task-number: QTBUG-32464
Change-Id: I5ee2741735255254c17555dfb977ce73941d3e22
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
2013-07-25 05:43:35 +02:00
Friedemann Kleint
97378dc70e Re-enable tests tst_qgraphicsproxywidget, tst_qgraphicswidget.
Task-number: QTBUG-25294
Task-number: QTBUG-20778

Change-Id: I6b6e19e812d5527465c6162e2df2e4807cf160da
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2013-07-24 22:16:58 +02:00
Tomasz Olszak
f2a611ce6c Fixed mkspecs/devices/linux_device_post.conf for non-arm platforms.
Now arm specific -mfloat-abi flag is added to compiler flags
only for arm architecture in linux_arm_device_post.conf.

Change-Id: Ie77ac6e0717d9d1fd9c14e1d6a26e86f08ab418c
Reviewed-by: Jarosław Staniek <staniek@kde.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-07-24 18:58:24 +02:00
Sergio Ahumada
509ed01c85 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-07-24 15:09:38 +02:00
Kevin Ottens
288e50227d Add the RFC2822Date format
QDateTime can now be converted to strings compliant to RFC 2822.
Additionally, it supports RFC 850 and RFC 1036 during parsing.
By having them all together, all type of dates found in exchanged
messages on the internet (including USENET) get supported.

Change-Id: I771066c23f409d20b31b7d802f37852ea68ca2a0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-07-24 15:02:35 +02:00
Bernd Weimer
828c034f1e BlackBerry: Rearmed socket notifiers after select
Socket notifiers that are registered with BPS are disabled by a call to
select. This solves the echoTest2 test case of QProcess.

Change-Id: Ic7f3f14433477b89eaad5ffbeb6c22a1b5c2e910
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-07-24 14:51:35 +02:00
Peter Hartmann
78f9f4b497 HTTP internals: do not access reply that was deleted already
... rather than crashing.

Task-number: QTBUG-32404
Change-Id: Ia2f938394fb451459564ef5966419f952b3e2d0e
Reviewed-by: Richard J. Moore <rich@kde.org>
2013-07-24 14:30:41 +02:00
Topi Reinio
3f95ae8e2f Doc: Update documentation of Qt::HANDLE
Qt::HANDLE is always defined as 'void *' on Qt 5.0

Task-number: QTBUG-32469

Change-Id: I3f0f2b19e65d54c88604e1cb65b5791c456b3003
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-07-24 14:30:30 +02:00
Stephen Kelly
880f73d1f0 Use absolute path in the /usr move workaround if -libdir is specified
Change-Id: I68d087b15839418008db5bf1c0c76ca303245519
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-07-24 11:54:21 +02:00
Stephen Kelly
9b7adfa081 Move the cmakeRelativePath function to cmake_functions.
Task-number: QTBUG-32570

Change-Id: I05bbf7084ef8501bf17698f2ecc1cf3d8fd4d460
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-07-24 11:54:18 +02:00
Stephen Kelly
27313d1244 CMake: Add a clean_path before returning a path.
The $$path may already be absolute, so prepending a slash may
result in //usr/lib, for example.

Task-number: QTBUG-32570

Change-Id: If7a4f6fbec0216404cfe48c1da62d21d75b3e272
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-07-24 11:54:14 +02:00
Stephen Kelly
37ab8b4ed7 CMake: Remove copy-pasto for the IMPORTED_LOCATION
Task-number: QTBUG-32579

Change-Id: Ibe9dd92824091989168fca842a59b556937b1f08
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-07-24 11:54:11 +02:00
Friedemann Kleint
77833b90c8 Fix crashes when invoking toVariant() on empty QJsonValue objects.
Change-Id: I51cd114e862c6fad564484e990348f324ad56ab9
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-07-24 10:56:07 +02:00
Friedemann Kleint
0edf1390ca Windows: Mark window margins as dirty when the theme changes.
Task-number: QTBUG-31523

Change-Id: Ibd8ed4e3fc5b6d1723f94dc32b3bf86b74e71020
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-24 10:55:59 +02:00
Shawn Rutledge
bd602a2dc4 QPrintDialog: document the modality on OS X and Windows
You can't programmatically close the dialog because it's modal.

Task-number: QTBUG-32464
Change-Id: I2f24581dc660a088b4e741fa4ee1518e27adea4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-07-24 10:49:58 +02:00
Sergio Ahumada
366aba402f Bump Qt version to 5.1.2
Change-Id: Ibe3e6a37a874b75ea9a20e0a9ed8aa5f21bf6be2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-07-23 20:12:23 +02:00
Allan Sandfeld Jensen
36e6376755 Support RGBA image format
Support the byte-ordered RGBA format which is used by OpenGL, and many
endian neutral byte formats.

Task-number: QTBUG-32201
Change-Id: I77cffb4c30c69545fa96ded2f537b2ebd9351acb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2013-07-23 16:30:06 +02:00
Oswald Buddenhagen
d24b4a5548 set QT_TARGET_ARCH when building for the host
the built host tool may need to know what the target architecture is,
e.g. mkv8snapshot does.

Change-Id: Ie5b1f6a07fa082d212e7c5b54289de49fd74dbcf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-07-23 16:30:06 +02:00
Jerome Pasion
b625cddcd8 Doc: Edited CSS files in doc/global/template
-edited style convention for readability (as opposed to file size)
-removed extra CSS rule which does nothing

Change-Id: Ica9cbdf0c63bae87a8446afcbc22f74403e3247e
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-07-23 16:30:06 +02:00