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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Avoid calls to QStyleHint and QPlatformIntegration from
threads.
Change-Id: I851ef029ea348f182e0b42536d0a994960aa9187
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
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>
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>
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>
Change-Id: Ie50b0bf0741637a3acfc39360804590f3c133332
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
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>
-sysroot has been undocumented so far.
Change-Id: I552f9233778de9490a3479292f0cda9c8c439282
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
In the deprecated function the child parameter got lost.
Change-Id: Ieeef19100bffaaa6079185dae6ae5bf82dcd7a60
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>