From 2b7fe678fa1bc68323f27a4f29283ac456fdd27b Mon Sep 17 00:00:00 2001 From: Garrett Brown Date: Thu, 30 Jan 2020 13:29:49 -0800 Subject: [PATCH 1/3] FileItem: Fix range iterator constness --- xbmc/FileItem.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h index 75f57db659645..63ba0bf698acf 100644 --- a/xbmc/FileItem.h +++ b/xbmc/FileItem.h @@ -749,12 +749,12 @@ class CFileItemList : public CFileItem void ClearSortState(); - VECFILEITEMS::const_iterator begin() { return m_items.cbegin(); } - VECFILEITEMS::const_iterator end() { return m_items.cend(); } + VECFILEITEMS::iterator begin() { return m_items.begin(); } + VECFILEITEMS::iterator end() { return m_items.end(); } VECFILEITEMS::const_iterator begin() const { return m_items.begin(); } VECFILEITEMS::const_iterator end() const { return m_items.end(); } - VECFILEITEMS::const_iterator cbegin() const { return m_items.begin(); } - VECFILEITEMS::const_iterator cend() const { return m_items.end(); } + VECFILEITEMS::const_iterator cbegin() const { return m_items.cbegin(); } + VECFILEITEMS::const_iterator cend() const { return m_items.cend(); } private: void Sort(FILEITEMLISTCOMPARISONFUNC func); void FillSortFields(FILEITEMFILLFUNC func); From 67b64c877c7d32c1ebe8292d6d647d6b264d23ba Mon Sep 17 00:00:00 2001 From: Garrett Brown Date: Sun, 26 Jan 2020 13:53:59 -0800 Subject: [PATCH 2/3] Fix error playing disk image games Game items ending in disk image extensions are currently played using VideoPlayer instead of RetroPlayer. This results in a brief buffering dialog, and then the player exits to the previous window. --- system/playercorefactory.xml | 2 +- xbmc/cores/playercorefactory/PlayerSelectionRule.cpp | 3 +++ xbmc/cores/playercorefactory/PlayerSelectionRule.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/system/playercorefactory.xml b/system/playercorefactory.xml index be6b7219ab430..bb57a08e6c4e9 100644 --- a/system/playercorefactory.xml +++ b/system/playercorefactory.xml @@ -26,7 +26,7 @@ - + diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp index 59e641638bdb6..439a69a8cfedf 100644 --- a/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp +++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.cpp @@ -45,6 +45,7 @@ void CPlayerSelectionRule::Initialize(TiXmlElement* pRule) m_tRemote = GetTristate(pRule->Attribute("remote")); m_tAudio = GetTristate(pRule->Attribute("audio")); m_tVideo = GetTristate(pRule->Attribute("video")); + m_tGame = GetTristate(pRule->Attribute("game")); m_tBD = GetTristate(pRule->Attribute("bd")); m_tDVD = GetTristate(pRule->Attribute("dvd")); @@ -110,6 +111,8 @@ void CPlayerSelectionRule::GetPlayers(const CFileItem& item, std::vector= 0 && (m_tVideo > 0) != item.IsVideo()) return; + if (m_tGame >= 0 && (m_tGame > 0) != item.IsGame()) + return; if (m_tInternetStream >= 0 && (m_tInternetStream > 0) != item.IsInternetStream()) return; if (m_tRemote >= 0 && (m_tRemote > 0) != item.IsRemote()) diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.h b/xbmc/cores/playercorefactory/PlayerSelectionRule.h index bdc65927ac2d2..991631e1df6c0 100644 --- a/xbmc/cores/playercorefactory/PlayerSelectionRule.h +++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.h @@ -35,6 +35,7 @@ class CPlayerSelectionRule int m_tAudio; int m_tVideo; + int m_tGame; int m_tInternetStream; int m_tRemote; From 87351fd60390e93cf5a4020aeb1066cc6497ec70 Mon Sep 17 00:00:00 2001 From: Garrett Brown Date: Sun, 26 Jan 2020 18:18:51 -0800 Subject: [PATCH 3/3] Fix launching zip and 7z files from MyGames --- xbmc/games/windows/GUIWindowGames.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xbmc/games/windows/GUIWindowGames.cpp b/xbmc/games/windows/GUIWindowGames.cpp index 355442386f3ad..4721a940ac5d4 100644 --- a/xbmc/games/windows/GUIWindowGames.cpp +++ b/xbmc/games/windows/GUIWindowGames.cpp @@ -264,6 +264,13 @@ bool CGUIWindowGames::GetDirectory(const std::string &strDirectory, CFileItemLis if (!content.empty()) items.SetContent(content); + // Ensure a game info tag is created so that files are recognized as games + for (const CFileItemPtr& item : items) + { + if (!item->m_bIsFolder) + item->GetGameInfoTag(); + } + return true; }