Skip to content

Commit

Permalink
add param to CFileItem::UpdateInfo() to not update the labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Marshall committed Jan 26, 2012
1 parent e1175d5 commit d613807
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions xbmc/FileItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion xbmc/FileItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d613807

Please sign in to comment.