Commit Graph

4763 Commits

Author SHA1 Message Date
Maximilian Hrabowski
4cbb99c5e2 QAbstractItemView: fix CTRL+A select all behavior
The check for Qt::Key_A to handle selectAll was changed to directly
compare to QKeySequence::SelectAll as this will only match Ctrl. The
former implementation also triggered when e.g. Shift was pressed.
Added a check that selectAll is only called when selection is not
disabled, i.e. selectionMode=NoSelection.

Added a unit test for selectAll().

Task-number: QTBUG-26687
Change-Id: I721e7ab590b55d7d754b3b74ef01756fa5aa1315
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-10-13 13:53:28 +02:00
Eskil Abrahamsen Blomfeldt
27bc4c4ce5 QPlainTextEdit: Fix crash on complex undo w/full width selection
Say you have a document of two blocks of text.

When you select a block of text in the document and then replace this
with a new empty block (by pressing enter) and then subsequently
undo this action, the following three steps are performed as a
chain of undo commands:

1. Remove the empty block at the beginning of the document
2. Insert a new empty block at the beginning of the document
3. Insert the text back into the first block

Since a block is removed and inserted in the same go, both blocks
require a relayout, since the accumulated change spans both blocks.
However, in QPlainTextDocumentLayout we would only look at the max
of either removed chars or added chars. This would match the text
length of the first block at this point, so we would only relayout
that block. However, since we are also removing characters, the
actual accumulated change to the document is larger. We should
relayout any block touched by the sum of the added and removed
character counts.

Missing this, the paint event would later query
block.layout()->lineForTextPosition(0) which would give an invalid
line despite the fact that the block.length() > 0. This caused
a crash in the paint event when the full width selection was
turned on.

Note that the logic here was only recently updated to include the
removed characters at all in the logic, by the SHA1:
2983cb9531.

[ChangeLog][QPlainTextEdit] Fixed a crash when using full width
selections and issuing a complex undo command chain which removes
and inserts an empty block in one go.

Task-number: QTBUG-36415
Change-Id: Iafe8a69e455e0c713a48714f10f0cace69c84f51
Reviewed-by: Axel Rasmussen <axel.rasmussen1@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-09-30 10:21:39 +02:00
Markus Goetz
097b641c3e QNAM: Fix previous HTTP upload CPU fix
My previous fix for CPU load issues between HTTP thread
and user thread  was fragile if the upload QIODevice
emitted readyRead() multiple times.

[ChangeLog][QtNetwork][QNetworkAccessManager] Fix behavior of upload QIODevice
that generate data on readyRead() for HTTP PUT/POST

Change-Id: Idb1c2d5a382a704d8cc08fe03c55c883bfc95aa7
Reviewed-by: Christian Kamm <kamm@incasoftware.de>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-25 17:10:54 +02:00
Christian Kandeler
e66a878838 QSettings: Don't chop off trailing tabs that were actually part of a value.
This was done wrong when using the ini format.

Task-number:  QTBUG-22461
Change-Id: Ib9390460bce6138659cceac7e3cd25339ba5e9bb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-09-23 11:28:58 +02:00
Albert Astals Cid
a966b19b52 Fix crash in QNetworkAccessCacheBackend::closeDownstreamChannel
device is private, always null and class has no friends, so no need to have it at all

Change-Id: I320d47f1a712a3202c08b494563533e29d185501
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-22 13:42:03 +02:00
Giuseppe D'Angelo
bb3d2ca9f1 QToolButton: properly reset the size hint when a menu is set on it
QToolButton::sizeHint() takes into account the presence of a menu.
However, setMenu() doesn't retrigger a size hint recalculation. Hence,
(un)setting a menu on an already sized tool button won't properly
reset the size hint. Since the calculated size hint is cached,
delete the cached value and call updateGeometry to cause a
recalculation.

Task-number: QTBUG-38949
Change-Id: I6e79e5e70e31afdfd129282b3668875eca86f51d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-16 22:42:47 +02:00
Giuseppe D'Angelo
b2b9fdfda0 QSizeGrip: use a QPointer to the tracked TLW
And not a normal pointer. The problem is that in certain scenarios,
if the TLW containing a QSizeGrip changes and the old TLW gets
immediately destroyed, then the mechanism which updates the tracked
TLW is run too late, and ends up accessing a dangling pointer.
Therefore, we need to protect that pointer via a smart pointer.

Task-number: QTBUG-22867
Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-15 20:50:50 +02:00
Eric Lemanissier
3e80497668 Preventing caching of null authenticator
In some cases, e.g. when bad credentials are provided in an ftp URI,
QNetworkAccessAuthenticationManager::cacheCredentials is called with a
null authenticator. This authenticator should not be cached, because
it is useless, and leads to inconsistencies in the use of the cache

Task-number: QTBUG-40622
Change-Id: If2a0a422b915f268648f5eef1d68601446123371
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
2014-09-09 22:26:27 +02:00
Thomas Fischer
983dde1f2f Avoid adding widget to its own layout
Widgets and layouts added or inserted to a layout are checked for:
- Not being NULL
- Not being the parent widget of a layout or the layout itself,
  respectively

Without this commit, adding a widget to its own layout would result in a
CPU-hogging infinite loop. Now, a warning is written to stderr and the
add or insert function call is ignored.

The checks are implemented as public functions of QLayoutPrivate and
thus accessible in QLayout's descendants to be used in various
"addWidget", "insertWidget", etc functions.

Unlike 'classical' layouts like QGridLayout, QFormLayout does indeed
accept widgets that are NULL. To not break this behavior, any call for
the check functions first tests if the widget or layout, respectively,
to test is NULL or not and calls the check only in the latter case.

Automated tests for QBoxLayout, QGridLayout, and QFormLayout were added.
For an unpatched Qt 5.3, each of those automated tests will freeze as
explained in QTBUG-40609. For a fixed version, warning messages about
invalid parameters to addWidget/addLayout/... calls will be read by
QTest::ignoreMessage, resulting in a passed test.

Change-Id: I1522d5727e643da3f7c025755975aca9f482676d
Task-number: QTBUG-40609
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-09-05 00:05:45 +02:00
Kevin Funk
eb44767945 Fix crash in QTextLayout::cursorToX
When 'cursorPos' is out of bounds ([0, lineEnd]), this method crashed.

Change-Id: Ia0540ab3afbffb5c598f7b8515263cce3b3928e4
Task-number: QTBUG-40753
Reviewed-by: Dominik Haumann <dhaumann@kde.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-09-02 14:18:08 +02:00
Dyami Caliri
9c3a58a913 Recreate child windows when changing screens
When setting a new screen, the code calls QWindow::destroy(), which
recursively destroys all child windows. It then calls create() on the
top-level window, leaving child windows destroyed. This causes crashes
if you have embedded native widgets.

Task-number: QTBUG-40817
Change-Id: Iaace2589f48bbfd5faaf5ff95357ff43b310504a
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-28 23:48:56 +02:00
Eskil Abrahamsen Blomfeldt
198009db79 Fix several regressions in font selection
In Qt 5.3.0 a change was added which automatically adapts Common
script to surrounding scripts in accordance with the Unicode tr#24.

This broke *a lot* of cases of font selection because the font
selection algorithm is not prepared for handling characters with
adapted scripts. We need to disable this change for now and redo it
later with patches to font selection to avoid the regressions.

[ChangeLog][Text] Fixed several regressions in font selection when
combining different writing systems in the same text.

Task-number: QTBUG-39930
Task-number: QTBUG-39860
Change-Id: Id02b5ae2403c06542ed5d81e7c4deb2e0c7d816e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-08-20 13:10:55 +02:00
Timur Pocheptsov
6b6e51e5ab OS X - QCollator::compare() returns wrong results.
kUCCollateDigitsAsNumberMask works only if kUCCollateDigitsOverrideMask
is also set.
Update 0: - test added.
Task-number: QTBUG-40777
Change-Id: I48bfec78f5f8439a51f8d749f0fc4397a72b29f2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-19 17:53:36 +02:00
Matt Broadstone
45cbbe56bc refactor disconnectFromFtp to remove cached entries when necessary
In cases where a cached ftp connection fails to connect, or a file
transfer has failed, we should removed the cached connection. Since qnam
has an idea of a single internal QFtp per full operation, when file
transfers failed previously the cached connection would be reused for
subsequent connections and thus fail.

[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
properly handles FTP transfer failures by removing failed cached ftp
connections.

Task-number: QTBUG-40797
Change-Id: Ie090a39ceddd7e58a0d8baf7d01f2a08c70162e5
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-15 19:48:36 +02:00
Thiago Macieira
4848796f3e Make sure we don't cache old file sizes prior to new writes
If we write to a file, its size changes. We should drop previous size
caches.

Change-Id: Ib687c91e5fc88cab588c89023f23da9622160da9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-08-13 16:36:11 +02:00
Marcel Krems
9f486efcbe Show the correct cursor for QLineEdit's side buttons.
Task-number: QTBUG-40708
Change-Id: I5869f42bab3a27085b5572a4b83b16c39a67f733
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-12 14:56:23 +02:00
Olivier Goffart
c2badc7423 Fix disconnect()ing from signals declared in a base class
Fix disconnection from pointer to member signal that belongs to the base
class, but whose type is a pointer to a member of the derived class.

Commit 9cc106d9d7 fixed connect, so apply
the same fix in disconnect

[ChangeLog][QtCore][QObject] Fixed disconnecting from pointer to member
signal that belongs in the base class but whose type is explicitly given
as a pointer to a member in the derived class

Task-number: QTBUG-40638
Change-Id: Ia546fc8f36e1ea0dd0645bdd820aea47f43677ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-11 16:49:01 +02:00
Peter Hartmann
9ad5dd0e8f network tests: add manual test for auth / proxy auth
This is helpful to e.g. test an NTLM proxy.
The test server currently does not support NTLM; this test offers a
possibility to specify a proxy server via environment variables.

Change-Id: Iea94656d38424c1d932fc854d13ca15ca47cdd68
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-07 11:54:08 +02:00
Andy Shaw
866c8bc5e3 Uncomment some tests which accidently got commented
With SHA1 47b3ecf3f4 some tests got
commented out by accident. This re-enables those tests.

Change-Id: If9c7d8a672b66086895a0383fe87d3101fb146fb
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-08-07 10:08:51 +02:00
Peter Kümmel
4124cd159e Undo: Fix state entry bug for parallel state groups
This commit reverts c4cef6fae9.
The above fix for QTBUG-25958 (cloned in QTBUG-40219) is not
complete and introduces the regression QTBUG-30049.

Task-number: QTBUG-30049, QTBUG-25958, QTBUG-40219
Change-Id: I3c4b774dce06c13cb4e089f8413a7747cedfd212
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-06 07:21:18 +02:00
Marc Mutz
54a4488ca5 tst_QHash: check which of several equal keys is inserted
Add a test that checks that QHash keeps the first of the keys
that compare equal. This may or may not be documented, but is
inconsistent with the values in a QHash, where the last element
with equal key is kept.

Document this as a test. That way, we'll be informed when the
behavior changes (e.g. by a port to std::unordered_map).

Do the equivalent checks in tst_QMap, too. There, of course,
instead of equal keys, check equivalent ones.

Change-Id: I2c5f04f8e8a6bbc7dbaadadd878a4c876e4df042
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-05 18:04:46 +02:00
Marc Mutz
e1fed5dc31 tst_QSet: check which of several equal elements is inserted
Add a test that checks that QSet keeps the first of the elements
that have equal value. This is documented, but inconsistent with
values in a QHash, which keeps the last element with equal key.

Document this as a test. That way, we'll be informed when the
behavior changes (e.g. by a port to std::unordered_set).

Change-Id: I4ca1718bb86599b925b3ccd13b0856917cd4ce67
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-05 00:02:26 +02:00
Oswald Buddenhagen
87d15f2c1b Merge remote-tracking branch 'origin/stable' into 5.3
Change-Id: I2a044d44ca991ba20ddd710053b85afb51e362d3
2014-07-30 15:53:07 +02:00
Marc Mutz
aaaba5da24 tst_QSet: verify that {}-style initialization drops duplicates
No actual reason for this test, except my curiority. Then again, it's
good to have this check, too.

Change-Id: I815fce7e4dbe76e21cac29beb1dbfc1083191d24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-25 14:53:25 +02:00
Marc Mutz
67a316be7c tst_QMap: replace QVERIFY(x == y) with QCOMPARE(x,y)
QCOMPARE produces more useful output on failure.

Change-Id: Idaa9bf61a22a43b0feb084a71985a69c8787d633
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-25 14:53:05 +02:00
Marc Mutz
34237d62f6 tst_QMap: verify that {}-style initialization drops duplicates
No actual reason for this test, except my curiority. Then again, it's
good to have this check, too.

Also checks that the last entry in the init_list "wins", which is
not how std:: containers work.

Change-Id: I4f7d1228f2b90a904b6c3f99e54afcd9970b723e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-25 14:52:58 +02:00
Marc Mutz
443bc6ab18 tst_QHash: replace QVERIFY(x == y) with QCOMPARE(x,y)
QCOMPARE produces more useful output on failure.

Change-Id: I584a5d33026ac2587758d72524f735937029e111
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-25 14:52:40 +02:00
Marc Mutz
8b0cc9db9b tst_QHash: verify that {}-style initialization drops duplicates
No actual reason for this test, except my curiority. Then again, it's
good to have this check, too.

Also checks that the last entry in the init_list "wins", which is
not how std:: containers work.

Change-Id: Ia284d093cd0029432372630e81657fb687b9516f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-25 14:52:33 +02:00
Markus Goetz
b99fa32d70 QNAM: Fix CPU load for limited upload QIODevice
This fixes high CPU load for upload devices that don't generate
a constant stream of data. Their readData() function was called all the
time without returning actual data.

This was noticed when implementing an upload device that emits data in
a limited way for bandwidth limiting.

[ChangeLog][QtNetwork][QNetworkAccessManager] Fixed high CPU load when handling
POST/upload QIODevice that generates data on readyRead().

Change-Id: Iefbcb1a21d8aedef1eb11761232dd16a049018dc
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-07-25 12:56:14 +02:00
David Faure
6f3bb0aafa tst_qurl: add tests for mailto parsing and toString. No bug.
This was prompted by https://git.reviewboard.kde.org/r/119221

Change-Id: Ia148f07f6d711df533693918bbedfa5e7dc02cd5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-22 11:01:52 +02:00
Eskil Abrahamsen Blomfeldt
e746e2a11a Android: Fix tests in gui/text requiring test data
Several tests require test data to be deployed with the
application. The easiest way to achieve this on Android
is to add them to a qrc file and use the QFINDTESTDATA macro
to look up the files. This fixes several test failures
in the gui/text subdirectory for Android.

Change-Id: If944bb1fc93434a1b2d6487da829d21bd6b84e87
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-07-21 09:49:09 +02:00
Friedemann Kleint
a71e285133 Ensure transient parents are top level widgets.
When a dialog was parented on a native child widget,
its window handle was used as a transient parent.
This confused QPlatformWindow::initialGeometry() among
other things. Use top level window as is in Qt 4.

Task-number: QTBUG-40195
Change-Id: Ic82adc276175f92adde825fb2551274351e41f30
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-07-18 09:25:05 +02:00
Nikita Krupenko
feb1afc782 Added stream version into network cache file format
At the moment, there is no stream information in the cache file. This
can lead to a problem when current stream version differs from version
cache file written with.

As an example, if file written with Qt 5.1.1, QTimeDate in the metadata
stored as 13-bytes value, but Qt 5.2 and later can read additional 4
bytes which breaks following data, leading to network request just hangs
forever.

Adding stream version fixes this problem.

As cache format changed, cache version bumped.

Task-number: QTBUG-36219
Change-Id: I467d8c9fda82bcf9302192f51e7a00d2f6a9ff66
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-07-17 11:28:18 +02:00
Friedemann Kleint
cdba2439f9 QSplitter: Exclude top level widgets from child event handling.
Prevent the splitter from adding them to the layout or showing
them.

Task-number: QTBUG-40132
Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-07-15 11:24:38 +02:00
Eskil Abrahamsen Blomfeldt
0cbebb21cc Android: Prefer "Droid Serif" as default serif font
I've also updated the qfont test so it passes on Android now. Note that
there are no suitable cursive/fantasy fonts on Android, so the regular
default "Roboto" (or "Droid Sans" on older devices) will be picked here
instead.

[ChangeLog][Android] Fixed font selection to prefer "Droid Serif" when
Serif style hint is set on QFont.

Change-Id: I294eebcc4d79410e435bdddce552acc6044753b2
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
2014-07-10 16:23:50 +02:00
Eskil Abrahamsen Blomfeldt
1dd9a0af4f Fix fallbacks for adapted common script
When the platform plugin gives us specific fallbacks for a
specific script, we need to respect this, and load the correct
font family regardless of which writing systems it supports.

This is especially important since the common script is adapted
to match surrounding, proper scripts, so characters such as
digits next to e.g. Hebrew text will be marked as Hebrew. On
stock Android, there is a single Hebrew font, and this would
previously be put in all fallback slots for Hebrew regardless of
what fallback fonts were dictated by the platform plugin. Since
this font does not support the digits, they would show up as boxes.

[ChangeLog][Android] Fixed common characters like digits and
punctuation showing as boxes when positioned next to non-latin
scripts.

Task-number: QTBUG-39377
Change-Id: I1555e208a8ddc587c0bbdbfff1600cafdd9442e9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-07-10 10:01:49 +02:00
Peter Hartmann
916c9d469b QSslCertificate: blacklist NIC certificates from India
Those intermediate certificates were used to issue "unauthorized"
certificates according to
http://googleonlinesecurity.blogspot.de/2014/07/maintaining-digital-certificate-security.html
, and are by default trusted on Windows, so to be safe we blacklist
them here.

Change-Id: I9891c5bee2dd82c22eb0f45e9b04abd25efeb596
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-07-09 21:30:11 +02:00
Friedemann Kleint
cdf9aed630 tst_qdir: Move QFINDTESTDATA() from init() to constructor.
Check result in initTestData().

Previously, QFINDTESTDATA() was repeatedly invoked in init(). The
data-driven cd() test then failed when invoked stand-alone since
cd_data(), which relies on the data path, is executed before init().

Task-number: QTBUG-40067
Change-Id: I91039247e8dcaedd92fa990f1b5f82bc54b17c60
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-09 10:59:42 +02:00
Eskil Abrahamsen Blomfeldt
b56a42be14 REG: Fix nbsp in QTextLayout
At some point since Qt 4.8, the nbsp character has acquired
the whitespace attribute, causing it to be treated exactly
like an ordinary space. To account for this, we add an extra
check in the layout code to avoid breaking on non-breaking
spaces even if they have the whiteSpace flag set.

This is a temporary fix for the regression. The line breaking
algorithm needs to be refactored and support Unicode tr14
properly, which it currently doesn't.

[ChangeLog][Text] Fixed lines breaking on non-breaking spaces.

Task-number: QTBUG-39832
Change-Id: Ibd7e1a11ce4b82c611ecda1542c8638a67bf3cae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-07-08 08:35:02 +02:00
Morten Johan Sørvig
b942cf0f3b Make tst_QLocale::macDefaultLocale() more robust
The assumption that we can test "en_US" and expect
it to behave a certain way is flawed in that most
of the formatting settings are independently
configurable by the end user.

Make the test more robust while attempting to preserve
as much testing as possible:

Make the decimalPoint/groupSeparator tests check for
a range of possible values. Check that they are not
the same.

Remove the date formatting tests and the firstDayOfWeek()
== Sunday test.

Make the time zone test accept a non zero extended
time zone. ("GMT+2" in addition to "GMT+02".)

Change-Id: Ie1f89793eb785f526c5f6fafbb6726ef8c6cb016
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-07-02 12:55:47 +02:00
Bernd Weimer
8377384e3a Fix some tst_qwidget test cases
Fixed qwidget test cases for platforms that show windows full screen by
default and that don't support WindowMasks. Incorporated QNX/BlackBerry
peculiarities.

Change-Id: I349ecab5cef35c7d9751aa547465f685d620164a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
2014-07-02 10:29:44 +02:00
Morten Johan Sørvig
ddeb907442 Skip unstable autotests in QtBase.
The combination of these unstable tests makes it very
hard to get changes through the CI system due to the
unrelated test failures.

Skip the following test functions:
tst_QIODevice::unget QTBUG-39983 (Mac)
tst_QThreadPool:expiryTimeoutRace QTBUG-3786 (Windows)
tst_QLocalSocket::processConnection QTBUG-39986 (Mac)
tst_QTcpServer::adressReusable QTBUG-39985 (Linux)

Change-Id: I96559bea0d437fd25966b6ccac1ece1490e06241
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-07-02 09:28:34 +02:00
David Faure
9ee27005ee qDebug: fix data race in qt_message_print
The setting of (static) messageHandler to qDefaultMessageHandler if null
was happening in multiple threads simultaneously, so it needs synchronization.

Used an atomic pointer in case qInstallMessageHandler is called from a thread,
but more importantly, initialized the static vars right away.

Improve auto test to ensure that qInstallMessageHandler(0) still sets the
default message handler.

Change-Id: I70335af38c1d28a1cdba1df8a79c6006f227422e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-01 20:23:31 +02:00
Friedemann Kleint
813462a0ce tst_qcollator: Exclude failing test cases for non-ICU/Windows.
Change-Id: I17912ddb34337216805259dab9d90eb2c9ac64cc
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
2014-06-30 15:02:06 +02:00
Eskil Abrahamsen Blomfeldt
8638895f6b Android: Fix compilation of qtcpsocket test
No pthread_yield() in the Android NDK.

Change-Id: I5ff77c55f30c172ee7fefb1129bdf475b318449e
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 11:40:24 +02:00
Eskil Abrahamsen Blomfeldt
190bb186ae Android: Fix compilation of qhostaddress test
The sockaddr_in struct is defined in netinet/in.h header.

Change-Id: I67a3421094c96a5e948968a26723ec8c21f85c93
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 08:59:45 +02:00
Eskil Abrahamsen Blomfeldt
a57f3ee9bb Android: Fix compilation of qpluginloader test
The almostplugin has an unresolved symbol, and on Android
we compile with -no-undefined.

Change-Id: Ia631193890dfe8e7ac8e58087475164222d876fc
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-06-30 08:59:35 +02:00
Fabian Bumberger
e83c52a997 QNX: Fix QMdiWindow autotests
In "setOpaqueResizeAndMove" this patch makes sure that the content of a subwindow
actually fits into the window, otherwise the resize does not work properly.
The content is dpi dependent and thus the pixel size of it increases with the display
dpi value.
Furthermore when moving the QMdiSubwindow this patch makes sure that we actually grab
the window's header and not one of it's tool buttons (minimize, maximize, close).

Change-Id: I88314994957c5883f57c09c9240a3b83f1ee42ed
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
2014-06-25 14:43:13 +02:00
Alex Trotsenko
7cc893b216 Fix QRingBuffer::readPointerAtPosition()
Fix condition to allow return a valid pointer when head != 0.

Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-24 18:48:33 +02:00
Peter Hartmann
100ed2e91e network internals: do not try to cache a deleted entry
We were keeping a dangling pointer to a non-existent QIODevice around
which would lead to a crash.

Task-number: QTBUG-17400
Change-Id: Ie374cbb94bb45c9b0fbef46287b3317f60154123
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-06-24 15:07:03 +02:00