diff options
| author | Friedemann Kleint <[email protected]> | 2016-03-30 11:14:27 +0200 |
|---|---|---|
| committer | Friedemann Kleint <[email protected]> | 2016-03-30 09:40:35 +0000 |
| commit | 99490d3e8b1c6cbedd64dbe29f28a22d0f99cc42 (patch) | |
| tree | 13065d89bf23f68140beacc3bd3cae937ddbf0c3 | |
| parent | f7cdb0abdb96bd81cca3898316e9867fbac758b3 (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 <[email protected]>
| -rw-r--r-- | examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp b/examples/corelib/mimetypes/mimetypebrowser/mimetypemodel.cpp index 81e4eb10cd0..39e737a412e 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) { |
