本文整理汇总了C++中CPVRDatabase::RemoveChannelsFromGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRDatabase::RemoveChannelsFromGroup方法的具体用法?C++ CPVRDatabase::RemoveChannelsFromGroup怎么用?C++ CPVRDatabase::RemoveChannelsFromGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRDatabase
的用法示例。
在下文中一共展示了CPVRDatabase::RemoveChannelsFromGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteGroup
bool CPVRChannelGroups::DeleteGroup(const CPVRChannelGroup &group)
{
bool bReturn = false;
if (group.IsInternalGroup())
{
CLog::Log(LOG_ERROR, "CPVRChannelGroups - %s - cannot delete internal group '%s'",
__FUNCTION__, group.GroupName().c_str());
return bReturn;
}
CPVRDatabase *database = CPVRManager::Get()->GetTVDatabase();
if (!database || !database->Open())
{
CLog::Log(LOG_ERROR, "CPVRChannelGroups - %s - unable to open the database", __FUNCTION__);
return bReturn;
}
/* remove all channels from the group */
database->RemoveChannelsFromGroup(group.GroupID());
/* delete the group from the database */
bReturn = database->DeleteChannelGroup(group.GroupID(), m_bRadio);
database->Close();
/* delete the group in this container */
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
if (at(iGroupPtr)->GroupID() == group.GroupID())
{
delete at(iGroupPtr);
erase(begin() + iGroupPtr);
break;
}
}
return bReturn;
}
示例2: DeleteGroup
bool CPVRChannelGroups::DeleteGroup(const CPVRChannelGroup &group)
{
bool bReturn = false;
CSingleLock lock(m_critSection);
if (group.IsInternalGroup())
{
CLog::Log(LOGERROR, "CPVRChannelGroups - %s - cannot delete internal group '%s'",
__FUNCTION__, group.GroupName().c_str());
return bReturn;
}
CPVRDatabase *database = GetPVRDatabase();
if (!database)
return bReturn;
/* remove all channels from the group */
database->RemoveChannelsFromGroup(group);
/* delete the group from the database */
bReturn = database->Delete(group);
/* delete the group in this container */
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
if (at(iGroupPtr)->GroupID() == group.GroupID())
{
CPVRChannelGroup *selectedGroup = GetSelectedGroup();
if (selectedGroup && *selectedGroup == group)
g_PVRManager.SetPlayingGroup(GetGroupAll());
delete at(iGroupPtr);
erase(begin() + iGroupPtr);
break;
}
}
return bReturn;
}