[EPG] Guide Window: 20% performance gain on open
authorKai Sommerfeld <kai.sommerfeld@gmx.com>
Wed, 16 Mar 2016 11:35:39 +0000 (12:35 +0100)
committerKai Sommerfeld <kai.sommerfeld@gmx.com>
Thu, 17 Mar 2016 12:37:48 +0000 (13:37 +0100)
xbmc/FileItem.cpp
xbmc/utils/URIUtils.cpp
xbmc/utils/URIUtils.h

index 49c7eec..7c66e9e 100644 (file)
@@ -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)
index 4a9903c..592dfed 100644 (file)
@@ -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))
index 874d5ec..01323d7 100644 (file)
@@ -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);