summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2010-10-06 10:45:03 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2010-10-07 13:36:03 (GMT)
commit3f8476b9d7dc6bf45db5c3e959d7bc045099cd08 (patch)
treed7f8aee7f126a44d80d2a7d61c6ad6de60506954 /src/corelib
parent36dff2ee879021bbb0d2f1ca8826088a1969e8f0 (diff)
downloadQt-3f8476b9d7dc6bf45db5c3e959d7bc045099cd08.zip
Qt-3f8476b9d7dc6bf45db5c3e959d7bc045099cd08.tar.gz
Qt-3f8476b9d7dc6bf45db5c3e959d7bc045099cd08.tar.bz2
Implement error reporting for QFile position and size functions
Reviewed-By: Thomas Zander
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index acb58a5..f5d40f1 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -518,6 +518,7 @@ qint64 QFSFileEnginePrivate::nativeWrite(const char *data, qint64 len)
qint64 QFSFileEnginePrivate::nativePos() const
{
#ifdef Q_OS_SYMBIAN
+ const Q_Q(QFSFileEngine);
if (symbianFile.SubSessionHandle()) {
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
qint64 pos = 0;
@@ -526,8 +527,7 @@ qint64 QFSFileEnginePrivate::nativePos() const
#endif
TInt err = symbianFile.Seek(ESeekCurrent, pos);
if(err != KErrNone) {
- //TODO: error reporting
- //setSymbianError(err, QFile::PositionError, QLatin1String("seek failed"));
+ const_cast<QFSFileEngine*>(q)->setError(QFile::PositionError, QFileSystemEngine::errorString(err));
return -1;
}
return pos;
@@ -635,6 +635,7 @@ bool QFSFileEngine::link(const QString &newName)
qint64 QFSFileEnginePrivate::nativeSize() const
{
#ifdef Q_OS_SYMBIAN
+ const Q_Q(QFSFileEngine);
if (symbianFile.SubSessionHandle()) {
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
qint64 size;
@@ -643,7 +644,7 @@ qint64 QFSFileEnginePrivate::nativeSize() const
#endif
TInt err = symbianFile.Size(size);
if(err != KErrNone) {
- //TODO: error reporting
+ const_cast<QFSFileEngine*>(q)->setError(QFile::PositionError, QFileSystemEngine::errorString(err));
return 0;
}
return size;