summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qbuffer.cpp17
-rw-r--r--src/corelib/io/qprocess.cpp11
-rw-r--r--src/corelib/tools/qpoint.h6
3 files changed, 10 insertions, 24 deletions
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index 38e406b1a4..35e7b6809c 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -333,23 +333,18 @@ bool QBuffer::open(OpenMode flags)
{
Q_D(QBuffer);
- if ((flags & Append) == Append)
+ if ((flags & (Append | Truncate)) != 0)
flags |= WriteOnly;
- setOpenMode(flags);
- if (!(isReadable() || isWritable())) {
- qWarning("QFile::open: File access not specified");
+ if ((flags & (ReadOnly | WriteOnly)) == 0) {
+ qWarning("QBuffer::open: Buffer access not specified");
return false;
}
- if ((flags & QIODevice::Truncate) == QIODevice::Truncate) {
+ if ((flags & Truncate) == Truncate)
d->buf->resize(0);
- }
- if ((flags & QIODevice::Append) == QIODevice::Append) // append to end of buffer
- seek(d->buf->size());
- else
- seek(0);
+ d->ioIndex = (flags & Append) == Append ? d->buf->size() : 0;
- return true;
+ return QIODevice::open(flags);
}
/*!
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index a14c4fdc7d..ddbbbd5286 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1673,13 +1673,10 @@ QProcessEnvironment QProcess::processEnvironment() const
bool QProcess::waitForStarted(int msecs)
{
Q_D(QProcess);
- if (d->processState == QProcess::Starting) {
- if (!d->waitForStarted(msecs))
- return false;
- setProcessState(QProcess::Running);
- emit started();
- }
- return d->processState == QProcess::Running;
+ if (d->processState == QProcess::Running)
+ return true;
+
+ return d->waitForStarted(msecs);
}
/*! \reimp
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index c0cf2192c1..b394ece1a6 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -92,14 +92,8 @@ public:
private:
friend class QTransform;
- // ### Qt 5; remove the ifdef and just have the same order on all platforms.
-#if defined(Q_OS_MAC)
- int yp;
- int xp;
-#else
int xp;
int yp;
-#endif
};
Q_DECLARE_TYPEINFO(QPoint, Q_MOVABLE_TYPE);