Hi there,

I would like to read a playlist .pls file to tell Audio what music to play but I cannot get QFile to read it. My application shall be an Sailfish app.
To read a file I followed this tutorial.
If I use this code with source: "qrc:/playlist.pls" (currently I provide the playlist within my resource file)
Qt Code:
  1. FileIO {
  2. id: myFile
  3. source: "my_file.txt"
  4. onError: console.log(msg)
  5. }
To copy to clipboard, switch view to plain text mode 
I get this error:
Qt Code:
  1. [W] unknown:39 - file:///usr/share/Test/qml/Test.qml:39:30: Type FirstPage unavailable
  2. initialPage: Component { FirstPage { } }
  3. ^
  4. [W] unknown:57 - file:///usr/share/Test/qml/pages/FirstPage.qml:57:21: Invalid property assignment: "source" is a read-only property
  5. source: "qrc:/playlist.pls"
To copy to clipboard, switch view to plain text mode 
I do not understand that because I only want to open the file as read-only, so why is the string invalid?

Then I commented the source out and put the path directly into the cpp file.
Qt Code:
  1. ...
  2. mSource = "qrc:/playlist.pls";
  3. if (mSource.isEmpty()){
  4. ...
To copy to clipboard, switch view to plain text mode 
Then the file could be opened but not read and I get the error message:
Qt Code:
  1. [D] onError:58 - Unable to open the file
  2. [D] onCompleted:125 -
To copy to clipboard, switch view to plain text mode 
I spend nearly to days now to figure out what is wrong but I just cannot find anything on the web. Can someone help me please?