+void KFileItemModel::setShowTrashMime(bool show)
+{
+ const auto trashMime = QStringLiteral("application/x-trash");
+ QStringList excludeFilter = m_filter.excludeMimeTypes();
+ bool wasShown = !excludeFilter.contains(trashMime);
+
+ if (show) {
+ if (!wasShown) {
+ excludeFilter.removeAll(trashMime);
+ }
+ } else {
+ if (wasShown) {
+ excludeFilter.append(trashMime);
+ }
+ }
+
+ if (wasShown != show) {
+ setExcludeMimeTypeFilter(excludeFilter);
+ }
+}
+