summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Call QDir::homePath() only when necessary in QSettings::initDefaultPaths()Maks Naumov2015-02-021-3/+2
| | | | | Change-Id: I990520917ec65127ae554b5e872791cff78f0b56 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update for libinput 0.8Laszlo Agocs2015-02-022-1/+13
| | | | | | | | | | | We don't yet have API compatibility, apparently, so we need to keep up with those changes. Dropping support for older versions is not yet acceptable since some distros (in particular current version of some embedded ones) may ship these versions. Change-Id: Ibea780abd76c4b89661012dfea46868b432ded42 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Expose the ThreadedOpenGL cap to appsLaszlo Agocs2015-02-022-0/+17
| | | | | | | | | | | Applications have no public API to check for the ThreadedOpenGL flag reported by the platform plugins. Add a static function to QOpenGLContext to give interested applications a way to decide if they should do rendering on separate threads. Task-number: QTBUG-44208 Change-Id: I629332512ab31fe49f842065a911270cd6cea7aa Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Utilize EGL_KHR_surfaceless_context in QOffscreenSurface when availableLaszlo Agocs2015-02-023-8/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use it also in the context initialization code which also relied on pbuffers until now. This is safe to do since QOffscreenSurface is deliberately kept minimal: we only support it for rendering to FBOs or uploading textures, it is quite useless for any rendering type of operation. Therefore simply not creating a surface when the extension is available is viable and should not break anything. While we should have done this a long time ago, the real inspiration now is to avoid crashes with some bad EGL implementations. Mesa in particular tends to crash in its interal configuration handling when trying to create a pbuffer surface with more exotic attributes, for example with multisampling enabled. Just getting rid of those properties is not an option since the resulting pbuffer would not be compatible with the existing context. Therefore our only option is to avoid the pbuffer altogether. There's a so-far-ignored patch for Mesa http://patchwork.freedesktop.org/patch/38100/ which tries to solve some of this but it turns out it is not sufficient to avoid problems with the multisampled case. So to avoid more headache, we just stop using pbuffers there. [ChangeLog][QtGui] QOffscreenSurface is now relying on EGL_KHR_surfaceless_context when available, and avoids creating a pbuffer surface when the extension is present. Change-Id: Id18742768b8e66c8d92ce65a9bf64b0296e14db7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add SecureTransport based SSL backend for iOS and OS XJeremy Lainé2015-02-027-0/+1677
| | | | | | | | | | | Add support for SSL on iOS/OS X by adding a SecureTransport based backend. [ChangeLog][QtNetwork][QSslSocket] A new SSL backend for iOS and OS X, implemented with Apple's Secure Transport (Security Framework). Change-Id: I7466db471be2a8a2170f9af9d6ad4c7b6425738b Reviewed-by: Richard J. Moore <rich@kde.org>
* fix relative path resolution inconsistency in qmake propertiesOswald Buddenhagen2015-02-021-1/+3
| | | | | | | | | | | | | | suppose we queried QT_INSTALL_DOCS/get. if no [EffectivePaths] existed, we'd try [Paths]. if that didn't exist, either, we'd use the built-in, which is relative. so we'd query QT_INSTALL_PREFIX ... without the /get, which is technically wrong. this doesn't currently matter, as all groups have the same built-in defaults anyway, but it may (hint hint) matter later on. Change-Id: I5a3746e80ca1bfbf2f37db3604cc351bddeacd94 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* less preprocessor magic relating to qmake buildOswald Buddenhagen2015-02-021-5/+5
| | | | | | | | it's not worth making things more complicated to remove the duplication of one real LOC. Change-Id: Iddbd0db7d0f81b80192b3980dbe2316b246a3b57 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* complete reversal of adding QLibraryInfo to the bootstrap libraryOswald Buddenhagen2015-02-023-32/+23
| | | | | | | amends 684028a64. Change-Id: I8dcc4b74c4c0328c07711cd7253ff19a74ea2fbf Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Only use 32bit version of qPremultiplyAllan Sandfeld Jensen2015-02-021-19/+2
| | | | | | | | | | With auto-vectorization enabled in QtGui, the 32bit version of qPremultiply is faster than the 64bit version since it can be vectorized wider (4x on 128bit as opposed to 2x). Since all our important 64bit targets have SIMD, that makes the 64bit version pointless. Change-Id: I4e9070a3a3c8e2b54f17a95ba0aee0405cbb8ec9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Centralize use of __attribute__((noinline))Marc Mutz2015-01-293-11/+11
| | | | | | | | | | There are currently only two users, but I have patches in the pipeline which mark some other function noinline, so proavtively centralize the ifdef'ery involved. Change-Id: I1f02351fdc903d4e026089e12b8a976ed6a8d603 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString: optimize multiArg()Marc Mutz2015-01-291-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function used a QMap<int,int> to map the %n's to the index in the args array. By way of construction, the key was sorted in ascending order while the values, initially all -1, were later reassigned to be 0...map.size()-1, ie. std::iota(). The only information this data structure stores is therefore the sorted %n's. For that, a sorted vector is a vastly superior data structure. Go one step further and use QVarLengthArray to avoid allocating any memory for the common case of just a few placeholders. As an artifact of the underlying refactoring, the management of that data structure has been moved to a separate class, ArgMapper. Runtime for the following test from tst_qstring: QString str("%1 %2 %3 %4 %5 %6 %7 %8 %9 foo %10 %11 bar"); // not timed str = str.arg("one", "2", "3", "4", "5", "6", "7", "8", "9"); str = str.arg("ahoy", "there"); went down from 2.2us to 1.5us. Change-Id: Ic552615fbac646b78ba05eb4e3215e63d202fd94 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QString: reduce template bloatMarc Mutz2015-01-291-11/+12
| | | | | | | | | | | | | | | | | | | | Reduce the number of (non-regex) splitString instantiations from six to two by: - Passing separators by (const QChar*, int) and using qFindString() instead of indexOf() - Passing QString as QStringRef when the output is QVector<QStringRef>. Doing so also allows to drop the MidMethod template parameter since QString::midRef() is no longer being used. (Somewhat disappointing) effects on Linux GCC 4.9 stripped release builds: text -500B data +-0B relocs +-0 Change-Id: Id89e2814d5f7da5170181d863167517943c2e0cd Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [QSSL] Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-01-288-4/+20
| | | | | | Change-Id: I9c09a3e2dfb90eb22d4509ac6c450a0bb5da48f6 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* qlogging: Fix build on FreeBSD after 63cd16d.Raphael Kubo da Costa2015-01-281-2/+2
| | | | | | | | | pthread_getthreadid_np(3) is defined in pthread_np.h, not pthread.h. Additionally, it was added during the FreeBSD 9 time frame, so add a version check to use it only when we know it is present. Change-Id: I4d716d9bfb189d10128b6d458a47045e130b51e8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* corelib: Fix a faulty 5.4->dev merge.Raphael Kubo da Costa2015-01-281-0/+1
| | | | | | | | | | Commit b6191b16 ("Merge remote-tracking branch 'origin/5.4' into dev") merged commit 350c60b ("Link against QMAKE_LIBS_EXECINFO when using backtrace(3)") into the dev branch, but the conflict resolution left out the actual line that changed LIBS_PRIVATE. Change-Id: I6e716ed375abdc534a1f20e412ce7c56ee85d6c0 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* OS X: Fix QWindowSystemInterface::handleExtendedKeyEventFrederik Gladhorn2015-01-281-1/+1
| | | | | | | | | | | | | In d7ca800a87a2291c94c6580f0cfe068bb2280caf another parameter was introduced to unify ShortcutOverride. The call to it in qnsview.mm accidentally passed false as last parameter which would go to count instead of tryShortcutOverride. The patch wasn't released yet, so this regression doesn't need a change log entry. Thanks to Felipe Seoane for spotting this! Change-Id: Ide2211806caf742d649e0d5dadcc47fd032d2cdf Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Remove unused class QPaintBufferLars Knoll2015-01-283-2629/+0
| | | | | | | | | The class hasn't been used for a while anymore. Since it's private, simply remove it from QtGui. Change-Id: Ia0911d1c8b8836d963a51c8e354c96bc1ee4093f Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Remove support for QT_QLOCALE_USES_FCVT.Erik Verbruggen2015-01-282-78/+0
| | | | | | | We expect floating-point math to be IEEE754 compliant. Change-Id: I2b257177f2ef5fce38ac4d8fd76f746dc7b9fc15 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make Qt for Android compile when using errors for warningsAlex Blasche2015-01-282-2/+3
| | | | | | | | | | | | | | | | | | | | | | In file included from kernel/qsystemsemaphore_android.cpp:35:0: kernel/qsystemsemaphore_p.h: In constructor 'QSystemSemaphorePrivate::QSystemSemaphorePrivate()': kernel/qsystemsemaphore_p.h:104:10: error: 'QSystemSemaphorePrivate::createdSemaphore' will be initialized after [-Werror=reorder] bool createdSemaphore; ^ kernel/qsystemsemaphore_p.h:101:11: error: 'key_t QSystemSemaphorePrivate::unix_key' [-Werror=reorder] key_t unix_key; ^ kernel/qsystemsemaphore_android.cpp:43:1: error: when initialized here [-Werror=reorder] QSystemSemaphorePrivate::QSystemSemaphorePrivate() : ^ widgets/qdockwidget.cpp:208:6: error: unused parameter 'floating' [-Werror=unused-parameter] bool QDockWidgetLayout::nativeWindowDeco(bool floating) const ^ cc1plus: all warnings being treated as errors Change-Id: I69af3ba3883b4311477f0e4e991b5cc0900fb71b Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Introduce QMatrix4x4::isAffine()Konstantin Ritt2015-01-282-0/+19
| | | | | | | | - a convenience method thats checks if the matrix has no projective coefficients. Change-Id: Ieea8ac2e4237b471a683ad5010672b1e89a0c953 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Introduce QQuaternion::inverted()Konstantin Ritt2015-01-282-0/+24
| | | | | Change-Id: I6de77082bb7c32e48fb7f7d765a58fdbe68db1fd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* [QVectorND] Add missing operator/=(const QVectorND &)Konstantin Ritt2015-01-286-0/+108
| | | | | Change-Id: Ic1d2912808b95e02ba5d9cb2972c81c6374bbca9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid warning in makeCurrentLaszlo Agocs2015-01-281-3/+1
| | | | | | | | This warning is not necessary. We don't warn in doneCurrent or QOpenGLWindow either. Task-number: QTBUG-44094 Change-Id: Icb3cf51137258c939d5dfb653cf98ded3c147aac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Bail out in composeAndFlush when makeCurrent failsLaszlo Agocs2015-01-281-1/+5
| | | | | | | | And show a warning so we have a chance of knowing what happened. Change-Id: I9ddf3842b7d19946876ac1a2375611e8c13bbb9a Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Android: Don't open assets files in read/write modeEskil Abrahamsen Blomfeldt2015-01-281-3/+1
| | | | | | | | | | | | | | | | | We would return true when opening assets in read/write mode despite the fact that the files are not writable. The logic now matches that of the qrc file engine. This also adds a unit test for Android-specific issues. [ChangeLog][Android][Important Behavior Changes] Opening assets with QIODevice::ReadWrite now returns false to correctly indicate that the files are not writable. Change-Id: I019cc27861fc9b000dc13c5e0a38c0fc09a08671 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
* QTreeWidget: forbid forcing PartiallyChecked on parent tristate items.David Faure2015-01-251-1/+1
| | | | | | | | | | | | ItemIsTristate means QTreeWidget determines the check state of parent items based on the check state of child items. Checking/unchecking the parent propagates to children; but setting the parent to PartiallyChecked shouldn't do that, especially since it can lead to children without ItemIsTristate having PartiallyChecked check state. Change-Id: Ibc8b7c77d9ec4c1578c07f3c62581edb770f8439 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Itemviews: add ItemIsUserTristate flagDavid Faure2015-01-254-4/+10
| | | | | | | | | | | | | | | | | | | ItemIsTristate is now again purely for enabling the automatic management of the check state of QTreeWidgetItems, while ItemIsUserTristate is separate from that and lets the user select the three states manually. This restores the original behavior of ItemIsTristate for QTreeWidgetItems, which got broken by letting the user cycle through the states too. [ChangeLog][QtWidgets][QTreeWidget] Restored Qt 5.1 behavior of QTreeWidgetItems with ItemIsTristate to enable automatic management of the check state. User-editable tristate checkboxes are now enabled by setting the new flag ItemIsUserTristate. Task-number: QTBUG-40060 Change-Id: I341f5e983804d3b4f27982520bb6647f3014cccc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* [HarfBuzz-NG] Fix build on WinRTKonstantin Ritt2015-01-252-12/+16
| | | | | | | | This adopts c26d5cf6ef50ea102cfb18eb2109f60bcdfdafb6 and moves some code around. Change-Id: Icbc1f4e0cfa6c6b994c3e5096cf1cc66bc0b32f9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Update bundled HarfBuzz-NG to 0.9.38Konstantin Ritt2015-01-2545-1796/+2344
| | | | | | | | | | | Most important changes: * Fixes for Arabic, Hangul, Hebrew, Indic, Mandaic, Myanmar, and New Tai Lue shapers. * Fixed out-of-bounds access in Indic shaper. * Build and stability fixes, various optimizations. Change-Id: I4f0e32c017f62fe576bee41a430d3da6d571de80 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Micro optimizations to HB-NG pathKonstantin Ritt2015-01-241-37/+34
| | | | | | | No changes in functionality. Change-Id: I9cf90241bdb087ef16fb0b759a5976848a197f55 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* iOS: Limit auto-rotation to device screen (excludes external screens)Tor Arne Vestbø2015-01-242-21/+23
| | | | | | | | | | | An external screen should always stay in the native orientation of the screen, and not be affected by rotations of the device. If the user requires the external content to follow the device rotation, this can be done explicitly by listening to orientation changes of the main screen, or using QSensors. Change-Id: I3a98655d11915f0db107930e7d97a24417656bc9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Track QPlatformScreen -> QScreen using QPointerTor Arne Vestbø2015-01-243-2/+4
| | | | | | | | | | Allows the QPlatformScreen to verify that the QScreen is alive before sending events to QPA for the given screen (which will assert if the screen is being destroyed). Change-Id: Ie77674fead3e0a4d4f6fedbf1f7f3c98364c7485 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* QPlainTextEditControl: reimplement anchorAt()J-P Nurmi2015-01-243-1/+6
| | | | | | | | | | | See comments in QPlainTextDocumentLayout::hitTest(). Since QPlainTextEdit does not do hit testing on the document layout level, allow QPlainTextEditControl to override anchorAt() so that hit testing can be done on the widget level instead. Change-Id: I70247eafae96897382a0c7db7d596128a03e7a6c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QOpenGLWidget/QOpenGLWindow: add a destructor which calls makeCurrentGiuseppe D'Angelo2015-01-243-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally speaking, QOpenGLWindow subclasses are going to use some various QOpenGL* wrapper object to handle their buffers, FBOs, etc. Some of those QOpenGL* wrappers are QObjects, hence it should be safe to have them as child objects, and expect Qt to clean them up properly; but that doesn't happen because of how the destruction will work. In particular, when the subclass object is deleted, there may not be the right OpenGL context set as current. The deletion will go up to ~QObject, where the child objects will be deleted, resulting in a crash. That will *also* happen if someone connected to the context's aboutToBeDestroyed() signal: the context will in fact be deleted after the child objects, since it's stored in QOpenGLWindowPrivate, whose dtor will be run after ~QObject (!). Now, in the general case, QOpenGLWindow subclasses should always have a dtor in which they call makeCurrent() (also because various QOpenGL* class are not QObjects, hence they're kept around as full members instead of pointers-to); but at the same time we should clean up properly the QObject children. All of the above of course stands for QOpenGLWidget as well. Task-number: QTBUG-44094 Change-Id: I2379041fe175416936f6d40292039f773a515b35 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Add conversion functions for C++11 u16string and u32stringAllan Sandfeld Jensen2015-01-242-4/+70
| | | | | | | | | | | The patch adds convenience functions for working on C++11's new char width specific unicode strings u16string and u32string. [ChangeLog][QtCore][QString] Added methods for convenient conversion to and from std::u16string and std::u32string. Change-Id: I67c082e4755c592d61daaaaa70c8867ef0b23dcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* src/corelib/tools/tools.pri: add missing qtools_p.hMarc Mutz2015-01-241-0/+1
| | | | | Change-Id: If7af29fdaefddc1e3f08148610ba2720f5927b67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build on [older] MinGWKonstantin Ritt2015-01-231-0/+30
| | | | | | | Add some macros missed in older MinGW. Change-Id: Ia61ff270d012022c4e9ec0d4dd2ea050860f4fcd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* iOS: Associate UIScreen and show UIWindow on initial QWindow mappingTor Arne Vestbø2015-01-232-13/+43
| | | | | | | | | | | | We delay showing the UIWindow until the first QWindow is created and mapped to the screen. This allows external screens to stay in mirror mode until a QWindow has been explicitly created on that screen. We also remove the screen-association when the last QWindow on that screen has been removed, which will return the external screen to mirror mode. Change-Id: Iccecb297281d0c4f397f69f2494debff051ade01 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Base [QIOSViewController shouldAutorotate] on the locked orientationTor Arne Vestbø2015-01-233-16/+14
| | | | | | | | | Instead of keeping a separate property for the auto-rotation. Allows us to override shouldAutorotate later on to make the decision even more fine grained. Change-Id: I9a3cd6c1316f2a5485a94ef8d9b633df87f46f5f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* iOS: Ignore statusbar changes for windows on external screensTor Arne Vestbø2015-01-231-0/+5
| | | | | Change-Id: Ib7919abb2da324f6ffa058e8b215bf566ff43e40 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* QNX: QProcess workaround for the stdin pipeRafael Roquetto2015-01-231-3/+37
| | | | | | | | | | | | Due to a bug in the internal implementation of posix_spawnp on QNX, all file descriptors with a value lower than the maximum file descriptor specified in the file_actions structure are duplicated by default, ignoring the FD_CLOEXEC flag. This includes all file descriptors that we are not working with. So we add those file descriptors that have the FD_CLOEXEC flag to the file_actions structure as close actions. Change-Id: I316bc334addb46a4b84c199a69e9bd291ca706c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Handle posix_spawn using exit code 127 to indicate fail-to-startThiago Macieira2015-01-231-2/+16
| | | | | | | | | Most posix_spawn implementations are done using fork(), so the only way to report errors afer fork() is via a special exit code. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html Change-Id: I3a37f81b0cb278bb31e5cb83c87e6b4c034dbc19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use forkfd in QProcessThiago Macieira2015-01-235-398/+138
| | | | | | | | | | | | | | | | | | | | Replace the existing code in QProcess that dealt with signaling of child processes exiting with forkfd and spawnfd. The previous code was convoluted and hard to maintain, having shown its age in the last year. I've been running it for a year and a half and the new implementation is definitely an improvement. This change replaces support for the QNX Neutrino spawn() call with the POSIX version. We lose the ability to do setsid(), but we gain quite a few ioctls() that were done to fill in the file descriptor mapping structure. That's also the only OS for which we have the ability to thread-safely chdir() before the call to spawnfd(). Another advantage is that forkfd does not require a dedicated thread running to handle child processes exiting. Change-Id: I5eb76821dfdb6a8ed2989d7f53b3c31e515c3174 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Add spawnfd for use where fork / forkfd can't be usedThiago Macieira2015-01-232-0/+76
| | | | | | | | | | | | | | | | | | | | In certain environments, using fork() is not recommended due to the need for an MMU. This commit adds support for those environments, by using posix_spawn. Limitations of this environment are: - we cannot reliably detect failure to exec (e.g. non-existing executable) - we cannot do setsid(); we do setpgrp(0, 0) instead - we cannot thread-safely chdir() to the requested dir Because of the former limitation, the QProcess unit tests that rely on failure-to-start error conditions are either skipped or marked as expected failures. There's a non-reliable solution that is implemented in a another commit. This change also makes it easier to transition the QNX builds to using fork(), which is supported from QNX Neutrino 6.6 and onwards. Change-Id: I5cb46abf2ef8783941525d35cc991f00d2bf2d58 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix forkfd on OS X 10.7 and earlierThiago Macieira2015-01-231-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | dtruss logs show that the signal handler does enter and is active, since it does the first waitid() call, but then returns immediately: waitid(0x0, 0x0, 0x7FFF62D7C468) = 0 0 sigreturn(0x7FFF62D7C9A0, 0x1E, 0x0) = 0 Err#-2 Since there was no error return, we conclude that si_pid was zero on return. Source code for OS X 10.7 confirms that si_pid is set to zero unconditionally, which is rather stupid: http://fxr.watson.org/fxr/source/bsd/kern/kern_exit.c?v=xnu-1699.24.8#L1330 This is fixed for OS X 10.8: http://fxr.watson.org/fxr/source/bsd/kern/kern_exit.c?v=xnu-2050.18.24#L1399 Without that information, we have to scan each child anyway, so just disable the waitid() solution on OS X. This is a "hammer" solution which will get forkfd working. We can later try and detect at runtime whether waitid() is working. Change-Id: Ic5d393bfd36e48a193fcffff13bb584927cdeafe Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix compilation of non-waittid forkfd() outside of LinuxThiago Macieira2015-01-231-2/+2
| | | | | | | | | | | | | | | POSIX.1 does not guarantee the presence of the si_utime and si_stime members. So instead of trying to set those members to zero, ask the compiler to initialize everything for us. This was found on OS X when HAVE_WAITTID was removed. forkfd.c:192:11: error: no member named 'si_utime' in '__siginfo' forkfd.c:193:11: error: no member named 'si_stime' in '__siginfo' Change-Id: Ic5d393bfd36e48a193fcffff13b90aa6ccf592ae Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Use waitid with WNOWAIT in forkfdThiago Macieira2015-01-231-2/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation required one syscall per child we're waiting on to see which one exited. That means the algorithm was O(n). This implementation uses WNOWAIT to find out which child exited and then goes straight to that one. So it's O(1) on the number of children, but runs 2 * number_of_children_that_exited + 1 syscalls, assuming there are no race conditions with other threads. If there are or if a child not started by forkfd exits, we'll still iterate over each child we're managing to see which one exited. It modifies the existing code so that it will do a waitid() with WNOWAIT to check on the status of the child: if the child has exited, we'll try to lock the entry so only one thread will do the final wait(). In the case we read the PID, then the child exited, was reaped by another thread, the PID got recycled and that child exited again, we'll fail to lock the ProcessInfo entry so no harm comes. If by an absurd coincidence this other child was started by forkfd() and its ProcessInfo is exactly the one we are looking at, then we'll succeed in locking but that's a benign race: we'll do what the other thread was trying to do and the other thread will give up. Future improvements to the algorithm are discussed in the Gerrit change. Change-Id: Ie74836dbc388cd9b3fa375a41a8d944602a32df1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add the compilation of forkfd to QtCoreThiago Macieira2015-01-232-0/+85
| | | | | | | | This also brings in the harness to forkfd that uses QBasicAtomic instead of the generic GCC atomics. Change-Id: Id5488bf192db0027bc684956ade0bf6c640c9512 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Keep the width as it is to ensure the underline is drawn correctlyAndy Shaw2015-01-231-1/+1
| | | | | | | | | | | When the width of the decoration was floored then in some circumstances (such as when latin and Hangul text was mixed) an underline of the text would appear to be broken on HiDpi screens. Since the width is correct then we should keep it as it is to ensure it meets up correctly. Task-number: QTBUG-44062 Change-Id: I2cbf722a9cf9c7e15caa9aad061bf28d3bd0bb59 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Get rid of Q_GUI_EXPORT occurrences in QPlatformSupportKonstantin Ritt2015-01-231-2/+2
| | | | | | | | | This fixes GCC warning on MinGW, when built with -Wattribute (the default) Change-Id: I8e2b56a4a8fe9db0ec821f346a523b670df80f85 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>