Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 325
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

Usage of QTemporaryFile in "Working with JSON" data chaper of user guide.



first of all I would like to state that I'm complete beginner to C++/Qt.


I tried to save JSON into filesystem and I found one weird thing in developer's guide (https://developer.blackberry.com/cascades/documentation/device_platform/data_access/working_with_jso...  subchapter called Saving JSON data. 


There is this snippet:


// Retrieve the working directory, and create a temporary .json file in that

// location
QDir home = QDir::home();
QTemporaryFile file(home.absoluteFilePath("myJSONFile.json"));
My feeling is that usage og QTemporaryFile is misleading for beginners. I have feeling that almost nobody saves JSON data into temporary file. 
I would suggest to make consistent part about Loading and part about Saving and use normal file in home directory of the user.
Feel free to correct me if I'm wrong.
Thanks a lot
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net