mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-04 09:11:33 +02:00
Replace config_Get(Data|Lib)Dir() with config_GetSysDir()
This commit is contained in:
parent
5acf932211
commit
477d18c723
@ -381,9 +381,9 @@ static int ScanParametersDvbS( vlc_object_t *p_access, dvb_sys_t *p_sys, scan_pa
|
|||||||
char *psz_name = var_InheritString( p_access, "dvb-satellite" );
|
char *psz_name = var_InheritString( p_access, "dvb-satellite" );
|
||||||
if( psz_name )
|
if( psz_name )
|
||||||
{
|
{
|
||||||
char *data_dir = config_GetDataDir();
|
char *data_dir = config_GetSysPath(VLC_PKG_DATA_DIR, "dvb/dvb-s");
|
||||||
if( !data_dir || -1 == asprintf( &p_scan->psz_scanlist_file,
|
if( !data_dir || -1 == asprintf( &p_scan->psz_scanlist_file,
|
||||||
"%s" DIR_SEP "dvb" DIR_SEP "dvb-s" DIR_SEP "%s", data_dir, psz_name ) )
|
"%s/%s", data_dir, psz_name ) )
|
||||||
{
|
{
|
||||||
p_scan->psz_scanlist_file = NULL;
|
p_scan->psz_scanlist_file = NULL;
|
||||||
}
|
}
|
||||||
|
@ -150,12 +150,10 @@ static std::string getHRTFPath(filter_t *p_filter)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dataDir = config_GetDataDir();
|
char *dataDir = config_GetSysPath(VLC_PKG_DATA_DIR, DEFAULT_HRTF_PATH);
|
||||||
if (dataDir != NULL)
|
if (dataDir != NULL)
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
HRTFPath = std::string(dataDir);
|
||||||
ss << std::string(dataDir) << DIR_SEP << DEFAULT_HRTF_PATH;
|
|
||||||
HRTFPath = ss.str();
|
|
||||||
free(dataDir);
|
free(dataDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,14 +381,7 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
|
|||||||
|
|
||||||
#if (_POSIX_SPAWN >= 0)
|
#if (_POSIX_SPAWN >= 0)
|
||||||
/* Check if QApplication works */
|
/* Check if QApplication works */
|
||||||
char *libdir = config_GetLibDir();
|
char *path = config_GetSysPath(VLC_PKG_LIB_DIR, "vlc-qt-check");
|
||||||
if (likely(libdir != NULL))
|
|
||||||
{
|
|
||||||
char *path;
|
|
||||||
|
|
||||||
if (unlikely(asprintf(&path, "%s/vlc-qt-check", libdir) < 0))
|
|
||||||
path = NULL;
|
|
||||||
free(libdir);
|
|
||||||
if (unlikely(path == NULL))
|
if (unlikely(path == NULL))
|
||||||
return VLC_ENOMEM;
|
return VLC_ENOMEM;
|
||||||
|
|
||||||
@ -408,7 +401,6 @@ static int Open( vlc_object_t *p_this, bool isDialogProvider )
|
|||||||
msg_Dbg(p_this, "Qt check failed (%d). Skipping.", status);
|
msg_Dbg(p_this, "Qt check failed (%d). Skipping.", status);
|
||||||
return VLC_EGENERIC;
|
return VLC_EGENERIC;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QMutexLocker locker (&lock);
|
QMutexLocker locker (&lock);
|
||||||
|
@ -220,7 +220,7 @@ bool OS2Factory::init()
|
|||||||
char *datadir = config_GetUserDir( VLC_USER_DATA_DIR );
|
char *datadir = config_GetUserDir( VLC_USER_DATA_DIR );
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
||||||
free( datadir );
|
free( datadir );
|
||||||
datadir = config_GetDataDir();
|
datadir = config_GetSysPath(VLC_PKG_DATA_DIR, NULL);
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\skins2" );
|
m_resourcePath.push_back( (std::string)datadir + "\\skins2" );
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\share\\skins" );
|
m_resourcePath.push_back( (std::string)datadir + "\\share\\skins" );
|
||||||
|
@ -236,7 +236,7 @@ bool Win32Factory::init()
|
|||||||
char *datadir = config_GetUserDir( VLC_USERDATA_DIR );
|
char *datadir = config_GetUserDir( VLC_USERDATA_DIR );
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
||||||
free( datadir );
|
free( datadir );
|
||||||
datadir = config_GetDataDir();
|
datadir = config_GetSysPath(VLC_PKG_DATA_DIR, NULL);
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
m_resourcePath.push_back( (std::string)datadir + "\\skins" );
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\skins2" );
|
m_resourcePath.push_back( (std::string)datadir + "\\skins2" );
|
||||||
m_resourcePath.push_back( (std::string)datadir + "\\share\\skins" );
|
m_resourcePath.push_back( (std::string)datadir + "\\share\\skins" );
|
||||||
|
@ -90,8 +90,8 @@ bool X11Factory::init()
|
|||||||
m_resourcePath.push_back( (std::string)datadir + "/skins2" );
|
m_resourcePath.push_back( (std::string)datadir + "/skins2" );
|
||||||
free( datadir );
|
free( datadir );
|
||||||
m_resourcePath.push_back( (std::string)"share/skins2" );
|
m_resourcePath.push_back( (std::string)"share/skins2" );
|
||||||
datadir = config_GetDataDir();
|
datadir = config_GetSysPath(VLC_PKG_DATA_DIR, "skins2");
|
||||||
m_resourcePath.push_back( (std::string)datadir + "/skins2" );
|
m_resourcePath.push_back( (std::string)datadir );
|
||||||
free( datadir );
|
free( datadir );
|
||||||
|
|
||||||
// Determine the monitor geometry
|
// Determine the monitor geometry
|
||||||
|
@ -104,7 +104,7 @@ static int vlclua_config_set( lua_State *L )
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static int vlclua_datadir( lua_State *L )
|
static int vlclua_datadir( lua_State *L )
|
||||||
{
|
{
|
||||||
char *psz_data = config_GetDataDir();
|
char *psz_data = config_GetSysPath(VLC_PKG_DATA_DIR, NULL);
|
||||||
lua_pushstring( L, psz_data );
|
lua_pushstring( L, psz_data );
|
||||||
free( psz_data );
|
free( psz_data );
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -223,8 +223,8 @@ int vlclua_dir_list(const char *luadirname, char ***restrict listp)
|
|||||||
list = vlclua_dir_list_append(list, config_GetUserDir(VLC_USERDATA_DIR),
|
list = vlclua_dir_list_append(list, config_GetUserDir(VLC_USERDATA_DIR),
|
||||||
luadirname);
|
luadirname);
|
||||||
|
|
||||||
char *libdir = config_GetLibDir();
|
char *libdir = config_GetSysPath(VLC_PKG_LIB_DIR, NULL);
|
||||||
char *datadir = config_GetDataDir();
|
char *datadir = config_GetSysPath(VLC_PKG_DATA_DIR, NULL);
|
||||||
bool both = libdir != NULL && datadir != NULL && strcmp(libdir, datadir);
|
bool both = libdir != NULL && datadir != NULL && strcmp(libdir, datadir);
|
||||||
|
|
||||||
/* Tokenized Lua scripts in architecture-specific data directory */
|
/* Tokenized Lua scripts in architecture-specific data directory */
|
||||||
|
@ -233,14 +233,13 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
|
|||||||
{
|
{
|
||||||
/* Load icon from share/ */
|
/* Load icon from share/ */
|
||||||
GError *p_error = NULL;
|
GError *p_error = NULL;
|
||||||
char *psz_pixbuf;
|
char *psz_pixbuf = config_GetSysPath(VLC_PKG_DATA_DIR,
|
||||||
char *psz_data = config_GetDataDir();
|
"icons/48x48/"PACKAGE".png");
|
||||||
if( asprintf( &psz_pixbuf, "%s/icons/48x48/vlc.png", psz_data ) >= 0 )
|
if (psz_pixbuf != NULL)
|
||||||
{
|
{
|
||||||
pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
|
pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
|
||||||
free( psz_pixbuf );
|
free( psz_pixbuf );
|
||||||
}
|
}
|
||||||
free( psz_data );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,11 +306,7 @@ static void *Thread( void *p_data )
|
|||||||
psz_preset_path = var_InheritString( p_filter, "projectm-preset-path" );
|
psz_preset_path = var_InheritString( p_filter, "projectm-preset-path" );
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if ( psz_preset_path == NULL )
|
if ( psz_preset_path == NULL )
|
||||||
{
|
psz_preset_path = config_GetSysPath(VLC_PKG_DATA_DIR, "visualization");
|
||||||
char *psz_data_path = config_GetDataDir();
|
|
||||||
asprintf( &psz_preset_path, "%s" DIR_SEP "visualization", psz_data_path );
|
|
||||||
free( psz_data_path );
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
psz_title_font = var_InheritString( p_filter, "projectm-title-font" );
|
psz_title_font = var_InheritString( p_filter, "projectm-title-font" );
|
||||||
|
@ -45,14 +45,8 @@ int vlc_bindtextdomain (const char *domain)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
char *datadir = config_GetDataDir();
|
char *upath = config_GetSysPath(VLC_PKG_DATA_DIR, "locale");
|
||||||
if (unlikely(datadir == NULL))
|
if (unlikely(upath == NULL))
|
||||||
return -1;
|
|
||||||
|
|
||||||
char *upath;
|
|
||||||
int ret = asprintf (&upath, "%s" DIR_SEP "locale", datadir);
|
|
||||||
free (datadir);
|
|
||||||
if (unlikely(ret == -1))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
char *lpath = ToLocale(upath);
|
char *lpath = ToLocale(upath);
|
||||||
|
@ -77,14 +77,13 @@ struct subpicture_updater_sys_t
|
|||||||
static char * GetDefaultArtUri( void )
|
static char * GetDefaultArtUri( void )
|
||||||
{
|
{
|
||||||
char *psz_uri = NULL;
|
char *psz_uri = NULL;
|
||||||
char *psz_path;
|
char *psz_path = config_GetSysPath(VLC_PKG_DATA_DIR,
|
||||||
char *psz_datadir = config_GetDataDir();
|
"icons/128x128/"PACKAGE_NAME".png");
|
||||||
if( asprintf( &psz_path, "%s/icons/128x128/vlc.png", psz_datadir ) >= 0 )
|
if( psz_path != NULL )
|
||||||
{
|
{
|
||||||
psz_uri = vlc_path2uri( psz_path, NULL );
|
psz_uri = vlc_path2uri( psz_path, NULL );
|
||||||
free( psz_path );
|
free( psz_path );
|
||||||
}
|
}
|
||||||
free( psz_datadir );
|
|
||||||
return psz_uri;
|
return psz_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user