diff options
author | Andy Shaw <andy.shaw@digia.com> | 2013-04-15 13:18:11 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-18 09:18:43 +0200 |
commit | 9ec493fa41d06a618d3983c02d9a1141d9d306df (patch) | |
tree | fb04a858135a412590d07a1967b45ba1fb7ffa9a /src | |
parent | eb95685556143eb71323742bfcdaa20541b01375 (diff) |
Convert the new filename to native separators before checking it
If a native separator was put in the new name when renaming a file name
via the file dialog then it would correctly fail. But if a non-native
one was used on Windows then it would cause the file to be moved
instead if the directory existed.
Change-Id: If01760b8c54a69b600c9a44c7509017be70d33e3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 9556c0ed15..8e3ecc3e0e 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -850,7 +850,7 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in return true; if (newName.isEmpty() - || newName.contains(QDir::separator()) + || QDir::toNativeSeparators(newName).contains(QDir::separator()) || !QDir(filePath(parent(idx))).rename(oldName, newName)) { #ifndef QT_NO_MESSAGEBOX QMessageBox::information(0, QFileSystemModel::tr("Invalid filename"), |