summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Let QWindowsPipeWriter::write only warn about unexpected errorsJoerg Bornemann2017-07-241-1/+9
| | | | | | | | | Do not print a critical message when the pipe connection dropped as this can happen with regular QLocalSocket usage as demonstrated in qtremoteobjects. Change-Id: If79915ce5d83b8cae5e090c04e893dafcb5a88a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QFileSystemEngine::id/Windows: Fix use with directoriesThiago Macieira2017-07-221-3/+10
| | | | | | | | | | | The Microsoft documentation says that CreateFile cannot be used to create directories, so you can only use it on a directory with OPEN_EXISTING and FILE_FLAG_BACKUP_SEMANTICS. This commit implements that. Change-Id: I658f552684924f8aa2cafffd14cfc0e5660a4a62 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileSystemWatcher/kqueue: make the fd duplication + FD_CLOEXEC atomicThiago Macieira2017-07-211-2/+1
| | | | | | | The original fd was already FD_CLOEXEC due to qt_safe_open. Change-Id: Ief61d358e2b54a0fac37fffd14d2394ee02da059 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QFile::rename: use the open file's ID, instead of using the file nameThiago Macieira2017-07-189-3/+66
| | | | | | | | | | | To do that, we needed to add virtual id() in QAbstractFileEngine and override it in QFSFileEngine. It might be useful to return other types of IDs for the other file engines, but this commit does not attempt that just yet. Change-Id: I1eba2b016de74620bfc8fffd14ccafe0762b3c38 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert improper uses of qt_error_string() to QSystemError::stdString()Thiago Macieira2017-07-183-14/+15
| | | | | | | | | On Windows, qt_error_string() returns the string corresponding to the Win32 API, not an errno. Replace those uses for a function that works for errno values. Change-Id: I1eba2b016de74620bfc8fffd14ccce6162bafdca Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileSystemEngine::id/Windows: Use the volume ID tooThiago Macieira2017-07-181-5/+7
| | | | | | | | | | | The MS documentation says that the high/low parts uniquely identify a file within a system, but they actually mean the filesystem. The details on how it's allocated make that clear. So we need the volume identifier. Change-Id: I658f552684924f8aa2cafffd14cfc03c5a09c0e9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Doc: QLoggingCategory::setEnabled() should only be called in filterKai Koehne2017-07-181-6/+5
| | | | | Change-Id: Ib159c45ca259af125e48e3dfe59d64abc5f81f81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Clarify limitations of category filterKai Koehne2017-07-181-2/+2
| | | | | | | As suggested by ogoffart. Change-Id: I15747869147819799b14dfe0670ff2225f76fc03 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Do not wait in QWindowsPipe{Reader|Writer}::stop()Joerg Bornemann2017-07-174-14/+30
| | | | | | | | | | | | | | | | | | | | | | A deadlock can occur if the user does QLocalSocket *ls = new QLocalSocket; ls->moveToThread(t); ... delete ls; Then QLocalSocket calls QWindowsPipeReader::stop() in a different thread than the I/O operation is running in. The waitForNotified(-1) call would then wait indefinitely until the I/O thread is in alertable wait state again. Especially on application shut down this might never be the case, and the application would deadlock. Solve this by detaching the Overlapped object from the QWindowsPipe{Reader|Writer} in stop() and delete it in the callback. Task-number: QTBUG-61643 Change-Id: Ie262d75c5fd92ac7cf7dfcdbf1519050be9fd3c4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix warning messages in QWindowsPipeReader/WriterJoerg Bornemann2017-07-172-2/+2
| | | | | | | | | We forgot to update the warnings when removing qt_cancelIo. Also, use %p instead of %x, because HANDLE is void*. This amends commit fade2958. Change-Id: Ia11d7d094aa6beb939e0be4bbe4ab3654eaa1c02 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QStorageInfo/Windows: Improve error handlingFriedemann Kleint2017-07-091-18/+34
| | | | | | | | | Bail out of QStorageInfoPrivate::doStats() should an error occur and set the ready/valid flags accordingly. Task-number: QTBUG-6039 Change-Id: Id5354b31329d951599ae991aa7edde0515c90514 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid sharing violation in QFileSystemEngine::id on WindowsThiago Macieira2017-07-071-3/+3
| | | | | | | | | We can't open a file for reading if the file is open by another process (or by ourselves) without sharing permitted. So ask for no access just so we can get a handle to it. Change-Id: I998653739e1cec2a58a07a6593b6ff87c1d59dd1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFile::rename: avoid two stat(2)/CreateFile in a rowThiago Macieira2017-07-072-4/+7
| | | | | | | | | | | | QFileSystemEngine::id() will stat(2)/CreateFile in order to get the ID of the file anyway, so we don't need to use QFile::exists() to check if the destination exists. Instead, rely on id() returning a null value to indicate error. On Windows, it's possible that the calls to either GetFileInformationByHandle or GetFileInformationByHandleEx might fail, but we ignore those. Change-Id: I1eba2b016de74620bfc8fffd14ccaebcbed64419 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* QFileSystemWatcher/Windows: Recreate handle for filesFriedemann Kleint2017-07-071-9/+38
| | | | | | | | | | | | | | | | QWindowsFileSystemWatcherEngine uses one change notification per directory to watch directories or files within that directory. Adding files and their directories in a sequence caused the value in QWindowsFileSystemWatcherEngineThread::HandleForDirHash to be overwritten. Relax the check for the flags (watcher attributes) to use >= and recreate the change notification of a directory should its flags be insufficient. This triggers when a file is added after its directory since files require more attributes. Task-number: QTBUG-61792 Change-Id: I371a72f1934fa82c53aaf84beb907825031f1c81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileSystemEngine::id: use the proper QT_STATBUF/QT_STATThiago Macieira2017-07-051-2/+2
| | | | | | | Just in case. Change-Id: I1eba2b016de74620bfc8fffd14ccaa801805ae02 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileSystemEngine/Unix: use fchmod(2) if the file is openThiago Macieira2017-07-053-3/+32
| | | | | | | | | This protects against the file having been renamed or deleted. We'll still operate on the open file, regardless the name it may have on the filesystem. Change-Id: I1eba2b016de74620bfc8fffd14cca85cfd672e6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileSystemEngine::fillMetaData: fix apparent use of dangling pointerThiago Macieira2017-07-051-9/+1
| | | | | | | | | | | | | It's not dangling only because of QFileSystemMetaData's construction: the nativeFilePath() function returns a member variable. Since QByteArray COWs, the pointer that we stored would not be freed. But this was dangerous, since any change to the "entry" variable could cause it to invalidate the member variable and the pointer to become dangling. This line is only as old as this entire file is. Change-Id: I8d96dea9955d4c749b99fffd14cda4d8e2cc5e5b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix Windows build without features.filesytemiteratorStephan Binner2017-07-051-1/+4
| | | | | | Task-number: QTBUG-61671 Change-Id: I65a96ca51efee303602c836e5b0177b1a63d1a7a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QFileSystemEntry: Export static helper function checking for the root pathFriedemann Kleint2017-07-032-10/+23
| | | | | | | | | | | This provides a helper function which does the check on the string. QFileInfo::isRoot() in addition checks for the existence of the directory, which can cause hangs with network drives. Use the new function in appropriate places in QtWidgets. Task-number: QTBUG-6039 Change-Id: I54d0d860713e82b28fa4069a5345b042337f9c52 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Add note about fromPercentEncoding's behavior on invalid inputMårten Nordheim2017-06-291-0/+4
| | | | | | | | | Add a note saying that invalid input to QByteArray::fromPercentEncoding and QUrl::fromPercentEncoding will produce invalid output, and provide an example. Change-Id: Icc68f59c23cf199640b646cd4a6ca8e4808a3f71 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProcess/Unix: move strerror() up from child to parentThiago Macieira2017-06-281-27/+19
| | | | | | | | | | | | | | | | | | | | In theory, there's nothing wrong with having it in the child process. In practice, we've found that strerror/malloc can hang: if an application- wide lock was held by another thread before fork(), the child process could wait forever for an unlocking that will not happen (no threads running). See https://sourceware.org/bugzilla/show_bug.cgi?id=19431 As an added bonus, we now use qt_error_string(), which may produce slightly different text from strerror. [ChangeLog][QtCore][QProcess] Added a workaround for a rare race- condition bug in some C libraries that caused the child process started by QProcess to hang after trying to launch a non-existent executable or change to a non-existent directory. Task-number: QTBUG-61634 Change-Id: I1eba2b016de74620bfc8fffd14cbce4b9f9af69b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Use QMap in QProcessEnvironment so variables are sortedThomas Sondergaard2017-06-133-23/+20
| | | | | | | | | | | | | | | | | | | | | | The motivation for this change is to make it simple to pass a correctly sorted environment block to Win32 CreateProcess(). It is also nice in other contexts that the environment variables are sorted. The change is made for all platforms. This keeps it simple and the only ill effect is slightly slower lookups. Concerning the environment block passed to Win32 CreateProcess: The environment block that is passed to CreateProcess() must be sorted case-insensitively and without regard to locale. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682009(v=vs.85).aspx The need for sorting the environment block is also mentioned in the CreateProcess() documentation, but with less details: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx Task-number: QTBUG-61315 Change-Id: Ie1edd443301de79cf5f699d45beab01b7c0f9de3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename QProcessEnvironmentPrivate::hash to varsThomas Sondergaard2017-06-135-30/+30
| | | | | | | | | Also use auto for iterators to vars. This is a small refactoring in preparation for changing type of vars to QMap. Task-number: QTBUG-61315 Change-Id: I5731d7916b6f54a0da5be2da378c09a7688bd870 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document that QLoggingCategory is thread-safeKai Koehne2017-06-081-2/+24
| | | | | | Task-number: QTBUG-60475 Change-Id: Idced5e1a8ad1d2d28839fd23126a7bf084141eca Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QStorageInfo: Pass MNT_NOWAIT to getmntinfoThiago Macieira2017-05-301-1/+5
| | | | | | | | | | | | | This forces the API not to wait for synchronous I/O from the filesystems and get the information, but instead just use the cached information directly. It's a good idea if we have an unresponsive FS, like NFS with an unreachable server. Task-number: QTBUG-61096 Change-Id: Iddeeffb6f4ad4a2894a2fffd14c32f6e90664a63 Reviewed-by: Tobias C. Berner Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDirIterator docs: add a cool recursive file-finding snippetShawn Rutledge2017-05-161-0/+4
| | | | | | | | This is one of the main use cases for QDirIterator, but it wasn't obvious enough that it's possible. Change-Id: Idae11cfe75dd0e16f1a960bba2470b1695d11241 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Warn if files are not found because of features.filesystemiteratorStephan Binner2017-05-081-0/+2
| | | | | | Change-Id: Ife3197aa1c56ba3ab6e7f530fbcbcf761f223b16 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QtCore: include mocsThiago Macieira2017-05-0512-1/+37
| | | | | | | | | | | | | | | | | | | Compilation and link times in CPU seconds with GCC 7, using precompiled headers (not including moc, rcc, uic, etc. steps or headersclean): Before After Debug -O0 198,1 180,3 Debug -Og 240,7 229,2 Release -O3 267,1 249,2 Release LTO 239,4 229,8 QtCore required a little manual adjusting because some files are bootstrapped into moc itself and into qmake. Change-Id: I84e363d735b443cb9beefffd14b8b57c10e7da36 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Doc: Do not abbreviate directory in documentationKai Koehne2017-05-041-5/+5
| | | | | | Change-Id: I26e8c5caca31e842adc7a09151b6de2cc17698ed Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QWindowsPipeReader: fix possible invalid invocation of ReadFileEx()Alex Trotsenko2017-05-021-2/+2
| | | | | | | | | | | If the user calls QLocalSocket::setReadBufferSize() with a value less than the current size of the pipe buffer, startAsyncRead() would call ReadFileEx() with invalid parameters: ReadFileEx(handle, nullptr, some_big_value, ...); Change-Id: I3d153e3ec34f8038dc001c1c896aeceb666a8979 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: fix IDN conversion when the ACE form is invalidThiago Macieira2017-04-251-9/+36
| | | | | | | | | | | | | | | | We guarded against the Unicode form being invalid and did not produce an encoded form. But we did not guard against proper Punycode sequences that decode to forms that had not passed the proper Nameprep stage. So check for that and, if it fails, just keep the label in the form we found it in (it's valid STD3 anyway). [ChangeLog][QtCore][QUrl] Fixed a bug that caused certain domain names that look like Internationalized Domain Names to become corrupt in decoded forms of QUrl, notably toString() and toDisplayString(). Task-number: QTBUG-60364 Change-Id: Iadfecb6f28984634979dfffd14b833142cca8d0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QUrl: fix IDN whitelist checking when the TLD is in UnicodeThiago Macieira2017-04-241-2/+2
| | | | | | | | | | The whitelist is kept in ACE form, so if the TLD came in Unicode, we need to run ToASCII before we can check the whitelist. This is slightly inefficient because we'll run the same operation later in this domain. Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
* QLoggingRegistry: remove rules vectorMarc Mutz2017-04-212-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It only contained a concatenation of the individual rule sets, probably to fix their order in a central place, as well as simplifying iteration in defaultCategoryFilter(). Fix these two issues differently, but introducing a RuleSet enum that lists rule sets in the order in which they should be applied by defaultCategoryFilter(), and turn individual rule sets vectors into a C array of vectors. This enables two nested loops in defaultCategoryFilter to replace the one loop over 'rules'. Apart from building up 'rules' in updateRules(), this was the only access to that member. That leaves updateRules() with just the task of running defaultCategoryFilter() on the new rule sets. Consequently, a call to updateRules() can now replace the identical loop in installFilter(). Performance should not suffer. Iterating over a fixed-size array of vectors is hardly any slower than iterating over a single vector, and while the construction of 'rules' was probably a one-off task in most programs, this way of keeping the rules also saves memory because rules are not kept in two different vectors. It is also more maintainable, of course. Change-Id: Ibc132d096c8137dd02b034752646212e51208637 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Split Q_COMPILER_UNICODE_STRINGS: add Q_STDLIB_UNICODE_STRINGSMarc Mutz2017-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bf2160e72cd8840a8e604438cbdc807483ac980a, we can rely on charNN_t support in all compilers except MSVC 2013, and since that commit, we use (in 5.10, not 5.9, yet) !defined(Q_OS_WIN) || defined(Q_COMPILER_UNICODE_STRINGS) when we only need charNN_t, the type, as opposed to its library support (u16string, char_traits<char16_t>, ...). This patch splits the Q_C_UNICODE_STRINGS macro into two, adding Q_STDLIB_UNICODE_STRINGS for when we need std::uNNstring, leaving Q_C_UNICODE_STRINGS for when we need just charNN_t support. In QDebug, when constructing a QChar out of a char16_t, cast to ushort first, since QChar(char16_t) was only officially introduced in Qt 5.10. [ChangeLog][Potentially Source-Incompatible Changes] The internal Q_COMPILER_UNICODE_STRINGS macro is now defined if the compiler supports charNN_t, even if the standard library does not. To check for availability of std::uNNstring, use the new Q_STDLIB_UNICODE_STRINGS macro. Change-Id: I8f210fd7f1799fe21faf54506475a759b1f76a59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_REQUIRED_RESULT to its correct positionThiago Macieira2017-04-201-2/+2
| | | | | | | | | | | That's before the return type or static, inline, constexpr or such keywords (if any). Perl Script: s/^(\s+)(.*) Q_REQUIRED_RESULT(;)?(\s*\/\/.*)?$/\1Q_REQUIRED_RESULT \2\3\4/ Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Revert "Initialize QLoggingRegistry rules on first use, not qApp construction"Tor Arne Vestbø2017-04-192-2/+2
| | | | | | | | | | | | | This reverts commit 47cc9e23a313d67a4a3107242f205d2473842021. We use QCoreApplication::applicationDirPath in the logging initialization to find a possible qtlogging.ini file. Because QCoreApplication::applicationDirPath requires a QCoreApplication instance this leads to a qWarning, which in turn leads to a recursive call to the logging initialization, and in turn to a recursive mutex deadlock. Task-number: QTCREATORBUG-18031 Change-Id: Ic75e1e8c062eb647991725378489bf87c9648cca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Initialize QLoggingRegistry rules on first use, not qApp constructionTor Arne Vestbø2017-04-182-2/+2
| | | | | | | | | Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: Ia733105c5b6f28e22af511ced5271e45782da12b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-181-5/+5
|\ | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp Change-Id: I375fa4afa662fa411a15f212ebd5f2f0dffdba7f
| * Restore compatibility with Qt 5.7.0 and 5.6.1Thiago Macieira2017-04-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSysInfo::productType() returned "osx" for all versions of macOS, even 10.12. Change 3e2bde35786 was incorrect. [ChangeLog][Important Behavior Changes] QSysInfo::productType() and QFileSelector behavior on macOS was restored to match what Qt used to return in version 5.7.0 and earlier. The behavior found in Qt 5.6.2, 5.7.1 and 5.8.0 is removed. [ChangeLog][Future Compatibility Notice] The identifiers that QSysInfo::productType() and QFileSelector will use to identify macOS systems will change in Qt 6.0 to match the Apple naming guidelines which will be current then. Task-number: QTBUG-59849 Change-Id: Ib0e40a7a3ebc44329f23fffd14b2b39392210c4f Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | QProcess: fix Unix buildJake Petroules2017-04-111-0/+4
| | | | | | | | | | | | | | | | This fixes a regression introduced in ff19ebcc Task-number: QTBUG-60046 Change-Id: I47c357433b25f07011a7a3a64d3150591785b206 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Optimize QLoggingSettingsParserMarc Mutz2017-04-102-39/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor the line parsing into a separate function, parseNextLine(), taking a QStringRef. In setContent(QTextStream&), use the new readLineInto() function to re-use the capacity of a single QString for all lines. In setContent(QString), use splitRef() to split the lines. In either function, pass each line to parseNextLine(). In order to port all the parsing to QStringRef, I needed to make some semantic changes: the old code removed all whitespace right at the beginning. This is not possible with QStringRef. It also didn't feel right, since a line like [ r u l e s ] would successfully parse as the section named "rules". I added trimmed() calls at the beginning, and around the valueStr and pattern extraction, which should be good enough. Also, when a section is found, don't store it anymore. Instead, only store whether it was the [rules] section, because that's all we'll test for. That way, we don't have to convert QStringRefs to QString just to store them across parseNextLine() calls. Replace the setSection() function with setImplicitRulesSection(), because "rules" is all that was ever passed. This is private API, we can bring back some of the dropped flexibility later, as needed. [ChangeLog][Important Behavior Changes] Logging rules can no longer contain arbitrary whitespace such as within a category identifier. Change-Id: Ic26cd23c71f5c810b37ef4b972354ac31d3408fe Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Fix QDir::mkpath() when the path contains "symlink/../"Thiago Macieira2017-04-071-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is incorrect to collapse a "symlink/.." segment because the parent directory of the symlink's target may not be the directory where the symlink itself is located. [ChangeLog][QtCore][QDir] Fixed a bug that caused QDir::mkpath() to create the wrong directory if the requested path contained a symbolic link and "../". Change-Id: Iaddbecfbba5441c8b2e4fffd14a3e367730a1e24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* | QDataStream: add operator<< and >> for std::nullptr_tThiago Macieira2017-04-072-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::nullptr_t is nullary: it accepts only one value, nullptr. So we don't need to read or write anything. This commit simply adds the two operators that allow generic code to operate on std::nullptr_t if required. This commit also adds the actual use to QMetaType::load/save, even though there's no change in behavior. [ChangeLog][QtCore][QDataStream] Added operator<< and operator>> overloads that take std::nullptr_t, to facilitate generic code. Change-Id: Iae839f6a131a4f0784bffffd14aa37e7f62d2740 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix warning for -no-feature-temporaryfileStephan Binner2017-04-041-0/+1
| | | | | | | | | | | | Change-Id: Ibb022a1fd043001f628a343dc8ae509083eb4471 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Prefer rvalue versions of toLatin() and toUtf8()Anton Kudryavtsev2017-03-302-5/+3
| | | | | | | | | | | | | | ... to re-use existing buffers. Change-Id: I7c42529b8cd4400520a59e658ab76f4f8e965cd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use QStringBuilder moreAnton Kudryavtsev2017-03-301-2/+1
| | | | | | | | | | Change-Id: If5283e364e921d99ffa7a8fa1abb07356a4a2682 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Use case-insensitive compare moreAnton Kudryavtsev2017-03-291-1/+1
| | | | | | | | | | | | | | | | ... to avoid allocations. Change-Id: I5993633d1509495ff6ce3a11274a53504aac7c5e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Prefer rvalue versions of toLower() and toUpper()Anton Kudryavtsev2017-03-281-1/+1
| | | | | | | | | | | | | | ... to re-use existing buffers. Change-Id: Ib2bc938f1cf0451c1dbc012b3db022b878e987cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-271-1/+1
|\| | | | | | | Change-Id: Icdd71e9713725bda9c305e338f5c8b41a92ed8e8
| * Fix some warnings found by QNX's compilerThiago Macieira2017-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | -Werror is now disabled for that compiler, but it doesn't hurt to fix. io/qstandardpaths_unix.cpp:149:32: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] qtestcase.cpp:2330:31: error: narrowing conversion of '(ms / 1000)' from 'int' to '_Timet {aka unsigned int}' inside { } [-Werror=narrowing] Change-Id: Id92f4a61915b49ddaee6fffd14aea2c1e686e8f2 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>