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 @@ ...@@ -34,7 +34,6 @@
#include <vector> #include <vector>
#include "tubes/tubesdllapi.h" #include "tubes/tubesdllapi.h"
#include <tubes/warnings_guard_boost_signals2.hpp>
typedef struct _TpAccount TpAccount; typedef struct _TpAccount TpAccount;
typedef struct _TpContact TpContact; typedef struct _TpContact TpContact;
...@@ -51,9 +50,6 @@ public: ...@@ -51,9 +50,6 @@ public:
AccountContactPairV getContacts(); AccountContactPairV getContacts();
/** Emitted when a contact changes its presence. */
boost::signals2::signal<void ()> sigContactListChanged;
private: private:
TpAccountManager* mpAccountManager; TpAccountManager* mpAccountManager;
std::set< TpContact* > maRegistered; std::set< TpContact* > maRegistered;
......
...@@ -92,13 +92,16 @@ tb_contact_is_online (TpContact *contact) ...@@ -92,13 +92,16 @@ tb_contact_is_online (TpContact *contact)
} }
} }
namespace tubes {
void reDrawAllContacts();
}
static void presence_changed_cb( TpContact* /* contact */, static void presence_changed_cb( TpContact* /* contact */,
guint /* type */, guint /* type */,
gchar* /* status */, gchar* /* status */,
gchar* /* message */, gchar* /* message */,
gpointer pContactList ) gpointer /* pContactList*/ )
{ {
reinterpret_cast<ContactList*> (pContactList)->sigContactListChanged(); tubes::reDrawAllContacts();
} }
AccountContactPairV ContactList::getContacts() AccountContactPairV ContactList::getContacts()
......
...@@ -182,9 +182,6 @@ public: ...@@ -182,9 +182,6 @@ public:
sHeader += String( TubesResId( STR_HEADER_NAME ) ); sHeader += String( TubesResId( STR_HEADER_NAME ) );
sHeader += '\t'; sHeader += '\t';
maList.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT ); maList.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, HIB_LEFT );
mpManager->getContactList()->sigContactListChanged.connect(
boost::bind( &TubeContacts::Populate, this ) );
} }
virtual ~TubeContacts() virtual ~TubeContacts()
{ {
...@@ -263,10 +260,12 @@ IMPL_LINK_NOARG( TubeContacts, BtnListenHdl ) ...@@ -263,10 +260,12 @@ IMPL_LINK_NOARG( TubeContacts, BtnListenHdl )
return 0; return 0;
} }
// Mapping contacts dialog instance for each document
typedef std::map< sal_uInt64, TubeContacts* > DialogsMap;
static DialogsMap aDialogsMap;
TubeContacts* ContactsFactory( Collaboration* pCollaboration ) TubeContacts* ContactsFactory( Collaboration* pCollaboration )
{ {
// Mapping contacts dialog instance for each document
static std::map< sal_uInt64, TubeContacts* > aDialogsMap;
sal_uInt64 Id = pCollaboration->GetId(); sal_uInt64 Id = pCollaboration->GetId();
if (aDialogsMap.find( Id ) == aDialogsMap.end()) if (aDialogsMap.find( Id ) == aDialogsMap.end())
aDialogsMap[ Id ] = new TubeContacts( pCollaboration ); aDialogsMap[ Id ] = new TubeContacts( pCollaboration );
...@@ -281,6 +280,14 @@ void createContacts( Collaboration* pCollaboration ) ...@@ -281,6 +280,14 @@ void createContacts( Collaboration* pCollaboration )
TubeContacts* pContacts = ContactsFactory( pCollaboration ); TubeContacts* pContacts = ContactsFactory( pCollaboration );
pContacts->Populate(); 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: */ /* 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