Skip to content

Commit

Permalink
Merge pull request #8716 from tamland/remove_get_more
Browse files Browse the repository at this point in the history
[gui] remove 'get more' node from vfs
  • Loading branch information
tamland committed Jan 10, 2016
2 parents 8d33f0c + fe27a19 commit 36b7223
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 27 deletions.
19 changes: 7 additions & 12 deletions xbmc/filesystem/AddonsDirectory.cpp
Expand Up @@ -455,6 +455,13 @@ bool CAddonsDirectory::GetDirectory(const CURL& url, CFileItemList &items)
{
return GetSearchResults(path, items);
}
else if (endpoint == "more")
{
std::string type = path.GetFileName();
if (type == "video" || type == "audio" || type == "image" || type == "executable")
return Browse(CURL("addons://all/xbmc.addon." + type), items);
return false;
}
else
{
return Browse(path, items);
Expand Down Expand Up @@ -585,23 +592,11 @@ bool CAddonsDirectory::GetScriptsAndPlugins(const std::string &content, CFileIte
items.Add(item);
}

items.Add(GetMoreItem(content));

items.SetContent("addons");
items.SetLabel(g_localizeStrings.Get(24001)); // Add-ons

return items.Size() > 0;
}

CFileItemPtr CAddonsDirectory::GetMoreItem(const std::string &content)
{
CFileItemPtr item(new CFileItem("addons://more/"+content,false));
item->SetLabelPreformated(true);
item->SetLabel(g_localizeStrings.Get(21452));
item->SetIconImage("DefaultAddon.png");
item->SetSpecialSort(SortSpecialOnBottom);
return item;
}

}

6 changes: 0 additions & 6 deletions xbmc/filesystem/AddonsDirectory.h
Expand Up @@ -56,12 +56,6 @@ namespace XFILE
*/
static bool GetScriptsAndPlugins(const std::string &content, CFileItemList &items);

/*! \brief return the "Get More..." link item for the current content type
\param content the content type for the link item
\return a CFileItemPtr to a new item for the link.
*/
static CFileItemPtr GetMoreItem(const std::string &content);

static void GenerateAddonListing(const CURL &path, const ADDON::VECADDONS& addons, CFileItemList &items, const std::string label);
static CFileItemPtr FileItemFromAddon(const ADDON::AddonPtr &addon, const std::string& path, bool folder = false);

Expand Down
2 changes: 1 addition & 1 deletion xbmc/music/windows/GUIWindowMusicNav.cpp
Expand Up @@ -438,7 +438,7 @@ void CGUIWindowMusicNav::GetContextButtons(int itemNumber, CContextButtons &butt
CFileItemPtr item;
if (itemNumber >= 0 && itemNumber < m_vecItems->Size())
item = m_vecItems->Get(itemNumber);
if (item && !StringUtils::StartsWithNoCase(item->GetPath(), "addons://more/"))
if (item)
{
// are we in the playlists location?
bool inPlaylists = m_vecItems->IsPath(CUtil::MusicPlaylistsLocation()) ||
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pictures/GUIWindowPictures.cpp
Expand Up @@ -462,7 +462,7 @@ void CGUIWindowPictures::GetContextButtons(int itemNumber, CContextButtons &butt
}
else
{
if (item && !StringUtils::StartsWithNoCase(item->GetPath(), "addons://more/"))
if (item)
{
if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
buttons.Add(CONTEXT_BUTTON_INFO, 24003); // Add-on info
Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/windows/GUIWindowVideoBase.cpp
Expand Up @@ -621,7 +621,7 @@ bool CGUIWindowVideoBase::OnSelect(int iItem)
CFileItemPtr item = m_vecItems->Get(iItem);

std::string path = item->GetPath();
if (!item->m_bIsFolder && path != "add" && path != "addons://more/video" &&
if (!item->m_bIsFolder && path != "add" &&
!StringUtils::StartsWith(path, "newsmartplaylist://") &&
!StringUtils::StartsWith(path, "newplaylist://") &&
!StringUtils::StartsWith(path, "newtag://"))
Expand Down
7 changes: 1 addition & 6 deletions xbmc/windows/GUIMediaWindow.cpp
Expand Up @@ -1010,11 +1010,6 @@ bool CGUIMediaWindow::OnClick(int iItem, const std::string &player)
Refresh();
return true;
}
else if (StringUtils::StartsWithNoCase(pItem->GetPath(), "addons://more/"))
{
CBuiltins::GetInstance().Execute("ActivateWindow(AddonBrowser,addons://all/xbmc.addon." + pItem->GetPath().substr(14) + ",return)");
return true;
}

bool autoplay = m_guiState.get() && m_guiState->AutoPlayNextItem();

Expand Down Expand Up @@ -1544,7 +1539,7 @@ void CGUIMediaWindow::GetContextButtons(int itemNumber, CContextButtons &buttons
// TODO: FAVOURITES Conditions on masterlock and localisation
if (!item->IsParentFolder() && !item->IsPath("add") && !item->IsPath("newplaylist://") &&
!URIUtils::IsProtocol(item->GetPath(), "newsmartplaylist") && !URIUtils::IsProtocol(item->GetPath(), "newtag") &&
!URIUtils::PathStarts(item->GetPath(), "addons://more/") && !URIUtils::IsProtocol(item->GetPath(), "musicsearch") &&
!URIUtils::IsProtocol(item->GetPath(), "musicsearch") &&
!URIUtils::PathStarts(item->GetPath(), "pvr://guide/") && !URIUtils::PathStarts(item->GetPath(), "pvr://timers/"))
{
if (XFILE::CFavouritesDirectory::IsFavourite(item.get(), GetID()))
Expand Down

0 comments on commit 36b7223

Please sign in to comment.