Ask / Submit
1

$XDG_CACHE_HOME in QML

asked 2015-07-16 10:31:47 +0300

Ósanwe gravatar image

updated 2015-07-16 10:32:13 +0300

Hello!

The FAQ contains information that developers must use environment variables like $XDG_CACHE_HOME.

I tried to use this in QML with the follow way:

Image {
    ...
    source: "$XDG_CACHE_HOME/harbour-kat/" + StorageJS.readUserAvatar()
}

After this in the log I saw the follow message:

QML Image: Cannot open: file:///usr/share/harbour-kat/qml/pages/$XDG_CACHE_HOME/harbour-kat/jJGeaWL3a9E.jpg

What is the right way of using this variables in QML?

Thanks in advance!

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
0

answered 2015-07-17 06:59:27 +0300

BirdZhang gravatar image

$XDG_CACHE_HOME does not recognize in QML

And Image source default is relative path

edit flag offensive delete publish link more

Comments

Therefore I have to build a path with this variables in C++? Or is it possible to build a path into JS?

Ósanwe ( 2015-07-17 13:30:36 +0300 )edit

In C++ and Python it's support ,donot know js support it or not.

BirdZhang ( 2015-07-17 14:17:54 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2015-07-16 10:31:47 +0300

Seen: 130 times

Last updated: Jul 17 '15