Commit Graph

21179 Commits

Author SHA1 Message Date
Thiago Macieira
e38631b5e9 Stabilize tst_QUdpSocket::broadcasting
Sending 100*8 packets of each type of message is WAY overkill. That's a
stress test without limiting. My Linux system starts reporting EAGAIN on
the socket, so reduce the amount of data sent.

Change-Id: I153f44cf3b91d37526dac580b400114cc80b1769
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:42:27 +01:00
Thiago Macieira
68d8d27fad Don't try to send broadcasts over IPv6
IPv6 has no such thing, so don't try to bind to an IPv6 address to send
broadcasts (even though that works) and it's a poor idea to bind to IPv6
to receive broadcasts. Moreover, skip any IPv6 network addresses
(broadcast() is invalid).

Change-Id: I2829b042c000158565adfd92db682f37d67dacae
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:42:05 +01:00
Thiago Macieira
7a303ff55f Suppress silly shell warning during qmake of qtcpsocket.pro
If you don't have /etc/lsb-release, you'd get
  sh: line 0: [: =: unary operator expected

Change-Id: Idb5c79f799879e4d32cd640ef74fb388227f831e
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:41:55 +01:00
Thiago Macieira
a0cec54220 Autotest: Disable multicast testing with proxies
It doesn't make sense because there is no command to ask the proxy
server to join a multicast group. At best, we could write a datagram via
proxy without joining, but we definitely can't receive.

Change-Id: Icc6b54572a053fb7821dfca1f4111f2046ff8686
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-24 14:40:21 +01:00
Giuseppe D'Angelo
8815a75ef0 Remove a memory leak in the custom sort filter model example
Change-Id: Ie14f07bc2ee2215da2a81a75d816d4763fac085f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-23 16:39:03 +01:00
Giuseppe D'Angelo
ceeb032de6 QRawFont: improve the thread-safety checks
384388f2 introduced some checks, and used an assignment in an assert;
that sets off compiler warnings about expressions with side effects
into an assertion. Hence, that code needs to be reworked a bit.

Unfortunately, there's no single define we can use to know if
assertions are enabled or not in Qt, so simply use QT_NO_DEBUG
to enable/disable those checks. The actual "thread" data member
is kept around to avoid break ABI depending on debugging flags.

Change-Id: I8b07e7ff6f81359d6b0653a1d9cc2b720541d1b9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-23 16:38:56 +01:00
Thiago Macieira
c013104b04 Temporarily disable the QtDBus tests if the session bus isn't available
This is a temporary measure while the Qt CI system is updated to have
the correct D-Bus configuration. Once it is fixed, this commit should be
reverted, so that we don't run into the situation in which the tests
aren't getting run on some configurations and we never know about it.

Change-Id: I7192d4d95a60dcb63acfa6cc90bfdc58592b0664
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2014-12-23 12:22:56 +01:00
Thiago Macieira
7f34bee849 Fix include headers for qsslcertificate_qt.cpp
The order is:
 1) own header
 2) own private header, if any
 3) other headers

Commit f17d7a124f broke the order.

Change-Id: I7225024691db91fd936a057accdad65bacb3f979
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-12-23 12:20:19 +01:00
Nico Vertriest
a8714548d1 Doc: corrected broken links qtbase
Task-number: QTBUG-43115
Change-Id: Ib441326083294a6d59d75510142b1481f7b0bc35
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-12-23 10:55:45 +01:00
Joni Poikelin
0920e00932 Check screen before changing cursor
Task-number: QTBUG-43508
Change-Id: I6b525cab2a3958f4e3528ed8102d07984f152e60
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-12-23 10:11:23 +01:00
Jason Haslam
033318f7a7 Check for valid receiver before sending gesture events.
Gesture events sent to a disappearing tooltip can crash. This can most
easily be seen by scrolling over a tooltip on OSX with a magic mouse
middle scroll gesture.

Task-number: QTBUG-42826
Change-Id: Id5510895f63297ca157e3d24a3f4e3a6034586e8
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2014-12-23 10:11:08 +01:00
Dmitry Shachnev
13972476ad qstorageinfo_unix.cpp: Fix build on BSD and other unices
* Include statvfs.h on all non-Linux and non-Solaris systems.
* Fix type of stat_buf structure on BSD.

Change-Id: I6336503082fafd7f6108cf95c079bdd329d2ea0f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-12-23 09:12:01 +01:00
Aleix Pol
c63bb90ac7 Fix typo in Qt5CoreMacros.cmake
According to the documentation, the argument is called COPYONLY instead
of COPY_ONLY.
Fixes warning and ensures it works properly.

Change-Id: I643f5ea808aaaf94c3ee666ec39485e84ed38df1
Reviewed-by: Vishesh Handa <vhanda@kde.org>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2014-12-23 01:14:11 +01:00
Alexander Volkov
2b7204c0a9 Doc: Describe the enum item QStyle::PE_FrameStatusBar as obsolete
Change-Id: Ibda864d2b037bd8b2484b8642423ae1bca218021
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-12-22 23:47:14 +01:00
Sérgio Martins
66a8be2681 QColorDialog: Fix a few layouting issues.
Fixes combo-boxes being too big and some alignment issues
that were not present in Qt4.

See screenshot in JIRA task.
Tested with QT_SMALL_COLORDIALOG too.

Task-number: QTBUG-43501
Change-Id: I2aefb64be1c5f3c4894149d85e1a12c9c0cc3d62
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-12-22 15:46:47 +01:00
Timur Pocheptsov
c085382555 Revert "OS X: rename special menu items instead of duplicating"
This reverts commit 8c538d10da.
This patch, unfortunately, do not combine well with another
problematic code producing, as a result, a serious regression.
While the proper/better fix in Cocoa menu not found, I'm reverting
this patch.

Change-Id: I1ff03dbe12805da447cb3cfe3e2f231528bf1a16
Task-number: QTBUG-43471
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2014-12-22 14:27:51 +01:00
Eskil Abrahamsen Blomfeldt
244da85d3b Android: Fix QTemporaryDir/File::nonWritableCurrentDir() tests
The /home path doesn't exist on Android, so it doesn't work as
a non-writable current dir. Instead we use /data on Android.

Change-Id: Ib779f60822da1bef421a16a00c1030245a8c5b90
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:28:05 +01:00
Eskil Abrahamsen Blomfeldt
4bee095069 Android: Fix QLoggingRegistry test
The qtlogging.ini file needs to be detectable by QFINDTESTDATA,
so we put it in a qrc file on Android.

Change-Id: I5fb0217098c56f2b2e99ab8d1642c4a7904b18d1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:55 +01:00
Eskil Abrahamsen Blomfeldt
4fec0dca87 Android: Disable QLockFile test
This test requires building a console application first, deploying
this as part of the APK and then being able to execute the
bundled file from the main application. Since IPC is a limited
use case on Android, we just skip this test instead.

Change-Id: Ie68e495ff64b69e7027924291a411b5de0e2da76
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:49 +01:00
Eskil Abrahamsen Blomfeldt
ae55d3ea27 Android: Fix QIODevice tests
Test requires that tst_qiodevice.cpp is available on file system,
but since we're not able to deploy directly to the file system
on Android and since we want to actually test file system access,
we bundle it in qrc and copy it out during initialization.

Change-Id: Ida2b5bf6f1dcd43bc740a2b9380352bab5eb6c62
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:44 +01:00
Eskil Abrahamsen Blomfeldt
e511d9b9dd Android: Fix QFileSystemWatcher test failures
Some of the tests expect QDir::homePath() and QDir::currentPath()
to be different, so we just set the current path to something
other than QDir::homePath().

Change-Id: Ib048d323f4745369821765230b995a73b8a97145
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:38 +01:00
Eskil Abrahamsen Blomfeldt
616ac8e59c Android: Fix test failure for test QFileInfo::lastRead()
This test may not be possible on Android, since the file system
can be mounted with noatime or relatime which means read access
will not be registered.

Change-Id: I40f587e1a1f131ee06f0e3700e908ccaa19c83ce
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:31 +01:00
Eskil Abrahamsen Blomfeldt
5681ae74e3 Android: Fix QFileInfo tests
Since there's no way to deploy files directly to the file file
system on Android, we put them in a qrc file and extract them
on startup.

Change-Id: I6a42aa5e0372bfd9fb2f7ccfea964c9c3c2e45d8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:27:27 +01:00
Eskil Abrahamsen Blomfeldt
0dd7bd0c7a Android: Fix QDirIterator tests
This test requires that the resources are also available
in the file system. Since it's not possible to deploy directly
to the file system using Android, we extract the files on
startup instead.

Change-Id: I1d1fe7d62c4c618a89713e3a7d1903e42bfb10b8
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:26:57 +01:00
Eskil Abrahamsen Blomfeldt
0b16f42565 Android: Fix QDir tests
There's no way to install files automatically into the file
system on Android, so to test QDir on the file system, we have
to bundle the files in qrc and then copy them into the file system
on startup. This adds some complexity, but at least it will detect
regressions.

We also need to make sure the current directory is the same as
the data path, since the test assumes this, and /usr/ does not
exist on Android, so we have to use a different path to find the
root path.

Change-Id: I18d79b5ed99a0afff573beb30c61745c403f8991
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:26:49 +01:00
Eskil Abrahamsen Blomfeldt
999321fecb Android: Stabilize QPauseAnimation test
This will arbitrarily fail at certain points. Adjusting the
timeouts helps, but it's very unpredictable, so it's better
to do what we do on Windows and just expect-fail the results
that we get.

Change-Id: Ie6033c73539c2dd69115b06096919e173f097367
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-22 09:26:38 +01:00
BogDan Vatra
49517ac1dc Android: Fix qicoimageformat test.
Add all test data to resources.

Change-Id: Id42a4c033b75409f65cb4d56ebf1161336b93832
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:34:05 +01:00
BogDan Vatra
4cea71eebe Android: Fix qmovie test.
We must add all test data to resources.

Change-Id: Ic12f8fce9afb965aff32e7141516c8d223e64491
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:33:17 +01:00
BogDan Vatra
daa5679c8e Android: Fix qicon test.
We must add all test data to resources.

Change-Id: I7f9e7650156b174b7c16270d86b78e9408dff254
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:33:02 +01:00
BogDan Vatra
2073057bde Android: Fix json test.
Add test data to resources.

Change-Id: Ib8a5688e7caab8434b8f0676f53a2a79ec94b264
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-22 08:32:39 +01:00
Laszlo Papp
81d116595c Mention the c++14 CONFIG option in the qmake variable reference
Change-Id: Iaad18c39925c07b9bf068c02f2cda5d7f06fd38f
Reviewed-by: Alejandro Exojo Piqueras <suy@badopi.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-20 07:48:01 +01:00
BogDan Vatra
36132addd1 Remove old test script & project.
Change-Id: Ia31959228e188a3f9d2fe3a95c7381a3f4e5d1fb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2014-12-20 07:42:09 +01:00
Thiago Macieira
d55db285fc Autotest: Fix a race condition in launching the QtDBus sub-processes
Wait for the subprocess to print "ready" before assuming that it is
ready to receive calls. waitForStarted() will return as soon as the
child is running, but it may not have registered on D-Bus yet.

This also solves the synchronization problem more elegantly than how
tst_qdbusmarshall.cpp was trying to do it.

Change-Id: I548dfba2677cc5a34ba50f4310c4d5baa98093b2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:37:17 +01:00
Thiago Macieira
36314ae75f Fix handling of subprocesses for QtDBus unit tests on Windows
The executables are not in the same dir as on Unix, so we need to use
QFINDTESTDATA to find them. The DESTDIR setting prevents qmake from
placing the executables in a "debug/" subdir.

Change-Id: I1d6d10e6f6f109f55fd9809dcf83da0386f38772
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:37:12 +01:00
Thiago Macieira
3148d0c7b4 Don't kill the subprocess in tst_qdbusabstractinterface
Rohan was right in e88f9a92b7 to stabilize
the test and reset the state, but killing the subprocess is overkill.
All we need is to reset the state in both applications, which includes
disconnecting and reconnecting to the peer, to discard any sent but not
yet received messages.

Change-Id: Ie01392e6e63bd70ef8345217d3fc641ed63c7aba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:37:01 +01:00
Thiago Macieira
91fe8129fa Autotest: Make the peer executables report error if they failed
QDBusServer::address() will return an empty QString, which caused the
tests to fail later with no apparent reason.

Change-Id: I86f448dfc67a6cdb27ecda2d490f335766cfaf4f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:52 +01:00
Thiago Macieira
7b6ab50c68 Remove the hardcoding of Unix socket paths for QtDBus
This allows the tests to be run on Windows too by using TCP socket
connections instead of requiring Unix sockets. The tests shouldn't have
hardcoded the path, which came from QDBusServer anyway. Now the tests
simply defer to QDBusServer.

This is a slight behavior change for Windows, but not one that should
matter since anyone who was using the default constructor resulted in a
QDBusServer that failed to listen.

[ChangeLog][QtDBus][QDBusServer] Fixed a bug that made QDBusServer's
default constructor try to bind to a Unix socket on non-Unix systems.
Now QDBusServer will attempt to bind to a TCP socket instead.

Change-Id: I2a126019671c2d90257e739ed3aff7938d1fe946
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:42 +01:00
Thiago Macieira
9434162eda tst_qdbusconnection_no_bus: Fix build on Windows
There's no setenv, so use qputenv instead.

Change-Id: I357ff6d0e3d67e199661a9d87c720fc4e0131755
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:34 +01:00
Thiago Macieira
cfab934186 Fix loading of the dbus-1 DLL built by MinGW on Windows
QLibrary does not append the version suffix on Windows by itself, since
there's no established practice on how to do this. The MinGW builds of
dbus-1 call it "libdbus-1-3.dll", so we need append the suffix
ourselves.

Unfortunately, other names like "dbus-1.dll" have been seen in the wild,
so we need to try both basenames (Windows doesn't prepend the "lib"
prefix). Both basenames work on Unix, so give "libdbus-1" on Unix since
that will result in one fewer stat.

Change-Id: I92506df5fd30c7674216568406bf86b25bf646b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-12-20 07:36:20 +01:00
Thiago Macieira
d1d3c36e87 Simplify use of __has_include in qlogging.cpp
Easier to just #define it to 0

Change-Id: Ife99fdca6564077762fa67c6d7a5becaf48655d8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-12-20 07:36:17 +01:00
Thiago Macieira
91ae988b5c Remove unnecessary adding of test rows in the QtDBus type benchmark
No need to loop twice to add the "native" entries, since they are added
by the helper function anyway.

Change-Id: I9caabc6fc4973a90b483840815769b1351947a89
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-12-20 07:36:06 +01:00
Jeongmin Kim
741dd3da33 QNetworkDiskCache: Do not store set-cookie headers of the response in disk cache.
The cookies may contain sensitive information. so we should not store cookies in disk cache.

Task-number: QTBUG-42546
Change-Id: I6331bdd766445af41f55bfaf0e9132b75dd7957f
Reviewed-by: Jeongmin Kim <jm86.kim@lge.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-12-20 04:20:07 +01:00
Thiago Macieira
a31b75b766 Use the GCC and Clang __builtin_bswap intrinsics in qbswap
Glibc will use the intrinsics for 32- and 64-bit, but didn't for 16-bit
(probably because GCC didn't document it until version 4.8), so this
commit will make us access the intrinsics directly the intrisincs for
all type sizes.

Additionally, this will get us access to the compiler intrisics even
without Glibc, such as when building against uclibc or Bionic.

Another benefit is that both Clang and ICC will use the MOVBE
instruction on Atom and Haswell architectures.

Change-Id: I39d1891f479887d719d69ebe4ac92ac9bfeda8af
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2014-12-20 01:41:00 +01:00
Thiago Macieira
c70658d301 Make sure we don't try to ask QByteArray to allocate too much
QFile::readAll could be asked to read a file that is over 1 GB in size
and thus cause an assertion:

ASSERT failure in qAllocMore: "Requested size is too large!", ...

The idea behind the existing code was correct, but the value was wrong.
It prevented overflow of the integer size request, but didn't prevent
overflowing the storage size.

Change-Id: I072e6e419f47b639454f3fd96deb0f88d03e960c
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-12-20 01:39:33 +01:00
Thiago Macieira
80d0075588 Fix QThread::idealThreadCount on Unix if sysconf or sysctl fails
The BSD4 code (including OS X) calls sysctl and if that fails, it sets
cores to -1. Similarly, the generic Unix code calls sysconf() and
assigns the returned value to cores, but sysconf can return -1 on
failure.

Change-Id: I9e521d366e9c42f36c2ba20a37e7a74539ddb8f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2014-12-20 01:39:22 +01:00
Pavel Krebs
1c1cce67fa QScrollBar: emit valueChanged once even if a slot takes too much time
Put also processing of control activation into initial timer check for possibly
pending mouse release event.

[ChangeLog][QtWidgets][QScrollBar] Fixed a bug where the valueChanged() signal
was emitted twice if a connected slot took too much time.

Task-number: QTBUG-42871
Change-Id: I7bad5279ef84463a033b55256d241d4445374081
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-12-19 17:15:07 +01:00
Friedemann Kleint
b6514cf307 Diaglib: Add helper functions for analyzing non-Latin strings.
Add a functions to dump out texts character by character and
as code.

Task-number: QTBUG-43191
Change-Id: I1ac17f2485563f909b71bb1fbd1fd595d1d94223
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2014-12-19 16:19:30 +01:00
Eskil Abrahamsen Blomfeldt
0655504015 Also search current directory in QFINDTESTDATA
On Android, none of the file system paths used for QFINDTESTDATA
currently are suitable. We do have the possibility of putting
test data in qrc, but in cases where the test is specifically
testing access to the regular file system, we need a way to
find files there as well. We add a fifth step when all other
fail, which searches the current active directory for the data.

Change-Id: I4f02f8530b5843eb282bd112ea03ed6a476593d6
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-19 16:00:59 +01:00
Eskil Abrahamsen Blomfeldt
678a283498 Android: Fix QStandardPaths test
QStandardPaths::writableLocation() is documented to return the
empty string if no matching writable location can be determined.
This is the case for e.g. FontsLocation and ApplicationsLocation on
Android. We need to still accept this as a valid response.

Change-Id: I2824e9dcfd41b1c24dbf3896b7ae9b5260e9accd
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-19 16:00:46 +01:00
Eskil Abrahamsen Blomfeldt
0fb839ac62 Android: Fix QResourceEngine tests
The test expects all the files to reside in the file system,
both for loading the runtime resources and for comparisons.
Since we can't deploy directly to the file system on Android,
we go via qrc and extract the files on startup instead.

Change-Id: I17ff8985cb17dbfc45f0fb692ca46558bb5c5cdc
Reviewed-by: BogDan Vatra <bogdan@kde.org>
2014-12-19 16:00:41 +01:00