Commit Graph

4708 Commits

Author SHA1 Message Date
Toby Tomkins
4c577aead9 Flag QGraphicsView test as unstable on Mac.
Task-number: QTBUG-24296

Change-Id: I9f748c368fbc0cc2b272be9400da95d774d51bde
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-22 00:07:31 +01:00
João Abecasis
7bbe79fe5f Drop file-engine abstraction from public API
This abstraction imposed serious performance penalties and is being
dropped from the public API.

In particular, by allowing file names to be arbitrarily hijacked by
different file engines, and requiring engines to be instantiated in
order to decide, it imposed unnecessary overhead on all file operations.

Another flaw in the design with direct impact on performance is how
engines have no way to provide (or retain) additional information
obtained when querying the filesystem. In many places this has meant
repeated operations on the file system, where useful information is
immediately discarded to be queried again subsequently.

For Qt 4.8 a major refactoring of the code base took place to allow
bypassing the file-engine abstraction in select places, with
considerable performance gains observed. In Qt 5 it is expected we'll be
able to take this further, reaping even more benefits, but the
abstraction has to go.

[Dropping this now does not preclude that virtual file systems make an
appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a
new and improved abstraction.]

Forward declarations for QFileExtension(Result) were dropped, as the
classes were never used or defined.

Tests using "internalized" classes will only fully run on developer
builds. QFSFileEngine was removed altogether from exception safety test,
as it isn't its intent to test internal API.

Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-22 00:07:31 +01:00
Donald Carr
9beeb3030b Correct pkg-config usage to respect sysroot
Direct use of pkg-config variables disregards the sysroot offset pkg-config
factors into consideration with the dedicated variables:

--cflags-only-I
--libs-only-L

these parameters exist exactly for this reason.

Change-Id: Ieecf31ebe0640f64b272b84fba22701aacf8f966
Reviewed-by: Johannes Zellner <johannes.zellner@nokia.com>
Reviewed-by: Donald Carr <donald.carr@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-22 00:07:31 +01:00
jian liang
4b30882a3f Fix potential race condition in data structure of adopted thread watcher
Fix potential race condition in data structure of adopted thread watcher
in Windows. Since QVector is not thread safe, it is not safe to read and
append data to qt_adopted_thread_handles or qt_adopted_qthread
simultaneously in qthread_win.cpp. This patch fix this race condition.

Change-Id: I2d0c7a4cdde5390d38d15c98343f0fc6ddd24aba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-22 00:07:31 +01:00
Richard Moore
28401bf747 Merge overloads
Fixes ### Qt 5

Change-Id: I2846593616635440e17c8a9ce518780561992b84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 00:07:31 +01:00
Richard Moore
5f5f9f33be Merge overloads.
Fixes a Qt 5 TODO

Change-Id: Ide3159a5b979bd8e8a1edefff7fccb98dbe9a78e
Reviewed-by: Pierre Rossi <pierre.rossi@nokia.com>
2012-02-22 00:07:31 +01:00
Jonathan Liu
e8ecf3ad03 QElapsedTimer/Win: Fix 64-bit integer overflow
The ticksToNanoseconds function in qelapsedtimer_win.cpp multiplies
ticks from performance counter with 1000000000 which can sometimes
result in 64-bit integer overflow. This can cause the elapsed time to
reset or jump around.

Task-number: QTBUG-23150
Change-Id: I464503e03cbe64e13906e773beafbf88e7dc256a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f30a91ba9d98de1a0ebee5608ba289ac35871a8c)
2012-02-22 00:07:31 +01:00
Andrew Stanley-Jones
d1abf3e3e7 Fix the qlocalsocket test
This test is broken in a couple of ways. A few one line fixes
combined into a single patch.

1. Linux is the only OS that does
abstract unix domain sockets by prepending a null as the first
character.  Don't test this on non-Linux platforms and expect
it to pass.

2. Change QVERIFY2 to QCOMPARE so we can see why this
fails in CI but no on the local system.  Use QCOMPARE
where possible.

Change-Id: Ic3d2cf9696730dc4d6589539fdfe8a48ccf28de5
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-02-21 22:31:00 +01:00
Andrew Stanley-Jones
511e447b70 Enable qlocalsocket auto test
Due to recent changes in the test it should now compile
and run properly.  This re-enables the test.

Change-Id: I6c647d99fa1f1b1c53e006fef2865d6be08ec16c
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-02-21 22:31:00 +01:00
Andrew Stanley-Jones
c354b4f12f Fix error in addrlen field
addrlen must be initialize to the amount of space available
in the buffer.

Change-Id: I52945d780bba9d22aeaa7ac5a35a0e54dbea60dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 22:31:00 +01:00
Stephen Kelly
361cd9f9b2 Give the compile flags an EXECUTABLE_ prefix.
The fPIE flag should only be used with executables.

Change-Id: If799ae4a7fe2492af3aac67651659a52d365024a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 22:31:00 +01:00
Simon Hausmann
1386e68b2b Add GL_BGR to the list of defined GL constants, right next to GL_BGRA
We use this one in WebKit's OpenGL texture mapper and it would be
convenient to have it here if it's not defined by the platform.

Change-Id: Idae33e49773e21c6290b164bccd4f209cf9820a2
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-21 22:31:00 +01:00
Oswald Buddenhagen
a0da58b5dd make resolution of default spec less inefficient
resolve only once, in particular on unix.

Change-Id: I090698fc6029322a3a16d179d461af3e8336f6ad
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-02-21 22:31:00 +01:00
Oswald Buddenhagen
3cf6521f54 revamp reading of bootstrap variables
make the "evaluator" able to process simple variable expansions.
cache the processed spec, so it is not re-read for every variable.

Change-Id: I20e69ec7b65faa7d571e68dbfea6c21c79a62641
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-02-21 22:31:00 +01:00
Oswald Buddenhagen
249489d141 regenerate unicode tables after rittk's patches
Change-Id: I60b416fc2dc2f0ccbcf13288a9ba2a42547269ec
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
9514138a5c optimize QString::toLower()/toUpper() for special cases, step 2
from now, QUnicodeTables::specialCaseMap[] starts with a placeholder; so,
if somethingCaseSpecial is true, then somethingCaseDiff is always greater than 0

Change-Id: Ibb1870512836eee71b1521564c0745096c05b2f9
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
5f04962132 optimize QString::toLower()/toUpper() for special cases, step 1
reorganize QUnicodeTables::specialCaseMap as follows:
specialCaseMap contains sequence entries in form { length, a, b, .. }

Change-Id: Iea1f80bc2f4dc1f505428dad981cde26daaa52c7
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
20faf6408a optimize QString::toCaseFolded()
use the codepath similar to QString::toLower()

Change-Id: Ica1948c5e9c82199307d9f823e07d42b50d59480
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
34be7e1625 optimize handling of surrogate pairs in toLower()/toUpper()
high surrogate part never changes on upper/lower casing
(which tested explicitly in the qunicodetables generator),
thus we can copy the high surrogate part in the loop

Change-Id: I24642b35eea7596c6ad494f2a7bc670f10b759a8
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
432a756048 replace 'const QChar &' with 'QChar ' where appropriate
as QChar is actually an ushort and there is no point in taking its
address.

Merge-request: 69
Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 21:05:25 +01:00
Bradley T. Hughes
c8160ea1db Move QSysInfo out of qglobal.h and into a separate header
qsysinfo.h is still included by qglobal.h, but it may be possible
to remove the include from qglobal.h and instead include qsysinfo.h
only where needed (e.g. qendian.h, qdatastream.h).

Change-Id: Ifa2c72e0dae206d88eaa192e15a906297673c048
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 19:33:16 +01:00
Marc Mutz
ca588f40db QEasingCurve: implement copy assignment operator inline
Implement the copy-assignment operator inline, using the
copy-swap idiom. This makes assignment strongly exception
safe, but also simplifies maintainence, because op= is
formulated in terms of the copy constructor now.

Change-Id: I803c9100a520d659b685992237cb76fd114222c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 19:15:48 +01:00
Stephen Kelly
4fc6bc4804 Print out the try_compile output for tests expected to fail.
This way, ctest -V shows that it fails for the expected reason.

Change-Id: I97589d4e90d889ea0b10dbd6192526712dbfdd8e
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 18:58:47 +01:00
Oswald Buddenhagen
d5afe6e7e4 remove bizarre late feeding of user_configs into base_vars
there is no obvious reason why this should happen. if base_vars is used
again, the user configs will be parsed again, too.

Change-Id: Ib56e01a468cdb5e81d610bcaf0163bf730cbae05
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-02-21 18:41:40 +01:00
David Faure
848d3694f6 qmimetype: Fix test failure when LC_ALL is set.
This code sets LANG=en_US so that the method comment(), which returns a translated
name, can be compared with an expected result in English.
(QMimeType::comment uses QLocale::system().name() and QLocale::system().uiLanguages())

But LANG= has no effect if LC_ALL is set, so LC_ALL needs to be cleared (or set
to en_US) for the test to work.

Change-Id: Icb031057769be9bc8c0fcab65daa45e7bf1d5b18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Shane Kearns
3f91cde588 Test for QT_NO_SSL instead of QT_NO_OPENSSL
Change the ifdefs in our own code (except openssl backend) to use the
new configure flag.

Change-Id: I8774734771c66b22164b5fae8fdb27814ac3df7b
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-21 15:28:40 +01:00
Shane Kearns
3fe79f23a9 Make qget manual test compile without ssl support
Change-Id: I35f92328b79df1cfcae52fa6ff8290f260183aea
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-21 15:28:40 +01:00
Shane Kearns
49a7c2fe6e Make https requests fail fast when configured without ssl support
Restored the Qt4 behaviour where attempting a https request using
QNetworkAccessManager fails with ProtocolUnsupportedError instead
of timing out or hanging.

Covered by existing autotests.

Task-number: QTBUG-17189
Change-Id: Iceb1ba6558c7d2b1af8ddf8d4ea9315a5b44d970
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-21 15:28:40 +01:00
Marc Mutz
ae445b20fa QEasingCurve: simplify and fix copy constructor
The copy constructor used the default Private constructor,
followed by the application of the compiler-generated
copy assignment operator, and finally replaced the config
member with a copy of itself.

This is needlessly inefficient.

Worse: it's incorrect: if config->copy() throws, then
*d_ptr is leaked.

Solution: implement the copy constructor for Private,
and use it in the copy constructor of the public class.

Effect: everything that can throw now prevents the new
Private class from being created, and the compiler ends
up cleaning up after us.

Change-Id: I09ed18bb39ee7cd81aaa8ba01676fc202502a8e3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
60f7473782 QHash: more robust use of qDebug()
I'm sure 'line' can't contain anything resembling a format string,
but better safe than sorry.

Change-Id: I0aa0f4a5a03d97b18d6a866c27fa721fcbe0f77b
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
3a8da4a484 QEasingCurve: implement move constructor
The move constructor sets other.d_ptr to zero. This is safe, because
after being moved from, the object is left in a state in which it
can be safely destroyed (delete nullptr is a no-op).

It cannot meaningfully be used anymore (most members will crash with
a nullptr dereference), but in most cases, the moved-from object
cannot be accessed anyway (not a named object), and if a named object
is moved from, it must have been through explicit std::move(), as in
the test case.

The STL makes better guarantees (moved-from containers are .empty()),
but I don't think it's worth introducing a null state into
QEasingCurve just for supporting a use-case that should be
considered a bug anyway.

Change-Id: I4115b7386cdea6960507da6843a0d0196d8e4139
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
6a6178702e QEasingCurve: implement move-assignment operator
Implemented as in QPen etc.

Change-Id: I65b43c6ec7308ca4b44f614594c15c41ab2f89f9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
5d6b2d5e34 QEasingCurve: add member-swap
Implementated as in QPen etc.

Change-Id: Ia08551bf7902b60e115d1b1d2353030597e34841
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
689311a568 QEasingCurve: mark as Q_MOVABLE_TYPE
The private data doesn't contain any back-links to the public
class, afaics. So QEasingCurve qualifies for movable.

Change-Id: Id8ab186fc0a25740458341256b53425dc40bce37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 15:28:40 +01:00
Tor Arne Vestbø
95c759ee0c Use requested window format to match rest of the patch in 38257651
Otherwise we end up with an error at runtime:

  QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x4b5c58

Change-Id: I1e794f427243e40f0a8f572a936b9fb756e89f8a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-21 14:01:29 +01:00
Kent Hansen
12520e8300 Port badxml autotest to QMetaObjectBuilder
The meta-object format is going to change for Qt5. Use QMOB to
insulate the badxml test from such changes.

(It just so happens that the QFAIL("a failure") statement is still on
line 109 after the refactoring, so the expected_badxml.* files'
location tags did not have to be changed.)

Change-Id: I04421d13c4df71c8004fa71cafc4823a59079a41
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-21 13:57:12 +01:00
Harald Fernengel
c69106d1bf Rename Q_MUTEX_LINUX to QT_LINUX_FUTEX
As requested by Thiago

Change-Id: Ie5b00cf4e530e19d360d0bc588f0f051e04b338f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 13:52:52 +01:00
Friedemann Kleint
4fad7ae76a moc: Fix loading of plugins in release mode.
Generate the plugin meta data with "debug" set to false/true
in two code sections #ifdefed QT_NO_DEBUG.

Do not use the value of QT_NO_DEBUG set at moc compile
time which does not work in release mode/Windows.

Change-Id: I0252795ed063bebb2c3b3784f880e64845b5b7e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-21 13:49:02 +01:00
Friedemann Kleint
b071aeccc0 Streamline QPalette initialization code.
Share the brushes to reduce memory usage by QBrushData.

Change-Id: I04044b4c54b1f6a35a73d8bb4d299661ec0136a5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-21 13:30:46 +01:00
Friedemann Kleint
4e4fd63371 Use new plugin system for Input Context plugins.
Change-Id: Ifd1f63499afba546a745815762263a58ebf66460
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 12:54:07 +01:00
Thorbjørn Lund Martsum
13f3346d34 QHeaderView - create a union to save some space.
Beside saving some space it also ensures a bit faster vector operations
(remove and insert memcpy) - and lower the risk for a cache-miss.
(Many operations seems to be about 5-10% faster in the benchmark).

Change-Id: If8109e2146c25f642015906375dfbb449706ce8e
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 12:52:00 +01:00
Thorbjørn Lund Martsum
a4e4c31007 QHeaderview - many sections removed performance boost.
When the QHeaderView model rowCount is decreased then the headerview
needs to remove some sections.

If e.g swapSections had occured then qheaderview before this patch did
a very slow removal by removing one section at a time and for each section
it restored visual and logical indexes.

By temporarily storing the logical index on the section we
can reduce the execution time of this a lot. The old code is only
faster when we remove one index (and is kept for that situation)

There is a complexity in difference (and many factors in our
qheaderview benchmark (the trunc part))

Change-Id: If45eab17fbca3364d458b004980570b5d013e4bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 12:51:46 +01:00
Bradley T. Hughes
84438a77cc Remove qMacVersion()
Add QSysInfo::macVersion() instead, to match the windowsVersion()
function.

Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 12:48:04 +01:00
Friedemann Kleint
69da8588d4 Fix qlogging test.
Build app sub-process first.

Change-Id: I87a11f7fd5d8a82584e496722f79e236191b0fb3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-21 08:39:44 +01:00
Jason McDonald
4eb54f7f36 Improve tst_QPrinterInfo::testForDefaultPrinter().
Be explicit about skipping the test when no default printer is present.

Change-Id: If69b275eb0f490411471ec42798d8aefcc57fd83
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-21 06:10:43 +01:00
Jason McDonald
f8c3074faa Allow printer names to contain hyphens in QPrinterInfo test.
Change-Id: I473627413d2f1cd5637704f2948eb07a264be49e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-21 06:10:39 +01:00
Jason McDonald
7d44f45fb7 Fix warning about unregistered metatype in QWindow autotest.
Change-Id: If9d8d7e1cd52815ef7231294e4890dfafcd28ec8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-21 06:10:34 +01:00
Toby Tomkins
a30f42ddb3 Flag two tests (Win+A, Simon+G) in parseString as expect fail on OSX.
Remove previously defined insignificant test flag as the number of
tests failing has been reduced.

Task-number: QTBUG-24406
Task-number: QTBUG-23058

Change-Id: I01b41f30469cf7a440e21195e105cb30a8db76e2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-21 04:17:51 +01:00
Jason McDonald
ca1aa0da03 Make the QApplication autotest work for shadow builds.
Use QFINDTESTDATA to locate the helper applications.

Change-Id: I604d10e37c9367f2e95225864edf5bf705f1d961
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-21 02:27:23 +01:00
Rohan McGovern
8a182591be tst_qapplication: mark expected failure on mac
The tab key behavior in Qt5 no longer respects the "Text boxes and lists
only" tab navigation option in OSX, which is the default.  This is a
regression since Qt4.

Task-number: QTBUG-24372
Change-Id: I54c1663f8fb259dd847083432102a0bfad7dd69c
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-02-21 02:27:23 +01:00