summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-08-05 08:39:53 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-08-17 15:52:21 (GMT)
commit63bb67d3107b03f399cddf4c9cca9c7eb347b62d (patch)
treed3f367fd409d23d11ab07a2217d57dae15b4e3ec /src
parentd69788728ccd843e3d4a372680185fdf5e711c86 (diff)
downloadQt-63bb67d3107b03f399cddf4c9cca9c7eb347b62d.zip
Qt-63bb67d3107b03f399cddf4c9cca9c7eb347b62d.tar.gz
Qt-63bb67d3107b03f399cddf4c9cca9c7eb347b62d.tar.bz2
Make Symbian follow Windows code in temporary path generation
On the one hand, we stop using OpenC here. On the other, we no longer use an atomic create and obtain file handle API -- just as we don't on Windows yet. This is a stepping stone to removing back and forth conversions of path names when generating unique names and also towards the use of native APIs for creating and obtaining a file handle atomically. Reviewed-by: Gareth Stockwell Reviewed-by: Shane Kearns
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qtemporaryfile.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 9228f94..497faad 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -49,12 +49,9 @@
#include "private/qabstractfileengine_p.h"
#include "private/qfsfileengine_p.h"
-#if !defined(Q_OS_WINCE)
-# include <errno.h>
-#endif
-
-#if defined(Q_OS_UNIX)
-# include "private/qcore_unix_p.h" // overrides QT_OPEN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
+#include "private/qcore_unix_p.h" // overrides QT_OPEN
+#include <errno.h>
#endif
#if defined(QT_BUILD_CORE_LIB)
@@ -136,7 +133,7 @@ static int createFileFromTemplate(QByteArray &path, size_t pos, size_t length)
for (;;) {
// Atomically create file and obtain handle
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
{
int fd = QT_OPEN(path.constData(),
QT_OPEN_CREAT | O_EXCL | QT_OPEN_RDWR | QT_OPEN_LARGEFILE,
@@ -303,7 +300,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
int fd = createFileFromTemplate(filename, phPos, phLength);
-#ifndef Q_OS_WIN
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
if (fd != -1) {
// First open the fd as an external file descriptor to
// initialize the engine properly.