Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

cosmetics, remove _P define, leading underscore for var names is rese…

…rved and we collide under android, remove PTH_IC define as well
  • Loading branch information...
commit 8ccc965ac6a7662efcab5da5683beff26368f932 1 parent 9a60f0c
@davilla davilla authored
Showing with 89 additions and 84 deletions.
  1. +4 −4 xbmc/Application.cpp
  2. +4 −4 xbmc/addons/AddonManager.cpp
  3. +1 −1  xbmc/addons/GUIDialogAddonInfo.cpp
  4. +2 −2 xbmc/addons/ScreenSaver.cpp
  5. +1 −1  xbmc/addons/Skin.cpp
  6. +4 −4 xbmc/addons/Visualisation.cpp
  7. +2 −2 xbmc/cdrip/CDDARipper.cpp
  8. +1 −1  xbmc/cores/AudioRenderers/ALSADirectSound.cpp
  9. +1 −1  xbmc/cores/DllLoader/DllLoader.cpp
  10. +1 −1  xbmc/cores/DllLoader/SoLoader.cpp
  11. +7 −7 xbmc/cores/DllLoader/Win32DllLoader.cpp
  12. +3 −3 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
  13. +19 −11 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
  14. +2 −2 xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
  15. +1 −1  xbmc/cores/paplayer/TimidityCodec.cpp
  16. +1 −1  xbmc/dbwrappers/Database.cpp
  17. +1 −1  xbmc/filesystem/RarManager.cpp
  18. +0 −3  xbmc/filesystem/SpecialProtocol.h
  19. +1 −1  xbmc/guilib/AnimatedGif.cpp
  20. +2 −2 xbmc/guilib/GUIColorManager.cpp
  21. +2 −2 xbmc/guilib/GUIFontManager.cpp
  22. +1 −1  xbmc/guilib/GUIFontTTF.cpp
  23. +1 −1  xbmc/guilib/GUISound.cpp
  24. +1 −1  xbmc/guilib/LocalizeStrings.cpp
  25. +1 −1  xbmc/guilib/TextureBundleXBT.cpp
  26. +2 −2 xbmc/guilib/TextureBundleXPR.cpp
  27. +1 −1  xbmc/guilib/XBTFReader.cpp
  28. +2 −2 xbmc/interfaces/http-api/XBMChttp.cpp
  29. +6 −6 xbmc/interfaces/python/XBPyThread.cpp
  30. +7 −7 xbmc/interfaces/python/XBPython.cpp
  31. +2 −2 xbmc/linux/XFileUtils.cpp
  32. +1 −1  xbmc/music/tags/MusicInfoTagLoaderMod.cpp
  33. +1 −1  xbmc/settings/AdvancedSettings.cpp
  34. +1 −1  xbmc/settings/GUIWindowSettingsCategory.cpp
  35. +1 −1  xbmc/storage/windows/Win32StorageProvider.cpp
  36. +1 −1  xbmc/video/Teletext.cpp
View
8 xbmc/Application.cpp
@@ -543,10 +543,10 @@ bool CApplication::Create()
CopyUserDataIfNeeded("special://masterprofile/", "Lircmap.xml");
CopyUserDataIfNeeded("special://masterprofile/", "LCD.xml");
- if (!CLog::Init(_P(g_settings.m_logFolder).c_str()))
+ if (!CLog::Init(CSpecialProtocol::TranslatePath(g_settings.m_logFolder).c_str()))
{
fprintf(stderr,"Could not init logging classes. Permission errors on ~/.xbmc (%s)\n",
- _P(g_settings.m_logFolder).c_str());
+ CSpecialProtocol::TranslatePath(g_settings.m_logFolder).c_str());
return false;
}
@@ -1015,7 +1015,7 @@ bool CApplication::InitDirectoriesWin32()
CSpecialProtocol::SetMasterProfilePath(URIUtils::AddFileToFolder(strWin32UserFolder, "userdata"));
CSpecialProtocol::SetTempPath(URIUtils::AddFileToFolder(strWin32UserFolder,"cache"));
- SetEnvironmentVariable("XBMC_PROFILE_USERDATA",_P("special://masterprofile/").c_str());
+ SetEnvironmentVariable("XBMC_PROFILE_USERDATA",CSpecialProtocol::TranslatePath("special://masterprofile/").c_str());
CreateUserDirs();
@@ -2624,7 +2624,7 @@ bool CApplication::OnAction(const CAction &action)
}
if (action.GetID() == ACTION_GUIPROFILE_BEGIN)
{
- CGUIControlProfiler::Instance().SetOutputFile(_P("special://home/guiprofiler.xml"));
+ CGUIControlProfiler::Instance().SetOutputFile(CSpecialProtocol::TranslatePath("special://home/guiprofiler.xml"));
CGUIControlProfiler::Instance().Start();
return true;
}
View
8 xbmc/addons/AddonManager.cpp
@@ -248,9 +248,9 @@ bool CAddonMgr::Init()
// would allow partial unloading of addon framework
m_cp_context = m_cpluff->create_context(&status);
assert(m_cp_context);
- status = m_cpluff->register_pcollection(m_cp_context, _P("special://home/addons"));
- status = m_cpluff->register_pcollection(m_cp_context, _P("special://xbmc/addons"));
- status = m_cpluff->register_pcollection(m_cp_context, _P("special://xbmcbin/addons"));
+ status = m_cpluff->register_pcollection(m_cp_context, CSpecialProtocol::TranslatePath("special://home/addons"));
+ status = m_cpluff->register_pcollection(m_cp_context, CSpecialProtocol::TranslatePath("special://xbmc/addons"));
+ status = m_cpluff->register_pcollection(m_cp_context, CSpecialProtocol::TranslatePath("special://xbmcbin/addons"));
if (status != CP_OK)
{
CLog::Log(LOGERROR, "ADDONS: Fatal Error, cp_register_pcollection() returned status: %i", status);
@@ -681,7 +681,7 @@ AddonPtr CAddonMgr::GetAddonFromDescriptor(const cp_plugin_info_t *info)
bool CAddonMgr::LoadAddonDescription(const CStdString &path, AddonPtr &addon)
{
cp_status_t status;
- cp_plugin_info_t *info = m_cpluff->load_plugin_descriptor(m_cp_context, _P(path).c_str(), &status);
+ cp_plugin_info_t *info = m_cpluff->load_plugin_descriptor(m_cp_context, CSpecialProtocol::TranslatePath(path).c_str(), &status);
if (info)
{
addon = GetAddonFromDescriptor(info);
View
2  xbmc/addons/GUIDialogAddonInfo.cpp
@@ -129,7 +129,7 @@ void CGUIDialogAddonInfo::OnInitWindow()
void CGUIDialogAddonInfo::UpdateControls()
{
- CStdString xbmcPath = _P("special://xbmc/addons");
+ CStdString xbmcPath = CSpecialProtocol::TranslatePath("special://xbmc/addons");
bool isInstalled = NULL != m_localAddon.get();
bool isSystem = isInstalled && m_localAddon->Path().Left(xbmcPath.size()).Equals(xbmcPath);
bool isEnabled = isInstalled && m_item->GetProperty("Addon.Enabled").asBoolean();
View
4 xbmc/addons/ScreenSaver.cpp
@@ -49,8 +49,8 @@ bool CScreenSaver::CreateScreenSaver()
m_pInfo->height = iHeight;
m_pInfo->pixelRatio = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].fPixelRatio;
m_pInfo->name = strdup(Name().c_str());
- m_pInfo->presets = strdup(_P(Path()).c_str());
- m_pInfo->profile = strdup(_P(Profile()).c_str());
+ m_pInfo->presets = strdup(CSpecialProtocol::TranslatePath(Path()).c_str());
+ m_pInfo->profile = strdup(CSpecialProtocol::TranslatePath(Profile()).c_str());
if (CAddonDll<DllScreenSaver, ScreenSaver, SCR_PROPS>::Create())
return true;
View
2  xbmc/addons/Skin.cpp
@@ -174,7 +174,7 @@ double CSkinInfo::GetMinVersion()
void CSkinInfo::LoadIncludes()
{
- CStdString includesPath = PTH_IC(GetSkinPath("includes.xml"));
+ CStdString includesPath = CSpecialProtocol::TranslatePathConvertCase(GetSkinPath("includes.xml"));
CLog::Log(LOGINFO, "Loading skin includes from %s", includesPath.c_str());
m_includes.ClearIncludes();
m_includes.LoadIncludes(includesPath);
View
8 xbmc/addons/Visualisation.cpp
@@ -100,8 +100,8 @@ bool CVisualisation::Create(int x, int y, int w, int h)
m_pInfo->pixelRatio = g_settings.m_ResInfo[g_graphicsContext.GetVideoResolution()].fPixelRatio;
m_pInfo->name = strdup(Name().c_str());
- m_pInfo->presets = strdup(_P(Path()).c_str());
- m_pInfo->profile = strdup(_P(Profile()).c_str());
+ m_pInfo->presets = strdup(CSpecialProtocol::TranslatePath(Path()).c_str());
+ m_pInfo->profile = strdup(CSpecialProtocol::TranslatePath(Profile()).c_str());
m_pInfo->submodule = NULL;
if (CAddonDll<DllVisualisation, Visualisation, VIS_PROPS>::Create())
@@ -122,7 +122,7 @@ bool CVisualisation::Create(int x, int y, int w, int h)
GetPresets();
if (GetSubModules())
- m_pInfo->submodule = strdup(_P(m_submodules.front()).c_str());
+ m_pInfo->submodule = strdup(CSpecialProtocol::TranslatePath(m_submodules.front()).c_str());
else
m_pInfo->submodule = NULL;
@@ -359,7 +359,7 @@ bool CVisualisation::UpdateTrack()
if (Initialized())
{
// get the current album art filename
- m_AlbumThumb = _P(g_infoManager.GetImage(MUSICPLAYER_COVER, WINDOW_INVALID));
+ m_AlbumThumb = CSpecialProtocol::TranslatePath(g_infoManager.GetImage(MUSICPLAYER_COVER, WINDOW_INVALID));
// get the current track tag
const CMusicInfoTag* tag = g_infoManager.GetCurrentSongTag();
View
4 xbmc/cdrip/CDDARipper.cpp
@@ -160,10 +160,10 @@ bool CCDDARipper::Rip(const CStdString& strTrackFile, const CStdString& strFile,
{
char tmp[MAX_PATH];
#ifndef _LINUX
- GetTempFileName(_P("special://temp/"), "riptrack", 0, tmp);
+ GetTempFileName(CSpecialProtocol::TranslatePath("special://temp/"), "riptrack", 0, tmp);
#else
int fd;
- strncpy(tmp, _P("special://temp/riptrackXXXXXX"), MAX_PATH);
+ strncpy(tmp, CSpecialProtocol::TranslatePath("special://temp/riptrackXXXXXX"), MAX_PATH);
if ((fd = mkstemp(tmp)) == -1)
strFilename = "";
close(fd);
View
2  xbmc/cores/AudioRenderers/ALSADirectSound.cpp
@@ -175,7 +175,7 @@ bool CALSADirectSound::Initialize(IAudioCallback* pCallback, const CStdString& d
if(deviceuse != device)
{
snd_input_t* input;
- nErr = snd_input_stdio_open(&input, _P("special://xbmc/system/asound.conf").c_str(), "r");
+ nErr = snd_input_stdio_open(&input, CSpecialProtocol::TranslatePath("special://xbmc/system/asound.conf").c_str(), "r");
if(nErr >= 0)
{
nErr = snd_config_load(config, input);
View
2  xbmc/cores/DllLoader/DllLoader.cpp
@@ -156,7 +156,7 @@ int DllLoader::Parse()
int iResult = 0;
CStdString strFileName= GetFileName();
- FILE* fp = fopen_utf8(_P(strFileName).c_str(), "rb");
+ FILE* fp = fopen_utf8(CSpecialProtocol::TranslatePath(strFileName).c_str(), "rb");
if (fp)
{
View
2  xbmc/cores/DllLoader/SoLoader.cpp
@@ -43,7 +43,7 @@ bool SoLoader::Load()
if (m_soHandle != NULL)
return true;
- CStdString strFileName= _P(GetFileName());
+ CStdString strFileName= CSpecialProtocol::TranslatePath(GetFileName());
int flags = RTLD_LAZY;
if (m_bGlobal) flags |= RTLD_GLOBAL;
if (strFileName == "xbmc.so")
View
14 xbmc/cores/DllLoader/Win32DllLoader.cpp
@@ -158,7 +158,7 @@ bool Win32DllLoader::Load()
CStdString strFileName = GetFileName();
CStdStringW strDllW;
- g_charsetConverter.utf8ToW(_P(strFileName), strDllW);
+ g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(strFileName), strDllW);
m_dllHandle = LoadLibraryExW(strDllW.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if (!m_dllHandle)
{
@@ -166,7 +166,7 @@ bool Win32DllLoader::Load()
DWORD dw = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, 0, (LPTSTR) &lpMsgBuf, 0, NULL );
- CLog::Log(LOGERROR, "%s: Failed to load %s with error %d:%s", __FUNCTION__, _P(strFileName).c_str(), dw, lpMsgBuf);
+ CLog::Log(LOGERROR, "%s: Failed to load %s with error %d:%s", __FUNCTION__, CSpecialProtocol::TranslatePath(strFileName).c_str(), dw, lpMsgBuf);
LocalFree(lpMsgBuf);
return false;
}
@@ -234,7 +234,7 @@ bool Win32DllLoader::HasSymbols()
void Win32DllLoader::OverrideImports(const CStdString &dll)
{
CStdStringW strdllW;
- g_charsetConverter.utf8ToW(_P(dll), strdllW, false);
+ g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(dll), strdllW, false);
BYTE* image_base = (BYTE*)GetModuleHandleW(strdllW.c_str());
if (!image_base)
@@ -329,7 +329,7 @@ bool Win32DllLoader::NeedsHooking(const char *dllName)
}
}
CStdStringW strdllNameW;
- g_charsetConverter.utf8ToW(_P(dllName), strdllNameW, false);
+ g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(dllName), strdllNameW, false);
HMODULE hModule = GetModuleHandleW(strdllNameW.c_str());
wchar_t filepathW[MAX_PATH];
GetModuleFileNameW(hModule, filepathW, MAX_PATH);
@@ -337,9 +337,9 @@ bool Win32DllLoader::NeedsHooking(const char *dllName)
g_charsetConverter.wToUTF8(filepathW, dllPath);
// compare this filepath with some special directories
- CStdString xbmcPath = _P("special://xbmc");
- CStdString homePath = _P("special://home");
- CStdString tempPath = _P("special://temp");
+ CStdString xbmcPath = CSpecialProtocol::TranslatePath("special://xbmc");
+ CStdString homePath = CSpecialProtocol::TranslatePath("special://home");
+ CStdString tempPath = CSpecialProtocol::TranslatePath("special://temp");
return ((strncmp(xbmcPath.c_str(), dllPath.c_str(), xbmcPath.GetLength()) == 0) ||
(strncmp(homePath.c_str(), dllPath.c_str(), homePath.GetLength()) == 0) ||
(strncmp(tempPath.c_str(), dllPath.c_str(), tempPath.GetLength()) == 0));
View
6 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
@@ -168,12 +168,12 @@ extern "C" HANDLE WINAPI dllFindFirstFileA(LPCTSTR lpFileName, LPWIN32_FIND_DATA
#ifdef _WIN32
struct _WIN32_FIND_DATAW FindFileDataW;
CStdStringW strwfile;
- g_charsetConverter.utf8ToW(_P(p), strwfile, false);
+ g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(p), strwfile, false);
HANDLE res = FindFirstFileW(strwfile.c_str(), &FindFileDataW);
if (res != INVALID_HANDLE_VALUE)
to_WIN32_FIND_DATA(&FindFileDataW, lpFindFileData);
#else
- HANDLE res = FindFirstFile(_P(p).c_str(), lpFindFileData);
+ HANDLE res = FindFirstFile(CSpecialProtocol::TranslatePath(p).c_str(), lpFindFileData);
#endif
free(p);
return res;
@@ -986,7 +986,7 @@ extern "C" HANDLE WINAPI dllCreateFileA(
IN HANDLE hTemplateFile
)
{
- return CreateFileA(_P(lpFileName), dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
+ return CreateFileA(CSpecialProtocol::TranslatePath(lpFileName), dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
}
extern "C" BOOL WINAPI dllLockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOffBytesToLockLow, DWORD nNumberOffBytesToLockHigh)
View
30 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
@@ -148,15 +148,23 @@ extern "C" void __stdcall init_emu_environ()
{
// using external python, it's build looking for xxx/lib/python2.6
// so point it to frameworks which is where python2.6 is located
- dll_putenv(string("PYTHONPATH=" + _P("special://frameworks")).c_str());
- dll_putenv(string("PYTHONHOME=" + _P("special://frameworks")).c_str());
- dll_putenv(string("PATH=.;" + _P("special://xbmc") + ";" + _P("special://frameworks")).c_str());
+ dll_putenv(string("PYTHONPATH=" +
+ CSpecialProtocol::TranslatePath("special://frameworks")).c_str());
+ dll_putenv(string("PYTHONHOME=" +
+ CSpecialProtocol::TranslatePath("special://frameworks")).c_str());
+ dll_putenv(string("PATH=.;" +
+ CSpecialProtocol::TranslatePath("special://xbmc") + ";" +
+ CSpecialProtocol::TranslatePath("special://frameworks")).c_str());
}
else
{
- dll_putenv(string("PYTHONPATH=" + _P("special://xbmc/system/python/DLLs") + ";" + _P("special://xbmc/system/python/Lib")).c_str());
- dll_putenv(string("PYTHONHOME=" + _P("special://xbmc/system/python")).c_str());
- dll_putenv(string("PATH=.;" + _P("special://xbmc") + ";" + _P("special://xbmc/system/python")).c_str());
+ dll_putenv(string("PYTHONPATH=" +
+ CSpecialProtocol::TranslatePath("special://xbmc/system/python/DLLs") + ";" +
+ CSpecialProtocol::TranslatePath("special://xbmc/system/python/Lib")).c_str());
+ dll_putenv(string("PYTHONHOME=" +
+ CSpecialProtocol::TranslatePath("special://xbmc/system/python")).c_str());
+ dll_putenv(string("PATH=.;" + CSpecialProtocol::TranslatePath("special://xbmc") + ";" +
+ CSpecialProtocol::TranslatePath("special://xbmc/system/python")).c_str());
}
//dll_putenv("PYTHONCASEOK=1");
//dll_putenv("PYTHONDEBUG=1");
@@ -528,7 +536,7 @@ extern "C"
else if (!IS_STD_STREAM(stream))
{
// Translate the path
- return freopen(_P(path).c_str(), mode, stream);
+ return freopen(CSpecialProtocol::TranslatePath(path).c_str(), mode, stream);
}
// error
@@ -768,7 +776,7 @@ extern "C"
{
char str[1024];
int size = sizeof(str);
- CURL url(_P(file));
+ CURL url(CSpecialProtocol::TranslatePath(file));
if (url.IsLocal())
{
// move to CFile classes
@@ -792,7 +800,7 @@ extern "C"
// Make sure the slashes are correct & translate the path
struct _wfinddata64i32_t wdata;
CStdStringW strwfile;
- g_charsetConverter.utf8ToW(CUtil::ValidatePath(_P(str)), strwfile, false);
+ g_charsetConverter.utf8ToW(CUtil::ValidatePath(CSpecialProtocol::TranslatePath(str)), strwfile, false);
intptr_t ret = _wfindfirst64i32(strwfile.c_str(), &wdata);
if (ret != -1)
to_finddata64i32(&wdata, data);
@@ -928,7 +936,7 @@ extern "C"
DIR *dll_opendir(const char *file)
{
- CURL url(_P(file));
+ CURL url(CSpecialProtocol::TranslatePath(file));
if (url.IsLocal())
{ // Make sure the slashes are correct & translate the path
return opendir(CUtil::ValidatePath(url.Get().c_str()));
@@ -1892,7 +1900,7 @@ extern "C"
if (!dir) return -1;
// Make sure the slashes are correct & translate the path
- CStdString strPath = CUtil::ValidatePath(_P(dir));
+ CStdString strPath = CUtil::ValidatePath(CSpecialProtocol::TranslatePath(dir));
#ifndef _LINUX
CStdStringW strWPath;
g_charsetConverter.utf8ToW(strPath, strWPath, false);
View
4 xbmc/cores/dvdplayer/DVDSubtitles/DVDSubtitlesLibass.cpp
@@ -64,7 +64,7 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
CLog::Log(LOGINFO, "CDVDSubtitlesLibass: Initializing ASS library font settings");
// libass uses fontconfig (system lib) which is not wrapped
// so translate the path before calling into libass
- m_dll.ass_set_fonts_dir(m_library, _P(strPath).c_str());
+ m_dll.ass_set_fonts_dir(m_library, CSpecialProtocol::TranslatePath(strPath).c_str());
m_dll.ass_set_extract_fonts(m_library, 1);
m_dll.ass_set_style_overrides(m_library, NULL);
@@ -86,7 +86,7 @@ CDVDSubtitlesLibass::CDVDSubtitlesLibass()
// libass uses fontconfig (system lib) which is not wrapped
// so translate the path before calling into libass
- m_dll.ass_set_fonts(m_renderer, _P(strPath).c_str(), "Arial", fc, NULL, 1);
+ m_dll.ass_set_fonts(m_renderer, CSpecialProtocol::TranslatePath(strPath).c_str(), "Arial", fc, NULL, 1);
}
View
2  xbmc/cores/paplayer/TimidityCodec.cpp
@@ -114,7 +114,7 @@ bool TimidityCodec::Init(const CStdString &strFile, unsigned int filecache)
url.Parse(file);
}
- m_mid = m_dll.LoadMID(_P(url.Get()).c_str());
+ m_mid = m_dll.LoadMID(CSpecialProtocol::TranslatePath(url.Get()).c_str());
if (!m_mid)
{
CLog::Log(LOGERROR,"TimidityCodec: error opening file %s: %s",strFile.c_str(), m_dll.ErrorMsg());
View
2  xbmc/dbwrappers/Database.cpp
@@ -278,7 +278,7 @@ bool CDatabase::Open(const DatabaseSettings &settings)
else
{
dbSettings.type = "sqlite3";
- dbSettings.host = _P(g_settings.GetDatabaseFolder());
+ dbSettings.host = CSpecialProtocol::TranslatePath(g_settings.GetDatabaseFolder());
dbSettings.name = GetBaseDBName();
}
View
2  xbmc/filesystem/RarManager.cpp
@@ -452,7 +452,7 @@ void CRarManager::ExtractArchive(const CStdString& strArchive, const CStdString&
int64_t CRarManager::CheckFreeSpace(const CStdString& strDrive)
{
ULARGE_INTEGER lTotalFreeBytes;
- if (GetDiskFreeSpaceEx(_P(strDrive.c_str()), NULL, NULL, &lTotalFreeBytes))
+ if (GetDiskFreeSpaceEx(CSpecialProtocol::TranslatePath(strDrive.c_str()), NULL, NULL, &lTotalFreeBytes))
return lTotalFreeBytes.QuadPart;
return 0;
View
3  xbmc/filesystem/SpecialProtocol.h
@@ -78,9 +78,6 @@ class CSpecialProtocol
static std::map<CStdString, CStdString> m_pathMap;
};
-#define _P(x) CSpecialProtocol::TranslatePath(x)
-#define PTH_IC(x) CSpecialProtocol::TranslatePathConvertCase(x)
-
#ifdef _WIN32
#define PATH_SEPARATOR_CHAR '\\'
#define PATH_SEPARATOR_STRING "\\"
View
2  xbmc/guilib/AnimatedGif.cpp
@@ -224,7 +224,7 @@ int CAnimatedGifSet::LoadGIF (const char * szFileName)
int GraphicExtensionFound = 0;
// OPEN FILE
- FILE *fd = fopen_utf8(_P(szFileName), "rb");
+ FILE *fd = fopen_utf8(CSpecialProtocol::TranslatePath(szFileName), "rb");
if (!fd)
{
return 0;
View
4 xbmc/guilib/GUIColorManager.cpp
@@ -49,7 +49,7 @@ void CGUIColorManager::Load(const CStdString &colorFile)
// load the global color map if it exists
TiXmlDocument xmlDoc;
- if (xmlDoc.LoadFile(PTH_IC("special://xbmc/system/colors.xml")))
+ if (xmlDoc.LoadFile(CSpecialProtocol::TranslatePathConvertCase("special://xbmc/system/colors.xml")))
LoadXML(xmlDoc);
// first load the default color map if it exists
@@ -57,7 +57,7 @@ void CGUIColorManager::Load(const CStdString &colorFile)
URIUtils::AddFileToFolder(g_SkinInfo->Path(), "colors", basePath);
URIUtils::AddFileToFolder(basePath, "defaults.xml", path);
- if (xmlDoc.LoadFile(PTH_IC(path)))
+ if (xmlDoc.LoadFile(CSpecialProtocol::TranslatePathConvertCase(path)))
LoadXML(xmlDoc);
// now the color map requested
View
4 xbmc/guilib/GUIFontManager.cpp
@@ -80,7 +80,7 @@ static bool CheckFont(CStdString& strPath, const CStdString& newPath,
{
strPath = URIUtils::AddFileToFolder(newPath,filename);
#ifdef _LINUX
- strPath = PTH_IC(strPath);
+ strPath = CSpecialProtocol::TranslatePathConvertCase(strPath);
#endif
return false;
}
@@ -114,7 +114,7 @@ CGUIFont* GUIFontManager::LoadTTF(const CStdString& strFontName, const CStdStrin
strPath = strFilename;
#ifdef _LINUX
- strPath = PTH_IC(strPath);
+ strPath = CSpecialProtocol::TranslatePathConvertCase(strPath);
#endif
// Check if the file exists, otherwise try loading it from the global media dir
View
2  xbmc/guilib/GUIFontTTF.cpp
@@ -82,7 +82,7 @@ class CFreeTypeLibrary
FT_Face face;
// ok, now load the font face
- if (FT_New_Face( m_library, _P(filename).c_str(), 0, &face ))
+ if (FT_New_Face( m_library, CSpecialProtocol::TranslatePath(filename).c_str(), 0, &face ))
return NULL;
unsigned int ydpi = GetDPI();
View
2  xbmc/guilib/GUISound.cpp
@@ -80,7 +80,7 @@ bool CGUISound::Load(const CStdString& strFile)
return bReady;
#elif defined(HAS_SDL_AUDIO)
- m_soundBuffer = Mix_LoadWAV(_P(strFile));
+ m_soundBuffer = Mix_LoadWAV(CSpecialProtocol::TranslatePath(strFile));
if (!m_soundBuffer)
return false;
View
2  xbmc/guilib/LocalizeStrings.cpp
@@ -73,7 +73,7 @@ bool CLocalizeStrings::LoadSkinStrings(const CStdString& path, const CStdString&
bool CLocalizeStrings::LoadXML(const CStdString &filename, CStdString &encoding, uint32_t offset /* = 0 */)
{
TiXmlDocument xmlDoc;
- if (!xmlDoc.LoadFile(PTH_IC(filename)))
+ if (!xmlDoc.LoadFile(CSpecialProtocol::TranslatePathConvertCase(filename)))
{
CLog::Log(LOGDEBUG, "unable to load %s: %s at line %d", filename.c_str(), xmlDoc.ErrorDesc(), xmlDoc.ErrorRow());
return false;
View
2  xbmc/guilib/TextureBundleXBT.cpp
@@ -75,7 +75,7 @@ bool CTextureBundleXBT::OpenBundle()
strPath = URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), "media/Textures.xbt");
}
- strPath = PTH_IC(strPath);
+ strPath = CSpecialProtocol::TranslatePathConvertCase(strPath);
// Load the texture file
if (!m_XBTFReader.Open(strPath))
View
4 xbmc/guilib/TextureBundleXPR.cpp
@@ -138,11 +138,11 @@ bool CTextureBundleXPR::OpenBundle()
else
strPath = URIUtils::AddFileToFolder(g_graphicsContext.GetMediaDir(), "media/Textures.xpr");
- strPath = PTH_IC(strPath);
+ strPath = CSpecialProtocol::TranslatePathConvertCase(strPath);
#ifndef _LINUX
CStdStringW strPathW;
- g_charsetConverter.utf8ToW(_P(strPath), strPathW, false);
+ g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(strPath), strPathW, false);
m_hFile = _wfopen(strPathW.c_str(), L"rb");
#else
m_hFile = fopen(strPath.c_str(), "rb");
View
2  xbmc/guilib/XBTFReader.cpp
@@ -60,7 +60,7 @@ bool CXBTFReader::Open(const CStdString& fileName)
#ifdef _WIN32
CStdStringW strPathW;
- g_charsetConverter.utf8ToW(_P(m_fileName), strPathW, false);
+ g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(m_fileName), strPathW, false);
m_file = _wfopen(strPathW.c_str(), L"rb");
#else
m_file = fopen(m_fileName.c_str(), "rb");
View
4 xbmc/interfaces/http-api/XBMChttp.cpp
@@ -187,9 +187,9 @@ bool CXbmcHttp::decodeBase64ToFile( const CStdString &inString, const CStdString
try
{
if (append)
- outfile = fopen_utf8(_P(outfilename).c_str(), "ab" );
+ outfile = fopen_utf8(CSpecialProtocol::TranslatePath(outfilename).c_str(), "ab" );
else
- outfile = fopen_utf8(_P(outfilename).c_str(), "wb" );
+ outfile = fopen_utf8(CSpecialProtocol::TranslatePath(outfilename).c_str(), "wb" );
while( ptr < inString.length() )
{
for( len = 0, i = 0; i < 4 && ptr < inString.length(); i++ )
View
12 xbmc/interfaces/python/XBPyThread.cpp
@@ -154,7 +154,7 @@ void XBPyThread::Process()
// get path from script file name and add python path's
// this is used for python so it will search modules from script path first
CStdString scriptDir;
- URIUtils::GetDirectory(_P(m_source), scriptDir);
+ URIUtils::GetDirectory(CSpecialProtocol::TranslatePath(m_source), scriptDir);
URIUtils::RemoveSlashAtEnd(scriptDir);
CStdString path = scriptDir;
@@ -164,12 +164,12 @@ void XBPyThread::Process()
for (unsigned int i = 0; i < addons.size(); ++i)
#ifdef TARGET_WINDOWS
{
- CStdString strTmp(_P(addons[i]->LibPath()));
+ CStdString strTmp(CSpecialProtocol::TranslatePath(addons[i]->LibPath()));
g_charsetConverter.utf8ToSystem(strTmp);
path += PY_PATH_SEP + strTmp;
}
#else
- path += PY_PATH_SEP + _P(addons[i]->LibPath());
+ path += PY_PATH_SEP + CSpecialProtocol::TranslatePath(addons[i]->LibPath());
#endif
// and add on whatever our default path is
@@ -234,12 +234,12 @@ void XBPyThread::Process()
// We need to have python open the file because on Windows the DLL that python
// is linked against may not be the DLL that xbmc is linked against so
// passing a FILE* to python from an fopen has the potential to crash.
- PyObject* file = PyFile_FromString((char *) _P(m_source).c_str(), (char*)"r");
+ PyObject* file = PyFile_FromString((char *) CSpecialProtocol::TranslatePath(m_source).c_str(), (char*)"r");
FILE *fp = PyFile_AsFile(file);
if (fp)
{
- PyObject *f = PyString_FromString(_P(m_source).c_str());
+ PyObject *f = PyString_FromString(CSpecialProtocol::TranslatePath(m_source).c_str());
PyDict_SetItemString(moduleDict, "__file__", f);
if (addon.get() != NULL)
{
@@ -253,7 +253,7 @@ void XBPyThread::Process()
CLog::Log(LOGDEBUG,"Instantiating addon using automatically obtained id of \"%s\" dependent on version %s of the xbmc.python api",addon->ID().c_str(),version.c_str());
}
Py_DECREF(f);
- PyRun_FileExFlags(fp, _P(m_source).c_str(), m_Py_file_input, moduleDict, moduleDict,1,NULL);
+ PyRun_FileExFlags(fp, CSpecialProtocol::TranslatePath(m_source).c_str(), m_Py_file_input, moduleDict, moduleDict,1,NULL);
}
else
CLog::Log(LOGERROR, "%s not found!", m_source);
View
14 xbmc/interfaces/python/XBPython.cpp
@@ -344,10 +344,10 @@ void XBPython::Initialize()
{
// using external python, it's build looking for xxx/lib/python2.6
// so point it to frameworks which is where python2.6 is located
- setenv("PYTHONHOME", _P("special://frameworks").c_str(), 1);
- setenv("PYTHONPATH", _P("special://frameworks").c_str(), 1);
- CLog::Log(LOGDEBUG, "PYTHONHOME -> %s", _P("special://frameworks").c_str());
- CLog::Log(LOGDEBUG, "PYTHONPATH -> %s", _P("special://frameworks").c_str());
+ setenv("PYTHONHOME", CSpecialProtocol::TranslatePath("special://frameworks").c_str(), 1);
+ setenv("PYTHONPATH", CSpecialProtocol::TranslatePath("special://frameworks").c_str(), 1);
+ CLog::Log(LOGDEBUG, "PYTHONHOME -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());
+ CLog::Log(LOGDEBUG, "PYTHONPATH -> %s", CSpecialProtocol::TranslatePath("special://frameworks").c_str());
}
setenv("PYTHONCASEOK", "1", 1); //This line should really be removed
#elif defined(_WIN32)
@@ -356,11 +356,11 @@ void XBPython::Initialize()
// buf is corrupted after putenv and might need a strdup but it seems to
// work this way
CStdString buf;
- buf = "PYTHONPATH=" + _P("special://xbmc/system/python/DLLs") + ";" + _P("special://xbmc/system/python/Lib");
+ buf = "PYTHONPATH=" + CSpecialProtocol::TranslatePath("special://xbmc/system/python/DLLs") + ";" + CSpecialProtocol::TranslatePath("special://xbmc/system/python/Lib");
pgwin32_putenv(buf.c_str());
buf = "PYTHONOPTIMIZE=1";
pgwin32_putenv(buf.c_str());
- buf = "PYTHONHOME=" + _P("special://xbmc/system/python");
+ buf = "PYTHONHOME=" + CSpecialProtocol::TranslatePath("special://xbmc/system/python");
pgwin32_putenv(buf.c_str());
buf = "OS=win32";
pgwin32_putenv(buf.c_str());
@@ -465,7 +465,7 @@ void XBPython::Process()
m_bLogin = false;
// autoexec.py - profile
- CStdString strAutoExecPy = _P("special://profile/autoexec.py");
+ CStdString strAutoExecPy = CSpecialProtocol::TranslatePath("special://profile/autoexec.py");
if ( XFILE::CFile::Exists(strAutoExecPy) )
evalFile(strAutoExecPy,ADDON::AddonPtr());
View
4 xbmc/linux/XFileUtils.cpp
@@ -251,7 +251,7 @@ HANDLE CreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess,
{
// Failed to open file. maybe due to case sensitivity.
// Try opening the same name in lower case.
- CStdString igFileName = PTH_IC(lpFileName);
+ CStdString igFileName = CSpecialProtocol::TranslatePathConvertCase(lpFileName);
fd = open(igFileName.c_str(), flags, mode);
if (fd != -1)
{
@@ -576,7 +576,7 @@ BOOL GetDiskFreeSpaceEx(
{
struct statfs64 fsInfo;
- if (statfs64(_P(lpDirectoryName), &fsInfo) != 0)
+ if (statfs64(CSpecialProtocol::TranslatePath(lpDirectoryName), &fsInfo) != 0)
return false;
if (lpFreeBytesAvailable)
View
2  xbmc/music/tags/MusicInfoTagLoaderMod.cpp
@@ -52,7 +52,7 @@ bool CMusicInfoTagLoaderMod::Load(const CStdString& strFileName, CMusicInfoTag&
tag.SetLoaded(false);
return( false );
}
- ifstream inMDZ(_P(strMDZ.c_str()));
+ ifstream inMDZ(CSpecialProtocol::TranslatePath(strMDZ.c_str()));
char temp[8192];
char temp2[8192];
View
2  xbmc/settings/AdvancedSettings.cpp
@@ -832,7 +832,7 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
CStdString strFrom, strTo;
TiXmlNode* pFrom = pSubstitute->FirstChild("from");
if (pFrom)
- strFrom = _P(pFrom->FirstChild()->Value()).c_str();
+ strFrom = CSpecialProtocol::TranslatePath(pFrom->FirstChild()->Value()).c_str();
TiXmlNode* pTo = pSubstitute->FirstChild("to");
if (pTo)
strTo = pTo->FirstChild()->Value();
View
2  xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -2491,7 +2491,7 @@ void CGUIWindowSettingsCategory::FillInSkinColors(CSetting *pSetting)
URIUtils::AddFileToFolder(g_SkinInfo->Path(),"colors",strPath);
CFileItemList items;
- CDirectory::GetDirectory(PTH_IC(strPath), items, ".xml");
+ CDirectory::GetDirectory(CSpecialProtocol::TranslatePathConvertCase(strPath), items, ".xml");
// Search for Themes in the Current skin!
for (int i = 0; i < items.Size(); ++i)
{
View
2  xbmc/storage/windows/Win32StorageProvider.cpp
@@ -46,7 +46,7 @@ void CWin32StorageProvider::Initialize()
void CWin32StorageProvider::GetLocalDrives(VECSOURCES &localDrives)
{
CMediaSource share;
- share.strPath = _P("special://home");
+ share.strPath = CSpecialProtocol::TranslatePath("special://home");
share.strName = g_localizeStrings.Get(21440);
share.m_ignore = true;
share.m_iDriveType = CMediaSource::SOURCE_TYPE_LOCAL;
View
2  xbmc/video/Teletext.cpp
@@ -413,7 +413,7 @@ CTeletextDecoder::CTeletextDecoder()
{
memset(&m_RenderInfo, 0, sizeof(TextRenderInfo_t));
- m_teletextFont = _P(TeletextFont);
+ m_teletextFont = CSpecialProtocol::TranslatePath(TeletextFont);
m_TextureBuffer = NULL;
m_txtCache = NULL;
m_Manager = NULL;
Please sign in to comment.
Something went wrong with that request. Please try again.