Implementing fallbacks when special dirs don't behave as expected #44
This solves https://todo.sr.ht/~martijnbraam/Megapixels/44 , seems need in sxmo (at least for me).
This commit is contained in:
parent
867b0c9bef
commit
ea20aa26fb
|
@ -357,10 +357,23 @@ process_capture_burst(cairo_surface_t *thumb)
|
|||
char timestamp[30];
|
||||
strftime(timestamp, 30, "%Y%m%d%H%M%S", &tim);
|
||||
|
||||
sprintf(capture_fname,
|
||||
"%s/IMG%s",
|
||||
g_get_user_special_dir(G_USER_DIRECTORY_PICTURES),
|
||||
timestamp);
|
||||
if (g_get_user_special_dir(G_USER_DIRECTORY_PICTURES) != NULL) {
|
||||
sprintf(capture_fname,
|
||||
"%s/IMG%s",
|
||||
g_get_user_special_dir(G_USER_DIRECTORY_PICTURES),
|
||||
timestamp);
|
||||
} else if (getenv("XDG_PICTURES_DIR") != NULL) {
|
||||
sprintf(capture_fname,
|
||||
"%s/IMG%s",
|
||||
getenv("XDG_PICTURES_DIR"),
|
||||
timestamp);
|
||||
} else {
|
||||
sprintf(capture_fname,
|
||||
"%s/Pictures/IMG%s",
|
||||
getenv("HOME"),
|
||||
timestamp);
|
||||
}
|
||||
|
||||
|
||||
// Start post-processing the captured burst
|
||||
g_print("Post process %s to %s.ext\n", burst_dir, capture_fname);
|
||||
|
|
Loading…
Reference in New Issue