X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=xbmc%2Ffilesystem%2FAndroidAppFile.cpp;h=0c7361df3b613b2729c6b6d8cb0da7c72532261b;hb=2d2eff9c723670fd76f711e94bad69fbd587438c;hp=9314700d11fcf2020ace4ea42ff020c6b2c06d96;hpb=ad4ea1d5c7da57159f3ecd31df889b07b01859b9;p=vuplus_xbmc diff --git a/xbmc/filesystem/AndroidAppFile.cpp b/xbmc/filesystem/AndroidAppFile.cpp index 9314700..0c7361d 100644 --- a/xbmc/filesystem/AndroidAppFile.cpp +++ b/xbmc/filesystem/AndroidAppFile.cpp @@ -45,17 +45,33 @@ CFileAndroidApp::~CFileAndroidApp(void) bool CFileAndroidApp::Open(const CURL& url) { - m_url = url; m_appname = URIUtils::GetFileName(url.Get()); - m_appname = m_appname.Left(m_appname.size() - 4); + m_appname = m_appname.substr(0, m_appname.size() - 4); + + std::vector applications = CXBMCApp::GetApplications(); + for(std::vector::iterator i = applications.begin(); i != applications.end(); ++i) + { + if ((*i).packageName == m_appname) + return true; + } - return m_appname.size() > 0; + return false; } bool CFileAndroidApp::Exists(const CURL& url) { - return true; + std::string appname = URIUtils::GetFileName(url.Get()); + appname = appname.substr(0, appname.size() - 4); + + std::vector applications = CXBMCApp::GetApplications(); + for(std::vector::iterator i = applications.begin(); i != applications.end(); ++i) + { + if ((*i).packageName == appname) + return true; + } + + return false; } unsigned int CFileAndroidApp::Read(void* lpBuf, int64_t uiBufSize)