From b4c313573076f43fb5c8e8bf0b104d4615441028 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 10 Feb 2008 12:31:27 +0000 Subject: [PATCH] Use config_GetDataDir() instead of DATA_PATH. --- modules/control/http/http.c | 8 ++++++-- modules/gui/skins2/x11/x11_factory.cpp | 2 +- modules/misc/lua/vlc.c | 4 ++-- modules/misc/notify/notify.c | 8 +++++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/modules/control/http/http.c b/modules/control/http/http.c index 661fb1fa2d..6a0e593de2 100644 --- a/modules/control/http/http.c +++ b/modules/control/http/http.c @@ -263,10 +263,14 @@ static int Open( vlc_object_t *p_this ) if( ( psz_src == NULL ) || ( *psz_src == '\0' ) ) { - static char const* ppsz_paths[] = { + const char *data_path = config_GetDataDir (); + char buf[strlen (data_path) + sizeof ("/http")]; + snprintf (buf, sizeof (buf), "%s/http", data_path); + + const char const* ppsz_paths[] = { "share/http", "../share/http", - DATA_PATH"/http", + buf, NULL }; unsigned i; diff --git a/modules/gui/skins2/x11/x11_factory.cpp b/modules/gui/skins2/x11/x11_factory.cpp index 442a10bb5e..02fcc178c5 100644 --- a/modules/gui/skins2/x11/x11_factory.cpp +++ b/modules/gui/skins2/x11/x11_factory.cpp @@ -74,7 +74,7 @@ bool X11Factory::init() m_resourcePath.push_back( (string)getIntf()->p_libvlc->psz_datadir + + "/skins2" ); m_resourcePath.push_back( (string)"share/skins2" ); - m_resourcePath.push_back( (string)DATA_PATH + "/skins2" ); + m_resourcePath.push_back( (string)config_GetDataDir () + "/skins2" ); return true; } diff --git a/modules/misc/lua/vlc.c b/modules/misc/lua/vlc.c index 6cd732b985..7d2a356fec 100644 --- a/modules/misc/lua/vlc.c +++ b/modules/misc/lua/vlc.c @@ -432,8 +432,8 @@ int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname, || !S_ISDIR( stat_info.st_mode ) ) { free(ppsz_dir_list[1]); - if( asprintf( &ppsz_dir_list[1], - DATA_PATH DIR_SEP "%s", luadirname ) < 0 ) + if( asprintf( &ppsz_dir_list[1], "%s" DIR_SEP "%s", + config_GetDataDir (), luadirname ) < 0 ) return VLC_ENOMEM; } } diff --git a/modules/misc/notify/notify.c b/modules/misc/notify/notify.c index 793cab8d08..27c2ba22fc 100644 --- a/modules/misc/notify/notify.c +++ b/modules/misc/notify/notify.c @@ -219,7 +219,13 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var, free( psz_arturl ); } else /* else we show state-of-the art logo */ - pix = gdk_pixbuf_new_from_file( DATA_PATH "/vlc48x48.png", &p_error ); + { + const char *data_path = config_GetDataDir (); + char buf[strlen (data_path) + sizeof ("/vlc48x48.png")]; + + snprintf (buf, sizeof (buf), "%s/vlc48x48.png", data_path); + pix = gdk_pixbuf_new_from_file( buf, &p_error ); + } /* we need to replace '&' with '&' because '&' is a keyword of * notification-daemon parser */ -- 2.39.2