Skip to content

Commit

Permalink
CFileItem: add IsEnabled() and SetEnabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Aug 15, 2015
1 parent 05e07ee commit 7a4151b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions xbmc/FileItem.cpp
Expand Up @@ -332,6 +332,7 @@ const CFileItem& CFileItem::operator=(const CFileItem& item)
return *this;

CGUIListItem::operator=(item);
m_enabled = item.m_enabled;
m_bLabelPreformated=item.m_bLabelPreformated;
FreeMemory();
m_strPath = item.GetPath();
Expand Down Expand Up @@ -410,6 +411,7 @@ void CFileItem::Initialize()
m_videoInfoTag = NULL;
m_pictureInfoTag = NULL;
m_bLabelPreformated = false;
m_enabled = true;
m_bIsAlbum = false;
m_dwSize = 0;
m_bIsParentFolder = false;
Expand Down Expand Up @@ -511,6 +513,8 @@ void CFileItem::Archive(CArchive& ar)
}
else
ar << 0;

ar << m_enabled;
}
else
{
Expand Down Expand Up @@ -551,6 +555,8 @@ void CFileItem::Archive(CArchive& ar)
if (iType == 1)
ar >> *GetPictureInfoTag();

ar >> m_enabled;

SetInvalid();
}
}
Expand Down
4 changes: 4 additions & 0 deletions xbmc/FileItem.h
Expand Up @@ -137,6 +137,9 @@ class CFileItem :
void ToSortable(SortItem &sortable, const Fields &fields) const;
virtual bool IsFileItem() const { return true; };

bool IsEnabled() const { return m_enabled; }
void SetEnabled(bool enabled) { m_enabled = enabled; }

bool Exists(bool bUseCache = true) const;

/*!
Expand Down Expand Up @@ -489,6 +492,7 @@ class CFileItem :
void Initialize();

std::string m_strPath; ///< complete path to item
bool m_enabled;

SortSpecial m_specialSort;
bool m_bIsParentFolder;
Expand Down
7 changes: 5 additions & 2 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -468,7 +468,8 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
{ "content", CONTAINER_CONTENT },
{ "art", CONTAINER_ART }};

const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB },
const infomap listitem_labels[]= {{ "enabled", LISTITEM_ENABLED },
{ "thumb", LISTITEM_THUMB },
{ "icon", LISTITEM_ICON },
{ "actualicon", LISTITEM_ACTUAL_ICON },
{ "overlay", LISTITEM_OVERLAY },
Expand Down Expand Up @@ -5506,7 +5507,9 @@ bool CGUIInfoManager::GetItemBool(const CGUIListItem *item, int condition) const
else if (item->IsFileItem())
{
const CFileItem *pItem = (const CFileItem *)item;
if (condition == LISTITEM_ISRECORDING)
if (condition == LISTITEM_ENABLED)
return pItem->IsEnabled();
else if (condition == LISTITEM_ISRECORDING)
{
if (!g_PVRManager.IsStarted())
return false;
Expand Down
1 change: 1 addition & 0 deletions xbmc/guiinfo/GUIInfoLabels.h
Expand Up @@ -666,6 +666,7 @@
#define LISTITEM_TIMERTYPE (LISTITEM_START + 150)
#define LISTITEM_EPG_EVENT_TITLE (LISTITEM_START + 151)
#define LISTITEM_DATETIME (LISTITEM_START + 152)
#define LISTITEM_ENABLED (LISTITEM_START + 153)

#define LISTITEM_PROPERTY_START (LISTITEM_START + 200)
#define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1000)
Expand Down

0 comments on commit 7a4151b

Please sign in to comment.