diff options
author | Karlson2k <k2k@narod.ru> | 2014-10-02 16:25:01 +0400 |
---|---|---|
committer | Karlson2k <k2k@narod.ru> | 2014-10-02 16:25:01 +0400 |
commit | 9a71c809465bb27d7f823f6a4242861adc9f8250 (patch) | |
tree | e3a45452796b36f796853c70faccf61b9db3071b | |
parent | 28d47e3f113063d56e3cc2455429d4f2099314c3 (diff) | |
parent | 56be8e095a87cb90a00d0e6224b8dc7fb70134d9 (diff) |
Merge pull request #5349 from Karlson2k/vfs_fix_exists_01
Fix wrongly used CFile::Exists() for directories instead of CDirectory::Exists()
-rw-r--r-- | xbmc/Application.cpp | 5 | ||||
-rw-r--r-- | xbmc/Util.cpp | 4 | ||||
-rw-r--r-- | xbmc/addons/AddonManager.cpp | 2 | ||||
-rw-r--r-- | xbmc/dialogs/GUIDialogMediaSource.cpp | 2 | ||||
-rw-r--r-- | xbmc/filesystem/FavouritesDirectory.cpp | 3 | ||||
-rw-r--r-- | xbmc/storage/android/AndroidStorageProvider.cpp | 3 |
6 files changed, 11 insertions, 8 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index c6667ba071..186ea7fb4c 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -59,6 +59,7 @@ #include "SectionLoader.h" #include "cores/DllLoader/DllLoaderContainer.h" #include "GUIUserMessages.h" +#include "filesystem/Directory.h" #include "filesystem/DirectoryCache.h" #include "filesystem/StackDirectory.h" #include "filesystem/SpecialProtocol.h" @@ -1077,11 +1078,11 @@ bool CApplication::InitDirectoriesLinux() xbmcPath = xbmcBinPath; /* Check if xbmc binaries and arch independent data files are being kept in * separate locations. */ - if (!CFile::Exists(URIUtils::AddFileToFolder(xbmcPath, "language"))) + if (!CDirectory::Exists(URIUtils::AddFileToFolder(xbmcPath, "language"))) { /* Attempt to locate arch independent data files. */ CUtil::GetHomePath(xbmcPath); - if (!CFile::Exists(URIUtils::AddFileToFolder(xbmcPath, "language"))) + if (!CDirectory::Exists(URIUtils::AddFileToFolder(xbmcPath, "language"))) { fprintf(stderr, "Unable to find path to XBMC data files!\n"); exit(1); diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp index 7c92a32fd3..8b3795a7b1 100644 --- a/xbmc/Util.cpp +++ b/xbmc/Util.cpp @@ -679,7 +679,7 @@ void CUtil::ClearTempFonts() { CStdString searchPath = "special://temp/fonts/"; - if (!CFile::Exists(searchPath)) + if (!CDirectory::Exists(searchPath)) return; CFileItemList items; @@ -735,7 +735,7 @@ CStdString CUtil::GetNextPathname(const CStdString &path_template, int max) for (int i = 0; i <= max; i++) { CStdString name = StringUtils::Format(path_template.c_str(), i); - if (!CFile::Exists(name)) + if (!CFile::Exists(name) && !CDirectory::Exists(name)) return name; } return ""; diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp index c00bc83233..bc6be308e8 100644 --- a/xbmc/addons/AddonManager.cpp +++ b/xbmc/addons/AddonManager.cpp @@ -194,7 +194,7 @@ bool CAddonMgr::CheckUserDirs(const cp_cfg_element_t *settings) while (itr != elements.end()) { std::string path = GetExtValue(*itr++, "@path"); - if (!CFile::Exists(path)) + if (!CDirectory::Exists(path)) { if (!CUtil::CreateDirectoryEx(path)) { diff --git a/xbmc/dialogs/GUIDialogMediaSource.cpp b/xbmc/dialogs/GUIDialogMediaSource.cpp index d943853866..4a45257a28 100644 --- a/xbmc/dialogs/GUIDialogMediaSource.cpp +++ b/xbmc/dialogs/GUIDialogMediaSource.cpp @@ -235,7 +235,7 @@ void CGUIDialogMediaSource::OnPathBrowse(int item) #if defined(TARGET_ANDROID) // add the default android music directory std::string path; - if (CXBMCApp::GetExternalStorage(path, "music") && !path.empty() && CFile::Exists(path)) + if (CXBMCApp::GetExternalStorage(path, "music") && !path.empty() && CDirectory::Exists(path)) { share1.strPath = path; share1.strName = g_localizeStrings.Get(20240); diff --git a/xbmc/filesystem/FavouritesDirectory.cpp b/xbmc/filesystem/FavouritesDirectory.cpp index 3a87eaff67..2cf9feff9a 100644 --- a/xbmc/filesystem/FavouritesDirectory.cpp +++ b/xbmc/filesystem/FavouritesDirectory.cpp @@ -20,6 +20,7 @@ #include "FavouritesDirectory.h" #include "File.h" +#include "Directory.h" #include "Util.h" #include "profiles/ProfilesManager.h" #include "FileItem.h" @@ -53,7 +54,7 @@ bool CFavouritesDirectory::Exists(const CURL& url) return XFILE::CFile::Exists("special://xbmc/system/favourites.xml") || XFILE::CFile::Exists(URIUtils::AddFileToFolder(CProfilesManager::Get().GetProfileUserDataFolder(), "favourites.xml")); } - return XFILE::CFile::Exists(url); //directly load the given file + return XFILE::CDirectory::Exists(url); //directly load the given file } bool CFavouritesDirectory::Load(CFileItemList &items) diff --git a/xbmc/storage/android/AndroidStorageProvider.cpp b/xbmc/storage/android/AndroidStorageProvider.cpp index 8fcd43d159..076d7d2ae4 100644 --- a/xbmc/storage/android/AndroidStorageProvider.cpp +++ b/xbmc/storage/android/AndroidStorageProvider.cpp @@ -22,6 +22,7 @@ #include "android/activity/XBMCApp.h" #include "guilib/LocalizeStrings.h" #include "filesystem/File.h" +#include "filesystem/Directory.h" #include "utils/log.h" #include "utils/RegExp.h" @@ -82,7 +83,7 @@ void CAndroidStorageProvider::GetLocalDrives(VECSOURCES &localDrives) // external directory std::string path; - if (CXBMCApp::GetExternalStorage(path) && !path.empty() && XFILE::CFile::Exists(path)) + if (CXBMCApp::GetExternalStorage(path) && !path.empty() && XFILE::CDirectory::Exists(path)) { share.strPath = path; share.strName = g_localizeStrings.Get(21456); |