summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorRohan McGovern <rohan@mcgovern.id.au>2010-03-06 23:44:26 (GMT)
committerRohan McGovern <rohan@mcgovern.id.au>2010-03-06 23:44:26 (GMT)
commitad341d612129287793620bc84d3077afd64f97a4 (patch)
tree3d62b038c34985046ad1f3ff56c1c4e85a194ed2 /src/corelib/io
parentb20ef0ade0aec89b969bd0ae7f754c680e390c67 (diff)
parent2458cb45665b0fe3144266122f876bd541de9c42 (diff)
downloadQt-ad341d612129287793620bc84d3077afd64f97a4.zip
Qt-ad341d612129287793620bc84d3077afd64f97a4.tar.gz
Qt-ad341d612129287793620bc84d3077afd64f97a4.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: configure.exe examples/multimedia/audioinput/audioinput.cpp src/corelib/io/qfsfileengine.cpp src/gui/egl/qegl_wince.cpp src/gui/egl/qeglproperties.cpp src/gui/egl/qeglproperties_p.h src/gui/embedded/directfb.pri src/gui/kernel/qapplication_win.cpp src/gui/painting/qdrawutil.cpp src/opengl/qgl_p.h src/sql/drivers/odbc/qsql_odbc.cpp src/sql/drivers/odbc/qsql_odbc.h tests/auto/auto.pro tests/auto/qgl/tst_qgl.cpp translations/assistant_adp_ru.ts
Diffstat (limited to 'src/corelib/io')
-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
3 files changed, 15 insertions, 0 deletions
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 d2fa744..1331f54 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 07d10ad..adc87fb 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;