本文整理汇总了C++中Index::SetParentId方法的典型用法代码示例。如果您正苦于以下问题:C++ Index::SetParentId方法的具体用法?C++ Index::SetParentId怎么用?C++ Index::SetParentId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index::SetParentId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDropIndex
void AccessTreeViewListener::OnDropIndex(DesktopDragObject* drag_object, index_gid_t source, index_gid_t dest)
{
AccessModel* model = static_cast<AccessModel*>(m_treeview.GetTreeModel());
Indexer* indexer = g_m2_engine->GetIndexer();
if (dest == 0)
dest = model->GetCategoryID();
else if (drag_object->GetInsertType() == DesktopDragObject::INSERT_BEFORE || drag_object->GetInsertType() == DesktopDragObject::INSERT_AFTER)
dest = indexer->GetIndexById(dest)->GetParentId();
if (!CanDropIndex(source, dest))
return;
// corner case, changing the order of two folders
OpINT32Vector children;
indexer->GetChildren(source, children, FALSE);
if (children.Find(dest) != -1)
{
Index* index = indexer->GetIndexById(dest);
while (index->GetParentId() != source)
{
index = indexer->GetIndexById(index->GetParentId());
}
index->SetParentId(indexer->GetIndexById(source)->GetParentId());
}
indexer->GetIndexById(source)->SetParentId(dest);
}
示例2:
OP_STATUS OPMLM2ImportHandler::OnOutlineBegin(const OpStringC& text,
const OpStringC& xml_url, const OpStringC& title,
const OpStringC& description)
{
if (xml_url.HasContent())
{
const OpStringC& folder_name = title.HasContent() ? title : text;
// First we see if this index already exists.
Index* index = m_indexer->GetSubscribedFolderIndex(m_newsfeed_account, xml_url, 0, folder_name, FALSE, FALSE);
if (index == 0)
{
// Didn't exist; create it.
if ((index = m_indexer->GetSubscribedFolderIndex(m_newsfeed_account, xml_url, 0, folder_name, TRUE, FALSE)) == 0)
return OpStatus::ERR;
g_m2_engine->RefreshFolder(index->GetId());
if (m_parent_folder)
index->SetParentId(m_parent_folder->GetId());
++m_import_count;
}
}
else
{
// this is a folder
m_parent_folder = m_indexer->GetFeedFolderIndexByName(m_parent_folder->GetId(), title.HasContent() ? title : text);
}
return OpStatus::OK;
}