10-02-2012 04:57 PM
I've seen the other threads about problems with the HTTP communication sample from https://developer.blackberry.com/cascades/document
But this issue is different. I changed the url to use HTTPS and the file downloads properly, I even output the response contents to the debug logger and it's as expected. I've even verified the file is written to the application's data folder properly as a file namedmodel.xml.
What I have a problem with is the attempt to load the saved file into an XmlDataModel using the sample code
// Create the data model using the contents of the file. The // location of the file is relative to the assets directory. XmlDataModel *dataModel = new XmlDataModel(); dataModel->setSource(QUrl("../../../data/model.xml
In the debug log this always throws out a message saying it could not load "../../../data/model.xml"
After finding no answers in the forums I tried changing the path used to access this file and changed the code to
XmlDataModel *dataModel = new XmlDataModel(); dataModel->setSource(QUrl::fromLocalFile(QDir::hom
ePath() + "/model.xml"));
Now this works because QDir::homePath() returns the path to the app's data folder. But why did it not work before using the relative path as the comments in the sample suggest? Has something changed? I see nothing in the Beta 3 release notes about this being a known issue. Any feedback is appreciated.
Solved! Go to Solution.
10-02-2012 05:25 PM - edited 10-02-2012 05:26 PM
I think same issue was discussed in other thread. http://supportforums.blackberry.com/t5/Cascades-De
More about changes here https://developer.blackberry.com/cascades/document