Merge branch 'sdl2.0' of ssh://git.code.sf.net/p/tuxpaint/tuxpaint into sdl2.0

This commit is contained in:
Pere Pujal i Carabantes 2021-01-16 01:21:08 +01:00
commit 54f6a4a07d
160 changed files with 12548 additions and 9027 deletions

View file

@ -18999,7 +18999,15 @@ static void load_magic_plugins(void)
for (plc = 0; plc < NUM_MAGIC_PLACES; plc++)
{
if (plc == MAGIC_PLACE_GLOBAL)
place = strdup(MAGIC_PREFIX);
{
#if defined (__ANDROID__)
/* Need this at runtime as Android installs on different locations depending on the user */
place = strdup(SDL_AndroidGetInternalStoragePath());
strcpy(strstr(place, "/files"), "/lib/");
#else
place = strdup(MAGIC_PREFIX);
#endif
}
else if (plc == MAGIC_PLACE_LOCAL)
place = get_fname("plugins/", DIR_DATA);
#ifdef __APPLE__
@ -26877,9 +26885,16 @@ static char * get_export_filepath(const char * ext) {
/* Make sure the export dir exists */
if (!make_directory(DIR_EXPORT, "", "Can't create export directory (E016)"))
if (!make_directory(DIR_EXPORT, "", "Can't create export directory; will try to make its parent (E016)"))
{
return NULL;
/* See if perhaps we need to try and make its parent directory first? */
if (make_directory(DIR_EXPORT_PARENT, "", "Can't create export directory parent (E016b)")) {
if (!make_directory(DIR_EXPORT, "", "Can't create export directory (E016c)")) {
return NULL;
}
} else {
return NULL;
}
}
/* Create a unique filename, within that dir */