From 99490d3e8b1c6cbedd64dbe29f28a22d0f99cc42 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Mar 2016 11:14:27 +0200 Subject: mimetypebrowser example: Fix building of the hierarchy. Replace QMimeType::inherits() by a check using the list of parents since only the direct children are needed to build the tree. Change-Id: I041f21c4b94c8a250f7402a6f550f987c64f8fe8 Reviewed-by: David Faure --- examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp') diff --git a/examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp b/examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp index 81e4eb10cd..39e737a412 100644 --- a/examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp +++ b/examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp @@ -135,8 +135,8 @@ void MimetypeModel::populate() // append the items to parent and truncate the list. const QString &parentName = nameIndexIt.key(); const Iterator start = - std::stable_partition(allTypes.begin(), end, - [parentName](const QMimeType &t) { return !t.inherits(parentName); }); + std::stable_partition(allTypes.begin(), end, [parentName](const QMimeType &t) + { return !t.parentMimeTypes().contains(parentName); }); std::stable_sort(start, end); QStandardItem *parentItem = itemFromIndex(nameIndexIt.value()); for (Iterator it = start; it != end; ++it) { -- cgit v1.2.3