diff options
author | Liang Qi <liang.qi@qt.io> | 2016-05-03 15:49:15 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-05-03 15:49:15 +0200 |
commit | 6357813207c866c99aadfd91af8fb3affe891f1d (patch) | |
tree | 69464d415b12ebaa3e57d88d7b5cd113878be988 /src/corelib/io | |
parent | 5a76a3fb03f8d1dc8cb367de1a1dc6a37048376a (diff) | |
parent | b3fcaea5f2b97d3f562add97aee48cbb469c875a (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
configure
src/3rdparty/double-conversion/include/double-conversion/utils.h
src/corelib/global/qnamespace.qdoc
src/corelib/tools/qsimd_p.h
tests/auto/corelib/io/qfile/tst_qfile.cpp
Change-Id: I3ca1007bab5355d251c13002a18e93d81c254d34
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qipaddress.cpp | 3 | ||||
-rw-r--r-- | src/corelib/io/qlockfile_p.h | 3 | ||||
-rw-r--r-- | src/corelib/io/qlockfile_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qprocess.cpp | 6 | ||||
-rw-r--r-- | src/corelib/io/qresource.cpp | 6 | ||||
-rw-r--r-- | src/corelib/io/qsettings_mac.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_mac.mm | 2 |
7 files changed, 16 insertions, 10 deletions
diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp index 13636ebb8b..02b12f635a 100644 --- a/src/corelib/io/qipaddress.cpp +++ b/src/corelib/io/qipaddress.cpp @@ -117,6 +117,9 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL return false; else if (dotCount == 3 || *endptr == '\0') return true; + if (*endptr != '.') + return false; + ++dotCount; ptr = endptr + 1; } diff --git a/src/corelib/io/qlockfile_p.h b/src/corelib/io/qlockfile_p.h index b41b9b4604..d7f2a1d52d 100644 --- a/src/corelib/io/qlockfile_p.h +++ b/src/corelib/io/qlockfile_p.h @@ -81,7 +81,8 @@ public: // Returns \c true if the lock belongs to dead PID, or is old. // The attempt to delete it will tell us if it was really stale or not, though. bool isApparentlyStale() const; - static QString processNameByPid(qint64 pid); + // used in dbusmenu + Q_CORE_EXPORT static QString processNameByPid(qint64 pid); #ifdef Q_OS_UNIX static int checkFcntlWorksAfterFlock(const QString &fn); diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 3455305858..7255414bdc 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -148,6 +148,8 @@ static QBasicMutex fcntlLock; static bool fcntlWorksAfterFlock(const QString &fn) { QMutexLocker lock(&fcntlLock); + if (fcntlOK.isDestroyed()) + return QLockFilePrivate::checkFcntlWorksAfterFlock(fn); bool *worksPtr = fcntlOK->object(fn); if (!worksPtr) { worksPtr = new bool(QLockFilePrivate::checkFcntlWorksAfterFlock(fn)); diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 8b794df6df..439f9fce5a 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2297,8 +2297,7 @@ void QProcess::start(const QString &command, OpenMode mode) return; } - QString prog = args.first(); - args.removeFirst(); + const QString prog = args.takeFirst(); start(prog, args, mode); } @@ -2540,8 +2539,7 @@ bool QProcess::startDetached(const QString &command) if (args.isEmpty()) return false; - QString prog = args.first(); - args.removeFirst(); + const QString prog = args.takeFirst(); return QProcessPrivate::startDetached(prog, args); } diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index ad24b43568..1ead114235 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -1259,8 +1259,10 @@ bool QResourceFileEngine::open(QIODevice::OpenMode flags) } if(flags & QIODevice::WriteOnly) return false; - if(!d->resource.isValid()) - return false; + if (!d->resource.isValid()) { + d->errorString = qt_error_string(ENOENT); + return false; + } return true; } diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp index ceee165459..d73cc4d298 100644 --- a/src/corelib/io/qsettings_mac.cpp +++ b/src/corelib/io/qsettings_mac.cpp @@ -149,7 +149,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value) bool singleton = (values.count() == 1); if (singleton) { - switch (values.first().type()) { + switch (values.constFirst().type()) { // should be same as above (look for LIST) case QVariant::List: case QVariant::StringList: @@ -161,7 +161,7 @@ static QCFType<CFPropertyListRef> macValue(const QVariant &value) } cfkeys[numUniqueKeys] = QCFString::toCFStringRef(key); - cfvalues[numUniqueKeys] = singleton ? macValue(values.first()) : macList(values); + cfvalues[numUniqueKeys] = singleton ? macValue(values.constFirst()) : macList(values); ++numUniqueKeys; } diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm index 33c34d41af..f08a6dac53 100644 --- a/src/corelib/io/qstandardpaths_mac.mm +++ b/src/corelib/io/qstandardpaths_mac.mm @@ -273,7 +273,7 @@ QString QStandardPaths::displayName(StandardLocation type) return QCoreApplication::translate("QStandardPaths", "Applications"); if (QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - standardLocations(type).first().toCFString(), + standardLocations(type).constFirst().toCFString(), kCFURLPOSIXPathStyle, true)) { QCFString name; CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL); |