summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-03-11 09:15:55 (GMT)
committeraxis <qt-info@nokia.com>2010-03-11 09:42:47 (GMT)
commita375537d32bc33ba1154ec132f99f5a779bce067 (patch)
tree3c23e3b2c44fb52d7d62036fe7dd793e589841e8 /src/corelib/io
parent02f6da62a42bd1059eb0da091d1f46efbb919750 (diff)
parent1e9552f826c05bf9884fb2893dedca265ead363b (diff)
downloadQt-a375537d32bc33ba1154ec132f99f5a779bce067.zip
Qt-a375537d32bc33ba1154ec132f99f5a779bce067.tar.gz
Qt-a375537d32bc33ba1154ec132f99f5a779bce067.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public
Conflicts: mkspecs/common/symbian/symbian.conf qmake/generators/makefile.h qmake/project.cpp src/3rdparty/webkit/WebCore/WebCore.pro src/src.pro
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qdatastream.h1
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp13
-rw-r--r--src/corelib/io/qfsfileengine.cpp3
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp10
-rw-r--r--src/corelib/io/qprocess_symbian.cpp2
-rw-r--r--src/corelib/io/qtextstream.cpp3
-rw-r--r--src/corelib/io/qurl.cpp13
-rw-r--r--src/corelib/io/qurl.h4
8 files changed, 44 insertions, 5 deletions
diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h
index ec4ba2f..222ba8f 100644
--- a/src/corelib/io/qdatastream.h
+++ b/src/corelib/io/qdatastream.h
@@ -243,6 +243,7 @@ QDataStream& operator>>(QDataStream& s, QList<T>& l)
l.clear();
quint32 c;
s >> c;
+ l.reserve(c);
for(quint32 i = 0; i < c; ++i)
{
T t;
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index 54ae24e..d3276bd 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -171,6 +171,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
stop();
+ wait();
QMutexLocker locker(&mutex);
QStringList failedToAdd;
// if we have a running FSStreamEvent, we have to kill it, we'll re-add the stream soon.
@@ -268,6 +269,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
stop();
+ wait();
QMutexLocker locker(&mutex);
// short circuit for smarties that call remove before add and we have nothing.
if (pathsToWatch == 0)
@@ -445,7 +447,16 @@ void QFSEventsFileSystemWatcherEngine::updateFiles()
updateHash(dirPathInfoHash);
if (filePathInfoHash.isEmpty() && dirPathInfoHash.isEmpty()) {
// Everything disappeared before we got to start, don't bother.
- stop();
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ // Code duplicated from stop(), with the exception that we
+ // don't wait on waitForStop here. Doing this will lead to
+ // a deadlock since this function is called from the worker
+ // thread. (waitForStop.wakeAll() is only called from the
+ // end of run()).
+ stopFSStream(fsStream);
+ if (threadsRunLoop)
+ CFRunLoopStop(threadsRunLoop);
+#endif
cleanupFSStream(fsStream);
}
waitCondition.wakeAll();
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 1672dfc..070edb4 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -147,6 +147,8 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
return path;
#endif
#if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN) || defined(Q_OS_MAC)
+ // ... but Linux with uClibc does not have it
+#if !defined(__UCLIBC__)
char *ret = 0;
#if defined(Q_OS_MAC)
// Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here.
@@ -173,6 +175,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
return canonicalPath;
}
#endif
+#endif
QFileInfo fi;
const QChar slash(QLatin1Char('/'));
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index dced3e7..61a4af8 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -668,6 +668,16 @@ bool QFSFileEnginePrivate::doStat() const
could_stat = (QT_FSTAT(QT_FILENO(fh), &st) == 0);
} else if (fd == -1) {
// ### actually covers two cases: d->fh and when the file is not open
+#if defined(Q_OS_SYMBIAN)
+ // Optimisation for Symbian where fileFlags() calls both doStat() and isSymlink(), but rarely on real links.
+ // When the filename is not a link, lstat will return the same info as stat, but this also removes
+ // any need for a further call to lstat to check if the file is a link.
+ need_lstat = false;
+ could_stat = (QT_LSTAT(nativeFilePath.constData(), &st) == 0);
+ is_link = could_stat ? S_ISLNK(st.st_mode) : false;
+ // if it turns out this was a link, we can call stat too.
+ if (is_link)
+#endif
could_stat = (QT_STAT(nativeFilePath.constData(), &st) == 0);
} else {
could_stat = (QT_FSTAT(fd, &st) == 0);
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index 34491d0..8902f7d 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -371,6 +371,7 @@ QProcessActive::QProcessActive()
// Called from ProcessManagerThread
QProcessActive::~QProcessActive()
{
+ Cancel();
process = NULL;
pproc = NULL;
}
@@ -477,6 +478,7 @@ QProcessManagerMediator::QProcessManagerMediator()
// Called from ProcessManagerThread
QProcessManagerMediator::~QProcessManagerMediator()
{
+ Cancel();
processManagerThread.Close();
currentCommand = ENoCommand;
currentObserver = NULL;
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 9e79894..b1c403f 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -70,7 +70,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
have reached the end of the data stream, with stdin. The reason for this is
that as long as stdin doesn't give any input to the QTextStream, \c atEnd()
will return true even if the stdin is open and waiting for more characters.
-
+
Besides using QTextStream's constructors, you can also set the
device or string QTextStream operates on by calling setDevice() or
setString(). You can seek to a position by calling seek(), and
@@ -1196,6 +1196,7 @@ bool QTextStream::seek(qint64 pos)
resetCodecConverterStateHelper(&d->writeConverterState);
delete d->readConverterSavedState;
d->readConverterSavedState = 0;
+ d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
#endif
return true;
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index acb73fd..a60f206 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -167,6 +167,13 @@
regardless of the Qt::FormattingOptions used.
*/
+/*!
+ \fn uint qHash(const QUrl &url)
+ \since 4.7
+ \relates QUrl
+
+ Computes a hash key from the normalized version of \a url.
+ */
#include "qplatformdefs.h"
#include "qurl.h"
#include "private/qunicodetables_p.h"
@@ -3472,8 +3479,12 @@ QString QUrlPrivate::authority(QUrl::FormattingOptions options) const
void QUrlPrivate::setAuthority(const QString &auth)
{
- if (auth.isEmpty())
+ if (auth.isEmpty()) {
+ setUserInfo(QString());
+ host.clear();
+ port = -1;
return;
+ }
// find the port section of the authority by searching from the
// end towards the beginning for numbers until a ':' is reached.
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 906979c..6f8331a 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -270,9 +270,9 @@ public:
inline DataPtr &data_ptr() { return d; }
};
-inline uint qHash(const QUrl &uri)
+inline uint qHash(const QUrl &url)
{
- return qHash(uri.toEncoded(QUrl::FormattingOption(0x100)));
+ return qHash(url.toEncoded(QUrl::FormattingOption(0x100)));
}
Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE);