Skip to content
Browse files

changed: Move actual protocol translation in a seperate static function

  • Loading branch information...
1 parent 2343a50 commit f23a9efd37073a2cef6c4d557c4b6eb2259fa60f arnova committed
Showing with 21 additions and 13 deletions.
  1. +19 −13 xbmc/URL.cpp
  2. +2 −0 xbmc/URL.h
View
32 xbmc/URL.cpp
@@ -433,19 +433,7 @@ const CStdString& CURL::GetProtocol() const
const CStdString CURL::GetTranslatedProtocol() const
{
- if (m_strProtocol == "shout"
- || m_strProtocol == "daap"
- || m_strProtocol == "dav"
- || m_strProtocol == "tuxbox"
- || m_strProtocol == "lastfm"
- || m_strProtocol == "mms"
- || m_strProtocol == "rss")
- return "http";
-
- if (m_strProtocol == "davs")
- return "https";
-
- return m_strProtocol;
+ return TranslateProtocol(m_strProtocol);
}
const CStdString& CURL::GetFileType() const
@@ -715,3 +703,21 @@ void CURL::Encode(CStdString& strURLData)
}
strURLData = strResult;
}
+
+CStdString CURL::TranslateProtocol(const CStdString& prot)
+{
+ if (prot == "shout"
+ || prot == "daap"
+ || prot == "dav"
+ || prot == "tuxbox"
+ || prot == "lastfm"
+ || prot == "mms"
+ || prot == "rss")
+ return "http";
+
+ if (prot == "davs")
+ return "https";
+
+ return prot;
+}
+
View
2 xbmc/URL.h
@@ -71,6 +71,8 @@ class CURL
static bool IsFullPath(const CStdString &url); ///< return true if the url includes the full path
static void Decode(CStdString& strURLData);
static void Encode(CStdString& strURLData);
+ static CStdString TranslateProtocol(const CStdString& prot);
+
protected:
int m_iPort;
CStdString m_strHostName;

0 comments on commit f23a9ef

Please sign in to comment.
Something went wrong with that request. Please try again.