本文整理汇总了C++中AccountHandler::getBuddiesAsync方法的典型用法代码示例。如果您正苦于以下问题:C++ AccountHandler::getBuddiesAsync方法的具体用法?C++ AccountHandler::getBuddiesAsync怎么用?C++ AccountHandler::getBuddiesAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountHandler
的用法示例。
在下文中一共展示了AccountHandler::getBuddiesAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _populateBuddyModel
void AP_UnixDialog_CollaborationShare::_populateBuddyModel(bool refresh)
{
UT_DEBUGMSG(("AP_UnixDialog_CollaborationShare::_populateBuddyModel()\n"));
UT_return_if_fail(m_pBuddyModel);
AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
UT_return_if_fail(pManager);
AccountHandler* pHandler = _getActiveAccountHandler();
UT_return_if_fail(pHandler);
if (refresh)
{
// signal the account to refresh its buddy list ...
pHandler->getBuddiesAsync(); // this function is really sync() atm; we need to rework this dialog to make it proper async
// fetch the current ACL
m_vAcl = _getSessionACL();
}
// clear out the old contents, if any
_freeBuddyList();
GtkTreeIter iter;
for (UT_uint32 i = 0; i < pHandler->getBuddies().size(); i++)
{
BuddyPtr pBuddy = pHandler->getBuddies()[i];
UT_continue_if_fail(pBuddy);
if (!pBuddy->getHandler()->canShare(pBuddy))
{
UT_DEBUGMSG(("Not allowed to share with buddy: %s\n", pBuddy->getDescription().utf8_str()));
continue;
}
// crap, we can't store shared pointers in the list store; use a
// hack to do it (which kinda defies the whole shared pointer thingy,
// but alas...)
BuddyPtrWrapper* pWrapper = new BuddyPtrWrapper(pBuddy);
gtk_list_store_append (m_pBuddyModel, &iter);
gtk_list_store_set (m_pBuddyModel, &iter,
SHARE_COLUMN, _populateShareState(pBuddy),
DESC_COLUMN, pBuddy->getDescription().utf8_str(),
BUDDY_COLUMN, pWrapper,
-1);
}
gtk_widget_show_all(m_wBuddyTree);
}