本文整理汇总了C++中CPVRDatabasePtr::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRDatabasePtr::Delete方法的具体用法?C++ CPVRDatabasePtr::Delete怎么用?C++ CPVRDatabasePtr::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRDatabasePtr
的用法示例。
在下文中一共展示了CPVRDatabasePtr::Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteGroup
bool CPVRChannelGroups::DeleteGroup(const CPVRChannelGroup &group)
{
// don't delete internal groups
if (group.IsInternalGroup())
{
CLog::Log(LOGERROR, "CPVRChannelGroups - %s - cannot delete internal group '%s'", __FUNCTION__, group.GroupName().c_str());
return false;
}
bool bFound(false);
CPVRChannelGroupPtr playingGroup;
// delete the group in this container
{
CSingleLock lock(m_critSection);
for (std::vector<CPVRChannelGroupPtr>::iterator it = m_groups.begin(); !bFound && it != m_groups.end();)
{
if (*(*it) == group || (group.GroupID() > 0 && (*it)->GroupID() == group.GroupID()))
{
// update the selected group in the gui if it's deleted
CPVRChannelGroupPtr selectedGroup = GetSelectedGroup();
if (selectedGroup && *selectedGroup == group)
playingGroup = GetGroupAll();
it = m_groups.erase(it);
bFound = true;
}
else
{
++it;
}
}
}
if (playingGroup)
g_PVRManager.SetPlayingGroup(playingGroup);
if (group.GroupID() > 0)
{
// delete the group from the database
const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase());
return database ? database->Delete(group) : false;
}
return bFound;
}
示例2: Delete
bool CPVRChannel::Delete(void)
{
bool bReturn = false;
const CPVRDatabasePtr database = CServiceBroker::GetPVRManager().GetTVDatabase();
if (!database)
return bReturn;
const CPVREpgPtr epg = GetEPG();
if (epg)
{
CServiceBroker::GetPVRManager().EpgContainer().DeleteEpg(epg, true);
CSingleLock lock(m_critSection);
m_epg.reset();
}
bReturn = database->Delete(*this);
return bReturn;
}
示例3: Delete
bool CPVRChannel::Delete(void)
{
bool bReturn = false;
const CPVRDatabasePtr database(g_PVRManager.GetTVDatabase());
if (!database)
return bReturn;
/* delete the EPG table */
CEpgPtr epg = GetEPG();
if (epg)
{
CPVRChannelPtr empty;
epg->SetChannel(empty);
g_EpgContainer.DeleteEpg(*epg, true);
CSingleLock lock(m_critSection);
m_bEPGCreated = false;
}
bReturn = database->Delete(*this);
return bReturn;
}