[vlc-commits] config: rename VLC_DATA_DIR to VLC_USERDATA_DIR

Rémi Denis-Courmont git at videolan.org
Tue Mar 6 20:17:23 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar  5 23:05:50 2018 +0200| [ca621cd7f7022b0b9982211381c1671e09663233] | committer: Rémi Denis-Courmont

config: rename VLC_DATA_DIR to VLC_USERDATA_DIR

...to avoid confusion going forward. The name matches the VLC Lua name.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ca621cd7f7022b0b9982211381c1671e09663233
---

 include/vlc_configuration.h                | 2 +-
 lib/media_library.c                        | 2 +-
 modules/codec/arib/aribsub.c               | 2 +-
 modules/gui/skins2/os2/os2_factory.cpp     | 2 +-
 modules/gui/skins2/win32/win32_factory.cpp | 2 +-
 modules/gui/skins2/x11/x11_factory.cpp     | 2 +-
 modules/lua/libs/configuration.c           | 2 +-
 modules/lua/vlc.c                          | 2 +-
 modules/misc/addons/fsstorage.c            | 6 +++---
 src/android/specific.c                     | 2 +-
 src/darwin/dirs.c                          | 4 ++--
 src/os2/dirs.c                             | 2 +-
 src/playlist/loadsave.c                    | 4 ++--
 src/posix/dirs.c                           | 2 +-
 src/win32/dirs.c                           | 2 +-
 15 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index 8aeafde1d7..8421c370f4 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -301,7 +301,7 @@ typedef enum vlc_userdir
 {
     VLC_HOME_DIR, /* User's home */
     VLC_CONFIG_DIR, /* VLC-specific configuration directory */
-    VLC_DATA_DIR, /* VLC-specific data directory */
+    VLC_USERDATA_DIR, /* VLC-specific data directory */
     VLC_CACHE_DIR, /* VLC-specific user cached data directory */
     /* Generic directories (same as XDG) */
     VLC_DESKTOP_DIR=0x80,
diff --git a/lib/media_library.c b/lib/media_library.c
index f2bf77a77f..d13a36ee2b 100644
--- a/lib/media_library.c
+++ b/lib/media_library.c
@@ -104,7 +104,7 @@ void libvlc_media_library_retain( libvlc_media_library_t * p_mlib )
  **************************************************************************/
 int libvlc_media_library_load( libvlc_media_library_t * p_mlib )
 {
-    char *psz_datadir = config_GetUserDir( VLC_DATA_DIR );
+    char *psz_datadir = config_GetUserDir( VLC_USERDATA_DIR );
     char * psz_uri;
 
     if( psz_datadir == NULL
diff --git a/modules/codec/arib/aribsub.c b/modules/codec/arib/aribsub.c
index 46272ea175..214f6f51af 100644
--- a/modules/codec/arib/aribsub.c
+++ b/modules/codec/arib/aribsub.c
@@ -197,7 +197,7 @@ static void messages_callback_handler( void *p_opaque, const char *psz_message )
 
 static char* get_arib_base_dir()
 {
-    char *psz_data_dir = config_GetUserDir( VLC_DATA_DIR );
+    char *psz_data_dir = config_GetUserDir( VLC_USERDATA_DIR );
     if( psz_data_dir == NULL )
     {
         return NULL;
diff --git a/modules/gui/skins2/os2/os2_factory.cpp b/modules/gui/skins2/os2/os2_factory.cpp
index 5a8bb9f784..dc6357c371 100644
--- a/modules/gui/skins2/os2/os2_factory.cpp
+++ b/modules/gui/skins2/os2/os2_factory.cpp
@@ -217,7 +217,7 @@ bool OS2Factory::init()
     changeCursor( kDefaultArrow );
 
     // Initialize the resource path
-    char *datadir = config_GetUserDir( VLC_DATA_DIR );
+    char *datadir = config_GetUserDir( VLC_USER_DATA_DIR );
     m_resourcePath.push_back( (std::string)datadir + "\\skins" );
     free( datadir );
     datadir = config_GetDataDir();
diff --git a/modules/gui/skins2/win32/win32_factory.cpp b/modules/gui/skins2/win32/win32_factory.cpp
index 74a802aff2..3df64fb785 100644
--- a/modules/gui/skins2/win32/win32_factory.cpp
+++ b/modules/gui/skins2/win32/win32_factory.cpp
@@ -233,7 +233,7 @@ bool Win32Factory::init()
     OleInitialize( NULL );
 
     // Initialize the resource path
-    char *datadir = config_GetUserDir( VLC_DATA_DIR );
+    char *datadir = config_GetUserDir( VLC_USERDATA_DIR );
     m_resourcePath.push_back( (std::string)datadir + "\\skins" );
     free( datadir );
     datadir = config_GetDataDir();
diff --git a/modules/gui/skins2/x11/x11_factory.cpp b/modules/gui/skins2/x11/x11_factory.cpp
index ed52ff1ae2..d66dbcf5bc 100644
--- a/modules/gui/skins2/x11/x11_factory.cpp
+++ b/modules/gui/skins2/x11/x11_factory.cpp
@@ -86,7 +86,7 @@ bool X11Factory::init()
                                      ConnectionNumber( pDisplay ) );
 
     // Initialize the resource path
-    char *datadir = config_GetUserDir( VLC_DATA_DIR );
+    char *datadir = config_GetUserDir( VLC_USERDATA_DIR );
     m_resourcePath.push_back( (std::string)datadir + "/skins2" );
     free( datadir );
     m_resourcePath.push_back( (std::string)"share/skins2" );
diff --git a/modules/lua/libs/configuration.c b/modules/lua/libs/configuration.c
index 6c26e4bf43..0d94cb1c07 100644
--- a/modules/lua/libs/configuration.c
+++ b/modules/lua/libs/configuration.c
@@ -112,7 +112,7 @@ static int vlclua_datadir( lua_State *L )
 
 static int vlclua_userdatadir( lua_State *L )
 {
-    char *dir = config_GetUserDir( VLC_DATA_DIR );
+    char *dir = config_GetUserDir( VLC_USERDATA_DIR );
     lua_pushstring( L, dir );
     free( dir );
     return 1;
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 79efaf5400..e2a63ebb54 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -220,7 +220,7 @@ int vlclua_dir_list(const char *luadirname, char ***restrict listp)
     *listp = list;
 
     /* Lua scripts in user-specific data directory */
-    list = vlclua_dir_list_append(list, config_GetUserDir(VLC_DATA_DIR),
+    list = vlclua_dir_list_append(list, config_GetUserDir(VLC_USERDATA_DIR),
                                   luadirname);
 
     char *libdir = config_GetLibDir();
diff --git a/modules/misc/addons/fsstorage.c b/modules/misc/addons/fsstorage.c
index e4916b099e..77ba5db6cf 100644
--- a/modules/misc/addons/fsstorage.c
+++ b/modules/misc/addons/fsstorage.c
@@ -100,7 +100,7 @@ static char * getAddonInstallDir( addon_type_t t )
 {
     const char *psz_subdir = NULL;
     char *psz_dir;
-    char *psz_userdir = config_GetUserDir( VLC_DATA_DIR );
+    char *psz_userdir = config_GetUserDir( VLC_USERDATA_DIR );
     if ( !psz_userdir ) return NULL;
 
     for ( unsigned int i=0; i< ARRAY_SIZE(addons_dirs); i++ )
@@ -542,7 +542,7 @@ static int WriteCatalog( addons_storage_t *p_storage,
     char *psz_file;
     char *psz_file_tmp;
     char *psz_tempstring;
-    char *psz_userdir = config_GetUserDir( VLC_DATA_DIR );
+    char *psz_userdir = config_GetUserDir( VLC_USERDATA_DIR );
     if ( !psz_userdir ) return VLC_ENOMEM;
 
     if ( asprintf( &psz_file, "%s%s", psz_userdir, ADDONS_CATALOG ) < 1 )
@@ -671,7 +671,7 @@ static int WriteCatalog( addons_storage_t *p_storage,
 static int LoadCatalog( addons_finder_t *p_finder )
 {
     char *psz_path;
-    char * psz_userdir = config_GetUserDir( VLC_DATA_DIR );
+    char * psz_userdir = config_GetUserDir( VLC_USERDATA_DIR );
     if ( !psz_userdir ) return VLC_ENOMEM;
 
     if ( asprintf( &psz_path, "%s%s", psz_userdir, ADDONS_CATALOG ) < 1 )
diff --git a/src/android/specific.c b/src/android/specific.c
index 9c797e7305..bb45f28e16 100644
--- a/src/android/specific.c
+++ b/src/android/specific.c
@@ -273,7 +273,7 @@ char *config_GetUserDir (vlc_userdir_t type)
 {
     switch (type)
     {
-        case VLC_DATA_DIR:
+        case VLC_USERDATA_DIR:
             return config_GetHomeDir(".share",
                 "/sdcard/Android/data/org.videolan.vlc");
         case VLC_CACHE_DIR:
diff --git a/src/darwin/dirs.c b/src/darwin/dirs.c
index c80a59d5b5..9fb15b6dcf 100644
--- a/src/darwin/dirs.c
+++ b/src/darwin/dirs.c
@@ -126,7 +126,7 @@ static char *getAppDependentDir(vlc_userdir_t type)
             psz_path = "%s/Library/Preferences/%s";
             break;
         case VLC_TEMPLATES_DIR:
-        case VLC_DATA_DIR:
+        case VLC_USERDATA_DIR:
             psz_path = "%s/Library/Application Support/%s";
             break;
         case VLC_CACHE_DIR:
@@ -172,7 +172,7 @@ char *config_GetUserDir (vlc_userdir_t type)
     switch (type) {
         case VLC_CONFIG_DIR:
         case VLC_TEMPLATES_DIR:
-        case VLC_DATA_DIR:
+        case VLC_USERDATA_DIR:
         case VLC_CACHE_DIR:
             return getAppDependentDir(type);
 
diff --git a/src/os2/dirs.c b/src/os2/dirs.c
index 09bc26fca3..f5753df209 100644
--- a/src/os2/dirs.c
+++ b/src/os2/dirs.c
@@ -79,7 +79,7 @@ char *config_GetUserDir (vlc_userdir_t type)
     {
         case VLC_HOME_DIR:
         case VLC_CONFIG_DIR:
-        case VLC_DATA_DIR:
+        case VLC_USERDATA_DIR:
         case VLC_CACHE_DIR:
         case VLC_DESKTOP_DIR:
         case VLC_DOWNLOAD_DIR:
diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index 05d6b9038e..178ec1fbb4 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -129,7 +129,7 @@ static void input_item_subitem_tree_added( const vlc_event_t * p_event,
 
 int playlist_MLLoad( playlist_t *p_playlist )
 {
-    char *psz_datadir = config_GetUserDir( VLC_DATA_DIR );
+    char *psz_datadir = config_GetUserDir( VLC_USERDATA_DIR );
     if( !psz_datadir ) /* XXX: This should never happen */
     {
         msg_Err( p_playlist, "no data directory, cannot load media library") ;
@@ -180,7 +180,7 @@ int playlist_MLDump( playlist_t *p_playlist )
 {
     char *psz_temp;
 
-    psz_temp = config_GetUserDir( VLC_DATA_DIR );
+    psz_temp = config_GetUserDir( VLC_USERDATA_DIR );
 
     if( !psz_temp ) /* XXX: This should never happen */
     {
diff --git a/src/posix/dirs.c b/src/posix/dirs.c
index 59d36787ab..0514a41a6a 100644
--- a/src/posix/dirs.c
+++ b/src/posix/dirs.c
@@ -216,7 +216,7 @@ char *config_GetUserDir (vlc_userdir_t type)
             break;
         case VLC_CONFIG_DIR:
             return config_GetAppDir ("CONFIG", ".config");
-        case VLC_DATA_DIR:
+        case VLC_USERDATA_DIR:
             return config_GetAppDir ("DATA", ".local/share");
         case VLC_CACHE_DIR:
             return config_GetAppDir ("CACHE", ".cache");
diff --git a/src/win32/dirs.c b/src/win32/dirs.c
index 8a8876a1a2..5e5dd09570 100644
--- a/src/win32/dirs.c
+++ b/src/win32/dirs.c
@@ -259,7 +259,7 @@ char *config_GetUserDir (vlc_userdir_t type)
         case VLC_HOME_DIR:
             return config_GetShellDir (CSIDL_PERSONAL);
         case VLC_CONFIG_DIR:
-        case VLC_DATA_DIR:
+        case VLC_USERDATA_DIR:
             return config_GetAppDir ();
         case VLC_CACHE_DIR:
 #if !VLC_WINSTORE_APP



More information about the vlc-commits mailing list