std::string CGUIWindowPrograms::GetStartFolder(const std::string &dir) { std::string lower(dir); StringUtils::ToLower(lower); if (lower == "plugins" || lower == "addons") return "addons://sources/executable/"; else if (lower == "androidapps") return "androidapp://sources/apps/"; SetupShares(); VECSOURCES shares; m_rootDir.GetSources(shares); bool bIsSourceName = false; int iIndex = CUtil::GetMatchingSource(dir, shares, bIsSourceName); if (iIndex > -1) { if (iIndex < (int)shares.size() && shares[iIndex].m_iHasLock == 2) { CFileItem item(shares[iIndex]); if (!g_passwordManager.IsItemUnlocked(&item,"programs")) return ""; } if (bIsSourceName) return shares[iIndex].strPath; return dir; } return CGUIMediaWindow::GetStartFolder(dir); }
CStdString CGUIWindowJukeboxSongs::GetStartFolder(const CStdString &dir) { SetupShares(); VECSOURCES shares; m_rootDir.GetSources(shares); bool bIsSourceName = false; int iIndex = CUtil::GetMatchingSource(dir, shares, bIsSourceName); if (iIndex > -1) { if (iIndex < (int) shares.size() && shares[iIndex].m_iHasLock == 2) { CFileItem item(shares[iIndex]); if (!g_passwordManager.IsItemUnlocked(&item, "music")) return ""; } // set current directory to matching share if (bIsSourceName) return shares[iIndex].strPath; return dir; } return CGUIWindowJukeboxBase::GetStartFolder(dir); }
CStdString CGUIWindowPrograms::GetStartFolder(const CStdString &dir) { if (dir.Equals("Plugins") || dir.Equals("Addons")) return "addons://sources/executable/"; SetupShares(); VECSOURCES shares; m_rootDir.GetSources(shares); bool bIsSourceName = false; int iIndex = CUtil::GetMatchingSource(dir, shares, bIsSourceName); if (iIndex > -1) { if (iIndex < (int)shares.size() && shares[iIndex].m_iHasLock == 2) { CFileItem item(shares[iIndex]); if (!g_passwordManager.IsItemUnlocked(&item,"programs")) return ""; } if (bIsSourceName) return shares[iIndex].strPath; return dir; } return CGUIMediaWindow::GetStartFolder(dir); }