aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Haupt <w.haupt@at-visions.com>2013-07-18 17:05:33 +0200
committerWolfgang Haupt <w.haupt@at-visions.com>2013-07-19 10:29:05 +0200
commit1d82f056834556287eb1f5e7103cfc82e76bc9bd (patch)
tree4530c27275ee6c53e853ba839cfad7ef63d11fcb
parent24d57e763f0842451c26eb56574ac6e5f0a0744c (diff)
[WebServer] Simplify file existence check
-rw-r--r--xbmc/network/WebServer.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp
index 63d677900b..f929dffb6a 100644
--- a/xbmc/network/WebServer.cpp
+++ b/xbmc/network/WebServer.cpp
@@ -838,17 +838,7 @@ void CWebServer::SetCredentials(const string &username, const string &password)
bool CWebServer::PrepareDownload(const char *path, CVariant &details, std::string &protocol)
{
- bool exists = false;
- CFile *file = new CFile();
- if (file->Open(path))
- {
- exists = true;
- file->Close();
- }
-
- delete file;
-
- if (exists)
+ if (CFile::Exists(path))
{
protocol = "http";
string url;
@@ -861,9 +851,10 @@ bool CWebServer::PrepareDownload(const char *path, CVariant &details, std::strin
CURL::Encode(strPath);
url += strPath;
details["path"] = url;
+ return true;
}
- return exists;
+ return false;
}
bool CWebServer::Download(const char *path, CVariant &result)