summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qdatastream.cpp16
-rw-r--r--src/corelib/io/qfileinfo.cpp2
-rw-r--r--src/corelib/io/qfileinfo_p.h8
-rw-r--r--src/corelib/io/qprocess.cpp37
4 files changed, 31 insertions, 32 deletions
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index 484dcbf22e..da38f8ae21 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -817,8 +817,12 @@ QDataStream &QDataStream::operator>>(double &f)
Reads the '\\0'-terminated string \a s from the stream and returns
a reference to the stream.
- Space for the string is allocated using \c new -- the caller must
- destroy it with \c{delete[]}.
+ The string is deserialized using \c{readBytes()}.
+
+ Space for the string is allocated using \c{new []} -- the caller must
+ destroy it with \c{delete []}.
+
+ \sa readBytes(), readRawData()
*/
QDataStream &QDataStream::operator>>(char *&s)
@@ -832,8 +836,8 @@ QDataStream &QDataStream::operator>>(char *&s)
Reads the buffer \a s from the stream and returns a reference to
the stream.
- The buffer \a s is allocated using \c new. Destroy it with the \c
- delete[] operator.
+ The buffer \a s is allocated using \c{new []}. Destroy it with the
+ \c{delete []} operator.
The \a l parameter is set to the length of the buffer. If the
string read is empty, \a l is set to 0 and \a s is set to
@@ -1102,7 +1106,9 @@ QDataStream &QDataStream::operator<<(double f)
Writes the '\\0'-terminated string \a s to the stream and returns a
reference to the stream.
- The string is serialized using writeBytes().
+ The string is serialized using \c{writeBytes()}.
+
+ \sa writeBytes(), writeRawData()
*/
QDataStream &QDataStream::operator<<(const char *s)
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 7fcb4154f2..addcd772ab 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -187,6 +187,8 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const
{
Q_ASSERT(fileEngine); // should never be called when using the native FS
+ if (fileTimes.size() != 3)
+ fileTimes.resize(3);
if (!cache_enabled)
clearFlags();
uint cf;
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 1b254f6e85..442e6b5ef0 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -58,6 +58,7 @@
#include "qatomic.h"
#include "qshareddata.h"
#include "qfilesystemengine_p.h"
+#include "qvector.h"
#include <QtCore/private/qabstractfileengine_p.h>
#include <QtCore/private/qfilesystementry_p.h>
@@ -152,7 +153,12 @@ public:
bool cache_enabled : 1;
mutable uint fileFlags;
mutable qint64 fileSize;
- mutable QDateTime fileTimes[3];
+ // ### Qt6: FIXME: This vector is essentially a plain array
+ // mutable QDateTime fileTimes[3], but the array is slower
+ // to initialize than the QVector as QDateTime has a pimpl.
+ // In Qt 6, QDateTime should inline its data members,
+ // and this here can be an array again.
+ mutable QVector<QDateTime> fileTimes;
inline bool getCachedFlag(uint c) const
{ return cache_enabled ? (cachedFlags & c) : 0; }
inline void setCachedFlag(uint c) const
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 3993cf5002..59b6db7c79 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -125,16 +125,15 @@ QT_BEGIN_NAMESPACE
The environment of the calling process can be obtained using
QProcessEnvironment::systemEnvironment().
- On Unix systems, the variable names are case-sensitive. For that reason,
- this class will not touch the names of the variables. Note as well that
+ On Unix systems, the variable names are case-sensitive. Note that the
Unix environment allows both variable names and contents to contain arbitrary
- binary data (except for the NUL character), but this is not supported by
- QProcessEnvironment. This class only supports names and values that are
- encodable by the current locale settings (see QTextCodec::codecForLocale).
+ binary data (except for the NUL character). QProcessEnvironment will preserve
+ such variables, but does not support manipulating variables whose names or
+ values are not encodable by the current locale settings (see
+ QTextCodec::codecForLocale).
- On Windows, the variable names are case-insensitive. Therefore,
- QProcessEnvironment will always uppercase the names and do case-insensitive
- comparisons.
+ On Windows, the variable names are case-insensitive, but case-preserving.
+ QProcessEnvironment behaves accordingly.
On Windows CE, the concept of environment does not exist. This class will
keep the values set for compatibility with other platforms, but the values
@@ -298,9 +297,6 @@ void QProcessEnvironment::clear()
Returns true if the environment variable of name \a name is found in
this QProcessEnvironment object.
- On Windows, variable names are case-insensitive, so the key is converted
- to uppercase before searching. On other systems, names are case-sensitive
- so no trasformation is applied.
\sa insert(), value()
*/
@@ -314,10 +310,6 @@ bool QProcessEnvironment::contains(const QString &name) const
into this QProcessEnvironment object. If that variable already existed,
it is replaced by the new value.
- On Windows, variable names are case-insensitive, so this function always
- uppercases the variable name before inserting. On other systems, names
- are case-sensitive, so no transformation is applied.
-
On most systems, inserting a variable with no contents will have the
same effect for applications as if the variable had not been set at all.
However, to guarantee that there are no incompatibilities, to remove a
@@ -336,9 +328,6 @@ void QProcessEnvironment::insert(const QString &name, const QString &value)
QProcessEnvironment object. If that variable did not exist before,
nothing happens.
- On Windows, variable names are case-insensitive, so the key is converted
- to uppercase before searching. On other systems, names are case-sensitive
- so no trasformation is applied.
\sa contains(), insert(), value()
*/
@@ -353,10 +342,6 @@ void QProcessEnvironment::remove(const QString &name)
\a name and returns its value. If the variable is not found in this object,
then \a defaultValue is returned instead.
- On Windows, variable names are case-insensitive, so the key is converted
- to uppercase before searching. On other systems, names are case-sensitive
- so no trasformation is applied.
-
\sa contains(), insert(), remove()
*/
QString QProcessEnvironment::value(const QString &name, const QString &defaultValue) const
@@ -376,10 +361,10 @@ QString QProcessEnvironment::value(const QString &name, const QString &defaultVa
each environment variable that is set. The environment variable's name
and its value are separated by an equal character ('=').
- The QStringList contents returned by this function are suitable for use
- with the QProcess::setEnvironment function. However, it is recommended
- to use QProcess::setProcessEnvironment instead since that will avoid
- unnecessary copying of the data.
+ The QStringList contents returned by this function are suitable for
+ presentation.
+ Use with the QProcess::setEnvironment function is not recommended due to
+ potential encoding problems under Unix, and worse performance.
\sa systemEnvironment(), QProcess::systemEnvironment(), QProcess::environment(),
QProcess::setEnvironment()