当前位置: 首页>>代码示例>>C++>>正文


C++ Index::GetId方法代码示例

本文整理汇总了C++中Index::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ Index::GetId方法的具体用法?C++ Index::GetId怎么用?C++ Index::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Index的用法示例。


在下文中一共展示了Index::GetId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

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;
}
开发者ID:prestocore,项目名称:browser,代码行数:32,代码来源:opml_importer.cpp

示例2: OnItemEdited

void AccessTreeViewListener::OnItemEdited(OpWidget *widget, INT32 pos, INT32 column, OpString& text)
{
	INT32 id = m_treeview.GetItemByPosition(pos)->GetID();
	Index* index = g_m2_engine->GetIndexById(id);
	index->SetName(text.CStr());
	g_m2_engine->UpdateIndex(index->GetId());
}
开发者ID:prestocore,项目名称:browser,代码行数:7,代码来源:accesstreeviewlistener.cpp

示例3: UnionIndexGroup

IndexGroupRange::IndexGroupRange(index_gid_t index_id, index_gid_t range_start, index_gid_t range_end)
	: UnionIndexGroup(index_id)
	, m_or_range_start(range_start)
	, m_or_range_end(range_end)
{
	// Or all indexes currently in the range
	INT32 it = -1;
	Index* index;
	while ((index = m_indexer->GetRange(range_start, range_end, it)) != NULL)
	{
		AddIndex(index->GetId());
	}
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:indexgroup.cpp

示例4: GhostBuster

/***********************************************************************************
 **
 ** MailRecovery::GhostBuster
 ***********************************************************************************/
OP_STATUS MailRecovery::GhostBuster()
{
    Store* store = g_m2_engine->GetStore();
    // we can only run this if we have loaded all messages!
    if (!store->HasFinishedLoading())
        return OpStatus::OK;

    OpString8 indexes_with_ghosts;
    OpStringC8 log_heading("Ghostbuster");
    OpStatus::Ignore(DesktopFileLogger::Log(m_recovery_log,log_heading,"Started"));
    INT32 num_ghosts = 0;
    Index* current;
    // go through all indexes
    for (INT32 it = -1; (current = g_m2_engine->GetIndexer()->GetRange(0, IndexTypes::LAST, it)) != NULL; )
    {
        OpINT32Vector message_ids;

        if (OpStatus::IsError(current->PreFetch()) || OpStatus::IsError(current->GetAllMessages(message_ids)))
            continue;

        // go through all messages in all indexes
        for (UINT32 nb = 0; nb < message_ids.GetCount(); nb++)
        {
            INT32 message_id = message_ids.Get(nb);
            // check if the message really exists in store
            if (!store->MessageAvailable(message_id))
            {
                // we have a ghost, a message that doesn't exist in store, but exists in an index
                current->RemoveMessage(message_id);
                num_ghosts++;
                indexes_with_ghosts.AppendFormat(" %d",current->GetId());
            }
        }
    }
    OpStatus::Ignore(store->CommitData());
    OpString8 log_text;
    OpStatus::Ignore(log_text.AppendFormat("Finished: Deleted %d ghosts from the following indexes:%s", num_ghosts, indexes_with_ghosts.CStr()));
    OpStatus::Ignore(DesktopFileLogger::Log(m_recovery_log,log_heading,log_text));
    return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:44,代码来源:recovery.cpp

示例5: Commit

void GroupsModel::Commit()
{
	if (m_read_only)
		return;

	Account* account = MessageEngine::GetInstance()->GetAccountById(m_account_id);

	BOOL account_changed = FALSE;

	if (account)
	{
		account->StopFolderLoading();

		UINT32 index_to_show = 0;

		for (int pos = 0; pos < GetItemCount(); pos++)
		{
			GroupsModelItem* item = GetItemByIndex(pos);
			if (item)
			{
				OpString path, name;
				OpStatus::Ignore(item->GetPath(path));
				OpStatus::Ignore(item->GetName(name));

				if (item->PathIsChanged() && !item->IsManuallyAdded())
				{
					OpString old_path;
					OpStatus::Ignore(item->GetOldPath(old_path));
					OpStatus::Ignore(account->RenameFolder(old_path, path));
				}

				if (item->SubscriptionIsChanged())
				{
					if (item->IsManuallyAdded())
					{
						OpStatus::Ignore(account->CreateFolder(path, item->GetIsSubscribed()));
					}

					if (item->GetIsSubscribed())
					{
						OpStatus::Ignore(account->AddSubscribedFolder(path));
                        account->SetIsTemporary(FALSE);
						if (m_folder_type != OpTypedObject::IMAPFOLDER_TYPE)
						{
							Index* index = MessageEngine::GetInstance()->GetIndexer()->GetSubscribedFolderIndex(account, path, 0, name, TRUE, FALSE);
							if (index)
							{
								MessageEngine::GetInstance()->RefreshFolder(index->GetId());
								if (index_to_show)
									index_to_show = IndexTypes::FIRST_ACCOUNT + m_account_id;
								else
									index_to_show = index->GetId();
							}
						}
					}
					else
					{
						Index* index = MessageEngine::GetInstance()->GetIndexer()->GetSubscribedFolderIndex(account, path, 0, name, FALSE, FALSE);

						if (index)
							OpStatus::Ignore(account->RemoveSubscribedFolder(index->GetId()));
						else
							OpStatus::Ignore(account->RemoveSubscribedFolder(path));
					}
					account_changed = TRUE;
				}
				else if (item->GetIsSubscribed() && m_folder_type != OpTypedObject::IMAPFOLDER_TYPE)
				{
					MessageEngine::GetInstance()->GetIndexer()->GetSubscribedFolderIndex(account, path, 0, name, TRUE, FALSE);
				}
			}
		}
		if (account_changed)
		{
			account->CommitSubscribedFolders();
		}

		if (index_to_show)
		{
			g_application->GoToMailView(index_to_show, NULL, NULL, TRUE, FALSE, TRUE);
		}
	}
}
开发者ID:prestocore,项目名称:browser,代码行数:83,代码来源:groupsmodel.cpp

示例6: GetIndexId

UINT32 GroupsModelItem::GetIndexId()
{
	Index* index = MessageEngine::GetInstance()->GetIndexer()->GetSubscribedFolderIndex(MessageEngine::GetInstance()->GetAccountById(m_account_id), m_path, 0, m_name, FALSE, FALSE);
	return index ? index->GetId() : 0;
}
开发者ID:prestocore,项目名称:browser,代码行数:5,代码来源:groupsmodel.cpp

示例7: OnInputAction


//.........这里部分代码省略.........
				{
					child_action->SetEnabled(FALSE);
					return TRUE;
				}
			}
			break;
		}
		case OpInputAction::ACTION_MAIL_SHOW_INDEX:
		{
			if (action->GetActionDataString())
				g_m2_engine->GetIndexer()->GetSubscribedFolderIndex(g_m2_engine->GetAccountById(id), action->GetActionDataString(), 0, action->GetActionText(), TRUE, FALSE);
			else
			{
				if ((IndexTypes::FIRST_CATEGORY <= id && id <= IndexTypes::LAST_CATEGORY) ||
					(IndexTypes::FIRST_ACCOUNT <= id && id <= IndexTypes::LAST_ACCOUNT))
				{
					g_m2_engine->GetIndexer()->SetCategoryVisible(id, TRUE);
				}
				else
				{
					g_m2_engine->GetIndexer()->GetIndexById(id)->SetVisible(TRUE);
				}
			}
			return TRUE;
		}
		case OpInputAction::ACTION_MAIL_HIDE_INDEX:
		{
			if (g_input_manager->GetActionState(action,this) & OpInputAction::STATE_ENABLED)
			{
				if (action->GetActionDataString())
				{
					Index* index = g_m2_engine->GetIndexer()->GetSubscribedFolderIndex(g_m2_engine->GetAccountById(id), action->GetActionDataString(), 0, action->GetActionText(), FALSE, FALSE);	
					if (index)
						OpStatus::Ignore(g_m2_engine->GetAccountById(id)->RemoveSubscribedFolder(index->GetId()));
				}
				else
				{
					if ((IndexTypes::FIRST_CATEGORY <= id && id <= IndexTypes::LAST_CATEGORY) ||
						(IndexTypes::FIRST_ACCOUNT <= id && id <= IndexTypes::LAST_ACCOUNT))
					{
						g_m2_engine->GetIndexer()->SetCategoryVisible(id, FALSE);
					}
					else
					{
						g_m2_engine->GetIndexer()->GetIndexById(id)->SetVisible(FALSE);
					}
				}
				return TRUE;
			}
			break;
		}
		case OpInputAction::ACTION_NEW_NEWSFEED:
		{
			OpAccordion::OpAccordionItem * accordion_item = m_accordion->GetItemById(action->GetActionData());
			if (accordion_item)
			{
				m_accordion->ExpandItem(accordion_item, TRUE);
				accordion_item->GetWidget()->OnInputAction(action);
			}
			return TRUE;
		}
		case OpInputAction::ACTION_NEW_FOLDER:
		{
			index_gid_t parent_id = 0;
			if (action->GetActionData())
			{
开发者ID:prestocore,项目名称:browser,代码行数:67,代码来源:AccordionMailPanel.cpp


注:本文中的Index::GetId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。