Commit Graph

6073 Commits

Author SHA1 Message Date
Thiago Macieira
6028efa3ff Add the code that recodes URLs.
This one function is an all-in-one:
 - UTF-8 encoder
 - UTF-8 decoder
 - percent encoder
 - percent decoder

The next step is add the ability to modify the behaviour, by telling
the function what else it must encode or decode and what it should
leave untouched.

Change-Id: I997eccfd2f9ad8487305670b18d6c806f4cf6717
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
4c7e950aad Mark QUrl::{to,from}Punycode as deprecated since 5.0
These functions are now aliases to {to,from}Ace, which are usually
what you want. The original functions from Qt 4.0 had the wrong
semantics and wrong name. The new ones from Qt 4.2 execute the ACE
processing from IDNA (specifically, the ToASCII and ToUnicode
operations described in the RFC).

But so as not to be without tests, export the tests in unit testing
environment and test the punycode roundtrip. Note that the
tst_QUrl::idna_test_suite test tests *only* the Punycode roundtrip,
not the nameprepping.

Change-Id: I9b95b4bd07b4425344a5c6ef5cce7cfcb9846d3e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-03-30 01:19:59 +02:00
Thiago Macieira
8fa2a41bd5 Move the QByteArray-based percent-encoding activities to QByteArray
Copy the unit tests that related to percent-encoding to
tst_qbytearray.cpp and use public functions to execute
QUrl::fromPercentEncoded and QUrl::toPercentEncoded.

Change-Id: I6639ea566d82dabeb91280177a854e89e18f6f8d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-03-30 01:19:59 +02:00
Debao Zhang
94f7d70a4b Remove qpa option form configure.exe
Change-Id: Ib35b65be43f76ac4babf6e7dd3b0763274f0ab8c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-30 00:38:31 +02:00
Jędrzej Nowacki
d78fe5f8d3 Make QArrayData::shared_null zero terminated.
This is expected by QByteArray and QString

Change-Id: Ib668b144bdc0d2c793018c8f8d794f249eaf935c
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-29 23:26:34 +02:00
Jędrzej Nowacki
ca604b5b77 Remove compression support from moc.
Moc doesn't compress anything so it doesn't have to link against zlib.
In practice it is a build fix for a bug exposed by previous patches.

Change-Id: I0debfccc903b3addd7c16be8421a51b6be9ceb2f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-29 23:25:40 +02:00
Holger Hans Peter Freyther
dbb9d96bdb device: Introduce a qmake test function
A common issue for our users is that they do not provide the path
to their cross compiler or don't have it in their $PATH. Introduce
a qmake testFunction to sanity check the presence of the compiler.

Change-Id: I7d41db139d2a9c67334908b96e9f5e8f996426f6
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-29 21:21:01 +02:00
Casper van Donderen
c3ccd3d41d QDoc: Add hand-written ditamaps as children of qt.ditamap
Known issues: the hand-written ditamap has to be a flat list. The
function used should preferably become a recursive function, which would
allow you to have as many nested items as you want.

Change-Id: I0dc897da5222f6409e2e58c42200c342bc8cacf2
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-29 18:29:04 +02:00
Casper van Donderen
c1cb279019 QDoc: Remove LOCAL LINK debug output.
Change-Id: Iac8c5df2ca22315f34bbb738314299a23c646b2a
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-29 18:28:15 +02:00
Casper van Donderen
c8f7677596 QDoc: pre-/append qmlmodule/module to distinguish names.
It is possible that a \qmlmodule and \module have the same name. This
would then cause a conflict, since both of the output pages would have
the same name. This change make sure that C++ modules (\module) output
pages are appended with -module and that QML modules (\qmlmodule) are
prepended with qmlmodule-.

Change-Id: I2ce352f05ff388469fd02458354154dbf8b7b0db
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-29 18:27:26 +02:00
Casper van Donderen
9d37235bdd QDoc: Do not generate the sub-lists in automatic ditamap.
Change-Id: I6f91495dabf5e4aa2d0d7c1fbc690bd1fd53bd17
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-29 18:27:00 +02:00
Denis Dzyubenko
e444dcf5b1 Don't copy the whole binary input into QJsonDocument
If the input binary data exceeds the size of the enclosed binary object, we
shouldn't allocate buffer and copy the whole content, but only content size
that has meaningful data.

Change-Id: I32587f504bd120c6e4e3d7e1b3403961a6f0d537
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-29 16:08:40 +02:00
Denis Dzyubenko
aeb1824a84 Validate size of the input in QJsonDocument::fromBinaryData
Change-Id: Ifc1d11b4dfbbe782d4e153118059c9affb833fa4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-29 16:08:40 +02:00
Lars Knoll
698b33fcce Properly detach when the modified object is a sub object
The clone() method didn't detach if we had enough memory
allocated, but didn't consider that the object being
modified is not the root object of the binary blob.

Change-Id: I9a479ae1c873b7fe9cff7e13c539e7a41961bf68
Reviewed-by: Cristiano di Flora <cristiano.di-flora@nokia.com>
Reviewed-by: abcd <amos.choy@nokia.com>
Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
2012-03-29 16:08:40 +02:00
Bradley T. Hughes
19109a7697 Remove modal child widget buttons from tests/manual/windowmodality
This functionality does not work anymore. Modality is tied to top-level
windows, not to any arbirtrary QWidget.

Change-Id: Ie7545cbcfbf4021850b215f014bb0f7274971327
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-29 16:08:40 +02:00
Jonas Rabbe
5185a28139 Fix a crash in QFactoryLoader
The change in plugin loading has meant that different plugins in the
same plugin folder will not be handled properly when loaded with
different instances of QFactoryLoader.
A solution is to only unload compatability plugins from
QFactoryLoader::update() since they are the only plugins that are
actually loaded in that method.
This auto test shows the error on the current version of QFactoryLoader
and passes with the fix described above.

Change-Id: I12001525d51bb631d6742c5965357598322f247c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-29 13:58:13 +02:00
Pekka Vuorela
d3c6664fb0 Change documentation to refer to up to date property name in QtQuick
Change-Id: I78550862a2b1eb14f89c5ad01cc3718cf83606d2
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-03-29 13:23:55 +02:00
Jędrzej Nowacki
11f8eb2e34 Add an assert to QMetaObjectBuilder.
Constructors and destructors don't have a return value, but every other
method return at least "void".

Change-Id: Ie621aff83e44c187e950910d5c0684ba1a6579b8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-29 13:20:36 +02:00
Jędrzej Nowacki
fb650b0271 Compile QArrayData in bootstrap phase.
This change will be needed during migration from QByteArrayData to
QArrayData.

Change-Id: I0c8d6f9ed3ef7c33af62736af55259a8f9a70c0f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-29 11:28:41 +02:00
Friedemann Kleint
4451010026 Determine font smoothing gamma in initialization.
Avoid calls to QStyleHint and QPlatformIntegration from
threads.

Change-Id: I851ef029ea348f182e0b42536d0a994960aa9187
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-29 08:48:43 +02:00
Andy Shaw
6eae3cec5a The scaling should not effect the width of a cosmetic pen
When the scaling effects the pen width so that it is less than 1 pixel
in width then it would use the QCosmeticStroker to draw, however this
should not be the case for cosmetic pens that are not less than 1 pixel
in width as the scaling does not change their width.

Task-number: QTBUG-25006
Change-Id: I142db0f3a7ee02aa87171495d5a7a7011100814e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-29 06:22:07 +02:00
Thiago Macieira
2d35844ee5 Fix operator precedence order.
Clang (I guess it was clang) reports:

io/qipaddress.cpp:276:34: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]

Fix the precedence by wrapping the ternary expression in parentheses.

Change-Id: I1c995dc8e2b1b831480ea8f8a695f7f89c08fcac
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-29 02:07:38 +02:00
Casper van Donderen
c1e05824ad qdoc: Add simple return types such as void to output.
Change-Id: I2c9b2bc982f9fa3390a7b5bd322df9e015e53824
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 23:15:32 +02:00
Casper van Donderen
05d1929685 qdoc: Use otherprops attribute for DITA signals/slots.
Change-Id: Id85860abfb8abdf0b7bd95a65384576d8970096b
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 23:15:32 +02:00
Thiago Macieira
cc3ff3c1f6 Make qsimd.cpp also complain if required features are missing
Record in a variable the features that the compiler used for code
generation when Qt was compiled. Then complain if those are
missing. This is required in qdrawhelper_plain.cpp to make it disable
the plain build, keeping only the AVX, Neon or SSE2 builds. This code
works for GCC, ICC on Unix and Clang.

MSVC support is pending. It will involve defining the same macros
from qsimd_p.h when the compiler support is detected.

Other compilers are unknown. The only relevant one would be Sun Studio
for x86, but I have no access to it to find out what macros it
predefines.

Change-Id: I25f2d90b3c7ac7bd0442f4b349b6ee3bd751a95b
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 22:32:40 +02:00
Harald Fernengel
3df8a12f05 Compile fix for Linux Standard Base
Change-Id: I1a6dba065c45bf732c0174ed0a6492cc80478985
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
2ad8b63762 Fix warning introduced in Intel CC 12.1
Change-Id: Ie50b0bf0741637a3acfc39360804590f3c133332
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
d6d997a36f Ensure that qdrawhelper.cpp is compiled with vectorisation active
The GCC option -ftree-vectorize is enabled only at level -O3, so force
-O3 if this is an optimised build. Also, ensure that we're using SSE
for floating point math if we're in x86 (32-bit) builds.

No change is necessary for the Intel compiler, since it enables
vectorisation by default at any non-zero -O level.

These options are not possible with MSVC.

Change-Id: If1169a73cd8a3e8b34d9e21f281b78897b9aec3e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
af3c7d35b6 Fix qmake's use of Q_ASSERT with side-effects.
The nice side-effect of having Q_ASSERT use the condition twice is
that we break code that has side-effects.

Change-Id: Ia0b7ed2a8030c8e222612af95eb2d58671433110
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 21:24:43 +02:00
João Abecasis
cbe8c10146 Clean up and make robust the file loading code
The used_mmap variable was set to true the first time an mmap operation
was successful, but it was never reset back to false. While that can be
a good indicator that future calls might succeed it is not a guarantee.
Not properly resetting could mean we'd unmap memory allocated with new,
instead of deleting it.

Since that variable is only used inside defined(QT_USE_MMAP) blocks, its
declaration is scoped the same way.

While mmap is still handled "by hand", use QFile for the other
operations. Calling mmap here is less than ideal, as it prevents use of
other memory mapping methods, such as native Windows APIs, but is less
intrusive as it allows QTranslator to retain control over lifetime of
the map. Using QFile for remaining operations reduces the number of
filesystem operations.

The file size is now checked to be minimally sane (<4GB), the limit of
the 32-bit variable that will hold mapping's length. Translation files
should be expected to be much smaller in practice, but there isn't a
sane hard-limit. The file format is broken down to sections, each of
which has a 32-bit length.

Finally, when loading a file fails, release resources immediately,
instead of delaying to next load attempt or the destructor.

Change-Id: I5cc1b626a99d229e8861eb0fbafc42b928b6a122
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 20:22:57 +02:00
Girish Ramakrishnan
4ba9cecec2 Remove sysroot detection
configure parses the compiler from the mkspecs using an awk script.
The detected compiler is then used to determine sysroot support.
The awk script is currently unable to handle loading of qmake
features and thus configure will not detect the compiler correctly.

This is the case when using device profiles. The qdevice.pri is loaded
through the qmake feature file device_config.prf.

One possible way to fix this is to move this detection after qmake is
built and make this a .pro based config.test. However, this cannot be done
because the sysroot is actually baked into the qmake binary as the
QT_SYSROOT variable.

The solution is to remove this check completely and let the build fail
when Qt starts compiling with --sysroot.

Change-Id: I6c3b7ec2c8e5e390d6f5b1e602d656682d610b98
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 19:34:42 +02:00
Girish Ramakrishnan
d29b56f604 Document configure's -sysroot option
-sysroot has been undocumented so far.

Change-Id: I552f9233778de9490a3479292f0cda9c8c439282
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 19:34:42 +02:00
Rafael Roquetto
68ecbffb30 Remove the virtual keyword from reimpl. methods
Qt Coding Standards state that "when reimplementing a virtual method, do not
put the virtual keyword in the header file'".

Change-Id: I89ae34eee78ad5b58a3e41845384a656225ed658
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
2012-03-28 19:34:42 +02:00
Kevin Krammer
5d117fd427 Refactoring virtual keyboard class into non-singleton
Getting rid of the singleton gives us better control over when the
virtual keyboard handling class is instantiated and configured.

Also notify screens about keyboard height changes and let them
notify through QWindowSystemInterface instead of "guessing" the
screen in QQnxVirtualKeyboard.

Change-Id: I71a7f6b5e9d5455563404f6abe7a0daec567a12d
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-28 19:34:42 +02:00
Kevin Krammer
a80a2c6da2 Move screen event processing into its own class
The event handler class can then be reused when we have proper
BPS event support available from corelib

Change-Id: Iafe645e69248597377045c711108ce0acbe3984b
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-28 19:34:42 +02:00
Friedemann Kleint
f5c5708f6e rcc: Add a note about the usage of the source code for Qt Designer.
Change-Id: I672b470fcbd37b024451e7ed5f241643a1ab85a6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-28 17:43:58 +02:00
Simjees Abraham
91bdfd3020 irrelevant qDebugs from QGuiApplication removed.
removed the qDebugs that are not relevant for the user and were printed when the
app was started from QtCreator.

Change-Id: Iae49d6c780a4d3cfd55b3e149555294e150f3f52
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 17:22:39 +02:00
Thiago Macieira
4fc7474805 Port QHostAddress to use the new IP utilities in QtCore
The new code now generates lowercase hex instead of uppercase, so
adapt the unit tests to pass.

Also, "123.0.0" is now considered valid (compatibility with inet_aton).

Change-Id: I07b5125abf60106dc5e706033d60836fb690a41f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
826c0723c1 Add support for IPv6 parsing and reconstructing the address
Similarly, only test against the libc function on Linux, as other OS
sometimes have different behaviour.

Change-Id: I9b8ef9a3d660a59882396d695202865ca307e528
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
70db6233e7 Add a function to parse IPv4 addresses in QtCore
In the unit test, check against inet_aton on Linux with GLIBC
only. Other platforms have this function too, but they sometimes have
different behaviour, so don't try to test them equally.

Change-Id: I1a77e405ac7e713d4cf1cee03ea5ce17fb47feef
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
7adbc9b234 Remove the -no-stl option from configure
This was decided on the mailing list. See:
http://lists.qt-project.org/pipermail/development/2012-March/002442.html
http://lists.qt-project.org/pipermail/development/2012-March/002465.html

Change-Id: I7681e5cc743b20f6d4e29d2aea45c50df41a0b98
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
d43fe0b672 Remove the old code using MMX registers.
There are only 8 MMX registers, each 64-bit wide, and they alias the
x87 registers. The access to the MMX register cannot use the new
VEX-prefix instructions either.

All of the functions being replaced are either present in the
qdrawhelper_sse2.cpp and qdrawhelper_ssse3.cpp files, or the plain C++
function in qdrawhelper.cpp is vectorised when compiled with
-ftree-vectorize (enabled in -O3), if SSE2 support is enabled.

All x86-64 processors have SSE2, so this is a net improvement for
64-bit builds. For 32-bit builds, without further support this will
cause the code to use non-vector or x87 instructions, which aren't the
best. The solution will come in another commit.

Change-Id: I4a22d8a2516b79172867510202d0fd627db54807
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 14:54:12 +02:00
Martin Petersson
b754deb055 QNam: try to read the last CRLF when chunked encoding is used.
When chunked encoding is used we should try to read the last CRLF after
the last zero-lenght chunk, with chunk size coded as 0.

Task-number: QTBUG-19480
Task-number: QTBUG-20924
Change-Id: Ida40593fec8788bff713a31cfe6a7c2d86354a91
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 13:22:11 +02:00
Friedemann Kleint
b2d205b587 Windows: Fix handling of -nomake.
Add to list of disabled build parts (see
b9a498bf51).
This fixes the tests are currently built in developer-build
despite "-nomake tests".

Change-Id: I43282112e03328dd89d8c874ca31b0483742ddb3
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-28 13:01:01 +02:00
Debao Zhang
d2b1c2ef1f Remove WA_PaintOutsidePaintEvent
WA_PaintOutsidePaintEvent is only suggested to be used when porting Qt3 code
to Qt 4 under X11 platform. and it has been broken now.

Change-Id: Ie4297b2a449f1055ca10ada9efb930e6018b1efb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 11:22:11 +02:00
Debao Zhang
5e80eb7917 Remove AutoCompatConnection
The default type when Qt 3 support is enabled. Same as
AutoConnection but will also cause warnings to be output in
certain situations.

Change-Id: I64bf3c39a740afb716820bfd3173936fda213f4a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 11:22:11 +02:00
David Faure
a5a80da223 Allow auto tests to stay away from the user's configuration.
QStandardPaths now knows a "test mode" which changes writable locations
to point to test directories, in order to prevent auto tests from reading from
or writing to the current user's configuration.

This affects the locations into which test programs might write files:
GenericDataLocation, DataLocation, ConfigLocation,
GenericCacheLocation, CacheLocation.
Other locations are not affected.

Change-Id: I29606c2e74714360edd871a8c387a5c1ef7d1f54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-28 11:22:11 +02:00
Bradley T. Hughes
448b9c00be windowmodality test: Allow exec() with ApplicationModal dialogs
Add a checkbox to the main window and dialog .ui files to allow
exec()ing ApplicationModal dialogs.

Change-Id: I4d8a4be136d0f6b688938a8020a6ebcc69a9dfe8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-28 09:42:00 +02:00
Frederik Gladhorn
6c45614cbe Add missing accessible child id.
In the deprecated function the child parameter got lost.

Change-Id: Ieeef19100bffaaa6079185dae6ae5bf82dcd7a60
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-28 09:42:00 +02:00
João Abecasis
99e7ad660f Ensure QTypedArrayData is just a shim over QArrayData
Change-Id: I6f41ca054d0e0a0c4642f0b841b3b3df9559f818
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-28 09:37:27 +02:00