From 67215c7ffe55fc61d08f40a14f61b20adfc9a061 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 11 Nov 2014 20:28:45 +0000 Subject: [PATCH] Removed unnecessary method p3Notify::AddFeedItem. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7674 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/dbase/fistore.h | 1 - libretroshare/src/ft/ftserver.h | 1 - libretroshare/src/pqi/p3linkmgr.cc | 2 +- libretroshare/src/pqi/p3notify.cc | 9 --------- libretroshare/src/pqi/p3notify.h | 13 ++++++------- libretroshare/src/retroshare/rsnotify.h | 12 +++--------- 6 files changed, 10 insertions(+), 28 deletions(-) diff --git a/libretroshare/src/dbase/fistore.h b/libretroshare/src/dbase/fistore.h index 1faad88d3..e175adec8 100644 --- a/libretroshare/src/dbase/fistore.h +++ b/libretroshare/src/dbase/fistore.h @@ -35,7 +35,6 @@ */ class p3PeerMgr ; -class pqiNotify ; #include "dbase/findex.h" #include "dbase/cachestrapper.h" diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index e8bfa0a1e..99ee5e849 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -57,7 +57,6 @@ class p3ConnectMgr; class CacheStrapper; class CacheTransfer; -class pqiNotify; /* needed by FiStore */ class ftCacheStrapper; class ftFiStore; class ftFiMonitor; diff --git a/libretroshare/src/pqi/p3linkmgr.cc b/libretroshare/src/pqi/p3linkmgr.cc index ed8c59f23..69110ee03 100644 --- a/libretroshare/src/pqi/p3linkmgr.cc +++ b/libretroshare/src/pqi/p3linkmgr.cc @@ -472,7 +472,7 @@ void p3LinkMgrIMPL::tickMonitors() if (notify) { notify->AddPopupMessage(RS_POPUP_CONNECT, peer.id.toStdString(),"", "Online: "); - notify->AddFeedItem(RS_FEED_ITEM_PEER_CONNECT, peer.id.toStdString(), "", ""); + notify->AddFeedItem(RS_FEED_ITEM_PEER_CONNECT, peer.id.toStdString()); } } } diff --git a/libretroshare/src/pqi/p3notify.cc b/libretroshare/src/pqi/p3notify.cc index 0ddc9a0a8..80ea867de 100644 --- a/libretroshare/src/pqi/p3notify.cc +++ b/libretroshare/src/pqi/p3notify.cc @@ -196,15 +196,6 @@ bool p3Notify::AddFeedItem(uint32_t type, const std::string& id1, const std::str return true; } -bool p3Notify::AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3) -{ - RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/ - pendingNewsFeed.push_back(RsFeedItem(type, id1, id2, id3)); - - return true; -} - - bool p3Notify::ClearFeedItems(uint32_t type) { RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/ diff --git a/libretroshare/src/pqi/p3notify.h b/libretroshare/src/pqi/p3notify.h index c5a4b5eaa..7ba96af74 100644 --- a/libretroshare/src/pqi/p3notify.h +++ b/libretroshare/src/pqi/p3notify.h @@ -86,13 +86,12 @@ class p3Notify: public RsNotify bool SetSysMessageMode(uint32_t sysid, uint32_t mode); bool SetPopupMessageMode(uint32_t ptype, uint32_t mode); - /* Overloaded from pqiNotify */ - virtual bool AddPopupMessage(uint32_t ptype, const std::string& name, const std::string& title, const std::string& msg); - virtual bool AddSysMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg); - virtual bool AddLogMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg); - virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3); - virtual bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3,const std::string& id4); - virtual bool ClearFeedItems(uint32_t type); + /* Notify messages */ + bool AddPopupMessage(uint32_t ptype, const std::string& name, const std::string& title, const std::string& msg); + bool AddSysMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg); + bool AddLogMessage(uint32_t sysid, uint32_t type, const std::string& title, const std::string& msg); + bool AddFeedItem(uint32_t type, const std::string& id1, const std::string& id2 = "", const std::string& id3 = "", const std::string& id4 = ""); + bool ClearFeedItems(uint32_t type); // Notifications of clients. Can be called from anywhere inside libretroshare. // diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h index 3bd4b6432..6e8ad4fe4 100644 --- a/libretroshare/src/retroshare/rsnotify.h +++ b/libretroshare/src/retroshare/rsnotify.h @@ -120,13 +120,7 @@ const uint32_t NOTIFY_HASHTYPE_SAVE_FILE_INDEX = 4; /* Hashing file */ class RsFeedItem { public: - RsFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3) - :mType(type), mId1(id1), mId2(id2), mId3(id3) - { - return; - } - - RsFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3,const std::string& id4) + RsFeedItem(uint32_t type, const std::string& id1, const std::string& id2 = "", const std::string& id3 = "", const std::string& id4 = "") :mType(type), mId1(id1), mId2(id2), mId3(id3), mId4(id4) {} RsFeedItem() :mType(0) { return; } @@ -203,8 +197,8 @@ class NotifyClient virtual void notifyForumMsgReadSatusChanged (const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) {} virtual void notifyChannelMsgReadSatusChanged (const std::string& /* channelId */, const std::string& /* msgId */, uint32_t /* status */) {} virtual bool askForDeferredSelfSignature (const void * /* data */, const uint32_t /* len */, unsigned char * /* sign */, unsigned int * /* signlen */,int& signature_result ) { signature_result = false ;return true; } - virtual void notifyDownloadComplete (const std::string& /* fileHash */) {}; - virtual void notifyDownloadCompleteCount (uint32_t /* count */) {}; + virtual void notifyDownloadComplete (const std::string& /* fileHash */) {} + virtual void notifyDownloadCompleteCount (uint32_t /* count */) {} virtual void notifyHistoryChanged (uint32_t /* msgId */, int /* type */) {} virtual bool askForPassword (const std::string& /* key_details */, bool /* prev_is_bad */, std::string& /* password */ ) { return false ;}