diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2009-08-21 12:52:05 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@trolltech.com> | 2009-08-21 13:10:31 (GMT) |
commit | 48758257c77ab6698e8f11b1d7acfdaa93158054 (patch) | |
tree | a0dfb7105dda2c0f97f7650e1937c66ecf1531e1 /src/corelib/io/qfile.cpp | |
parent | bc58c9d33c3e333dd51f2aa60fd4bdcb296b2649 (diff) | |
download | Qt-48758257c77ab6698e8f11b1d7acfdaa93158054.zip Qt-48758257c77ab6698e8f11b1d7acfdaa93158054.tar.gz Qt-48758257c77ab6698e8f11b1d7acfdaa93158054.tar.bz2 |
QFile: use fileEngine's errorString() instead of errno/GetLastError()
QFile behaves like wrapper for file engine in most operations, so
proper error reporting must be implemented in file engine backends.
Merge-request: 833
Reviewed-by: Joerg Bornemann <joerg.bornemann@trolltech.com>
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r-- | src/corelib/io/qfile.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index aa704d3..daadad7 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -52,10 +52,6 @@ # include "qcoreapplication.h" #endif -#if !defined(Q_OS_WINCE) -#include <errno.h> -#endif - #ifdef QT_NO_QOBJECT #define tr(X) QString::fromLatin1(X) #endif @@ -654,11 +650,7 @@ QFile::remove() unsetError(); return true; } -#if defined(Q_OS_WIN) - d->setError(QFile::RemoveError, GetLastError()); -#else - d->setError(QFile::RemoveError, errno); -#endif + d->setError(QFile::RemoveError, fileEngine()->errorString()); } return false; } @@ -809,7 +801,7 @@ QFile::link(const QString &linkName) unsetError(); return true; } - d->setError(QFile::RenameError, errno); + d->setError(QFile::RenameError, fileEngine()->errorString()); return false; } @@ -1255,7 +1247,7 @@ QFile::resize(qint64 sz) unsetError(); return true; } - d->setError(QFile::ResizeError, errno); + d->setError(QFile::ResizeError, fileEngine()->errorString()); return false; } @@ -1319,7 +1311,7 @@ QFile::setPermissions(Permissions permissions) unsetError(); return true; } - d->setError(QFile::PermissionsError, errno); + d->setError(QFile::PermissionsError, fileEngine()->errorString()); return false; } |