summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Add test of automated container metatype declaration.Stephen Kelly2012-05-181-0/+104
| | | | | Change-Id: Iddaf444ead6d9f0147b9b11452ccea46aa712ba3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove parallel flag for qsemaphore because of flaky nature.Toby Tomkins2012-05-181-1/+1
| | | | | | | | | The CI system is now using the parallel_test flag to run tests in parallel. This test has become flaky, or at least more flaky than it was previously. Mark it to no longer run in parallel. Change-Id: I47bca3be620a8f648a0eb9c9b9f26d2d925efc01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Limit the nesting depth of the Json parserLars Knoll2012-05-161-0/+60
| | | | | | | | | | | | | | | The parser is recursive and too deeply nested json would cause it to exhaust the available stack space leading to crashes. We now abort parsing with a DeepNesting parse error if the document is too deeply nested. The current nesting limit is set to 1024, which should be more then enough for any real JSON data set. Change-Id: I4adea3fd727149f7342536d73cf4530361a0a3a1 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* QChar: add isSurrogate() and isNonCharacter() to the public APIKonstantin Ritt2012-05-161-4/+4
| | | | | | | | + QChar::LastValidCodePoint enum value that supercede the UNICODE_LAST_CODEPOINT macro replace uses of hardcoded values with the new API; remove leftovers Change-Id: I1395c9840b85fcb6b08e241b131794a98773c952 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QChar: add missing UCS-4 overloads, get rid of UCS-2 onesKonstantin Ritt2012-05-161-20/+12
| | | | | | | | | | inline all non-static members to a static ones (declared with QT_FASTCALL), ushort converts automatically to uint and the conversion cost is minimal. Task-Number: QTBUG-13052 Change-Id: I189a6f205736766adcd3de2d61cee71f30cc64f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QFile::permissions for long filenamesShane Kearns2012-05-161-7/+59
| | | | | | | | | | When qt_ntfs_permission_lookup is used, QFile::permissions failed for files with long filenames. Also created a test case for this API, which revealed another bug. Task-number: QTBUG-25629 Change-Id: I73b7676a9d059c0e782b3f701b2e6bbc92f671ed Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* Fix cases where functions are called with a drive and no slashAndy Shaw2012-05-161-1/+25
| | | | | | | | | | | | | | | When a file is specified on a path that includes a drive letter followed by a colon but no slash then it didn't always account for the fact that this refers to the current path on that drive. This fixes the problems in completeBaseName(), baseName() and path(). Tests are also added for these three cases and some others too. Task-number: QTBUG-25353 Change-Id: I47a197c6af066f532442ad269be57597ec61303a Reviewed-by: Irfan Omair <irfan.omair@gmail.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add Q_UINT64_C to 64 bit integer literal.Carl Schumann2012-05-151-1/+1
| | | | | | | | | | On some systems prior to this change the code would not build with the following error reported by gcc: error: integer constant is too large for 'long' type Change-Id: I778bce9a72ccf3a41cdf17883d734082ed3fb4b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename QMimeDatabase method for consistency.David Faure2012-05-151-3/+3
| | | | | | | | Name is about mimetype names, while FileName is about, well, file names. Task-number: QTBUG-25748 Change-Id: I34a9ac1a5fc06dc3e3855365e19c4dc7a1aa2671 Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
* Remove const char *-based connectNotify() APIKent Hansen2012-05-151-111/+23
| | | | | | | | | | | | | | | | This completes the transition from connectNotify(const char *) and disconnectNotify(const char *) to the new QMetaMethod-based functions. Removed the old connectNotify autotests and renamed the connectNotifyMethodXXX autotests to connectNotify, since there is no longer any ambiguity about which overload is being tested. Change-Id: Icf108a80177155f21bb73c165fb8ab5d4e997bc2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove capitalization when specifying include-libraries.kb2012-05-142-2/+2
| | | | | | | | | | | | | MinGW installations on case-sensitive filesystems expect lowercase names of include-libraries and (usually) include files. When crosscompiling on Debian 6 (targeting MS Windows) linking fails because mingw is looking for non-existent include-libraries. Using lowercase names solves this. Change-Id: Id3454f4ed8ba42b6ea93d65d9c0ce567db6712df Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QUrl: using sectionIsPresent in operator== broke for local files.David Faure2012-05-141-0/+4
| | | | | | | | | QUrl::fromLocalFile("/foo") doesn't set Host, but QUrl("file:///foo") does (to remember that it saw a Host section, even if empty, which is useful for urls like "remote://"). So ignore the Host flag in operator==. Change-Id: I4322b4a75420c4e42766c0d65c1b121f28028a76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: a url with a fragment or query, and one without, are different.David Faure2012-05-141-0/+2
| | | | | | | | | Fix operator== and operator< so that a URL with an empty fragment or query, is not treated as equal to a URL without any fragment or query. This restores the Qt4 behavior on this particular issue. Change-Id: Ie989f37353fb13c791b1d558d638d2e8a5b5d1b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restore QUrl::setEncodedQuery(QByteArray()) to the Qt4 behavior.David Faure2012-05-131-2/+9
| | | | | | | | | | Null bytearray means no query, and QString::fromLatin1(QByteArray()) doesn't give a null string, but an empty string. Same for setEncodedFragment(QByteArray()). Change-Id: I992e9253e35941d66886456872ea06aa2ae92450 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix QString::isRightToLeft() for SMP code pointsKonstantin Ritt2012-05-111-0/+35
| | | | | | Change-Id: Ib8afc932d9566df1a8922da9a75b9f9cbbdd321d Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Correctly parse json documents with a leading BOMLars Knoll2012-05-102-0/+19
| | | | | | | | A leading byte order mark is valid in utf-8 and we should parse documents starting with those correctly. Change-Id: Id85398ff6e05b93ceefbaf4a6de5571d5e61ca13 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* move the default text breaking algorithm impl from HarfBuzz to QtKonstantin Ritt2012-05-101-0/+90
| | | | | | | | | | | there are several reasons to do this: * text breaking is not a shaper's job; * since the text breaking rules are bound to a specific Unicode version, updating Qt's internal unicode data would require updating the data in HB as well; * makes porting to HurfBuzz-NG some easier Change-Id: I0bbf8e8a343bc074696f4ddf2ae4e7fa32a61629 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a crash when parsing a URL with username and port, but no passwordThiago Macieira2012-05-101-0/+10
| | | | | | | | | | This was crashing because the ':' was found past the end of the username, causing the recoder to run from position 22 to 11, via the long way around the memory. Change-Id: Ic1ae596f34f7db857fb4210294974fb5a6adf691 Reviewed-by: Alexis Menard <alexis.menard@openbossa.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix qDecodeDataUrl for already percentage encoded content.Alexis Menard2012-05-093-0/+98
| | | | | | | | | | | If the url we pass as parameter already have percentage encoded data, we don't want to decode it and call fromPercentEncoding. The test coverage is not complete for qdataurl.cpp file but it is better than previously and it will also protect us from future regressions. Change-Id: I79f709f44bed1b7f274a3de639c7e291fa91a193 Reviewed-by: Thiago Macieira Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Ensure qstring.h compiles with QT_NO_CAST_FROM_BYTEARRAYDavid Faure2012-05-093-0/+66
| | | | | | | | | | | 19d160b72ba broke it temporarily, and this wasn't detected by tst_headersclean, because it sets QT_NO_CAST_FROM_ASCII too, which disabled the faulty code. So this adds a new unittest for QT_NO_CAST_FROM_BYTEARRAY alone. Change-Id: Iaf7a36a1378e77188bcc636e5dc9a1f9b84f70a7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix QUrl::StripTrailingSlash for the case of no path at all.David Faure2012-05-091-0/+1
| | | | | Change-Id: I1fd0fe4b9b67996732c85c1792415e371e865595 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce a new built-in type: signed char.Jędrzej Nowacki2012-05-082-3/+30
| | | | | | | | | | | | C++ distinguish between "char", "signed char" and "unsigned char", they are three independent types. Fix QVariant behavior on ARM. On ARM "char" may mean "unsigned char", but we depends on the sign during a numerical conversions. Change-Id: I610ce3fb88ed5964b67f3ae442d264fe16b2d261 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add assignment operator for QJsonValueRefAli Akhtarzada2012-05-081-0/+5
| | | | | | | | | The implicit cast to QJsonValue was being ignored probably because the compiler was generating a default QJsonValueRef assignment operator Change-Id: I3a041595497308868dd7e4aab71027ce21bf8f0b Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add some extra tests to tst_QString to ensure the encoding is correctThiago Macieira2012-05-071-3/+193
| | | | | | | | | | | This also tests by consequence that the behaviour of QByteArrays containing NULs is consistent. Right now, that means the QByteArray processing stops at the NUL, which is the same behaviour as if a pointer to the byte array's data were used. (it's what happens if there's no QByteArray overload and the const char* one is called) Change-Id: If56a822f95866e8cb5b153d07b48198bb83fb386 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Change QStringBuilder to use UTF-8 tooThiago Macieira2012-05-071-16/+1
| | | | | | | | | | | | | This commit completes the previous commit so that both QString and QStringBuilder now operate on UTF-8 input. A small fix was required in QStringBuilder: an if clause isn't enough to separate the two append versions. Since there are no QString functions that append to char*, if we're converting to a QByteArray, we need to go through a QString first in a separate function. Change-Id: Ic503340c5d0c32d420c90c91cc2e0fc1ae9230f3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add default value for getters in QJsonValueLiang Qi2012-05-061-1/+11
| | | | | | | Done-with: Debao Zhang <dbzhang800@gmail.com> Change-Id: I3ddd8dd89dc75d91ac9977bf9b6eb3174d7669e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* add support for non-BMP ligaturesKonstantin Ritt2012-05-041-0/+12
| | | | | | | | | | | | | | | | | | | | | > http://www.unicode.org/versions/Unicode5.2.0/ D. Character Additions: There are three new characters in the newly-encoded Kaithi script that will require changes in implementations which make hard-coded assumptions about composition during normalization. Most new characters added to the standard with decompositions cannot be generated by the operations toNFC() or toNFKC), but these three can. Implementers should check their code carefully to ensure that it handles these three characters correctly. U+1109A KAITHI LETTER DDDHA U+1109C KAITHI LETTER RHA U+110AB KAITHI LETTER VA UCD 6.1 adds two more of them: U+1112E CHAKMA VOWEL SIGN O U+1112F CHAKMA VOWEL SIGN AU Change-Id: I781a26848078d8b83a182b0fd4e681be2a6d9a27 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Slightly improve the query encode/decode test in QUrlThiago Macieira2012-05-041-6/+7
| | | | | | | | Show that nothing is changed either way, regardless of the encoding flags used. Change-Id: I31fba5f87eae777d4b708ab789b32169004bcbcc Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QUrl::toString(StripTrailingSlash) to not turn file:/// into file:David Faure2012-05-041-10/+18
| | | | | | | | It should only strip one slash (as the name indicates), and not if the path is just "/". Change-Id: I133a81977241de77a49d1d1559143d30e0bd52f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtCore]Thiago Macieira2012-05-047-22/+22
| | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I38f97ad379deafebef02c75d611343ca15640c8a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make the event notification on Windows be mandatory in all dispatchersThiago Macieira2012-05-042-0/+10
| | | | | | | | | | | | | This way, QWinEventNotifier will work on all Windows systems, not just with the default event dispatcher. Other dispatchers (other than QWin32EventDispatcher) are permitted, so the class should not abort just because of that. If a dispatcher really doesn't want to implement this, they need to implement the virtuals to do nothing, possibly print a warning. Change-Id: I2c132bcde95b9d5941c8906a0fcd2ad964087772 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-05-036-63/+61
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/gui/kernel/qguiapplication.h src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow.h tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp Change-Id: I62a8805577a7940d4d36bed985eb3e7019d22f2e
| * Allow qDebug output to be configured by qSetMessagePattern()Kai Koehne2012-04-242-4/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qSetMessagePattern() to configure the default message pattern. This one can still be overwritten by setting the QT_MESSAGE_PATTERN environment variable. Without this method, there's actually no way to change the default output programatically. Since QT_MESSAGE_PATTERN is evaluated when the first message arrives, setting it via e.g. qputenv might have no effect/be too late. Change-Id: I115e0c30606f128fdbf5c169a951ffa2a6a48517 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Make QStringLiteral and QByteArrayLiteral always return the real typesThiago Macieira2012-04-231-30/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, the macros would return an internal type that contained the pointer to the data. This breaks code that tried to use the macros with operators, like QStringBuilder but also when writing: QStringList() << QStringLiteral("a") << QStringLiteral("b"); This change seems to work fine now and I can also verify that this works: const auto str = QStringLiteral("Hello"); Even though it creates a QString, which is non-POD and non-constexpr. Change-Id: Iaf82af9bea4245513a1128ea54f9d2d3d785fb09 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * Logging: Change arguments of message handler to avoid conversionsKai Koehne2012-04-202-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new QtMessageHandler that takes QString instead of char *: This avoids converting to local8bit , only to convert it back to utf16 for Windows. The old QMessageHandler is kept for a transition period, but will be removed before Qt 5.0. Also fix qEmergencyOut (that is called in OOM situations) to not rely on the default message handler. Change-Id: Iee0ce5838f97175c98788b847964273dd22d4a37 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Remove QVariant constructor taking Qt::GlobalColor.Jędrzej Nowacki2012-04-192-10/+1
| | | | | | | | | | | | | | | | The constructor is wrong, it creates instance of QVariant encapsulating a QColor instance. QVariant should not implicitly convert data, never. Change-Id: Idc794ecdecb42d8b53fee3f993bf51ddd43f595d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Define P in stringbuilder.cpp, just to help in editing in the editorThiago Macieira2012-05-031-0/+5
| | | | | | | | | | | | | | Otherwise it keeps thinking that we have an error. Change-Id: I8175e34dc6421884b89de9165193e32b6cdf1b62 Reviewed-by: hjk <qthjk@ovi.com>
* | Introduce QObject::isSignalConnected(QMetaMethod)Olivier Goffart2012-05-021-0/+31
| | | | | | | | | | | | | | | | | | This is much more performant than calling QObject::receivers(const char*) Can be used instead of connectNotify in some cases. Change-Id: I19e0933f678f171f515d9a0f69f0ad4fb7d894b4 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* | Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-0211-221/+221
| | | | | | | | | | | | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* | Fix regression in connectNotify(const char *) emissionKent Hansen2012-05-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplementations of connectNotify() and disconnectNotify() can assume that the signal argument is in normalized form, but after the introduction of the Qt5 meta-object format, it could happen that it's not. The problem is that the internal QArgumentType class, which attempts to resolve a typename to a type id, was calling QMetaType::type(). QMetaType::type() falls back to trying the normalized form of the typename if the original argument can't be resolved as a type (this behavior isn't documented, but that's how it works). This means that e.g. QMetaType::type("const QString &") returns QMetaType::QString. Since QMetaObjectPrivate::indexOfMethodRelative() (more specifically, the methodMatch() helper function) prefers to compare type ids over typenames (since the type ids are stored directly in the meta- object data for built-in types), the method lookup would *succeed* for signatures with non-normalized built-in typenames as parameters. QObject::connect() would then think that it did not have to normalize the signature (see "// check for normalized signatures"). The consequence was that the original, non-normalized form got passed to connectNotify(). This commit introduces an internal typename-to-type function that is the same as QMetaType::type(), except it doesn't try to normalize the name. This way, the only place where normalization can occur in the signature-to-meta-method processing is through the calls to QMetaObject::normalizedSignature() in QObject::connect() itself. The implication is that there are now cases where the method signature will be decoded and processed twice, where processing it once was sufficient before. On the other hand, it is consistent with the pre-Qt5-meta-object behavior, where we predict that the signature is already normalized, and only perform (comparatively costly) normalization if the initial lookup fails. Change-Id: Ie6b60f60b0f9a57ebd378d980329dac62d57bbd9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* | Fixed uninitialized memory in QMetaObjectBuilder::fromRelocatableDataRohan McGovern2012-05-011-0/+5
| | | | | | | | | | | | | | | | | | | | static_metacall was never set on the metaobject written by QMetaObjectBuilder::fromRelocatableData, sometimes causing a crash. It should be initialized to 0. Change-Id: I79373d895e131f0cc2ff1af6d2177a0c1a282be7 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Add QMetaMethod-based QObject::connect/disconnectNotify() APIKent Hansen2012-05-011-0/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API will fully replace the const char *-based connectNotify() and disconnectNotify() in Qt5; the old functions will be REMOVED before Qt 5.0 final. The new implementation fixes the long-standing issue of connectNotify() not being called when using the (internal) index-based QMetaObject::connect() (e.g., from QML). As with the old API, there are still two "unintuitive" behaviors concerning disconnectNotify(): - disconnectNotify() is not called when the signal is disconnected using the QObject::disconnect(QMetaObject::Connection) overload. - disconnectNotify() is not called when a receiver is destroyed (i.e., when a connection is implicitly removed). The old versions of connectNotify() and disconnectNotify() are kept for now, and they are still called. They will be removed once known existing reimplementations (e.g., QtNetwork, QtDBus) have been ported to the new API. Change-Id: I8b4f007f3c6d89199c1ba04a3e23c8ca314e0896 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* | Re-enable casting to and from "ASCII" on tst_qstring.cppThiago Macieira2012-04-281-33/+13
| | | | | | | | | | | | | | | | | | | | Turns out that we've had some old unit tests commented out that did not compile. QString does not have a std::string constructor nor overloads to many other methods. And std::string does not cast to char* on its own. So these tests need to be removed. Change-Id: I22df66fc3ccc68bc2840f2d83747234418e480f5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Wrap all Latin 1 strings with QString::fromLatin1 or QLatin1StringsThiago Macieira2012-04-273-27/+29
| | | | | | | | | | Change-Id: I1a1891b9126a2546c1872ec25aba9581cc84bb2f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Convert these files to ASCII or UTF-8Thiago Macieira2012-04-271-1/+1
| | | | | | | | | | | | | | Remove all non-UTF-8 sequences from source code in Qt. Change-Id: I46d9cb23ef2199894896f171d553b3144822f36c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Force tst_qstring to use fromLatin1 where it has Latin 1 literalsThiago Macieira2012-04-271-37/+39
| | | | | | | | | | Change-Id: I941d20733da2987ca7ced14c314adebaf6a431f6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Add QMetaMethod::fromSignal() functionKent Hansen2012-04-271-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given a member function that's a signal, returns the corresponding QMetaMethod. Inspired by the implementation of the template-based QObject::connect(). The primary use case for this function is to have an effective and exact (not subject to shadowing) way of checking whether a known signal was connected to in reimplementations of QObject::connectNotify(QMetaMethod), avoiding string comparisons. Example: void MyObject::connectNotify(const QMetaMethod &signal) { if (signal == QMetaMethod::fromSignal(&MyObject::mySignal)) { // Someone connected to mySignal ... } } Change-Id: I5e4de434275fe543c004d569dcaa9ceda3442f03 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | Make QTimeLine test significant.Jason McDonald2012-04-261-1/+0
| | | | | | | | | | | | | | | | Known failures in this test are now handled by QEXPECT_FAIL. Task-number: QTBUG-24796 Change-Id: I12ba57370cf3df1a85a108fbbcdc9db2222491c1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Ensure that QUrl::{to,from}LocalPath encode/decode properlyThiago Macieira2012-04-261-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike path(), toLocalFile() isn't reporting a URL component, so it should decode the percent-encoded characters fully. This extra decoding pass is meant to catch %00 to %1F, %7F and %25 (the percent sign itself). It also catches %80 to %FF, which aren't decoded because they don't form UTF-8 sequences. That means QUrl::toLocalFile() has undefined behaviour if the path contained non-UTF8 sequences. Task-number: QTBUG-25459 Change-Id: Iab5a0ba6afcfc4510e297984f2ffc208cedd752b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* | Remove QMetaObjectExtraData and put everything into QMetaObjectOlivier Goffart2012-04-251-20/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaObjectExtraData was added when support for QMetaObject::newInstance was added. One needed a place to put the pointer to static_metacall in the QMetaObject. But as we break binary compatibility, one can change the size of QMetaObject, and put everything back inside QMetaObject's own structure. Meaning it is not required anymore to have one QMetaObjectExtraData instance per QMetaObject anymore. Change-Id: If0b8f586cbaf633eed10045adee3ba3366826c86 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>