The Following 8 Users Say Thank You to Android_808 For This Useful Post: | ||
|
2017-04-07
, 12:20
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#162
|
Sorry, been unwell again the last few weeks. I was wondering the same thing a few months ago as part of something else (finding WM/shell during runtime). Would it be better to look at implementing/following XDG? We use it for menus and autostart iirc but not sure about user-dirs.dirs. As I understand it we could just add XDG_CAMERA_DIR to the config file and use that where needed.
The trouble then is Glib doesn't seem to have a direct (GUserDirectory) method of using this, it would require manually processing the config file for each app or just creating a routine within libhildonfm/libhildon.
OR, we cheat and just make it XDG_PICTURES_DIR/DCIM
https://wiki.archlinux.org/index.php...er_directories
or for a N9 example:
https://fravaccaro.wordpress.com/201...r-screenshots/
Edit:
For custom paths, reading the config file would need something like xdg_user_dir_lookup_with_fallback
https://cgit.freedesktop.org/xdg/xdg...r-dir-lookup.c
|
2017-04-07
, 21:23
|
Posts: 1,203 |
Thanked: 3,027 times |
Joined on Dec 2010
|
#163
|
The Following 4 Users Say Thank You to Android_808 For This Useful Post: | ||
|
2017-04-08
, 06:52
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#164
|
There is a function in the linked source file that allows a fallback directory to be set, that seems about the closest I can come up with at the moment.
What's DCF?
The Following 5 Users Say Thank You to freemangordon For This Useful Post: | ||
|
2017-04-08
, 10:07
|
Posts: 1,203 |
Thanked: 3,027 times |
Joined on Dec 2010
|
#165
|
The Following 6 Users Say Thank You to Android_808 For This Useful Post: | ||
|
2017-04-08
, 11:35
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#166
|
If we implement a function based on the fallback version in that file you could add XDG_CAMERA_DIR to the user-dirs.dir config file (with a default value equal to the Nokia equivalent) so users could specify their own location if desired. The function would then load the file and return this value if present, if not use a hard-coded default location. If the function was added to libhildon as part of something like hildon-utils.c all hildon apps would have access. To cheat even more, you could just give the function the same name as the glib version and #define the Nokia values to the XDG equivalents.
On a side note, are there any updates that need adding to the Fremantle-GTK3 version (utils/userland wise)? I've still got to work out a few issues with the current state of libhildon3 and then check to see if I need to restore any features in the current hildon-desktop implementation. After that I'll look to working out the Devuan kinks.
The Following 6 Users Say Thank You to freemangordon For This Useful Post: | ||
|
2017-04-08
, 18:17
|
Posts: 1,203 |
Thanked: 3,027 times |
Joined on Dec 2010
|
#167
|
|
2017-04-19
, 19:00
|
Posts: 3,074 |
Thanked: 12,960 times |
Joined on Mar 2010
@ Sofia,Bulgaria
|
#168
|
|
2017-04-19
, 21:44
|
Posts: 1,163 |
Thanked: 1,873 times |
Joined on Feb 2011
@ The Netherlands
|
#169
|
The Following 5 Users Say Thank You to mr_pingu For This Useful Post: | ||
|
2017-05-03
, 15:50
|
Posts: 1,203 |
Thanked: 3,027 times |
Joined on Dec 2010
|
#170
|
The Following 8 Users Say Thank You to Android_808 For This Useful Post: | ||
OR, we cheat and just make it XDG_PICTURES_DIR/DCIM
https://wiki.archlinux.org/index.php...er_directories
or for a N9 example:
https://fravaccaro.wordpress.com/201...r-screenshots/
Edit:
For custom paths, reading the config file would need something like xdg_user_dir_lookup_with_fallback
https://cgit.freedesktop.org/xdg/xdg...r-dir-lookup.c
Last edited by Android_808; 2017-04-07 at 08:25.