Permalink
Browse files

add param to CFileItem::UpdateInfo() to not update the labels

  • Loading branch information...
1 parent e1175d5 commit d613807e192e20c644e5cc7b54751f3fe8cd3385 Jonathan Marshall committed Jan 26, 2012
Showing with 5 additions and 4 deletions.
  1. +3 −3 xbmc/FileItem.cpp
  2. +2 −1 xbmc/FileItem.h
View
@@ -1158,7 +1158,7 @@ bool CFileItem::IsAlbum() const
return m_bIsAlbum;
}
-void CFileItem::UpdateInfo(const CFileItem &item)
+void CFileItem::UpdateInfo(const CFileItem &item, bool replaceLabels /*=true*/)
{
if (item.HasVideoInfoTag())
{ // copy info across (TODO: premiered info is normally stored in m_dateTime by the db)
@@ -1170,9 +1170,9 @@ void CFileItem::UpdateInfo(const CFileItem &item)
if (item.HasPictureInfoTag())
*GetPictureInfoTag() = *item.GetPictureInfoTag();
- if (!item.GetLabel().IsEmpty())
+ if (replaceLabels && !item.GetLabel().IsEmpty())
SetLabel(item.GetLabel());
- if (!item.GetLabel2().IsEmpty())
+ if (replaceLabels && !item.GetLabel2().IsEmpty())
SetLabel2(item.GetLabel2());
if (!item.GetThumbnailImage().IsEmpty())
SetThumbnailImage(item.GetThumbnailImage());
View
@@ -293,8 +293,9 @@ class CFileItem :
Properties are appended, and labels, thumbnail and icon are updated if non-empty
in the given item.
\param item the item used to supplement information
+ \param replaceLabels whether to replace labels (defaults to true)
*/
- void UpdateInfo(const CFileItem &item);
+ void UpdateInfo(const CFileItem &item, bool replaceLabels = true);
bool IsSamePath(const CFileItem *item) const;

0 comments on commit d613807

Please sign in to comment.