diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2018-04-15 19:58:36 +0200 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2018-04-15 19:58:36 +0200 |
commit | c68712958587a06d1551336cb3924a302f98f46a (patch) | |
tree | b2699e7de70ea2ee6d343e775cc4e26ce9bc0f1d | |
parent | d23e30ed675368c389f4d458c4bf3d9b14d34fb2 (diff) |
[guiinfo] Fix CGUIInfoManager::GetInt to pass a given item to CGUIInfoManager::GetMultiInfoInt.
-rw-r--r-- | xbmc/GUIInfoManager.cpp | 13 | ||||
-rw-r--r-- | xbmc/GUIInfoManager.h | 6 |
2 files changed, 12 insertions, 7 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index e52ee7a3dc..c14f87e017 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -6355,7 +6355,7 @@ bool CGUIInfoManager::GetInt(int &value, int info, int contextWindow, const CGUI { if (info >= MULTI_INFO_START && info <= MULTI_INFO_END) { - return GetMultiInfoInt(value, m_multiInfo[info - MULTI_INFO_START], contextWindow); + return GetMultiInfoInt(value, m_multiInfo[info - MULTI_INFO_START], contextWindow, item); } else if (info >= LISTITEM_START && info <= LISTITEM_END) { @@ -6552,14 +6552,19 @@ bool CGUIInfoManager::GetMultiInfoBool(const CGUIInfo &info, int contextWindow, return (info.m_info < 0) ? !bReturn : bReturn; } -bool CGUIInfoManager::GetMultiInfoInt(int &value, const CGUIInfo &info, int contextWindow) const +bool CGUIInfoManager::GetMultiInfoInt(int &value, const CGUIInfo &info, int contextWindow, const CGUIListItem *item) const { if (info.m_info >= LISTITEM_START && info.m_info <= LISTITEM_END) { - const CGUIListItemPtr item = GUIINFO::GetCurrentListItem(contextWindow, info.GetData1(), info.GetData2(), info.GetInfoFlag()); + CGUIListItemPtr itemPtr; + if (!item) + { + itemPtr = GUIINFO::GetCurrentListItem(contextWindow, info.GetData1(), info.GetData2(), info.GetInfoFlag()); + item = itemPtr.get(); + } if (item) { - return GetItemInt(value, item.get(), contextWindow, info.m_info); + return GetItemInt(value, item, contextWindow, info.m_info); } else { diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h index d401cb7701..cac69b520a 100644 --- a/xbmc/GUIInfoManager.h +++ b/xbmc/GUIInfoManager.h @@ -185,9 +185,9 @@ private: int TranslateMusicPlayerString(const std::string &info) const; static TIME_FORMAT TranslateTimeFormat(const std::string &format); - std::string GetMultiInfoLabel(const KODI::GUILIB::GUIINFO::CGUIInfo &info, int contextWindow = 0, std::string *fallback = nullptr) const; - bool GetMultiInfoInt(int &value, const KODI::GUILIB::GUIINFO::CGUIInfo &info, int contextWindow = 0) const; - bool GetMultiInfoBool(const KODI::GUILIB::GUIINFO::CGUIInfo &info, int contextWindow = 0, const CGUIListItem *item = nullptr); + std::string GetMultiInfoLabel(const KODI::GUILIB::GUIINFO::CGUIInfo &info, int contextWindow, std::string *fallback = nullptr) const; + bool GetMultiInfoInt(int &value, const KODI::GUILIB::GUIINFO::CGUIInfo &info, int contextWindow, const CGUIListItem *item) const; + bool GetMultiInfoBool(const KODI::GUILIB::GUIINFO::CGUIInfo &info, int contextWindow, const CGUIListItem *item); std::string GetMultiInfoItemLabel(const CFileItem *item, int contextWindow, const KODI::GUILIB::GUIINFO::CGUIInfo &info, std::string *fallback = nullptr) const; std::string GetMultiInfoItemImage(const CFileItem *item, int contextWindow, const KODI::GUILIB::GUIINFO::CGUIInfo &info, std::string *fallback = nullptr) const; |