summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Add missing #include <qdatastream.h> or <qiodevice.h>Thiago Macieira2014-08-076-0/+6
| | | | | | | Lots of code depended on an indirect includes from qstringlist.h. Change-Id: I33d0dce33d64302d6c0e49180cc1249b90ab27c5 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* winrt: Handle dispatcher thread changeAndrew Knight2014-08-071-18/+21
| | | | | | | | | | If the calling thread changes when processing events, the dispatcher will no longer have thread access and event processing will fail. This can e.g. prevent new threads from being created. To remedy this, the dispatcher object is re-fetched if the thread is changed. Change-Id: I519cff521f9b84211db3f28a7a28b532de44a6a4 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* QCommandLineParser: support extremely concise option configuration in C++11Marc Mutz2014-08-066-2/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this commit to make the code in the test work: QCommandLineParser parser; parser.addOptions({ { "a", "The A option." }, { { "v", "verbose" }, "The verbose option." }, { { "i", "infile" }, "The input file.", "value" }, }); For this, QCommandLineParser needs a version of addOption that can take a list of options. That's what addOptions() is for. More importantly, the QCommandLineOption ctors mustn't be explicit. OTOH, any implicit conversion from QString or QStringList to QCommandLineOption is also undesirable. To solve this dilemma, add new QCommandLineOption ctors that just take one argument and are explicit, and make the existing ctors implicit. In order to avoid ambiguities, remove the default values of their resp. 2nd arguments. The new ctors are by intention not \since 5.4, as they are completely transparent to the user. Et voila, even better than getopt_long(3). [ChangeLog][QtCore][QCommandLineParser] Added addOptions() method. Change-Id: I5e779f3406cd0f6c8ec6ecbf6c8074af226de300 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement QStringRef::splitJędrzej Nowacki2014-08-062-2/+38
| | | | | | | [ChangeLog][QtCore] Added the QStringRef::split() function Change-Id: I28709c9761785dea7be4e7d621ecf4e1ae007a72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the last remnants of iWMMXt in QtThiago Macieira2014-08-053-40/+7
| | | | | | | | This code hasn't been tested for at least 4 years. It's not maintained and probably doesn't work. Change-Id: I4b9a5179e34111b400914f91caa6b741b69771bb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Doc: normalize the {to,from}WCharArray text about encodingsThiago Macieira2014-08-051-4/+4
| | | | | | | | | | Properly capitalize the names UTF-16 and UCS-4 and make sure we talk about UTF-16 and not UCS-2. UCS-2 is not the same and does not support surrogate pairs. Task-number: QTBUG-35287 Change-Id: If33270996bacc9ae5d04c87423fa1ee9ddaff230 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Add a few missing Neon constructsThiago Macieira2014-08-052-7/+7
| | | | | | | | | | | The #undef in qcompilerdetection.h was missing. And apparently we can detect Neon since Windows Mobile 6 too. Change-Id: I38a5f71b2704a29a706183e39f43db3a78a729db Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QFutureInterface: allow to work with a QThreadPool != globalInstance()Marc Mutz2014-08-053-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: It is often necessary/advisable to schedule tasks on thread pools != globalInstance(). As Herb Sutter writes in http://www.drdobbs.com/parallel/use-thread-pools-correctly-keep-tasks-sh/216500409 and the Qt Training Material stresses, tasks you schedule on a (global) thread pool should be non-blocking, which currently rules out using any of the QtConcurrent functions for, say, file I/O. Nonetheless it's often convenient to have thread pools also for file I/O, as the thumbnail viewer exercise in the Qt Training Material shows. In this case, you'd use a dedicated thead pool, leaving the global thread pool for CPU-bound tasks. Yet, none of the QtConcurrent functions allow to pick the QThreadPool instance on which to schedule the work created with them. This patch prepares for them to do so. This is the first part of the forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1281. Implement by using a new QThreadPool* member that defaults to nullptr, and adding setThreadPool to set this member, then using it in lieu of QThreadPool::globalInstance() everywhere. I chose to leave m_pool == nullptr to mean globalInstance() to avoid creating the global instance whenever a QFuture is created, even if the future represents the result of a calculation not run on the global thread pool. [ChangeLog][QtCore][QFuture] Can now be used with any QThreadPool, not just globalInstance(). Task-number: QTBUG-17220 Change-Id: I4e1dc18d55cf60141b2fa3d14e2d44a3e9e74858 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Logging: use the known function when the first frame of the backtrace is unknownOlivier Goffart2014-08-051-3/+7
| | | | | | Change-Id: Ia591805c82e7bf77dc7af04f1054c7daca58eb6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-08-054-9/+29
|\
| * Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-08-044-9/+29
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/arch/arch.cpp src/opengl/qgl_qpa.cpp src/widgets/kernel/qapplication.cpp Change-Id: I80b442a4c2c9632743a5b5c7319ff201ec5bc4fd
| | * Merge remote-tracking branch 'origin/stable' into 5.3Oswald Buddenhagen2014-07-302-8/+17
| | |\ | | | | | | | | | | | | Change-Id: I2a044d44ca991ba20ddd710053b85afb51e362d3
| | | * Support MIPS atomic on pre-MIPS32 architecturesAurelien Jarno2014-06-271-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The atomic functions on MIPS are based on the sync opcode with an immediate argument, which is something introduced in the MIPS32 instruction set. This prevent to use Qt on pre-MIPS32 CPU, like the Loongson 2 CPU. However some of the pre-MIPS32 CPUs interprets the sync opcode with and immediate argument as a sync opcode without argument (which is a stronger ordering than with the argument), and for the others the kernel emulates it. It is therefore fine to use the current MIPS atomic functions on pre-MIPS32 CPU. This patch allows that by temporarily changing the instruction set to MIPS32 around the sync instruction, so that binutils doesn't choke on it. Change-Id: I9cc984bd55b5f172736ce9e638a6f4e271b79fe7 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Enable sparc detection.Lisandro Damián Nicanor Pérez Meyer2014-06-271-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been working in Debian for some time. It also adds detection for 64bits Sparc. Change-Id: Ie4fc0f58b37672b79191ebe51de0caf2eaf8a1d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Work around ICC bug in local static symbols for Q_GLOBAL_STATICThiago Macieira2014-07-301-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling the innerFunction() of the Q_GLOBAL_STATIC expansion, ICC emits global symbols for the internal "holder" local static variable and its guard. If there are two global statics of the same name in two different .cpp files, the linker will incorrectly merge the two "holder" variables. This was noted between the "customTypes" global statics of qmetatype.cpp and qdbusmetatype.cpp in a static build. The C++ standard requires that local static variables declared in inline functions must be the same, regardless of whether the body of the function got inlined or not. The IA-64 C++ ABI does that by requiring local static symbols for inline functions to be global and mergeable ("link once"). However, two functions in anonymous namespaces in different files are not considered to be the same function, so their local statics should not be merged. This is where ICC failed: the local statics are global and mergeable, even though the function is in an anonymous namespace. ICC correctly emits the function itself as a local symbol. Alternative solutions were: 1) add "static", but you can't use a static symbol in a template parameter in C++98 mode 2) remove the "inline" keyword, but then GCC 4.8 will not inline Intel issue ID: 6000058488 Task-number: QTBUG-40053 Change-Id: I307622222499682dde711b2771c8cf7557400799 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | | | Add Q_ENUMS for Qt::MouseEventSource, Qt::FocusReason.Friedemann Kleint2014-08-051-0/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: Ic91b9a74d0c28ec225d2708a13aafddd1e2c32af Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | | QList: Fix MSVC 64bit warning about loss of data.Friedemann Kleint2014-08-051-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | qlist.h(133) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data qlist.h(131) : while compiling class template member function 'QList<QString>::QList(std::initializer_list<T>)' Change-Id: I8a11e298cd10da199490fbd8b269405a9e1cf5f3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | QList: add missing reserve() call in the initializer_list ctorMarc Mutz2014-08-031-1/+1
| | | | | | | | | | | | | | | Change-Id: Idc46a347009556d06db4bc1f7ce3e2613fb1a405 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Support multimedia keys on WindowsAllan Sandfeld Jensen2014-08-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently do not receive events from most multimedia keys on Windows because they are sent using appcommand events instead of the normal key events. This patchs adds support for parsing appcommand events. Change-Id: I19f568b6fa0d3d136e3a22318df1499a1fab6edb Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | | Make QOpenGLWidget publicLaszlo Agocs2014-08-012-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLWidget is now public. In addition Qt::WA_AlwaysStackOnTop is introduced to support the special case of semi-transparent QOpenGLWidget or QQuickWidget on top of regular widgets. hellogl_es2 becomes the qopenglwidget example. This example performs painting both via QPainter and native GL commands and has the OpenGL widget combined with other, normal widgets. The widget stack receives some changes when it comes to renderToTexture widgets like QQuickWidget and QOpenGLWidget. Calling update() will now result in a paint event, which is essential for QOpenGLWidget since we want it to behave like a regular widget. The dirty region handling is extended specially for such widgets due to performance reasons. (an OpenGL content update must not result in any backingstore painting, and is thus handled as a different kind of dirtiness) [ChangeLog] Added QOpenGLWidget. This widget serves as a replacement for QGLWidget. Task-number: QTBUG-36899 Task-number: QTBUG-40086 Change-Id: Ibf7f82fea99b39edfffd2fc088e7e0eadbca25cf Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | | QTimeZone: optimize QTimeZonePrivate::isValidId()Marc Mutz2014-07-311-18/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is used in the named timezone ctor and was using QByteArray::split(), followed by size checks and a linear scan for invalid chars per section. The use of split() resulted in a lot of memory allocations and, unsurprisingly, bad performance. The new code just performs one linear scan through the byte array, calculating section sizes on the fly. Benchmark results (with the test data in tst_QTimeZone::isValidId_data()) show typical speedups of ~10x for valid IDs: RESULT : tst_QTimeZone::isValidId_bench():"minimal middle": - 0.00036 msecs per iteration (total: 95, iterations: 262144) + 0.000035 msecs per iteration (total: 74, iterations: 2097152) Even in the sweet-spot case of the old code---a space character anywhere in the string, checked for before the split---the new code is anywhere between slightly faster and not much slower: RESULT : tst_QTimeZone::isValidId_bench():"invalid char ' ' front": - 0.000011 msecs per iteration (total: 94, iterations: 8388608) + 0.000010 msecs per iteration (total: 86, iterations: 8388608) RESULT : tst_QTimeZone::isValidId_bench():"invalid char ' ' middle": - 0.000014 msecs per iteration (total: 62, iterations: 4194304) + 0.000016 msecs per iteration (total: 69, iterations: 4194304) RESULT : tst_QTimeZone::isValidId_bench():"invalid char ' ' back": - 0.000018 msecs per iteration (total: 79, iterations: 4194304) + 0.000023 msecs per iteration (total: 98, iterations: 4194304) This is not surprising, as the space character was singled out for a fast-exit check before. For any other invalid character, the new version is anywhere from 15x to 35x faster: RESULT : tst_QTimeZone::isValidId_bench():"invalid char ? front": - 0.00034 msecs per iteration (total: 91, iterations: 262144) + 0.000010 msecs per iteration (total: 87, iterations: 8388608) RESULT : tst_QTimeZone::isValidId_bench():"invalid char ? middle": - 0.00036 msecs per iteration (total: 96, iterations: 262144) + 0.000016 msecs per iteration (total: 68, iterations: 4194304) RESULT : tst_QTimeZone::isValidId_bench():"invalid char ? back": - 0.00035 msecs per iteration (total: 94, iterations: 262144) + 0.000021 msecs per iteration (total: 92, iterations: 4194304) If there was a deeper reason to single out the space character, that fast-exit path can easily be restored. This function is often used in conjunction with availableTimeZoneIds(), which currently vastly dominates the runtime of the function calling both, but I'll add another optimization for the common use-case of just checking for a time-zone's existence in a subsequent commit. Change-Id: Ife1d096fcd39464083ea464c23e49ad98fabf345 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Android: Really suspend apps that are put in the backgroundBogDan Vatra2014-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main event loop will be paused when an application is suspended, this is also the normal behavior of any Android application. When an application is suspended on Android all its Gl surfaces are destroyed and can't be used to render anymore. So, we need to pause the main event loop in order to pause all the timers which might trigger drawings. The event loop is resumed immediately after the application is foreground. AndroidManifest.xml contains more info about how to disable this behavior and what might happen if you do it. [ChangeLog][Android][Important Behavior Changes] The main event loop is now stopped when the app is suspended Task-number: QTBUG-36274 Change-Id: I4c0ba5df9d95f348bca67ea5c76865d6d20775e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | | Add ascii_isspace to replace the locale-dependent isspace(3)Thiago Macieira2014-07-313-10/+37
| | | | | | | | | | | | | | | Change-Id: Icee42515179e6f3ddefe0692af69e90054449618 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Micro-optimize QXmlStreamReaderPrivate.Jędrzej Nowacki2014-07-311-3/+3
| | | | | | | | | | | | | | | | | | | | | Avoid redundant QStringRef to QString conversions. Change-Id: I4a65119e7821206e2f72387a5d02cec5ce39dbfb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Add QString::splitRef functions.Jędrzej Nowacki2014-07-312-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functions can be used to optimize code that do not need to use the split results as QString directly. [ChangeLog][QtCore] QString can now split a string to a list of QStringRef. Change-Id: Ic2dc929e1fba82f9a060e37c51068a301cb5b866 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Doc: update the list of typical values for xxxCpuArchitectureThiago Macieira2014-07-311-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we wanted to make the list exhaustive for buildCpuArchitecture, we'd add alpha, avr32, bfin, s390(x), and sh. I don't want to make it exhaustive because that's cluttering the documentation and we'd have to keep in sync with archdetect.cpp. And we can't make currentCpuArchitecture exhaustive, since it depends on the output from uname(2). You can argue that neither IA-64, POWER, nor SPARC architectures are typical these days... Change-Id: I0a5310770947263e1bafd9443ea59420813c51a8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Attempt to add support for Solaris sysinfo callThiago Macieira2014-07-311-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Totally untested. Change-Id: I2c2347a66cb3fcb71d97782090ac628bef0b247f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use an enum to check that the OS is saving the register stateThiago Macieira2014-07-311-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's easier to read AVXState and AVX512State than 6 and 0xe6. Also add a note that where we should have checked whether the SSE state is being saved by the OS. However, we won't do it because it's just a waste of CPU cycles: any OS Qt 5 runs on will enable the proper state-saving. Change-Id: Id87b59fe1388a6cab983c9412341e36a86dd15c5 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-07-302-6/+6
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-292-6/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl_symbols.cpp Change-Id: Ic62419fa1fee5f4de6c372459d72e6e16f9a810b
| | * | Use the stateless UTF-8 encoder in QStringRef::toUtf8Thiago Macieira2014-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::toUtf8 already does it. I guess I forgot to update this part in d51130cc3a00df8147e2eb0799e06865c901c6e0. Change-Id: I83feafcb0383758f7e64d5142f57a7ae6a2ff351 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| | * | Doc: corrected autolink errors in qnamespace.qdocNico Vertriest2014-07-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-40362 Change-Id: Ic2a0740a12c98a60cb1d178c4d42c4ae1c39869c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | | Don't parse /etc/os-release every time we need to do uname(2)Thiago Macieira2014-07-301-39/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just an optimization of the code: instead of opening and parsing /etc/os-release every time QSysInfo::kernelType() is called on Linux, do that only in QSysInfo::productType() and productVersion(). Change-Id: I201504934ecf7a51854cb49c790bd9d30eba644b Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | | | Fix QByteArray::to{Upper,Lower} when the array contains embedded nullsThiago Macieira2014-07-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QByteArray] Fixed a bug that would cause QByteArray to stop converting toUpper or toLower at the first embedded null character. Change-Id: Ia369037206617813d86a8f1489589243c82aa51b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Rework of QSysInfo OS and kernel version functionsThiago Macieira2014-07-303-105/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch splits the OS product from the kernel name and versions. Previously, it was a little confusing. Thus, osType is split in two: kernelType() always returns the kernel type, which includes "linux" for Android, "darwin" for iOS and OS X, "qnx" for BlackBerry, and "windows" for all the Windows OSes. The Linux distribution name and the visible product names are found in productType(), with the respective versions in productVersion(). For an update system, applications probably want to send all four tokens: - for Android, BlackBerry, iOS, OS X and Windows, the relevant information is productType and productVersion - for Linux distributions, in addition to productType and productVersion, the kernelType ("linux") is useful as a fallback and it's important for Debian/kFreeBSD and Debian/GNU - for other Unix systems, the relevant information is kernelType and kernelVersion Change-Id: I66c36d5a4ddfad47babfc6744d752273705e7076 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | | | Add QSysInfo::currentCpuArchitecture()Thiago Macieira2014-07-302-2/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buildCpuArchitecture() returns the CPU Qt was built for, while this function returns the CPU that Qt is running on -- if the OS was kind enough to tell us. Change-Id: Ib27937e3ff028cb500d263c4921ef00d3a567715 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QDebug: Improve QDebug stream operator for QFlagsKai Koehne2014-07-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the built-in hex, showbase manipulator to format the number in hex. Also, apply nospace() only once. Change-Id: Id4b3d5f082ad13f52c8711408d7ec609bec3a621 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | | Remove normalization of "default" categoryKai Koehne2014-07-304-77/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d61e774307819 got rid of the special handling of the 'default' category in the qloggingregistry, so we don't need the private header file anymore, nor does it gain us anything to 'normalize' all default categories to one string. Change-Id: I027b4b82ff915428287432f39f76b4e719cf7874 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | | Add qFormatLogMessage()Kai Koehne2014-07-302-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Export the former qMessageFormatString() as qFormatLogMessage(). This allows custom message handlers to format their messages just like the default message handler, taking qSetMessagePattern() / QT_MESSAGE_PATTERN into account. The method should arguably not add the '\n' at the end, which a follow up commit will fix. Change-Id: Ib2a9cfda91473df079daf03bf3197e6ac63e013e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | | | Add initializer list support in QJsonObject.Jędrzej Nowacki2014-07-302-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It allows to create a QJsonObject instance in C++ by using initializer list of pairs QString QJsonValue, for example: QJsonObject o = {{"property1", 1}, {"property2", 2}}; [ChangeLog][QtCore][QtJson] QJsonObject now supports C++11 initializer lists. Task-number: QTBUG-26606 Change-Id: I67af881e175f427e563e685336c48a5f8466b476 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Export QAbstractState active property.BogDan Vatra2014-07-294-2/+49
|/ / / | | | | | | | | | | | | | | | | | | It is needed to check if a State is active. Change-Id: I8aa0230b8cd96fb9b95b86b2ce118fe280f9ce97 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | | Logging: support %{backtrace} in QT_MESSAGE_PATTERNOlivier Goffart2014-07-281-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On supported platform, allow to show a backtrace by using %{backtrace} or %{backtrace depth=N separator="|"} [ChangeLog][QtCore][Logging] QT_MESSAGE_PATTERN can include a backtrace using %{backtrace} Change-Id: Ib00418c070d3bd6fe846dc04bf69fa91ba64f9cd Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | | Don't track the sharable bit upon detachJoão Abecasis2014-07-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Unsharables", given they can't be shared, don't need to detach, so skip the check altogether and don't try to propagate the flag. It shouldn't be. Change-Id: Icc483401d5a57708b43d64bd3cebc66c6b934815 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Refactor QString::split functions.Jędrzej Nowacki2014-07-281-57/+73
| | | | | | | | | | | | | | | | | | | | | | | | Implementation of the functions were moved to templatized helper functions that will be shared with QString::splitRef in future. Change-Id: Ie25fab57f77f5ceb11ced26ab7e7f86739f4c78b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Ensure mutating operations are NOT performed on immutable dataJoão Abecasis2014-07-281-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Static" and "raw" data are immutable and shouldn't be modified from within the QArrayData API. Adding the asserts here gives us a basic safety net. Change-Id: Ie2fec03fa1ef5a7f73c50e5badf8b8ab863728b4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QUrl: fromLocalFile(QString()) should lead to an empty URL.David Faure2014-07-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is much more useful than the URL "file:", it allows to use "empty path" and "empty URL" for the same meaning (e.g. not set). QFileDialog actually uses "file:" though, as the URL for the "My Computer" item in the sidebar. This patch preserves that. [ChangeLog][QtCore][QUrl] QUrl::fromLocalFile now returns an empty URL if the input string is empty. Change-Id: Ib5ce1a3cdf5f229368e5bcd83c62c1d1ac9f8a17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use the 3-argument testAndSet in the fetchAndXxx operationsThiago Macieira2014-07-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Saves us from an extra load in the loop when the result is already there. Change-Id: Ib65b5b13f27975b8fc88be9b888c19505bf5e07c Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Remove non-existing function.Thiago Macieira2014-07-251-1/+0
| | | | | | | | | | | | | | | Change-Id: I1c201453d069dbc3d981e1ff3789570af09b662c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Use simd.prf for building MIPS DSP codeThiago Macieira2014-07-252-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | No need to duplicate the extra compiler code. Change-Id: Ic5656d2f4500c19e0428a7eec1cbcef6c353e99b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove redundant static_cast from QVariantAnimationJędrzej Nowacki2014-07-251-3/+3
| | | | | | | | | | | | | | | | | | | | | QVariant::convert accepts int as an argument, there was no need to cast. Change-Id: I774c9567972860d887e17acb91ec332ffcebd9d5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>