summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2012-08-03 15:22:26 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-08-04 01:57:12 +0200
commitb7e077787849a91efbc81fbbf5fd885b7cd0f3e1 (patch)
tree2b7eb663357e7954917072b6ab413dccf00cc7d9 /tubes
parent4e648b8e7c65fd8c382baf6b6798cdedfac5cdd8 (diff)
tubes: do not use boost::signal here; call function directly
Change-Id: Iaab997f3d56d76fe98d70f8cffdbb44a34500901
Diffstat (limited to 'tubes')
-rw-r--r--tubes/inc/tubes/contact-list.hxx4
-rw-r--r--tubes/source/contact-list.cxx7
-rw-r--r--tubes/source/contacts.cxx17
3 files changed, 17 insertions, 11 deletions
diff --git a/tubes/inc/tubes/contact-list.hxx b/tubes/inc/tubes/contact-list.hxx
index bb504dc7fafc..eca9f7090336 100644
--- a/tubes/inc/tubes/contact-list.hxx
+++ b/tubes/inc/tubes/contact-list.hxx
@@ -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;
diff --git a/tubes/source/contact-list.cxx b/tubes/source/contact-list.cxx
index 78f84b534417..9a5b49211f40 100644
--- a/tubes/source/contact-list.cxx
+++ b/tubes/source/contact-list.cxx
@@ -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()
diff --git a/tubes/source/contacts.cxx b/tubes/source/contacts.cxx
index 9245b55284b4..ff42df38e567 100644
--- a/tubes/source/contacts.cxx
+++ b/tubes/source/contacts.cxx
@@ -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: */