summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QtBase: avoid uses of Java-style iterators [QHash, QMap]Marc Mutz2016-02-022-17/+5
| | | | | | | | | | | | | | | Java-style iterators are slower than STL-style ones, so they should not be used in library code. Replaced them with C++11 range-for, STL iterators or, in one case, qDeleteAll(). In one case, avoid a double hash lookup by using erase(it) instead of remove(it.key()), which we can now do without detaching, due to the new erase() taking const_iterator. Change-Id: I96174657fed70f76120b2c9d8190b4e70d5d8179 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QRingBuffer: add append(const char *, qint64) functionAlex Trotsenko2016-02-019-37/+23
| | | | | | | This allows to remove a code duplication in several places. Change-Id: I49f56e951682dbd2968923654a12cba5199a2502 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Micro-optimize QIODevice::write()Alex Trotsenko2016-02-011-7/+4
| | | | | | | Remove redundant checks. Change-Id: I766fc08d0d7e48bf7dc2371309f6644c37c3b68b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Windows QPA: Improve handling of windows of type Qt::ForeignWindow.Friedemann Kleint2016-01-308-132/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | Extract a base class QWindowsBaseWindow from QWindowsWindow that provides _sys() getters for geometry and margin calculation and implements QPlatformWindow::geometry()/ frameMargins() to be calculated from the HWND. Implement a QWindowsDesktopWindow class directly inheriting QWindowsBaseWindow which does not allow any manipulation. Add a thin QWindowsForeignWindow class that wraps a foreign window id and always returns correct geometry/margin information when queried. Simple reparenting and manipulation of geometry for child windows is also implemented, allowing for embedding foreign windows into Qt. When calling other setters on it, the unimplemented warnings of QPlatformWindow will trigger. Remove the special casing for foreign/desktop window from QWindowsWindow. The existing mechanism to cache the geometry/margin values in QWindowsWindow remains as is. Rename the existing QWindowsWindow::baseWindowOf() and add checks there. Task-number: QTBUG-50206 Task-number: QTBUG-41186 Change-Id: Ib57cb87e3981312d32920fe3e49f0b1c4ad516a3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Fix QSocketEngineBackend::nativeBytesAvaible for UDP socketsTimur Pocheptsov2016-01-291-4/+13
| | | | | | | | | | | | | | On OS X ioctl(... FIONREAD) on UDP socket returns more than expected: "SO_NREAD returns the amount of data in the input buffer that is available to be received For datagram oriented sockets, SO_NREAD returns the size of the first packet -- this dif- fers from the ioctl() command FIONREAD that returns the total amount of data available." (man getsockopt). On OS X bytesAvailable for UDP socket seems to include some headers also: for a datagram of size 1 - bytesAvailable == 17, 2 - bytesAvailable == 18 etc. Found in a broken tst_qudpsocket test. Change-Id: I88be827c66208835ed10b010f13d9dc70576fea4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Correct floordiv() to cope with implementation-defined division."Edward Welbourne2016-01-291-10/+6
| | | | | | | | | | | This reverts commit cd9625fc3cacb4efd0da57d9f5780671f5c1310f. The ambiguity in division, with negative operands, goes away in C++11 (where division is defined to truncate, hence round towards zero), so we no longer need to be robust against it in 5.7. Added suitable commentary to make clear that we are relying on that. Change-Id: Id2c0d421bad4bcec87de9cc9519cd00df2456930 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Integrate QProcess into QIODevice's multistreaming infrastructureAlex Trotsenko2016-01-296-114/+57
| | | | | | | | As a result, this patch eliminates double-buffering in QProcess. Change-Id: I436faa4a5ffc28ce77f959dd6089bef400ac39f6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Adapt QFileDevice to use QIODevice's write bufferAlex Trotsenko2016-01-293-19/+16
| | | | | | | | | Also, bump the TypeInformationVersion field in qtHookData, to notify the Qt Creator developers that the offset of QFilePrivate::fileName was changed and dumpers should be adapted. Change-Id: I71bc5f509b733c0ab3430cd47ff08961f0388839 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QNetworkHeadersPrivate: use erase and std::remove_if with QListAnton Kudryavtsev2016-01-291-7/+8
| | | | | | | ... instead of using erase in a loop, with quadratic complexity. Change-Id: I91053ddb58639615e8864e5be20861e7cceb815e Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QGraphicsAnchorLayout: return a struct instead of a QListMarc Mutz2016-01-292-27/+20
| | | | | | | | | | | | | | | | | | | | | ... of QLists. The returned list was only ever exactly of size one or two, and two only if a local QList in the getGraphParts() function was not empty. Instead of using a QList to return those QLists, use a small struct of two QLists. This way, we avoid copying, memory allocations, and the code becomes a lot clearer, because we can give the members of the struct meaningful names, instead of at(0) and at(1). As a consequence, at the call site, the loop over the result can now be collapsed into an if. Saves ~1200b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I5c2a3b3be0edcc418b310551abca51c410aca7c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFontComboBox: optimize handling of icons for delegateMarc Mutz2016-01-291-6/+6
| | | | | | | | | | | | | | | | Instead of move-assigning a new QIcon to the default- constructed members, initialize them directly in the ctor-init-list. Do this for the other data member, too, for consistency. Also use QStringLiteral instead of QLatin1String as the argument to the QIcon ctor. This is correct, since the string will never be modified, and saves two memory allocations. Change-Id: I9398bbe9d0fd63db9b6cf856dd240ab334364518 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QColor: plaster API with Q_DECL_NOTHROWMarc Mutz2016-01-292-127/+127
| | | | | | | | | | | | | | | | | | | | | This is mostly straight-forward, but some things are worth noting: 1. Yes, this is necessary. The noexcept operator looks for noexcept tagging, not at the contents of the function to determine whether to return true. The more conditionally-noexcept functions are used, the more important it becomes that low-level classes are correctly marked noexcept. In that, it is like constexpr. 2. In accordance with the rules governing noexcept specifications for the standard library itself, the get*() functions, as well as any function taking (but not returning) channel values as ints or qreals, or taking QStrings are not marked as noexcept, since they have preconditions and thus a narrow contract. Narrow-contract functions should not be noexcept. All other functions have wide contracts (ie. no preconditions). 3. Any function returning QString can throw (bad_alloc). Consequently, they, too, are not marked nothrow. Change-Id: I023356ba1b9a4b057e613cd45380a89b222dc09d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QEventDispatcherUNIX: Clean up thread_pipe logicLouai Al-Khanji2016-01-292-80/+111
| | | | | Change-Id: Ic13ad54a5b3c7bd3e3e5921b3dbbe321690fad21 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* update bundled sqlite to 3.10.0.2Mark Brand2016-01-294-9129/+40245
| | | | | | | Thanks to gunnar.roth@gmx.net for updating the WinCE patch. Change-Id: I131e0ee9141efdbd377e096aae0959311a601830 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Compile fix for QT_NO_ACCESSIBILITYPaul Olav Tvete2016-01-281-1/+2
| | | | | Change-Id: I251518566f114e0e5528304c908bcaef0f026c67 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* uic: Accept an -idbased argumentPavel Geiger2016-01-283-6/+20
| | | | | | | | | | | | | | | | When we want to use qtTrId function instead QApplication::translate in generated files it's not possible to use custom function with presented by the --tr argument due to signature difference between qtTrId and QApplication::translate function. With this argument present, uic will generate qtTrId function with second argument empty. When used together with --tr parameter it will use presented function instead. Change-Id: I0d986e4ea25ce58917fd9a2866b1eac0a4671502 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* QTranslator: optimize string and char usageAnton Kudryavtsev2016-01-281-2/+2
| | | | | | | | | | | Port a QString::fromLatin1() to QStringLiteral. The string is never modified. Wrap char in QLatin1Char to construct a QChar with 8-bit character. Change-Id: I579ca9eae0c2a72ea893254f258b001063e9f64e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QHttpNetworkHeaderPrivate: use erase and std::remove_if with QListAnton Kudryavtsev2016-01-281-7/+8
| | | | | | | ... instead of using erase in a loop, with quadratic complexity. Change-Id: I9527923dcfc3201776a59de53dd5c03ca4d80063 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QIODevice: make the read/write chunk sizes configurableAlex Trotsenko2016-01-273-17/+22
| | | | | | | | | | | | | | | By default, the read chunk size is QIODEVICE_BUFFERSIZE and the write chunk size is 0 (which means that we don't use the internal write buffer). Derived classes may override these values to define the size of QIODevice's write buffer or to optimize the read buffer use. Bump the TypeInformationVersion field in qtHookData, to notify the Qt Creator developers that the offset of QFilePrivate::fileName was changed and dumpers should be adapted. Change-Id: Ib732bc94be8da8a5514a6e5dcc04445895f130d8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QIODevice: add infrastructure for multistreamingAlex Trotsenko2016-01-274-13/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some sequential devices allow data to be partitioned into several channels that have the property of independently sequenced delivery. Supporting such devices uniformly requires a unified API which provides the user with a uniform concept of multistreaming. This patch is based on QProcess's multiplexing model and introduces the following features: - ability to get the number of channels; - multiple internal read/write buffers; - channel selection functions; - notification signals on channel activity. To keep the source code compatible with single-channel implementations, introduce a private class that references the current read buffer and hides multistreaming internals from the user. Bump the TypeInformationVersion field in qtHookData, to notify the Qt Creator developers that the offset of QFilePrivate::fileName was changed and dumpers should be adapted. [ChangeLog][QtCore] Added multistreaming to QIODevice. Change-Id: Idcaa6a618927c101c4c7284d2a633913be6a6ee2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QEventDispatcherUNIX: Use poll instead of selectLouai Al-Khanji2016-01-262-324/+206
| | | | | | | This allows us to support file descriptors >= FD_SETSIZE. Change-Id: I7e4a35333446a587cfd13c077fa5e19fa3d1abc4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-01-2654-258/+571
|\
| * Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-2654-258/+571
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/dbus/qdbusconnection_p.h src/dbus/qdbusintegrator.cpp src/dbus/qdbusintegrator_p.h tests/auto/corelib/io/qdir/qdir.pro tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
| | * Android: Probe for virtual keyboard heightBogDan Vatra2016-01-261-7/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Knowing the real virtual keyboard height will be easier for us to decide if we pan or resize the current view. The virtual keyboard is re-shown if current virtual keyboard height is different from previous one. Task-number: QTBUG-43739 Change-Id: I1bb41a70cced4c1d0e5f05a6c554831459b7a917 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| | * Call out to QtDBus message spies in the main threadThiago Macieira2016-01-253-13/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever there are spies installed, we call out to the main thread to call to the kded/kiod message spies. This allows the spy code to do just about anything, where previously it was restricted in what it could do to avoid deadlocking or triggering assertions if it recursed back into QDBusConnection code in the manager thread. After the spies are done, the message is re-inserted into the QDBusConnection processing pipeline. This commit moves the spy handling to after the check for disabled dispatching, as doing otherwise would mean the message could get postponed again for no good reason. It's also possible that the main thread isn't done installing the hooks, so waiting until the dispatching is enabled is a good idea. For simplicity, this commit also restricts spying to method calls only. Signals are no longer spyable. Change-Id: I3d11545be52c43119f0fffff142b0e9d447415c2 Reviewed-by: David Faure <david.faure@kdab.com>
| | * Repaint QOpenGLWidget when screen changesDyami Caliri2016-01-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 5c7f000cd4c9e3769e8cd4085cf0beee104f9886 greatly reduces the number of repaints for QOpenGLWidget. Unfortunately, this included when the widget changes screens. Change-Id: Iaabcb94925e4519cb5d8561b47aaddcfdc7b01ac Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Fix tlw source rect transformation for backingstore blit.Dyami Caliri2016-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The srcRect is already in device window coordinates. Converting it again via deviceRect(QRect, QWindow) causes it to be overly large. Task-number: QTBUG-50613 Change-Id: Iaae390499c0d1add842bde6eec22fb07c8de663b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Q*Application: don't allocate memory just to compare C stringsMarc Mutz2016-01-233-37/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating a QByteArray, possibly normalizing a leading '--' (one allocation, plus possibly one copy), simply use the old 'ol str(n)cmp, skipping the first character if the argument starts with '--'. It also fixes parsing of -stylesheet and other options which were erroneously parsed using indexOf() != -1, when they should have used startsWith(). Also saves 504/742/522b in text size for QtCore/QtGui/QtWidgets, resp., on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Ida868badac3fb9b77285417ee537c861ccc4fc06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Android: Fix compile on arm64BogDan Vatra2016-01-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Workaround Bionic bug. Check https://code.google.com/p/android/issues/detail?id=194631 for more info. Change-Id: Ib1abae37c94d4e76bb3bd633985c84128659bf4c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Speed up QObject::connect with function pointersSimon Hausmann2016-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When resolving the signal/slot of connect(&Foo::bar, ...) we place a meta-call to map the address to the method index. Once we have found the index, we don't need to continue but can return the result right away. Change-Id: I67bb22df394d7c22dc1731367c0961b958ed77b3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QNX: Fix -developer-buildRafael Roquetto2016-01-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -developer-build enables -Werror=undef, which uncovered a bug inside qcompilerdetection.h. According to the Dinkum headers, it is necessary to account for three different states concerning the values of the _HAS_* macros: 1. undefined 2. 0 3. 1 Therefore, it is necessary to check both whether it is defined and if it is not 0. Only checking whether a given macro is 0 will generate a trap by -Werror=undef. (__GLIBCXX__ is the sole exception). Change-Id: Ib95e485698ee38858a1671d930d7e960b75bb041 Reviewed-by: James McDonnell <jmcdonnell@qnx.com> Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Cocoa: Update QWindow::screen() on expose/show.Morten Johan Sørvig2016-01-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to correctly handle show on non-primary screens. Change-Id: I80b13372b3a92786987a66f0da385af6b4a6a863 Task-number: QTBUG-47950 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * Hide better the private API QTextCursor constructorsThiago Macieira2016-01-227-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both constructors were taking a pointer, so they participated in overload resolution along with QTextDocument and QTextFrame pointers. Instead, make them take references and move them to the private section of QTextCursor. That necessitated adding a method to QTextCursorPrivate to access that private constructor from non-friend classes. Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * Fix build with QT_NO_OPENGLTor Arne Vestbø2016-01-211-0/+1
| | | | | | | | | | | | | | | Change-Id: I3056d101967d94961b35ce10692dc9f390189b40 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Use QFileInfo::exists(f) instead of QFileInfo(f).exists()Tobias Koenig2016-01-213-7/+7
| | | | | | | | | | | | | | | | | | | | | QFileInfo::exists(f) is somewhat faster than the version which creates an temporary object. Change-Id: I5f931a86d9dfad57d99efe04ca115422de43def9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Remove dead code from QOpenGLPaintEngineAllan Sandfeld Jensen2016-01-212-19/+1
| | | | | | | | | | | | | | | | | | | | | These variables were never used or set to anything meaningfull. Change-Id: Ic68ac5c38a3db28d7a5a05be004bcb6a554a1483 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Avoid heap allocations in Median classTobias Koenig2016-01-213-1/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | Create a MedianDouble class and V2 version of BlockSizeManager, which use a fixed size array of double (since we always use 7 elements to calculate the median anyway). Change-Id: Ife90b90336a9a8c037b90726dee4cd2a1b8b6cd9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QString: optimize case conversion codeKonstantin Ritt2016-01-211-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle special case mapping of length 1 explicitly; Skip calculating of high surrogate for the same plane; Optimize branch prediction with Q_LIKELY/Q_UNLIKELY; Replace peekNext() + advance() with just next() in the caller function. Change-Id: I0d37969749bd8ca855321242e6a0e72c405c5f8d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * eglfs: Detect llvmpipe and show a warningLaszlo Agocs2016-01-214-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do ourselves and our users a favor by pointing out why Qt (Quick) apps perform horribly on commonly used distros on the RPi. Using a software rasterizer on such boards is not going to cut it. Task-number: QTBUG-50533 Change-Id: I087f502ddb9c6bdde84343e6abd85c87cdc474f0 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
| | * Fix some mis-guided fall-throughs #ifdef QT_BOOTSTRAPPED.Edward Welbourne2016-01-211-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A switch had a case whose body was in a #ifndef; when that got elided, this case fell through into an entirely misguided case. Give the #if a #else clause so that it break;s in the defined case. Code review revealed another, then I searched for more following the same pattern. Change-Id: I57fb59b6c8d349604f3fc6c8b1d424fb3c775d50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix pixmap types in org.kde.StatusNotifierItem.xmlDmitry Shachnev2016-01-212-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the spec, pixmap type is ARRAY(INT, INT, ARRAY BYTE). This also matches our QXdgDBusImageVector typedef. Also fix the D-Bus Introspection class info. Change-Id: Ic13e8a078299b9c76d2742055d64cfdc54460d58 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | * QtPlatformSupport: Remove virtual from declarations with override.Friedemann Kleint2016-01-215-59/+59
| | | | | | | | | | | | | | | | | | Change-Id: If94207596411680dfc2dbe33f298dc48fd5b7cc0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QGnomeTheme: Change the QFont members to pointer members.Friedemann Kleint2016-01-211-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When initializing the font members in the QGnomeTheme constructor, the QFont constructor called QGuiApplication::font() which in turn calls initFontUnlocked(), initializing QGuiApplicationPrivate::app_font to QPlatformFontDatabase::defaultFont() ("Deja Vu 12") since QGuiApplicationPrivate::platformTheme() is still 0 at that point. Change the fonts to pointer members and initialize them delayed in QGnomeThemePrivate::configureFonts() instead. Task-number: QTBUG-49095 Change-Id: I3282ea8484e04827be2a424f5ea3e34d607c4bc5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| | * winrt: Fix potential crash in readDatagramMaurice Kalinowski2016-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native socket engine used strcpy for WinRT, which tries to copy terminating null character. The QSocketNotifier::async_readDatagramSlot autotest uses a buffer of size 1, which causes readDatagram to overwrite the buffer on the stack. Hence use memcpy instead to protect from additional copies beyond barriers. Note that we cannot use qstrcpy as that does a buf[size-1] = '\0' at the end, which would remove content for a buf size of 1. Change-Id: I20baf9e63646cd28c1c954a20b8ae9c7d5873c31 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| | * winrt: msvc2015: refactor file handlingMaurice Kalinowski2016-01-216-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | msvc2015 reintroduced a couple of functions from the win32 API towards WinRT. Enable usage of those and simplify the file system engine. Furthermore update the autotests. Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| | * [docs] Fix reverse STL iteration exampleMarc Mutz2016-01-212-7/+4
| | | | | | | | | | | | | | | | | | | | | Use reverse_iterator, now that we finally have it. Change-Id: If74ead1a6075c5437c1d111206913481a495a014 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix the use of R_X86_64_GOTPCREL on a 64-bit field: it should be 32-bitThiago Macieira2016-01-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ABI says that PC-relative displacements should be on 32-bit fields, even on 64-bit builds. For -mcmodel=large, it should use R_X86_64_GOT64 relocations, like 32-bit. Task-number: QTBUG-50537 Change-Id: I1041122c530b4f5bbaabffff142ade5b3cbfc4c5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QNetworkInterface: don't add a QNetworkAddressEntry if no IP is knownThiago Macieira2016-01-211-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If SIOCGIFADDR fails, then don't bother trying to get the broadcast address or netmask, and especially don't add the empty QNetworkAddressEntry to the interface. This can happen on interfaces that have no IP address assigned (for example, inactive interfaces). Change-Id: I8de47ed6c7be4847b99bffff141c326d94ecca78 Reviewed-by: Richard J. Moore <rich@kde.org>
| | * QNetworkInterface: fix handling of interfaces with no addressesThiago Macieira2016-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Certain Linux interfaces have no addresses at all (hardware or IP), like the nlmon interfaces. They weren't being reported. Change-Id: I8de47ed6c7be4847b99bffff141c2b60c2089ad3 Reviewed-by: Richard J. Moore <rich@kde.org>
* | | uic: optimize generateMultiDirectiveBegin()Marc Mutz2016-01-261-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of building a QMap with dummy values, just to sort the elements of the QSet, build a QList, and sort that. Also use QStringList::join() instead of rolling our own loop. Change-Id: Iebb7faac8e4b72d6f71b3ab3feba7865b1a102f3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>