diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2010-01-06 14:57:30 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2010-01-06 15:05:41 (GMT) |
commit | a6eb1a3ef2c897f1ebca01a7d7bd1a073799e737 (patch) | |
tree | 1dc9bd3456b810baaa6cf156ad134163692eb9fc | |
parent | b1327abb777ff3ee7ae32690442ca1250f536054 (diff) | |
download | Qt-a6eb1a3ef2c897f1ebca01a7d7bd1a073799e737.zip Qt-a6eb1a3ef2c897f1ebca01a7d7bd1a073799e737.tar.gz Qt-a6eb1a3ef2c897f1ebca01a7d7bd1a073799e737.tar.bz2 |
Use QFile:rename when moving items in QFileystemModel.
We got for free the recursive move if the directory that we move has
subdirectories. Unfortunately copying a directory to an another is
not easy in Qt so the copy still doesn't work if the directory contains
directories.
Task-number:QTBUG-5855
Reviewed-by:ogoffart
-rw-r--r-- | src/gui/dialogs/qfilesystemmodel.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 21cb737..6ec80a9 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1223,8 +1223,7 @@ bool QFileSystemModel::dropMimeData(const QMimeData *data, Qt::DropAction action case Qt::MoveAction: for (; it != urls.constEnd(); ++it) { QString path = (*it).toLocalFile(); - success = QFile::copy(path, to + QFileInfo(path).fileName()) - && QFile::remove(path) && success; + success = QFile::rename(path, to + QFileInfo(path).fileName()) && success; } break; default: |