summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Ensure QTextStream doesn't modify the Text flag on the underlying iodeviceLars Knoll2016-03-081-9/+10
| | | | | | | | | | | An empty read or a failed write on the underlying QIODevice of the text stream would lead to an early return where we wouldn't correctly restore the QIODevice::Text flag of the io device. Change-Id: I5b632f45dea6ede3f408113556c3dad1b96574e2 Task-number: QTBUG-47176 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Clean up WINVER, _WIN32_WINNT macros for MinGW.Friedemann Kleint2016-03-071-7/+0
| | | | | | | | | | | Define WINVER, _WIN32_WINNT as 0x501 (Windows XP) in qt_windows.h. Remove definitions of the same/lower versions and unneeded definitions in other places. Remove definition for Borland compiler. Task-number: QTBUG-51673 Change-Id: I2a344a7f7cf78b2afbf45dcdf8bf2a19b93f0a07 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Remove QT_MOC_COMPAT from deprecated QProcess::error signalKai Koehne2016-03-041-1/+1
| | | | | | | | | | | QT_MOC_COMPAT has the unfortunate behavior that it generates a warning at runtime, which also cannot be disabled. This is too draconic. Task-number: QTBUG-51517 Change-Id: I80af8b8b482671e4c9567281c3b1c504d737e202 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fixed reading REG_SZ without terminating \0 delivers garbageDavid Weisgerber2016-03-021-0/+6
| | | | | | | | | | | | | When reading from the registry, sometimes the string is not null terminated. In order to fix this, the preallocated QByteArray size is increased, so that there are guaranteed enough terminating \0 [Windows] Not null terminated strings are now read properly from the registry Change-Id: I95fdf42cbbb7074fcf010dd14d0241f02d3c412b Task-number: QTBUG-51382 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Fix crash in QProcess::waitForFinished on WindowsJoerg Bornemann2016-02-291-2/+4
| | | | | | | | | | | | | | | | | | | Suppose the user connects QProcess::readyReadStandardOutput with a slot that calls QCoreApplication::processEvents. Assume the event loop did not handle events between QProcess::start and QProcess::waitForFinished. The process writes to stdout and exits. QProcessPrivate::waitForFinished calls drainOutputPipes which calls QWindowsPipeWriter::waitForReadyRead. This in turn will trigger _q_processDied via the readyRead signal and processEvents. _q_processDied will delete the pid object and set pid to null. After drainOutputPipes returns, _q_processDied is called again but it must not be called if pid is already destroyed. Prevent calling _q_processDied if pid is null. Task-number: QTBUG-48697 Change-Id: Iee047938ee1529057a1a43d71f4e882750903c7e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* OS X: Implement download folder display name querySamuel Gaist2016-02-151-0/+8
| | | | | | | | | | | | | Up to now, the download folder display name was queried using FSFindFolder and kDesktopFolderType. Now that NSFileManager can be used unconditionnaly, the query has been replaced to use NSFileManager. [ChangeLog][QtCore][OS X] QStandardPaths now returns the correct display name for the download folder. Task-number: QTBUG-50262 Change-Id: Ie16c8daea3261a4dd5ca051956fc08d51656e0fa Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* Remove Windows CE build hacks from QWindowsPipeWriterJoerg Bornemann2016-02-121-11/+0
| | | | | | | | Those were added in ancient times to make QWindowsPipeWriter compile on Windows CE. It was never used though. Change-Id: Ica71b182f7ee4e47d9e33638d78475842b2ecdff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Document QWinOverlappedIoNotifier restrictionsJoerg Bornemann2016-02-121-0/+16
| | | | | Change-Id: I13cd14c29ddaf4c7423d672b0551081f87d8726b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix usage of QMutexLocker, destroy it only at end of scopeSérgio Martins2016-02-101-1/+1
| | | | | | Change-Id: I87f2c433c987b5f7b4680639cae51cdf6ce9ddc6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Readability fix for MS isRelative, isAbsolute.Edward Welbourne2016-02-091-6/+10
| | | | | | | | | | | The layout and phrasing of these two QFileSystemEntry methods was such as to obscure what they actually test. (Overlong lines, extraneous parentheses, spurious conditions and poor line-breaking.) Rewrote to make both clearer; and, in particular, to make it obvious that they are *not* mutually complementary. Behavior is not changed. Change-Id: If748e48d41fe3a76bab3a1f840c7b7ca62442f8f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Do not build QWindowsPipeWriter on Windows CEJoerg Bornemann2016-01-292-5/+4
| | | | | | | QWindowsPipeWriter is not used in the Windows CE port. Change-Id: I068dd2408bb21a7e2a86886e0692b1636016ff6a Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
* Refactor QStandardPaths for Desktop Windows.Friedemann Kleint2016-01-281-115/+143
| | | | | | | | | | | | | | | Replace the large switch in QStandardPaths::writableLocation() by a function mapping QStandardPaths::StandardLocation to the int clsid required by SHGetSpecialFolderPath(). Warn if SHGetSpecialFolderPath() fails for config location and append prefixes (cache/application name/organization) only on success. Change the logic in QStandardPaths::standardLocations() to append the writable location first, avoiding the prepend(). Task-number: QTBUG-50570 Change-Id: I9d80e83d1ca7af3ea8d3ac2c720ee981b1b2c32a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Use QFile::exists(f) instead of QFile(f).exists().Anton Kudryavtsev2016-01-271-1/+1
| | | | | | | It's faster. Change-Id: Ie57619b4e0c53975aa955c83c833c34e1446e4c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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>
* Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6Jani Heikkinen2016-01-218-47/+82
|\
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-198-47/+82
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| | * Fix QFileSelector::select if called with QUrl and scheme "assets"André Klitzing2016-01-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFileSelector::select(QUrl) will use ":" for scheme "qrc" to call QFileSelector::select(QString). Scheme "assets" needs to remain "assets:" for select(QString), otherwise it won't recognize the file in "assets". Following failed because it was passed as ":/qml/example.qml" to select(QString): select(QUrl("assets:/qml/example.qml")); This will call select(QString) to: select("assets:/qml/example.qml"); Change-Id: I6bdeed6bb67992498ae3b8e1273c20e70049381a Task-number: QTBUG-50435 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | * Fix UB in QIODevicePrivateMarc Mutz2016-01-131-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing nullptr as the second argument of memcpy/memmove constitutes undefined behavior, even if the length argument is zero at the same time. Fix by protecting mem{cpy,move,chr} from nullptrs. Found by UBSan: qtbase/src/corelib/io/qiodevice_p.h:105:33: runtime error: null pointer passed as argument 2, which is declared to never be null qtbase/src/corelib/io/qiodevice_p.h:175:53: runtime error: null pointer passed as argument 2, which is declared to never be null Change-Id: I979158b0a74169ca4eb459928398ebc40f77dfb5 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix UB in QFileDevice::writeData()Marc Mutz2016-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing nullptr as the 2nd argument of memcpy constitutes undefined behavior. Fix by protecting the block with 'if (len)', which, presumably, is the only valid case where 'data' may be nullptr. Change-Id: I7647d7e0808b1f26444ea3cf8bbf5cda9ddc9e6c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix UB in QFSFileEnginePrivate::writeFdFh()Marc Mutz2016-01-111-21/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, it is considered valid to call the function with 'data' set to nullptr, and 'len' to zero. But doing so invokes undefined behavior because nullptr is passed to fwrite(). Fix by protecting the loops with 'if (len)'. Found by UBSan: qtbase/src/corelib/io/qfsfileengine.cpp:732:84: runtime error: null pointer passed as argument 1, which is declared to never be null Change-Id: Idfe23875c868ebb21d2164550de3304d2f01e9df Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * forkfd: Also define BSD visibility macros in forkfd_qt.cpp.Raphael Kubo da Costa2016-01-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to c8c4ad0 ("forkfd: Define __BSD_VISIBLE and _NETBSD_SOURCE"). Defining those macros in forkfd.c is not enough: forkfd_qt.cpp also sets _POSIX_C_SOURCE, and sys/cdefs.h can be included implicitly via Qt's headers (<algorithm> ends up pulling unistd.h that leads to sys/cdefs.h and sys/types.h with both libstdc++ and older libc++ versions). In this case, __BSD_VISIBLE/_NETBSD_SOURCE are not defined, _POSIX_C_SOURCE is, several type definitions are omitted and by the time we include sys/time.h in forkfd.c the build fails. On FreeBSD < 11, the error looks like this: In file included from io/../../3rdparty/forkfd/forkfd.c:36, from io/forkfd_qt.cpp:80: /usr/include/sys/time.h:94: error: 'u_int' has not been declared Change-Id: I01fa2f5861027d99936d3026faeee9f0db3ecabd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fix timeout calculations using qt_subtract_from_timeoutJoerg Bornemann2015-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Commit ed0c0070 introduced qt_subtract_from_timeout but used it incorrectly in several places. Change-Id: I80ea16088707929a45d5a61ec6f3370f8e63d1cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * QLockFile: decide on locking strategy per pathDavid Fries2015-12-112-14/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is filesystem dependent if flock and fcntl locks are independent or the same underlying lock (which causes getting the second lock to fail). A temporary file in /tmp might be on a local file system and pass while the lock file is placed on NFS and fail with: setNativeLocks failed: Resource temporarily unavailable Instead check for lock conflicts per path and cache the result. Change-Id: I39c59bb240cd99ef0a0ec271243770ffd5df8a7d Reviewed-by: David Faure <david.faure@kdab.com>
| | * Check if the file is writable even while QT_BOOTSTRAPPEDAndy Shaw2015-12-111-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QConfFile::isWritable() has the extra effect that it will try and create the path where the file should be if it does not already exist. So this cannot be omitted as 'qmake -set' may be used in a situation where the path does not yet exist. Change-Id: I0113644259f78d090a0687c44cf60d400be9c859 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Fix toDisplayString(QUrl::PreferLocalFile) on WinKevin Funk2016-01-201-23/+30
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using QUrl::PreferLocalFile we do want to strip the leading slash, as toLocalFile() would do as well. Behavior change by means of an example: QUrl url(QUrl::fromLocalFile("C:/file.txt") url.toLocalFile() --> "C:/file.txt" Before: url.toDisplayString(QUrl::PreferLocalFile) --> "/C:/file.txt" After: url.toDisplayString(QUrl::PreferLocalFile) --> "C:/file.txt" Task-number: QTBUG-41729 Change-Id: I7d425541f6077ebcf3fcf46feeb7e0f03a0d7fe2 Reviewed-by: Dominik Haumann <dhaumann@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Replace QStringLiteral with QLatin1String in QFileSelectorAndré Klitzing2016-01-131-2/+2
| | | | | | | | | | Change-Id: I5c109d26bf5252947ae016465db5675e38cd68c9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Make QUrl::removeAllQueryItems actually remove the query itemsThiago Macieira2016-01-091-2/+2
| | | | | | | | | | | | | | | | | | We forgot to setQuery() after the query was modified. Task-number: QTBUG-49963 Change-Id: I11f559ef75544c50b3f8ffff1420148ba3092200 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | WinCE: Remove QIncrementalSleepTimer from QProcess::waitForFinishedJoerg Bornemann2016-01-061-12/+6
| | | | | | | | | | | | | | | | | | | | | | Remove a superfluous loop and thus the usage of QIncrementalSleepTimer from QProcess::waitForFinished. We just wait for the process handle. There's no need for a loop that checks multiple wait conditions. This enables us to remove QWindowsPipeWriter from the Windows CE port in a subsequent commit. Change-Id: If6a82405227cf145263dba3726bae959e6871d0e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QUrl: revert path-normalization in setPath().David Faure2015-12-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Path normalization should happen only when NormalizePathSegments is set. Use a less intrusive fix for the setPath("//path") issue that commit aba336c2b4ad8 was about. This allows fromLocalFile("/tmp/.") to keep the "/." at the end, which is useful for appending to the path later on (e.g. to get "/tmp/.hidden") Change-Id: Ibc3d4d3276c1d3aaee1774e21e24d01af38fa880 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QStandardPaths: warn if $XDG_RUNTIME_DIR doesn't existDavid Faure2015-12-221-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | If the environment variable is set, but points to a non-existing directory, the user would get a warning about chmod failing. Better be clear and warn about the fact that the directory itself doesn't exist. Also warn if $XDG_RUNTIME_DIR points to a file rather than a directory. Task-number: QTBUG-48771 Change-Id: If84e72d768528ea4b80260afbbc18709b7b738a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Remove superfluous ReleaseSemaphore/WFSO callsJoerg Bornemann2015-12-212-13/+16
| | | | | | | | | | | | | | | | | | Factor out the dispatching of IO results into a separate function. Do not increment the semaphore count in waitForAnyNotified just to decrement it again in _q_notified. Change-Id: I7d4a04b679bb152ab3a5025513f885aee276d086 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QProcessPrivate::startProcess - fix invalid encodedProgramName (OS X)Timur Pocheptsov2015-12-091-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | CFBundleCopyExecutableURL returns different URLs (can be absolute or relative) for the same bundle (caching) - and this results in an invalid encodedProgramName (in case we try to start the same process twice), for example, if we start: QProcess p; p.start("nestedDir/nested.app") twice, the second time we'll have an error trying to start something like nestedDir/nested.app/_and_here_absolute_url. Change-Id: I8ac42e20fe3b9fe8b80d5b5c663672e77d88269d Task-number: QTBUG-49837 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* | QStandardPaths::standardLocations()/WinRT: Return empty lists.Friedemann Kleint2015-12-031-1/+2
| | | | | | | | | | | | | | | | Previously, lists containing one empty string were returned for the unimplemented functions. Change-Id: Ia64b53325420e32076f2bacf22c48885d7121df0 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | doc: add a note about cmd.exe and the QProcess string splitting/joiningThiago Macieira2015-12-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | cmd.exe uses a different set of characters to split arguments on, which is not compatible with CommandLineToArgvW(). See https://technet.microsoft.com/en-us/library/bb490880.aspx. Task-number: QTBUG-49641 Change-Id: Ic90fe6b1cbe84978a02fffff141b8f961a43ad28 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Remove a reference to Mac OS X 10.4Lars Knoll2015-11-301-2/+2
| | | | | | | | | | | | | | It's been a while since we stopped supporting that version :) Change-Id: I2fa4900945551024ac920c36c47d20b47aee50c0 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-271-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_p.h src/network/ssl/qsslsocket_mac.cpp src/network/ssl/qsslsocket_mac_p.h src/widgets/kernel/qwidget.cpp Change-Id: I39592cb37d710dfaf8640769ba3c1b637927d7f4
| * OS X: Fix QStandardPaths::standardLocations()Andrew McCann2015-11-221-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-49443 Change-Id: I0699dfd3cb4c710ab96c324219444c6294c9d732 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Do not overwrite detailed error message if process fails to launchKai Koehne2015-11-125-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | On Unix we get a detailed error message when a process fails to start, but later on we overwrite it with a generic "Process fails to start". Fix this by keeping the original error message (if one is available). This fixes a regression introduced in commit 5147f73ac3. Task-number: QTBUG-49286 Change-Id: Idd0f0fed9773d39f2947fc3e532b51e670952caf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Doc: Added more details to QIODevice::readAll()Nico Vertriest2015-11-091-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-43666 Change-Id: Ibe56a72f9fa7a31a320aceda645fde9b08645271 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-043-17/+59
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/styles/qwindowsvistastyle.cpp Change-Id: Ie1725933815891cc8c86258d4c0e8ed0ab386edf
| * QWindowsPipeReader: fix occasional "Unknown error 995"Joerg Bornemann2015-11-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | After canceling the asynchronous read operation, the notified() slot receives ERROR_OPERATION_ABORTED. We must not handle this situation as an error. This amends commit 5ce567c5. Task-number: QTBUG-48336 Change-Id: Iff948ceb3ad1f805a9de8c188fbc39ed4c76ba82 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Fix QStorageInfo on BSD4 systemsDmitry Shachnev2015-10-271-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | - On NetBSD, the defines were not properly defined; - On all other BSD systems, we use statfs which does not have f_frsize member, revert to using f_bsize there. Task-number: QTBUG-48267 Change-Id: Ia1ed484ac61a615fcbb5b45affb516b5e86a64b0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * fix growth of event queue in QWinOverlappedIoNotifier::waitFor*Joerg Bornemann2015-10-261-15/+47
| | | | | | | | | | | | | | | | | | Do not emit _q_notified when we're in a wait function. Otherwise, the queued signals could pile up in the event queue. Task-number: QTBUG-48653 Change-Id: I071863e2356e17c7004e3b7ca359967cb115e343 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QIODevice: fix interleaving read() and write() in text mode under WindowsAlex Trotsenko2015-10-271-3/+4
| | | | | | | | | | | | | | | | Skip the correct number of bytes in the read buffer when expanding '\n' into "\r\n" upon writing. Change-Id: I5b01fc47c330dee5c83001abf0acd7d63d790b96 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | QTextStream: optimize streaming of QLatin1String and const char*Marc Mutz2015-10-232-4/+48
| | | | | | | | | | | | | | | | | | | | | | Instead of converting the QLatin1String to a QString at the first opportunity, keep it around until it is appended to one of the internal QStrings in write(). Avoids a memory allocation per QLatin1String / const char* streamed. Change-Id: Id973a9b743e5a6696defbc4ef4ed2db1ef54e9cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTextStream: Extract Method padding() from putString()Marc Mutz2015-10-222-29/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation of adding a putString(QLatin1String) overload. To keep the change simple, I kept the construction of the padChar chain per putString() call. It probably makes sense to have a QString::resize(int, QChar) to perform the padding operation in-place. Let's leave that for another changeset. Change-Id: I9ef66b8df38117e1669fd2bece6ee180a2ce3369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Android: Warnings--BogDan Vatra2015-10-201-1/+1
| | | | | | | | | | Change-Id: I79bef1e5e73fedf2bae61d6cfc9634a14958ba0e Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | QTextStream: add missing op<<(QStringRef)Marc Mutz2015-10-162-0/+16
| | | | | | | | | | | | | | | | | | | | | | It simply is missing. We could wait for QStringView to come around, but I need this function in uic _now_, so let's add it. [ChangeLog][QtCore][QTextStream] Can now stream QStringRef without converting to a QString first. Change-Id: Idd178e0ba8a89c025f4533d46de912cbdb3883d5 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QTextStream: optimize putString()Marc Mutz2015-10-151-10/+15
| | | | | | | | | | | | | | | | | | | | Instead of filling a QString with the padding characters, use a QVarLengthArray. Do this only in the code path where it's actually needed, and mark that code path as unlikely. Change-Id: I11e04ccc4a07e16e430f2ea6dbb2f0f736908f5b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-133-10/+68
|\| | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qabstractsocket.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp src/sql/drivers/mysql/qsql_mysql.cpp Change-Id: Ifb73623d09f53340ee5e10283f1f86b580998902