aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2018-11-26 17:50:21 +0100
committerGitHub <noreply@github.com>2018-11-26 17:50:21 +0100
commit101e80619a294481dfe301baf7f7c306771b0313 (patch)
tree248c306805215c7b2805fcc3eb19b589950ce8b0
parentca5e96279a295a7174c1615491b50db4bf4a40e9 (diff)
parent04c23c1f30142c85762aa2e790ce5758fa0f3679 (diff)
Merge pull request #14918 from Rechi/fix/fsFactory
[fix] remove network available checks in C(Directory|File)Factory
-rw-r--r--xbmc/filesystem/DirectoryFactory.cpp24
-rw-r--r--xbmc/filesystem/FileFactory.cpp30
2 files changed, 23 insertions, 31 deletions
diff --git a/xbmc/filesystem/DirectoryFactory.cpp b/xbmc/filesystem/DirectoryFactory.cpp
index 644a4d661f..580d2dae62 100644
--- a/xbmc/filesystem/DirectoryFactory.cpp
+++ b/xbmc/filesystem/DirectoryFactory.cpp
@@ -137,30 +137,26 @@ IDirectory* CDirectoryFactory::Create(const CURL& url)
if (CWinLibraryDirectory::IsValid(url)) return new CWinLibraryDirectory();
#endif
- bool networkAvailable = CServiceBroker::GetNetwork().IsAvailable();
- if (networkAvailable)
- {
- if (url.IsProtocol("ftp") || url.IsProtocol("ftps")) return new CFTPDirectory();
- if (url.IsProtocol("http") || url.IsProtocol("https")) return new CHTTPDirectory();
- if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVDirectory();
+ if (url.IsProtocol("ftp") || url.IsProtocol("ftps")) return new CFTPDirectory();
+ if (url.IsProtocol("http") || url.IsProtocol("https")) return new CHTTPDirectory();
+ if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVDirectory();
#ifdef HAS_FILESYSTEM_SMB
#ifdef TARGET_WINDOWS
- if (url.IsProtocol("smb")) return new CWin32SMBDirectory();
+ if (url.IsProtocol("smb")) return new CWin32SMBDirectory();
#else
- if (url.IsProtocol("smb")) return new CSMBDirectory();
+ if (url.IsProtocol("smb")) return new CSMBDirectory();
#endif
#endif
#ifdef HAS_UPNP
- if (url.IsProtocol("upnp")) return new CUPnPDirectory();
+ if (url.IsProtocol("upnp")) return new CUPnPDirectory();
#endif
- if (url.IsProtocol("rss") || url.IsProtocol("rsss")) return new CRSSDirectory();
+ if (url.IsProtocol("rss") || url.IsProtocol("rsss")) return new CRSSDirectory();
#ifdef HAS_ZEROCONF
- if (url.IsProtocol("zeroconf")) return new CZeroconfDirectory();
+ if (url.IsProtocol("zeroconf")) return new CZeroconfDirectory();
#endif
#ifdef HAS_FILESYSTEM_NFS
- if (url.IsProtocol("nfs")) return new CNFSDirectory();
+ if (url.IsProtocol("nfs")) return new CNFSDirectory();
#endif
- }
if (url.IsProtocol("pvr"))
return new CPVRDirectory();
@@ -174,7 +170,7 @@ IDirectory* CDirectoryFactory::Create(const CURL& url)
}
}
- CLog::Log(LOGWARNING, "%s - %sunsupported protocol(%s) in %s", __FUNCTION__, networkAvailable ? "" : "Network down or ", url.GetProtocol().c_str(), url.GetRedacted().c_str() );
+ CLog::Log(LOGWARNING, "%s - unsupported protocol(%s) in %s", __FUNCTION__, url.GetProtocol().c_str(), url.GetRedacted().c_str() );
return NULL;
}
diff --git a/xbmc/filesystem/FileFactory.cpp b/xbmc/filesystem/FileFactory.cpp
index 35b320d227..5b67eb0ced 100644
--- a/xbmc/filesystem/FileFactory.cpp
+++ b/xbmc/filesystem/FileFactory.cpp
@@ -129,32 +129,28 @@ IFile* CFileFactory::CreateLoader(const CURL& url)
else if (CWinLibraryFile::IsValid(url)) return new CWinLibraryFile();
#endif
- bool networkAvailable = CServiceBroker::GetNetwork().IsAvailable();
- if (networkAvailable)
- {
- if (url.IsProtocol("ftp")
- || url.IsProtocol("ftps")
- || url.IsProtocol("rss")
- || url.IsProtocol("rsss")
- || url.IsProtocol("http")
- || url.IsProtocol("https")) return new CCurlFile();
- else if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVFile();
- else if (url.IsProtocol("shout")) return new CShoutcastFile();
+ if (url.IsProtocol("ftp")
+ || url.IsProtocol("ftps")
+ || url.IsProtocol("rss")
+ || url.IsProtocol("rsss")
+ || url.IsProtocol("http")
+ || url.IsProtocol("https")) return new CCurlFile();
+ else if (url.IsProtocol("dav") || url.IsProtocol("davs")) return new CDAVFile();
+ else if (url.IsProtocol("shout")) return new CShoutcastFile();
#ifdef HAS_FILESYSTEM_SMB
#ifdef TARGET_WINDOWS
- else if (url.IsProtocol("smb")) return new CWin32SMBFile();
+ else if (url.IsProtocol("smb")) return new CWin32SMBFile();
#else
- else if (url.IsProtocol("smb")) return new CSMBFile();
+ else if (url.IsProtocol("smb")) return new CSMBFile();
#endif
#endif
#ifdef HAS_FILESYSTEM_NFS
- else if (url.IsProtocol("nfs")) return new CNFSFile();
+ else if (url.IsProtocol("nfs")) return new CNFSFile();
#endif
#ifdef HAS_UPNP
- else if (url.IsProtocol("upnp")) return new CUPnPFile();
+ else if (url.IsProtocol("upnp")) return new CUPnPFile();
#endif
- }
- CLog::Log(LOGWARNING, "%s - %sunsupported protocol(%s) in %s", __FUNCTION__, networkAvailable ? "" : "Network down or ", url.GetProtocol().c_str(), url.GetRedacted().c_str());
+ CLog::Log(LOGWARNING, "%s - unsupported protocol(%s) in %s", __FUNCTION__, url.GetProtocol().c_str(), url.GetRedacted().c_str());
return NULL;
}