diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-10-23 12:22:58 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-23 19:09:54 +0200 |
commit | 7e30d3afd35cd24b8888d6f392330c3afa69cb81 (patch) | |
tree | 63ebe908e550b9fe78b280a031af4208a472ca93 /src/widgets | |
parent | 483a9d83f04b17b797df171d3eff91341a565a33 (diff) |
QFileDialog can delete files too, not just directories
After Ic12de12ec51c20de52d040514e90be5e783add43 this functionality
was broken. Added an autotest.
Task-number: QTBUG-34159
Change-Id: I8f41b7073dc57fea855ab87796f09e8a91520d13
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 6330d529fb..fa6306005b 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -204,6 +204,8 @@ bool QFileSystemModel::remove(const QModelIndex &aindex) #ifndef QT_NO_FILESYSTEMWATCHER d->fileInfoGatherer.removePath(path); #endif + if (QFileInfo(path).isFile()) + return QFile::remove(path); return QDir(path).removeRecursively(); } |