summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Disable some implicit conversions with QT_RESTRICTED_CAST_FROM_ASCIIAlexander Volkov2017-12-011-0/+4
| | | | | | | | | | Non-const arrays are not literals, so their encoding may be not defined at compile-time and they should be converted explicitly. Change-Id: I2a65e095224f48efafeaa97fd85134697a1e5bf0 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaObject::Connection: mark move ctors Q_DECL_NOTHROWMarc Mutz2017-12-011-4/+2
| | | | | | | Drop the #ifdef Q_COMPILER_RVALUE_REFS - we require that since Qt 5.7. Change-Id: Ib4c6f559b014915f43875ec6791bfda3f24a109b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add template text to \fn commands in container classesMartin Smith2017-12-016-761/+882
| | | | | | | | | | The \fn commands were not recognized by clang-qdoc because the template stuff was missing from the \fn commands. This update adds the correct template text and parameters. It eliminates nearly 2000 qdoc warnings. Change-Id: Ibe047424396a8f99f8bd64efea1b0d8cc7c7527d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Clean up in TZP-Win's calculateTransitionLocalDate()Edward Welbourne2017-11-301-19/+28
| | | | | | | | | | | | | | It's decoding a SYSTEMTIME in the slightly quirky manner of MS's timezone APIs (year 0 means annual, with wDay as 1 through 4 for the first through fourth, or 5 for the last, of a specified week-day within a month) and the calculations to go with it were a little opaque. So clean it up, document what it's doing (and why) and assert some things that should be true. Also, only copy one int, instead of a whole structure, to change from their day-numbering to ours. Expand on a related TODO comment in its caller, at the same time. Change-Id: Iffd95c094c37fc1081b73b2a267cfdcd29aeb4ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Pull several structs and static functions into an anonymous namespaceEdward Welbourne2017-11-301-22/+24
| | | | | | | | | | The implementation of QWinTimeZonePrivate used many static functions and at least one struct; to which I've added. Put these all into an anonymous namespace (thereby keeping the struct types out of the linker's sight): make them local the C++ way, rather than the C way. Change-Id: Ibdce0865234b5d4ebbdc90628cc4d9e790ed6321 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fake a "first transition" at the start of timeEdward Welbourne2017-11-301-0/+9
| | | | | | | | | | | | | | QTimeZonePrivate::dataForLocalTime() needs a transition before the time it starts at; MS's time-zone data tends to omit old zones (before 2007, in the case of Win7 for Casablanca - which had interesting transitions before that), so all we can do is extrapolate backwards from there; but a first rule is indeed apt to be a no-transition rule, describing the zone's status up to the first known transition. So fake a "start of time" transition to return for this case, that describes this prefix of history. Change-Id: Iaf178cbebc3b1e599cbde3437a0af75d9f6ca432 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid underflow on arithmetic with possibly-first transition timesEdward Welbourne2017-11-301-2/+2
| | | | | | | | | | A transition time may represent the beginning of time; as such, arithmetic on it might underflow, e.g. on adding a negative zone offset to compare with a given time. So move the arithmetic to the other side of the comparison in such cases. Change-Id: I1697a03ebf74679ff86059664dd2b173b9c4c367 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Take account of single-transition hacks in MS time-zone APIsEdward Welbourne2017-11-302-17/+106
| | | | | | | | | | | | When a year contains a real change of standard time without any DST, MS's APIs still claim to have both a DST start and a DST end; one of them is bogus and positioned on the start (or end) of the year, producing no change in offset from the end of the previous (or into the start of the next) year. So code round that. Task-number: QTBUG-42021 Change-Id: Ieb6161cfb77db8a57dc181097f117316f9d1c13c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinTimeZonePrivate: make transition searches more efficientEdward Welbourne2017-11-301-125/+83
| | | | | | | | | | Iterate rules (now that there's fewer of them than years) with only a secondary iteration on years (when needed - in which case it should never need more than two iterations). In particular, avoid iterating years to the MIN_YEAR and MAX_YEAR extremes on failure; fail faster ! Change-Id: I354af8e0cb1e484c8abda279991e6e1824f9f7d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refine handling of wMonth checks in QWinTimeZonePrivateEdward Welbourne2017-11-301-6/+28
| | | | | | | | | | | | | | | | | The MS API documents that the two TIME_ZONE_INFORMATION date fields either both have wMonth clear (when there is no DST) or both have it set (for each part of a DST pair). This rule is followed even when there's a standard time change without DST, with perverse results I'll deal with in a later commit. Add code in init() to verify the rule is followed and qWarning() if not. A year with no transitions doesn't imply no earlier or later year has transitions, so don't give up on searches for transitions because of it. Also fix a potential uninitialized variable bug, related to data() breaking out of a loop on such a year. Change-Id: I1ad86c07e54b2eb835a2e02d18dc64022f52a0d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up QDateTimeParser code to make it easier to reason aboutEdward Welbourne2017-11-301-9/+10
| | | | | | | | | | Note that the relevant cases are all numeric, eliminate a redundant variable (the min of two others, one of which was provably <= the other), invert and rename a boolean (that was always used negated), eliminate a case that couldn't arise (and assert this). Change-Id: I9ef9cedbeb608c7cd56ddc618ddfb921966edfbf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTimeParser: reject all short values in fixed-width fieldsEdward Welbourne2017-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | Previously, a 1, 2 or 3 for "dd" would be rejected because 10, 20 or 30 would fit in the field and be valid; but 4 or more was accepted, even though it was too short for the field, because no suffix could make it valid within the field-width. [ChangeLog][QtCore][QDateTime] When parsing dates and times from strings, fixed-width date-time fields, such as a "dd" for day, QDateTime now rejects all values that should be padded, rather than only doing so when the value is a prefix of some value that would fill the field-width. Use a single letter for the field, e.g. "d" for day, if you want to accept short values. (QDateTimeEdit is not affected.) Task-number: QTBUG-63072 Change-Id: I22d223c50057c3edab4ef7f01d9ed0f58e9139c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Raise the upper bound on years to 9999Edward Welbourne2017-11-302-3/+3
| | | | | | | | | | | | | | | | | Test-case taken from bug-report; fits in as an easy row in an existing data-driven test. Add similar tests for date-time and time; and an isValid test on the end of year 9999. The date-time parser was using the end of year 7999 as maximum value for dates and date-times; extend this to year 9999, as I can see no reason not to. [ChangeLog][QtCore][QDateTime] Years up to 9999 can now be parsed without error (previously 8000 and beyond were treated as invalid) in all formats (not only in ISO format). Widgets handling dates now support dates to 9999, likewise. Task-number: QTBUG-64401 Change-Id: I518cfa6c2cb4ecc5a85b896dc9e56b4fdd8a8bb1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mutex-lock QLocale's update of its globalLocaleDataEdward Welbourne2017-11-301-6/+17
| | | | | | | | | For want of this, nothing that used QLocale::system(), inter alia, could be thread-safe or re-entrant. Task-number: QTBUG-49473 Change-Id: I3e017aa7d59c4c39828bb5cdc7ff0780ea66bafe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize QThread::isInterruptionRequested()Marc Mutz2017-11-302-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To signal a thread to cancel, nothing more than a std::atomic_flag is needed, but the implementation actually used mutexes, and weird run-state introspection, so we can't just swap it out for a std::atomic_flag. Instead, we retain the principal logic, however weird it is, and just optimize the common case where isInterruptionRequested() is called from the secondary thread, repeatedly. We add a fast-path that just checks that d->interruptionRequested is not set. That requires nothing more than a relaxed atomic load, because there's no new value read that could be used as a signal to the secondary thread that some condition changed. "What signal?", you may ask. Well, one can think of users doing this: void cancel() { m_why = tr("&Canceled"); requestIterruption(); } void run() override { while (!isInterruptionRequested()) { doWork(); } emit progress(100, 100, m_why); } We need to keep this code working, at least until Qt 6. But the code can already now only rely on synchronization if isInterruptionRequested() returns true. If it returns false, then requestInterruption() has not been called, yet, and any modifications done prior to the requestInterruption() call are not visible in the secondary thead. So we still lock the mutex, and in general don't change the semantics of the functions, except that we don't lock the mutex in the case where the flag wasn't set in the first place. This makes calling isInterruptionRequested() as cheap as it can get, assuming a lock-free implementation, of course. I opted to use a std::atomic<bool> instead of QAtomicInt, as the latter does not have loadRelaxed()/storeRelaxed(), and because it future-proofs the code. Change-Id: I67faf36b8de73d2723f9cdd66c416010d0873d98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QSortFilterProxyModel: Clear persistent indexes on source model changeChristian Ehrlicher2017-11-301-1/+4
| | | | | | | | | | | When a new source model was set to QSortFilterProxyModel, the model tried to remap the persistent indexes to the new model which was wrong. The correct solution is to clear the persistent indexes with _q_sourceModelDestroyed() since the old source model went away. Task-number: QTBUG-44962 Change-Id: Id39e9ac83324250e8bfa434aae467a9206d2590e Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QItemSelectionRange: speedup intersects() in negative caseChristian Ehrlicher2017-11-301-4/+6
| | | | | | | | | | | | | | QItemSelectionRange::intersects() needs to check if the parent of both QItemSelectionRanges is the same. This is a very expensive operation which should be done last. Same goes for isValid() which itself calls parent() for two indexes. This rearrangement speeds up some worst-case usecases by at least 30% as shown in the bug report. Task-number: QTBUG-60940 Change-Id: If6111a73cb8b97a8a0d0640527b34448d21f3143 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Replace qrand() engine with C++11 <random> LCG and deprecateThiago Macieira2017-11-301-83/+59
| | | | | | | | | | | | | | | | Instead of trying to adapt to whatever the C library may have and using QThreadLocalStorage, let's use a simple linear congruential generator engine from <random>. We can't use a single instance because qsrand() is documented to work per thread. I thought of using QRandomEngine, but had to make the choice between growing the QtCore code size and growing the per-thread data size. Code is sharable and is actually smaller than the sizeof(QRandomEngine), which is over 2500 bytes. sizeof(std::minstd_rand) is just sizeof(uint_fast32_t). Change-Id: I0a103569c81b4711a649fffd14ec8e641d02bf20 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Create a QNX version of calculateUnixPriorityJames McDonnell2017-11-301-0/+54
| | | | | | | | | | | | | | | The standard calculateUnixPriority provides values that are almost invariably inappropriate with even LowestPriority mapping to something higher than the priority of any other thread on the system. [ChangeLog][QtCore][QThread] Changed how Qt thread priorities are mapped to QNX system thread priorities. Task-number: QTBUG-53357 Change-Id: I205035c4ca7dcafabda7a9a9b06cc52c67c6d2b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Mark some functions as coldMarc Mutz2017-11-303-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add Q_DECL_COLD_FUNCTION (__attribute__((cold))) to tell the compiler that the following functions are not usually executed in normal programs: - qWarning/qCritical/qFatal - qTerminate - assertion failure - qBadAlloc The effect of the attribute is that 1. These functions get put into their own section, .text.unlikely, and will be optimized for size, not speed. 2. Conditions that lead to one of these functions are automatically marked as unlikely (something we have done manually in the past) 3. (anecdotal) the compiler is less likely to inline these functions Text size effect of this change over all of QtBase: ~27KiB text size saved, of which 11KiB in QtCore alone. Change-Id: If308d4a4b9ff8f7934316c54b161a78ebe3f4205 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThread::requestInterruption(): move qWarning() out of critical sectionMarc Mutz2017-11-301-4/+4
| | | | | | | | | | | | | We do not touch anything mutex-protected in the path towards the qWarning(), so the mutex lock is not needed. It may actually be harmful, since a message handler may check isInterruptionRequested(), which would then deadlock. Otherwise, we're just decreasing the size of the critical section — always a worthwhile goal. Change-Id: I26aa7e3dc087ff7efaccff1d4dc788ba00ba183f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2017-11-3012-63/+66
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-3012-63/+66
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/thread/qsemaphore.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
| | * Correct \since value for QIODevice::skipAndy Shaw2017-11-291-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I9a2f18263a8bc0a0de8978792dbb1f285acc0ccd Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-285-8/+9
| | |\ | | | | | | | | | | | | Change-Id: Iede384644c3df5ee01b701806dfdb586dd6bb138
| | | * Initialize QLoggingRegistry rules on first useTor Arne Vestbø2017-11-253-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: I1861e5366ea980dff2ffa753b137276c77278eee Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | | * Merge "Merge remote-tracking branch 'origin/5.9.3' into 5.9" into ↵Thiago Macieira2017-11-251-3/+5
| | | |\ | | | | | | | | | | | | | | | refs/staging/5.9
| | | | * Merge remote-tracking branch 'origin/5.9.3' into 5.9Liang Qi2017-11-231-3/+5
| | | | |\ | | | | | | | | | | | | | | | | | | Change-Id: I9add7e07ff1b6a1cf52f59dbb8319f30e114e5fc
| | | | | * QSemaphore: fix regression when the timeout < 0Thiago Macieira2017-11-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was introduced by eaee1209f0ead5be786e81db8aee604ccfea85b0, so it affected only 5.9.2. [ChangeLog][QtCore][QSemaphore] Fixed a regression that would make tryAcquire() not to wait forever if the timeout was a negative value. Note: new code is advised to only use -1 to indicate "forever", as some other functions taking timeout periods do not accept other values. Task-number: QTBUG-64413 Change-Id: I57a1bd6e0c194530b732fffd14f58fce60d5dfc9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | | * | | QFlags: support enum classes in setFlag()Giuseppe D'Angelo2017-11-241-1/+1
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unary ~ is not defined for enum classes, so we need a cast. Change-Id: I79d495ebcc24ab960da8dae3be08eb307a9de448 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | improve QLocale::formattedDataSize docs slightlyShawn Rutledge2017-11-241-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I42aaec6d54299d906bf8e2ef1fd696f121b7c2d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * | | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-233-7/+30
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_win.cpp src/plugins/platforms/ios/qioswindow.mm src/plugins/platforms/ios/quiview.mm tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
| | | * | Windows: Resolve QStandardPaths config location without qApp instanceTor Arne Vestbø2017-11-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QCoreApplication::applicationDirPath() requires an app instance, but on Windows the implementation just relies on qAppFileName(), which does not require any instance. As resolving the standard paths could be needed before QCoreApplication instantiation, e.g. for categorized logging, we use qAppFileName() directly. Change-Id: Id882cebd528bcb8e945e73a83f1dc3d599b74d1d Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | | * | Fix the build when AVX2 is enabled but __F16C__ isn't definedThiago Macieira2017-11-221-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If -mavx2 is used, __AVX2__ is defined, which enables the F16C code after commit 280e321e52fd4e86545f3f0d4bd4e047786a897e, but that was wrong since we aren't allowed to use the F16C intrinsics with either Clang or GCC (we can only do that with GCC 4.9 and Clang 4.8, and only with an __attribute__ decoration). With ICC and MSVC, we are allowed to use the intrinsics, but the #include was missing. [ChangeLog][QtCore] Fixed a compilation issue with qfloat16 if AVX2 support is enabled in the compiler. Since all processors that support AVX2 also support F16C, for GCC and Clang it is recommended to either add -mf16c to your build or to use the corresponding -march= switch. Task-number: QTBUG-64529 Change-Id: I84e363d735b443cb9beefffd14b8ac1fd4baa978 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | | * | CMake: Set SKIP_AUTOMOC/AUTOUIC where neededKevin Funk2017-11-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we don't run into warnings for CMake 3.10 Task-number: QTBUG-63442 Change-Id: Ida004705646f0c32fb4bf6006036d80b1f279fd7 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Sebastian Holtermann <sebholt@xwmw.org> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
| | * | | QTimeZonePrivate: prefer /etc/localtime over /etc/timezonePeter Wu2017-11-221-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On modern distros (e.g. those using systemd), /etc/localtime is always a symlink. As that file is actually used by libraries (see tzset(3)), prefer it over /etc/timezone (which is no longer needed since https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803144). This fixes a wrongly reported local timezone when a stale /etc/timezone file exists. While at it, improve sanity check for localtime symlink. Change-Id: I8557a58acf21afaeca0d585066304c79a92b5ddb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | qsimd.cpp: Remove workaround for GCC 4.2Thiago Macieira2017-11-191-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That's long fallen out of support in Qt. Change-Id: I938b024e38bf4aac9154fffd14f7a603baa24e04 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | | QMimeMagicRule: fix inconsequential out-of-bounds accessMarc Mutz2017-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The penultimate entry in mimeRuleTypes_strings is "byte", which, incl. the terminating NUL character, has length five. But 65-59 == 6, so the last index in magicRuleType_indices was off by one. No harm done, since there's one more NUL (three in total...), but fix for the next reader of the code. Change-Id: Ibdf855014a313a0486d013c9d06d55cea96435fd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | | QMimeDatabase: handle removal of a mime directoryDavid Faure2017-11-301-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit didn't handle correctly the case where an entire mime directory is deleted. The unittest wasn't testing that case, now it is. We need to move providers into a new list, and then delete those left over (i.e. now unused). Change-Id: I04fd8b39b511a2331d706864f695ce5074acf916 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | | QMimeDatabase: redesign to use both binary and XML providersDavid Faure2017-11-3010-347/+391
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we would use mime.cache in all mime directories if at least one of them had such a file (other than the most-local one), otherwise the "source" XML would be used in all directories. Now it's possible to use mime.cache in those directories which have one, and XML in those directories that don't. Not only is this more correct, it will allow in a subsequent commit to bundle the binary cache in QtCore's qrc rather than the very big XML file. The design change to allow this is that now every provider only deals with a single directory, and QMimeDatabasePrivate takes care of creating multiple providers, one for each dir. This required to move most of the loops from the binary provider up to QMimeDatabasePrivate itself. Change-Id: Iac82d5f5836b80d45076e586b903d16fa2525b34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | | QMimeDatabase: move recheck test up from the mime providersDavid Faure2017-11-304-75/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is actually simpler (two calls to ensureLoaded are enough, rather than one in every implementation method) and is necessary for further refactoring steps (which will instanciate more provider instances). Change-Id: I9fb8acf3556515babecb88ba88e25af43937af5a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | | QMimeDatabase: ensure mutex is locked in provider()David Faure2017-11-303-20/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This wasn't the case when called from QMimeType, or some QMimeDatabase methods. Now fixed. Change-Id: Ifd515c1520482e4a23c399f1f773269659c92359 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | | QSystemError: unexport the class and export only some methodsThiago Macieira2017-11-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Idaa189413f404cffb1eafffd14cef1f64308fa50 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | | QSystemError: move inline methods to class bodyThiago Macieira2017-11-301-34/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the code smaller and neater. Take this opportunity to mark some of them constexpr. Change-Id: Idaa189413f404cffb1eafffd14cef1df599c9ab7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | | Add a configure-time check for QT_COMPILER_SUPPORTS_SIMD_ALWAYSThiago Macieira2017-11-301-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has two main benefits: 1) introduces a qmake CONFIG we can use in .pro/.pri/.prf files 2) removes the need to keep an up-to-date list of which compilers support the feature The test is implemented as trying to compile every single SIMD test we currently have, but without passing the -mXXX option. The reason for trying all of them is that some people may have modified their mkspecs to add -mXXX options or -march=XXX, which could enable the particular feature we tried, resulting in a false positive outcome. Change-Id: I938b024e38bf4aac9154fffd14f7784dc8d1f020 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | | | QStorageInfo: use Linux's /proc/self/mountinfo to get the subvolumeThiago Macieira2017-11-301-28/+207
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to get "subvolumes" on all filesystem types. We do that by detecting the subdirectory that was bind-mounted. /proc/self/mountinfo has been in the kernel since 2.6.26. Since btrfs was only added on 2.6.29, there is no loss of functionality for btrfs users. I've tested this with subvolume or mountpoint names containing spaces, tabs and newlines. Change-Id: I57a1bd6e0c194530b732fffd14f4fa418255d839 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Thiago Macieira2017-11-3020-374/+856
|\ \ \ \ | | | | | | | | | | | | | | | refs/staging/dev
| * | | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-2320-374/+856
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
| | * | | qfloat16(float) constructor: explicit cast on aarch64 to avoid warningShawn Rutledge2017-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning was global/qfloat16.h: In constructor ‘qfloat16::qfloat16(float)’: global/qfloat16.h:124:18: error: conversion to ‘__fp16’ from ‘float’ may alter its value [-Werror=float-conversion] __fp16 f16 = f; ^ cc1plus: all warnings being treated as errors The warning was added by fb5976038162d93d60c7f76376bbb4df38e83ba9. Change-Id: I489348c4d5d672bfa5d4db99c837696a2a69a27e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | QIODevice: do not clear error string on closeAlex Trotsenko2017-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keeping a description of the last device error is a more informative to the user than forcing the string to 'Unknown error'. Change-Id: Ie98fe1c94f24279fb633ce950bbe16450b0efdbd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>