Introduce VLC_SNAPSHOTS_DIR for consistent default snapshots folder.

Standardize default snapshots folder across platforms with the
introduction of VLC_SNAPSHOTS_DIR. Users can still customize this
directory in Preferences.

Resolves: #27424.
This commit is contained in:
Vikram Kangotra 2023-11-14 14:42:14 +05:30 committed by Steve Lhomme
parent 6481dd9b71
commit dce86501f9
7 changed files with 10 additions and 1 deletions

View File

@ -303,6 +303,7 @@ typedef enum vlc_user_dir
VLC_MUSIC_DIR,
VLC_PICTURES_DIR,
VLC_VIDEOS_DIR,
VLC_SNAPSHOTS_DIR,
} vlc_userdir_t;
VLC_API char * config_GetUserDir( vlc_userdir_t ) VLC_USED VLC_MALLOC;

View File

@ -35,7 +35,7 @@
#include <jni.h>
static JavaVM *s_jvm = NULL;
#define GENERIC_DIR_COUNT (VLC_VIDEOS_DIR - VLC_DESKTOP_DIR + 1)
#define GENERIC_DIR_COUNT (VLC_SNAPSHOTS_DIR - VLC_DESKTOP_DIR + 1)
static char *ppsz_generic_names[GENERIC_DIR_COUNT] = {};
static struct {
struct {
@ -120,6 +120,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
"DIRECTORY_MUSIC", /* VLC_MUSIC_DIR */
"DIRECTORY_PICTURES", /* VLC_PICTURES_DIR */
"DIRECTORY_MOVIES", /* VLC_VIDEOS_DIR */
"DIRECTORY_SCREENSHOTS",/* VLC_SNAPSHOTS_DIR */
};
for (size_t i = 0; i < GENERIC_DIR_COUNT; ++i)
{
@ -291,6 +292,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
case VLC_PUBLICSHARE_DIR:
case VLC_DOCUMENTS_DIR:
case VLC_MUSIC_DIR:
case VLC_SNAPSHOTS_DIR:
case VLC_PICTURES_DIR:
case VLC_VIDEOS_DIR:
{

View File

@ -221,6 +221,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
case VLC_MUSIC_DIR:
psz_path = "%s/Music";
break;
case VLC_SNAPSHOTS_DIR:
case VLC_PICTURES_DIR:
psz_path = "%s/Pictures";
break;

View File

@ -172,6 +172,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
case VLC_PUBLICSHARE_DIR:
case VLC_DOCUMENTS_DIR:
case VLC_MUSIC_DIR:
case VLC_SNAPSHOTS_DIR:
case VLC_PICTURES_DIR:
case VLC_VIDEOS_DIR:
break;

View File

@ -290,6 +290,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
return config_GetTypeDir ("DOCUMENTS");
case VLC_MUSIC_DIR:
return config_GetTypeDir ("MUSIC");
case VLC_SNAPSHOTS_DIR:
case VLC_PICTURES_DIR:
return config_GetTypeDir ("PICTURES");
case VLC_VIDEOS_DIR:

View File

@ -338,6 +338,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
return config_GetCacheDir ();
case VLC_MUSIC_DIR:
return config_GetShellDir (VLC_MUSIC_DIR);
case VLC_SNAPSHOTS_DIR: // FIXME GetFolderForUserAsync / UserDataPath
case VLC_PICTURES_DIR:
return config_GetShellDir (VLC_PICTURES_DIR);
case VLC_VIDEOS_DIR:

View File

@ -164,6 +164,8 @@ char *platform_GetUserDir (vlc_userdir_t type)
return config_GetUserDir(VLC_HOME_DIR);
case VLC_MUSIC_DIR:
return config_GetKnownFolder (FOLDERID_Music);
case VLC_SNAPSHOTS_DIR:
return config_GetKnownFolder (FOLDERID_Screenshots);
case VLC_PICTURES_DIR:
return config_GetKnownFolder (FOLDERID_Pictures);
case VLC_VIDEOS_DIR: