summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* get rid of Q_*_EXPORT_INLINE macrosKonstantin Ritt2012-04-262-60/+8
| | | | | | | | | | | | > Girish: > We should be able to remove the macro completely today, > just mark all those functions as plain inline. > With Qt5, we don't have to worry about bc yet. this fixes "import attribute ignored" warnings on mingw with -fno-keep-inline-dllexport Change-Id: I616e5de7c8d59953ce03a316b941a439fae56298 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix C++11 compilationOlivier Goffart2012-04-261-6/+6
| | | | | | | | Fix compilation with compilers that support user defined literal (such as GCC 4.7) Change-Id: I31cd3d2177688f963ab33cf68cd6060a5fb8640f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use the proper way to find qdoc.Casper van Donderen2012-04-261-1/+2
| | | | | | | | Previously $$QT.core.bins was used to find qdoc, the proper way is to use qtPrepareTool(). Change-Id: I5d97f5517ae63253ccaf1fb1487034c3a312a074 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Ensure that QUrl::{to,from}LocalPath encode/decode properlyThiago Macieira2012-04-261-0/+23
| | | | | | | | | | | | | | | 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-256-61/+27
| | | | | | | | | | | | | | | | 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>
* Split qobject_impl.h into qobjectdefs_impl.hKent Hansen2012-04-254-425/+488
| | | | | | | | | | | | | | | | | | | This is done to make QtPrivate::FunctionPointer available to the QMetaMethod declaration in qmetaobject.h (which already included qobjectdefs.h, since that's where QMetaObject is declared), so that the new template-based QMetaMethod::fromSignal() function may be implemented. The logic for statically generating the array of qMetaTypeId (used by the template-based QObject::connect()) remains in qobject_impl.h, since it's not needed for QMetaMethod::fromSignal(). Moreover, moving that code would introduce a circular dependency, since qmetatype.h as of commit 194674044693d6b101c3dc2f4784718540d343a4 now includes qobjectdefs.h. Change-Id: I36c35041e0c6661c3cf523684177a0b6c19e2d35 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add comparison operators == and != for QMetaMethodKent Hansen2012-04-252-0/+25
| | | | | | | | | | | | | This is done in preparation of introducing the QObject::connectNotify(QMetaMethod) function. Together with the forthcoming QMetaMethod::fromSignal() function, which returns the QMetaMethod corresponding to a Qt/C++ signal (member function), the comparison operators provide an effective way of checking which signal was connected to. Change-Id: I2de48628c4884a7174fb8574895f272cb3fe5634 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add detection code for AVX2, HLE, RTM and AES to qsimd.cppThiago Macieira2012-04-252-17/+39
| | | | | | | | | | | | | | | AES is currently not enabled, since we don't use it for anything. The code is here with the proper detection should we want to in the future. RTM and HLE (Transactional Memory Extensions) I'll use soon in the locking code. Also rename a few variables to make it easier to read later on. Change-Id: I800c66d7e1ba86ec037692928d94f53ea5d5868f Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Replace the x86 XGETBV instruction with its opcode bytesThiago Macieira2012-04-251-1/+1
| | | | | | | | | | | | | This is a new instruction, present on the SandyBridge architecture and later. Some older assemblers do not support it and produce: {standard input}:225:no such instruction: `xgetbv' The use of this instruction is protected by a CPUID check (function 1, ECX bit 27), so we only run it in processors that do support it. Change-Id: Ife7500c0deaab9539074835a4511e8c19602608e Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Update the x86 feature-detection code, unifying x86 and x86-64Thiago Macieira2012-04-251-125/+113
| | | | | | | | | | | | | | | Most of it is the same for both of them, so let's avoid doing everything twice. Or more, since we may support x32 soon. For Windows, use the intrinsics. For GCC, we'd like to use cpuid.h, but it only exists since GCC 4.3, so we can't. And properly detect AVX support: it's not enough to detect that the processor supports them, we also need to check that the OS enabled support for the 256-bit registers. Change-Id: Ibb4872cdb774de5701b18c40f4e612330a266214 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix atomics on SPARCThiago Macieira2012-04-251-8/+8
| | | | | | | | | Inspired by https://bugreports.qt-project.org/secure/attachment/26020/qt_atomic_sparc64.patch Task-number: QTBUG-22479 Change-Id: Ie3275df96c639d6a75e05f70fe5745aeb34457f9 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Revert QUrl::isRelative to its Qt 4 behaviourThiago Macieira2012-04-251-4/+6
| | | | | | | | | Instead of trying to return whether the URL is relative to something undefined, let's instead follow what the documentation was saying all along and what the RFC says about "Relative References". Change-Id: I32722321a6b36c6e3480669ad769390e4c6f7d1c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* get rid of QT_NO_IMAGE_TEXT switcherKonstantin Ritt2012-04-255-15/+0
| | | | | Change-Id: Ie72f907ffb959f629af6a414959348a992c4c941 Reviewed-by: aavit <qt_aavit@ovi.com>
* optimize QChar::decomposition()Konstantin Ritt2012-04-251-27/+32
| | | | | | | | | | * by not using QString::fromUtf16() as we know for sure that the data is 'raw' UCS-2; * it's safe to avoid a check for > UNICODE_LAST_CODEPOINT as GET_DECOMPOSITION_INDEX macro already does a similar check Change-Id: Ifb660efc51c664d06733ac8ed46d54278520da06 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix locale issue on unix systemsStephen Röttger2012-04-241-0/+2
| | | | | | | | | | | | | QSystemLocale::query() was missing the LanguageId QueryType. Therefore QSystemLocale::fallbackLocale() was always used as default language, which reads environment variables in the order: LC_ALL -> LC_NUMERIC -> LANG. The correct behaviour is to read LC_ALL -> LC_MESSAGES -> LANG. This leads to problems for users that want to use english language, but non-english localization features (date, number formats etc.) Change-Id: I4310537dac8622a3dd79231fbad58e22f20ca262 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* qunicodetables generator: improve the output and the generated codeKonstantin Ritt2012-04-242-29/+33
| | | | | | | | | | | better memory usage report; an additional asserts with conditions the implementation is depends on; a namespace for the internal static data; styling fixes Change-Id: Id4048ff6104c56b5f590f9ac6fbf7c0bce79ec47 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* workaround issue where casing diff overflows signed shortKonstantin Ritt2012-04-243-11/+39
| | | | | | | | | | | | | | | | | | | there are two such codepoints were added in the Unicode 5.1: U+1D79 LATIN SMALL LETTER INSULAR G U+A77D LATIN CAPITAL LETTER INSULAR G two more of them were added in the Unicode 6.0: U+0265 LATIN SMALL LETTER TURNED H U+A78D LATIN CAPITAL LETTER TURNED H and two more were added in the Unicode 6.1: U+0266 LATIN SMALL LETTER H WITH HOOK U+A7AA LATIN CAPITAL LETTER H WITH HOOK we map them like special cases with length == 1 (note: all are in BMP which is checked explicitly in the generator) Change-Id: I8a34164eb3ee2e575b7799cc12d4b96ad5bcd9c6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QChar: reduce code duplication by inlining some methodsKonstantin Ritt2012-04-242-96/+80
| | | | | | | | | using templates for toLower()/toUpper()/toTitleCase()/toCaseFolded() makes the upcoming patches smaller and thus easier to review Change-Id: Ideb23e8669dbc2fe9ea3f129bf0137e1805ece11 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Provide access to RTLD_NODELETE flag on Unix.Yan Shapochnik2012-04-243-1/+20
| | | | | | | | | Introduce a new QLibrary::PreventUnloadHint to support the RTLD_NODELETE flag support by dlcompat on Unix platforms. Change-Id: Ib1327e968a2a888850ad1086a102a143f86c5090 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
* Integrate Blackberry Platform Services (BPS) with Qt event loop.Jeff Kehres2012-04-245-7/+389
| | | | | | | | | | | | This ensures interoperability between the Blackbery C and C++ APIs and makes it easier to expose platform services in C++ that are exposed in BPS - since events from both APIs can be processed on the same thread. Change-Id: I7270adc64c26396f66d9126141500d5e58be51e7 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Ensure that QUrl::toLocalFile returns decoded pathsThiago Macieira2012-04-241-2/+2
| | | | | | | | | | | QUrl::path() already decodes almost everything, but let's pass the formatting flag to be sure. Note: decoding of control characters from U+0001 to U+001F is not implemented. Non-UTF8 sequences are also not representable. Change-Id: I9a0ae2282ec3d48cc0e70e5b2d3824fb120709ed Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Don't strip the leading slash of letter+colon paths on UnixThiago Macieira2012-04-241-0/+2
| | | | | | | | | It's perfectly valid to have a path of /c:/a.txt on Unix, so don't strip the leading slash unless we're on Windows. Task-number: QTBUG-20322 Change-Id: I721bd0a65b41048bc735d4eaa0d536174164fe64 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Update the QUrl documentation concerning the encodingThiago Macieira2012-04-241-21/+103
| | | | | | | Looks like I failed to update this earlier, when the behaviour changed. Change-Id: Ic020c2a14d4e9153f2bc9d22d943a3a380c0851c Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* QLocale: Clean up QLocalePrivate implementationJohn Layt2012-04-247-324/+334
| | | | | | | | | | | | | | In Qt4 QLocalePrivate is a struct returned by a d() method. This will be unsuitable for the planned change to use ICU and may cause BIC issues. This change makes QLocalePrivate a class and creates a new struct QLocaleData to hold the data index. Further clean-ups are possible but are left for later. Change-Id: Ie316a07790f74674a3b520b735dff72695cc4060 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cleanup QMetaObject string access.Jędrzej Nowacki2012-04-241-20/+14
| | | | | | | | We do not need operate on raw QByteArrayData, QByteArray gives us better, stable API, without any performance penalty. Change-Id: Idf47af2333c3694e81dcd31cd07d1a4720046df7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix QMutex::tryLock timeout regression (integer overflow)Markus Rathgeb2012-04-241-1/+1
| | | | | | | | | | | | | | | | | The timeout given in milliseconds should be converted to a timespec struct. To separate the seconds and nanoseconds the milliseconds are first multiplied to represent the whole value in an int64 variable. The calculation is done on integers, so we get an overflow if the milliseconds are bigger then 2148. If we cast the given value to an int64 we can avoid this problem. Fix the used cast. Task-number: QTBUG-24795 Change-Id: I864ae227cf7dda16a6f30aa4db74acc49e20f6eb Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove Qt 5 todo in QVariant: we're not going to change the behaviourThiago Macieira2012-04-241-2/+0
| | | | | | | Task-number: QTBUG-25111 Change-Id: I2387767698c402e2bd0ecdfdd6ed41d4a224f1b6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Rename the default organisation from "Trolltech" to "Qt" on MacThiago Macieira2012-04-231-1/+1
| | | | | | | | | This doesn't seem to be documented -- or if it was, the documentation has been changed. Task-number: QTBUG-23269 Change-Id: Ie7aa51aeb251bfaa3d0018fbac4adc9517c97fa0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Removed unused QUrlPrivate::clear()Simon Hausmann2012-04-232-19/+0
| | | | | | | The function is not used anymore. Change-Id: Idfdc0505358421a866b15e2ad322679a1808e223 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the Q_PROCESSOR_* macros in qsimd.cppThiago Macieira2012-04-231-3/+3
| | | | | Change-Id: I7be9b14a24329be32c43603ae87df17328696109 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Set thread name on QNXSean Harmer2012-04-231-1/+3
| | | | | | | Change-Id: I4fc786afce2e53676b148332dddd2c84228f7d87 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTimer: fix typo in singleShot optimization for 0 msecsGiuseppe D'Angelo2012-04-231-1/+1
| | | | | | | | | The SIGNAL/SLOT/METHOD(x) macros prepend a character between '0' and '2' inclusive, and not '0' and '3'. Change-Id: Ibdbf442422925a43f956b2ba70f1f9c6a2812305 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_FUNC_INFO to qcompilerdetection.hThiago Macieira2012-04-232-13/+11
| | | | | | Change-Id: Ibc63913f070febe561890e98ef079ca883d9bfc9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Move the QT_STRINGIFY macro to the top of qglobal.hThiago Macieira2012-04-231-10/+4
| | | | | | | | | This will allow me to use them in qcompilerdetection.h. Also, leave them defined. Change-Id: I73cb39e3cfcc2463d1d47a856e4a64354ebe743c Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix warning in qobject.cppOlivier Goffart2012-04-231-0/+1
| | | | | | | Variable only used in debug mode Change-Id: I6601ca68c427b909680423ae81802f1ed5cd178a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QDoc: Support -indexdir on CLI and depends in qdocconf.Casper van Donderen2012-04-232-0/+3
| | | | | | | | | You can now specify a list of modules in the "depends" qdocconf variable. This stringlist is then used by the -indexdir option to specify in which directory to search for [depends entry]/[depends entry].index Change-Id: Icab6dd0133e180ac04365da9605743def6fb754d Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Fix bug in qsslsocket peek()Kalle Viironen2012-04-231-0/+5
| | | | | | | | | | | | | | | | | | Calling peek() for qsslsocket caused socket data to be copied into qiodevices buffer and therefore make it unaccessible in qsslsocket. Cherry picked form 4.8-branch & modified to Qt5 API changes (int -> qintptr) Original commits: commit 621f18955082fc73471e75d1f8c35c2dcd4befeb Author: Shane Kearns <ext-shane.2.kearns@nokia.com> commit 68b1d5c17aa38d5921bdade2b0e0cb67c6c90513 Author: Kalle Viironen <kalle.viironen@digia.com> Task-number: QTBUG-18498 Change-Id: I6be4b19baec2f3197537f5e7b61432040ec84ad2 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Removed invalid C-style license header from .pro fileRohan McGovern2012-04-231-40/+0
| | | | | | | | | | | /* C-style comments */ cannot be parsed by qmake. Additionally, Qt Project legal has agreed that .pro files do not need to be covered by license headers. Change-Id: Ie4d75ee09c2fc85a2f954ec4a931b36ea9d51d93 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Don't assume QAbstractDeclarativeData::objectNameChanged is available.Michael Brasser2012-04-231-1/+1
| | | | | | | | Preparation for removal from declarative now that a proper NOTIFY signal exists. Change-Id: If0acb73b73d17c49dc8de211d95ecd1e8e80ff1b Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Ensure that qXXXdetection.h can be included directlyThiago Macieira2012-04-213-0/+12
| | | | | | | | | Those files might have dependency on one another, on qconfig.h and on early qglobal.h definitions, so ensure that the only correct include order is that of qglobal.h. Change-Id: I89098bacaf16353ee8b51604ee885508dc8e201a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make the fallback Q_ASSUME and Q_UNREACHABLE be qt_noopThiago Macieira2012-04-211-2/+2
| | | | | | | | That way, we can properly add ; after them, and I can use Q_ASSUME in Q_ASSERT's else condition. Change-Id: Iad35819fbb06714116b7dd0f952e1c2c89044c72 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move Q_DECL_{IMPORT,EXPORT,HIDDEN} to qcompilerdetection.hThiago Macieira2012-04-212-29/+29
| | | | | | | | | | | | | | Mindful of QT_VISIBILITY_AVAILABLE and Q_OS_WIN for GCC: when GCC is used on Windows (i.e., MinGW or potentially Cygwin), use the declspec variant so we produce proper DLL imports and exports. When used on other platforms, rely on configure adding QT_VISIBILITY_AVAILABLE to qconfig.h, which confirms that the -fvisibility argument is available. That flag has been available since GCC 4.0 on ELF targets, but it could be missing on some other targets. Change-Id: I3dbc0043c1eaee0c469c5b1dc8bf05842fe9cd47 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move some compiler macro definitions into the compiler sectionsThiago Macieira2012-04-211-26/+12
| | | | | | | Makes for a couple of cleaner definitions of fallbacks. Change-Id: I9b1a6f77bab986514e1862ae1f431ea37b89c1b5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move the compiler-related macros to qcompilerdetection.hThiago Macieira2012-04-212-109/+110
| | | | | | | | This cleans up qglobal.h a little further and organises things a bit more. Change-Id: Ic025e720941cdf59b8a1a0baf515b29f25eba0f1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Compile on Windows.Jan-Arve Saether2012-04-211-2/+8
| | | | | | | | | | | The previous code was trying to sum one pointer with one string literal... Using QVarLengthArray should also potentially speed things up a bit, since it will avoid a malloc if className is small enough (less than 15 bytes). Change-Id: I41218babb3030e7e6f9c31fc77e4af1c209ae0a5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* QDataStream: Update Version info for docAurindam Jana2012-04-201-1/+1
| | | | | | | | | | QDataStream::Qt_5_0 was modified in aee1f6cc413f56bf4962324799ee3887c3dd037f but the documentation was not updated. Change-Id: I520798a7572b0f21cd275290bcd689e1b686d098 Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Don't push unnecessary data to a data stream for QVariant()Thiago Macieira2012-04-202-6/+6
| | | | | | | | Adjust the test because we don't read past the end anymore. Task-number: QTBUG-25108 Change-Id: I8243f1d5ae79d1256aab2cb1132598a716a7eeeb Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix MSVC conversion warnings in new bytearray code.Friedemann Kleint2012-04-203-12/+13
| | | | | | Change-Id: Ifc81564daf3fef0d7f08ae8d250ba41d3b1d5b0f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* mingw: fix a lot of annoying warningsKonstantin Ritt2012-04-204-166/+166
| | | | | | | | | like "QRect::intersected() redeclared without dllimport attribute after being referenced with dll linkage" (-fno-keep-inline-dllexport) Change-Id: Id24e5ee857579ee9f97a60de0ab88ce3db8385cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Provide versions of qRegisterMetaType() that do not normalize typename.Martin Jones2012-04-202-12/+70
| | | | | | | | | QML is quite capable of providing typenames in the correct format. qRegisterNormalizedMetaType() does not normalize the typename, so avoids the huge overhead. Change-Id: I96c9a42fe0b5d36ac05a9247f6507dbf9583fa67 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>