diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2016-03-16 12:35:39 +0100 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2016-03-17 13:37:48 +0100 |
commit | 47759586c1d2c7b5f40b7ab1f2609c588a651834 (patch) | |
tree | 19a0c8f15b21f7d899bd3d9029d6158ab661e5bd | |
parent | 67c6591d005baf7aadaaaf3925f4a23b92885414 (diff) |
[EPG] Guide Window: 20% performance gain on open
-rw-r--r-- | xbmc/FileItem.cpp | 7 | ||||
-rw-r--r-- | xbmc/utils/URIUtils.cpp | 8 | ||||
-rw-r--r-- | xbmc/utils/URIUtils.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index 49c7eec423..7c66e9e5d3 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -1114,6 +1114,13 @@ bool CFileItem::IsReadOnly() const void CFileItem::FillInDefaultIcon() { + if (URIUtils::IsPVRGuideItem(m_strPath)) + { + // epg items never have a default icon. no need to execute this expensive method. + // when filling epg grid window, easily tens of thousands of epg items are processed. + return; + } + //CLog::Log(LOGINFO, "FillInDefaultIcon(%s)", pItem->GetLabel().c_str()); // find the default icon for a file or folder item // for files this can be the (depending on the file type) diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index 4a9903c6b0..592dfedf35 100644 --- a/xbmc/utils/URIUtils.cpp +++ b/xbmc/utils/URIUtils.cpp @@ -908,6 +908,14 @@ bool URIUtils::IsPVRChannel(const std::string& strFile) return StringUtils::StartsWithNoCase(strFile2, "pvr://channels"); } +bool URIUtils::IsPVRGuideItem(const std::string& strFile) +{ + if (IsStack(strFile)) + return IsPVRGuideItem(CStackDirectory::GetFirstStackedFile(strFile)); + + return StringUtils::StartsWithNoCase(strFile, "pvr://guide"); +} + bool URIUtils::IsDAV(const std::string& strFile) { if (IsStack(strFile)) diff --git a/xbmc/utils/URIUtils.h b/xbmc/utils/URIUtils.h index 874d5ec81d..01323d76a9 100644 --- a/xbmc/utils/URIUtils.h +++ b/xbmc/utils/URIUtils.h @@ -163,6 +163,7 @@ public: static bool IsLibraryFolder(const std::string& strFile); static bool IsLibraryContent(const std::string& strFile); static bool IsPVRChannel(const std::string& strFile); + static bool IsPVRGuideItem(const std::string& strFile); static bool IsUsingFastSwitch(const std::string& strFile); static void AddSlashAtEnd(std::string& strFolder); |