diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2012-11-16 09:55:35 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-31 10:02:48 +0200 |
commit | 7f1e6566a1bc356d29a2307810d16f5a43df7bfe (patch) | |
tree | a1cd8c986f315255198545e66c91e3d74599bae2 /tests | |
parent | 08fa879cd2fa64f5ef0d1435bb001195e1e18893 (diff) |
Fix query syntax for PhotoAlbum children.
The nie:isLogicalPartOf(?x) syntax won't match against an id, so this
query would never return anything. Instead return the contents
of the list rather than relying on a connection that may never
be established.
The same query will also return the contents of a Playlist, support
for which was mysteriously absent.
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
(cherry picked from commit c473e738f884563e557e1d18fbb5fd515386325b)
Change-Id: Id448e06f8d183e064c8966b22d44414057a45f8a
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qgallerytrackerschema_tracker/tst_qgallerytrackerschema.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/tests/auto/qgallerytrackerschema_tracker/tst_qgallerytrackerschema.cpp b/tests/auto/qgallerytrackerschema_tracker/tst_qgallerytrackerschema.cpp index 39f5a82..1c937ee 100644 --- a/tests/auto/qgallerytrackerschema_tracker/tst_qgallerytrackerschema.cpp +++ b/tests/auto/qgallerytrackerschema_tracker/tst_qgallerytrackerschema.cpp @@ -1561,7 +1561,8 @@ void tst_QGalleryTrackerSchema::queryResponseRootItem_data() << "SELECT ?x nie:url(?x) rdf:type(?x) " "WHERE {" "{?x rdf:type nmm:Photo}" - "FILTER(nie:isLogicalPartOf(?x)=<photoAlbum:Camping>)" + "{<photoAlbum:Camping> nfo:hasMediaFileListEntry ?entry}" + "FILTER(nie:url(?x) = nfo:entryUrl(?entry))" "} " "GROUP BY ?x"; @@ -1572,7 +1573,32 @@ void tst_QGalleryTrackerSchema::queryResponseRootItem_data() << "SELECT ?x nie:url(?x) rdf:type(?x) " "WHERE {" "{?x rdf:type nmm:Photo}" - "FILTER(nie:isLogicalPartOf(?x)=<photoAlbum:Camping>)" + "{<photoAlbum:Camping> nfo:hasMediaFileListEntry ?entry}" + "FILTER(nie:url(?x) = nfo:entryUrl(?entry))" + "} " + "GROUP BY ?x"; + + QTest::newRow("Playlist, All Image Descendants") + << QString::fromLatin1("Audio") + << QString::fromLatin1("playlist::playlist:mix") + << QGalleryQueryRequest::AllDescendants + << "SELECT ?x nie:url(?x) rdf:type(?x) " + "WHERE {" + "{?x rdf:type nfo:Audio}" + "{<playlist:mix> nfo:hasMediaFileListEntry ?entry}" + "FILTER(nie:url(?x) = nfo:entryUrl(?entry))" + "} " + "GROUP BY ?x"; + + QTest::newRow("Playlist, Direct Audio Descendants") + << QString::fromLatin1("Audio") + << QString::fromLatin1("playlist::playlist:mix") + << QGalleryQueryRequest::DirectDescendants + << "SELECT ?x nie:url(?x) rdf:type(?x) " + "WHERE {" + "{?x rdf:type nfo:Audio}" + "{<playlist:mix> nfo:hasMediaFileListEntry ?entry}" + "FILTER(nie:url(?x) = nfo:entryUrl(?entry))" "} " "GROUP BY ?x"; |