diff options
author | David Faure <faure+bluesystems@kde.org> | 2013-01-14 09:34:08 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-14 23:44:15 +0100 |
commit | 7e7b65c370207fa849ac0ec69fe9209f08d8f2e3 (patch) | |
tree | c3e45fa2fcfe34eb5eefdfe6a70aa32eeaa27851 /src/corelib/io/qabstractfileengine.cpp | |
parent | 18c916517f3004d34482c20ed66bf09ec274d385 (diff) |
Add renameOverwrite() to QAbstractFileEngine.
QFSFileEngine::rename() on Windows doesn't overwrite the existing destination.
Keep that unchanged (it's the desired behavior in QFile::rename), and
provide cross-platform rename-overwrite behavior in the new method.
This is needed by QSaveFile.
Change-Id: I5e753d289d8a53692530a48a1783d62e26169cdc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qabstractfileengine.cpp')
-rw-r--r-- | src/corelib/io/qabstractfileengine.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp index d7cf7e3f15..b12dc47c52 100644 --- a/src/corelib/io/qabstractfileengine.cpp +++ b/src/corelib/io/qabstractfileengine.cpp @@ -496,6 +496,24 @@ bool QAbstractFileEngine::rename(const QString &newName) } /*! + \since 5.1 + + Requests that the file be renamed to \a newName in the file + system. If the new name already exists, it must be overwritten. + If the operation succeeds, returns true; otherwise returns + false. + + This virtual function must be reimplemented by all subclasses. + + \sa setFileName() + */ +bool QAbstractFileEngine::renameOverwrite(const QString &newName) +{ + Q_UNUSED(newName); + return false; +} + +/*! Creates a link from the file currently specified by fileName() to \a newName. What a link is depends on the underlying filesystem (be it a shortcut on Windows or a symbolic link on Unix). Returns |