本文整理汇总了C++中Account::CreateFolder方法的典型用法代码示例。如果您正苦于以下问题:C++ Account::CreateFolder方法的具体用法?C++ Account::CreateFolder怎么用?C++ Account::CreateFolder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::CreateFolder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}