use notify for gxs events. Removed the previous polling based system. Now multiple clients can receive gxs changes. This also fixes the always growing changes queue in rs-nogui.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8057 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-03-20 10:39:17 +00:00
parent b912ac656c
commit 6dff335515
11 changed files with 117 additions and 280 deletions

View file

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*************************************************************************/
#include <retroshare/rsgxsifacehelper.h>
#include <QInputDialog>
#include <QMessageBox>
@ -140,6 +141,7 @@ NotifyQt::NotifyQt() : cDialog(NULL)
// register to allow sending over Qt::QueuedConnection
qRegisterMetaType<ChatId>("ChatId");
qRegisterMetaType<ChatMessage>("ChatMessage");
qRegisterMetaType<RsGxsChanges>("RsGxsChanges");
}
void NotifyQt::notifyErrorMsg(int list, int type, std::string msg)
@ -417,6 +419,22 @@ void NotifyQt::notifyPeerStatusChangedSummary()
emit peerStatusChangedSummary();
}
void NotifyQt::notifyGxsChange(const RsGxsChanges& changes)
{
{
QMutexLocker m(&_mutex) ;
if(!_enabled)
return ;
}
#ifdef NOTIFY_DEBUG
std::cerr << "Notifyqt:: notified that gxs has changes" << std::endl;
#endif
emit gxsChange(changes);
}
#ifdef REMOVE
void NotifyQt::notifyForumMsgReadSatusChanged(const std::string& forumId, const std::string& msgId, uint32_t status)
{