From a6eb1a3ef2c897f1ebca01a7d7bd1a073799e737 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 6 Jan 2010 15:57:30 +0100 Subject: 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 --- src/gui/dialogs/qfilesystemmodel.cpp | 3 +-- 1 file changed, 1 insertion(+), 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: -- cgit v0.12