diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-29 12:55:54 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-07-18 15:51:35 +0000 |
commit | ad3b41a06d9ba7219c79b5548c5b11698787288d (patch) | |
tree | 557d65faed341e73d8fded4dede9ba70a1c1496e /src/corelib/io/qfsfileengine_unix.cpp | |
parent | f9bfc8b91cd8ea755808751ab6268e37ffd6c17a (diff) |
QFile::rename: use the open file's ID, instead of using the file name
To do that, we needed to add virtual id() in QAbstractFileEngine and
override it in QFSFileEngine. It might be useful to return other types
of IDs for the other file engines, but this commit does not attempt that
just yet.
Change-Id: I1eba2b016de74620bfc8fffd14ccafe0762b3c38
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfsfileengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfsfileengine_unix.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 3f4f593d81..c613368a91 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -596,6 +596,14 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const return ret; } +QByteArray QFSFileEngine::id() const +{ + Q_D(const QFSFileEngine); + if (d->fd != -1) + return QFileSystemEngine::id(d->fd); + return QFileSystemEngine::id(d->fileEntry); +} + QString QFSFileEngine::fileName(FileName file) const { Q_D(const QFSFileEngine); |