ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #05793
Re: Access XML file in ~/
On 2014-01-07 17:02, Christian Dywan wrote:
>> On 30.12.2013 23:35, Israel wrote:
>>> I want it to access the XML file from a relative ~/.config/
>>> so far it seems I can only hard code the location..
>> Check out QStandardPaths:
>> http://qt-project.org/doc/qt-5.0/qtcore/qstandardpaths.html
>>
>> QStandardPaths::writableLocation with QStandardPaths::ConfigLocation
>> should give you the interesting path.
>>
>> Otherwise QDir::homePath() could be used, too.
>>
>> So yeah, you need some slim C++ for that.
> Hey Israel,
>
> can you elaborate on what API you're using to read the XML? Are you
> using QML or C++?
>
> Most QML APIs don't actually cope with filenames. For instance
> LocalStorage takes strings which are stored under filenames based on the
> checksum internally. Similarly U1Db doesn't require paths by default.
> XMLListModel can take filenames but has no writing capability.
> If you use C++, QStandardPaths is indeed the way to go if you need a
> filename or implement a QML component. And this is actually used in
> several C++ components.
>
> I'm actually looking to write an overview of different storage methods
> inspired by this thread. The individual APIs are a bit scattered for
> somebody starting afresh.
Link to my branch with the storage docs. Any feedback welcome.
https://code.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/add-storage-overview/+merge/200688
<https://code.launchpad.net/%7Eubuntu-sdk-team/ubuntu-ui-toolkit/add-storage-overview/+merge/200688>
Attachment:
signature.asc
Description: OpenPGP digital signature
References