summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfilesystemmodel.cpp
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2010-05-12 12:41:49 (GMT)
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 10:24:39 (GMT)
commitbed275599ff44809372af99b9b6cbe492f5fdec8 (patch)
treefcc8fdde12af7567a08b5e69c1c10b55b340a182 /src/gui/dialogs/qfilesystemmodel.cpp
parent0cc309d2dd0469bc8997154455b91fba4697ccc5 (diff)
downloadQt-bed275599ff44809372af99b9b6cbe492f5fdec8.zip
Qt-bed275599ff44809372af99b9b6cbe492f5fdec8.tar.gz
Qt-bed275599ff44809372af99b9b6cbe492f5fdec8.tar.bz2
make QFileSystemModel::rmdir(dir) remove dir from fileInfoGatherer
Otherwise directories cannot be deleted as long as they are watched, since the fileInfoGatherer keeps a QFileInfo object with open file handles. Reviewed-by: Joao Task-number: QTBUG-8241
Diffstat (limited to 'src/gui/dialogs/qfilesystemmodel.cpp')
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index f9f9df8..86f2920 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -1631,6 +1631,14 @@ bool QFileSystemModel::event(QEvent *event)
return QAbstractItemModel::event(event);
}
+bool QFileSystemModel::rmdir(const QModelIndex &aindex) const
+{
+ QString path = filePath(aindex);
+ QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func());
+ d->fileInfoGatherer.removePath(path);
+ return QDir().rmdir(path);
+}
+
/*!
\internal