summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-30 11:14:27 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-30 09:40:35 +0000
commit99490d3e8b1c6cbedd64dbe29f28a22d0f99cc42 (patch)
tree13065d89bf23f68140beacc3bd3cae937ddbf0c3 /examples
parentf7cdb0abdb96bd81cca3898316e9867fbac758b3 (diff)
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 <david.faure@kdab.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp4
1 files changed, 2 insertions, 2 deletions
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) {