summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-01-28 12:57:00 +0100
committerWolf-Michael Bolle <wolf-michael.bolle@nokia.com>2012-01-30 13:13:29 +0100
commit845cf3b231a325d94ca7eee8d95068782e60b11b (patch)
treecbfd305718c55800c4c3e5b9573b7328e2b92892
parent52bfdb8b99d59164a93a9cc398eaaa925f4855fc (diff)
QMimeType API: allParentMimeTypes -> allAncestors.
Suggested by Lars. Change-Id: Ibaef47854fcf06fb39e7cc9a987557940f5bbe66 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
-rw-r--r--examples/mimetypeviewer/mimetypeviewer.cpp2
-rw-r--r--examples/mimetypeviewer/mimetypeviewer.ui2
-rw-r--r--src/mimetypes/qmimetype.cpp2
-rw-r--r--src/mimetypes/qmimetype.h2
-rw-r--r--tests/auto/qmimedatabase/tst_qmimedatabase.cpp14
5 files changed, 11 insertions, 11 deletions
diff --git a/examples/mimetypeviewer/mimetypeviewer.cpp b/examples/mimetypeviewer/mimetypeviewer.cpp
index 10341e5..370e3b0 100644
--- a/examples/mimetypeviewer/mimetypeviewer.cpp
+++ b/examples/mimetypeviewer/mimetypeviewer.cpp
@@ -50,7 +50,7 @@ void MimeTypeViewer::setMimeType(const QMimeType &mimeType)
ui->globPatternsLabel->setText(mimeType.globPatterns().join(", "));
ui->parentMimeTypesLabel->setText(mimeType.parentMimeTypes().join(", "));
- ui->allParentMimeTypesLabel->setText(mimeType.allParentMimeTypes().join(", "));
+ ui->allAncestorsLabel->setText(mimeType.allAncestors().join(", "));
ui->suffixesLabel->setText(mimeType.suffixes().join(", "));
ui->preferredSuffixLabel->setText(mimeType.preferredSuffix());
diff --git a/examples/mimetypeviewer/mimetypeviewer.ui b/examples/mimetypeviewer/mimetypeviewer.ui
index 317ab38..085986b 100644
--- a/examples/mimetypeviewer/mimetypeviewer.ui
+++ b/examples/mimetypeviewer/mimetypeviewer.ui
@@ -160,7 +160,7 @@
</widget>
</item>
<item row="8" column="1">
- <widget class="QLabel" name="allParentMimeTypesLabel">
+ <widget class="QLabel" name="allAncestorsLabel">
<property name="text">
<string>&lt;&gt;</string>
</property>
diff --git a/src/mimetypes/qmimetype.cpp b/src/mimetypes/qmimetype.cpp
index e37ee61..b4d4e1c 100644
--- a/src/mimetypes/qmimetype.cpp
+++ b/src/mimetypes/qmimetype.cpp
@@ -474,7 +474,7 @@ static void collectParentMimeTypes(const QString& mime, QStringList& allParents)
Note that application/octet-stream is the ultimate parent for all types
of files (but not directories).
*/
-QStringList QMimeType::allParentMimeTypes() const
+QStringList QMimeType::allAncestors() const
{
QStringList allParents;
collectParentMimeTypes(d->name, allParents);
diff --git a/src/mimetypes/qmimetype.h b/src/mimetypes/qmimetype.h
index ca986a6..3f43263 100644
--- a/src/mimetypes/qmimetype.h
+++ b/src/mimetypes/qmimetype.h
@@ -77,7 +77,7 @@ public:
QString iconName() const;
QStringList globPatterns() const;
QStringList parentMimeTypes() const;
- QStringList allParentMimeTypes() const;
+ QStringList allAncestors() const;
QStringList suffixes() const;
QString preferredSuffix() const;
diff --git a/tests/auto/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/qmimedatabase/tst_qmimedatabase.cpp
index 7b6da34..d1249e6 100644
--- a/tests/auto/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/qmimedatabase/tst_qmimedatabase.cpp
@@ -276,15 +276,15 @@ void tst_qmimedatabase::test_inheritance()
QVERIFY(shellParents.contains(QLatin1String("text/plain")));
QVERIFY(shellParents.contains(QLatin1String("application/x-executable")));
QCOMPARE(shellParents.count(), 2); // only the above two
- const QStringList allShellParents = shellscript.allParentMimeTypes();
- QVERIFY(allShellParents.contains(QLatin1String("text/plain")));
- QVERIFY(allShellParents.contains(QLatin1String("application/x-executable")));
- QVERIFY(allShellParents.contains(QLatin1String("application/octet-stream")));
+ const QStringList allShellAncestors = shellscript.allAncestors();
+ QVERIFY(allShellAncestors.contains(QLatin1String("text/plain")));
+ QVERIFY(allShellAncestors.contains(QLatin1String("application/x-executable")));
+ QVERIFY(allShellAncestors.contains(QLatin1String("application/octet-stream")));
// Must be least-specific last, i.e. breadth first.
- QCOMPARE(allShellParents.last(), QString::fromLatin1("application/octet-stream"));
+ QCOMPARE(allShellAncestors.last(), QString::fromLatin1("application/octet-stream"));
- const QStringList allSvgParents = db.mimeTypeForName(QString::fromLatin1("image/svg+xml")).allParentMimeTypes();
- QCOMPARE(allSvgParents, QStringList() << QLatin1String("application/xml") << QLatin1String("text/plain") << QLatin1String("application/octet-stream"));
+ const QStringList allSvgAncestors = db.mimeTypeForName(QString::fromLatin1("image/svg+xml")).allAncestors();
+ QCOMPARE(allSvgAncestors, QStringList() << QLatin1String("application/xml") << QLatin1String("text/plain") << QLatin1String("application/octet-stream"));
// Check that text/x-mrml knows that it inherits from text/plain (implicitly)
const QMimeType mrml = db.mimeTypeForName(QString::fromLatin1("text/x-mrml"));