summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc9
-rw-r--r--src/corelib/io/qfile.cpp2
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h3
-rw-r--r--src/corelib/io/qprocess_win.cpp18
-rw-r--r--src/corelib/thread/qmutex_unix.cpp28
-rw-r--r--src/corelib/tools/qelapsedtimer_win.cpp6
-rw-r--r--src/corelib/tools/qline.cpp5
-rw-r--r--src/corelib/tools/qlist.cpp2
-rw-r--r--src/corelib/tools/qlocale.qdoc1
-rw-r--r--src/corelib/tools/qpoint.cpp9
-rw-r--r--src/corelib/tools/qset.qdoc1
-rw-r--r--src/corelib/tools/qstring.cpp3
-rw-r--r--src/corelib/xml/qxmlstream.cpp5
14 files changed, 67 insertions, 26 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 99479d0..e247533 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -546,6 +546,7 @@ public:
AA_S60DontConstructApplicationPanes = 8,
AA_S60DisablePartialScreenInputMode = 9,
AA_X11InitThreads = 10,
+ AA_CaptureMultimediaKeys = 11,
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index ad9e113..dc92866 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -171,6 +171,15 @@
construction in order to make Xlib calls thread-safe. This
attribute must be set before QApplication is constructed.
+ \value AA_CaptureMultimediaKeys Enables application to receive multimedia key events
+ (play, next, previous etc). This includes also external sources such as headsets.
+ Application can not use Remote Control framework on Symbian if this attribute is
+ set. On Symbian, multimedia key event routing may vary between different devices.
+ For example, application on background may receive multimedia key events only if
+ it has active audio stream i.e. it is playing music or video. This attribute must
+ be set before QApplication is constructed. This attribute is only supported in Symbian
+ platform.
+
\omitvalue AA_AttributeCount
*/
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 66edf58..929b2f9 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -358,6 +358,7 @@ QFilePrivate::setError(QFile::FileError err, int errNum)
/*!
\enum QFile::FileHandleFlag
+ \since 4.8
This enum is used when opening a file to specify additional
options which only apply to files and not to a generic
@@ -1657,6 +1658,7 @@ bool QFile::atEnd() const
/*!
\fn bool QFile::seek(qint64 pos)
+ \since 4.8
For random-access devices, this function sets the current position
to \a pos, returning true on success, or false if an error occurred.
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index c961101..de5b003 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -369,8 +369,7 @@ inline void QFileSystemMetaData::fillFromFindData(WIN32_FIND_DATA &findData, boo
entryFlags &= ~LinkType;
#if !defined(Q_OS_WINCE)
if ((fileAttribute_ & FILE_ATTRIBUTE_REPARSE_POINT)
- && (findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK
- || findData.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT)) {
+ && (findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) {
entryFlags |= LinkType;
}
#endif
diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp
index 1761c0e..510f723 100644
--- a/src/corelib/io/qprocess_win.cpp
+++ b/src/corelib/io/qprocess_win.cpp
@@ -46,6 +46,7 @@
#include <qdatetime.h>
#include <qdir.h>
#include <qfileinfo.h>
+#include <qregexp.h>
#include <qtimer.h>
#include <qthread.h>
#include <qmutex.h>
@@ -256,24 +257,19 @@ static QString qt_create_commandline(const QString &program, const QStringList &
for (int i=0; i<arguments.size(); ++i) {
QString tmp = arguments.at(i);
- // in the case of \" already being in the string the \ must also be escaped
- tmp.replace( QLatin1String("\\\""), QLatin1String("\\\\\"") );
- // escape a single " because the arguments will be parsed
- tmp.replace( QLatin1Char('\"'), QLatin1String("\\\"") );
+ // Quotes are escaped and their preceding backslashes are doubled.
+ tmp.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\""));
if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) {
// The argument must not end with a \ since this would be interpreted
// as escaping the quote -- rather put the \ behind the quote: e.g.
// rather use "foo"\ than "foo\"
- QString endQuote(QLatin1Char('\"'));
int i = tmp.length();
- while (i>0 && tmp.at(i-1) == QLatin1Char('\\')) {
+ while (i > 0 && tmp.at(i - 1) == QLatin1Char('\\'))
--i;
- endQuote += QLatin1Char('\\');
- }
- args += QLatin1String(" \"") + tmp.left(i) + endQuote;
- } else {
- args += QLatin1Char(' ') + tmp;
+ tmp.insert(i, QLatin1Char('"'));
+ tmp.prepend(QLatin1Char('"'));
}
+ args += QLatin1Char(' ') + tmp;
}
return args;
}
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index 12bc795..e692e19 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -60,6 +60,7 @@
# include <linux/futex.h>
# include <sys/syscall.h>
# include <unistd.h>
+# include <QtCore/qelapsedtimer.h>
#endif
QT_BEGIN_NAMESPACE
@@ -138,16 +139,31 @@ static inline int _q_futex(volatile int *addr, int op, int val, const struct tim
bool QMutexPrivate::wait(int timeout)
{
+ struct timespec ts, *pts = 0;
+ QElapsedTimer timer;
+ if (timeout >= 0) {
+ ts.tv_nsec = ((timeout % 1000) * 1000) * 1000;
+ ts.tv_sec = (timeout / 1000);
+ pts = &ts;
+ timer.start();
+ }
while (contenders.fetchAndStoreAcquire(2) > 0) {
- struct timespec ts, *pts = 0;
- if (timeout >= 0) {
- ts.tv_nsec = ((timeout % 1000) * 1000) * 1000;
- ts.tv_sec = (timeout / 1000);
- pts = &ts;
- }
int r = _q_futex(&contenders._q_value, FUTEX_WAIT, 2, pts, 0, 0);
if (r != 0 && errno == ETIMEDOUT)
return false;
+
+ if (pts) {
+ // recalculate the timeout
+ qint64 xtimeout = timeout * 1000 * 1000;
+ xtimeout -= timer.nsecsElapsed();
+ if (xtimeout < 0) {
+ // timer expired after we returned
+ return false;
+ }
+
+ ts.tv_sec = timeout / Q_INT64_C(1000) / 1000 / 1000;
+ ts.tv_nsec = timeout % (Q_INT64_C(1000) * 1000 * 1000);
+ }
}
return true;
}
diff --git a/src/corelib/tools/qelapsedtimer_win.cpp b/src/corelib/tools/qelapsedtimer_win.cpp
index cd076a6..d79dc5d 100644
--- a/src/corelib/tools/qelapsedtimer_win.cpp
+++ b/src/corelib/tools/qelapsedtimer_win.cpp
@@ -42,14 +42,14 @@
#include "qelapsedtimer.h"
#include <windows.h>
-// Result of QueryPerformanceFrequency, 0 indicates that the high resolution timer is unavailable
-static quint64 counterFrequency = 0;
-
typedef ULONGLONG (WINAPI *PtrGetTickCount64)(void);
static PtrGetTickCount64 ptrGetTickCount64 = 0;
QT_BEGIN_NAMESPACE
+// Result of QueryPerformanceFrequency, 0 indicates that the high resolution timer is unavailable
+static quint64 counterFrequency = 0;
+
static void resolveLibs()
{
static bool done = false;
diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp
index af3b7d5..0f67652 100644
--- a/src/corelib/tools/qline.cpp
+++ b/src/corelib/tools/qline.cpp
@@ -564,8 +564,9 @@ qreal QLineF::length() const
Returns the angle of the line in degrees.
- Positive values for the angles mean counter-clockwise while negative values
- mean the clockwise direction. Zero degrees is at the 3 o'clock position.
+ The return value will be in the range of values from 0.0 up to but not
+ including 360.0. The angles are measured counter-clockwise from a point
+ on the x-axis to the right of the origin (x > 0).
\sa setAngle()
*/
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 36a9c60..e68ddd5 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -237,7 +237,7 @@ void **QListData::append(int n)
if (b - n >= 2 * d->alloc / 3) {
// we have enough space. Just not at the end -> move it.
e -= b;
- ::memcpy(d->array, d->array + b, e * sizeof(void *));
+ ::memmove(d->array, d->array + b, e * sizeof(void *));
d->begin = 0;
} else {
realloc(grow(d->alloc + n));
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index fd139c3..5d4f305 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -608,6 +608,7 @@
/*!
\enum QLocale::Script
+ \since 4.8
This enumerated type is used to specify a script.
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp
index bd32fe7..ae6ed71 100644
--- a/src/corelib/tools/qpoint.cpp
+++ b/src/corelib/tools/qpoint.cpp
@@ -188,6 +188,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QPoint &QPoint::operator*=(float factor)
+ \since 4.8
Multiplies this point's coordinates by the given \a factor, and
returns a reference to this point.
@@ -200,6 +201,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QPoint &QPoint::operator*=(double factor)
+ \since 4.8
Multiplies this point's coordinates by the given \a factor, and
returns a reference to this point. For example:
@@ -214,6 +216,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QPoint &QPoint::operator*=(int factor)
+ \since 4.8
Multiplies this point's coordinates by the given \a factor, and
returns a reference to this point.
@@ -259,6 +262,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn const QPoint operator*(const QPoint &point, float factor)
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
@@ -271,6 +275,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn const QPoint operator*(const QPoint &point, double factor)
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
@@ -283,6 +288,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn const QPoint operator*(const QPoint &point, int factor)
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
@@ -293,6 +299,7 @@ QT_BEGIN_NAMESPACE
\fn const QPoint operator*(float factor, const QPoint &point)
\overload
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
*/
@@ -301,6 +308,7 @@ QT_BEGIN_NAMESPACE
\fn const QPoint operator*(double factor, const QPoint &point)
\overload
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
*/
@@ -309,6 +317,7 @@ QT_BEGIN_NAMESPACE
\fn const QPoint operator*(int factor, const QPoint &point)
\overload
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
*/
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index f562c68..31129e0 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -124,6 +124,7 @@
/*!
\fn void QSet::swap(QSet<T> &other)
+ \since 4.8
Swaps set \a other with this set. This operation is very fast and
never fails.
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index c303c00..f5efe55 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -837,18 +837,21 @@ int QString::grow(int size)
/*!
\typedef QString::const_reference
+ \since 4.8
The QString::const_reference typedef provides an STL-style
const reference for QString.
*/
/*!
\typedef QString::reference
+ \since 4.8
The QString::const_reference typedef provides an STL-style
reference for QString.
*/
/*!
\typedef QString::value_type
+ \since 4.8
The QString::const_reference typedef provides an STL-style
value type for QString.
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index caaffd3..9682688 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3381,7 +3381,10 @@ int QXmlStreamWriter::autoFormattingIndent() const
}
/*!
- Returns \c true if the stream failed to write to the underlying device.
+ \since 4.8
+
+ Returns true if the stream failed to write to the underlying device;
+ otherwise returns false.
The error status is never reset. Writes happening after the error
occurred are ignored, even if the error condition is cleared.