diff options
-rw-r--r-- | xbmc/interfaces/legacy/ModuleXbmc.cpp | 4 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/ModuleXbmc.h | 1 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/ModuleXbmcvfs.cpp | 8 | ||||
-rw-r--r-- | xbmc/interfaces/legacy/ModuleXbmcvfs.h | 29 |
4 files changed, 41 insertions, 1 deletions
diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp index d621f133c6..0615e832d2 100644 --- a/xbmc/interfaces/legacy/ModuleXbmc.cpp +++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp @@ -22,7 +22,7 @@ #include "aojsonrpc.h" #include "cores/AudioEngine/Interfaces/AE.h" #include "filesystem/File.h" -#include "filesystem/SpecialProtocol.h" +#include "filesystem/SpecialProtocol.h" //! @todo remove me when dropping translatePath from this file #include "guilib/GUIAudioManager.h" #include "guilib/GUIWindowManager.h" #include "guilib/LocalizeStrings.h" @@ -380,6 +380,8 @@ namespace XBMCAddon String translatePath(const String& path) { XBMC_TRACE; + CLog::Log(LOGWARNING, "xbmc.translatePath is deprecated and might be removed in future kodi " + "versions. Please use xbmcvfs.translatePath instead."); return CSpecialProtocol::TranslatePath(path); } diff --git a/xbmc/interfaces/legacy/ModuleXbmc.h b/xbmc/interfaces/legacy/ModuleXbmc.h index 9a4cfd0bbf..38e92367cf 100644 --- a/xbmc/interfaces/legacy/ModuleXbmc.h +++ b/xbmc/interfaces/legacy/ModuleXbmc.h @@ -625,6 +625,7 @@ namespace XBMCAddon /// /// /// ------------------------------------------------------------------------ + /// @python_v19 Deprecated **xbmc.translatePath**. Moved to **xbmcvfs.translatePath** /// /// **Example:** /// ~~~~~~~~~~~~~{.py} diff --git a/xbmc/interfaces/legacy/ModuleXbmcvfs.cpp b/xbmc/interfaces/legacy/ModuleXbmcvfs.cpp index 495f9bd425..8d02894b5e 100644 --- a/xbmc/interfaces/legacy/ModuleXbmcvfs.cpp +++ b/xbmc/interfaces/legacy/ModuleXbmcvfs.cpp @@ -13,6 +13,7 @@ #include "Util.h" #include "filesystem/Directory.h" #include "filesystem/File.h" +#include "filesystem/SpecialProtocol.h" #include "utils/FileUtils.h" #include "utils/URIUtils.h" @@ -57,6 +58,13 @@ namespace XBMCAddon return CUtil::MakeLegalPath(filename); } + // translate path + String translatePath(const String& path) + { + XBMC_TRACE; + return CSpecialProtocol::TranslatePath(path); + } + // validate path String validatePath(const String& path) { diff --git a/xbmc/interfaces/legacy/ModuleXbmcvfs.h b/xbmc/interfaces/legacy/ModuleXbmcvfs.h index b5380162c6..7e8226bce7 100644 --- a/xbmc/interfaces/legacy/ModuleXbmcvfs.h +++ b/xbmc/interfaces/legacy/ModuleXbmcvfs.h @@ -170,6 +170,35 @@ namespace XBMCAddon #ifdef DOXYGEN_SHOULD_USE_THIS /// /// \ingroup python_xbmcvfs + /// @brief \python_func{ xbmcvfs.translatePath(path) } + /// Returns the translated path. + /// + /// @param path string - Path to format + /// @return Translated path + /// + /// @note Only useful if you are coding for both Linux and Windows. + /// e.g. Converts 'special://home' -> '/home/[username]/.kodi' + /// on Linux. + /// + /// + /// ------------------------------------------------------------------------ + /// @python_v19 New function added (replaces old **xbmc.translatePath**) + /// + /// **Example:** + /// ~~~~~~~~~~~~~{.py} + /// .. + /// fpath = xbmcvfs.translatePath('special://home') + /// .. + /// ~~~~~~~~~~~~~ + /// + translatePath(...); +#else + String translatePath(const String& path); +#endif + +#ifdef DOXYGEN_SHOULD_USE_THIS + /// + /// \ingroup python_xbmcvfs /// @brief \python_func{ xbmcvfs.validatePath(path) } /// Returns the validated path. /// |