Kaydet (Commit) b7e07778 authored tarafından Matúš Kukan's avatar Matúš Kukan

tubes: do not use boost::signal here; call function directly

Change-Id: Iaab997f3d56d76fe98d70f8cffdbb44a34500901
üst 4e648b8e
......@@ -34,7 +34,6 @@
#include <vector>
#include "tubes/tubesdllapi.h"
#include <tubes/warnings_guard_boost_signals2.hpp>
typedef struct _TpAccount TpAccount;
typedef struct _TpContact TpContact;
......@@ -51,9 +50,6 @@ public:
AccountContactPairV getContacts();
/** Emitted when a contact changes its presence. */
boost::signals2::signal<void ()> sigContactListChanged;
private:
TpAccountManager* mpAccountManager;
std::set< TpContact* > maRegistered;
......
......@@ -92,13 +92,16 @@ tb_contact_is_online (TpContact *contact)
}
}
namespace tubes {
void reDrawAllContacts();
}
static void presence_changed_cb( TpContact* /* contact */,
guint /* type */,
gchar* /* status */,
gchar* /* message */,
gpointer pContactList )
gpointer /* pContactList*/ )
{
reinterpret_cast<ContactList*> (pContactList)->sigContactListChanged();
tubes::reDrawAllContacts();
}
AccountContactPairV ContactList::getContacts()
......
......@@ -182,9 +182,6 @@ public:
sHeader += String( TubesResId( STR_HEADER_NAME ) );
sHeader += '\t';
maList.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT );
mpManager->getContactList()->sigContactListChanged.connect(
boost::bind( &TubeContacts::Populate, this ) );
}
virtual ~TubeContacts()
{
......@@ -263,10 +260,12 @@ IMPL_LINK_NOARG( TubeContacts, BtnListenHdl )
return 0;
}
// Mapping contacts dialog instance for each document
typedef std::map< sal_uInt64, TubeContacts* > DialogsMap;
static DialogsMap aDialogsMap;
TubeContacts* ContactsFactory( Collaboration* pCollaboration )
{
// Mapping contacts dialog instance for each document
static std::map< sal_uInt64, TubeContacts* > aDialogsMap;
sal_uInt64 Id = pCollaboration->GetId();
if (aDialogsMap.find( Id ) == aDialogsMap.end())
aDialogsMap[ Id ] = new TubeContacts( pCollaboration );
......@@ -281,6 +280,14 @@ void createContacts( Collaboration* pCollaboration )
TubeContacts* pContacts = ContactsFactory( pCollaboration );
pContacts->Populate();
}
void reDrawAllContacts()
{
for (DialogsMap::const_iterator it = aDialogsMap.begin();
it != aDialogsMap.end(); ++it)
it->second->Populate();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment