summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix docs of qAbs to have the correct function signature.Jan-Arve Saether2012-09-031-1/+1
| | | | | Change-Id: I984032dc58387ae8f28318beeb053af28ccc8885 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QStandardPaths should still work without desktop serviceJing Bai2012-09-031-4/+0
| | | | | | | | | To fix a compile problem when QT_NO_DESKTOPSERVICES is defined. We should enable QStandardPaths on Mac even without desktop service, since it doesn't rely on desktop service and it is used in other files. Change-Id: I29267ebfe81b79c598043f8287fd2bb419573570 Reviewed-by: David Faure <faure@kde.org>
* QStringList::join: add an overload taking a single QCharMarc Mutz2012-09-032-5/+17
| | | | | | | | | | | | | | This overload avoids the needless heap allocation that the traditional overload incurs due to the implicit QChar -> QString conversion involved there. In order to share the implementation between the two overloads, QStringList_join now takes the separator as a (Char*,int) tuple instead of as a QString. Change-Id: I92961f13a3f19099de2a6e2df9f4789a12fc83a0 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the package macros from qglobal.hThiago Macieira2012-09-031-4/+0
| | | | | | | It's the wrong place to have these. Change-Id: I3b716317ba02ea2baf0f7053c8b16128e4c88e17 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Change SChar to metatype id 40.Stephen Kelly2012-09-032-5/+4
| | | | | | | | | This fills the gap left by QWidgetStar, making the sequence between FirstCoreType and LastCoreType contiguous, which some benchmarks assume to be true anyway. Change-Id: I2d5d202b6246a9065fdf77f325a4a04279dbe4b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix docsFrederik Gladhorn2012-09-034-12/+14
| | | | | | Change-Id: Id57b7932afb89fe9d3f4f6e6c3b558265475d77b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* doc: fix example linkFrederik Gladhorn2012-09-031-1/+1
| | | | | Change-Id: Ie0235281c3a4d5e5dadc6e5823bbf722b7ca411f Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* checkForCodecs is not used when QT_LOCALE_IS_UTF8 is definedJiang Jiang2012-09-021-1/+1
| | | | | | Change-Id: I3d82863cbd123dbf73eb8f5721ef9294e6365de6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't reference widgets/widgets in example doc.Frederik Gladhorn2012-09-011-3/+3
| | | | | Change-Id: Ie1fe516f75ca8c1b2233dc6bb2b887b55593e730 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Doc: Fix docbuild when not using -developer-build.Casper van Donderen2012-09-011-2/+2
| | | | | | | | https://codereview.qt-project.org/#change,33974 only works in the case of a developer build. Not in a normal prefix build. Change-Id: I3a3e5029cefaa9f83c5deb71665f0efa9d812819 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* add macro wrap for QXmlStream related codeJing Bai2012-08-312-0/+13
| | | | | | | | To fix a compile error when QXmlStream is removed by defining macro, but it is still used in some files. Change-Id: I776c799732212b7401767440448248fc7b5dc480 Reviewed-by: David Faure <faure@kde.org>
* Don't set empty CMAKE_TOOLCHAIN_FILE or CMAKE_BUILD_TYPEStephen Kelly2012-08-311-2/+12
| | | | | | | | | | | | | | | The CMake Visual Studio 10 generator generates an include() for the empty CMAKE_TOOLCHAIN_FILE, causing the errors in the bug. There may be other remaining errors to cause the Windows CMake build to fail with that generator, but this patch is an improvement anyway - there is no point in setting empty strings as values for those variables. Task-number: QTBUG-27087 Change-Id: I68cce9e3dce07835db5f42777ac02d440f90f967 Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Force QT_NO_ICONV on win32:!win32-msvc*Lukas Geyer2012-08-311-1/+1
| | | | | | | | | | | | This behaviour was changed in Ide9800f6 to suppress macro redefinition warnings for MSVC, but MinGW has iconv support and therefore configure does not set QT_NO_ICONV, which prevents compilation on win32-g++ as QIconvCodec does not support Windows. Change-Id: Ic3c4ccceb3eaf9542c95b0c27847ca5ab51849b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Fix the name of the arguments of qAtan2 to match std::atan2Thiago Macieira2012-08-312-6/+6
| | | | | | | | | There is no change in functionality, just swapping of the names x and y. The std::atan2 function uses (y, x) in that order, so we should too. Task-number: QTBUG-27090 Change-Id: I7d4597a6c6909f574c517033f5d49fe17b7a7ead Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Document the purpose of QDateTimeParser::cachedDay.Mitch Curtis2012-08-311-0/+13
| | | | | | | | | It's useful to know what this member variable is used for, since there is very little documentation for QDateTimeParser, which makes maintenance yucky. Change-Id: I9ecf5aa5ef0b5d778ceb858c323e3bab1ebaa7dc Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Simplify qtbase qdocconfs.Casper van Donderen2012-08-311-15/+2
| | | | | | | | | | We should be using the global qdocconf for the common variables. This change also allows you to just specify -installdir without using a templatedir. Change-Id: I207d279d9b5199212e896fc5ccab5c212b1896c6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Fix static plugins for classes in namespaces.Friedemann Kleint2012-08-301-6/+6
| | | | | | | | | | | Breakage introduced by 819d0203e6fd9d27dc4c22e8c3cb8b437998f62a . Extend QT_MOC_EXPORT to take the unqualified class name as well for the function names. Change-Id: I736097b564caa37c522d723780663d03341f9032 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Lukas Geyer <lgeyer@gmx.at>
* Logging: Remove mutex for OutputDebugStringKai Koehne2012-08-301-3/+0
| | | | | | | | | | | | OutputDebugString seems indeed to be thread safe, at least according to http://www.unixwiz.net/techtips/outputdebugstring.html . I also didn't manage to run into any deadlocks on Windows 7 ... The comment + code was already there (in qcoreapplication_win.cpp) in the first git commit that imported Qt. Change-Id: I442e22575558958ef21ab8c6b4cc8b03aee906b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixes possible memory leak in QContiguousCacheFabian Bumberger2012-08-301-2/+4
| | | | | | | | When inserting an item on a position that is already occupied, the destructor of the old item was never invoked. Change-Id: I01dc4ec9f2da5027284eba94e1a9ad36b062a50d Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVarLengthArray: C++11-ify insert/erase signaturesMarc Mutz2012-08-302-10/+10
| | | | | | | | | | | | | | | | | | | In C++11, container insert and erase operations take const_iterators instead of iterators. This is a bug fix compared to C++98, where the mere lookup step of a lookup-or-insert operation had to be done using (mutable) iterators, which is particularly worrisome for Qt containers that are implicitly shared, because of the unneeded detach in the positive case. QVarLengthArray is not implicitly shared, but for consistency, the signatures should be changed here, too. The reason this commit contains only the change to QVarLengthArray is that this is by far the easiest container. The implictly shared containers are harder, because detaching invalidates other iterators (more than the sister STL container would). Change-Id: Ib3d98360bfe376b782b9d1283c5fa3555e8a719e Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString::append: add (const QChar*, int len) overloadMarc Mutz2012-08-302-0/+19
| | | | | | | | | | | Both insert and replace have this overload, so one reason to add it to append(), too, is consistency. But I can also make good use of this overload in the the new QStringList::join(QChar) overload, so it's actually useful in its own right. Change-Id: Iccd48f9cb84831399e4db7e3e78eba25c0ced30d Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Blackberry: Fix QFileSystemEngine::tempPath()Thomas McGuire2012-08-291-2/+5
| | | | | | | | | | Apparently it depends on the user and/or firmware version on whether TMPDIR or TEMP is set, so try both. Additionally, fall back to /tmp if neither is set, as that seems to be present on all devices. Change-Id: Ia49499729df525276e145d2e35e94559eac45c98 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Exclude the examples/widgets/doc dir for all but widgets.Frederik Gladhorn2012-08-291-0/+2
| | | | | | | | There are too many references to the QWidget lib documentation in there. On the other hand this keeps snippets working. Change-Id: I7dd63b7fba1758accea2663f7b427940a8857e32 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Don't do path conversions on isEmpty()João Abecasis2012-08-291-2/+1
| | | | | | Change-Id: I4b5eefe74c6f741d1d0870d502798a5e3d0e7a2a Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Use QString for user-visible stringsJoão Abecasis2012-08-291-1/+1
| | | | | | | | | | | | | | dirPath is kept as the "user visible" path string and is used to construct paths during directory iteration. In QFileSystemEntry (and in Qt, more generally) these are represented with QString. While on Windows QFileSystemEntry::NativePath and QString are one and the same, dirPath does not represent a native path. So, basically, don't do that. Change-Id: I987477cb41b37018634ac43aeda004d254181dc5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* wrap the implementation with NO_SETTINGS macroJing Bai2012-08-291-0/+3
| | | | | | | | To fix a compile issue where the header is wrapped but the implementation is not. Change-Id: I9d4e30a251e9f5de71710eb6bf784fb2eb396698 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Plugin metadata is now updated in setFileName(), not load().Lukas Geyer2012-08-293-6/+16
| | | | | | | | | | | | Plugin metadata has been updated in load(), with the side-effect of metadata not beeing available until plugin has been loaded - and which the new metadata system tries to prevent in the first place. The metadata is now updated (and avaiable) as soon as a valid filename is set. Change-Id: Ia5aedc67d8115e71c2ecbcbcadf786ba1c2893d8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Removed extra detach calls from QJsonArray::takeAtDenis Dzyubenko2012-08-291-6/+1
| | | | | Change-Id: I5711ec6b03e3979eca61f62004a7c6f0eaae79e0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix warning when compliling with -Wconversion.Frederik Gladhorn2012-08-281-2/+2
| | | | | | Change-Id: I90bf9f9a1860cabb67bc92599e7ccce94496d134 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: make QT_SHAREDPOINTER_TRACK_POINTERS work with QObjectsGiuseppe D'Angelo2012-08-281-2/+2
| | | | | | | | | | | | | | | | If setQObjectShared crashes because a QObject is tracked by two different QSharedPointers, we lose the debug feature offered by #defining QT_SHAREDPOINTER_TRACK_POINTERS, as the check done by this define happens after the setQObjectShared call. Therefore, move setQObjectShared after the internalSafetyCheckAdd call. This is actually a noop change in 5.0, as setQObjectShared does nothing. However it prevents a bug in case the Qt 4 behaviour is brought back in some later version. Change-Id: I71340d0f878828354537762d01c46d441efc918c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Forward the CMAKE_TOOLCHAIN_FILE to tests.Stephen Kelly2012-08-281-2/+2
| | | | | | | | A Toolchain file must be supplied to cmake to cross compile. Forward that to tests so that they can be built too. Change-Id: Ie15190ff1d1f554ce436b7cb4d37a177a7e17e56 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* doc: remove links to Qt DesignerFrederik Gladhorn2012-08-282-3/+3
| | | | | | | | Designer is in the tools repo, we cannot link there. Mentioning the name should be good enough. Change-Id: I55193aa31e60ae266a8890f706c332a63ed3610d Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add automatic metatype registration for invokable methods.Stephen Kelly2012-08-282-10/+26
| | | | | | | | | | | This works similarly to the automatic registration for Q_PROPERTY types, but in this case it mostly affects the need for users to call qRegisterMetaType<T>() before using queued connections with methods using non-built-in metatypes, or before using invokeMethod manually. Change-Id: Ib17d0606b77b0130624b6a88b57c36d26e97d12d Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add automatic metatype registration for Q_PROPERTY types.Stephen Kelly2012-08-282-4/+20
| | | | | | | | | | | | | | | | In Qt 4, the user needs to call qRegisterMetaType if the property could otherwise be read before the type is registered with the metatype system. This patch makes that unnecessary and automatic by registering it when the first read indicates that it is not yet registered instead or when QMetaProperty::userType is called before it is registered. The types which are automatically registered exclude the built-in types, which do not need to be registered, and include metatypes which are automatically declared, such as pointers to QObject derived types and containers of existing metatypes. Change-Id: I0a06d8efdcb64121618e2378366d0142fa0771f5 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Handle invalid dates properly for QDataStream versions < 5.Mitch Curtis2012-08-281-1/+2
| | | | | | | | | | | | | | | In Qt 5, when streaming an invalid QDate using a QDataStream version earlier than Qt_5_0, QDate.jd is written and read as 0, which is an invalid julian day for Qt versions earlier than 5.0. For Qt 5.0 however, 0 is a valid julian day, so when comparing a deserialised invalid date (read using a QDataStream version < Qt_5_0) against a default-constructed invalid date, they won't compare equal when they should. Task-number: QTBUG-26989 Change-Id: Ia76df493471f3b068c7d7187be20e3178eff2cc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* cmake: define QT_NO_DEBUG in client release buildsPeter Kümmel2012-08-271-0/+1
| | | | | Change-Id: Ife224bf908c5e9bc1e62a830a3750de88a082eb7 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add some error checking to the qt5_use_modules function.Stephen Kelly2012-08-271-0/+8
| | | | | | Change-Id: I8fa2f10edbee1080646324c0689b23eda44aa75d Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix plugin docs regarding location of json files.Stephen Kelly2012-08-271-1/+2
| | | | | | | | | The commit 2ef52ca12416baa96feb64e02186aae04f883a12 introduced an error regarding where the json file must reside. Change-Id: I296c93abebb3e9f8c9e7e29a4a433201064969f0 Reviewed-by: Peter Kümmel <syntheticpp@gmx.net> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* qcompilerdetection.h: set Q_DECL_OVERRIDE/Q_DECL_FINAL for 2005 <= MSVC <= 2010Marc Mutz2012-08-271-3/+18
| | | | | | | | | This enables Q_DECL_FINAL and Q_DECL_OVERRIDE backed by VC's non-standard extensions from VC 2005 on. VC 2012 will support the standard-compliant version, so use that there. Change-Id: I96874fe3d36fcaa283d2d1f53d5eb6825e55f259 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update Q_PLUGIN_METADATA docu.Peter Kümmel2012-08-261-1/+6
| | | | | Change-Id: I7e451a15de392552609ef549118600684429e0ea Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QMetaTypeId: optimize qt_metatype_id() in special casesMarc Mutz2012-08-261-48/+50
| | | | | | | | Same change as for Q_DECLARE_METATYPE, but in the container and smart pointer specialisations of it. Change-Id: If9390ccc43eb3b07122f5ea5b8094139b5e1ded0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QMetaTypeId: optimize qt_metatype_id()Marc Mutz2012-08-261-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code resulted in one memory fetch for the test plus another one for the return value (at the assembler level). The new code reuses the already-loaded value: - movl _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip), %edx - testl %edx, %edx - je .L158 movl _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip), %eax - ret + testl %eax, %eax + je .L160 + rep; ret It also saves one load in the not-yet-initialised case: -.L158: +.L160: leaq .LC7(%rip), %rdi subq , %rsp .cfi_def_cfa_offset 16 movq himBH1, %rsi call _Z17qRegisterMetaTypeI12QDBusMessageEiPKcPT_ movl %eax, _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip) - movl _ZZN11QMetaTypeIdI12QDBusMessageE14qt_metatype_idEvE11metatype_id(%rip), %eax addq , %rsp .cfi_def_cfa_offset 8 ret Change-Id: I769950449822f2b1587680e05518be0a4f3120a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QSlotObjectBase: make 'impl' and 'ref' privateMarc Mutz2012-08-262-20/+21
| | | | | | | | | | | | This allows to fold the deref() and the destroy() operations into one, destroyIfLastRef(). The member variables were renamed since there's now a member function of the same name (ref()). Change-Id: Ib94416d9e658065bbf5d3711ecafaf0eb063af17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QSlotObjectBase: make Operation enum protectedMarc Mutz2012-08-261-3/+5
| | | | | | | | | We don't want people to go and call through the function pointer directly. Change-Id: I386645239974f008d513eaa62593c1141b294b60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QSlotObjectBase: remove misleading commentMarc Mutz2012-08-261-1/+1
| | | | | | | | | | | | These constructors might not benefit from being constexpr (as the objects are only created on the heap), so don't suggest so. There's no disadvantage of them begin constexpr, but their constexpr'ability depends on whether QAtomic has a constexpr constructor, and the added complexity of finding that out isn't worth it. Change-Id: I089a29dcb98ba935c339dce09d71f283522a9afd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtGlobal: document Q_DECL_FINAL and Q_DECL_OVERRIDEMarc Mutz2012-08-261-0/+56
| | | | | | Change-Id: I9b292ae3319c30ad878aade4416fb88155465a54 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtGlobal: remove Q_DECL_FINAL_CLASSMarc Mutz2012-08-262-9/+3
| | | | | | | | | | | Now that qvariant_p.h's HasIsNullMethod check is fixed so that it doesn't require Q_COMPILER_DECLTYPE anymore to be able to deal with final classes, there's no point in distinguishing Q_DECL_FINAL and Q_DECL_FINAL_CLASS anymore, so remove the latter. Change-Id: I31de5b63e7d2e44171a13e928997c946d93e05c9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QVariant: make the HasIsNullMethod check work across all compilers (maybe)Marc Mutz2012-08-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we have a C++11 version that requires Q_COMPILER_DECLTYPE support, and can deal with final classes, and a C++98 version that doesn't require any C++11 features, but fails on final classes. What we're missing is a version that works for MSVC v8 and v9 (2005 and 2008), which sport the 'sealed' non-standard keywords but lack decltype support. So far, we tried to solve the problem by making class-level final special (Q_DECL_FINAL_CLASS), not defining that macro for these two compilers, even though we did define Q_DECL_FINAL, the method-level keyword. This new formulation, taken from http://stackoverflow.com/a/9655327/134841 supposedly supports all compilers with a minor #ifdef for MSVC which doesn't like applying sizeof() the way we do. However, testing has shown this to blow up on OSX. So we use the less intrusive approach: add this variant as a third version, only used by VC 2005 and 2008. Change-Id: If1945f8a6e9ed36cb68212fa781d5e29eb2a082d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* qcompilerdetection.h: add MSVC 2012 featuresMarc Mutz2012-08-261-0/+7
| | | | | | | | These are taken from the table at http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx Change-Id: Ifd2f88ca5d92092a6a025bef3da36fde0a802a66 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* qcompilerdetection.h: stream-line MSVC feature detectionMarc Mutz2012-08-261-6/+9
| | | | | | | | | | | | | | | | | Reformat the MSVC feature detection to be similar to other compilers, ie. 1. Inside the C++11 features section instead of where the compilers are detected 2. In one block for the compiler, with sub-blocks for the version. However, it's now not 100% compatible with the previous version, since Q_CC_INTEL is now explicitly excluded while before it was implicitly included in the MSVC case. I have no idea whether that matters, since Q_CC_INTEL is handled for itself further up already. Change-Id: Id9e8da0a5394ad5643bcb29493f14bc6e8264c13 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>