本文整理汇总了C++中ChannelInfo::SetSourceName方法的典型用法代码示例。如果您正苦于以下问题:C++ ChannelInfo::SetSourceName方法的具体用法?C++ ChannelInfo::SetSourceName怎么用?C++ ChannelInfo::SetSourceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChannelInfo
的用法示例。
在下文中一共展示了ChannelInfo::SetSourceName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillList
void ChannelRecPriority::FillList(void)
{
QMap<int, QString> srcMap;
m_channelData.clear();
m_sortedChannel.clear();
MSqlQuery result(MSqlQuery::InitCon());
result.prepare("SELECT sourceid, name FROM videosource;");
if (result.exec())
{
while (result.next())
{
srcMap[result.value(0).toInt()] = result.value(1).toString();
}
}
result.prepare("SELECT chanid, channum, sourceid, callsign, "
"icon, recpriority, name FROM channel WHERE visible=1;");
if (result.exec())
{
int cnt = 999;
while (result.next())
{
ChannelInfo *chaninfo = new ChannelInfo;
chaninfo->chanid = result.value(0).toInt();
chaninfo->channum = result.value(1).toString();
chaninfo->sourceid = result.value(2).toInt();
chaninfo->callsign = result.value(3).toString();
QString iconurl = result.value(4).toString();
if (!iconurl.isEmpty())
iconurl = gCoreContext->GetMasterHostPrefix( "ChannelIcons", iconurl);
chaninfo->icon = iconurl;
chaninfo->recpriority = result.value(5).toInt();
chaninfo->name = result.value(6).toString();
chaninfo->SetSourceName(srcMap[chaninfo->sourceid]);
m_channelData[QString::number(cnt)] = *chaninfo;
// save recording priority value in map so we don't have to save
// all channel's recording priority values when we exit
m_origRecPriorityData[QString::number(chaninfo->chanid)] =
chaninfo->recpriority;
cnt--;
}
}
else if (!result.isActive())
MythDB::DBError("Get channel recording priorities query", result);
SortList();
}