← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1266478] Re: Query model doesn't work properly with a multilevel document list

 

This bug was fixed in the package u1db-qt -
0.1.5+14.04.20140313-0ubuntu1

---------------
u1db-qt (0.1.5+14.04.20140313-0ubuntu1) trusty; urgency=low

  [ CI bot ]
  * No change rebuild against Qt 5.2.1.

  [ Christian Dywan ]
  * Adopt xvfb.sh script from ui toolkit to run tests
  * Sort out build warnings and make them always fatal.
  * Implement Database.removeDoc method and use it in unit test
    Functionally this is equivalent to replacing the doc with an empty
    one. (LP: #1243395)
  * Use new-style qmlrunner log option to enable stdout.
  * Query improvements and more advanced example. (LP: #1271977,
    #1271972, #1266478)
  * Store whole document contents in the results and unit test that.
    (LP: #1271973)
  * Reverse query logic to check non-matching and internally convert
    between query syntaxes. (LP: #1284194, #1214538, #1215898)
  * Revert r113 and update unit test to verify previous behavior
 -- Ubuntu daily release <ps-jenkins@xxxxxxxxxxxxxxxxxxx>   Thu, 13 Mar 2014 23:12:40 +0000

** Changed in: u1db-qt (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to u1db-qt in Ubuntu.
https://bugs.launchpad.net/bugs/1266478

Title:
  Query model doesn't work properly with a multilevel document list

Status in Music application for Ubuntu devices:
  Triaged
Status in U1DB Qt/ QML:
  Fix Committed
Status in “u1db-qt” package in Ubuntu:
  Fix Released

Bug description:
  While using a Query model in a listview, I have noticed a weird
  scenario where it happens to kick out some index fields. Here is the
  code I used. Starting of with the document, index and query
  definitions,

  U1db.Document {
          database: appDb
          docId: 'eyeOfTheTiger'
          create: true
          defaults: { "playlist": { "name": "oldies", "tracks": [ { "file": "old1", "title": "very old song" },{ "file": "old2", "title": "even older" }  ] } }
     }

  U1db.Index{
          database: appDb
          id: by_playlist
          expression: ["playlist.name", "playlist.tracks.file", "playlist.tracks.title"]
      }

      U1db.Query{
          id: aQuery
          index: by_playlist
          query: [{"name":"*"}, {"file":"*"}, {"title":"*"}]
      }

  Here below is the listview where this query model is used.

  ListView {
              id: playlistView

              model: aQuery
              clip: true
              spacing: units.gu(2)
              anchors {
                  left: parent.left
                  top: parent.top
                  right: parent.right
                  bottom: addButton.top
                  margins: units.gu(2)
              }

              delegate: Item {
                  width: parent.width
                  height: childrenRect.height

                  Column {
                      Text { text: contents.name }
                      Text { text: contents.file + "|" + contents.title }
                  }
              }
   }

  On running the program, I get the output referring to contents.name as undefined.
  Unable to assign [undefined] to QString

  Here is the strange part, If I change the index expression to
  ["playlist.name", "playlist.tracks"], then contents.name seems to be
  properly displayed. However now we lose the playlist.tracks field.
  This only happens when there are multiple layer lists in a document.
  If they are on the same level, it seems to work fine.

To manage notifications about this bug go to:
https://bugs.launchpad.net/music-app/+bug/1266478/+subscriptions