Commit Graph

6101 Commits

Author SHA1 Message Date
Casper van Donderen
ac2f7eff88 QDoc: Write proper output file name for debug output.
Change-Id: I55138c47960a4d9e1595ef648a8d0982e3bfd19b
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-30 12:04:49 +02:00
Kevin Krammer
831943d7f1 Separate virtual keyboard interface and implementation
Allows us to create a BPS based implementation and drop it in
without further changes to users of the interface.

Change-Id: I16313717e1200d717c330cbb18c3314567af51c2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-30 11:47:55 +02:00
João Abecasis
4ef5a6269c Add tests to verify QByteArray's zero termination
For data allocated and maintained by QByteArray, there's a guarantee
that data() is null-terminated. This holds true even for null and empty,
where logically the terminating character should never be dereferenced.

For tests that modify or generate QByteArrays, this ensures the
invariant is kept.

In the toFromHex() text, const-ness of temporary variables was dropped
to enable the test macro to be used, as the qualification didn't add
much to the test otherwise.

Change-Id: I7ee52e79e3a9df7de18c743f3698dab688e6bf0e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-03-30 11:21:34 +02:00
João Abecasis
be4554d934 Use unsigned variable for size and index
rulesSize is passed from unsigned variable numerusRulesLength, so don't
bring sign bit into equation; array index variable i also made unsigned.

Change-Id: I0cb4e8483272c1e60339298149fb118215aa2183
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-30 11:21:34 +02:00
Morten Sorvig
724e0e20ae Add Mac OS 10.8 define.
Change-Id: Ief687d3d6188b11c39d9ac4879928b35d8b467d0
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-30 09:31:03 +02:00
Morten Sorvig
3d72797df1 Fix "unused variable" warning in QVariant header.
Change-Id: Ia70ee372e277b1f95b893c461820fe97f381b8b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-30 09:31:03 +02:00
Bradley T. Hughes
3fa70d9c74 Update tests/manual/windowmodality to test native dialogs
Window- and ApplicationModal native dialogs need to send WindowBlocked
and WindowUnblocked events as well. This will let us test that they work
properly.

Change-Id: Iaa4ddb79bb0872f9ab1e61336a5decb262472283
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-30 09:31:03 +02:00
Matt Newell
cff46983a8 Allow named bind values to be used multiple times per query
Prepared queries should be able to use a name parameter more than
once. Currently this will result in undefined behavior and crashes.
This patch fixes the bug and implements the needed test case.

Task-number: QTBUG-6420
Change-Id: I07d6537e432a9b2781e9ef3d9f597bceb054527e
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-30 09:31:03 +02:00
João Abecasis
f1b2f1acd1 Fix comments out of touch with reality
Change-Id: Id060626b0bb6c28f4e67c9b3c7a0fbc456f7dcc6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-30 09:25:03 +02:00
Andy Shaw
3ec88b355b Plug memory leak when gestures are grabbed but never triggered
When a gesture is grabbed by QAbstractScrollArea but never triggered
then the deletion of the QAbstractScrollArea would mean that the gesture
created for it would not be deleted.  This ensures that it always
deletes the gestures waiting to be deleted even if no gesture event is
triggered

Task-number: QTBUG-25011

Change-Id: I36118b82baaa60ac4e014896159060e1af76b2d2
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-03-30 07:27:19 +02:00
Thiago Macieira
ffd20af339 Revert to Qt4 behaviour that QUrl().isValid() == false
There are probably lots of places that rely on that behaviour, so go
back to what it was.

Change-Id: I4d1503a0ee105a50cdfaab52d9a5862a02c70757
Reviewed-by: David Faure <faure@kde.org>
2012-03-30 01:19:59 +02:00
Thiago Macieira
7f20dce264 Move the #include "tst_qurlinternal.moc" up to workaround a bug
I don't know if the bug is in moc or in qmake. But it bails out trying
to parse the .cpp file after the
tst_QUrlInternal::nameprep_testsuite_data function. If the #include is
placed above, it works. If it's placed below, it doesn't.

Change-Id: Ide554aa5aa3f1999e29604ba6d25ccdb09f6ef28
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
c9b78026f5 Fix the license headers for the files in the new-qurl branch
Change-Id: I469fed8b72111905e31553d0c82e62ced4009d75
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
83526a9bdc De-inline qHash(const QUrl&) and improve
Make it a friend and access the internals to have better performance.

Change-Id: I3bbf0b0faa5363278b7b3871d6b6fb5f2225a5f4
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
66df11f4d1 Fix QUrl operator== and operator<
Don't crash when either side is null but not both sides.

Also make sure operator< is working properly and satisfies the basic
conditions of a type (such as that if A < B, then !(B < A)).

Change-Id: Idd9e9fc593e1a7781d9f4f2b13a1024b643926fd
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
64a10879cb Disallow spaces in URLs when parsing in StrictMode.
Change-Id: I16de68aff2b9e84cc800734c5875aaee9a2ea565
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
329ee8cedc Reimplement the StrictMode URL parsing
The strict mode check is now implemented after the tolerant parser has
finished, and only if the tolerant parser has not found any errors. We
catch the use of disallowed characters (control characters plus a few
not permitted anywhere) and broken percent encodings.

We do not catch the use of Unicode characters, as they are permitted
in IRIs.

In the tests, remove the old errorString test since it makes little
sense.

Change-Id: I8261a2ccad031ad68fc6377a206e59c9db89fb38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
cff38329aa Re-introduce support for QUrl::errorString()
Note that QUrl can only remember one error. If the URL contains more
than one error condition, only the latest (in whichever parsing order
URL decides to use) will be reported.

I don't want too keep too much data in QUrlPrivate for validation, so
let's use 4 bytes only.

Change-Id: I2afbf80734d3633f41f779984ab76b3a5ba293a2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
74d2dba460 Port to the new QUrl API
The use of any broken-down components of the query now needs
QUrlQuery.

The QUrl constructor and toString() are now rehabilitated and the
preferred forms. Use toEncoded() and fromEncoded() now only when we
need to store data in a QByteArray or the data comes from a QByteArray
anyway. Change to toString() or the constructor if the data was in a
QString.

Change-Id: I9d761a628bef9c70185a48e927a61779a1642342
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
8cf66c3bc4 Add QUrl::setQuery overload with QUrlQuery
Change-Id: I0cba92b6bf7f848f1918383b380c0444b8bead3a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
f40e934983 QUrl: optimise setHost for the common case
Change-Id: Ib667557268ebf75cb796ddd716b337ca24b466ad
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
2591545ee1 QUrl: Always lowercase the scheme
Change-Id: I8d467014d22384f1be15fdd746e20b1153a82a4e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
1372d60bde Long live the new QUrl implementation.
Also say hello to QUrl's constructor and QUrl::toString being allowed
again.

QUrl operates now on UTF-16 encoded data, where a Unicode character
matches its UTF-8 percent-encoded form (as per RFC 3987). The data may
exist in different levels of encoding, but it is always in encoded
form (a percent is always "%25"). For that reason, the previously
dangerous methods are no longer dangerous.

The QUrl parser is much more lenient now. Instead of blindly following
the grammar from RFC 3986, we try to use common-sense. Hopefully, this
will also mean the code is faster. It also operates on QStrings and,
for the common case, will not perform any memory allocations it
doesn't keep (i.e., it allocates only for the data that is stored in
QUrlPrivate).

The Null/Empty behaviour that fragments and queries had in Qt4 are now
extended to the scheme, username, password and host parts. This means
QUrl can remember the difference between "http://@example.com" and
"http://example.com".

Missing from this commit:
 - more unit tests, for the new functionality
 - the implementation of the StrictMode parser
 - errorString() support
 - normalisation

Change-Id: I6d340b19c1a11b98a48145152513ffec58fb3fe3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
4758c8fa48 Move some of qurl.cpp into other files for ease of maintenance
The parsing code is now in qurlparser.cpp, whereas the IDNA related
code is in qurlidna.cpp.

Change-Id: I0b32c0bf0ee6c2f08dc3200c44af3c9d1504a3df
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
1c2144c39f Forward the methods dealing with the break down of query to QUrlQuery
Now that QUrlQuery exists, these methods are no longer necessary in
QUrl itself. Manipulation of the items should be done using the new
class.

They are now implemented using a temporary QUrlQuery. This is hardly
efficient but it works.

Change-Id: I34820b3101424593d0715841a2057ac3f74d74f0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
1aeb180386 Long live QUrlQuery
This class is meant to replace the QUrl functionality that handled
key-value pairs in the query part of an URL. We therefore split the
URL parsing code from the code dealing with the pairs: QUrl now only
needs to deal with one encoded string, without knowing what it is.

Since it doesn't know how to decode the query, QUrl also becomes
limited in what it can decode. Following the letter of the RFC,
queries will not encode "gen-delims" nor "sub-delims" nor the plus
sign (+), thus allowing the most common delimiters options to remain
unchanged.

QUrlQuery has some undefined behaviour when it comes to empty query
keys. It may drop them or keep them; it may merge them, etc.

Change-Id: Ia61096fe5060b486196ffb8532e7494eff58fec1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
b75aa795fe Refactor the URL recoder a little
Change it to operate on QChar pointers, which gains a little in
performance. This also avoids unnecessary detaching in the QString
source.

In addition, make the output be appended to an existing QString. This
will be useful later when we're reconstructing a URL from its
components.

Change-Id: I7e2f64028277637bd329af5f98001ace253a50c7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
73e16b15a6 Remove the tolerant parsing function and make the recoder tolerant
The reason for this change is that the strict parser made little sense
to exist. What would the recoder do if it was passed an invalid
string?

I believe that the tolerant recoder is more efficient than the
correcting code followed by the strict recoder. This makes the recoder
more complex and probably a little less efficient, but it's better in
the common case (tolerant that doesn't need fixes) and in the worst
case (needs fixes).

Change-Id: I68a0c9fda6765de05914cbd6ba7d3cea560a7cd6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
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