本文整理汇总了C++中PlaylistItem::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ PlaylistItem::isValid方法的具体用法?C++ PlaylistItem::isValid怎么用?C++ PlaylistItem::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlaylistItem
的用法示例。
在下文中一共展示了PlaylistItem::isValid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
bool PlaylistsModel::load()
{
setUpdateSignaled(false);
if (!m_provider)
return false;
clear();
const SONOS::PlayerPtr player = m_provider->getPlayer();
if (!player)
return false;
QString port;
port.setNum(player->GetPort());
QString url = "http://";
url.append(player->GetHost().c_str()).append(":").append(port);
SONOS::ContentDirectory cd(player->GetHost(), player->GetPort());
SONOS::ContentList cl(cd, m_root.isEmpty() ? SONOS::ContentSearch(SONOS::SearchSonosPlaylist,"").Root() : m_root.toUtf8().constData());
for (SONOS::ContentList::iterator it = cl.begin(); it != cl.end(); ++it)
{
PlaylistItem* item = new PlaylistItem(*it, url);
if (item->isValid())
addItem(item);
else
delete item;
}
if (cl.failure())
return m_loaded = false;
m_updateID = cl.GetUpdateID(); // sync new baseline
return m_loaded = true;
}
示例2: CollectionListItem
PlaylistItem *CollectionList::createItem(const FileHandle &file, QListViewItem *, bool)
{
// It's probably possible to optimize the line below away, but, well, right
// now it's more important to not load duplicate items.
if(m_itemsDict.find(file.absFilePath()))
return 0;
PlaylistItem *item = new CollectionListItem(file);
if(!item->isValid()) {
kdError() << "CollectionList::createItem() -- A valid tag was not created for \""
<< file.absFilePath() << "\"" << endl;
delete item;
return 0;
}
setupItem(item);
return item;
}