summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-05-03 17:03:26 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-05-03 18:58:24 +0000
commit69c2a606b36858454ec0b53b5d9789cf8e524806 (patch)
tree86a97816b5e4bf4be5937774f5b8fd2a126b8086 /src/corelib/io
parent224db5e6eb07154ba2e974a96ee617bf7d740134 (diff)
parent6357813207c866c99aadfd91af8fb3affe891f1d (diff)
Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qipaddress.cpp3
-rw-r--r--src/corelib/io/qlockfile_p.h3
-rw-r--r--src/corelib/io/qlockfile_unix.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp6
-rw-r--r--src/corelib/io/qresource.cpp6
-rw-r--r--src/corelib/io/qsettings_mac.cpp4
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm2
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);