summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* use regular configure mechanism for openssl library referencesOswald Buddenhagen2017-02-222-26/+21
| | | | | | | | | | | | don't attempt to hand-craft a library export any more. instead, use the configure system's built-in mechanism, and refer to it via QMAKE_USE. this also allows us to rely on transitive dependencies in the autotest. as a side effect, this makes the openssl-linked feature imply the openssl one. Change-Id: I5dd209b63bc8fbbc62852f6ffc472d4452ea2e68 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTimeZone: do not access static functions through this->Marc Mutz2017-02-221-7/+7
| | | | | | | | The this pointer cannot be null, so we can't do d->staticFunction while d is a null pointer. This was caught by Clang 3.8's ubsan. Change-Id: I3c0d39b88cca83d827a69ed1544a4412b18ac907 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash while dropping a tabbed group into a single floating QDockWidgetOlivier Goffart2017-02-212-5/+3
| | | | | | | | | | | | | | | | The problem was caused by commit 0feeb6f6d2cfaa964763ca1fcab65672812b4eef which fixed QTBUG-58036. It reparented widget that used to be skiped. In particular, floating widgets are skiped. But seting the parent of a floating widget docks it. And so as a result it would not be skiped anymore. This has two side effect: This breaks the animation (as the widget is docked too early; and cause crash when QDockWidgetGroupWindow get reparented as this breaks invariant that these are always floating. So restore the skip from before commit 0feeb6f6d2cfaa964763ca1fcab65672812b4eef, and explicitly set the parent in all cases when the animation finishes. Change-Id: I0e3e29ad22d6ffe4d62242d48a18dadb916fc14f Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* QLoggingRegistry: fix potential data raceMarc Mutz2017-02-202-7/+16
| | | | | | | | | | | | | | | | | The 'rules' vector is made up of all the individual {env,config,...}Rules vectors under mutex protection whenever init() is called (only from the QCoreApplication ctor) or, at any time, by a call to QLoggingCategory:: setFilterRules(). Yet, the writes to the individual *Rules vectors were never protected by registryMutex, racing against the reads of the same vectors in the updateRules() function. Fix by protecting all access of all member variables with registryMutex. Add some strategic comments to make analysis easier for the next guy. Change-Id: If68d15a553ec7038693574a34f10a39f4cd480e8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QMacStyle::sizeFromContents: don't do anything in CT_Menu caseOleg Yadrov2017-02-171-6/+1
| | | | | | | | | | In this case we can safely return the same QSize which we accept since it is already contains the right size for the given menu and this size will be bounded to screen geometry before QMenu will be displayed anyway. We also get rid of one dependency on HITheme. Change-Id: I7502a96d180fc4a41ce3dfabe8a200b886016348 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QMimeDatabase: fix matching of filenames with different length when lowercaseDavid Faure2017-02-171-1/+4
| | | | | | | | | AİİA.pdf takes 8 QChars, but after lowercasing it takes 10, so the code cannot assume the length to be the same. Task-number: QTBUG-58822 Change-Id: Id6fbb99f6afd08ee420099cd66372732d7598d9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QReadWriteLocker: Fix race in unlockOlivier Goffart2017-02-171-3/+3
| | | | | | | | | | | | | | | | | An Acquire barrier in QReadWriteLocker::unlock was missing to synchronize with the testAndSetOrdered on d_ptr in the lock functions. The race is between the write of d->writerCount in tryLockForWrite, and the read in unlock. The acquire on d->mutex is not enough because it is not on the same object. While that race could be fixed by taking the newly-allocate()ed d's mutex before publishing it with testAndSet, there's another race, on 'recursive', between a newly-minted Private* with recursive == false in tryLockForWrite(), and the read of 'recursive' in unlock(). Task-number: QTBUG-58917 Change-Id: I10ba36573c0e57468d11e9b77d85045711feaea1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* fix VNC platform plugin build on big-endian machinesShawn Rutledge2017-02-173-5/+10
| | | | | | | Task-number: QTBUG-58734 Change-Id: I3e44ee4be5003acaba2f1b8ed2658a3ff1bd700e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* Adapt to the C++ SIC introduced by P0012: noexcept overloadingEric Lemanissier2017-02-171-0/+84
| | | | | | | | see 5a1b4832a2 for more detail Task-number: QTBUG-58142 Change-Id: I51851ea9b4fe7b8eeadc452bc3dbb1ea00026d29 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Respect XDG_CONFIG_HOME when getting ibus socket locationFlorian Bruhin2017-02-171-1/+2
| | | | | | | | | Task-number: QTBUG-58687 Change-Id: I97ea8b7d7caf922227a92348fb914aead1ecd312 Reviewed-by: Tinu Weber Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com> Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix a race in QFreeListOlivier Goffart2017-02-171-2/+2
| | | | | | | | | | | | | The _next variable need the acquire and release fence in next() to synchronize with the equivalent operations in release() (which already have the them) The ordering on the _v[block] is not enough as this does not synchronize the same object. Task-number: QTBUG-58917 Change-Id: I17cc39e6791433348b6227363dbea92bcf03700d Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVarLengthArray: fix appending an already-contained itemMarc Mutz2017-02-171-5/+15
| | | | | | | | | | | | | | | Like the lvalue QVector::append() overload, when we reallocate, we need to take a copy of the function's argument because the reference will get stale upon reallocation. Add a test. [ChangeLog][QtCore][QVarLengthArray] Fixed a bug involving appending an item already in the container to the container again. Change-Id: I06eeed6cb383dd5924e47a302bb3d1666d04c8e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: use active window device pixel ratio for drag pixmapOleg Yadrov2017-02-171-0/+4
| | | | | | | | | | | | | | | | | | In QCocoaDrag::dragPixmap, it treats QDrag::source as a QWindow, but it is not - it's just a generic QObject* of some kind (which QQuickDrag sets to the originating QQuickItem, and the widgets stack sets to a QWidget). This failure means that dpr stayed at 1.0. Unfortunately it’s not possible to receive a pointer on QWindow directly from QQuickItem because QtWidgets and QtQuick do not share the sources, but we can use the same dpr as current focused window has because drag can only start from active window - press on a window which is not focused should activate it first. Task-number: QTBUG-57942 Change-Id: Id358c181d03d519188caaa83fb4226033b8ed1ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* QDir::mkpath: don't try to mkdir in automount filesystemsThiago Macieira2017-02-161-33/+63
| | | | | | | | | | | | | | | Automount filesystems like /home on many operating systems (QNX and OpenIndiana, at least) don't like if you try to mkdir in them, even if the file path already exists. OpenIndiana even gives you an ENOSYS error. So instead, let's try to mkdir our target, if we fail because of ENOENT, we try to create the parent, then try again. Task-number: QTBUG-58390 Change-Id: Ibe5b1b60c6ea47e19612fffd149cce81589b0acd Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QNetworkSession - register types before connecting slotsTimur Pocheptsov2017-02-161-4/+4
| | | | | | | | | | | | | | | | | | | | | QNetworkSession's ctor has a race condition: it 1) connects signals/slots and also 2) registers meta-types (but after these connects). Our users apparently have a lot of per-thread QNAMs in multiple threads (and implicitly many QNetworkSessions on different threads too). From error logs it appears that while one thread tries to connect signals/slots and evaluates the types of signal and slot arguments, another thread can register this type. If the first thread extracted signal argument types, then the second registered this type, we can end up in a 'type mismatch' error on the first thread with seemingly the same types in a debug message (something like "type mismatch A::Some <-> A::Some") - they have the same name, but one has type() == 0 and another - some non-zero type(). Now we call qRegisterMetaType before connect. Task-number: QTBUG-50901 Change-Id: Idbb9515573e174bbc5e5bf55dc3a7911a81646ea Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Eliminate QT_NO_DYNAMIC_LIBRARYUlf Hermann2017-02-162-23/+11
| | | | | | | | | The library feature already covers this. As library depends on the dlopen compile check, we can assume dlopen to be available, also on vxworks. Change-Id: Idcdb07ab4688c6158651d9a5ad5e2ba126bd7d9e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QReadWriteLock: make field 'recursive' constMarc Mutz2017-02-161-1/+1
| | | | | | | | | | It is never written after initialization, and accessed concurrently outside mutex protection, so make sure that it never changes by marking it as const. Change-Id: Ib28b2e8b3067d596a95d1699165a6ebfb15fe674 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QJNIHelpers: unbreak runnables counterMarc Mutz2017-02-161-2/+2
| | | | | | | | | | | | | | | | | | Adding 0 each time will obviously not produce a new identifier each time... Also use static initialization for QBasicAtomicInt. A default-constructed static QBasicAtomicInt at function scope will be dynamically initialized. It will still be zero-initialized, but at least GCC adds guard variables for such objects. When using aggregate initialization, the guard disappears. Amends 265db5ad9bda9c984393c1e95fd27dcc4633ed1c. Change-Id: Ia71290cf26c486dcbcc74381f12cd0c4712d6019 Reviewed-by: David Faure <david.faure@kdab.com>
* xcb: Allow to disable XInput 2 support by setting QT_XCB_NO_XI2 env varAlexander Volkov2017-02-161-1/+2
| | | | | | | | | | Use of XInput 2 may result in regressions. For example we call XISelectEvents for each window every time a device plugs/unplugs. It causes significant delays when there are many native windows. Change-Id: I60b799bb667d0e4bca1f9c52cdaa07b04bcc749f Task-number: QTBUG-57013 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* qcssparser: Undef TILDE to fix compilation on HurdDmitry Shachnev2017-02-151-0/+4
| | | | | | Change-Id: Ic3168629565618bcd7f26e47579beaa1bbd22e39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use Qt::PreciseTimer for the QDeadlineTimers in QTest::qWait*Thiago Macieira2017-02-151-3/+3
| | | | | | | | | QDeadlineTimer will eventually support CLOCK_MONOTONIC_COARSE on Linux, so let's be safe before that change appears. Change-Id: I9b423f1b71194205b27afffd14a383a7e9f66a9d Reviewed-by: Stéphane Fabry, Cutesoft <stephane.fabry@gmail.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove the name cache from QMetaType::typeNameThiago Macieira2017-02-151-25/+14
| | | | | | | | | | | | | | | It was unnecessary, since we only cached the static types, which are all generated by the macro anyway. The way it was implemented, this produced data races that are strictly-speaking UB, even if all the threads were writing the same values to the same data locations. This commit changes a little the code to simplify, since we're changing those lines anyway. Task-number: QTBUG-58851 Change-Id: Idc5061f7145940f987dffffd14a30047846e3113 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: fixed explanation in Qt::Tool documentationSamuel Gaist2017-02-151-1/+1
| | | | | | | Clarify the the macOS implication of the flag. Change-Id: Ic68e1ac668cfa68abf868ba6bdd46241dfa9b9a7 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* QJNIHelpers: make mutexes staticMarc Mutz2017-02-151-2/+2
| | | | | | | Amends 265db5ad9bda9c984393c1e95fd27dcc4633ed1c. Change-Id: I707bb88285531ee9f82efec46901871d53413eb3 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QFileDialog: Protect against nullptr dereferenceKevin Funk2017-02-151-1/+1
| | | | | | | | | | | | | | When the QFileDialog receives a language change event, and native dialogs are used, this code path dereference a nullptr in the qFileDialogUi member. Protect by checking the return value of QFileDialogPrivate::usingWidgets() as done in other places deferencing qFileDialogUi. Fixes a crash in GammaRay Change-Id: I3e9eb81c75d9fc983519a58c5ec06e316ac80263 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix indentation of source code example in docsFrederik Schwarzer2017-02-151-8/+8
| | | | | Change-Id: Icf94c9adc55d16acd26831cce331054a8c49652d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix UB (data race) in QtAndroidPrivate::requestPermissionsSync()Marc Mutz2017-02-151-2/+4
| | | | | | | | | | | | | | | | | | If the QSemaphore::tryAcquire() call times out, we mustn't touch *res, because there was no happens-before relation established between *res = result in the lambda and our returning *res; Fix by returning a default-constructed hash in that case. Add a strategic std::move(). The same problem exists in runOnAndroidThreadSync(), but I have no idea how to solve it, because there the shared object is the runnable itself. Change-Id: I9a2c431144c169fbd545763555d96153143a11bf Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QJNIHelper: fix a potential race in sendRequestPermissionsResult()Marc Mutz2017-02-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The code obtained an iterator into a QHash under mutex protection, then dropped the lock, dereferenced the iterator several times and only retook the lock to erase the element from the QHash. This is very smelly. QHash provides no official iterator validity guarantees, and the container isn't const, either (which would imply thread-safety). In particular, the dereference into the container outside the critical section is cause for concerns. Simplify the code, removing any doubts about its race-freedom, by taking the payload item out of the hash before dropping the lock, and using only the local strong reference in the remainder of the function. The only other references to g_pendingPermissionRequests are insertions with unique-by-construction keys in QtAndroidPrivate's requestPermissions(), so there was no reason to keep the item in the hash for the whole duration of the sendRequestPermissionsResult() call. Change-Id: I39fe0803b13b3046d1f0fd9c8e96c531406d57da Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Update QSyntaxHighlighter docs to use QRegularExpressionAaron Linville2017-02-152-60/+22
| | | | | | | | | | | | | | Update the QSyntaxHighlighter examples to use the new QRegularExpression class in place of QRegExp. Fix typos. Remove duplicated snippet. Replace lengthy section of duplicate text in highlight(..) with a note to see the detailed description. Task-number: QTBUG-58494 Change-Id: Id8d94bddbed52e6e52feac107f6fc84e2fe4518a Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Enable QtAndroid::runOnAndroidThread in a ServiceHeikki Haveri2017-02-152-6/+17
| | | | | Change-Id: I214f5dc70c52011a5e1712ea70f97f8b564fb664 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Turn QThreadData::threadId into a QAtomicPointerThiago Macieira2017-02-155-17/+17
| | | | | | | | | | | Solves a data race found by TSan. Since thread and threadId are QAtomicPointer, I've removed the explicit initialization in the QThreadData constructor Task-number: QTBUG-58855 Change-Id: I4139d5f93dcb4b429ae9fffd14a34082f2683f76 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QJNIHelper: clean up atomic int and mutex handlingMarc Mutz2017-02-141-18/+18
| | | | | | | | | | | | | 1. Do not use Q_GLOBAL_STATIC to hold QAtomicInt or QMutex, use file-static QBasicAtomicInt and QBasicMutex instead. They are zero-initialized PODs. 2. Use only QMutexLocker to lock mutexes. Also wrap the atomic counter into a next...() function, as done elsewhere. Change-Id: I4b14ac0de9d4cb6780b1f1372c2b5fc88e918e4c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add Q_ASSERT before dereference pointerJesus Fernandez2017-02-141-0/+1
| | | | | | | | | | Fix Null pointer dereferences (NULL_RETURNS) CID 176640: Null pointer dereferences (NULL_RETURNS) Assigning: "p" = null return value from "value". Change-Id: I3af9aae3bbebd6f4de90854ba56cd601669b1b5a Coverity-Id: 176640 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMutex/Linux: remove unused QBasicAtomicMarc Mutz2017-02-141-2/+0
| | | | | | | | | | | $ git grep -we futexFlagSupport src/corelib/thread/qmutex_linux.cpp:static QBasicAtomicInt futexFlagSupport = Q_BASIC_ATOMIC_INITIALIZER(-1); The last user of this variable was removed in 9ef59b5. Change-Id: I818a13a481ad25baa5ff7d389a737b8801adcfcc Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Windows QPA: Fix compilation with QT_NO_OPENGLOlivier Goffart2017-02-141-1/+2
| | | | | | | Compilation error introduced in 7780ee9e5f20f80ab9e053058d0b6d92586cf876 Change-Id: Ia770ca207cdd25bb15c74d681ece391a844791a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Doc: Updated doc QSqlDatabaseNico Vertriest2017-02-131-28/+51
| | | | | Change-Id: I914e9bdbf6137f0e3858a57b0f59fc550fc7e317 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Windows QPA: Include GL header depending on presence of dynamic GLFriedemann Kleint2017-02-131-1/+5
| | | | | | | | Amends change 7780ee9e5f20f80ab9e053058d0b6d92586cf876. Task-number: QTBUG-58178 Change-Id: I0b6e064dfdbdafb7fba9c20c56cfd873fa594c44 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* announce 'temporaryfile' feature in bootstrap libraryOswald Buddenhagen2017-02-131-0/+1
| | | | | | | | qmldevtools refers to it. Task-number: QTBUG-58819 Change-Id: Id88265bb17e4d2e9c61f77409c4163eacc4a13f3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add the new NVIDIA specific calls to qeglstreamconvenienceDominik Holland2017-02-132-0/+18
| | | | | | | | | NVIDIA 370 introduced new calls needed to work with eglstreams in the wayland window system Task-number: QTBUG-58299 Change-Id: I606b143d3016f365b0d5ca4bc163b99289afbea1 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix QLibrary::isLibrary on Apple platformsFilipe Azevedo2017-02-121-21/+13
| | | | | | | | | | | | | | | | | | | | | Add proper support for 'so' and 'bundle' suffixes. Qt wrongly assumes .so libraries are not versioned on Apple platforms, which is wrong. Also, the shared library .bundle which is what Apple recommends instead of .so, are also versioned (not to be confound with the different Core Foundation bundles, which are directory hierarchy). For more info, see http://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm. Especially the part that reads: "Loadable modules, called bundles in Mac OS X, have the file type MH_BUNDLE. Most Unix-based software ports usually produce bundles with a .so extension, for the sake of consistency across platforms. Although Apple recommends giving bundles a .bundle extension, it isn't mandatory." Task-number: QTBUG-50446 Change-Id: Iacd5136397a12d65d83821434f332eb602550b4b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update the __xxx__ macros due to MSVC and ICC not defining them allThiago Macieira2017-02-121-1/+31
| | | | | | | | And if __AES__ or __PCLMUL__ is defined, then we expect wmmintrin.h to exist. Change-Id: I445bb15619f6401494e8fffd149db77dc513e071 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Use QBasicMutex in qthread_win.cppThiago Macieira2017-02-111-2/+2
| | | | | | | | It's QtCore, so we're fine. Change-Id: Ifaee7464122d402991b6fffd14a0d7ad9c09e2f2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Improve QIODevice::peek() performance on buffered devicesAlex Trotsenko2017-02-092-45/+40
| | | | | | | | | | | | | | Since 5.7, QIODevice::peek() implementation is based on transaction mechanism. While technically it's correct, seeking backward on a buffered random-access device clears the internal buffer that affects the performance of reading. To solve the problem, this patch implements peek mode directly inside the reading procedure. Task-number: QTBUG-56032 Change-Id: Ic5269f76e44c491a0309e13aba87fa7cf7b9259f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Refactor QIODevice::read()Alex Trotsenko2017-02-092-36/+51
| | | | | | | | | Move device-dependent part of the code into the private function for further reusing by peek() procedure. Task-number: QTBUG-56032 Change-Id: Iedceafe4b0bab109ca5c64ad274d779efe87c27b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* rename qvector.cpp => qvector.qdocOswald Buddenhagen2017-02-093-2/+0
| | | | | | | | | | the file contains no code. this avoids complaints from ar/ranlib in static/bootstrapped builds. Change-Id: Iee22ffc61a5f9ea8c25f5455b7e8e017ac521624 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* make libinput axis api feature depend on libinputOswald Buddenhagen2017-02-091-1/+1
| | | | | | | amends b4085e56. Change-Id: Id18a7de6496e8e9164cb247426aba1293aa4ea2e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* refuse to build EGLFS on android, darwin, and windowsOswald Buddenhagen2017-02-091-2/+1
| | | | | | | | ... instead of merely defaulting it to off on android and windows. this reflects actual reality. Change-Id: I880254138bedd07124aa00096a06dd6e1803feb9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Merge several Q_GLOBAL_STATICs in qresource.cpp into oneThiago Macieira2017-02-091-4/+18
| | | | | | | | | Since they are all used in a typical application, this reduces the number of memory allocations (thus, the overhead) as well as the state-keeping in the libc atexit() functions. Change-Id: Ifaee7464122d402991b6fffd14a0e59457ad9cb7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Avoid unnecessary creation of some Q_GLOBAL_STATICThiago Macieira2017-02-092-12/+10
| | | | | | | | | | | | | | | | | If these lists weren't created in the first place, then they are empty. We don't need to create it in order to conclude that. Unlike most Q_GLOBAL_STATICS, these are almost never used and yet they were always created due to where they were checked. Since we're calling exists() before, there are two consequences: first, since the list already exists, we're not allocating memory so it cannot throw std::bad_alloc when being accessed. Second, since we've just checked it exists, we can use QGlobalStatic's operator*(), which is slightly faster than operator()(). The weird &(*list) syntax is only to avoid changing the rest of the code that used a pointer Change-Id: Ifaee7464122d402991b6fffd14a0e44f533dc3d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* make freetype & fontconfig dependencies private againOswald Buddenhagen2017-02-083-3/+3
| | | | | | | | | | | | | | | | | exporting the freetype dependency caused qtwayland to break with -qt-freetype, as the helper libraries' module pri files are not installed (for good reasons) after f9a80e06a, no actual user of FontDatabaseSupport needs access to the transitive dependencies anyway (one of the headers has a fontconfig dependency, but it's not used outside the module itself), so hiding them again is just fine. this partially reverts ec774500f. Task-number: QTBUG-56666 Change-Id: I9e68a7e0725a92833b856c9ffdbec61c8aa5fed2 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>