profile/ivi/qtbase.git
12 years agoRemove QAccessibleInterface::navigate()
Jan-Arve Saether [Sat, 18 Feb 2012 22:29:24 +0000 (23:29 +0100)]
Remove QAccessibleInterface::navigate()

This is replaced by parent(), child() and relations()

Change-Id: Iabff6ec56176a1ca8465d6480860f6e0174fd134
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
12 years agoUse standard unix mutexes on LSB
Harald Fernengel [Mon, 20 Feb 2012 08:37:07 +0000 (09:37 +0100)]
Use standard unix mutexes on LSB

LSB doesn't allow syscalls, so fall back to the normal _unix
implementation

Change-Id: I8aba6147da8b46e3f85b0454cf9aca219811c9fe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoMove QMetaMethod::parameterTypes() implementation to helper function
Kent Hansen [Sun, 19 Feb 2012 18:34:50 +0000 (19:34 +0100)]
Move QMetaMethod::parameterTypes() implementation to helper function

Because of an upcoming change to the meta-object data format, the
ability to extract parameter types from a signature will be needed by
meta-object builders (such as QMetaObjectBuilder) soon.

Change-Id: I1f21b2be41761a5db2f1a05976fad29eb3aebb03
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoPort QSignalEventGenerator meta-object to revision 6
Kent Hansen [Sat, 18 Feb 2012 20:15:45 +0000 (21:15 +0100)]
Port QSignalEventGenerator meta-object to revision 6

We want to drop support for old revisions in Qt 5.

This commit brings the QSignalEventGenerator meta-object in sync with
current moc output.

Change-Id: Id5f4954b08cf49169850bd77543b2a7ab8274c18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoUse QMetaMethod::isValid() to check method validity
Kent Hansen [Fri, 17 Feb 2012 21:26:27 +0000 (22:26 +0100)]
Use QMetaMethod::isValid() to check method validity

The signature() method will soon be replaced by a function that
returns a QByteArray rather than a pointer, and calling it will be
more expensive than calling isValid(). Plus, isValid() looks nicer.

Change-Id: I6844988c84dcadf876fc86bc71c8b310a21f88de
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
12 years agoAdd QMetaMethod::isValid() function
Kent Hansen [Fri, 17 Feb 2012 21:12:05 +0000 (22:12 +0100)]
Add QMetaMethod::isValid() function

This function provides a proper way of determining whether a function
returned by QMetaObject::method() is valid. (Checking whether
signature() returns a 0 pointer, which e.g. testlib does, is not an
ideal API -- especially given that signature() will soon be removed
and replaced by a function that returns a QByteArray.)

Change-Id: I644f476b09904925f2042945f5d0ad744482b682
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoFix typo in QByteArray(QConstByteArrayData) constructor
Kent Hansen [Sun, 19 Feb 2012 18:02:16 +0000 (19:02 +0100)]
Fix typo in QByteArray(QConstByteArrayData) constructor

There is no "str" member in QConstByteArrayData, it should be "ba".

Change-Id: Ife76460e9332733480c1ceded21e78388656092d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
12 years agoDon't call metaObject() several times
Kent Hansen [Fri, 17 Feb 2012 20:48:52 +0000 (21:48 +0100)]
Don't call metaObject() several times

It's sufficient to call it once per invokeMethod.

Change-Id: I1db826027eca87c799f216d65e27c801a23e64e2
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoSmall moc cleanup: Pass lists by const reference
Kent Hansen [Sun, 19 Feb 2012 17:52:19 +0000 (18:52 +0100)]
Small moc cleanup: Pass lists by const reference

generateFunctions() shouldn't (and doesn't) modify the list of
functions, so the list should be passed by const reference.

Change-Id: If5ff810e5623e734816c3089eb8b3fd4f54f2345
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agomoc: Get rid of implicit conversions to const char *
Kent Hansen [Sat, 18 Feb 2012 17:51:46 +0000 (18:51 +0100)]
moc: Get rid of implicit conversions to const char *

moc mostly operates on QByteArrays. When an actual const char * is
needed, it should be explicit.

Change-Id: I0b3e262830128306688f4512a4b59ce8966c2579
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoMinuscule moc cleanup: Don't declare i in function scope
Kent Hansen [Mon, 20 Feb 2012 05:48:17 +0000 (06:48 +0100)]
Minuscule moc cleanup: Don't declare i in function scope

This is not C.
Furthermore, the function-level i was already shadowed in several
places by "for (int i = 0; ..." blocks later in the function.

Change-Id: Ic1777f78d9838bc2921d68337be05de454bbeabe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
12 years agoDon't force CFG_ENDIAN to "auto" on Mac.
Morten Johan Sorvig [Fri, 17 Feb 2012 13:21:37 +0000 (14:21 +0100)]
Don't force CFG_ENDIAN to "auto" on Mac.

We no longer support universal ppc/x86 builds.

Change-Id: I8c4a1d087d02da1ad80d91a7a04147b37e81d74f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoDon't use -rpath-link when building on Mac.
Morten Johan Sorvig [Fri, 17 Feb 2012 13:34:25 +0000 (14:34 +0100)]
Don't use -rpath-link when building on Mac.

The logic here was wrong: test if the
target linker supports -rpath-link, and then set
it for both host and target via mkspecs/qmodule.pri.

Change-Id: Ie4da7ed2e06e784f9edb65a27290913ab838a8c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoFix compilation with MinGW-w64
Jonathan Liu [Sun, 19 Feb 2012 11:33:35 +0000 (22:33 +1100)]
Fix compilation with MinGW-w64

This fixes a "cast from 'void*' to 'int' loses precision" error and adds
a missing argument to qWarning.

Change-Id: I38544c4e317a3f6d1ecf26ebb3e35c66b1878d24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoRename Q_PROCESSOR_POWERPC to Q_PROCESSOR_POWER
Bradley T. Hughes [Fri, 17 Feb 2012 13:17:54 +0000 (14:17 +0100)]
Rename Q_PROCESSOR_POWERPC to Q_PROCESSOR_POWER

IBM's POWER and the PowerPC architecture have been merged into a single
ISA, the Power ISA (see http://www.power.org). Use this unified name in
Qt.

Change-Id: Ia41492b0031d890843e43c5f7ecd1e60c65bb75b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoqwidget_p.h: Remove DontSetCompositionMode from the internal flags
Holger Hans Peter Freyther [Sun, 19 Feb 2012 18:20:49 +0000 (19:20 +0100)]
qwidget_p.h: Remove DontSetCompositionMode from the internal flags

This flag was used by QWS to set or not set the composition mode
when filling the background. E.g. this was used by 'transparent'
windows to set the alpha bits. QPA didn't have this enabled in 4.8,
the code paths are gone in Qt5 and it is the responsibility of the
QPlatformBackingStore to initialize the alpha bits properly.

Change-Id: I4011d842b718d6a40b19922b5f75c597e63079c8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoqpa: Verify that the platform returns a WId that is not WId(0)
Holger Hans Peter Freyther [Wed, 1 Feb 2012 12:32:53 +0000 (13:32 +0100)]
qpa: Verify that the platform returns a WId that is not WId(0)

This is motivated by visiting a customer that re-implemented the
::winId method and returned WId(0) that resulted in a crash. Currently
there is only a comment inside the implementation of the ::winId
default implementation. Add a note to the API documentation, add
a Q_ASSERT to check if our assumption holds true.

Change-Id: I8607a4efc4f561f7849c976cd2454f6fbcb20eaa
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoRemove dead method.
Richard Moore [Sun, 19 Feb 2012 16:31:39 +0000 (16:31 +0000)]
Remove dead method.

Fix Qt 5 TODO

Change-Id: I9a12cc07ebc7c039bbeb53922b0539f177b226f8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoChanged qabstractnetworkcache unittest to use TESTDATA
Kurt Korbatits [Mon, 20 Feb 2012 04:05:47 +0000 (14:05 +1000)]
Changed qabstractnetworkcache unittest to use TESTDATA

- Changed qabstractnetworkcache to install testdata

Change-Id: I8f2ae6103214755ee7898dbc0ee50c0e4d7d45ab
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoModify helper functions to remove embedded QSKIP call and return status.
Toby Tomkins [Mon, 20 Feb 2012 03:29:13 +0000 (13:29 +1000)]
Modify helper functions to remove embedded QSKIP call and return status.

The helper functions contained QSKIP macros which do not also skip their
parent function. These QSKIP function were removed and replaced with a
return success value.

Change-Id: I533f57842fc95beaeb1fcde5235678e9807db056
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoSet tst_qtoolbutton triggered function skipped.
Toby Tomkins [Mon, 20 Feb 2012 05:46:46 +0000 (15:46 +1000)]
Set tst_qtoolbutton triggered function skipped.

This autotest seems to be caught in an event loop preventing further
correct signalling. Mark test function skipped with QSKIP.

Task-number: QTBUG-24374

Change-Id: Ic943a33b71fa87d0873278cb7b7b134c22602be3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoMake QLocale autotest pass for shadow builds.
Jason McDonald [Mon, 20 Feb 2012 01:39:31 +0000 (11:39 +1000)]
Make QLocale autotest pass for shadow builds.

For shadow builds where "make install" had not been run, the
tst_QLocale::emptyCtor test function would fail to find its helper
application because QFINDTESTDATA was not searching for it in the build
directory due to the test not instantiating QCoreApplication.

This commit fixes the test by instantiating a QCoreApplication using the
QTEST_MAIN macro, which also allows some special case code for Windows
CE to be removed.

Change-Id: Ic81d4699da2538c24b36b3d6bd52c4a02ad417f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agotestlib: Report one test result per benchmark test.
Jason McDonald [Fri, 17 Feb 2012 03:39:30 +0000 (13:39 +1000)]
testlib: Report one test result per benchmark test.

Prior to this commit, a benchmark test could report 0..n passes and 0..m
fails or skips, where n is the number of accumulation iterations used to
collect benchmark data and m is the number of times the test function
was invoked.  Depending on the type of benchmark measurer being used,
this could result in a very large volume of test output and inconsistent
pass, fail and skip counts between test runs.

This commit changes the behaviour so that each benchmark test reports
one pass, fail or skip, regardless of the number of iterations used to
collect benchmark data.

This commit also prevents benchmark data being reported in the test
output if the benchmark test failed or skipped, as any benchmark data is
of dubious value in such cases.

The latter change in behaviour requires a minor modification to the
badxml selftest, which now tests quoting of literal strings in xml test
output for both passing and failing benchmarks.

Finally, this commit also adds a new selftest specifically for verifying
correct behaviour for benchmarks that fail or skip.

Task-number: QTBUG-24313
Change-Id: I3426dc659a7511b62fd183a031c7235bc753f497
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoFixed qobject unittest to work from installation directory
Kurt Korbatits [Mon, 20 Feb 2012 00:18:01 +0000 (10:18 +1000)]
Fixed qobject unittest to work from installation directory

- Made test depend on subprogram to make sure it was there when
  test ran.
- install signalbug subprogram

Change-Id: Ie0a19e52d131adcd17c97b263389aecffb81520e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agotestlib: Add selftests for XPASS and XFAIL involving QCOMPARE.
Jason McDonald [Mon, 20 Feb 2012 00:15:57 +0000 (10:15 +1000)]
testlib: Add selftests for XPASS and XFAIL involving QCOMPARE.

Change-Id: I4f897b411aaa51ff453208eda50e12665489074b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agotestlib: make XPASS output slightly less confusing.
Jason McDonald [Fri, 17 Feb 2012 05:11:20 +0000 (15:11 +1000)]
testlib: make XPASS output slightly less confusing.

Prior to this commit, when an unexpected pass occurred the test output
showed the message "XPASS : tst_foo::function() 'expr' returned FALSE",
where the problem was actually that the expression evaluated to true
when it was expected to be false.

This commit changes the output to make it clear that the expression
evaluated to true unexpectedly.

Task-number: QTBUG-22118
Change-Id: Id22c178073d3b75789675ca37a8ef019029b1f91
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoRemove unnecessary image height adjustments from layout.
Andrew den Exter [Mon, 20 Feb 2012 00:50:06 +0000 (10:50 +1000)]
Remove unnecessary image height adjustments from layout.

cb8445f0323b0eefbb04f1d8adad81a00b53abd8 removes an implied +1 from
document line height so we need to remove the compensating -1 from
image ascent/descent for image heights to be correct..

Change-Id: I310c06bcf1ce2eefef42c2828faa0eb435ad71cf
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
12 years agoSpeed up tst_QWaitCondition
Bradley T. Hughes [Thu, 16 Feb 2012 08:47:32 +0000 (09:47 +0100)]
Speed up tst_QWaitCondition

Reduce the thread and iteration counts to make this test execute faster.
This change reduces the runtime to 14 seconds (from 5 minutes, 38
seconds).

Change-Id: Id5ea056cfd33022da5a06809f0598a5cdb02b27b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoImport QMimeType / QMimeDatabase into QtCore.
David Faure [Sat, 18 Feb 2012 15:00:09 +0000 (16:00 +0100)]
Import QMimeType / QMimeDatabase into QtCore.

History of the development before the import:
ssh://codereview.qt-project.org/playground/mimetypes.git

Mimetype definitions come from shared-mime-info where available (UNIX systems),
loaded using a mmap'ed binary cache generated by update-mime-database.
As a fallback if no cache is found, we parse the raw XML files otherwise.

This makes the MIME type support fast and with very low memory usage on UNIX,
and it makes it easy to use on Windows (no dependency on shared-mime-info,
Qt even includes a freedesktop.xml file to use if none are found on the system).

Change-Id: I27b05008216ff936dc463bd80d3893422bfb940e
Reviewed-by: Richard J. Moore <rich@kde.org>
12 years agomake configure ignore $CC and $CXX
Oswald Buddenhagen [Mon, 30 Jan 2012 21:11:43 +0000 (22:11 +0100)]
make configure ignore $CC and $CXX

this was inconsistent with how qmake itself works, and was actually
wreaking havoc.

Change-Id: I5aa83cc88ffe7141cc0c31b03b76c48274f1ebdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
12 years agoIntroduced QWindow::isExposed().
Gunnar Sletta [Fri, 17 Feb 2012 10:30:56 +0000 (11:30 +0100)]
Introduced QWindow::isExposed().

The visible property along with show/hideEvent tracks the
windows visibility from the application perspective and is
really a request. The exposeEvent() along with the isExposed()
accessor is used to notify the application of the actual
state of the window in the windowing system.

Change-Id: I7f5b7ed74a168e34aaa21ce0ae9042ddfb0bf6d8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoAdding hasHeightForWidth as a virtual Widget funcion
Thorbjørn Lund Martsum [Mon, 6 Feb 2012 08:24:50 +0000 (09:24 +0100)]
Adding hasHeightForWidth as a virtual Widget funcion

Just implements what the note states (and removes the private function)

Change-Id: I9a6fd5134460712accf09ba01691df8b9b1f5d0d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
12 years agoAdded error reporting to QJsonParser
Andrew Christian [Fri, 17 Feb 2012 20:38:23 +0000 (15:38 -0500)]
Added error reporting to QJsonParser

Change-Id: Ib2390c0faf1ed7ada3fc185abce83740ad112929
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoQEasingCurve: return QVector for cubic spline representation
Marc Mutz [Wed, 15 Feb 2012 17:55:25 +0000 (18:55 +0100)]
QEasingCurve: return QVector for cubic spline representation

QEasingCurve internally holds the spline data in a
QVector<QPointF>. For the return from cubicBezierSpline(),
the vector is transformed into a QList<QPointF>.

This involves copying, and into an inefficient (for QPointF
payloads) container at that, so deprecate cubicBezierSpline()
in favour of a new toCubicSpline() returning the QVector
directly.

Change-Id: Ie4827fe7c6e289ad97a0b09772e47298779c76ca
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoTrivial doc fix
Richard Moore [Sat, 18 Feb 2012 10:57:42 +0000 (10:57 +0000)]
Trivial doc fix

Change-Id: I9b63e0b63f225b245eec68ea4211cb0f2ccf9bb5
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
12 years agoDocument Q_PROCESSOR_* macros
Bradley T. Hughes [Fri, 17 Feb 2012 08:41:35 +0000 (09:41 +0100)]
Document Q_PROCESSOR_* macros

All known processors and their variants/revisions are documented. I
added Q_PROCESSOR_MIPS_V based on the MIPS64 online documentation, which
documents MIPS64 as a superset of MIPS IV and MIPS V.

Change-Id: Ie2796d4f03499283aa2c96d60f5e37bd74a36ab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoFix qclipboard autotest on Windows.
Friedemann Kleint [Wed, 15 Feb 2012 11:34:04 +0000 (12:34 +0100)]
Fix qclipboard autotest on Windows.

Emit changed signal only if the clipboard is not owned,
in which case QClipboard does it.

Task-number: QTBUG-24184
Change-Id: I27420583a718a5f8cd93b9d361b1e422a75df300
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoFix error handling in QHostInfo windows backend
Shane Kearns [Fri, 17 Feb 2012 15:14:01 +0000 (15:14 +0000)]
Fix error handling in QHostInfo windows backend

If the DNS server returns a non authoritative host not found response,
then windows returns WSATRY_AGAIN error code.
This is now reported as HostNotFound and not UnknownError

Change-Id: I212985acd4e85ff4b2bdb6c57ec403405a7695fb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
12 years agoWindows: Fix QWindow-test.
Friedemann Kleint [Fri, 17 Feb 2012 15:08:17 +0000 (16:08 +0100)]
Windows: Fix QWindow-test.

- Save & Restore style and geometry when switching to
  full screen and back since it is not a real state on
  Windows.
- Obey the positioning policy in setGeometry.

Task-number: QTBUG-24185

Change-Id: I18dea4fd372e0b2e46273a7a27e0c6f4f4bde771
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoqnamespace.qdoc: Add doco for new values of Qt::MouseButton
Rick Stockton [Tue, 14 Feb 2012 16:52:09 +0000 (08:52 -0800)]
qnamespace.qdoc: Add doco for new values of Qt::MouseButton

QtTBUG-22642 added about 25 new values for the Qt::MouseButton Enum.
This change adds documentation for the new values. Note that the
special value 'Qt::AllButtons' is documented at the top (next to
the other special value, 'Qt::NoButton'.) The new internal value
'Qt::MaxMouseButton' is listed as a \omitvalue.

Task Number: QTBUG-22642

Change-Id: Iaec623754156fff8a2c73e357fef82e1fe36354b
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoOnly define QT_NAMESPACE if it is used.
Stephen Kelly [Wed, 15 Feb 2012 21:12:41 +0000 (22:12 +0100)]
Only define QT_NAMESPACE if it is used.

Fixes non-namespaced builds.

Change-Id: I0ec3c29f58042313dfa864f15c2b2d47914cdedb
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
12 years agoEnsure that Qt public headers compile with strict flags
David Faure [Fri, 17 Feb 2012 08:05:39 +0000 (09:05 +0100)]
Ensure that Qt public headers compile with strict flags

Those from
http://wiki.qt-project.org/Coding_Conventions#Conventions_for_public_header_files
(unfortunatey -Wold-style-cast cannot be used due to the glibc macro bswap_16)
and many Qt defines that disable casts.

Change-Id: I97ac707a101df9819e8c031fa75a31b30e20247f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoQProcess documentation typo fix and improvement.
Rafael Roquetto [Fri, 17 Feb 2012 11:17:30 +0000 (12:17 +0100)]
QProcess documentation typo fix and improvement.

The word 'momentaneously' does not exist.

Change-Id: I3d2201d5b7b3a01af5989bb1c3fcd55110d5482c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Till Adam <till@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
12 years agoMention QT_NO_STL in the QString documentation
Simon A. Eugster [Tue, 14 Feb 2012 18:04:11 +0000 (19:04 +0100)]
Mention QT_NO_STL in the QString documentation

Defining QT_NO_STL disables STL functions (toStdString() etc.) too.

Change-Id: Id5c8e12d933af6af63ee7f80fa2d5d7577cd689a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoNo need to stat with QFile::exists before QFile::open, for reading.
David Faure [Fri, 17 Feb 2012 13:16:55 +0000 (14:16 +0100)]
No need to stat with QFile::exists before QFile::open, for reading.

Change-Id: I14ca7f8a377bca39004defc96d69d62c151181f5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Jeremy Katz <jeremy.katz@nokia.com>
12 years agoRemove unnecessary locking from QNetworkProxy constructor
Shane Kearns [Thu, 16 Feb 2012 17:02:11 +0000 (17:02 +0000)]
Remove unnecessary locking from QNetworkProxy constructor

QGlobalNetworkProxy (a singleton) had two phase construction, with
the second phase being called from QNetworkProxy's constructor.
This isn't necessary, and has been reported as causing deadlocks.

Although constructing socket engine handlers has side effects
(they add themselves to a list on construction and remove themselves
on destruction), this appears to be safe. The socket engine handlers
are only used while holding the list mutex, and any socket engines
created don't have any reference to the factory that created them.

With the new version, it is possible that two instances of
QHttpSocketEngineHandler and QSocks5SocketEngineHandler exist
temporarily if a Q_GLOBAL_STATIC initialisation race occurs.
This appears safe, because the loser of the race deletes its
handlers, which remove themselves from the global list as above.

Task-number: QTBUG-13088
Change-Id: I8cf520da717d8ab7d862ab89c6de13aea6d60ac3
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFix warnings about missing file.
Friedemann Kleint [Fri, 17 Feb 2012 10:59:48 +0000 (11:59 +0100)]
Fix warnings about missing file.

Change-Id: I8644d2b80bab9c18f666d742da389e84bf3f124c
Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com>
12 years agoFix handling of urls containing username/password in QNetworkAccessManager
Shane Kearns [Wed, 15 Feb 2012 17:24:14 +0000 (17:24 +0000)]
Fix handling of urls containing username/password in QNetworkAccessManager

QNetworkAccessManager was ignoring the supplied credentials, although
webkit seems to support these urls at a higher level.

Following the behaviour of browsers:
We use supplied credentials if authentication is required.
We add supplied credentials to the authentication cache.
We emit authenticationRequired signal if the credentials were wrong.
We do not use previously cached credentials for that url

Synchronous http requests fail, if the credentials were wrong.

Task-number: QTBUG-18107
Change-Id: If46e8eab1511ba8a0f4bbe0d4efaabc4df0b8ab4
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFix incorrect use of QObject::disconnect in synchronous http request
Shane Kearns [Wed, 15 Feb 2012 17:58:11 +0000 (17:58 +0000)]
Fix incorrect use of QObject::disconnect in synchronous http request

In certain circumstances, this could cause the request to time out
(and repeatedly send bad authentication credentials to the server)
instead of failing with AuthenticationRequiredError.

Change-Id: Iff66b32f1d7268f21fd77b6620aae4b5d49d857f
Reviewed-by: Richard J. Moore <rich@kde.org>
12 years agoUpdate documentation to show NTLMv2 is supported
Shane Kearns [Wed, 15 Feb 2012 15:34:09 +0000 (15:34 +0000)]
Update documentation to show NTLMv2 is supported

This feature was implemented in 4.8, but documentation was not
updated at the time.

Task-number: QTBUG-18181
Change-Id: I657d7ab7aaf43b73b7bf8fd1cb76086522cf5c2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoQSize/QSizeF: add const versions of scale()/transpose()
Marc Mutz [Thu, 16 Feb 2012 15:38:52 +0000 (16:38 +0100)]
QSize/QSizeF: add const versions of scale()/transpose()

Non-mutating functions can (potentially) be constexpr.
On top of that, they often make for more readable code.

Change-Id: I3547327cf5a7162737353a864a1025d0d02ccc2f
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
12 years agoMake 'nmake check' succeed for widgets tests
Miikka Heikkinen [Thu, 16 Feb 2012 11:36:27 +0000 (13:36 +0200)]
Make 'nmake check' succeed for widgets tests

Marked a bunch of tests insignificant, and skipped one crashing test
case in QApplication test, as that couldn't be made to pass simply by
marking the test insignificant.

Once the underlying issues are fixed, the tests need to be re-enabled.

Task-number: QTBUG-24203
Change-Id: I9aea4fa207d307793445efdcaead72219fbf6c4f
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoFix another typo in the evdev keyboard plugin.
Friedemann Kleint [Fri, 17 Feb 2012 12:59:20 +0000 (13:59 +0100)]
Fix another typo in the evdev keyboard plugin.

Amend 3296b7327bd84f420df7e5561d192c0a8d0bb409

Change-Id: Ide58a6b8cbd980eda6ff91948c8f4fb45a30e527
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoWidgets: Remove obsolete QGuiPlatformPlugin.
Friedemann Kleint [Tue, 14 Feb 2012 15:46:31 +0000 (16:46 +0100)]
Widgets: Remove obsolete QGuiPlatformPlugin.

It has been superseeded by QPlatformTheme.

Task-number: QTBUG-24204
Change-Id: I8c4131c7bfd8201e747984d772ed8042610192b8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agoDisable 'check' target generation for network autotests for Windows.
Miikka Heikkinen [Fri, 17 Feb 2012 10:28:50 +0000 (12:28 +0200)]
Disable 'check' target generation for network autotests for Windows.

A number of network autotests are unstable in Windows, so don't
generate check target for them as is done for mac.

Once the tests are acceptably stable, this needs to be reverted.

Change-Id: I18262e28ce40eba541aecf3cfb651bff34698ead
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoFix "check" target when load(testcase) is used in .pro file.
Miikka Heikkinen [Fri, 17 Feb 2012 08:48:22 +0000 (10:48 +0200)]
Fix "check" target when load(testcase) is used in .pro file.

The "check" target always depended on debug-check on projects that
explicitly loaded the testcase.prf, even if Qt was configured with
-release parameter. This obviously caused build failure. Changed the
testcase.prf to check which configuration is preferred using
CONFIG(debug, debug|release) like is done with similar cases in other
.prf files.

Task-number: QTBUG-24332
Change-Id: Ib5140b106e99efe51932bdd5a48914786de23230
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoQt 5 plugin system: Fix handling of namespaced plugin classes.
Friedemann Kleint [Fri, 17 Feb 2012 10:01:26 +0000 (11:01 +0100)]
Qt 5 plugin system: Fix handling of namespaced plugin classes.

- Add 'using namespace' to moc code as was the case in 4.8.

Change-Id: I26cba9ad74bf05eecc5205714c32c3176695e3b4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoClean up default arch setting on Mac OS X
Bradley T. Hughes [Wed, 15 Feb 2012 12:49:55 +0000 (13:49 +0100)]
Clean up default arch setting on Mac OS X

Remove config.tests/mac/defaultarch.test, but do the same type of
default arch detection, only using the qmake binary instead of compiling
an empty file. Qt 5 will only support 10.6 and up, which means we
only support i386 and x86_64 now.

Change-Id: I24949ac803b965c523b1ee45cf769e266dcde134
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agoFortune client example - list all IP addresses
Shane Kearns [Wed, 15 Feb 2012 20:12:15 +0000 (20:12 +0000)]
Fortune client example - list all IP addresses

The first IP address on the machine might not be a usable one.
Changed the QLineEdit to a QComboBox, and populated it with
all IP addresses of the machine, along with the machine names
if they are configured.

Task-number: QTBUG-13121
Change-Id: I7c443f5ce6efb0d0b525c5abad1671d3dcbba33c
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
12 years agoFixed API in QWindow: visible() -> isVisible().
Samuel Rødal [Fri, 17 Feb 2012 09:19:35 +0000 (10:19 +0100)]
Fixed API in QWindow: visible() -> isVisible().

Change-Id: I14706abb8441c153f738563cb1a46205fdb2dae6
QWindow::visible() did not follow the API guidelines.
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
12 years agoQStandardPaths implementation configured using JSON
Jeremy Katz [Wed, 15 Feb 2012 17:49:31 +0000 (18:49 +0100)]
QStandardPaths implementation configured using JSON

The default JSON file is /etc/user-dirs.json, but may be
overridden by setting PATH_CONFIG_HOME to the file to be used.

This provides functionality similar to the XDG based QStandardPaths,
but uses a JSON file to define paths, rather than the XDG A=B
format. Values other than HomeLocation and TempLocation may be
specified by removing the "Location" postfix, converting to upper
case, and separating words with _. Values are independent. For example,
CacheLocation does not depend on GenericCacheLocation.

Variables specified as ${[^{]*} will be replaced with environment
variables.

Change-Id: I374f5e6bae498dbfa9cb4ecadf915b05fb91fc34
Reviewed-by: David Faure <faure@kde.org>
12 years agoWindows: Fix compilation with -qtnamespace
Kai Koehne [Fri, 17 Feb 2012 09:10:27 +0000 (10:10 +0100)]
Windows: Fix compilation with -qtnamespace

Change-Id: I00ba88887100b699d620875d868f8a769259a768
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoExpect failure in tst_QStyleSheetStyle::hoverColors()
Bradley T. Hughes [Thu, 16 Feb 2012 13:18:10 +0000 (14:18 +0100)]
Expect failure in tst_QStyleSheetStyle::hoverColors()

This is similar to the focusColors() failures in QTBUG-23686.

Task-number: QTBUG-23686
Change-Id: I1f01a4e41e61a7a664309be34cfa4fe916a92b15
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoSkip tst_QGuiApplication::focusObject() on Mac OS X
Bradley T. Hughes [Thu, 16 Feb 2012 08:40:02 +0000 (09:40 +0100)]
Skip tst_QGuiApplication::focusObject() on Mac OS X

This test fails intermittently, and at random locations.

Task-number: QTBUG-24322
Change-Id: Ied6dd4d1593066debc0fb48c6ca2a17a1f4d51b7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoSkip all tst_QFontDialog tests on Mac OS X
Bradley T. Hughes [Thu, 16 Feb 2012 08:35:53 +0000 (09:35 +0100)]
Skip all tst_QFontDialog tests on Mac OS X

All of these tests currently hang.

Task-number: QTBUG-24321
Change-Id: I7664b57f6539d4c03008701da66e193019a4440a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoSkip hanging tst_QColorDialog test, expect failing test on Mac OS X
Bradley T. Hughes [Thu, 16 Feb 2012 08:31:59 +0000 (09:31 +0100)]
Skip hanging tst_QColorDialog test, expect failing test on Mac OS X

tst_QColorDialog::native_activeModalWidget() hangs, so skip this test.
tst_QColorDialog::task247349_alpha() fails, so XFAIL this failure.

Task-number: QTBUG-24320
Change-Id: Ie4d69e07063e9a648ec4fa3337274143a52ea3e3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoSkip hanging/failing tst_QApplication tests on Mac OS X
Bradley T. Hughes [Thu, 16 Feb 2012 08:22:39 +0000 (09:22 +0100)]
Skip hanging/failing tst_QApplication tests on Mac OS X

The first block of tst_QApplication::quitOnLastWindowClosed() hangs
on Mac OS X, so skip that block for now.

tst_QApplication::testDeleteLAter() both hangs and fails on Mac OS X,
so skip the test and XFAIL the failure.

Task-number: QTBUG-24318
Task-number: QTBUG-24319
Change-Id: Ice11292d84e63215f1bb9e03f3ef369943d1d887
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
12 years agoRemove unused config.tests from config.tests/mac/*
Bradley T. Hughes [Wed, 15 Feb 2012 11:51:15 +0000 (12:51 +0100)]
Remove unused config.tests from config.tests/mac/*

The xarch.test and crc.test are not run by configure, so remove them
along with the related CFG_MACH_XARCH and QT_NAMESPACE_MAC_CRC configure
variables.

The kEventClassQt variable in qt_mac_p.h is also unused now, so remove
it as well.

Change-Id: I596ab9b493ce3164b6a4d40e8942479efc91b60d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
12 years agoExpect tst_QSettings::ctor(native) failures on Mac OS X
Bradley T. Hughes [Tue, 14 Feb 2012 07:46:22 +0000 (08:46 +0100)]
Expect tst_QSettings::ctor(native) failures on Mac OS X

The default constructor for QSettings does not set NoAccess status, even
if the organization domain, organization name, and application name are
empty. Instead of trying to fix QSettings, keep the existing behavior,
and test for it.

Failures from tst_QSettings no longer need to be ignored, so
mac:CONFIG+=insignificant_test has been removed from the .pro file.

Task-number: QTBUG-22745
Change-Id: Ic9f8b6821c483c217e1ef2ece704be2da169e340
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
12 years agoAdd palette() and further hints to QtGui/QPlatformTheme.
Friedemann Kleint [Fri, 10 Feb 2012 16:17:36 +0000 (17:17 +0100)]
Add palette() and further hints to QtGui/QPlatformTheme.

- Move palette() from deprecated QtWidgets/QGuiPlatformPlugin
  to  QtGui/QPlatformTheme, Make it return a const * since
  QPalette does not have isNull().
- Initialize QGuiApplication::palette() and
  QApplication::systemPalette() from it.
- Do not initialize QPalette from QGuiApplication::palette()
  unless app_pal is non-null (default to Qt::black if it is 0).
  This avoids initialization order crashes/recursions in the
  QPA plugin. Streamline initialization function.
- Remove styleName(), systemIconThemeName() and iconSearchPaths()
  from QGuiPlatformPlugin and re-add them as
  QPlatformTheme::themeHint().
- Remove styleHint() from QGuiPlatformPlugin, add it to
  QPlatformTheme::themeHint().
- Add UNIX themes with factory function (Generic,
  KDE, Gnome), taking it from Qt 4.8 code (stripping the
  KDE 3 code).
- Implement Windows palettes.

Task-number: QTBUG-24204

Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
12 years agoPlugin loader: Output offending plugin name in warning.
Friedemann Kleint [Fri, 17 Feb 2012 07:48:05 +0000 (08:48 +0100)]
Plugin loader: Output offending plugin name in warning.

Change-Id: I0aba0cf04f703b893459af55263685c5548a92f9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoConvert jpeg plugin to new format
Lars Knoll [Fri, 10 Feb 2012 09:57:48 +0000 (10:57 +0100)]
Convert jpeg plugin to new format

Change-Id: Icadeb366c39a71dac948904197464f7e0b4272b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoConvert ico plugin to new format.
Lars Knoll [Fri, 10 Feb 2012 09:54:01 +0000 (10:54 +0100)]
Convert ico plugin to new format.

Change-Id: Ib0fb7bb9f853e39cd62b693bb5b43ae15f750d84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoConvert GIF plugin to the new format
Lars Knoll [Thu, 9 Feb 2012 20:34:26 +0000 (21:34 +0100)]
Convert GIF plugin to the new format

Change-Id: I3adf1d2402a07213cb4cb5193c465bd820919bd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoEnables QProcess back on QNX.
Rafael Roquetto [Wed, 15 Feb 2012 15:52:43 +0000 (16:52 +0100)]
Enables QProcess back on QNX.

Because fork()/vfork() on QNX are not supported on multithreaded applications,
QProcess had been disabled on this platform. The corresponding code has now
been replaced with functions that wrap around spawn().

Change-Id: I46091b7d41f322a5cad07d17893aa929c84941ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoStatic plugins don't break QFactoryLoader::keys()
Lincoln Ramsay [Fri, 17 Feb 2012 06:31:06 +0000 (16:31 +1000)]
Static plugins don't break QFactoryLoader::keys()

The = means that a single, static, compat plugin replaces the list of
keys (eg. from previously checked static plugins or from dynamic plugins).

Using += prevents this undesirable behaviour.

Change-Id: I3a40752c08dddbfe81444ca9c782b633e9742ab9
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoChanged qnetworkreply unittest to work from install directory
Kurt Korbatits [Tue, 14 Feb 2012 01:46:03 +0000 (11:46 +1000)]
Changed qnetworkreply unittest to work from install directory

- made subdir test depend on echo
- remove SRCDIR and changed to use TESTDATA and QFINDTESTDATA
- added waitForFinish() to handle slow networks
- removed core module header from echo subprogram and replaced
  with needed header only
- Added ipv6 skip to connectToIPV6Address() if not available
- Added check QT_BUILD_INTERNAL and skip tests if backend
  not available
- Skip permission tests if run as root
- Removed win32 debug and release directory locations so that
  application is in known location relative to test data

Change-Id: I58c3c2fca3cd2fee72fdb81d016bb4fd7fe08ac2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoRemoved rfc3252.txt from networkselftest unittest
Kurt Korbatits [Wed, 15 Feb 2012 23:32:06 +0000 (09:32 +1000)]
Removed rfc3252.txt from networkselftest unittest

- no longer needed after test that used it was removed

Change-Id: I63fc8a9db07f9250507becb9bf6c2aefe0fdc254
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
12 years agoFix naming of plugins for QPA plugins and use new plugin system.
Friedemann Kleint [Thu, 16 Feb 2012 14:30:37 +0000 (15:30 +0100)]
Fix naming of plugins for QPA plugins and use new plugin system.

- Fix naming "com.nokia" -> "org.qt-project" in platform
  integration & platform theme.
- Adapt Windows, XCB, Cocoa, Minimal.

Change-Id: I7834f5c3d94473b6f06c1bffee074a70ee25f426
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoRemove usages of QT_ARCH and QT_ARCH_* from qtbase
Bradley T. Hughes [Fri, 10 Feb 2012 14:50:47 +0000 (15:50 +0100)]
Remove usages of QT_ARCH and QT_ARCH_* from qtbase

The architecture is detected at compile time based on the predefined
macros from the compiler. Don't use QT_ARCH in .pro, .pri, or .prf
files.  The PNG_NO_ASSEMBLER_CODE define from libpng.pri is not present
in the current copy of src/3rdparty/libpng, so no change in
functionality is expected.

The conditional for the SUPPORT_JIT define in pcre.pri is moved to
src/3rdparty/pcre/config.h, again so that we can use the compiler's
predefined macros to detect the architecture at compile time.

Replace QT_ARCH_ARM, QT_ARCH_MIPS, and QT_ARCH_SPARC with their
Q_PROCESSOR_* equivalents.

Replace QT_ARCH_INTEGRITY, QT_ARCH_VXWORKS, and QT_ARCH_WINDOWSCE with
their Q_OS_* equivalents.

Note that this commit also effectively disables the SPARC atomic
implementation. An inline implementation for SPARC needs to be added,
or we remove the current code and instead rely on the GCC intrinsic or
C++11 std::atomic support on SPARC.

Note also that this commit does not remove QT_ARCH from configure or
qconfig.h. This will continue to be set until all Qt 5 projects can be
moved away from using QT_ARCH.

Change-Id: I5de747cc4436d21941329974cff3016970f497b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoSome small doc fixes, typos and removal of one incorrect paragraph
Andy Shaw [Fri, 3 Feb 2012 22:53:31 +0000 (23:53 +0100)]
Some small doc fixes, typos and removal of one incorrect paragraph

The QTextStream paragraph that is removed referred to something that is
incorrect.  This was confirmed for Windows, Linux and Mac.

Change-Id: Ibac8f82482f2060308b5b8485d6da228bdf52fe6
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
(cherry picked from commit 80cebfde10cf34dcc0777c24f1b3ff37cad20181)

12 years agoDon't render glyph with FT with fetchMetricsOnly
Jiang Jiang [Wed, 15 Feb 2012 13:41:07 +0000 (14:41 +0100)]
Don't render glyph with FT with fetchMetricsOnly

Neither rendering with outline nor fetchMetricsOnly requires the
rendering from FreeType so we don't need to render them or cache
it. It should speed up recalcAdvances() quite a lot.

Change-Id: I0f623cb4f79da2edf6e9c9634a2f22fb0c66823c
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoEnsure that QSqlDatabase::database() is still thread-safe
Andy Shaw [Thu, 10 Nov 2011 06:56:57 +0000 (07:56 +0100)]
Ensure that QSqlDatabase::database() is still thread-safe

QSqlDatabase::database() is documented to be thread-safe and when the
driver is queried for the numericalPrecisionPolicy set then it can
comprimise the thread-safety.

Since the driver itself (if one is set) will be queried for the
numericalPrecisionPolicy when numericalPrecisionPolicy() is called on
the QSqlDatabase then we can have it fallback to the default instead
rather than taking the driver's own setting.

Task-number: QTBUG-13423
(cherry picked from commit e7e9fca6c0cd1d0869029fc6e9d7605234ee5bb2)
Change-Id: Ie7e9fca6c0cd1d0869029fc6e9d7605234ee5bb2
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
12 years agoEnsure the header's context menu is in sync with the visible sections
Andy Shaw [Fri, 3 Feb 2012 23:45:33 +0000 (00:45 +0100)]
Ensure the header's context menu is in sync with the visible sections

When the filedialog was reshown the context menu for the header was not
in sync with the sections that were actually visible.  This ensures that
it is in sync after the state of the header is restored.

Task-number: QTBUG-23271

Change-Id: Ia1546bf300d43a5822482f63de99eb52b674bf52
Reviewed-by: Zeno Albisser <zeno.albisser@nokia.com>
(cherry picked from commit 2e220e4603d6a0c21efee3a884be76e9f2d7ebb7)

12 years agoUse ctest to run all tests and print output.
Stephen Kelly [Wed, 15 Feb 2012 22:19:19 +0000 (23:19 +0100)]
Use ctest to run all tests and print output.

Change-Id: Ib5a8513cc2d08adce49602b2590059b918b1ffda
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
12 years agoOnly define QT_NAMESPACE if it is used.
Stephen Kelly [Wed, 15 Feb 2012 21:12:41 +0000 (22:12 +0100)]
Only define QT_NAMESPACE if it is used.

Fixes non-namespaced builds.

Change-Id: Ie743fc57e7f208fdd50c61b08dc8a4b150de3930
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
12 years agoCompilation fix: missing includes for geteuid()
Marc Mutz [Thu, 16 Feb 2012 13:37:04 +0000 (14:37 +0100)]
Compilation fix: missing includes for geteuid()

Change-Id: I054b8c9a398b5e192c2e005a39cba19bb4930966
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years ago[QTBUG-22847] Compile with C++11 compiler
Marc Mutz [Thu, 16 Feb 2012 06:40:20 +0000 (07:40 +0100)]
[QTBUG-22847] Compile with C++11 compiler

C++11 supports user-defined string literals, which makes
the C++98-accepted literal string concatenation sequence
  "foo"MACRO
illegal under C++11.

The solution is to add whitespace between the string
literal and the macro. For symmetry, this patch adds it
on both sides.

Change-Id: Ie0c698f610986c4d1b12dc2083489043b696936d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoxcb: avoid use of statically-sized QList
Marc Mutz [Thu, 16 Feb 2012 13:39:51 +0000 (14:39 +0100)]
xcb: avoid use of statically-sized QList

Change the use of QList<QPair<>> to a simple C array of xcb_keycode_t*s.
This is possible since the number of elements in the container is
statically known.

I have not measured speedup; this is just preventing premature pessimisation.

Change-Id: I8855fc8a4e7ee840d8b7497ec4166074da7d8ea8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoMake sure to print short text for QSslCertifictaeExtension.
Casper van Donderen [Thu, 16 Feb 2012 15:41:38 +0000 (16:41 +0100)]
Make sure to print short text for QSslCertifictaeExtension.

Change-Id: If2471bea27f095352ae8c28604e104b896fd97c7
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFix qlogging test for release configuration
Miikka Heikkinen [Thu, 16 Feb 2012 12:20:57 +0000 (14:20 +0200)]
Fix qlogging test for release configuration

The helper process 'app' wasn't built in release configuration.

Also improved finding the helper executable to utilize
QFINDTESTDATA and print out a proper errors if it could not be
found or started.

Note that adding ".exe" to process name in Windows is unnecessary
as QProcess already does that for you, so removed the ifdeffing.

Task-number: QTBUG-24330
Change-Id: Ibe75e0ecd24181ab623d0a60f17ecaf92052b0dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoQWindow-test: Fix QSignalSpy warning about Qt::ScreenOrientation.
Friedemann Kleint [Thu, 16 Feb 2012 11:50:22 +0000 (12:50 +0100)]
QWindow-test: Fix QSignalSpy warning about Qt::ScreenOrientation.

Change-Id: I5954445057c1a597b5062ee8e472d684832812e5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoQMimeData: export URLs as text too
David Faure [Sat, 11 Feb 2012 01:13:22 +0000 (02:13 +0100)]
QMimeData: export URLs as text too

This allows to drop or paste them into lineedits and text widgets
(including such widgets in non-Qt applications)

Implementation note: this is done on-demand rather than in setUrls
so that it's still possible to setText explicitely; the new code
is only a fallback for when no text/plain data is available.

Change-Id: Ie90c43a30bfa64a6047b627e7351d20bf5ec8e03
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoRemove historical +1 from font height calculation
Eskil Abrahamsen Blomfeldt [Fri, 3 Feb 2012 13:28:16 +0000 (14:28 +0100)]
Remove historical +1 from font height calculation

Historically, we've calculated font height as ascent+descent+1.
In Qt 4, a patch was added to work around this by subtracting
1 from the descent of the font engines. We now remove the +1 and
the work arounds.

Change-Id: I7e25d49b97ac892015d3328f32d70eb9a7c2d88f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoAvoid loading and keeping unused fallback font engines
Eskil Abrahamsen Blomfeldt [Wed, 15 Feb 2012 14:06:00 +0000 (15:06 +0100)]
Avoid loading and keeping unused fallback font engines

When we request glyphs from fallback fonts, we would potentially
load all fonts on the system into memory. This is especially true
for glyphs that are not supported by any font (or by the last in
the list) in any "Common" script (which e.g. includes CJK).

This would make any application which tried to display unsupported
glyphs use huge amounts of memory for keeping unused fonts cached,
only limited by the number of fonts on the system.

The patch contains two solutions: First, before loading the font,
the multi font engine will be asked whether it needs to be tried
for the given character. By default, this will always be true, so
all fonts will be tried, but with the new font config multi engine
in the platform plugin, it will ask FontConfig whether the font
contains a glyph for the character.

Should the font be loaded and still fail to resolve the character
(which could be the case for other platforms), we will simply
delete it again immediately instead keeping it cached.

Change-Id: I92dfb39289a359f49caa02c2caf8baf66098fb59
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
12 years agoBase active window handling on WM_SET/KILLFOCUS.
Friedemann Kleint [Thu, 16 Feb 2012 11:24:32 +0000 (12:24 +0100)]
Base active window handling on WM_SET/KILLFOCUS.

Make it work for child windows, fixing the isActive()
test of QWindow.

Task-number: QTBUG-24185
Change-Id: I75597c2d322969f7e109d76e30b9b1f4b66c6e1e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 years agoFix QWindowsClipboard crash when mimeData is NULL.
Miikka Heikkinen [Thu, 16 Feb 2012 10:27:46 +0000 (12:27 +0200)]
Fix QWindowsClipboard crash when mimeData is NULL.

When setting NULL mimeData in QWindowsClipboard::setMimeData, and the
OleSetClipboard call failed, the warning print crashed because it
tried to access mimeData.

Task-number: QTBUG-24327
Change-Id: I1f56fd28c9191a330e14a93b4b11ac9c89db6985
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
12 years agoQDebug: Add support for %{pid}, %{appname} and %{threadid}
David Faure [Sun, 12 Feb 2012 00:39:47 +0000 (01:39 +0100)]
QDebug: Add support for %{pid}, %{appname} and %{threadid}

Change-Id: I4add0a374e6524b615c6dc0ecfb010a90075b04f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
12 years agoFix tst_QFileSystemWatcher failure on Mac OS X
Bradley T. Hughes [Tue, 14 Feb 2012 06:03:18 +0000 (07:03 +0100)]
Fix tst_QFileSystemWatcher failure on Mac OS X

The watchFileAndItsDirectory() test would fail due to atime updates for
the first watched file coming up to 2 seconds after the file was closed.
Observation shows that the atime has a 2 second resolution on Mac OS X
using HFS+, so add an appropriate delay to make sure that the atime
update from the kqueue based file system watcher can dispatch all
updates.

Task-number: QTBUG-22744
Change-Id: Ie79af20d6b4c154021307c8a8f6d336369720337
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
12 years agotestlib: Skip test function if init() fails.
Jason McDonald [Thu, 16 Feb 2012 06:00:41 +0000 (16:00 +1000)]
testlib: Skip test function if init() fails.

Prior to this commit, the following statement in the qtestlib
documentation was untrue: "If init() fails, the following testfunction
will not be executed, the test will proceed to the next testfunction."
If init() called QSKIP, the test function would be skipped, but if
init() reported a failure, the test function would still be executed
(even though doing so could be unsafe).

This commit makes testlib skip a test function if init() reports a
failure and enhances the selftests to cover skips and fails in both
init() and cleanup().

Task-number: QTBUG-20371
Change-Id: Id1cc8464ae0b8c257ae1b74dbe9189a501f5366b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>