From 8fd22c8fd16520b237a81d5d48a67aa852190cee Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Mon, 29 Oct 2018 05:50:11 +0100 Subject: [PATCH 001/110] Safer rsGxsChannel API Protect data members with mutexes Print messages when errors happens --- libretroshare/src/gxs/gxstokenqueue.cc | 33 +-- libretroshare/src/gxs/gxstokenqueue.h | 2 +- libretroshare/src/gxs/rsgenexchange.cc | 2 +- libretroshare/src/gxs/rsgxsdataaccess.cc | 41 ++- libretroshare/src/retroshare/rsgxschannels.h | 23 +- libretroshare/src/services/p3gxschannels.cc | 275 ++++++++++--------- libretroshare/src/services/p3gxschannels.h | 24 +- 7 files changed, 204 insertions(+), 196 deletions(-) diff --git a/libretroshare/src/gxs/gxstokenqueue.cc b/libretroshare/src/gxs/gxstokenqueue.cc index c5ebf87fd..c9eb8ef92 100644 --- a/libretroshare/src/gxs/gxstokenqueue.cc +++ b/libretroshare/src/gxs/gxstokenqueue.cc @@ -36,20 +36,17 @@ bool GxsTokenQueue::queueRequest(uint32_t token, uint32_t req_type) void GxsTokenQueue::checkRequests() { { - RsStackMutex stack(mQueueMtx); /********** STACK LOCKED MTX ******/ - if (mQueue.empty()) - { - return; - } + RS_STACK_MUTEX(mQueueMtx); + if (mQueue.empty()) return; } // Must check all, and move to a different list - for reentrant / good mutex behaviour. std::list toload; std::list::iterator it; - bool stuffToLoad = false; + { - RsStackMutex stack(mQueueMtx); /********** STACK LOCKED MTX ******/ + RS_STACK_MUTEX(mQueueMtx); for(it = mQueue.begin(); it != mQueue.end();) { uint32_t token = it->mToken; @@ -62,29 +59,29 @@ void GxsTokenQueue::checkRequests() stuffToLoad = true; #ifdef GXS_DEBUG - std::cerr << "GxsTokenQueue::checkRequests() token: " << token << " Complete"; - std::cerr << std::endl; + std::cerr << "GxsTokenQueue::checkRequests() token: " << token + << " Complete" << std::endl; #endif ++it; } else if (status == RsTokenService::FAILED) { // maybe we should do alternative callback? - std::cerr << "GxsTokenQueue::checkRequests() ERROR Request Failed: " << token; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " ERROR Request Failed! " + << " token: " << token << std::endl; it = mQueue.erase(it); } else { #ifdef GXS_DEBUG - std::cerr << "GxsTokenQueue::checkRequests() token: " << token << " is unfinished, status: " << status; - std::cerr << std::endl; + std::cerr << "GxsTokenQueue::checkRequests() token: " << token + << " is unfinished, status: " << status << std::endl; #endif ++it; } } - } + } // RS_STACK_MUTEX(mQueueMtx) END if (stuffToLoad) { @@ -95,11 +92,3 @@ void GxsTokenQueue::checkRequests() } } - // This must be overloaded to complete the functionality. -void GxsTokenQueue::handleResponse(uint32_t token, uint32_t req_type) -{ - std::cerr << "GxsTokenQueue::handleResponse(" << token << "," << req_type << ") ERROR: NOT HANDLED"; - std::cerr << std::endl; -} - - diff --git a/libretroshare/src/gxs/gxstokenqueue.h b/libretroshare/src/gxs/gxstokenqueue.h index 0b58f7c3d..c6c32262e 100644 --- a/libretroshare/src/gxs/gxstokenqueue.h +++ b/libretroshare/src/gxs/gxstokenqueue.h @@ -54,7 +54,7 @@ public: protected: /// This must be overloaded to complete the functionality. - virtual void handleResponse(uint32_t token, uint32_t req_type); + virtual void handleResponse(uint32_t token, uint32_t req_type) = 0; private: RsGenExchange *mGenExchange; diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 1ffaf793a..183751356 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1925,7 +1925,7 @@ void RsGenExchange::setGroupStatusFlags(uint32_t& token, const RsGxsGroupId& grp void RsGenExchange::setGroupServiceString(uint32_t& token, const RsGxsGroupId& grpId, const std::string& servString) { - RS_STACK_MUTEX(mGenMtx) ; + RS_STACK_MUTEX(mGenMtx); token = mDataAccess->generatePublicToken(); GrpLocMetaData g; diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index a72123f92..a945829f7 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -39,14 +39,16 @@ RsGxsDataAccess::~RsGxsDataAccess() for(std::map::const_iterator it(mRequests.begin());it!=mRequests.end();++it) delete it->second ; } -bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, - const std::list &groupIds) +bool RsGxsDataAccess::requestGroupInfo( + uint32_t &token, uint32_t ansType, const RsTokReqOptions &opts, + const std::list &groupIds ) { - if(groupIds.empty()) - { - std::cerr << "(WW) Group Id list is empty" << std::endl; - return false; - } + if(groupIds.empty()) + { + std::cerr << __PRETTY_FUNCTION__ << " (WW) Group Id list is empty!" + << std::endl; + return false; + } GxsRequest* req = NULL; uint32_t reqType = opts.mReqType; @@ -76,19 +78,19 @@ bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const req = gir; } - if(req == NULL) - { - std::cerr << "RsGxsDataAccess::requestGroupInfo() request type not recognised, type " - << reqType << std::endl; - return false; - }else - { - generateToken(token); + if(!req) + { + std::cerr << __PRETTY_FUNCTION__ << " request type not recognised, " + << "reqType: " << reqType << std::endl; + return false; + } + + generateToken(token); #ifdef DATA_DEBUG - std::cerr << "RsGxsDataAccess::requestGroupInfo() gets Token: " << token << std::endl; + std::cerr << "RsGxsDataAccess::requestGroupInfo() gets token: " << token + << std::endl; #endif - } setReq(req, token, ansType, opts); storeRequest(req); @@ -130,11 +132,8 @@ bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const void RsGxsDataAccess::generateToken(uint32_t &token) { - RsStackMutex stack(mDataMutex); /****** LOCKED *****/ - + RS_STACK_MUTEX(mDataMutex); token = mNextToken++; - - return; } diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index cc95cf0bd..4f81f7a96 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -153,6 +153,16 @@ public: */ virtual bool createPost(RsGxsChannelPost& post) = 0; + /** + * @brief Subscrbe to a channel. Blocking API + * @jsonapi{development} + * @param[in] channelId Channel id + * @param[in] subscribe true to subscribe, false to unsubscribe + * @return false on error, true otherwise + */ + virtual bool subscribeToChannel( const RsGxsGroupId &channelId, + bool subscribe ) = 0; + /* Specific Service Data * TODO: change the orrible const uint32_t &token to uint32_t token @@ -174,24 +184,24 @@ public: uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; /** - * @brief Enable or disable auto-download for given channel + * @brief Enable or disable auto-download for given channel. Blocking API * @jsonapi{development} - * @param[in] groupId channel id + * @param[in] channelId channel id * @param[in] enable true to enable, false to disable * @return false if something failed, true otherwhise */ virtual bool setChannelAutoDownload( - const RsGxsGroupId &groupId, bool enable) = 0; + const RsGxsGroupId& channelId, bool enable) = 0; /** * @brief Get auto-download option value for given channel * @jsonapi{development} - * @param[in] groupId channel id - * @param[in] enabled storage for the auto-download option value + * @param[in] channelId channel id + * @param[out] enabled storage for the auto-download option value * @return false if something failed, true otherwhise */ virtual bool getChannelAutoDownload( - const RsGxsGroupId &groupId, bool& enabled) = 0; + const RsGxsGroupId& channelId, bool& enabled) = 0; /** * @brief Set download directory for the given channel @@ -228,7 +238,6 @@ public: * @brief Request subscription to a group. * The action is performed asyncronously, so it could fail in a subsequent * phase even after returning true. - * @jsonapi{development} * @param[out] token Storage for RsTokenService token to track request * status. * @param[in] groupId Channel id diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 3897cbb2a..d5ff4ac4e 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -76,6 +76,8 @@ p3GxsChannels::p3GxsChannels( RsGenExchange( gds, nes, new RsGxsChannelSerialiser(), RS_SERVICE_GXS_TYPE_CHANNELS, gixs, channelsAuthenPolicy() ), RsGxsChannels(static_cast(*this)), GxsTokenQueue(this), + mSubscribedGroupsMutex("GXS channels subscribed groups cache"), + mKnownChannelsMutex("GXS channels known channels timestamp cache"), mSearchCallbacksMapMutex("GXS channels search") { // For Dummy Msgs. @@ -174,7 +176,10 @@ bool p3GxsChannels::saveList(bool &cleanup, std::list&saveList) RsGxsForumNotifyRecordsItem *item = new RsGxsForumNotifyRecordsItem ; - item->records = mKnownChannels ; + { + RS_STACK_MUTEX(mKnownChannelsMutex); + item->records = mKnownChannels; + } saveList.push_back(item) ; return true; @@ -191,8 +196,9 @@ bool p3GxsChannels::loadList(std::list& loadList) RsGxsForumNotifyRecordsItem *fnr = dynamic_cast(item) ; - if(fnr != NULL) + if(fnr) { + RS_STACK_MUTEX(mKnownChannelsMutex); mKnownChannels.clear(); for(auto it(fnr->records.begin());it!=fnr->records.end();++it) @@ -228,7 +234,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) std::cerr << "p3GxsChannels::notifyChanges() : " << changes.size() << "changes to notify" << std::endl; #endif - p3Notify *notify = NULL; + p3Notify* notify = nullptr; if (!changes.empty()) { notify = RsServer::notify(); @@ -271,9 +277,8 @@ void p3GxsChannels::notifyChanges(std::vector &changes) std::cerr << "p3GxsChannels::notifyChanges() Msgs for Group: " << mit->first; std::cerr << std::endl; #endif - bool enabled = false ; - - if (autoDownloadEnabled(mit->first, enabled) && enabled) + bool enabled = false; + if (autoDownloadEnabled(mit->first, enabled) && enabled) { #ifdef GXSCHANNELS_DEBUG std::cerr << "p3GxsChannels::notifyChanges() AutoDownload for Group: " << mit->first; @@ -306,6 +311,7 @@ void p3GxsChannels::notifyChanges(std::vector &changes) /* group received */ std::list &grpList = grpChange->mGrpIdList; std::list::iterator git; + RS_STACK_MUTEX(mKnownChannelsMutex); for (git = grpList.begin(); git != grpList.end(); ++git) { if(mKnownChannels.find(*git) == mKnownChannels.end()) @@ -338,15 +344,15 @@ void p3GxsChannels::notifyChanges(std::vector &changes) /* shouldn't need to worry about groups - as they need to be subscribed to */ } - request_SpecificSubscribedGroups(unprocessedGroups); + if(!unprocessedGroups.empty()) + request_SpecificSubscribedGroups(unprocessedGroups); RsGxsIfaceHelper::receiveChanges(changes); } void p3GxsChannels::service_tick() { - -static rstime_t last_dummy_tick = 0; + static rstime_t last_dummy_tick = 0; if (time(NULL) > last_dummy_tick + 5) { @@ -414,75 +420,84 @@ bool p3GxsChannels::groupShareKeys( * at the moment - fix it up later */ -bool p3GxsChannels::getPostData(const uint32_t &token, std::vector &msgs, std::vector &cmts) +bool p3GxsChannels::getPostData( + const uint32_t &token, std::vector &msgs, + std::vector &cmts ) { #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::getPostData()"; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << std::cerr << std::endl; #endif GxsMsgDataMap msgData; - bool ok = RsGenExchange::getMsgData(token, msgData); - - if(ok) + if(!RsGenExchange::getMsgData(token, msgData)) { - GxsMsgDataMap::iterator mit = msgData.begin(); - - for(; mit != msgData.end(); ++mit) + std::cerr << __PRETTY_FUNCTION__ <<" ERROR in request" << std::endl; + return false; + } + + GxsMsgDataMap::iterator mit = msgData.begin(); + + for(; mit != msgData.end(); ++mit) + { + std::vector& msgItems = mit->second; + std::vector::iterator vit = msgItems.begin(); + + for(; vit != msgItems.end(); ++vit) { - std::vector& msgItems = mit->second; - std::vector::iterator vit = msgItems.begin(); + RsGxsChannelPostItem* postItem = + dynamic_cast(*vit); - for(; vit != msgItems.end(); ++vit) + if(postItem) { - RsGxsChannelPostItem* postItem = dynamic_cast(*vit); - - if(postItem) + RsGxsChannelPost msg; + postItem->toChannelPost(msg, true); + msgs.push_back(msg); + delete postItem; + } + else + { + RsGxsCommentItem* cmtItem = + dynamic_cast(*vit); + if(cmtItem) { - RsGxsChannelPost msg; - postItem->toChannelPost(msg, true); - msgs.push_back(msg); - delete postItem; + RsGxsComment cmt; + RsGxsMsgItem *mi = (*vit); + cmt = cmtItem->mMsg; + cmt.mMeta = mi->meta; +#ifdef GXSCOMMENT_DEBUG + std::cerr << "p3GxsChannels::getPostData Found Comment:" << std::endl; + cmt.print(std::cerr," ", "cmt"); +#endif + cmts.push_back(cmt); + delete cmtItem; } else { - RsGxsCommentItem* cmtItem = dynamic_cast(*vit); - if(cmtItem) - { - RsGxsComment cmt; - RsGxsMsgItem *mi = (*vit); - cmt = cmtItem->mMsg; - cmt.mMeta = mi->meta; -#ifdef GXSCOMMENT_DEBUG - std::cerr << "p3GxsChannels::getPostData Found Comment:" << std::endl; - cmt.print(std::cerr," ", "cmt"); -#endif - cmts.push_back(cmt); - delete cmtItem; - } - else - { - RsGxsMsgItem* msg = (*vit); - //const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217; - //const uint8_t RS_PKT_SUBTYPE_GXSCHANNEL_POST_ITEM = 0x03; - //const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_COMMENT_ITEM = 0xf1; - std::cerr << "Not a GxsChannelPostItem neither a RsGxsCommentItem" - << " PacketService=" << std::hex << (int)msg->PacketService() << std::dec - << " PacketSubType=" << std::hex << (int)msg->PacketSubType() << std::dec - << " , deleting!" << std::endl; - delete *vit; - } + RsGxsMsgItem* msg = (*vit); + //const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217; + //const uint8_t RS_PKT_SUBTYPE_GXSCHANNEL_POST_ITEM = 0x03; + //const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_COMMENT_ITEM = 0xf1; + std::cerr << __PRETTY_FUNCTION__ + << " Not a GxsChannelPostItem neither a " + << "RsGxsCommentItem PacketService=" << std::hex + << (int)msg->PacketService() << std::dec + << " PacketSubType=" << std::hex + << (int)msg->PacketSubType() << std::dec + << " , deleting!" << std::endl; + delete *vit; } } } } - else - { - std::cerr << "p3GxsChannels::getPostData() ERROR in request"; - std::cerr << std::endl; - } - return ok; + return true; +} + +bool p3GxsChannels::getPostData( + const uint32_t& token, std::vector& posts ) +{ + std::vector cmts; + return getPostData(token, posts, cmts); } //Not currently used @@ -548,21 +563,6 @@ bool p3GxsChannels::getPostData(const uint32_t &token, std::vector::iterator it; + RS_STACK_MUTEX(mSubscribedGroupsMutex); + std::map::iterator it; it = mSubscribedGroups.find(groupId); if (it == mSubscribedGroups.end()) { @@ -626,6 +627,8 @@ bool p3GxsChannels::getChannelDownloadDirectory(const RsGxsGroupId & groupId,std std::cerr << "p3GxsChannels::getChannelDownloadDirectory(" << id << ")" << std::endl; #endif + RS_STACK_MUTEX(mSubscribedGroupsMutex); + std::map::iterator it; it = mSubscribedGroups.find(groupId); @@ -668,7 +671,8 @@ void p3GxsChannels::request_AllSubscribedGroups() } -void p3GxsChannels::request_SpecificSubscribedGroups(const std::list &groups) +void p3GxsChannels::request_SpecificSubscribedGroups( + const std::list &groups ) { #ifdef GXSCHANNELS_DEBUG std::cerr << "p3GxsChannels::request_SpecificSubscribedGroups()"; @@ -681,8 +685,19 @@ void p3GxsChannels::request_SpecificSubscribedGroups(const std::listrequestGroupInfo(token, ansType, opts, groups); - GxsTokenQueue::queueRequest(token, GXSCHANNELS_SUBSCRIBED_META); + if(!RsGenExchange::getTokenService()-> + requestGroupInfo(token, ansType, opts, groups)) + { + std::cerr << __PRETTY_FUNCTION__ << " Failed requesting groups info!" + << std::endl; + return; + } + + if(!GxsTokenQueue::queueRequest(token, GXSCHANNELS_SUBSCRIBED_META)) + { + std::cerr << __PRETTY_FUNCTION__ << " Failed queuing request!" + << std::endl; + } } @@ -746,6 +761,7 @@ void p3GxsChannels::updateSubscribedGroup(const RsGroupMetaData &group) std::cerr << std::endl; #endif + RS_STACK_MUTEX(mSubscribedGroupsMutex); mSubscribedGroups[group.mGroupId] = group; } @@ -757,9 +773,8 @@ void p3GxsChannels::clearUnsubscribedGroup(const RsGxsGroupId &id) std::cerr << std::endl; #endif - //std::map mSubscribedGroups; + RS_STACK_MUTEX(mSubscribedGroupsMutex); std::map::iterator it; - it = mSubscribedGroups.find(id); if (it != mSubscribedGroups.end()) { @@ -838,24 +853,20 @@ void p3GxsChannels::request_GroupUnprocessedPosts(const std::list } -void p3GxsChannels::load_SpecificUnprocessedPosts(const uint32_t &token) +void p3GxsChannels::load_SpecificUnprocessedPosts(uint32_t token) { #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts"; - std::cerr << std::endl; + std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts" << std::endl; #endif std::vector posts; if (!getPostData(token, posts)) { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts ERROR"; - std::cerr << std::endl; -#endif + std::cerr << __PRETTY_FUNCTION__ << " ERROR getting post data!" + << std::endl; return; } - std::vector::iterator it; for(it = posts.begin(); it != posts.end(); ++it) { @@ -893,29 +904,24 @@ void p3GxsChannels::load_GroupUnprocessedPosts(const uint32_t &token) void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg) { #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::handleUnprocessedPost() GroupId: " << msg.mMeta.mGroupId << " MsgId: " << msg.mMeta.mMsgId; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " GroupId: " << msg.mMeta.mGroupId + << " MsgId: " << msg.mMeta.mMsgId << std::endl; #endif if (!IS_MSG_UNPROCESSED(msg.mMeta.mMsgStatus)) { - std::cerr << "p3GxsChannels::handleUnprocessedPost() Msg already Processed"; - std::cerr << std::endl; - std::cerr << "p3GxsChannels::handleUnprocessedPost() ERROR - this should not happen"; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " ERROR Msg already Processed!" + << std::endl; return; } - bool enabled = false ; - /* check that autodownload is set */ - if (autoDownloadEnabled(msg.mMeta.mGroupId,enabled) && enabled ) + bool enabled = false; + if (autoDownloadEnabled(msg.mMeta.mGroupId, enabled) && enabled) { - - #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::handleUnprocessedPost() AutoDownload Enabled ... handling"; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " AutoDownload Enabled... handling" + << std::endl; #endif /* check the date is not too old */ @@ -928,8 +934,7 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg) // MORE THOUGHT HAS TO GO INTO THAT STUFF. #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::handleUnprocessedPost() START DOWNLOAD"; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " START DOWNLOAD" << std::endl; #endif std::list::const_iterator fit; @@ -951,8 +956,11 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg) rsFiles->FileRequest(fname, hash, size, localpath, flags, srcIds); } - else - std::cerr << "WARNING: Channel file is not auto-downloaded because its size exceeds the threshold of " << CHANNEL_MAX_AUTO_DL << " bytes." << std::endl; + else + std::cerr << __PRETTY_FUNCTION__ << "Channel file is not auto-" + << "downloaded because its size exceeds the threshold" + << " of " << CHANNEL_MAX_AUTO_DL << " bytes." + << std::endl; } } @@ -1079,6 +1087,15 @@ bool p3GxsChannels::createPost(RsGxsChannelPost& post) return false; } +bool p3GxsChannels::subscribeToChannel( + const RsGxsGroupId& groupId, bool subscribe ) +{ + uint32_t token; + if( !subscribeToGroup(token, groupId, subscribe) + || waitToken(token) != RsTokenService::COMPLETE ) return false; + return true; +} + //////////////////////////////////////////////////////////////////////////////// /// Blocking API implementation end @@ -1096,16 +1113,13 @@ bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &groupId,bool& enable std::cerr << std::endl; #endif + RS_STACK_MUTEX(mSubscribedGroupsMutex); std::map::iterator it; - it = mSubscribedGroups.find(groupId); if (it == mSubscribedGroups.end()) { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::autoDownloadEnabled() No Entry"; - std::cerr << std::endl; -#endif - + std::cerr << __PRETTY_FUNCTION__ << " ERROR requested channel is not " + << "subscribed" << std::endl; return false; } @@ -1190,23 +1204,20 @@ std::string SSGxsChannelGroup::save() const return output; } -bool p3GxsChannels::setAutoDownload(const RsGxsGroupId &groupId, bool enabled) +bool p3GxsChannels::setAutoDownload(const RsGxsGroupId& groupId, bool enabled) { #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::setAutoDownload() id: " << groupId << " enabled: " << enabled; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " id: " << groupId + << " enabled: " << enabled << std::endl; #endif + RS_STACK_MUTEX(mSubscribedGroupsMutex); std::map::iterator it; - it = mSubscribedGroups.find(groupId); if (it == mSubscribedGroups.end()) { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::setAutoDownload() Missing Group"; - std::cerr << std::endl; -#endif - + std::cerr << __PRETTY_FUNCTION__ << " ERROR requested channel: " + << groupId.toStdString() << " is not subscribed!" << std::endl; return false; } @@ -1215,27 +1226,21 @@ bool p3GxsChannels::setAutoDownload(const RsGxsGroupId &groupId, bool enabled) ss.load(it->second.mServiceString); if (enabled == ss.mAutoDownload) { - /* it should be okay! */ -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::setAutoDownload() WARNING setting looks okay already"; - std::cerr << std::endl; -#endif - + std::cerr << __PRETTY_FUNCTION__ << " WARNING mAutoDownload was already" + << " properly set to: " << enabled << " for channel:" + << groupId.toStdString() << std::endl; + return false; } - /* we are just going to set it anyway. */ ss.mAutoDownload = enabled; std::string serviceString = ss.save(); + uint32_t token; + RsGenExchange::setGroupServiceString(token, groupId, serviceString); + + if(waitToken(token) != RsTokenService::COMPLETE) return false; it->second.mServiceString = serviceString; // update Local Cache. - RsGenExchange::setGroupServiceString(token, groupId, serviceString); // update dbase. - - /* now reload it */ - std::list groups; - groups.push_back(groupId); - - request_SpecificSubscribedGroups(groups); return true; } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 327444509..0d2cbf561 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -83,7 +83,7 @@ public: virtual bool getGroupData(const uint32_t &token, std::vector &groups); virtual bool getPostData(const uint32_t &token, std::vector &posts, std::vector &cmts); -virtual bool getPostData(const uint32_t &token, std::vector &posts) { std::vector cmts; return getPostData( token, posts, cmts);} +virtual bool getPostData(const uint32_t &token, std::vector &posts); //Not currently used //virtual bool getRelatedPosts(const uint32_t &token, std::vector &posts); @@ -186,6 +186,10 @@ virtual bool ExtraFileRemove(const RsFileHash &hash); /// Implementation of @see RsGxsChannels::createPost virtual bool createPost(RsGxsChannelPost& post); + /// Implementation of @see RsGxsChannels::subscribeToChannel + virtual bool subscribeToChannel( const RsGxsGroupId &groupId, + bool subscribe ); + protected: // Overloaded from GxsTokenQueue for Request callbacks. virtual void handleResponse(uint32_t token, uint32_t req_type); @@ -201,7 +205,7 @@ static uint32_t channelsAuthenPolicy(); void load_SubscribedGroups(const uint32_t &token); void request_SpecificUnprocessedPosts(std::list > &ids); - void load_SpecificUnprocessedPosts(const uint32_t &token); + void load_SpecificUnprocessedPosts(uint32_t token); void request_GroupUnprocessedPosts(const std::list &grouplist); void load_GroupUnprocessedPosts(const uint32_t &token); @@ -214,11 +218,6 @@ static uint32_t channelsAuthenPolicy(); bool setAutoDownload(const RsGxsGroupId &groupId, bool enabled); bool autoDownloadEnabled(const RsGxsGroupId &groupId, bool &enabled); - - - std::map mSubscribedGroups; - - // DUMMY DATA, virtual bool generateDummyData(); @@ -246,14 +245,21 @@ bool generateGroup(uint32_t &token, std::string groupName); RsGxsMessageId mMsgId; }; + std::map mSubscribedGroups; + RsMutex mSubscribedGroupsMutex; + + /** G10h4ck: Is this stuff really used? And for what? BEGIN */ uint32_t mGenToken; bool mGenActive; int mGenCount; std::vector mGenRefs; RsGxsMessageId mGenThreadId; + /** G10h4ck: Is this stuff really used? And for what? END */ - p3GxsCommentService *mCommentService; - std::map mKnownChannels; + p3GxsCommentService* mCommentService; + + std::map mKnownChannels; + RsMutex mKnownChannelsMutex; /** Store search callbacks with timeout*/ std::map< From ea86fe2615a282b80b3ff6186fe0c5e356d71fa8 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 1 Nov 2018 07:04:01 +0100 Subject: [PATCH 002/110] Safer RsGxsChannel API Deprecated old method which exposed interna async mechanism to the API users, making their and out life difficult Things that really need to be async like turtle search/requests now accept callbacks, so the caller can be notified everytime some result is got back Implement RsThread::async commodity wrapper to execute blocking API calls without blocking the caller, this could be optimized trasparently using a thread pool if necessary Added hints into some retroshare-gui files on how to use RsThread::async thoghether with QMetaObject::invokeMethod and blocking RetroShare API to simplyfy interaction between GUI and libretroshare --- libretroshare/src/gxs/rsgxsdataaccess.cc | 11 +- libretroshare/src/gxs/rsgxsnetservice.cc | 3 +- libretroshare/src/retroshare/rsgxschannels.h | 344 ++++++++++-------- libretroshare/src/services/p3gxschannels.cc | 270 ++++++++++---- libretroshare/src/services/p3gxschannels.h | 28 +- libretroshare/src/util/rsthreads.h | 15 +- .../src/gui/gxschannels/GxsChannelDialog.cpp | 32 +- .../gui/gxschannels/GxsChannelPostsWidget.cpp | 40 +- 8 files changed, 507 insertions(+), 236 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index a945829f7..96ceb32ff 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -300,15 +300,12 @@ void RsGxsDataAccess::setReq(GxsRequest* req, uint32_t token, uint32_t ansType, req->Options = opts; return; } -void RsGxsDataAccess::storeRequest(GxsRequest* req) +void RsGxsDataAccess::storeRequest(GxsRequest* req) { - RsStackMutex stack(mDataMutex); /****** LOCKED *****/ - - req->status = PENDING; - req->reqTime = time(NULL); + RS_STACK_MUTEX(mDataMutex); + req->status = PENDING; + req->reqTime = time(NULL); mRequests[req->token] = req; - - return; } RsTokenService::GxsRequestStatus RsGxsDataAccess::requestStatus(uint32_t token) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8e1aca41a..a7b558e2b 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -5290,7 +5290,8 @@ void RsGxsNetService::receiveTurtleSearchResults(TurtleRequestId req,const unsig #ifdef NXS_NET_DEBUG_8 GXSNETDEBUG___ << " passing the grp data to observer." << std::endl; #endif - mObserver->receiveNewGroups(new_grps); + mObserver->receiveNewGroups(new_grps); + mObserver->receiveDistantSearchResults(req, grpId); } bool RsGxsNetService::search( const std::string& substring, diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 4f81f7a96..347805b13 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -32,6 +32,7 @@ #include "retroshare/rsgxscommon.h" #include "serialiser/rsserializable.h" #include "retroshare/rsturtle.h" +#include "util/rsdeprecate.h" class RsGxsChannels; @@ -100,10 +101,70 @@ std::ostream &operator<<(std::ostream& out, const RsGxsChannelPost& post); class RsGxsChannels: public RsGxsIfaceHelper, public RsGxsCommentService { public: - explicit RsGxsChannels(RsGxsIface& gxs) : RsGxsIfaceHelper(gxs) {} virtual ~RsGxsChannels() {} + /** + * @brief Create channel. Blocking API. + * @jsonapi{development} + * @param[inout] channel Channel data (name, description...) + * @return false on error, true otherwise + */ + virtual bool createChannel(RsGxsChannelGroup& channel) = 0; + + /** + * @brief Create channel post. Blocking API. + * @jsonapi{development} + * @param[inout] post + * @return false on error, true otherwise + */ + virtual bool createPost(RsGxsChannelPost& post) = 0; + + /** + * @brief Edit channel details. + * @jsonapi{development} + * @param[in] channel Channel data (name, description...) with modifications + * @return false on error, true otherwise + */ + virtual bool editChannel(RsGxsChannelGroup& channel) = 0; + + /** + * @brief Share extra file + * Can be used to share extra file attached to a channel post + * @jsonapi{development} + * @param[in] path file path + * @return false on error, true otherwise + */ + virtual bool ExtraFileHash(const std::string& path) = 0; + + /** + * @brief Remove extra file from shared files + * @jsonapi{development} + * @param[in] hash hash of the file to remove + * @return false on error, true otherwise + */ + virtual bool ExtraFileRemove(const RsFileHash& hash) = 0; + + /** + * @brief Get auto-download option value for given channel + * @jsonapi{development} + * @param[in] channelId channel id + * @param[out] enabled storage for the auto-download option value + * @return false if something failed, true otherwhise + */ + virtual bool getChannelAutoDownload( + const RsGxsGroupId& channelId, bool& enabled ) = 0; + + /** + * @brief Get download directory for the given channel + * @jsonapi{development} + * @param[in] channelId id of the channel + * @param[out] directory reference to string where to store the path + * @return false on error, true otherwise + */ + virtual bool getChannelDownloadDirectory( const RsGxsGroupId& channelId, + std::string& directory ) = 0; + /** * @brief Get channels summaries list. Blocking API. * @jsonapi{development} @@ -138,20 +199,44 @@ public: std::vector& comments ) = 0; /** - * @brief Create channel. Blocking API. + * @brief Toggle post read status. Blocking API. * @jsonapi{development} - * @param[inout] channel Channel data (name, description...) + * @param[in] postId post identifier + * @param[in] read true to mark as read, false to mark as unread * @return false on error, true otherwise */ - virtual bool createChannel(RsGxsChannelGroup& channel) = 0; + virtual bool markRead(const RsGxsGrpMsgIdPair& postId, bool read) = 0; /** - * @brief Create channel post. Blocking API. + * @brief Enable or disable auto-download for given channel. Blocking API * @jsonapi{development} - * @param[inout] post + * @param[in] channelId channel id + * @param[in] enable true to enable, false to disable + * @return false if something failed, true otherwhise + */ + virtual bool setChannelAutoDownload( + const RsGxsGroupId& channelId, bool enable ) = 0; + + /** + * @brief Share channel publishing key + * This can be used to authorize other peers to post on the channel + * @jsonapi{development} + * @param[in] channelId id of the channel + * @param[in] peers peers to share the key with * @return false on error, true otherwise */ - virtual bool createPost(RsGxsChannelPost& post) = 0; + virtual bool shareChannelKeys( + const RsGxsGroupId& channelId, const std::set& peers ) = 0; + + /** + * @brief Set download directory for the given channel. Blocking API. + * @jsonapi{development} + * @param[in] channelId id of the channel + * @param[in] directory path + * @return false on error, true otherwise + */ + virtual bool setChannelDownloadDirectory( + const RsGxsGroupId& channelId, const std::string& directory) = 0; /** * @brief Subscrbe to a channel. Blocking API @@ -163,141 +248,6 @@ public: virtual bool subscribeToChannel( const RsGxsGroupId &channelId, bool subscribe ) = 0; - - /* Specific Service Data - * TODO: change the orrible const uint32_t &token to uint32_t token - * TODO: create a new typedef for token so code is easier to read - */ - - virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; - virtual bool getPostData(const uint32_t &token, std::vector &posts, std::vector &cmts) = 0; - virtual bool getPostData(const uint32_t &token, std::vector &posts) = 0; - - /** - * @brief toggle message read status - * @jsonapi{development} - * @param[out] token GXS token queue token - * @param[in] msgId - * @param[in] read - */ - virtual void setMessageReadStatus( - uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; - - /** - * @brief Enable or disable auto-download for given channel. Blocking API - * @jsonapi{development} - * @param[in] channelId channel id - * @param[in] enable true to enable, false to disable - * @return false if something failed, true otherwhise - */ - virtual bool setChannelAutoDownload( - const RsGxsGroupId& channelId, bool enable) = 0; - - /** - * @brief Get auto-download option value for given channel - * @jsonapi{development} - * @param[in] channelId channel id - * @param[out] enabled storage for the auto-download option value - * @return false if something failed, true otherwhise - */ - virtual bool getChannelAutoDownload( - const RsGxsGroupId& channelId, bool& enabled) = 0; - - /** - * @brief Set download directory for the given channel - * @jsonapi{development} - * @param[in] channelId id of the channel - * @param[in] directory path - * @return false on error, true otherwise - */ - virtual bool setChannelDownloadDirectory( - const RsGxsGroupId& channelId, const std::string& directory) = 0; - - /** - * @brief Get download directory for the given channel - * @jsonapi{development} - * @param[in] channelId id of the channel - * @param[out] directory reference to string where to store the path - * @return false on error, true otherwise - */ - virtual bool getChannelDownloadDirectory( const RsGxsGroupId& channelId, - std::string& directory ) = 0; - - /** - * @brief Share channel publishing key - * This can be used to authorize other peers to post on the channel - * @jsonapi{development} - * @param[in] groupId Channel id - * @param[in] peers peers to which share the key - * @return false on error, true otherwise - */ - virtual bool groupShareKeys( - const RsGxsGroupId& groupId, const std::set& peers ) = 0; - - /** - * @brief Request subscription to a group. - * The action is performed asyncronously, so it could fail in a subsequent - * phase even after returning true. - * @param[out] token Storage for RsTokenService token to track request - * status. - * @param[in] groupId Channel id - * @param[in] subscribe - * @return false on error, true otherwise - */ - virtual bool subscribeToGroup( uint32_t& token, const RsGxsGroupId &groupId, - bool subscribe ) = 0; - - /** - * @brief Request channel creation. - * The action is performed asyncronously, so it could fail in a subsequent - * phase even after returning true. - * @param[out] token Storage for RsTokenService token to track request - * status. - * @param[in] group Channel data (name, description...) - * @return false on error, true otherwise - */ - virtual bool createGroup(uint32_t& token, RsGxsChannelGroup& group) = 0; - - /** - * @brief Request post creation. - * The action is performed asyncronously, so it could fail in a subsequent - * phase even after returning true. - * @param[out] token Storage for RsTokenService token to track request - * status. - * @param[in] post - * @return false on error, true otherwise - */ - virtual bool createPost(uint32_t& token, RsGxsChannelPost& post) = 0; - - /** - * @brief Request channel change. - * The action is performed asyncronously, so it could fail in a subsequent - * phase even after returning true. - * @jsonapi{development} - * @param[out] token Storage for RsTokenService token to track request - * status. - * @param[in] group Channel data (name, description...) with modifications - * @return false on error, true otherwise - */ - virtual bool updateGroup(uint32_t& token, RsGxsChannelGroup& group) = 0; - - /** - * @brief Share extra file - * Can be used to share extra file attached to a channel post - * @jsonapi{development} - * @param[in] path file path - * @return false on error, true otherwise - */ - virtual bool ExtraFileHash(const std::string& path) = 0; - - /** - * @brief Remove extra file from shared files - * @jsonapi{development} - * @param[in] hash hash of the file to remove - * @return false on error, true otherwise - */ - virtual bool ExtraFileRemove(const RsFileHash& hash) = 0; - /** * @brief Request remote channels search * @jsonapi{development} @@ -312,15 +262,123 @@ public: const std::function& multiCallback, rstime_t maxWait = 300 ) = 0; + /** + * @brief Request remote channel + * @jsonapi{development} + * @param[in] channelId id of the channel to request to distants peers + * @param multiCallback function that will be called each time a result is + * received + * @param[in] maxWait maximum wait time in seconds for search results + * @return false on error, true otherwise + */ + virtual bool turtleChannelRequest( + const RsGxsGroupId& channelId, + const std::function& multiCallback, + rstime_t maxWait = 300 ) = 0; + + + /* Following functions are deprecated as they expose internal functioning + * semantic, instead of a safe to use API */ + + RS_DEPRECATED_FOR(getChannelsInfo) + virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; + + RS_DEPRECATED_FOR(getChannelsContent) + virtual bool getPostData(const uint32_t &token, std::vector &posts, std::vector &cmts) = 0; + + RS_DEPRECATED_FOR(getChannelsContent) + virtual bool getPostData(const uint32_t &token, std::vector &posts) = 0; + + /** + * @brief toggle message read status + * @deprecated + * @param[out] token GXS token queue token + * @param[in] msgId + * @param[in] read + */ + RS_DEPRECATED_FOR(markRead) + virtual void setMessageReadStatus( + uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; + + /** + * @brief Share channel publishing key + * This can be used to authorize other peers to post on the channel + * @deprecated + * @param[in] groupId Channel id + * @param[in] peers peers to which share the key + * @return false on error, true otherwise + */ + RS_DEPRECATED_FOR(shareChannelKeys) + virtual bool groupShareKeys( + const RsGxsGroupId& groupId, const std::set& peers ) = 0; + + /** + * @brief Request subscription to a group. + * The action is performed asyncronously, so it could fail in a subsequent + * phase even after returning true. + * @deprecated + * @param[out] token Storage for RsTokenService token to track request + * status. + * @param[in] groupId Channel id + * @param[in] subscribe + * @return false on error, true otherwise + */ + RS_DEPRECATED_FOR(subscribeToChannel) + virtual bool subscribeToGroup( uint32_t& token, const RsGxsGroupId &groupId, + bool subscribe ) = 0; + + /** + * @brief Request channel creation. + * The action is performed asyncronously, so it could fail in a subsequent + * phase even after returning true. + * @deprecated + * @param[out] token Storage for RsTokenService token to track request + * status. + * @param[in] group Channel data (name, description...) + * @return false on error, true otherwise + */ + RS_DEPRECATED_FOR(createChannel) + virtual bool createGroup(uint32_t& token, RsGxsChannelGroup& group) = 0; + + /** + * @brief Request post creation. + * The action is performed asyncronously, so it could fail in a subsequent + * phase even after returning true. + * @deprecated + * @param[out] token Storage for RsTokenService token to track request + * status. + * @param[in] post + * @return false on error, true otherwise + */ + RS_DEPRECATED + virtual bool createPost(uint32_t& token, RsGxsChannelPost& post) = 0; + + /** + * @brief Request channel change. + * The action is performed asyncronously, so it could fail in a subsequent + * phase even after returning true. + * @deprecated + * @param[out] token Storage for RsTokenService token to track request + * status. + * @param[in] group Channel data (name, description...) with modifications + * @return false on error, true otherwise + */ + RS_DEPRECATED_FOR(editChannel) + virtual bool updateGroup(uint32_t& token, RsGxsChannelGroup& group) = 0; + ////////////////////////////////////////////////////////////////////////////// /// Distant synchronisation methods /// ////////////////////////////////////////////////////////////////////////////// /// + RS_DEPRECATED_FOR(turtleChannelRequest) virtual TurtleRequestId turtleGroupRequest(const RsGxsGroupId& group_id)=0; + RS_DEPRECATED virtual TurtleRequestId turtleSearchRequest(const std::string& match_string)=0; + RS_DEPRECATED_FOR(turtleSearchRequest) virtual bool retrieveDistantSearchResults(TurtleRequestId req, std::map &results) =0; + RS_DEPRECATED virtual bool clearDistantSearchResults(TurtleRequestId req)=0; + RS_DEPRECATED_FOR(turtleChannelRequest) virtual bool retrieveDistantGroup(const RsGxsGroupId& group_id,RsGxsChannelGroup& distant_group)=0; - ////////////////////////////////////////////////////////////////////////////// }; diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index d5ff4ac4e..fb02d50eb 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -78,7 +78,8 @@ p3GxsChannels::p3GxsChannels( RsGxsChannels(static_cast(*this)), GxsTokenQueue(this), mSubscribedGroupsMutex("GXS channels subscribed groups cache"), mKnownChannelsMutex("GXS channels known channels timestamp cache"), - mSearchCallbacksMapMutex("GXS channels search") + mSearchCallbacksMapMutex("GXS channels search callbacks map"), + mDistantChannelsCallbacksMapMutex("GXS channels distant channels callbacks map") { // For Dummy Msgs. mGenActive = false; @@ -574,37 +575,37 @@ bool p3GxsChannels::getChannelAutoDownload(const RsGxsGroupId &groupId, bool& en return autoDownloadEnabled(groupId,enabled); } -bool p3GxsChannels::setChannelDownloadDirectory(const RsGxsGroupId &groupId, const std::string& directory) +bool p3GxsChannels::setChannelDownloadDirectory( + const RsGxsGroupId &groupId, const std::string& directory ) { #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::setDownloadDirectory() id: " << groupId << " to: " << directory << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " id: " << groupId << " to: " + << directory << std::endl; #endif RS_STACK_MUTEX(mSubscribedGroupsMutex); std::map::iterator it; - it = mSubscribedGroups.find(groupId); - if (it == mSubscribedGroups.end()) - { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::setAutoDownload() Missing Group" << std::endl; -#endif - return false; - } + it = mSubscribedGroups.find(groupId); + if (it == mSubscribedGroups.end()) + { + std::cerr << __PRETTY_FUNCTION__ << " Error! Unknown groupId: " + << groupId.toStdString() << std::endl; + return false; + } /* extract from ServiceString */ SSGxsChannelGroup ss; ss.load(it->second.mServiceString); - if (directory == ss.mDownloadDirectory) - { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::setDownloadDirectory() WARNING setting looks okay already" << std::endl; -#endif + if (directory == ss.mDownloadDirectory) + { + std::cerr << __PRETTY_FUNCTION__ << " Warning! groupId: " << groupId + << " Was already configured to download into: " << directory + << std::endl; + return false; + } - } - - /* we are just going to set it anyway. */ ss.mDownloadDirectory = directory; std::string serviceString = ss.save(); uint32_t token; @@ -612,6 +613,13 @@ bool p3GxsChannels::setChannelDownloadDirectory(const RsGxsGroupId &groupId, con it->second.mServiceString = serviceString; // update Local Cache. RsGenExchange::setGroupServiceString(token, groupId, serviceString); // update dbase. + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << " Error! Feiled setting group " + << " service string" << std::endl; + return false; + } + /* now reload it */ std::list groups; groups.push_back(groupId); @@ -631,23 +639,20 @@ bool p3GxsChannels::getChannelDownloadDirectory(const RsGxsGroupId & groupId,std std::map::iterator it; - it = mSubscribedGroups.find(groupId); - - if (it == mSubscribedGroups.end()) - { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::getChannelDownloadDirectory() No Entry" << std::endl; -#endif - - return false; - } + it = mSubscribedGroups.find(groupId); + if (it == mSubscribedGroups.end()) + { + std::cerr << __PRETTY_FUNCTION__ << " Error! Unknown groupId: " + << groupId.toStdString() << std::endl; + return false; + } /* extract from ServiceString */ SSGxsChannelGroup ss; ss.load(it->second.mServiceString); directory = ss.mDownloadDirectory; - return true ; + return true; } void p3GxsChannels::request_AllSubscribedGroups() @@ -1053,20 +1058,63 @@ bool p3GxsChannels::getChannelsContent( bool p3GxsChannels::createChannel(RsGxsChannelGroup& channel) { uint32_t token; - if( !createGroup(token, channel) - || waitToken(token) != RsTokenService::COMPLETE ) - return false; - - if(RsGenExchange::getPublishedGroupMeta(token, channel.mMeta)) + if(!createGroup(token, channel)) { -#ifdef RS_DEEP_SEARCH - DeepSearch::indexChannelGroup(channel); -#endif // RS_DEEP_SEARCH - - return true; + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed updating group." + << std::endl; + return false; } - return false; + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." + << std::endl; + return false; + } + + if(!RsGenExchange::getPublishedGroupMeta(token, channel.mMeta)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failure getting updated " + << " group data." << std::endl; + return false; + } + +#ifdef RS_DEEP_SEARCH + DeepSearch::indexChannelGroup(channel); +#endif // RS_DEEP_SEARCH + + return true; +} + +bool p3GxsChannels::editChannel(RsGxsChannelGroup& channel) +{ + uint32_t token; + if(!updateGroup(token, channel)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed updating group." + << std::endl; + return false; + } + + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." + << std::endl; + return false; + } + + if(!RsGenExchange::getPublishedGroupMeta(token, channel.mMeta)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failure getting updated " + << " group data." << std::endl; + return false; + } + +#ifdef RS_DEEP_SEARCH + DeepSearch::indexChannelGroup(channel); +#endif // RS_DEEP_SEARCH + + return true; } bool p3GxsChannels::createPost(RsGxsChannelPost& post) @@ -1096,6 +1144,20 @@ bool p3GxsChannels::subscribeToChannel( return true; } +bool p3GxsChannels::markRead(const RsGxsGrpMsgIdPair& msgId, bool read) +{ + uint32_t token; + setMessageReadStatus(token, msgId, read); + if(waitToken(token) != RsTokenService::COMPLETE ) return false; + return true; +} + +bool p3GxsChannels::shareChannelKeys( + const RsGxsGroupId& channelId, const std::set& peers) +{ + return groupShareKeys(channelId, peers); +} + //////////////////////////////////////////////////////////////////////////////// /// Blocking API implementation end @@ -1609,7 +1671,7 @@ void p3GxsChannels::dummy_tick() } - cleanTimedOutSearches(); + cleanTimedOutCallbacks(); } @@ -1781,7 +1843,7 @@ TurtleRequestId p3GxsChannels::turtleGroupRequest(const RsGxsGroupId& group_id) } TurtleRequestId p3GxsChannels::turtleSearchRequest(const std::string& match_string) { - return netService()->turtleSearchRequest(match_string) ; + return netService()->turtleSearchRequest(match_string); } bool p3GxsChannels::clearDistantSearchResults(TurtleRequestId req) @@ -1839,13 +1901,43 @@ bool p3GxsChannels::turtleSearchRequest( TurtleRequestId sId = turtleSearchRequest(matchString); + { RS_STACK_MUTEX(mSearchCallbacksMapMutex); mSearchCallbacksMap.emplace( sId, std::make_pair( multiCallback, std::chrono::system_clock::now() + - std::chrono::seconds(maxWait) ) ); + std::chrono::seconds(maxWait) ) ); + } + + return true; +} + +/// @see RsGxsChannels::turtleChannelRequest +bool p3GxsChannels::turtleChannelRequest( + const RsGxsGroupId& channelId, + const std::function& multiCallback, + rstime_t maxWait) +{ + if(channelId.isNull()) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! channelId can't be null!" + << std::endl; + return false; + } + + TurtleRequestId sId = turtleGroupRequest(channelId); + + { + RS_STACK_MUTEX(mDistantChannelsCallbacksMapMutex); + mDistantChannelsCallbacksMap.emplace( + sId, + std::make_pair( + multiCallback, + std::chrono::system_clock::now() + + std::chrono::seconds(maxWait) ) ); + } return true; } @@ -1856,29 +1948,77 @@ void p3GxsChannels::receiveDistantSearchResults( std::cerr << __PRETTY_FUNCTION__ << "(" << id << ", " << grpId << ")" << std::endl; - RsGenExchange::receiveDistantSearchResults(id, grpId); - RsGxsGroupSummary gs; - gs.mGroupId = grpId; - netService()->retrieveDistantGroupSummary(grpId, gs); + { + RsGenExchange::receiveDistantSearchResults(id, grpId); + RsGxsGroupSummary gs; + gs.mGroupId = grpId; + netService()->retrieveDistantGroupSummary(grpId, gs); + + { + RS_STACK_MUTEX(mSearchCallbacksMapMutex); + auto cbpt = mSearchCallbacksMap.find(id); + if(cbpt != mSearchCallbacksMap.end()) + { + cbpt->second.first(gs); + return; + } + } // end RS_STACK_MUTEX(mSearchCallbacksMapMutex); + } + + { + RS_STACK_MUTEX(mDistantChannelsCallbacksMapMutex); + auto cbpt = mDistantChannelsCallbacksMap.find(id); + if(cbpt != mDistantChannelsCallbacksMap.end()) + { + std::function callback = + cbpt->second.first; + RsThread::async([this, callback, grpId]() + { + std::list chanIds({grpId}); + std::vector channelsInfo; + if(!getChannelsInfo(chanIds, channelsInfo)) + { + std::cerr << __PRETTY_FUNCTION__ << " Error! Received " + << "distant channel result grpId: " << grpId + << " but failed getting channel info" + << std::endl; + return; + } + + for(const RsGxsChannelGroup& chan : channelsInfo) + callback(chan); + } ); + + return; + } + } // RS_STACK_MUTEX(mDistantChannelsCallbacksMapMutex); +} + +void p3GxsChannels::cleanTimedOutCallbacks() +{ + auto now = std::chrono::system_clock::now(); { RS_STACK_MUTEX(mSearchCallbacksMapMutex); - auto cbpt = mSearchCallbacksMap.find(id); - if(cbpt != mSearchCallbacksMap.end()) - cbpt->second.first(gs); - } // end RS_STACK_MUTEX(mSearchCallbacksMapMutex); -} + for( auto cbpt = mSearchCallbacksMap.begin(); + cbpt != mSearchCallbacksMap.end(); ) + if(cbpt->second.second <= now) + { + clearDistantSearchResults(cbpt->first); + cbpt = mSearchCallbacksMap.erase(cbpt); + } + else ++cbpt; + } // RS_STACK_MUTEX(mSearchCallbacksMapMutex); -void p3GxsChannels::cleanTimedOutSearches() -{ - RS_STACK_MUTEX(mSearchCallbacksMapMutex); - auto now = std::chrono::system_clock::now(); - for( auto cbpt = mSearchCallbacksMap.begin(); - cbpt != mSearchCallbacksMap.end(); ) - if(cbpt->second.second <= now) - { - clearDistantSearchResults(cbpt->first); - cbpt = mSearchCallbacksMap.erase(cbpt); - } - else ++cbpt; + { + RS_STACK_MUTEX(mDistantChannelsCallbacksMapMutex); + for( auto cbpt = mDistantChannelsCallbacksMap.begin(); + cbpt != mDistantChannelsCallbacksMap.end(); ) + if(cbpt->second.second <= now) + { + clearDistantSearchResults(cbpt->first); + cbpt = mDistantChannelsCallbacksMap.erase(cbpt); + } + else ++cbpt; + } // RS_STACK_MUTEX(mDistantChannelsCallbacksMapMutex) } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 0d2cbf561..bb6261f48 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -112,6 +112,12 @@ virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::strin const std::function& multiCallback, rstime_t maxWait = 300 ); + /// @see RsGxsChannels::turtleChannelRequest + virtual bool turtleChannelRequest( + const RsGxsGroupId& channelId, + const std::function& multiCallback, + rstime_t maxWait = 300 ); + /** * Receive results from turtle search @see RsGenExchange @see RsNxsObserver * @see RsGxsNetService::receiveTurtleSearchResults @@ -183,6 +189,9 @@ virtual bool ExtraFileRemove(const RsFileHash &hash); /// Implementation of @see RsGxsChannels::createChannel virtual bool createChannel(RsGxsChannelGroup& channel); + /// Implementation of @see RsGxsChannels::editChannel + virtual bool editChannel(RsGxsChannelGroup& channel); + /// Implementation of @see RsGxsChannels::createPost virtual bool createPost(RsGxsChannelPost& post); @@ -190,6 +199,12 @@ virtual bool ExtraFileRemove(const RsFileHash &hash); virtual bool subscribeToChannel( const RsGxsGroupId &groupId, bool subscribe ); + /// Implementation of @see RsGxsChannels::setPostRead + virtual bool markRead(const RsGxsGrpMsgIdPair& msgId, bool read); + + virtual bool shareChannelKeys( + const RsGxsGroupId& channelId, const std::set& peers ); + protected: // Overloaded from GxsTokenQueue for Request callbacks. virtual void handleResponse(uint32_t token, uint32_t req_type); @@ -270,8 +285,17 @@ bool generateGroup(uint32_t &token, std::string groupName); > mSearchCallbacksMap; RsMutex mSearchCallbacksMapMutex; - /// Cleanup mSearchCallbacksMap - void cleanTimedOutSearches(); + /** Store distant channels requests callbacks with timeout*/ + std::map< + TurtleRequestId, + std::pair< + std::function, + std::chrono::system_clock::time_point > + > mDistantChannelsCallbacksMap; + RsMutex mDistantChannelsCallbacksMapMutex; + + /// Cleanup mSearchCallbacksMap and mDistantChannelsCallbacksMap + void cleanTimedOutCallbacks(); }; #endif diff --git a/libretroshare/src/util/rsthreads.h b/libretroshare/src/util/rsthreads.h index 630c136a8..d9a1dda9f 100644 --- a/libretroshare/src/util/rsthreads.h +++ b/libretroshare/src/util/rsthreads.h @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include "util/rstime.h" @@ -239,7 +241,7 @@ pthread_t createThread(RsThread &thread); class RsThread { - public: +public: RsThread(); virtual ~RsThread() {} @@ -259,6 +261,17 @@ class RsThread void ask_for_stop(); + /** + * Execute given function on another thread without blocking the caller + * execution. + * This can be generalized with variadic template, ATM it is enough to wrap + * any kind of function call or job into a lamba which get no paramethers + * and return nothing but can capture + * This can be easly optimized later by using a thread pool + */ + static void async(const std::function& fn) + { std::thread(fn).detach(); } + protected: virtual void runloop() =0; /* called once the thread is started. Should be overloaded by subclasses. */ void go() ; // this one calls runloop and also sets the flags correctly when the thread is finished running. diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 8090dc353..63efe2bee 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -21,6 +21,7 @@ #include #include +#include #include @@ -276,17 +277,34 @@ QWidget *GxsChannelDialog::createCommentHeaderWidget(const RsGxsGroupId &grpId, void GxsChannelDialog::toggleAutoDownload() { RsGxsGroupId grpId = groupId(); - if (grpId.isNull()) { + if (grpId.isNull()) return; + + bool autoDownload; + if(!rsGxsChannels->getChannelAutoDownload(grpId, autoDownload)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to get autodownload value " + << "for channel: " << grpId.toStdString() << std::endl; return; } - bool autoDownload ; - - if(!rsGxsChannels->getChannelAutoDownload(grpId,autoDownload) || !rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) + RsThread::async([this, grpId, autoDownload]() { - std::cerr << "GxsChannelDialog::toggleAutoDownload() Auto Download failed to set"; - std::cerr << std::endl; - } + if(!rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to set autodownload " + << "for channel: " << grpId << std::endl; + return; + } + + QMetaObject::invokeMethod(this, [=]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + }, Qt::QueuedConnection); + }); } void GxsChannelDialog::loadGroupSummaryToken(const uint32_t &token, std::list &groupInfo, RsUserdata *&userdata) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index d238c7007..acab587f0 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -622,13 +622,13 @@ bool GxsChannelPostsWidget::navigatePostItem(const RsGxsMessageId &msgId) void GxsChannelPostsWidget::subscribeGroup(bool subscribe) { - if (groupId().isNull()) { - return; - } + RsGxsGroupId grpId(groupId()); + if (grpId.isNull()) return; - uint32_t token; - rsGxsChannels->subscribeToGroup(token, groupId(), subscribe); -// mChannelQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE); + RsThread::async([=]() + { + rsGxsChannels->subscribeToChannel(grpId, subscribe); + } ); } void GxsChannelPostsWidget::setAutoDownload(bool autoDl) @@ -644,12 +644,32 @@ void GxsChannelPostsWidget::toggleAutoDownload() return; } - bool autoDownload ; - if(!rsGxsChannels->getChannelAutoDownload(grpId,autoDownload) || !rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) + bool autoDownload; + if(!rsGxsChannels->getChannelAutoDownload(grpId, autoDownload)) { - std::cerr << "GxsChannelDialog::toggleAutoDownload() Auto Download failed to set"; - std::cerr << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " failed to get autodownload value " + << "for channel: " << grpId.toStdString() << std::endl; + return; } + + RsThread::async([this, grpId, autoDownload]() + { + if(!rsGxsChannels->setChannelAutoDownload(grpId, !autoDownload)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to set autodownload " + << "for channel: " << grpId.toStdString() << std::endl; + return; + } + + QMetaObject::invokeMethod(this, [=]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + }, Qt::QueuedConnection); + }); } bool GxsChannelPostsWidget::insertGroupData(const uint32_t &token, RsGroupMetaData &metaData) From 367c5182cfe61e9fee792a228575e47b809952b7 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 1 Nov 2018 14:51:57 +0100 Subject: [PATCH 003/110] Fix compilation with Qt older then 5.10 --- .../src/gui/gxschannels/GxsChannelDialog.cpp | 8 +- .../gui/gxschannels/GxsChannelPostsWidget.cpp | 11 +- retroshare-gui/src/retroshare-gui.pro | 1 + retroshare-gui/src/util/qtthreadsutils.h | 101 ++++++++++++++++++ 4 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 retroshare-gui/src/util/qtthreadsutils.h diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 63efe2bee..5c7f295d1 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -35,6 +35,7 @@ #include "gui/settings/rsharesettings.h" #include "gui/notifyqt.h" #include "gui/common/GroupTreeWidget.h" +#include "util/qtthreadsutils.h" class GxsChannelGroupInfoData : public RsUserdata { @@ -296,14 +297,17 @@ void GxsChannelDialog::toggleAutoDownload() return; } - QMetaObject::invokeMethod(this, [=]() + RsQThreadUtils::postToObject( [=]() { /* Here it goes any code you want to be executed on the Qt Gui * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete, note that * Qt::QueuedConnection is important! */ - }, Qt::QueuedConnection); + + std::cerr << __PRETTY_FUNCTION__ << " Has been executed on GUI " + << "thread but was scheduled by async thread" << std::endl; + }, this ); }); } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index acab587f0..1c565ab69 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -32,8 +32,10 @@ #include "gui/settings/rsharesettings.h" #include "gui/feeds/SubFileItem.h" #include "gui/notifyqt.h" -#include #include "util/DateTime.h" +#include "util/qtthreadsutils.h" + +#include #define CHAN_DEFAULT_IMAGE ":/images/channels.png" @@ -661,14 +663,17 @@ void GxsChannelPostsWidget::toggleAutoDownload() return; } - QMetaObject::invokeMethod(this, [=]() + RsQThreadUtils::postToObject( [=]() { /* Here it goes any code you want to be executed on the Qt Gui * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete, note that * Qt::QueuedConnection is important! */ - }, Qt::QueuedConnection); + + std::cerr << __PRETTY_FUNCTION__ << " Has been executed on GUI " + << "thread but was scheduled by async thread" << std::endl; + }, this ); }); } diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index e83ad180c..ffd7fc1af 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -406,6 +406,7 @@ HEADERS += rshare.h \ util/ObjectPainter.h \ util/QtVersion.h \ util/RsFile.h \ + util/qtthreadsutils.h \ gui/profile/ProfileWidget.h \ gui/profile/ProfileManager.h \ gui/profile/StatusMessage.h \ diff --git a/retroshare-gui/src/util/qtthreadsutils.h b/retroshare-gui/src/util/qtthreadsutils.h new file mode 100644 index 000000000..457be6b11 --- /dev/null +++ b/retroshare-gui/src/util/qtthreadsutils.h @@ -0,0 +1,101 @@ +/* + * RetroShare + * Copyright (C) 2018 Gioacchino Mazzurco + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +#pragma once + +/* Thanks to KubaO which realeased original C++14 versions of this functions + * under public domain license + * https://github.com/KubaO/stackoverflown/blob/master/questions/metacall-21646467/main.cpp + * https://github.com/KubaO/stackoverflown/blob/master/LICENSE + */ + +#include +#include +#include + +namespace RsQThreadUtils { + +#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + +template +void postToObject(F &&fun, QObject *obj = qApp) +{ + if (qobject_cast(obj)) + qWarning() << "posting a call to a thread object - consider using postToThread"; + QObject src; + auto type = obj->metaObject(); + QObject::connect( &src, &QObject::destroyed, obj, + [fun, type, obj] + { + // ensure that the object is not being destructed + if (obj->metaObject()->inherits(type)) fun(); + }, Qt::QueuedConnection ); +} + +template +void postToThread(F &&fun, QThread *thread = qApp->thread()) +{ + QObject * obj = QAbstractEventDispatcher::instance(thread); + Q_ASSERT(obj); + QObject src; + auto type = obj->metaObject(); + QObject::connect( &src, &QObject::destroyed, obj, + [fun, type, obj] + { + // ensure that the object is not being destructed + if (obj->metaObject()->inherits(type)) fun(); + }, Qt::QueuedConnection ); +} + +#else // QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + +template +struct FEvent : QEvent +{ + using Fun = typename std::decay::type; + const QObject *const obj; + const QMetaObject *const type = obj->metaObject(); + Fun fun; + template + FEvent(const QObject *obj, Fun &&fun) : + QEvent(QEvent::None), obj(obj), fun(std::forward(fun)) {} + ~FEvent() + { + // ensure that the object is not being destructed + if (obj->metaObject()->inherits(type)) fun(); + } +}; + +template +static void postToObject(F &&fun, QObject *obj = qApp) +{ + if (qobject_cast(obj)) + qWarning() << "posting a call to a thread object - consider using postToThread"; + QCoreApplication::postEvent(obj, new FEvent(obj, std::forward(fun))); +} + +template +static void postToThread(F &&fun, QThread *thread = qApp->thread()) +{ + QObject * obj = QAbstractEventDispatcher::instance(thread); + Q_ASSERT(obj); + QCoreApplication::postEvent(obj, new FEvent(obj, std::forward(fun))); +} +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) + +} + From 7aaf29c3de739349823d00712b5edf13eb74b29f Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 1 Nov 2018 15:27:46 +0100 Subject: [PATCH 004/110] Fix compilation with Qt older then 5.7 --- retroshare-gui/src/util/qtthreadsutils.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/retroshare-gui/src/util/qtthreadsutils.h b/retroshare-gui/src/util/qtthreadsutils.h index 457be6b11..f7dce65dc 100644 --- a/retroshare-gui/src/util/qtthreadsutils.h +++ b/retroshare-gui/src/util/qtthreadsutils.h @@ -31,6 +31,9 @@ namespace RsQThreadUtils { #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) +/** + * @brief execute given function in the QThread where given QObject belongs + */ template void postToObject(F &&fun, QObject *obj = qApp) { @@ -46,6 +49,9 @@ void postToObject(F &&fun, QObject *obj = qApp) }, Qt::QueuedConnection ); } +/** + * @brief execute given function in the given QThread + */ template void postToThread(F &&fun, QThread *thread = qApp->thread()) { @@ -75,11 +81,18 @@ struct FEvent : QEvent QEvent(QEvent::None), obj(obj), fun(std::forward(fun)) {} ~FEvent() { +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) // ensure that the object is not being destructed if (obj->metaObject()->inherits(type)) fun(); +#else // QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) + fun(); +#endif // QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) } }; +/** + * @brief execute given function in the QThread where given QObject belongs + */ template static void postToObject(F &&fun, QObject *obj = qApp) { @@ -88,6 +101,9 @@ static void postToObject(F &&fun, QObject *obj = qApp) QCoreApplication::postEvent(obj, new FEvent(obj, std::forward(fun))); } +/** + * @brief execute given function in the given QThread + */ template static void postToThread(F &&fun, QThread *thread = qApp->thread()) { From f6b22d25dad9ebc949c07132d38119f6c7d4e87e Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 1 Nov 2018 23:44:44 +0100 Subject: [PATCH 005/110] Fix typo in documentation --- libretroshare/src/util/rsthreads.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/util/rsthreads.h b/libretroshare/src/util/rsthreads.h index d9a1dda9f..6a61a9b4e 100644 --- a/libretroshare/src/util/rsthreads.h +++ b/libretroshare/src/util/rsthreads.h @@ -265,7 +265,7 @@ public: * Execute given function on another thread without blocking the caller * execution. * This can be generalized with variadic template, ATM it is enough to wrap - * any kind of function call or job into a lamba which get no paramethers + * any kind of function call or job into a lambda which get no paramethers * and return nothing but can capture * This can be easly optimized later by using a thread pool */ From 2ed6904d06caa9529f6ceb420c5c55205ac6d362 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 2 Nov 2018 00:53:32 +0100 Subject: [PATCH 006/110] gxschannels better debugging message --- libretroshare/src/services/p3gxschannels.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index fb02d50eb..3fc3ddc2b 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1171,7 +1171,7 @@ bool p3GxsChannels::shareChannelKeys( bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &groupId,bool& enabled) { #ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::autoDownloadEnabled(" << id << ")"; + std::cerr << "p3GxsChannels::autoDownloadEnabled(" << groupId << ")"; std::cerr << std::endl; #endif @@ -1180,8 +1180,8 @@ bool p3GxsChannels::autoDownloadEnabled(const RsGxsGroupId &groupId,bool& enable it = mSubscribedGroups.find(groupId); if (it == mSubscribedGroups.end()) { - std::cerr << __PRETTY_FUNCTION__ << " ERROR requested channel is not " - << "subscribed" << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " WARNING requested channel: " + << groupId << " is not subscribed" << std::endl; return false; } From 90bacf12bdf225fa2926c931f34aa0f7ea77c0c8 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 9 Nov 2018 21:24:31 +0100 Subject: [PATCH 007/110] RsGxsDataAccess filtered getters do not return all messages if none matches This was causing scary error message in RsGxsChannels with autodoanload enabled, when all messages where already processed none matched the filter so all messages where returned, making p3GxsChannels::handleUnprocessedPost furious more details into this forum post retroshare://forum?name=Scary%20message%2C%20but%20which%20doesn%27t%20seem%20to%20be%20the%20source%20of%20the%20problems%20Was%3A%20More%20GXS%20strange%20messages&id=8fd22bd8f99754461e7ba1ca8a727995&msgid=04f10ff97f761c6840c33f1610cb050f0f73da8d --- libretroshare/src/gxs/rsdataservice.cc | 27 +-- libretroshare/src/gxs/rsdataservice.h | 10 +- libretroshare/src/gxs/rsgds.h | 9 +- libretroshare/src/gxs/rsgxsdataaccess.cc | 186 ++++++++++++-------- libretroshare/src/services/p3gxschannels.cc | 53 ++---- libretroshare/src/services/p3gxschannels.h | 4 +- 6 files changed, 155 insertions(+), 134 deletions(-) diff --git a/libretroshare/src/gxs/rsdataservice.cc b/libretroshare/src/gxs/rsdataservice.cc index ca83a2b19..b10c4aec9 100644 --- a/libretroshare/src/gxs/rsdataservice.cc +++ b/libretroshare/src/gxs/rsdataservice.cc @@ -1198,16 +1198,16 @@ void RsDataService::locked_retrieveGroups(RetroCursor* c, std::vector } } -int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, bool /* cache */, bool withMeta) +int RsDataService::retrieveNxsMsgs( + const GxsMsgReq &reqIds, GxsMsgResult &msg, bool /* cache */, + bool withMeta ) { #ifdef RS_DATA_SERVICE_DEBUG_TIME rstime::RsScopeTimer timer(""); int resultCount = 0; #endif - GxsMsgReq::const_iterator mit = reqIds.begin(); - - for(; mit != reqIds.end(); ++mit) + for(auto mit = reqIds.begin(); mit != reqIds.end(); ++mit) { const RsGxsGroupId& grpId = mit->first; @@ -1216,9 +1216,9 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b const std::set& msgIdV = mit->second; std::vector msgSet; - if(msgIdV.empty()){ - - RsStackMutex stack(mDbMutex); + if(msgIdV.empty()) + { + RS_STACK_MUTEX(mDbMutex); RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, withMeta ? mMsgColumnsWithMeta : mMsgColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "'", ""); @@ -1228,16 +1228,17 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b } delete c; - }else{ + } + else + { + RS_STACK_MUTEX(mDbMutex); // request each grp - std::set::const_iterator sit = msgIdV.begin(); - - for(; sit!=msgIdV.end();++sit){ + for( std::set::const_iterator sit = msgIdV.begin(); + sit!=msgIdV.end();++sit ) + { const RsGxsMessageId& msgId = *sit; - RsStackMutex stack(mDbMutex); - RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, withMeta ? mMsgColumnsWithMeta : mMsgColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "' AND " + KEY_MSG_ID + "='" + msgId.toStdString() + "'", ""); diff --git a/libretroshare/src/gxs/rsdataservice.h b/libretroshare/src/gxs/rsdataservice.h index 572558cd8..8b4e2aac9 100644 --- a/libretroshare/src/gxs/rsdataservice.h +++ b/libretroshare/src/gxs/rsdataservice.h @@ -47,10 +47,14 @@ public: * Retrieves all msgs * @param reqIds requested msg ids (grpId,msgId), leave msg list empty to get all msgs for the grp * @param msg result of msg retrieval - * @param cache whether to store results of this retrieval in memory for faster later retrieval + * @param cache IGNORED whether to store results of this retrieval in memory + * for faster later retrieval + * @param strictFilter if true do not request any message if reqIds is empty * @return error code - */ - int retrieveNxsMsgs(const GxsMsgReq& reqIds, GxsMsgResult& msg, bool cache, bool withMeta = false); + */ + int retrieveNxsMsgs( + const GxsMsgReq& reqIds, GxsMsgResult& msg, bool cache, + bool withMeta = false ); /*! * Retrieves groups, if empty, retrieves all grps, if map is not empty diff --git a/libretroshare/src/gxs/rsgds.h b/libretroshare/src/gxs/rsgds.h index 3c63efb2c..2235249a7 100644 --- a/libretroshare/src/gxs/rsgds.h +++ b/libretroshare/src/gxs/rsgds.h @@ -137,16 +137,19 @@ public: typedef std::map MsgStoreMap; RsGeneralDataService(){} - virtual ~RsGeneralDataService(){return;} + virtual ~RsGeneralDataService(){} /*! * Retrieves all msgs * @param reqIds requested msg ids (grpId,msgId), leave msg list empty to get all msgs for the grp * @param msg result of msg retrieval * @param cache whether to store results of this retrieval in memory for faster later retrieval + * @param strictFilter if true do not request any message if reqIds is empty * @return error code - */ - virtual int retrieveNxsMsgs(const GxsMsgReq& reqIds, GxsMsgResult& msg, bool cache, bool withMeta=false) = 0; + */ + virtual int retrieveNxsMsgs( + const GxsMsgReq& reqIds, GxsMsgResult& msg, bool cache, + bool withMeta = false ) = 0; /*! * Retrieves all groups stored diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 96ceb32ff..f9049d9f0 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -1036,29 +1036,42 @@ bool RsGxsDataAccess::getMsgData(MsgDataReq* req) { GxsMsgReq msgIdOut; + const RsTokReqOptions& opts(req->Options); + // filter based on options - getMsgList(req->mMsgIds, req->Options, msgIdOut); + getMsgList(req->mMsgIds, opts, msgIdOut); + + // If the list is empty because of filtering do not retrieve from DB + if((opts.mMsgFlagMask || opts.mStatusMask) && msgIdOut.empty()) + return true; mDataStore->retrieveNxsMsgs(msgIdOut, req->mMsgData, true, true); - return true; } bool RsGxsDataAccess::getMsgSummary(MsgMetaReq* req) { - GxsMsgReq msgIdOut; + GxsMsgReq msgIdOut; - // filter based on options - getMsgList(req->mMsgIds, req->Options, msgIdOut); + const RsTokReqOptions& opts(req->Options); - mDataStore->retrieveGxsMsgMetaData(msgIdOut, req->mMsgMetaData); + // filter based on options + getMsgList(req->mMsgIds, opts, msgIdOut); + + // If the list is empty because of filtering do not retrieve from DB + if((opts.mMsgFlagMask || opts.mStatusMask) && msgIdOut.empty()) + return true; + + mDataStore->retrieveGxsMsgMetaData(msgIdOut, req->mMsgMetaData); return true; } -bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptions& opts, GxsMsgReq& msgIdsOut) +bool RsGxsDataAccess::getMsgList( + const GxsMsgReq& msgIds, const RsTokReqOptions& opts, + GxsMsgReq& msgIdsOut ) { GxsMsgMetaResult result; @@ -1689,41 +1702,45 @@ void RsGxsDataAccess::cleanseMsgMetaMap(GxsMsgMetaResult& result) return; } -void RsGxsDataAccess::filterMsgList(GxsMsgIdResult& msgIds, const RsTokReqOptions& opts, - const MsgMetaFilter& msgMetas) const +void RsGxsDataAccess::filterMsgList( + GxsMsgIdResult& resultsMap, const RsTokReqOptions& opts, + const MsgMetaFilter& msgMetas ) const { - - GxsMsgIdResult::iterator mit = msgIds.begin(); - for(;mit != msgIds.end(); ++mit) + for( GxsMsgIdResult::iterator grpIt = resultsMap.begin(); + grpIt != resultsMap.end(); ++grpIt ) { + const RsGxsGroupId& groupId(grpIt->first); + std::set& msgsIdSet(grpIt->second); - MsgMetaFilter::const_iterator cit = msgMetas.find(mit->first); + MsgMetaFilter::const_iterator cit = msgMetas.find(groupId); + if(cit == msgMetas.end()) continue; - if(cit == msgMetas.end()) - continue; + std::cerr << __PRETTY_FUNCTION__ << " " << msgsIdSet.size() + << " for group: " << groupId << " before filtering" + << std::endl; - std::set& msgs = mit->second; - std::set::iterator vit = msgs.begin(); - const std::map& meta = cit->second; - std::map::const_iterator cit2; - - for(; vit != msgs.end();) + for( std::set::iterator msgIdIt = msgsIdSet.begin(); + msgIdIt != msgsIdSet.end(); ) { + const RsGxsMessageId& msgId(*msgIdIt); + const std::map& msgsMetaMap = + cit->second; bool keep = false; - if( (cit2 = meta.find(*vit)) != meta.end() ) + std::map::const_iterator msgsMetaMapIt; + + if( (msgsMetaMapIt = msgsMetaMap.find(msgId)) != msgsMetaMap.end() ) { - keep = checkMsgFilter(opts, cit2->second); + keep = checkMsgFilter(opts, msgsMetaMapIt->second); } - if(keep) - { - ++vit; - }else - { - vit = msgs.erase(vit); - } + if(keep) ++msgIdIt; + else msgIdIt = msgsIdSet.erase(msgIdIt); } + + std::cerr << __PRETTY_FUNCTION__ << " " << msgsIdSet.size() + << " for group: " << groupId << " after filtering" + << std::endl; } } @@ -1901,62 +1918,87 @@ bool RsGxsDataAccess::checkGrpFilter(const RsTokReqOptions &opts, const RsGxsGrp return subscribeMatch; } -bool RsGxsDataAccess::checkMsgFilter(const RsTokReqOptions& opts, const RsGxsMsgMetaData* meta) const +bool RsGxsDataAccess::checkMsgFilter( + const RsTokReqOptions& opts, const RsGxsMsgMetaData* meta ) const { - bool statusMatch = false; - if (opts.mStatusMask) + if (opts.mStatusMask) { // Exact Flags match required. - if ((opts.mStatusMask & opts.mStatusFilter) == (opts.mStatusMask & meta->mMsgStatus)) + if ( (opts.mStatusMask & opts.mStatusFilter) == + (opts.mStatusMask & meta->mMsgStatus) ) { - std::cerr << "checkMsgFilter() Accepting Msg as StatusMatches: "; - std::cerr << " Mask: " << opts.mStatusMask << " StatusFilter: " << opts.mStatusFilter; - std::cerr << " MsgStatus: " << meta->mMsgStatus << " MsgId: " << meta->mMsgId; - std::cerr << std::endl; - - statusMatch = true; +#ifdef DATA_DEBUG + std::cerr << __PRETTY_FUNCTION__ + << " Continue checking Msg as StatusMatches: " + << " Mask: " << opts.mStatusMask + << " StatusFilter: " << opts.mStatusFilter + << " MsgStatus: " << meta->mMsgStatus + << " MsgId: " << meta->mMsgId << std::endl; +#endif } else { - std::cerr << "checkMsgFilter() Dropping Msg due to !StatusMatch "; - std::cerr << " Mask: " << opts.mStatusMask << " StatusFilter: " << opts.mStatusFilter; - std::cerr << " MsgStatus: " << meta->mMsgStatus << " MsgId: " << meta->mMsgId; - std::cerr << std::endl; +#ifdef DATA_DEBUG + std::cerr << __PRETTY_FUNCTION__ + << " Dropping Msg due to !StatusMatch " + << " Mask: " << opts.mStatusMask + << " StatusFilter: " << opts.mStatusFilter + << " MsgStatus: " << meta->mMsgStatus + << " MsgId: " << meta->mMsgId << std::endl; +#endif + + return false; } } else { - // no status comparision, - statusMatch = true; +#ifdef DATA_DEBUG + std::cerr << __PRETTY_FUNCTION__ + << " Status check not requested" + << " mStatusMask: " << opts.mStatusMask + << " MsgId: " << meta->mMsgId << std::endl; +#endif } - bool flagMatch = false; + if(opts.mMsgFlagMask) + { + // Exact Flags match required. + if ( (opts.mMsgFlagMask & opts.mMsgFlagFilter) == + (opts.mMsgFlagMask & meta->mMsgFlags) ) + { +#ifdef DATA_DEBUG + std::cerr << __PRETTY_FUNCTION__ + << " Accepting Msg as FlagMatches: " + << " Mask: " << opts.mMsgFlagMask + << " FlagFilter: " << opts.mMsgFlagFilter + << " MsgFlag: " << meta->mMsgFlags + << " MsgId: " << meta->mMsgId << std::endl; +#endif + } + else + { +#ifdef DATA_DEBUG + std::cerr << __PRETTY_FUNCTION__ + << " Dropping Msg due to !FlagMatch " + << " Mask: " << opts.mMsgFlagMask + << " FlagFilter: " << opts.mMsgFlagFilter + << " MsgFlag: " << meta->mMsgFlags + << " MsgId: " << meta->mMsgId << std::endl; +#endif - if(opts.mMsgFlagMask) - { - // Exact Flags match required. - if ((opts.mMsgFlagMask & opts.mMsgFlagFilter) == (opts.mMsgFlagMask & meta->mMsgFlags)) - { - std::cerr << "checkMsgFilter() Accepting Msg as FlagMatches: "; - std::cerr << " Mask: " << opts.mMsgFlagMask << " FlagFilter: " << opts.mMsgFlagFilter; - std::cerr << " MsgFlag: " << meta->mMsgFlags << " MsgId: " << meta->mMsgId; - std::cerr << std::endl; + return false; + } + } + else + { +#ifdef DATA_DEBUG + std::cerr << __PRETTY_FUNCTION__ + << " Flags check not requested" + << " mMsgFlagMask: " << opts.mMsgFlagMask + << " MsgId: " << meta->mMsgId << std::endl; +#endif + } - flagMatch = true; - } - else - { - std::cerr << "checkMsgFilter() Dropping Msg due to !FlagMatch "; - std::cerr << " Mask: " << opts.mMsgFlagMask << " FlagFilter: " << opts.mMsgFlagFilter; - std::cerr << " MsgFlag: " << meta->mMsgFlags << " MsgId: " << meta->mMsgId; - std::cerr << std::endl; - - flagMatch = false; - } - }else{ - flagMatch = true; - } - - return statusMatch && flagMatch; + return true; } diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 3fc3ddc2b..0b4c05dca 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -858,7 +858,7 @@ void p3GxsChannels::request_GroupUnprocessedPosts(const std::list } -void p3GxsChannels::load_SpecificUnprocessedPosts(uint32_t token) +void p3GxsChannels::load_unprocessedPosts(uint32_t token) { #ifdef GXSCHANNELS_DEBUG std::cerr << "p3GxsChannels::load_SpecificUnprocessedPosts" << std::endl; @@ -880,32 +880,6 @@ void p3GxsChannels::load_SpecificUnprocessedPosts(uint32_t token) } } - -void p3GxsChannels::load_GroupUnprocessedPosts(const uint32_t &token) -{ -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::load_GroupUnprocessedPosts"; - std::cerr << std::endl; -#endif - - std::vector posts; - if (!getPostData(token, posts)) - { -#ifdef GXSCHANNELS_DEBUG - std::cerr << "p3GxsChannels::load_GroupUnprocessedPosts ERROR"; - std::cerr << std::endl; -#endif - return; - } - - - std::vector::iterator it; - for(it = posts.begin(); it != posts.end(); ++it) - { - handleUnprocessedPost(*it); - } -} - void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg) { #ifdef GXSCHANNELS_DEBUG @@ -915,8 +889,8 @@ void p3GxsChannels::handleUnprocessedPost(const RsGxsChannelPost &msg) if (!IS_MSG_UNPROCESSED(msg.mMeta.mMsgStatus)) { - std::cerr << __PRETTY_FUNCTION__ << " ERROR Msg already Processed!" - << std::endl; + std::cerr << __PRETTY_FUNCTION__ << " ERROR Msg already Processed! " + << "mMsgId: " << msg.mMeta.mMsgId << std::endl; return; } @@ -999,19 +973,18 @@ void p3GxsChannels::handleResponse(uint32_t token, uint32_t req_type) load_SubscribedGroups(token); break; - case GXSCHANNELS_UNPROCESSED_SPECIFIC: - load_SpecificUnprocessedPosts(token); - break; + case GXSCHANNELS_UNPROCESSED_SPECIFIC: + load_unprocessedPosts(token); + break; - case GXSCHANNELS_UNPROCESSED_GENERIC: - load_SpecificUnprocessedPosts(token); - break; + case GXSCHANNELS_UNPROCESSED_GENERIC: + load_unprocessedPosts(token); + break; - default: - /* error */ - std::cerr << "p3GxsService::handleResponse() Unknown Request Type: " << req_type; - std::cerr << std::endl; - break; + default: + std::cerr << __PRETTY_FUNCTION__ << "ERROR Unknown Request Type: " + << req_type << std::endl; + break; } } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index bb6261f48..3caf31c59 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -220,10 +220,8 @@ static uint32_t channelsAuthenPolicy(); void load_SubscribedGroups(const uint32_t &token); void request_SpecificUnprocessedPosts(std::list > &ids); - void load_SpecificUnprocessedPosts(uint32_t token); - void request_GroupUnprocessedPosts(const std::list &grouplist); - void load_GroupUnprocessedPosts(const uint32_t &token); + void load_unprocessedPosts(uint32_t token); void handleUnprocessedPost(const RsGxsChannelPost &msg); From e449ffba04fb6a3342fc1a2e42d31d4ee49ac125 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 9 Nov 2018 22:24:49 +0100 Subject: [PATCH 008/110] Better include in RsGxsChannels --- libretroshare/src/retroshare/rsgxschannels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 347805b13..37edf7b05 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -22,7 +22,7 @@ * * *******************************************************************************/ -#include +#include #include #include #include From f84824271f092dbac34a8481027b063c35dafc97 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 10 Nov 2018 16:24:47 +0100 Subject: [PATCH 009/110] Implement ostream operator<< for RsSerializable So it is not necessary to define it for each class we want to print in debug --- libretroshare/src/libretroshare.pro | 3 +- .../src/serialiser/rsserializable.cc | 31 +++++++++++++++++++ libretroshare/src/serialiser/rsserializable.h | 5 +++ libretroshare/src/util/rsjson.h | 2 +- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 libretroshare/src/serialiser/rsserializable.cc diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index f6094100e..6adf9970d 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -764,7 +764,8 @@ HEADERS += serialiser/rsserializable.h \ serialiser/rstypeserializer.h \ util/rsjson.h -SOURCES += serialiser/rsserializer.cc \ +SOURCES += serialiser/rsserializable.cc \ + serialiser/rsserializer.cc \ serialiser/rstypeserializer.cc \ util/rsjson.cc diff --git a/libretroshare/src/serialiser/rsserializable.cc b/libretroshare/src/serialiser/rsserializable.cc new file mode 100644 index 000000000..a5a329e6d --- /dev/null +++ b/libretroshare/src/serialiser/rsserializable.cc @@ -0,0 +1,31 @@ +/******************************************************************************* + * libretroshare: retroshare core library * + * * + * Copyright (C) 2018 Gioacchino Mazzurco * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Lesser General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +#include "serialiser/rsserializable.h" + +#include + +std::ostream& operator<<(std::ostream& out, const RsSerializable& serializable) +{ + RsGenericSerializer::SerializeContext ctx; + const_cast(serializable) // safe with TO_JSON + .serial_process(RsGenericSerializer::TO_JSON, ctx); + return out << ctx.mJson; +} diff --git a/libretroshare/src/serialiser/rsserializable.h b/libretroshare/src/serialiser/rsserializable.h index fc6d73662..147cce20e 100644 --- a/libretroshare/src/serialiser/rsserializable.h +++ b/libretroshare/src/serialiser/rsserializable.h @@ -20,8 +20,11 @@ * * *******************************************************************************/ #pragma once + #include "serialiser/rsserializer.h" +#include + /** @brief Minimal ancestor for all serializable structs in RetroShare. * If you want your struct to be easly serializable you should inherit from this @@ -49,3 +52,5 @@ struct RsSerializable #define RS_SERIAL_PROCESS(I) do { \ RsTypeSerializer::serial_process(j, ctx, I, #I ); \ } while(0) + +std::ostream &operator<<(std::ostream& out, const RsSerializable& serializable); diff --git a/libretroshare/src/util/rsjson.h b/libretroshare/src/util/rsjson.h index c52584b7e..8bbb2a992 100644 --- a/libretroshare/src/util/rsjson.h +++ b/libretroshare/src/util/rsjson.h @@ -39,7 +39,7 @@ typedef rapidjson::Document RsJson; * @param[in] jDoc JSON document to print * @return same output stream passed as out parameter */ -std::ostream &operator<<(std::ostream &out, const RsJson &jDoc); +std::ostream& operator<<(std::ostream &out, const RsJson &jDoc); /** * Stream manipulator to print RsJson in compact format From 72dd985162c9924e47c6d1e99c4bbbe1cd9fbc8b Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 10 Nov 2018 16:28:15 +0100 Subject: [PATCH 010/110] Deprecate TLV items, to avoid temptation to use them in new code --- libretroshare/src/serialiser/rstlvidset.h | 8 +++++--- libretroshare/src/serialiser/rstlvitem.h | 16 +++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/serialiser/rstlvidset.h b/libretroshare/src/serialiser/rstlvidset.h index f722947de..732eee64c 100644 --- a/libretroshare/src/serialiser/rstlvidset.h +++ b/libretroshare/src/serialiser/rstlvidset.h @@ -28,13 +28,15 @@ #include "serialiser/rstlvbase.h" #include "serialiser/rstlvitem.h" - +#include "util/rsdeprecate.h" #include #include #include -template class t_RsTlvIdSet: public RsTlvItem +/// @deprecated use plain std::set<> instead +template class RS_DEPRECATED_FOR(std::set<>) t_RsTlvIdSet + : public RsTlvItem { public: t_RsTlvIdSet() {} @@ -122,7 +124,7 @@ typedef t_RsTlvIdSet RsTlvGxsMsgIdSet typedef t_RsTlvIdSet RsTlvGxsCircleIdSet ; typedef t_RsTlvIdSet RsTlvNodeGroupIdSet ; -class RsTlvServiceIdSet: public RsTlvItem +class RS_DEPRECATED RsTlvServiceIdSet: public RsTlvItem { public: RsTlvServiceIdSet() { return; } diff --git a/libretroshare/src/serialiser/rstlvitem.h b/libretroshare/src/serialiser/rstlvitem.h index 1623a8224..4d45cd120 100644 --- a/libretroshare/src/serialiser/rstlvitem.h +++ b/libretroshare/src/serialiser/rstlvitem.h @@ -26,15 +26,18 @@ * ******************************************************************/ +#include "util/rsdeprecate.h" + #include #include #include -//! A base class for all tlv items -/*! This class is provided to allow the serialisation and deserialization of compund -tlv items -*/ -class RsTlvItem +/*! A base class for all tlv items + * This class is provided to allow the serialisation and deserialization of + * compund tlv items + * @deprecated TLV serialization system is deprecated! + */ +class RS_DEPRECATED_FOR(RsSerializable) RsTlvItem { public: RsTlvItem() { return; } @@ -51,8 +54,7 @@ std::ostream &printEnd(std::ostream &out, std::string clsName, uint16_t indent) std::ostream &printIndent(std::ostream &out, uint16_t indent); - -class RsTlvUnit: public RsTlvItem +class RS_DEPRECATED_FOR(RsSerializable) RsTlvUnit: public RsTlvItem { public: RsTlvUnit(uint16_t tlv_type); From 1d110600fc48bac6c5766e15a78bb39a6b498523 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 10 Nov 2018 16:29:39 +0100 Subject: [PATCH 011/110] Minor cleanups in GxsChannels --- libretroshare/src/retroshare/rsgxschannels.h | 7 +------ libretroshare/src/services/p3gxschannels.cc | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 37edf7b05..6aa4a6081 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -1,4 +1,3 @@ -#pragma once /******************************************************************************* * libretroshare/src/retroshare: rsgxschannels.h * * * @@ -21,6 +20,7 @@ * along with this program. If not, see . * * * *******************************************************************************/ +#pragma once #include #include @@ -62,9 +62,6 @@ struct RsGxsChannelGroup : RsSerializable } }; -std::ostream &operator<<(std::ostream& out, const RsGxsChannelGroup& group); - - struct RsGxsChannelPost : RsSerializable { RsGxsChannelPost() : mCount(0), mSize(0) {} @@ -95,8 +92,6 @@ struct RsGxsChannelPost : RsSerializable } }; -std::ostream &operator<<(std::ostream& out, const RsGxsChannelPost& post); - class RsGxsChannels: public RsGxsIfaceHelper, public RsGxsCommentService { diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 0b4c05dca..380f1d378 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1033,7 +1033,7 @@ bool p3GxsChannels::createChannel(RsGxsChannelGroup& channel) uint32_t token; if(!createGroup(token, channel)) { - std::cerr << __PRETTY_FUNCTION__ << "Error! Failed updating group." + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed creating group." << std::endl; return false; } From 8b8ad3bce5ccf380b151b15e6359113df09fca7c Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 10 Nov 2018 16:30:35 +0100 Subject: [PATCH 012/110] Forum API for creation and posting Deprecate old functions that expose internal functioning --- libretroshare/src/retroshare/rsgxsforums.h | 96 +++++++++++++++------- libretroshare/src/services/p3gxsforums.cc | 38 +++++++++ libretroshare/src/services/p3gxsforums.h | 3 + 3 files changed, 108 insertions(+), 29 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index 690523055..f5121b64c 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -3,7 +3,8 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2012-2012 by Robert Fernie * + * Copyright (C) 2012 by Robert Fernie * + * Copyright (C) 2018 Gioacchino Mazzurco * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -19,61 +20,98 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#ifndef RETROSHARE_GXS_FORUM_GUI_INTERFACE_H -#define RETROSHARE_GXS_FORUM_GUI_INTERFACE_H +#pragma once -#include +#include #include #include #include "retroshare/rstokenservice.h" #include "retroshare/rsgxsifacehelper.h" #include "serialiser/rstlvidset.h" +#include "serialiser/rsserializable.h" -// Forum Service message flags, to be used in RsMsgMetaData::mMsgFlags -// Gxs imposes to use the first two bytes (lower bytes) of mMsgFlags for private forum flags, the upper bytes being used for internal GXS stuff. - -static const uint32_t RS_GXS_FORUM_MSG_FLAGS_MASK = 0x0000000f ; -static const uint32_t RS_GXS_FORUM_MSG_FLAGS_MODERATED = 0x00000001 ; - -#define IS_FORUM_MSG_MODERATION(flags) (flags & RS_GXS_FORUM_MSG_FLAGS_MODERATED) /* The Main Interface Class - for information about your Peers */ class RsGxsForums; -extern RsGxsForums *rsGxsForums; -class RsGxsForumGroup +/** + * Pointer to global instance of RsGxsChannels service implementation + * @jsonapi{development} + */ +extern RsGxsForums* rsGxsForums; + + +/** Forum Service message flags, to be used in RsMsgMetaData::mMsgFlags + * Gxs imposes to use the first two bytes (lower bytes) of mMsgFlags for + * private forum flags, the upper bytes being used for internal GXS stuff. + */ +static const uint32_t RS_GXS_FORUM_MSG_FLAGS_MASK = 0x0000000f; +static const uint32_t RS_GXS_FORUM_MSG_FLAGS_MODERATED = 0x00000001; + +#define IS_FORUM_MSG_MODERATION(flags) (flags & RS_GXS_FORUM_MSG_FLAGS_MODERATED) + + +struct RsGxsForumGroup : RsSerializable { - public: RsGroupMetaData mMeta; std::string mDescription; - // What's below is optional, and handled by the serialiser + /* What's below is optional, and handled by the serialiser + * TODO: run away from TLV old serializables as those types are opaque to + * JSON API! */ + RsTlvGxsIdSet mAdminList; + RsTlvGxsMsgIdSet mPinnedPosts; - RsTlvGxsIdSet mAdminList; - RsTlvGxsMsgIdSet mPinnedPosts; + /// @see RsSerializable + virtual void serial_process( RsGenericSerializer::SerializeJob j, + RsGenericSerializer::SerializeContext& ctx ) + { + RS_SERIAL_PROCESS(mMeta); + RS_SERIAL_PROCESS(mDescription); + RS_SERIAL_PROCESS(mAdminList); + RS_SERIAL_PROCESS(mPinnedPosts); + } }; -class RsGxsForumMsg +struct RsGxsForumMsg : RsSerializable { - public: RsMsgMetaData mMeta; std::string mMsg; + + /// @see RsSerializable + virtual void serial_process( RsGenericSerializer::SerializeJob j, + RsGenericSerializer::SerializeContext& ctx ) + { + RS_SERIAL_PROCESS(mMeta); + RS_SERIAL_PROCESS(mMsg); + } }; -//typedef std::map > GxsForumMsgResult; - -std::ostream &operator<<(std::ostream &out, const RsGxsForumGroup &group); -std::ostream &operator<<(std::ostream &out, const RsGxsForumMsg &msg); - class RsGxsForums: public RsGxsIfaceHelper { public: - explicit RsGxsForums(RsGxsIface& gxs) : RsGxsIfaceHelper(gxs) {} virtual ~RsGxsForums() {} + /** + * @brief Create forum. Blocking API. + * @jsonapi{development} + * @param[inout] forum Forum data (name, description...) + * @return false on error, true otherwise + */ + virtual bool createForum(RsGxsForumGroup& forum) = 0; + + /** + * @brief Create forum message. Blocking API. + * @jsonapi{development} + * @param[inout] message + * @return false on error, true otherwise + */ + virtual bool createMessage(RsGxsForumMsg& message) = 0; + + /* Specific Service Data */ virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; virtual bool getMsgData(const uint32_t &token, std::vector &msgs) = 0; @@ -89,8 +127,12 @@ public: //virtual bool groupRestoreKeys(const std::string &groupId); //virtual bool groupShareKeys(const std::string &groupId, std::list& peers); + RS_DEPRECATED_FOR(createForum) virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group) = 0; + + RS_DEPRECATED_FOR(createMessage) virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg) = 0; + /*! * To update forum group with new information * @param token the token used to check completion status of update @@ -98,9 +140,5 @@ public: * @return false groupId not set, true if set and accepted (still check token for completion) */ virtual bool updateGroup(uint32_t &token, RsGxsForumGroup &group) = 0; - }; - - -#endif diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index ccee5ba71..f913b5e1f 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -379,6 +379,33 @@ bool p3GxsForums::getMsgData(const uint32_t &token, std::vector & /********************************************************************************************/ +bool p3GxsForums::createForum(RsGxsForumGroup& forum) +{ + uint32_t token; + if(!createGroup(token, forum)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed creating group." + << std::endl; + return false; + } + + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." + << std::endl; + return false; + } + + if(!RsGenExchange::getPublishedGroupMeta(token, forum.mMeta)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failure getting updated " + << " group data." << std::endl; + return false; + } + + return true; +} + bool p3GxsForums::createGroup(uint32_t &token, RsGxsForumGroup &group) { std::cerr << "p3GxsForums::createGroup()" << std::endl; @@ -407,6 +434,17 @@ bool p3GxsForums::updateGroup(uint32_t &token, RsGxsForumGroup &group) return true; } +bool p3GxsForums::createMessage(RsGxsForumMsg& message) +{ + uint32_t token; + if( !createMsg(token, message) + || waitToken(token) != RsTokenService::COMPLETE ) return false; + + if(RsGenExchange::getPublishedMsgMeta(token, message.mMeta)) return true; + + return false; +} + bool p3GxsForums::createMsg(uint32_t &token, RsGxsForumMsg &msg) { std::cerr << "p3GxsForums::createForumMsg() GroupId: " << msg.mMeta.mGroupId; diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index ef3dd46d8..3e88d0cb3 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -74,6 +74,9 @@ virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgI //virtual bool groupRestoreKeys(const std::string &groupId); //virtual bool groupShareKeys(const std::string &groupId, std::list& peers); + virtual bool createForum(RsGxsForumGroup& forum); + virtual bool createMessage(RsGxsForumMsg& message); + virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group); virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg); From b57aacb6bbce5cc7f90800507ca8b1cf25c01610 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 11 Nov 2018 16:57:05 +0100 Subject: [PATCH 013/110] partially added/fixed licenses in gui/common --- .../src/gui/common/FloatingHelpBrowser.cpp | 39 +++++++++-------- .../src/gui/common/FloatingHelpBrowser.h | 39 +++++++++-------- retroshare-gui/src/gui/common/FriendList.cpp | 39 +++++++++-------- retroshare-gui/src/gui/common/FriendList.h | 39 +++++++++-------- .../src/gui/common/FriendSelectionDialog.cpp | 20 +++++++++ .../src/gui/common/FriendSelectionDialog.h | 20 +++++++++ .../src/gui/common/FriendSelectionWidget.cpp | 40 +++++++++--------- .../src/gui/common/FriendSelectionWidget.h | 40 +++++++++--------- .../src/gui/common/GroupChooser.cpp | 41 +++++++++--------- retroshare-gui/src/gui/common/GroupChooser.h | 42 +++++++++---------- retroshare-gui/src/gui/common/GroupDefs.cpp | 39 +++++++++-------- retroshare-gui/src/gui/common/GroupDefs.h | 40 +++++++++--------- .../src/gui/common/GroupFlagsWidget.cpp | 20 +++++++++ .../src/gui/common/GroupFlagsWidget.h | 20 +++++++++ .../src/gui/common/GroupSelectionBox.cpp | 20 +++++++++ .../src/gui/common/GroupSelectionBox.h | 20 +++++++++ .../src/gui/common/GroupTreeWidget.cpp | 40 +++++++++--------- .../src/gui/common/GroupTreeWidget.h | 39 +++++++++-------- retroshare-gui/src/gui/common/HashBox.cpp | 39 +++++++++-------- retroshare-gui/src/gui/common/HashBox.h | 39 +++++++++-------- retroshare-gui/src/gui/common/HeaderFrame.cpp | 20 +++++++++ retroshare-gui/src/gui/common/HeaderFrame.h | 20 +++++++++ .../src/gui/common/LineEditClear.cpp | 40 +++++++++--------- retroshare-gui/src/gui/common/LineEditClear.h | 40 +++++++++--------- .../src/gui/common/MimeTextEdit.cpp | 39 +++++++++-------- retroshare-gui/src/gui/common/MimeTextEdit.h | 39 +++++++++-------- retroshare-gui/src/gui/common/PeerDefs.cpp | 39 +++++++++-------- retroshare-gui/src/gui/common/PeerDefs.h | 40 +++++++++--------- .../src/gui/common/PopularityDefs.cpp | 39 +++++++++-------- .../src/gui/common/PopularityDefs.h | 40 +++++++++--------- 30 files changed, 579 insertions(+), 452 deletions(-) diff --git a/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp b/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp index ffb1bf290..8c2b9e016 100644 --- a/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp +++ b/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2013, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/FloatingHelpBrowser.cpp * + * * + * Copyright (C) 2013, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/FloatingHelpBrowser.h b/retroshare-gui/src/gui/common/FloatingHelpBrowser.h index d097aa7ee..02ae53f44 100644 --- a/retroshare-gui/src/gui/common/FloatingHelpBrowser.h +++ b/retroshare-gui/src/gui/common/FloatingHelpBrowser.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2013, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/FloatingHelpBrowser.h * + * * + * Copyright (C) 2013, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FLOATINGHELPBROWSER_H #define FLOATINGHELPBROWSER_H diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 3347e2911..ddca59bed 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/FriendList.cpp * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/FriendList.h b/retroshare-gui/src/gui/common/FriendList.h index f4a061e90..4aed1c43b 100644 --- a/retroshare-gui/src/gui/common/FriendList.h +++ b/retroshare-gui/src/gui/common/FriendList.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RShare is distributed under the following license: - * - * Copyright (C) 2011 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/FriendList.h * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FRIENDLIST_H #define FRIENDLIST_H diff --git a/retroshare-gui/src/gui/common/FriendSelectionDialog.cpp b/retroshare-gui/src/gui/common/FriendSelectionDialog.cpp index 01556eb49..9201a0458 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionDialog.cpp +++ b/retroshare-gui/src/gui/common/FriendSelectionDialog.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/FriendSelectionDialog.cpp * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include diff --git a/retroshare-gui/src/gui/common/FriendSelectionDialog.h b/retroshare-gui/src/gui/common/FriendSelectionDialog.h index 0bd3b5614..7a36a391c 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionDialog.h +++ b/retroshare-gui/src/gui/common/FriendSelectionDialog.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/FriendSelectionDialog.h * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once #include diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp index 8991b0012..2770622fe 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.cpp @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/FriendSelectionWidget.cpp * + * * + * Copyright (C) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/FriendSelectionWidget.h b/retroshare-gui/src/gui/common/FriendSelectionWidget.h index a9a546cfc..3b7a3db6c 100644 --- a/retroshare-gui/src/gui/common/FriendSelectionWidget.h +++ b/retroshare-gui/src/gui/common/FriendSelectionWidget.h @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/FriendSelectionWidget.h * + * * + * Copyright (C) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef FRIENDSELECTIONWIDGET_H #define FRIENDSELECTIONWIDGET_H diff --git a/retroshare-gui/src/gui/common/GroupChooser.cpp b/retroshare-gui/src/gui/common/GroupChooser.cpp index ca283c1a4..be456f96d 100644 --- a/retroshare-gui/src/gui/common/GroupChooser.cpp +++ b/retroshare-gui/src/gui/common/GroupChooser.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/common/GroupChooser.cpp * + * * + * Copyright (C) 2013, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GroupChooser.h" diff --git a/retroshare-gui/src/gui/common/GroupChooser.h b/retroshare-gui/src/gui/common/GroupChooser.h index fe7cb553b..fa7e2eba7 100644 --- a/retroshare-gui/src/gui/common/GroupChooser.h +++ b/retroshare-gui/src/gui/common/GroupChooser.h @@ -1,26 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - +/******************************************************************************* + * gui/common/GroupChooser.h * + * * + * Copyright (C) 2013, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once diff --git a/retroshare-gui/src/gui/common/GroupDefs.cpp b/retroshare-gui/src/gui/common/GroupDefs.cpp index 8a5e85ecd..ee784f81a 100644 --- a/retroshare-gui/src/gui/common/GroupDefs.cpp +++ b/retroshare-gui/src/gui/common/GroupDefs.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/GroupDefs.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/GroupDefs.h b/retroshare-gui/src/gui/common/GroupDefs.h index b502aa6bd..2f222847e 100644 --- a/retroshare-gui/src/gui/common/GroupDefs.h +++ b/retroshare-gui/src/gui/common/GroupDefs.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/GroupDefs.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GROUPDEFS_H #define _GROUPDEFS_H diff --git a/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp b/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp index d9d61043b..d4142f886 100644 --- a/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupFlagsWidget.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/GroupFlagsWidget.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include "GroupFlagsWidget.h" diff --git a/retroshare-gui/src/gui/common/GroupFlagsWidget.h b/retroshare-gui/src/gui/common/GroupFlagsWidget.h index 1c927f040..4703d124d 100644 --- a/retroshare-gui/src/gui/common/GroupFlagsWidget.h +++ b/retroshare-gui/src/gui/common/GroupFlagsWidget.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/GroupFlagsWidget.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once #include diff --git a/retroshare-gui/src/gui/common/GroupSelectionBox.cpp b/retroshare-gui/src/gui/common/GroupSelectionBox.cpp index fe83090b7..18cdff34d 100644 --- a/retroshare-gui/src/gui/common/GroupSelectionBox.cpp +++ b/retroshare-gui/src/gui/common/GroupSelectionBox.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/GroupSelectionBox.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include diff --git a/retroshare-gui/src/gui/common/GroupSelectionBox.h b/retroshare-gui/src/gui/common/GroupSelectionBox.h index 70ad69fc4..09ae741c2 100644 --- a/retroshare-gui/src/gui/common/GroupSelectionBox.h +++ b/retroshare-gui/src/gui/common/GroupSelectionBox.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/GroupSelectionBox.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 87be83e91..d658511e1 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -1,23 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/GroupTreeWidget.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include "GroupTreeWidget.h" diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.h b/retroshare-gui/src/gui/common/GroupTreeWidget.h index 59e0ae261..cc414c6db 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.h +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/GroupTreeWidget.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GROUPTREEWIDGET_H #define GROUPTREEWIDGET_H diff --git a/retroshare-gui/src/gui/common/HashBox.cpp b/retroshare-gui/src/gui/common/HashBox.cpp index 8214ee04c..989def440 100644 --- a/retroshare-gui/src/gui/common/HashBox.cpp +++ b/retroshare-gui/src/gui/common/HashBox.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2011, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/HashBox.cpp * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/HashBox.h b/retroshare-gui/src/gui/common/HashBox.h index d98b6fd85..908de1093 100644 --- a/retroshare-gui/src/gui/common/HashBox.h +++ b/retroshare-gui/src/gui/common/HashBox.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2011, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/HashBox.h * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef HASHBOX_H #define HASHBOX_H diff --git a/retroshare-gui/src/gui/common/HeaderFrame.cpp b/retroshare-gui/src/gui/common/HeaderFrame.cpp index 499076b80..88762fd46 100644 --- a/retroshare-gui/src/gui/common/HeaderFrame.cpp +++ b/retroshare-gui/src/gui/common/HeaderFrame.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/HeaderFrame.cpp * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "HeaderFrame.h" #include "ui_HeaderFrame.h" diff --git a/retroshare-gui/src/gui/common/HeaderFrame.h b/retroshare-gui/src/gui/common/HeaderFrame.h index 833da3df2..d6b026452 100644 --- a/retroshare-gui/src/gui/common/HeaderFrame.h +++ b/retroshare-gui/src/gui/common/HeaderFrame.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/HeaderFrame.h * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef HEADERFRAME_H #define HEADERFRAME_H diff --git a/retroshare-gui/src/gui/common/LineEditClear.cpp b/retroshare-gui/src/gui/common/LineEditClear.cpp index 3871b17ea..05bdca90b 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.cpp +++ b/retroshare-gui/src/gui/common/LineEditClear.cpp @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/LineEditClear.cpp * + * * + * Copyright (C) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "LineEditClear.h" diff --git a/retroshare-gui/src/gui/common/LineEditClear.h b/retroshare-gui/src/gui/common/LineEditClear.h index 7e5a5db5c..e8aea0626 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.h +++ b/retroshare-gui/src/gui/common/LineEditClear.h @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/LineEditClear.h * + * * + * Copyright (C) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef LINEEDITCLEAR_H #define LINEEDITCLEAR_H diff --git a/retroshare-gui/src/gui/common/MimeTextEdit.cpp b/retroshare-gui/src/gui/common/MimeTextEdit.cpp index 3ec714f0c..cac02dc3e 100644 --- a/retroshare-gui/src/gui/common/MimeTextEdit.cpp +++ b/retroshare-gui/src/gui/common/MimeTextEdit.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/MimeTextEdit.cpp * + * * + * Copyright (C) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/MimeTextEdit.h b/retroshare-gui/src/gui/common/MimeTextEdit.h index 7b22dee88..fc449fa64 100644 --- a/retroshare-gui/src/gui/common/MimeTextEdit.h +++ b/retroshare-gui/src/gui/common/MimeTextEdit.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/MimeTextEdit.h * + * * + * Copyright (C) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MIMETEXTEDIT_H #define MIMETEXTEDIT_H diff --git a/retroshare-gui/src/gui/common/PeerDefs.cpp b/retroshare-gui/src/gui/common/PeerDefs.cpp index 75978e692..204e89801 100644 --- a/retroshare-gui/src/gui/common/PeerDefs.cpp +++ b/retroshare-gui/src/gui/common/PeerDefs.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/PeerDefs.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/PeerDefs.h b/retroshare-gui/src/gui/common/PeerDefs.h index fd4b4fd52..e6b05505b 100644 --- a/retroshare-gui/src/gui/common/PeerDefs.h +++ b/retroshare-gui/src/gui/common/PeerDefs.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/PeerDefs.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _PEERDEFS_H #define _PEERDEFS_H diff --git a/retroshare-gui/src/gui/common/PopularityDefs.cpp b/retroshare-gui/src/gui/common/PopularityDefs.cpp index 5b843b7d7..096cdc1cf 100644 --- a/retroshare-gui/src/gui/common/PopularityDefs.cpp +++ b/retroshare-gui/src/gui/common/PopularityDefs.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/PopularityDefs.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/PopularityDefs.h b/retroshare-gui/src/gui/common/PopularityDefs.h index 5d989786d..64fa11eb0 100644 --- a/retroshare-gui/src/gui/common/PopularityDefs.h +++ b/retroshare-gui/src/gui/common/PopularityDefs.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/PopularityDefs.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _POPULARITYDEFS_H #define _POPULARITYDEFS_H From c4ae4c21b124e6e587f4b38d5f989146cac0248c Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 11 Nov 2018 20:41:06 +0100 Subject: [PATCH 014/110] fixed licenses in gui/common/ --- .../src/gui/common/RSElidedItemDelegate.cpp | 39 ++++++++--------- .../src/gui/common/RSElidedItemDelegate.h | 39 ++++++++--------- .../src/gui/common/RSFeedWidget.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/RSFeedWidget.h | 39 ++++++++--------- .../src/gui/common/RSGraphWidget.cpp | 43 +++++++++---------- retroshare-gui/src/gui/common/RSGraphWidget.h | 43 +++++++++---------- .../src/gui/common/RSImageBlockWidget.cpp | 39 ++++++++--------- .../src/gui/common/RSImageBlockWidget.h | 39 ++++++++--------- .../src/gui/common/RSItemDelegate.cpp | 39 ++++++++--------- .../src/gui/common/RSItemDelegate.h | 40 ++++++++--------- .../src/gui/common/RSListWidgetItem.cpp | 39 ++++++++--------- .../src/gui/common/RSListWidgetItem.h | 39 ++++++++--------- .../src/gui/common/RSPlainTextEdit.cpp | 40 ++++++++--------- .../src/gui/common/RSPlainTextEdit.h | 40 ++++++++--------- retroshare-gui/src/gui/common/RSTabWidget.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/RSTabWidget.h | 39 ++++++++--------- .../src/gui/common/RSTextBrowser.cpp | 20 +++++++++ retroshare-gui/src/gui/common/RSTextBrowser.h | 20 +++++++++ retroshare-gui/src/gui/common/RSTextEdit.cpp | 40 ++++++++--------- retroshare-gui/src/gui/common/RSTextEdit.h | 40 ++++++++--------- retroshare-gui/src/gui/common/RSTreeView.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/RSTreeView.h | 39 ++++++++--------- .../src/gui/common/RSTreeWidget.cpp | 40 ++++++++--------- retroshare-gui/src/gui/common/RSTreeWidget.h | 39 ++++++++--------- .../src/gui/common/RSTreeWidgetItem.cpp | 39 ++++++++--------- .../src/gui/common/RSTreeWidgetItem.h | 40 ++++++++--------- .../src/gui/common/RsBanListDefs.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/RsBanListDefs.h | 40 ++++++++--------- .../src/gui/common/RsBanListToolButton.cpp | 39 ++++++++--------- .../src/gui/common/RsBanListToolButton.h | 39 ++++++++--------- .../src/gui/common/RsButtonOnText.cpp | 19 ++++++++ .../src/gui/common/RsButtonOnText.h | 20 +++++++++ .../src/gui/common/RsCollection.cpp | 41 ++++++++---------- retroshare-gui/src/gui/common/RsCollection.h | 41 ++++++++---------- .../src/gui/common/RsCollectionDialog.cpp | 41 ++++++++---------- .../src/gui/common/RsCollectionDialog.h | 41 ++++++++---------- .../src/gui/common/RsUrlHandler.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/RsUrlHandler.h | 39 ++++++++--------- retroshare-gui/src/gui/common/StatusDefs.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/StatusDefs.h | 40 ++++++++--------- .../src/gui/common/StyledElidedLabel.cpp | 40 ++++++++--------- .../src/gui/common/StyledElidedLabel.h | 39 ++++++++--------- retroshare-gui/src/gui/common/StyledLabel.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/StyledLabel.h | 39 ++++++++--------- .../src/gui/common/SubscribeToolButton.cpp | 20 +++++++++ .../src/gui/common/SubscribeToolButton.h | 20 +++++++++ retroshare-gui/src/gui/common/TagDefs.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/TagDefs.h | 40 ++++++++--------- .../src/gui/common/ToasterNotify.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/ToasterNotify.h | 39 ++++++++--------- .../src/gui/common/UIStateHelper.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/UIStateHelper.h | 39 ++++++++--------- retroshare-gui/src/gui/common/UserNotify.cpp | 39 ++++++++--------- retroshare-gui/src/gui/common/UserNotify.h | 39 ++++++++--------- retroshare-gui/src/gui/common/rshtml.cpp | 41 +++++++++--------- retroshare-gui/src/gui/common/rshtml.h | 41 +++++++++--------- retroshare-gui/src/gui/common/rwindow.cpp | 42 +++++++++--------- retroshare-gui/src/gui/common/rwindow.h | 42 +++++++++--------- retroshare-gui/src/gui/common/vmessagebox.cpp | 41 +++++++++--------- retroshare-gui/src/gui/common/vmessagebox.h | 41 +++++++++--------- 60 files changed, 1156 insertions(+), 1110 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSElidedItemDelegate.cpp b/retroshare-gui/src/gui/common/RSElidedItemDelegate.cpp index 2da03cd48..de9f476b7 100644 --- a/retroshare-gui/src/gui/common/RSElidedItemDelegate.cpp +++ b/retroshare-gui/src/gui/common/RSElidedItemDelegate.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsEdlideLabelItemDelegate.cpp * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RSElidedItemDelegate.h" diff --git a/retroshare-gui/src/gui/common/RSElidedItemDelegate.h b/retroshare-gui/src/gui/common/RSElidedItemDelegate.h index 1addfafe0..f2d6e30cb 100644 --- a/retroshare-gui/src/gui/common/RSElidedItemDelegate.h +++ b/retroshare-gui/src/gui/common/RSElidedItemDelegate.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsEdlideLabelItemDelegate.h * + * * + * Copyright (C) 2010, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSELIDEDITEMDELEGATE_H #define RSELIDEDITEMDELEGATE_H diff --git a/retroshare-gui/src/gui/common/RSFeedWidget.cpp b/retroshare-gui/src/gui/common/RSFeedWidget.cpp index 15b174acc..264eda7e8 100644 --- a/retroshare-gui/src/gui/common/RSFeedWidget.cpp +++ b/retroshare-gui/src/gui/common/RSFeedWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSFeedWidget.cpp * + * * + * Copyright (C) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/RSFeedWidget.h b/retroshare-gui/src/gui/common/RSFeedWidget.h index 66bd0351c..b440c0850 100644 --- a/retroshare-gui/src/gui/common/RSFeedWidget.h +++ b/retroshare-gui/src/gui/common/RSFeedWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSFeedWidget.h * + * * + * Copyright (C) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSFEEDTREEWIDGET_H #define _RSFEEDTREEWIDGET_H diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index 0a929590a..5b9740b0b 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -1,25 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * Copyright (c) 2006-2007, crypton - * Copyright (c) 2006, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSGraphWidget.cpp * + * * + * Copyright (C) 2014 RetroShare Team * + * Copyright (c) 2006-2007, crypton * + * Copyright (c) 2006, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef WINDOWS_SYS #include diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.h b/retroshare-gui/src/gui/common/RSGraphWidget.h index 9e2b41b17..beefe314c 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.h +++ b/retroshare-gui/src/gui/common/RSGraphWidget.h @@ -1,25 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * Copyright (c) 2006-2007, crypton - * Copyright (c) 2006, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSGraphWidget.h * + * * + * Copyright (C) 2014 RetroShare Team * + * Copyright (c) 2006-2007, crypton * + * Copyright (c) 2006, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once diff --git a/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp b/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp index f2d62452f..789fcba15 100644 --- a/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp +++ b/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSImageBlockWidget.cpp * + * * + * Copyright (C) 2013 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/RSImageBlockWidget.h b/retroshare-gui/src/gui/common/RSImageBlockWidget.h index b435fbfbf..6d9b895ed 100644 --- a/retroshare-gui/src/gui/common/RSImageBlockWidget.h +++ b/retroshare-gui/src/gui/common/RSImageBlockWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSImageBlockWidget.h * + * * + * Copyright (C) 2013 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSIMAGEBLOCKWIDGET_H #define RSIMAGEBLOCKWIDGET_H diff --git a/retroshare-gui/src/gui/common/RSItemDelegate.cpp b/retroshare-gui/src/gui/common/RSItemDelegate.cpp index bf53e9653..f0f2051f6 100644 --- a/retroshare-gui/src/gui/common/RSItemDelegate.cpp +++ b/retroshare-gui/src/gui/common/RSItemDelegate.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSItemDelegate.cpp * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RSItemDelegate.h" diff --git a/retroshare-gui/src/gui/common/RSItemDelegate.h b/retroshare-gui/src/gui/common/RSItemDelegate.h index c7fbf0a70..04830196d 100644 --- a/retroshare-gui/src/gui/common/RSItemDelegate.h +++ b/retroshare-gui/src/gui/common/RSItemDelegate.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/RSItemDelegate.h * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSITEMDELEGATE_H #define _RSITEMDELEGATE_H diff --git a/retroshare-gui/src/gui/common/RSListWidgetItem.cpp b/retroshare-gui/src/gui/common/RSListWidgetItem.cpp index 5899c6977..64ad1e2b2 100644 --- a/retroshare-gui/src/gui/common/RSListWidgetItem.cpp +++ b/retroshare-gui/src/gui/common/RSListWidgetItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSListWidgetItem.cpp * + * * + * Copyright (C) 2012 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RSListWidgetItem.h" diff --git a/retroshare-gui/src/gui/common/RSListWidgetItem.h b/retroshare-gui/src/gui/common/RSListWidgetItem.h index 6d023f6cd..c3ac5ec3f 100644 --- a/retroshare-gui/src/gui/common/RSListWidgetItem.h +++ b/retroshare-gui/src/gui/common/RSListWidgetItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSListWidgetItem.h * + * * + * Copyright (C) 2012 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSLISTWIDGETITEM_H #define _RSLISTWIDGETITEM_H diff --git a/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp b/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp index 611cae2bb..3009ae745 100644 --- a/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp +++ b/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSPlainTextEdit.cpp * + * * + * Copyright (C) 2013 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/RSPlainTextEdit.h b/retroshare-gui/src/gui/common/RSPlainTextEdit.h index 8ea9fdc3f..ef0c3152a 100644 --- a/retroshare-gui/src/gui/common/RSPlainTextEdit.h +++ b/retroshare-gui/src/gui/common/RSPlainTextEdit.h @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSPlainTextEdit.h * + * * + * Copyright (C) 2013 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSPLAINTEXTEDIT_H #define RSPLAINTEXTEDIT_H diff --git a/retroshare-gui/src/gui/common/RSTabWidget.cpp b/retroshare-gui/src/gui/common/RSTabWidget.cpp index 807315890..149822a5f 100644 --- a/retroshare-gui/src/gui/common/RSTabWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTabWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTabWidget.cpp * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/RSTabWidget.h b/retroshare-gui/src/gui/common/RSTabWidget.h index 674445069..b8fb94a74 100644 --- a/retroshare-gui/src/gui/common/RSTabWidget.h +++ b/retroshare-gui/src/gui/common/RSTabWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTabWidget.h * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSTABWIDGET_H #define _RSTABWIDGET_H diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp index 4d58e07d7..a8ed488d1 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp +++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/RSTextBrowser.cpp * + * * + * Copyright (C) 2018 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.h b/retroshare-gui/src/gui/common/RSTextBrowser.h index 1140c9592..086889089 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.h +++ b/retroshare-gui/src/gui/common/RSTextBrowser.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/RSTextBrowser.h * + * * + * Copyright (C) 2018 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef RSTEXTBROWSER_H #define RSTEXTBROWSER_H diff --git a/retroshare-gui/src/gui/common/RSTextEdit.cpp b/retroshare-gui/src/gui/common/RSTextEdit.cpp index c812e8395..2f7f68a8c 100644 --- a/retroshare-gui/src/gui/common/RSTextEdit.cpp +++ b/retroshare-gui/src/gui/common/RSTextEdit.cpp @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTextEdit.cpp * + * * + * Copyright (C) 2014 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/RSTextEdit.h b/retroshare-gui/src/gui/common/RSTextEdit.h index 9ade41a36..ca18df6df 100644 --- a/retroshare-gui/src/gui/common/RSTextEdit.h +++ b/retroshare-gui/src/gui/common/RSTextEdit.h @@ -1,24 +1,22 @@ -/**************************************************************** - * - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTextEdit.h * + * * + * Copyright (C) 2014 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef RSTEXTEDIT_H #define RSTEXTEDIT_H diff --git a/retroshare-gui/src/gui/common/RSTreeView.cpp b/retroshare-gui/src/gui/common/RSTreeView.cpp index 6c4659161..c646b2a61 100644 --- a/retroshare-gui/src/gui/common/RSTreeView.cpp +++ b/retroshare-gui/src/gui/common/RSTreeView.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTreeView.cpp * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "RSTreeView.h" diff --git a/retroshare-gui/src/gui/common/RSTreeView.h b/retroshare-gui/src/gui/common/RSTreeView.h index 789728870..5132854e4 100644 --- a/retroshare-gui/src/gui/common/RSTreeView.h +++ b/retroshare-gui/src/gui/common/RSTreeView.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTreeView.h * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSTREEVIEW_H #define _RSTREEVIEW_H diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.cpp b/retroshare-gui/src/gui/common/RSTreeWidget.cpp index e4bd8be36..e38bc4bbb 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidget.cpp @@ -1,23 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTreeWidget.cpp * + * * + * Copyright (C) 2012 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "RSTreeWidget.h" #include diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.h b/retroshare-gui/src/gui/common/RSTreeWidget.h index 2d42088b9..76f77d0c2 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.h +++ b/retroshare-gui/src/gui/common/RSTreeWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTreeWidget.h * + * * + * Copyright (C) 2012 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSTREEWIDGET_H #define _RSTREEWIDGET_H diff --git a/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp b/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp index 5f614d414..3fcfb580a 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSTreeWidgetItem.cpp * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RSTreeWidgetItem.h" diff --git a/retroshare-gui/src/gui/common/RSTreeWidgetItem.h b/retroshare-gui/src/gui/common/RSTreeWidgetItem.h index df3042470..7f685f635 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidgetItem.h +++ b/retroshare-gui/src/gui/common/RSTreeWidgetItem.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/RSTreeWidgetItem.h * + * * + * Copyright (C) 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSTREEWIDGETITEM_H #define _RSTREEWIDGETITEM_H diff --git a/retroshare-gui/src/gui/common/RsBanListDefs.cpp b/retroshare-gui/src/gui/common/RsBanListDefs.cpp index 2173e7a30..f09c6cad9 100644 --- a/retroshare-gui/src/gui/common/RsBanListDefs.cpp +++ b/retroshare-gui/src/gui/common/RsBanListDefs.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsBanListDefs.cpp * + * * + * Copyright (C) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/RsBanListDefs.h b/retroshare-gui/src/gui/common/RsBanListDefs.h index 8a1275735..fe70e379a 100644 --- a/retroshare-gui/src/gui/common/RsBanListDefs.h +++ b/retroshare-gui/src/gui/common/RsBanListDefs.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/RsBanListDefs.h * + * * + * Copyright (C) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSBANLISTDEFS_H #define _RSBANLISTDEFS_H diff --git a/retroshare-gui/src/gui/common/RsBanListToolButton.cpp b/retroshare-gui/src/gui/common/RsBanListToolButton.cpp index 0ff70d914..7ed084d98 100644 --- a/retroshare-gui/src/gui/common/RsBanListToolButton.cpp +++ b/retroshare-gui/src/gui/common/RsBanListToolButton.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsBanListToolButton.cpp * + * * + * Copyright (C) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/RsBanListToolButton.h b/retroshare-gui/src/gui/common/RsBanListToolButton.h index 8a6080eda..b8acd8da2 100644 --- a/retroshare-gui/src/gui/common/RsBanListToolButton.h +++ b/retroshare-gui/src/gui/common/RsBanListToolButton.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsBanListToolButton.h * + * * + * Copyright (C) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RSBANLISTTOOLBUTTON_H #define _RSBANLISTTOOLBUTTON_H diff --git a/retroshare-gui/src/gui/common/RsButtonOnText.cpp b/retroshare-gui/src/gui/common/RsButtonOnText.cpp index e93134deb..95466c9d4 100644 --- a/retroshare-gui/src/gui/common/RsButtonOnText.cpp +++ b/retroshare-gui/src/gui/common/RsButtonOnText.cpp @@ -1,3 +1,22 @@ +/******************************************************************************* + * gui/common/RsButtonOnText.cpp * + * * + * Copyright (C) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RsButtonOnText.h" #include diff --git a/retroshare-gui/src/gui/common/RsButtonOnText.h b/retroshare-gui/src/gui/common/RsButtonOnText.h index 2d6ecbc5a..b85f8e7d0 100644 --- a/retroshare-gui/src/gui/common/RsButtonOnText.h +++ b/retroshare-gui/src/gui/common/RsButtonOnText.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/RsButtonOnText.h * + * * + * Copyright (C) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef RSBUTTONONTEXT_H #define RSBUTTONONTEXT_H diff --git a/retroshare-gui/src/gui/common/RsCollection.cpp b/retroshare-gui/src/gui/common/RsCollection.cpp index e22c9073d..b8bb4f7d9 100644 --- a/retroshare-gui/src/gui/common/RsCollection.cpp +++ b/retroshare-gui/src/gui/common/RsCollection.cpp @@ -1,25 +1,22 @@ -/*************************************:*************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011 - 2011 RetroShare Team - * - * Cyril Soler (csoler@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsCollection.cpp * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/RsCollection.h b/retroshare-gui/src/gui/common/RsCollection.h index 87f536033..d4764962f 100644 --- a/retroshare-gui/src/gui/common/RsCollection.h +++ b/retroshare-gui/src/gui/common/RsCollection.h @@ -1,25 +1,22 @@ -/*************************************:*************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011 - 2011 RetroShare Team - * - * Cyril Soler (csoler@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsCollection.h * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ // Implements a RetroShare collection file. Such a file contains // diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp index 36e0eb202..f5ed43c8b 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp @@ -1,25 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011 - 2011 RetroShare Team - * - * Cyril Soler (csoler@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsCollectionDialog.cpp * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "RsCollectionDialog.h" diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.h b/retroshare-gui/src/gui/common/RsCollectionDialog.h index ec3bf8711..43c7dbdd7 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.h +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.h @@ -1,25 +1,22 @@ -/*************************************:*************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011 - 2011 RetroShare Team - * - * Cyril Soler (csoler@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RsCollectionDialog.h * + * * + * Copyright (C) 2011, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ui_RsCollectionDialog.h" #include "RsCollection.h" diff --git a/retroshare-gui/src/gui/common/RsUrlHandler.cpp b/retroshare-gui/src/gui/common/RsUrlHandler.cpp index d307d7db1..6ac6310ac 100644 --- a/retroshare-gui/src/gui/common/RsUrlHandler.cpp +++ b/retroshare-gui/src/gui/common/RsUrlHandler.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011, Cyril Soler (csoler@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSUrlHandler.h * + * * + * Copyright (C) 2011 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/RsUrlHandler.h b/retroshare-gui/src/gui/common/RsUrlHandler.h index ff7463925..691774b34 100644 --- a/retroshare-gui/src/gui/common/RsUrlHandler.h +++ b/retroshare-gui/src/gui/common/RsUrlHandler.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2011 Cyril Soler (csoler@users.sourceforge.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/RSUrlHandler.h * + * * + * Copyright (C) 2011 Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ // This class overrides the desktop url handling. It's used to have e.g. rsCollection files // openned by retroshare. Other urls are passed on to the system. diff --git a/retroshare-gui/src/gui/common/StatusDefs.cpp b/retroshare-gui/src/gui/common/StatusDefs.cpp index 486312c61..f40949d17 100644 --- a/retroshare-gui/src/gui/common/StatusDefs.cpp +++ b/retroshare-gui/src/gui/common/StatusDefs.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/StatusDefs.cpp * + * * + * Copyright (c) 2010, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/StatusDefs.h b/retroshare-gui/src/gui/common/StatusDefs.h index 314208b0c..bbe3bc568 100644 --- a/retroshare-gui/src/gui/common/StatusDefs.h +++ b/retroshare-gui/src/gui/common/StatusDefs.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/StatusDefs.h * + * * + * Copyright (c) 2010, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _STATUSDEFS_H #define _STATUSDEFS_H diff --git a/retroshare-gui/src/gui/common/StyledElidedLabel.cpp b/retroshare-gui/src/gui/common/StyledElidedLabel.cpp index 3a196dc24..43fc85220 100644 --- a/retroshare-gui/src/gui/common/StyledElidedLabel.cpp +++ b/retroshare-gui/src/gui/common/StyledElidedLabel.cpp @@ -1,26 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/StyleElidedLabel.cpp * + * * + * Copyright (c) 2014, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include - #include "StyledElidedLabel.h" /** Constructor */ diff --git a/retroshare-gui/src/gui/common/StyledElidedLabel.h b/retroshare-gui/src/gui/common/StyledElidedLabel.h index f2f300989..d6467ab1f 100644 --- a/retroshare-gui/src/gui/common/StyledElidedLabel.h +++ b/retroshare-gui/src/gui/common/StyledElidedLabel.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/StyleElidedLabel.h * + * * + * Copyright (c) 2014, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _STYLEDELIDEDLABEL_H #define _STYLEDELIDEDLABEL_H diff --git a/retroshare-gui/src/gui/common/StyledLabel.cpp b/retroshare-gui/src/gui/common/StyledLabel.cpp index 799625d85..2eabc9852 100644 --- a/retroshare-gui/src/gui/common/StyledLabel.cpp +++ b/retroshare-gui/src/gui/common/StyledLabel.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/StyledLabel.cpp * + * * + * Copyright (c) 2014, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/common/StyledLabel.h b/retroshare-gui/src/gui/common/StyledLabel.h index 1ee140edf..faf0654da 100644 --- a/retroshare-gui/src/gui/common/StyledLabel.h +++ b/retroshare-gui/src/gui/common/StyledLabel.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2014, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/StyledLabel.h * + * * + * Copyright (c) 2014, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _STYLEDLABEL_H #define _STYLEDLABEL_H diff --git a/retroshare-gui/src/gui/common/SubscribeToolButton.cpp b/retroshare-gui/src/gui/common/SubscribeToolButton.cpp index d263b6f14..fa9b3f54e 100644 --- a/retroshare-gui/src/gui/common/SubscribeToolButton.cpp +++ b/retroshare-gui/src/gui/common/SubscribeToolButton.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/SubscribeToolButton.cpp * + * * + * Copyright (c) 2018, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include "SubscribeToolButton.h" diff --git a/retroshare-gui/src/gui/common/SubscribeToolButton.h b/retroshare-gui/src/gui/common/SubscribeToolButton.h index a2903893c..0bc43770d 100644 --- a/retroshare-gui/src/gui/common/SubscribeToolButton.h +++ b/retroshare-gui/src/gui/common/SubscribeToolButton.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/common/SubscribeToolButton.h * + * * + * Copyright (c) 2018, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef SUBSCRIBETOOLBUTTON_H #define SUBSCRIBETOOLBUTTON_H diff --git a/retroshare-gui/src/gui/common/TagDefs.cpp b/retroshare-gui/src/gui/common/TagDefs.cpp index a4c12f0ed..3eea81711 100644 --- a/retroshare-gui/src/gui/common/TagDefs.cpp +++ b/retroshare-gui/src/gui/common/TagDefs.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/TagDefs.cpp * + * * + * Copyright (c) 2010, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/TagDefs.h b/retroshare-gui/src/gui/common/TagDefs.h index 30211a50b..d542a2fc5 100644 --- a/retroshare-gui/src/gui/common/TagDefs.h +++ b/retroshare-gui/src/gui/common/TagDefs.h @@ -1,24 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/TagDefs.h * + * * + * Copyright (c) 2010, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _TAGDEFS_H #define _TAGDEFS_H diff --git a/retroshare-gui/src/gui/common/ToasterNotify.cpp b/retroshare-gui/src/gui/common/ToasterNotify.cpp index e964bf7d2..76efe126d 100644 --- a/retroshare-gui/src/gui/common/ToasterNotify.cpp +++ b/retroshare-gui/src/gui/common/ToasterNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/ToasterNotify.cpp * + * * + * Copyright (c) 2015, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ToasterNotify.h" diff --git a/retroshare-gui/src/gui/common/ToasterNotify.h b/retroshare-gui/src/gui/common/ToasterNotify.h index 062d6fbac..5f4176818 100644 --- a/retroshare-gui/src/gui/common/ToasterNotify.h +++ b/retroshare-gui/src/gui/common/ToasterNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/ToasterNotify.h * + * * + * Copyright (c) 2015, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef TOASTERNOTIFY_H #define TOASTERNOTIFY_H diff --git a/retroshare-gui/src/gui/common/UIStateHelper.cpp b/retroshare-gui/src/gui/common/UIStateHelper.cpp index bb4e8d726..0c59791e1 100644 --- a/retroshare-gui/src/gui/common/UIStateHelper.cpp +++ b/retroshare-gui/src/gui/common/UIStateHelper.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/UIStateHelper.cpp * + * * + * Copyright (c) 2013, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/UIStateHelper.h b/retroshare-gui/src/gui/common/UIStateHelper.h index 0cd6ac1d0..e6c8e6a9e 100644 --- a/retroshare-gui/src/gui/common/UIStateHelper.h +++ b/retroshare-gui/src/gui/common/UIStateHelper.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/UIStateHelper.h * + * * + * Copyright (c) 2013, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef UISTATEHELPER_H #define UISTATEHELPER_H diff --git a/retroshare-gui/src/gui/common/UserNotify.cpp b/retroshare-gui/src/gui/common/UserNotify.cpp index 6c70b3c9f..cf83cf316 100644 --- a/retroshare-gui/src/gui/common/UserNotify.cpp +++ b/retroshare-gui/src/gui/common/UserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/UserNotify.cpp * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/UserNotify.h b/retroshare-gui/src/gui/common/UserNotify.h index 42005982a..500c26dc3 100644 --- a/retroshare-gui/src/gui/common/UserNotify.h +++ b/retroshare-gui/src/gui/common/UserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/UserNotify.h * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef USERNOTIFY_H #define USERNOTIFY_H diff --git a/retroshare-gui/src/gui/common/rshtml.cpp b/retroshare-gui/src/gui/common/rshtml.cpp index e0a1cdaf6..ea6948763 100644 --- a/retroshare-gui/src/gui/common/rshtml.cpp +++ b/retroshare-gui/src/gui/common/rshtml.cpp @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/rshtml.cpp * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file rshtml.cpp diff --git a/retroshare-gui/src/gui/common/rshtml.h b/retroshare-gui/src/gui/common/rshtml.h index 627b81a59..8b8dd4704 100644 --- a/retroshare-gui/src/gui/common/rshtml.h +++ b/retroshare-gui/src/gui/common/rshtml.h @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/rshtml.h * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file rshtml.h diff --git a/retroshare-gui/src/gui/common/rwindow.cpp b/retroshare-gui/src/gui/common/rwindow.cpp index e86be7fa2..31fe12d9e 100644 --- a/retroshare-gui/src/gui/common/rwindow.cpp +++ b/retroshare-gui/src/gui/common/rwindow.cpp @@ -1,25 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2006-2007, crypton - * Copyright (c) 2006, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/rwindow.cpp * + * * + * Copyright (c) 2006-2007, crypton * + * Copyright (c) 2006, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/common/rwindow.h b/retroshare-gui/src/gui/common/rwindow.h index 50582307e..55441e45f 100644 --- a/retroshare-gui/src/gui/common/rwindow.h +++ b/retroshare-gui/src/gui/common/rwindow.h @@ -1,25 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2006-2007, crypton - * Copyright (c) 2006, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/common/rwindow.h * + * * + * Copyright (c) 2006-2007, crypton * + * Copyright (c) 2006, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _RETROSHAREWINDOW_H #define _RETROSHAREWINDOW_H diff --git a/retroshare-gui/src/gui/common/vmessagebox.cpp b/retroshare-gui/src/gui/common/vmessagebox.cpp index f1465fa4f..f2538b151 100644 --- a/retroshare-gui/src/gui/common/vmessagebox.cpp +++ b/retroshare-gui/src/gui/common/vmessagebox.cpp @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/vmessagebox.cpp * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file vmessagebox.cpp diff --git a/retroshare-gui/src/gui/common/vmessagebox.h b/retroshare-gui/src/gui/common/vmessagebox.h index 4a5b307ec..ca7b176ce 100644 --- a/retroshare-gui/src/gui/common/vmessagebox.h +++ b/retroshare-gui/src/gui/common/vmessagebox.h @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/common/vmessagebox.h * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file vmessagebox.h From 630609c11c745c9ec4c9115f928daa74a8ccd1b1 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 11 Nov 2018 20:42:48 +0100 Subject: [PATCH 015/110] fixed retroshare.project email in licenses --- libbitdht/src/util/bdstring.cc | 2 +- libbitdht/src/util/bdstring.h | 2 +- libresapi/src/api/ApiPluginHandler.cpp | 2 +- libresapi/src/api/ApiPluginHandler.h | 2 +- libresapi/src/api/ApiServer.cpp | 2 +- libresapi/src/api/ApiServer.h | 2 +- libresapi/src/api/ApiServerMHD.cpp | 2 +- libresapi/src/api/ApiServerMHD.h | 2 +- libresapi/src/api/ApiTypes.h | 2 +- libresapi/src/api/FileSearchHandler.cpp | 2 +- libresapi/src/api/FileSearchHandler.h | 2 +- libresapi/src/api/ForumHandler.cpp | 2 +- libresapi/src/api/ForumHandler.h | 2 +- libresapi/src/api/GetPluginInterfaces.cpp | 2 +- libresapi/src/api/GetPluginInterfaces.h | 2 +- libresapi/src/api/GxsResponseTask.cpp | 2 +- libresapi/src/api/GxsResponseTask.h | 2 +- libresapi/src/api/JsonStream.cpp | 2 +- libresapi/src/api/JsonStream.h | 2 +- libresapi/src/api/LivereloadHandler.cpp | 2 +- libresapi/src/api/LivereloadHandler.h | 2 +- libresapi/src/api/Operators.cpp | 2 +- libresapi/src/api/Operators.h | 2 +- libresapi/src/api/ResourceRouter.cpp | 2 +- libresapi/src/api/ResourceRouter.h | 2 +- libresapi/src/api/RsControlModule.cpp | 2 +- libresapi/src/api/RsControlModule.h | 2 +- libresapi/src/api/ServiceControlHandler.cpp | 2 +- libresapi/src/api/ServiceControlHandler.h | 2 +- libresapi/src/api/SettingsHandler.cpp | 2 +- libresapi/src/api/SettingsHandler.h | 2 +- libresapi/src/api/StateTokenServer.cpp | 2 +- libresapi/src/api/StateTokenServer.h | 2 +- libresapi/src/api/StatsHandler.cpp | 2 +- libresapi/src/api/StatsHandler.h | 2 +- libresapi/src/api/TmpBlobStore.cpp | 2 +- libresapi/src/api/TmpBlobStore.h | 2 +- libresapi/src/api/TransfersHandler.cpp | 2 +- libresapi/src/api/TransfersHandler.h | 2 +- libresapi/src/api/json.cpp | 2 +- libresapi/src/util/ContentTypes.cpp | 2 +- libresapi/src/util/ContentTypes.h | 2 +- libretroshare/src/crypto/chacha20.cpp | 2 +- libretroshare/src/crypto/hashstream.cc | 2 +- libretroshare/src/crypto/hashstream.h | 2 +- libretroshare/src/file_sharing/file_tree.cc | 2 +- libretroshare/src/ft/ftfilecreator.cc | 2 +- libretroshare/src/gxs/rsgxsnettunnel.cc | 2 +- libretroshare/src/gxs/rsgxsnettunnel.h | 2 +- libretroshare/src/gxs/rsnxs.h | 2 +- libretroshare/src/pqi/pqinetstatebox.cc | 2 +- libretroshare/src/pqi/pqinetstatebox.h | 2 +- libretroshare/src/retroshare/rsgrouter.h | 2 +- libretroshare/src/retroshare/rsgxsflags.h | 2 +- libretroshare/src/retroshare/rsgxsservice.h | 2 +- libretroshare/src/retroshare/rsversion.h | 2 +- libretroshare/src/rsserver/p3face-info.cc | 2 +- libretroshare/src/rsserver/p3face-server.cc | 2 +- libretroshare/src/rsserver/rsloginhandler.cc | 2 +- libretroshare/src/rsserver/rstypes.cc | 2 +- libretroshare/src/tcponudp/rsudpstack.h | 2 +- libretroshare/src/upnp/upnphandler_linux.cc | 2 +- libretroshare/src/upnp/upnphandler_linux.h | 2 +- libretroshare/src/upnp/upnphandler_miniupnp.cc | 2 +- libretroshare/src/upnp/upnphandler_miniupnp.h | 2 +- libretroshare/src/util/dnsresolver.cc | 2 +- libretroshare/src/util/dnsresolver.h | 2 +- libretroshare/src/util/extaddrfinder.cc | 2 +- libretroshare/src/util/extaddrfinder.h | 2 +- libretroshare/src/util/folderiterator.cc | 2 +- libretroshare/src/util/folderiterator.h | 2 +- libretroshare/src/util/radix32.h | 2 +- libretroshare/src/util/radix64.h | 2 +- libretroshare/src/util/rsinitedptr.h | 2 +- libretroshare/src/util/rsstd.h | 2 +- retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h | 2 +- retroshare-gui/src/gui/common/RSImageBlockWidget.cpp | 2 +- retroshare-gui/src/gui/common/RSImageBlockWidget.h | 2 +- retroshare-gui/src/gui/common/RSItemDelegate.cpp | 2 +- retroshare-gui/src/gui/common/RSItemDelegate.h | 2 +- retroshare-gui/src/gui/common/RSListWidgetItem.cpp | 2 +- retroshare-gui/src/gui/common/RSListWidgetItem.h | 2 +- retroshare-gui/src/gui/common/RSPlainTextEdit.cpp | 2 +- retroshare-gui/src/gui/common/RSPlainTextEdit.h | 2 +- retroshare-gui/src/gui/common/RSTabWidget.cpp | 2 +- retroshare-gui/src/gui/common/RSTabWidget.h | 2 +- retroshare-gui/src/gui/common/RSTextBrowser.cpp | 2 +- retroshare-gui/src/gui/common/RSTextBrowser.h | 2 +- retroshare-gui/src/gui/common/RSTextEdit.cpp | 2 +- retroshare-gui/src/gui/common/RSTextEdit.h | 2 +- retroshare-gui/src/gui/common/RSTreeView.cpp | 2 +- retroshare-gui/src/gui/common/RSTreeView.h | 2 +- retroshare-gui/src/gui/common/RSTreeWidget.cpp | 2 +- retroshare-gui/src/gui/common/RSTreeWidget.h | 2 +- retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp | 2 +- retroshare-gui/src/gui/common/RSTreeWidgetItem.h | 2 +- retroshare-gui/src/gui/common/RsUrlHandler.h | 2 +- retroshare-nogui/src/TerminalApiClient.cpp | 2 +- retroshare-nogui/src/TerminalApiClient.h | 2 +- retroshare-nogui/src/introserver.cc | 2 +- retroshare-nogui/src/introserver.h | 2 +- retroshare-nogui/src/notifytxt.cc | 2 +- retroshare-nogui/src/notifytxt.h | 2 +- retroshare-nogui/src/retroshare.cc | 2 +- .../unittests/libretroshare/gxs/security/gxssecurity_test.cc | 2 +- tests/unittests/libretroshare/serialiser/rsbaseitem_test.cc | 2 +- tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc | 2 +- .../libretroshare/serialiser/rsgxsupdateitem_test.cc | 2 +- tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc | 2 +- tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc | 2 +- tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc | 2 +- tests/unittests/libretroshare/serialiser/rstlvutil.cc | 2 +- tests/unittests/libretroshare/serialiser/rstlvutil.h | 2 +- tests/unittests/libretroshare/serialiser/rsturtleitem_test.cc | 2 +- tests/unittests/libretroshare/serialiser/support.cc | 2 +- tests/unittests/libretroshare/serialiser/support.h | 4 ++-- tests/unittests/libretroshare/serialiser/tlvbase_test.cc | 2 +- tests/unittests/libretroshare/serialiser/tlvbase_test2.cc | 2 +- tests/unittests/libretroshare/serialiser/tlvitems_test.cc | 2 +- tests/unittests/libretroshare/serialiser/tlvkey_test.cc | 2 +- tests/unittests/libretroshare/serialiser/tlvrandom_test.cc | 2 +- tests/unittests/libretroshare/serialiser/tlvstack_test.cc | 2 +- tests/unittests/libretroshare/serialiser/tlvtypes_test.cc | 4 ++-- tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc | 2 +- tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.h | 2 +- .../libretroshare/services/gxs/GxsIsolatedServiceTester.cc | 2 +- .../libretroshare/services/gxs/GxsIsolatedServiceTester.h | 2 +- .../libretroshare/services/gxs/GxsPairServiceTester.cc | 2 +- .../libretroshare/services/gxs/GxsPairServiceTester.h | 2 +- tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc | 2 +- tests/unittests/libretroshare/services/gxs/GxsPeerNode.h | 2 +- tests/unittests/libretroshare/services/gxs/gxstestservice.cc | 2 +- tests/unittests/libretroshare/services/gxs/gxstestservice.h | 2 +- tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc | 2 +- tests/unittests/libretroshare/services/gxs/nxspair_tests.cc | 2 +- tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc | 2 +- tests/unittests/libretroshare/services/gxs/rsgxstestitems.h | 2 +- tests/unittests/libretroshare/services/status/status_test.cc | 2 +- 139 files changed, 141 insertions(+), 141 deletions(-) diff --git a/libbitdht/src/util/bdstring.cc b/libbitdht/src/util/bdstring.cc index 2b9b289f4..3808e0c68 100644 --- a/libbitdht/src/util/bdstring.cc +++ b/libbitdht/src/util/bdstring.cc @@ -3,7 +3,7 @@ * * * BitDHT: An Flexible DHT library. * * * - * Copyright (C) 2010 Retroshare Team * + * Copyright (C) 2010 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libbitdht/src/util/bdstring.h b/libbitdht/src/util/bdstring.h index 7bd76892d..e9160c663 100644 --- a/libbitdht/src/util/bdstring.h +++ b/libbitdht/src/util/bdstring.h @@ -3,7 +3,7 @@ * * * BitDHT: An Flexible DHT library. * * * - * Copyright (C) 2010 Retroshare Team * + * Copyright (C) 2010 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiPluginHandler.cpp b/libresapi/src/api/ApiPluginHandler.cpp index 304e8e805..29253aa42 100644 --- a/libresapi/src/api/ApiPluginHandler.cpp +++ b/libresapi/src/api/ApiPluginHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiPluginHandler.h b/libresapi/src/api/ApiPluginHandler.h index 5fa8c8098..600e8b505 100644 --- a/libresapi/src/api/ApiPluginHandler.h +++ b/libresapi/src/api/ApiPluginHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiServer.cpp b/libresapi/src/api/ApiServer.cpp index 420a8ef05..8217dc7f6 100644 --- a/libresapi/src/api/ApiServer.cpp +++ b/libresapi/src/api/ApiServer.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiServer.h b/libresapi/src/api/ApiServer.h index 6843d39e7..42331c33e 100644 --- a/libresapi/src/api/ApiServer.h +++ b/libresapi/src/api/ApiServer.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiServerMHD.cpp b/libresapi/src/api/ApiServerMHD.cpp index c14c4ea71..81da6893d 100644 --- a/libresapi/src/api/ApiServerMHD.cpp +++ b/libresapi/src/api/ApiServerMHD.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiServerMHD.h b/libresapi/src/api/ApiServerMHD.h index 9046f0aa7..8258e90ad 100644 --- a/libresapi/src/api/ApiServerMHD.h +++ b/libresapi/src/api/ApiServerMHD.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ApiTypes.h b/libresapi/src/api/ApiTypes.h index 21e1b2132..ba171f9be 100644 --- a/libresapi/src/api/ApiTypes.h +++ b/libresapi/src/api/ApiTypes.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/FileSearchHandler.cpp b/libresapi/src/api/FileSearchHandler.cpp index c768b1112..7f719aa5b 100644 --- a/libresapi/src/api/FileSearchHandler.cpp +++ b/libresapi/src/api/FileSearchHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/FileSearchHandler.h b/libresapi/src/api/FileSearchHandler.h index 66b79209c..7e9b294b1 100644 --- a/libresapi/src/api/FileSearchHandler.h +++ b/libresapi/src/api/FileSearchHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ForumHandler.cpp b/libresapi/src/api/ForumHandler.cpp index 4180eb023..c6b6566b9 100644 --- a/libresapi/src/api/ForumHandler.cpp +++ b/libresapi/src/api/ForumHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ForumHandler.h b/libresapi/src/api/ForumHandler.h index 39fa0167f..e5225bb22 100644 --- a/libresapi/src/api/ForumHandler.h +++ b/libresapi/src/api/ForumHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/GetPluginInterfaces.cpp b/libresapi/src/api/GetPluginInterfaces.cpp index f2558a469..5375d0eea 100644 --- a/libresapi/src/api/GetPluginInterfaces.cpp +++ b/libresapi/src/api/GetPluginInterfaces.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/GetPluginInterfaces.h b/libresapi/src/api/GetPluginInterfaces.h index c7f92b263..9434da3aa 100644 --- a/libresapi/src/api/GetPluginInterfaces.h +++ b/libresapi/src/api/GetPluginInterfaces.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/GxsResponseTask.cpp b/libresapi/src/api/GxsResponseTask.cpp index 036a1f60a..2a35c979d 100644 --- a/libresapi/src/api/GxsResponseTask.cpp +++ b/libresapi/src/api/GxsResponseTask.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/GxsResponseTask.h b/libresapi/src/api/GxsResponseTask.h index 69e31d38d..30c30bc40 100644 --- a/libresapi/src/api/GxsResponseTask.h +++ b/libresapi/src/api/GxsResponseTask.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/JsonStream.cpp b/libresapi/src/api/JsonStream.cpp index 9802efe2a..4e6cffb6c 100644 --- a/libresapi/src/api/JsonStream.cpp +++ b/libresapi/src/api/JsonStream.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/JsonStream.h b/libresapi/src/api/JsonStream.h index 720b239d2..a6e3528ad 100644 --- a/libresapi/src/api/JsonStream.h +++ b/libresapi/src/api/JsonStream.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/LivereloadHandler.cpp b/libresapi/src/api/LivereloadHandler.cpp index e67cc2327..c57c86331 100644 --- a/libresapi/src/api/LivereloadHandler.cpp +++ b/libresapi/src/api/LivereloadHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/LivereloadHandler.h b/libresapi/src/api/LivereloadHandler.h index e32b206c9..5f77259c3 100644 --- a/libresapi/src/api/LivereloadHandler.h +++ b/libresapi/src/api/LivereloadHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/Operators.cpp b/libresapi/src/api/Operators.cpp index 643b39c7a..d0a27765e 100644 --- a/libresapi/src/api/Operators.cpp +++ b/libresapi/src/api/Operators.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/Operators.h b/libresapi/src/api/Operators.h index 92bed4c16..ddb5c18dc 100644 --- a/libresapi/src/api/Operators.h +++ b/libresapi/src/api/Operators.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ResourceRouter.cpp b/libresapi/src/api/ResourceRouter.cpp index 2c780ec2b..4ac6990b4 100644 --- a/libresapi/src/api/ResourceRouter.cpp +++ b/libresapi/src/api/ResourceRouter.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ResourceRouter.h b/libresapi/src/api/ResourceRouter.h index 53222ac75..2b0e6edc1 100644 --- a/libresapi/src/api/ResourceRouter.h +++ b/libresapi/src/api/ResourceRouter.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/RsControlModule.cpp b/libresapi/src/api/RsControlModule.cpp index c5d596ab3..5f07ed7ff 100644 --- a/libresapi/src/api/RsControlModule.cpp +++ b/libresapi/src/api/RsControlModule.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/RsControlModule.h b/libresapi/src/api/RsControlModule.h index 587a753a3..d18c15729 100644 --- a/libresapi/src/api/RsControlModule.h +++ b/libresapi/src/api/RsControlModule.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ServiceControlHandler.cpp b/libresapi/src/api/ServiceControlHandler.cpp index 6597d9d43..18189c197 100644 --- a/libresapi/src/api/ServiceControlHandler.cpp +++ b/libresapi/src/api/ServiceControlHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/ServiceControlHandler.h b/libresapi/src/api/ServiceControlHandler.h index 5ee9f6250..a0cab9008 100644 --- a/libresapi/src/api/ServiceControlHandler.h +++ b/libresapi/src/api/ServiceControlHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/SettingsHandler.cpp b/libresapi/src/api/SettingsHandler.cpp index 64a4d4997..543fa8e99 100644 --- a/libresapi/src/api/SettingsHandler.cpp +++ b/libresapi/src/api/SettingsHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/SettingsHandler.h b/libresapi/src/api/SettingsHandler.h index 6d7b040e8..9e37804d4 100644 --- a/libresapi/src/api/SettingsHandler.h +++ b/libresapi/src/api/SettingsHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/StateTokenServer.cpp b/libresapi/src/api/StateTokenServer.cpp index 7bd77a41f..6c0658e76 100644 --- a/libresapi/src/api/StateTokenServer.cpp +++ b/libresapi/src/api/StateTokenServer.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/StateTokenServer.h b/libresapi/src/api/StateTokenServer.h index 17900de8e..78e0676ed 100644 --- a/libresapi/src/api/StateTokenServer.h +++ b/libresapi/src/api/StateTokenServer.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/StatsHandler.cpp b/libresapi/src/api/StatsHandler.cpp index 49ce23487..05af03265 100644 --- a/libresapi/src/api/StatsHandler.cpp +++ b/libresapi/src/api/StatsHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/StatsHandler.h b/libresapi/src/api/StatsHandler.h index 0b6d65009..428c93695 100644 --- a/libresapi/src/api/StatsHandler.h +++ b/libresapi/src/api/StatsHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/TmpBlobStore.cpp b/libresapi/src/api/TmpBlobStore.cpp index 098f02e39..e3b04d8db 100644 --- a/libresapi/src/api/TmpBlobStore.cpp +++ b/libresapi/src/api/TmpBlobStore.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/TmpBlobStore.h b/libresapi/src/api/TmpBlobStore.h index 18ec6917b..1c4abc274 100644 --- a/libresapi/src/api/TmpBlobStore.h +++ b/libresapi/src/api/TmpBlobStore.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/TransfersHandler.cpp b/libresapi/src/api/TransfersHandler.cpp index c3b499a7e..1874138d9 100644 --- a/libresapi/src/api/TransfersHandler.cpp +++ b/libresapi/src/api/TransfersHandler.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/TransfersHandler.h b/libresapi/src/api/TransfersHandler.h index 41b442838..84b535de5 100644 --- a/libresapi/src/api/TransfersHandler.h +++ b/libresapi/src/api/TransfersHandler.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/api/json.cpp b/libresapi/src/api/json.cpp index 103ad9b67..16f238f39 100644 --- a/libresapi/src/api/json.cpp +++ b/libresapi/src/api/json.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/util/ContentTypes.cpp b/libresapi/src/util/ContentTypes.cpp index 3d026932b..9b54cc5f3 100644 --- a/libresapi/src/util/ContentTypes.cpp +++ b/libresapi/src/util/ContentTypes.cpp @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libresapi/src/util/ContentTypes.h b/libresapi/src/util/ContentTypes.h index 269383bae..02939a917 100644 --- a/libresapi/src/util/ContentTypes.h +++ b/libresapi/src/util/ContentTypes.h @@ -3,7 +3,7 @@ * * * LibResAPI: API for local socket server * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp index 16745968b..ebda0ee3c 100644 --- a/libretroshare/src/crypto/chacha20.cpp +++ b/libretroshare/src/crypto/chacha20.cpp @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2016 by Mr.Alice * + * Copyright 2016 by Mr.Alice * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/crypto/hashstream.cc b/libretroshare/src/crypto/hashstream.cc index 88709acfc..1d3c46b75 100644 --- a/libretroshare/src/crypto/hashstream.cc +++ b/libretroshare/src/crypto/hashstream.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/crypto/hashstream.h b/libretroshare/src/crypto/hashstream.h index 2a09935d0..b6babe6df 100644 --- a/libretroshare/src/crypto/hashstream.h +++ b/libretroshare/src/crypto/hashstream.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/file_sharing/file_tree.cc b/libretroshare/src/file_sharing/file_tree.cc index e96217804..4953b192b 100644 --- a/libretroshare/src/file_sharing/file_tree.cc +++ b/libretroshare/src/file_sharing/file_tree.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/ft/ftfilecreator.cc b/libretroshare/src/ft/ftfilecreator.cc index f792be958..a5c354092 100644 --- a/libretroshare/src/ft/ftfilecreator.cc +++ b/libretroshare/src/ft/ftfilecreator.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2008 by Retroshare Team * + * Copyright 2008 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/gxs/rsgxsnettunnel.cc b/libretroshare/src/gxs/rsgxsnettunnel.cc index fda849e0b..31564f980 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.cc +++ b/libretroshare/src/gxs/rsgxsnettunnel.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 by Cyril Soler * + * Copyright 2018 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/gxs/rsgxsnettunnel.h b/libretroshare/src/gxs/rsgxsnettunnel.h index 237bb9969..4fec812d2 100644 --- a/libretroshare/src/gxs/rsgxsnettunnel.h +++ b/libretroshare/src/gxs/rsgxsnettunnel.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 by Cyril Soler * + * Copyright 2018 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h index fdf268d5b..298e63ac8 100644 --- a/libretroshare/src/gxs/rsnxs.h +++ b/libretroshare/src/gxs/rsnxs.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2011-2011 by Robert Fernie * + * Copyright 2011-2011 by Robert Fernie * * Copyright 2011-2011 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * diff --git a/libretroshare/src/pqi/pqinetstatebox.cc b/libretroshare/src/pqi/pqinetstatebox.cc index 5b711afea..c570440c6 100644 --- a/libretroshare/src/pqi/pqinetstatebox.cc +++ b/libretroshare/src/pqi/pqinetstatebox.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 Retroshare Team * + * Copyright 2018 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/pqi/pqinetstatebox.h b/libretroshare/src/pqi/pqinetstatebox.h index 886b7d774..d4d86afee 100644 --- a/libretroshare/src/pqi/pqinetstatebox.h +++ b/libretroshare/src/pqi/pqinetstatebox.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 Retroshare Team * + * Copyright 2018 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/retroshare/rsgrouter.h b/libretroshare/src/retroshare/rsgrouter.h index 445b35d23..e29c5df50 100644 --- a/libretroshare/src/retroshare/rsgrouter.h +++ b/libretroshare/src/retroshare/rsgrouter.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2013 by Cyril Soler * + * Copyright 2013 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/retroshare/rsgxsflags.h b/libretroshare/src/retroshare/rsgxsflags.h index 885c5ae67..7a737c74c 100644 --- a/libretroshare/src/retroshare/rsgxsflags.h +++ b/libretroshare/src/retroshare/rsgxsflags.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2012-2018 by Retroshare Team * + * Copyright 2012-2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/retroshare/rsgxsservice.h b/libretroshare/src/retroshare/rsgxsservice.h index 9e217a04a..aab18b60b 100644 --- a/libretroshare/src/retroshare/rsgxsservice.h +++ b/libretroshare/src/retroshare/rsgxsservice.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2015 Retroshare Team * + * Copyright (C) 2015 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/retroshare/rsversion.h b/libretroshare/src/retroshare/rsversion.h index ca7b82c78..8452cbec8 100644 --- a/libretroshare/src/retroshare/rsversion.h +++ b/libretroshare/src/retroshare/rsversion.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2012-2018 by Retroshare Team * + * Copyright 2012-2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/rsserver/p3face-info.cc b/libretroshare/src/rsserver/p3face-info.cc index e3478aa4e..2b027e15b 100644 --- a/libretroshare/src/rsserver/p3face-info.cc +++ b/libretroshare/src/rsserver/p3face-info.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2015 by RetroShare Team * + * Copyright 2015 by RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/rsserver/p3face-server.cc b/libretroshare/src/rsserver/p3face-server.cc index 6d9581bc7..40bc1c452 100644 --- a/libretroshare/src/rsserver/p3face-server.cc +++ b/libretroshare/src/rsserver/p3face-server.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2015 by Robert Fernie * + * Copyright 2015 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/rsserver/rsloginhandler.cc b/libretroshare/src/rsserver/rsloginhandler.cc index 96c72bf4d..8a0469e1d 100644 --- a/libretroshare/src/rsserver/rsloginhandler.cc +++ b/libretroshare/src/rsserver/rsloginhandler.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2018 retroshare team * + * Copyright 2018 retroshare team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/rsserver/rstypes.cc b/libretroshare/src/rsserver/rstypes.cc index 1e6ec33ab..0dd06b956 100644 --- a/libretroshare/src/rsserver/rstypes.cc +++ b/libretroshare/src/rsserver/rstypes.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2004-2006 by Robert Fernie * + * Copyright 2004-2006 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/tcponudp/rsudpstack.h b/libretroshare/src/tcponudp/rsudpstack.h index e72e67f5e..77c25692c 100644 --- a/libretroshare/src/tcponudp/rsudpstack.h +++ b/libretroshare/src/tcponudp/rsudpstack.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2012-2012 by Robert Fernie * + * Copyright 2012-2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/upnp/upnphandler_linux.cc b/libretroshare/src/upnp/upnphandler_linux.cc index 4e6c344fb..943e62d7a 100644 --- a/libretroshare/src/upnp/upnphandler_linux.cc +++ b/libretroshare/src/upnp/upnphandler_linux.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2007-2018 Retroshare Team * + * Copyright 2007-2018 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/upnp/upnphandler_linux.h b/libretroshare/src/upnp/upnphandler_linux.h index 741adfc47..13aa83335 100644 --- a/libretroshare/src/upnp/upnphandler_linux.h +++ b/libretroshare/src/upnp/upnphandler_linux.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2007-2018 Retroshare Team * + * Copyright 2007-2018 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/upnp/upnphandler_miniupnp.cc b/libretroshare/src/upnp/upnphandler_miniupnp.cc index f264d80a7..316e23748 100644 --- a/libretroshare/src/upnp/upnphandler_miniupnp.cc +++ b/libretroshare/src/upnp/upnphandler_miniupnp.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2007-2018 Retroshare Team * + * Copyright 2007-2018 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/upnp/upnphandler_miniupnp.h b/libretroshare/src/upnp/upnphandler_miniupnp.h index 1f3c33378..e1616a0b9 100644 --- a/libretroshare/src/upnp/upnphandler_miniupnp.h +++ b/libretroshare/src/upnp/upnphandler_miniupnp.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2007-2018 Retroshare Team * + * Copyright 2007-2018 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/dnsresolver.cc b/libretroshare/src/util/dnsresolver.cc index 58d360027..3b68a052e 100644 --- a/libretroshare/src/util/dnsresolver.cc +++ b/libretroshare/src/util/dnsresolver.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2017 Retroshare Team * + * Copyright (C) 2017 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/dnsresolver.h b/libretroshare/src/util/dnsresolver.h index a85c6cfb1..1315dc223 100644 --- a/libretroshare/src/util/dnsresolver.h +++ b/libretroshare/src/util/dnsresolver.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2017 Retroshare Team * + * Copyright (C) 2017 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/extaddrfinder.cc b/libretroshare/src/util/extaddrfinder.cc index 034fef58d..315d4f650 100644 --- a/libretroshare/src/util/extaddrfinder.cc +++ b/libretroshare/src/util/extaddrfinder.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2017 Retroshare Team * + * Copyright (C) 2017 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/extaddrfinder.h b/libretroshare/src/util/extaddrfinder.h index d0f1db97b..d6f1d687d 100644 --- a/libretroshare/src/util/extaddrfinder.h +++ b/libretroshare/src/util/extaddrfinder.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2017 Retroshare Team * + * Copyright (C) 2017 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/folderiterator.cc b/libretroshare/src/util/folderiterator.cc index 3a390af75..c67204fc6 100644 --- a/libretroshare/src/util/folderiterator.cc +++ b/libretroshare/src/util/folderiterator.cc @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2017 Retroshare Team * + * Copyright (C) 2017 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/folderiterator.h b/libretroshare/src/util/folderiterator.h index 9117107c3..19cbb8e9c 100644 --- a/libretroshare/src/util/folderiterator.h +++ b/libretroshare/src/util/folderiterator.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2017 Retroshare Team * + * Copyright (C) 2017 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/radix32.h b/libretroshare/src/util/radix32.h index af5fef3ec..46219da17 100644 --- a/libretroshare/src/util/radix32.h +++ b/libretroshare/src/util/radix32.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2015 Retroshare Team * + * Copyright (C) 2015 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/radix64.h b/libretroshare/src/util/radix64.h index 470186a02..82a5af9d3 100644 --- a/libretroshare/src/util/radix64.h +++ b/libretroshare/src/util/radix64.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2015 Retroshare Team * + * Copyright (C) 2015 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/rsinitedptr.h b/libretroshare/src/util/rsinitedptr.h index 333a8af87..09aaa871a 100644 --- a/libretroshare/src/util/rsinitedptr.h +++ b/libretroshare/src/util/rsinitedptr.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2010-2010 by Retroshare Team * + * Copyright 2010-2010 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/libretroshare/src/util/rsstd.h b/libretroshare/src/util/rsstd.h index 8a41a3270..2cf3ae31d 100644 --- a/libretroshare/src/util/rsstd.h +++ b/libretroshare/src/util/rsstd.h @@ -3,7 +3,7 @@ * * * libretroshare: retroshare core library * * * - * Copyright (C) 2015 Retroshare Team * + * Copyright (C) 2015 Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * diff --git a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp index d304ce5c3..038a62ae1 100644 --- a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h index cdcb4f6ee..28b8e8df1 100644 --- a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h @@ -1,7 +1,7 @@ /******************************************************************************* * retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.h * * * - * Copyright 2018 by Retroshare Team * + * Copyright 2018 by Retroshare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp b/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp index 789fcba15..e1f517f42 100644 --- a/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp +++ b/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSImageBlockWidget.cpp * * * - * Copyright (C) 2013 RetroShare Team * + * Copyright (C) 2013 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSImageBlockWidget.h b/retroshare-gui/src/gui/common/RSImageBlockWidget.h index 6d9b895ed..4396bc4e1 100644 --- a/retroshare-gui/src/gui/common/RSImageBlockWidget.h +++ b/retroshare-gui/src/gui/common/RSImageBlockWidget.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSImageBlockWidget.h * * * - * Copyright (C) 2013 RetroShare Team * + * Copyright (C) 2013 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSItemDelegate.cpp b/retroshare-gui/src/gui/common/RSItemDelegate.cpp index f0f2051f6..d94b24a0e 100644 --- a/retroshare-gui/src/gui/common/RSItemDelegate.cpp +++ b/retroshare-gui/src/gui/common/RSItemDelegate.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSItemDelegate.cpp * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSItemDelegate.h b/retroshare-gui/src/gui/common/RSItemDelegate.h index 04830196d..3eb056b21 100644 --- a/retroshare-gui/src/gui/common/RSItemDelegate.h +++ b/retroshare-gui/src/gui/common/RSItemDelegate.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSItemDelegate.h * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSListWidgetItem.cpp b/retroshare-gui/src/gui/common/RSListWidgetItem.cpp index 64ad1e2b2..320c1cfb4 100644 --- a/retroshare-gui/src/gui/common/RSListWidgetItem.cpp +++ b/retroshare-gui/src/gui/common/RSListWidgetItem.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSListWidgetItem.cpp * * * - * Copyright (C) 2012 RetroShare Team * + * Copyright (C) 2012 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSListWidgetItem.h b/retroshare-gui/src/gui/common/RSListWidgetItem.h index c3ac5ec3f..5fd50b6b9 100644 --- a/retroshare-gui/src/gui/common/RSListWidgetItem.h +++ b/retroshare-gui/src/gui/common/RSListWidgetItem.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSListWidgetItem.h * * * - * Copyright (C) 2012 RetroShare Team * + * Copyright (C) 2012 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp b/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp index 3009ae745..5ad36d63e 100644 --- a/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp +++ b/retroshare-gui/src/gui/common/RSPlainTextEdit.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSPlainTextEdit.cpp * * * - * Copyright (C) 2013 RetroShare Team * + * Copyright (C) 2013 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSPlainTextEdit.h b/retroshare-gui/src/gui/common/RSPlainTextEdit.h index ef0c3152a..a44c9d4cd 100644 --- a/retroshare-gui/src/gui/common/RSPlainTextEdit.h +++ b/retroshare-gui/src/gui/common/RSPlainTextEdit.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSPlainTextEdit.h * * * - * Copyright (C) 2013 RetroShare Team * + * Copyright (C) 2013 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTabWidget.cpp b/retroshare-gui/src/gui/common/RSTabWidget.cpp index 149822a5f..806d277fc 100644 --- a/retroshare-gui/src/gui/common/RSTabWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTabWidget.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTabWidget.cpp * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTabWidget.h b/retroshare-gui/src/gui/common/RSTabWidget.h index b8fb94a74..7789fc1de 100644 --- a/retroshare-gui/src/gui/common/RSTabWidget.h +++ b/retroshare-gui/src/gui/common/RSTabWidget.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTabWidget.h * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp index a8ed488d1..46053bb66 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp +++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTextBrowser.cpp * * * - * Copyright (C) 2018 RetroShare Team * + * Copyright (C) 2018 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.h b/retroshare-gui/src/gui/common/RSTextBrowser.h index 086889089..1434bbb72 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.h +++ b/retroshare-gui/src/gui/common/RSTextBrowser.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTextBrowser.h * * * - * Copyright (C) 2018 RetroShare Team * + * Copyright (C) 2018 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTextEdit.cpp b/retroshare-gui/src/gui/common/RSTextEdit.cpp index 2f7f68a8c..6fb67283f 100644 --- a/retroshare-gui/src/gui/common/RSTextEdit.cpp +++ b/retroshare-gui/src/gui/common/RSTextEdit.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTextEdit.cpp * * * - * Copyright (C) 2014 RetroShare Team * + * Copyright (C) 2014 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTextEdit.h b/retroshare-gui/src/gui/common/RSTextEdit.h index ca18df6df..20ac475b8 100644 --- a/retroshare-gui/src/gui/common/RSTextEdit.h +++ b/retroshare-gui/src/gui/common/RSTextEdit.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTextEdit.h * * * - * Copyright (C) 2014 RetroShare Team * + * Copyright (C) 2014 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTreeView.cpp b/retroshare-gui/src/gui/common/RSTreeView.cpp index c646b2a61..918fbc558 100644 --- a/retroshare-gui/src/gui/common/RSTreeView.cpp +++ b/retroshare-gui/src/gui/common/RSTreeView.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTreeView.cpp * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTreeView.h b/retroshare-gui/src/gui/common/RSTreeView.h index 5132854e4..022a643db 100644 --- a/retroshare-gui/src/gui/common/RSTreeView.h +++ b/retroshare-gui/src/gui/common/RSTreeView.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTreeView.h * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.cpp b/retroshare-gui/src/gui/common/RSTreeWidget.cpp index e38bc4bbb..9322535fe 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidget.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTreeWidget.cpp * * * - * Copyright (C) 2012 RetroShare Team * + * Copyright (C) 2012 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.h b/retroshare-gui/src/gui/common/RSTreeWidget.h index 76f77d0c2..e42024629 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.h +++ b/retroshare-gui/src/gui/common/RSTreeWidget.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTreeWidget.h * * * - * Copyright (C) 2012 RetroShare Team * + * Copyright (C) 2012 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp b/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp index 3fcfb580a..64fb1c861 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidgetItem.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTreeWidgetItem.cpp * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RSTreeWidgetItem.h b/retroshare-gui/src/gui/common/RSTreeWidgetItem.h index 7f685f635..37119890a 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidgetItem.h +++ b/retroshare-gui/src/gui/common/RSTreeWidgetItem.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSTreeWidgetItem.h * * * - * Copyright (C) 2010 RetroShare Team * + * Copyright (C) 2010 RetroShare Team * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-gui/src/gui/common/RsUrlHandler.h b/retroshare-gui/src/gui/common/RsUrlHandler.h index 691774b34..c00e5dbd1 100644 --- a/retroshare-gui/src/gui/common/RsUrlHandler.h +++ b/retroshare-gui/src/gui/common/RsUrlHandler.h @@ -1,7 +1,7 @@ /******************************************************************************* * gui/common/RSUrlHandler.h * * * - * Copyright (C) 2011 Cyril Soler * + * Copyright (C) 2011 Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/TerminalApiClient.cpp b/retroshare-nogui/src/TerminalApiClient.cpp index d29b0e059..a5dd888fb 100644 --- a/retroshare-nogui/src/TerminalApiClient.cpp +++ b/retroshare-nogui/src/TerminalApiClient.cpp @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2004-2006 by Robert Fernie * + * Copyright 2004-2006 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/TerminalApiClient.h b/retroshare-nogui/src/TerminalApiClient.h index fd423c59a..d7c2385a2 100644 --- a/retroshare-nogui/src/TerminalApiClient.h +++ b/retroshare-nogui/src/TerminalApiClient.h @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2004-2006 by Robert Fernie * + * Copyright 2004-2006 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/introserver.cc b/retroshare-nogui/src/introserver.cc index c263d75ae..15b438409 100644 --- a/retroshare-nogui/src/introserver.cc +++ b/retroshare-nogui/src/introserver.cc @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2012-2012 by Robert Fernie * + * Copyright 2012-2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/introserver.h b/retroshare-nogui/src/introserver.h index 1cf278005..d2ba5adde 100644 --- a/retroshare-nogui/src/introserver.h +++ b/retroshare-nogui/src/introserver.h @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2012-2012 by Robert Fernie * + * Copyright 2012-2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/notifytxt.cc b/retroshare-nogui/src/notifytxt.cc index 44bb267c5..3bd3f5065 100644 --- a/retroshare-nogui/src/notifytxt.cc +++ b/retroshare-nogui/src/notifytxt.cc @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2004-2006 by Robert Fernie * + * Copyright 2004-2006 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/notifytxt.h b/retroshare-nogui/src/notifytxt.h index b5174528c..08f402717 100644 --- a/retroshare-nogui/src/notifytxt.h +++ b/retroshare-nogui/src/notifytxt.h @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2004-2006 by Robert Fernie * + * Copyright 2004-2006 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/retroshare-nogui/src/retroshare.cc b/retroshare-nogui/src/retroshare.cc index 4b5307c50..7a88e72d1 100644 --- a/retroshare-nogui/src/retroshare.cc +++ b/retroshare-nogui/src/retroshare.cc @@ -3,7 +3,7 @@ * * * retroshare-nogui: headless version of retroshare * * * - * Copyright 2004-2006 by Robert Fernie * + * Copyright 2004-2006 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc b/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc index f090a861a..fdb42301e 100644 --- a/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc +++ b/tests/unittests/libretroshare/gxs/security/gxssecurity_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/gxs/security/gxssecurity_tests.cc * * * - * Copyright 2007-2008 by Cyril Soler * + * Copyright 2007-2008 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsbaseitem_test.cc b/tests/unittests/libretroshare/serialiser/rsbaseitem_test.cc index eca009978..45da5ef88 100644 --- a/tests/unittests/libretroshare/serialiser/rsbaseitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsbaseitem_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rsbaseitem_test.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc b/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc index c578cfa13..b4d4141ad 100644 --- a/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsgxsiditem_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rsgxsiditem_test.cc * * * - * Copyright 2007-2008 by Cyril Soler * + * Copyright 2007-2008 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc b/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc index 2d049f98d..50abee232 100644 --- a/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rsgxsupdateitem_test.cc * * * - * Copyright 2013 by Crispy * + * Copyright 2013 by Crispy * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc b/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc index c2b6a0360..51c3cb466 100644 --- a/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsmsgitem_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/msgitem_test.cc * * * - * Copyright 2010 by Christopher Evi-Parker * + * Copyright 2010 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc b/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc index 8950362f2..4446cb597 100644 --- a/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsnxsitems_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rsnxsitems_test.cc * * * - * Copyright 2010 by Christopher Evi-Parker * + * Copyright 2010 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc b/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc index 70b0de569..9729ef404 100644 --- a/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsstatusitem_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rsstatusitem_test.cc * * * - * Copyright 2010 by Christopher Evi-Parker * + * Copyright 2010 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rstlvutil.cc b/tests/unittests/libretroshare/serialiser/rstlvutil.cc index 53e6ede30..ccba1d298 100644 --- a/tests/unittests/libretroshare/serialiser/rstlvutil.cc +++ b/tests/unittests/libretroshare/serialiser/rstlvutil.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rstlvutil.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rstlvutil.h b/tests/unittests/libretroshare/serialiser/rstlvutil.h index 806e8e7d1..3de9d4343 100644 --- a/tests/unittests/libretroshare/serialiser/rstlvutil.h +++ b/tests/unittests/libretroshare/serialiser/rstlvutil.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rstlvutil.h * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/rsturtleitem_test.cc b/tests/unittests/libretroshare/serialiser/rsturtleitem_test.cc index 81b0db278..c96bcd042 100644 --- a/tests/unittests/libretroshare/serialiser/rsturtleitem_test.cc +++ b/tests/unittests/libretroshare/serialiser/rsturtleitem_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/rsturtleitems_test.cc * * * - * Copyright 2007-2008 by Cyril Soler * + * Copyright 2007-2008 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/support.cc b/tests/unittests/libretroshare/serialiser/support.cc index 95d049fea..4771937c0 100644 --- a/tests/unittests/libretroshare/serialiser/support.cc +++ b/tests/unittests/libretroshare/serialiser/support.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/support.cc * * * - * Copyright 2007-2008 by Christopher Evi-Parker * + * Copyright 2007-2008 by Christopher Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/support.h b/tests/unittests/libretroshare/serialiser/support.h index af6f8208b..18c7eed9a 100644 --- a/tests/unittests/libretroshare/serialiser/support.h +++ b/tests/unittests/libretroshare/serialiser/support.h @@ -1,8 +1,8 @@ /******************************************************************************* * unittests/libretroshare/serialiser/support.h * * * - * Copyright 2007-2008 by Christopher Evi-Parker * - * Copyright 2007-2008 by Cyril Soler * + * Copyright 2007-2008 by Christopher Evi-Parker * + * Copyright 2007-2008 by Cyril Soler * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvbase_test.cc b/tests/unittests/libretroshare/serialiser/tlvbase_test.cc index 6e887d2f3..2f01346f4 100644 --- a/tests/unittests/libretroshare/serialiser/tlvbase_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvbase_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvbase_test.cc * * * - * Copyright 2007-2008 by Horatio * + * Copyright 2007-2008 by Horatio * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvbase_test2.cc b/tests/unittests/libretroshare/serialiser/tlvbase_test2.cc index 8490a52ee..8270158c5 100644 --- a/tests/unittests/libretroshare/serialiser/tlvbase_test2.cc +++ b/tests/unittests/libretroshare/serialiser/tlvbase_test2.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvbase_test2.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvitems_test.cc b/tests/unittests/libretroshare/serialiser/tlvitems_test.cc index c111b1b66..03eb8f0ab 100644 --- a/tests/unittests/libretroshare/serialiser/tlvitems_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvitems_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvitems_test.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvkey_test.cc b/tests/unittests/libretroshare/serialiser/tlvkey_test.cc index 477e84ec0..85d59d5ae 100644 --- a/tests/unittests/libretroshare/serialiser/tlvkey_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvkey_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvkey_test.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvrandom_test.cc b/tests/unittests/libretroshare/serialiser/tlvrandom_test.cc index d9376bab1..060485654 100644 --- a/tests/unittests/libretroshare/serialiser/tlvrandom_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvrandom_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvrandom_test.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvstack_test.cc b/tests/unittests/libretroshare/serialiser/tlvstack_test.cc index 0353ecb06..8a2f3c904 100644 --- a/tests/unittests/libretroshare/serialiser/tlvstack_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvstack_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvstack_test.cc * * * - * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/serialiser/tlvtypes_test.cc b/tests/unittests/libretroshare/serialiser/tlvtypes_test.cc index e9d64c394..b2c2ffb82 100644 --- a/tests/unittests/libretroshare/serialiser/tlvtypes_test.cc +++ b/tests/unittests/libretroshare/serialiser/tlvtypes_test.cc @@ -1,8 +1,8 @@ /******************************************************************************* * unittests/libretroshare/serialiser/tlvtypes_test.cc * * * - * Copyright 2007-2008 by Robert Fernie * - * Copyright 2007-2008 by Chris Evi-Parker * + * Copyright 2007-2008 by Robert Fernie * + * Copyright 2007-2008 by Chris Evi-Parker * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc b/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc index 8a5bd9d4b..d24bcca4e 100644 --- a/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc +++ b/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/FakePgpAuxUtils.cc * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.h b/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.h index 467a3140c..0cb48dbff 100644 --- a/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.h +++ b/tests/unittests/libretroshare/services/gxs/FakePgpAuxUtils.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/FakePgpAuxUtils.h * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc index 845320383..23d60edb4 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.cc * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.h b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.h index ef52047a3..7397fc784 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.h +++ b/tests/unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/GxsIsolatedServiceTester.h * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc index 0ce816c37..d0a00a2e2 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/GxsPairServiceTester.cc * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.h b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.h index 6b75ad6e8..ff9cef0bc 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.h +++ b/tests/unittests/libretroshare/services/gxs/GxsPairServiceTester.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/GxsPairServiceTester.h * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc b/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc index 338e76975..f134cdffb 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc +++ b/tests/unittests/libretroshare/services/gxs/GxsPeerNode.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/GxsPeerNode.cc * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/GxsPeerNode.h b/tests/unittests/libretroshare/services/gxs/GxsPeerNode.h index d5d065399..6a2b0dd65 100644 --- a/tests/unittests/libretroshare/services/gxs/GxsPeerNode.h +++ b/tests/unittests/libretroshare/services/gxs/GxsPeerNode.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/GxsPeerNode.h * * * - * Copyright 2014 by Robert Fernie * + * Copyright 2014 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/gxstestservice.cc b/tests/unittests/libretroshare/services/gxs/gxstestservice.cc index afcafcec4..e30309942 100644 --- a/tests/unittests/libretroshare/services/gxs/gxstestservice.cc +++ b/tests/unittests/libretroshare/services/gxs/gxstestservice.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/gxstestservice.cc * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/gxstestservice.h b/tests/unittests/libretroshare/services/gxs/gxstestservice.h index fadd8a1a2..59a5070ef 100644 --- a/tests/unittests/libretroshare/services/gxs/gxstestservice.h +++ b/tests/unittests/libretroshare/services/gxs/gxstestservice.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/gxstestservice.h * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc b/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc index e5610f0ad..4c78e9ad9 100644 --- a/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc +++ b/tests/unittests/libretroshare/services/gxs/nxsbasic_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/nxsbasic_test.cc * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc b/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc index c6e429755..88e811b7f 100644 --- a/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc +++ b/tests/unittests/libretroshare/services/gxs/nxspair_tests.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/nxspair_test.cc * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc index 2ac1c9457..6378f779b 100644 --- a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc +++ b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/nxstestitems.cc * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h index 06aaf5b91..8fb79ba36 100644 --- a/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h +++ b/tests/unittests/libretroshare/services/gxs/rsgxstestitems.h @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/gxs/nxstestitems.h * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * diff --git a/tests/unittests/libretroshare/services/status/status_test.cc b/tests/unittests/libretroshare/services/status/status_test.cc index 7433dd189..5f47b04c9 100644 --- a/tests/unittests/libretroshare/services/status/status_test.cc +++ b/tests/unittests/libretroshare/services/status/status_test.cc @@ -1,7 +1,7 @@ /******************************************************************************* * unittests/libretroshare/services/status/status_test.cc * * * - * Copyright 2012 by Robert Fernie * + * Copyright 2012 by Robert Fernie * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * From a506c80d80d1360fd584ca79a9233af879543e3b Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 13 Nov 2018 22:02:26 +0100 Subject: [PATCH 016/110] fixed licenses in elastic+feeds --- .../src/gui/connect/ConfCertDialog.cpp | 39 ++++++------ .../src/gui/connect/ConfCertDialog.h | 40 ++++++------ .../src/gui/connect/ConnectFriendWizard.cpp | 40 ++++++------ .../src/gui/connect/ConnectFriendWizard.h | 20 ++++++ .../src/gui/connect/ConnectProgressDialog.cpp | 42 ++++++------- .../src/gui/connect/ConnectProgressDialog.h | 41 ++++++------- .../src/gui/connect/FriendRecommendDialog.cpp | 19 ++++++ .../src/gui/connect/FriendRecommendDialog.h | 20 ++++++ .../src/gui/connect/PGPKeyDialog.cpp | 39 ++++++------ retroshare-gui/src/gui/connect/PGPKeyDialog.h | 40 ++++++------ retroshare-gui/src/gui/elastic/arrow.cpp | 56 +++++++---------- retroshare-gui/src/gui/elastic/arrow.h | 56 +++++++---------- retroshare-gui/src/gui/elastic/edge.cpp | 61 +++++++------------ retroshare-gui/src/gui/elastic/edge.h | 61 +++++++------------ retroshare-gui/src/gui/elastic/elnode.cpp | 61 +++++++------------ retroshare-gui/src/gui/elastic/elnode.h | 61 +++++++------------ .../src/gui/elastic/graphwidget.cpp | 61 +++++++------------ retroshare-gui/src/gui/elastic/graphwidget.h | 61 +++++++------------ .../src/gui/feeds/AttachFileItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/AttachFileItem.h | 39 ++++++------ retroshare-gui/src/gui/feeds/ChatMsgItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/ChatMsgItem.h | 39 ++++++------ retroshare-gui/src/gui/feeds/FeedHolder.h | 39 ++++++------ retroshare-gui/src/gui/feeds/FeedItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/FeedItem.h | 39 ++++++------ .../src/gui/feeds/GxsChannelGroupItem.cpp | 39 ++++++------ .../src/gui/feeds/GxsChannelGroupItem.h | 39 ++++++------ .../src/gui/feeds/GxsChannelPostItem.cpp | 41 ++++++------- .../src/gui/feeds/GxsChannelPostItem.h | 41 ++++++------- .../src/gui/feeds/GxsCircleItem.cpp | 41 ++++++------- retroshare-gui/src/gui/feeds/GxsCircleItem.h | 41 ++++++------- .../src/gui/feeds/GxsForumGroupItem.cpp | 39 ++++++------ .../src/gui/feeds/GxsForumGroupItem.h | 39 ++++++------ .../src/gui/feeds/GxsForumMsgItem.cpp | 41 ++++++------- .../src/gui/feeds/GxsForumMsgItem.h | 41 ++++++------- retroshare-gui/src/gui/feeds/MsgItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/MsgItem.h | 39 ++++++------ .../src/gui/feeds/NewsFeedUserNotify.cpp | 39 ++++++------ .../src/gui/feeds/NewsFeedUserNotify.h | 39 ++++++------ retroshare-gui/src/gui/feeds/PeerItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/PeerItem.h | 39 ++++++------ .../src/gui/feeds/PostedGroupItem.cpp | 39 ++++++------ .../src/gui/feeds/PostedGroupItem.h | 39 ++++++------ .../src/gui/feeds/SecurityIpItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/SecurityIpItem.h | 39 ++++++------ retroshare-gui/src/gui/feeds/SecurityItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/SecurityItem.h | 39 ++++++------ retroshare-gui/src/gui/feeds/SubFileItem.cpp | 39 ++++++------ retroshare-gui/src/gui/feeds/SubFileItem.h | 39 ++++++------ 49 files changed, 950 insertions(+), 1089 deletions(-) diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index e302cf02c..907e765cf 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/connect/ConfCertDialog.cpp * + * * + * Copyright (C) 2006 Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "ConfCertDialog.h" diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.h b/retroshare-gui/src/gui/connect/ConfCertDialog.h index 642fcbb56..a52ac3cdb 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.h +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.h @@ -1,24 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/connect/ConfCertDialog.h * + * * + * Copyright (C) 2006 Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _CONFCERTDIALOG_H #define _CONFCERTDIALOG_H diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index 71f2fe5b3..806817e99 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -1,23 +1,23 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2009 The RetroShare Team, Oleksiy Bilyanskyy - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/connect/ConnectFriendWizard.cpp * + * * + * Copyright (C) 2009 retroshare team * + * Copyright (C) 2009 Oleksiy Bilyanskyy * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.h b/retroshare-gui/src/gui/connect/ConnectFriendWizard.h index 1571dbb2c..6d9a74e57 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.h +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/connect/ConnectFriendWizard.h * + * * + * Copyright (C) 2018 retroshare team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef CONNECTFRIENDWIZARD_H #define CONNECTFRIENDWIZARD_H diff --git a/retroshare-gui/src/gui/connect/ConnectProgressDialog.cpp b/retroshare-gui/src/gui/connect/ConnectProgressDialog.cpp index c243006d4..580e1144e 100755 --- a/retroshare-gui/src/gui/connect/ConnectProgressDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConnectProgressDialog.cpp @@ -1,26 +1,22 @@ -/* - * Connect Progress Dialog - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - +/******************************************************************************* + * gui/connect/ConnectProgressDialog.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gui/connect/ConnectProgressDialog.h" diff --git a/retroshare-gui/src/gui/connect/ConnectProgressDialog.h b/retroshare-gui/src/gui/connect/ConnectProgressDialog.h index 8620bd93b..61951474c 100644 --- a/retroshare-gui/src/gui/connect/ConnectProgressDialog.h +++ b/retroshare-gui/src/gui/connect/ConnectProgressDialog.h @@ -1,25 +1,22 @@ -/* - * Connect Progress Dialog - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/connect/ConnectProgressDialog.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _CONNECT_PROGRESS_DIALOG_H #define _CONNECT_PROGRESS_DIALOG_H diff --git a/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp b/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp index d4140a939..7507f2b2b 100644 --- a/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp +++ b/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp @@ -1,3 +1,22 @@ +/******************************************************************************* + * gui/connect/FriendRecommendDialog.cpp * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "FriendRecommendDialog.h" diff --git a/retroshare-gui/src/gui/connect/FriendRecommendDialog.h b/retroshare-gui/src/gui/connect/FriendRecommendDialog.h index c364e12eb..6ffafd343 100644 --- a/retroshare-gui/src/gui/connect/FriendRecommendDialog.h +++ b/retroshare-gui/src/gui/connect/FriendRecommendDialog.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * gui/connect/FriendRecommendDialog.h * + * * + * Copyright 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once #include diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index a9e67585b..d27e779fd 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/connect/PGPKeyDialog.cpp * + * * + * Copyright 2006 by Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PGPKeyDialog.h" diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.h b/retroshare-gui/src/gui/connect/PGPKeyDialog.h index b9188c6c5..ed414960c 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.h +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.h @@ -1,24 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * gui/connect/PGPKeyDialog.h * + * * + * Copyright 2006 by Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once diff --git a/retroshare-gui/src/gui/elastic/arrow.cpp b/retroshare-gui/src/gui/elastic/arrow.cpp index f9fc8a95b..6a95f2041 100644 --- a/retroshare-gui/src/gui/elastic/arrow.cpp +++ b/retroshare-gui/src/gui/elastic/arrow.cpp @@ -1,38 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2006-2007 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License version 2.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of -** this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/ -** -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.0, which can be found at -** http://www.trolltech.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. -** -** In addition, as a special exception, Trolltech, as the sole copyright -** holder for Qt Designer, grants users of the Qt/Eclipse Integration -** plug-in the right for the Qt/Eclipse Integration to link to -** functionality provided by Qt Designer and its related libraries. -** -** Trolltech reserves all rights not expressly granted herein. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/arrow.cpp * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-arrow-cpp.html #include diff --git a/retroshare-gui/src/gui/elastic/arrow.h b/retroshare-gui/src/gui/elastic/arrow.h index 9bcbc170e..a3ab003f1 100644 --- a/retroshare-gui/src/gui/elastic/arrow.h +++ b/retroshare-gui/src/gui/elastic/arrow.h @@ -1,38 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2006-2007 Trolltech ASA. All rights reserved. -** -** This file is part of the example classes of the Qt Toolkit. -** -** This file may be used under the terms of the GNU General Public -** License version 2.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of -** this file. Please review the following information to ensure GNU -** General Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/ -** -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** In addition, as a special exception, Trolltech gives you certain -** additional rights. These rights are described in the Trolltech GPL -** Exception version 1.0, which can be found at -** http://www.trolltech.com/products/qt/gplexception/ and in the file -** GPL_EXCEPTION.txt in this package. -** -** In addition, as a special exception, Trolltech, as the sole copyright -** holder for Qt Designer, grants users of the Qt/Eclipse Integration -** plug-in the right for the Qt/Eclipse Integration to link to -** functionality provided by Qt Designer and its related libraries. -** -** Trolltech reserves all rights not expressly granted herein. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/arrow.h * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-arrow-h.html #ifndef ARROW_H #define ARROW_H diff --git a/retroshare-gui/src/gui/elastic/edge.cpp b/retroshare-gui/src/gui/elastic/edge.cpp index cee1e1e88..0fd8707d2 100644 --- a/retroshare-gui/src/gui/elastic/edge.cpp +++ b/retroshare-gui/src/gui/elastic/edge.cpp @@ -1,43 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the example classes of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/edge.cpp * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-edge-cpp.html #include diff --git a/retroshare-gui/src/gui/elastic/edge.h b/retroshare-gui/src/gui/elastic/edge.h index 4a2cc0cd9..dbf8b7d4c 100644 --- a/retroshare-gui/src/gui/elastic/edge.h +++ b/retroshare-gui/src/gui/elastic/edge.h @@ -1,43 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the example classes of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/edge.h * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-edge-h.html #ifndef EDGE_H #define EDGE_H diff --git a/retroshare-gui/src/gui/elastic/elnode.cpp b/retroshare-gui/src/gui/elastic/elnode.cpp index 99bbfd310..0fef49cba 100644 --- a/retroshare-gui/src/gui/elastic/elnode.cpp +++ b/retroshare-gui/src/gui/elastic/elnode.cpp @@ -1,43 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the example classes of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/elnode.cpp * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-node-cpp.html #include diff --git a/retroshare-gui/src/gui/elastic/elnode.h b/retroshare-gui/src/gui/elastic/elnode.h index 6e59cf43d..1e0edd1a8 100644 --- a/retroshare-gui/src/gui/elastic/elnode.h +++ b/retroshare-gui/src/gui/elastic/elnode.h @@ -1,43 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the example classes of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/elnode.h * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-node-h.html #ifndef ELNODE_H #define ELNODE_H diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index aa8cbf241..d0f90050f 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -1,43 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the example classes of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/graphwidget.cpp * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-graphwidget-cpp.html #include "graphwidget.h" #include "edge.h" diff --git a/retroshare-gui/src/gui/elastic/graphwidget.h b/retroshare-gui/src/gui/elastic/graphwidget.h index 4a7a6a340..a4a975455 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.h +++ b/retroshare-gui/src/gui/elastic/graphwidget.h @@ -1,43 +1,24 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the example classes of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ +/******************************************************************************* + * gui/elastic/graphwidget.h * + * * + * Copyright (c) 2012, RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-graphwidget-h.html #ifndef GRAPHWIDGET_H #define GRAPHWIDGET_H diff --git a/retroshare-gui/src/gui/feeds/AttachFileItem.cpp b/retroshare-gui/src/gui/feeds/AttachFileItem.cpp index e5ade18f4..af150edc3 100644 --- a/retroshare-gui/src/gui/feeds/AttachFileItem.cpp +++ b/retroshare-gui/src/gui/feeds/AttachFileItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/AttachFileItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/feeds/AttachFileItem.h b/retroshare-gui/src/gui/feeds/AttachFileItem.h index 5dd23aed2..afe32e0e1 100644 --- a/retroshare-gui/src/gui/feeds/AttachFileItem.h +++ b/retroshare-gui/src/gui/feeds/AttachFileItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/AttachFileItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _ATTACH_FILE_ITEM_DIALOG_H #define _ATTACH_FILE_ITEM_DIALOG_H diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp index 0a4637b08..ee7aa5ca8 100644 --- a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/ChatMsgItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.h b/retroshare-gui/src/gui/feeds/ChatMsgItem.h index b96b99ffa..bdfc343fe 100644 --- a/retroshare-gui/src/gui/feeds/ChatMsgItem.h +++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/ChatMsgItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _CHATMSG_ITEM_DIALOG_H #define _CHATMSG_ITEM_DIALOG_H diff --git a/retroshare-gui/src/gui/feeds/FeedHolder.h b/retroshare-gui/src/gui/feeds/FeedHolder.h index 44b07777b..f683bca19 100644 --- a/retroshare-gui/src/gui/feeds/FeedHolder.h +++ b/retroshare-gui/src/gui/feeds/FeedHolder.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/FeedHolder.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _FEED_HOLDER_H #define _FEED_HOLDER_H diff --git a/retroshare-gui/src/gui/feeds/FeedItem.cpp b/retroshare-gui/src/gui/feeds/FeedItem.cpp index 119eac658..19cfdbf72 100644 --- a/retroshare-gui/src/gui/feeds/FeedItem.cpp +++ b/retroshare-gui/src/gui/feeds/FeedItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/FeedItem.cpp * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "FeedItem.h" diff --git a/retroshare-gui/src/gui/feeds/FeedItem.h b/retroshare-gui/src/gui/feeds/FeedItem.h index 946ff566f..04adc9381 100644 --- a/retroshare-gui/src/gui/feeds/FeedItem.h +++ b/retroshare-gui/src/gui/feeds/FeedItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/FeedItem.h * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _FEED_ITEM_H #define _FEED_ITEM_H diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index 9d80244c6..4d0b33c8f 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/GxsChannelGroupItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsChannelGroupItem.h" #include "ui_GxsChannelGroupItem.h" diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h index a3c82f0ef..5a307d522 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/GxsChannelGroupItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSCHANNELGROUPITEM_H #define _GXSCHANNELGROUPITEM_H diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 72317640c..c6c301c46 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/feeds/GxsChannelPostItem.cpp * + * * + * Copyright (c) 2012, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index 1a87a7491..8f045c2d9 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/feeds/GxsChannelPostItem.h * + * * + * Copyright (c) 2012, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_CHANNEL_POST_ITEM_H #define _GXS_CHANNEL_POST_ITEM_H diff --git a/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp b/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp index c130e1031..3fd34d1cb 100644 --- a/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsCircleItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2014 RetroShare Team - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/feeds/GxsCircleItem.cpp * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsCircleItem.h" #include "ui_GxsCircleItem.h" diff --git a/retroshare-gui/src/gui/feeds/GxsCircleItem.h b/retroshare-gui/src/gui/feeds/GxsCircleItem.h index 760df3db2..a08adb8c1 100644 --- a/retroshare-gui/src/gui/feeds/GxsCircleItem.h +++ b/retroshare-gui/src/gui/feeds/GxsCircleItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2014 RetroShare Team - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/feeds/GxsCircleItem.h * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSCIRCLEITEM_H #define _GXSCIRCLEITEM_H diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp index 346953f95..e73f08ca6 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/GxsForumGroupItem.cpp * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsForumGroupItem.h" #include "ui_GxsForumGroupItem.h" diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h index 7463553a5..19e438b69 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/GxsForumGroupItem.h * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSFORUMGROUPITEM_H #define _GXSFORUMGROUPITEM_H diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index b02afa336..d6081bbd8 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2014 RetroShare Team - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/feeds/GxsForumMsgItem.cpp * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h index 19b98bc4a..ff152f92b 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2014 RetroShare Team - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * gui/feeds/GxsForumMsgItem.h * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSFORUMMSGITEM_H #define _GXSFORUMMSGITEM_H diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index 97570a537..3e4ae3bb6 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/MsgItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/MsgItem.h b/retroshare-gui/src/gui/feeds/MsgItem.h index 3c5ad6c99..6aa595767 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.h +++ b/retroshare-gui/src/gui/feeds/MsgItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/MsgItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _MSG_ITEM_DIALOG_H #define _MSG_ITEM_DIALOG_H diff --git a/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp b/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp index b6de18092..e089aa946 100644 --- a/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp +++ b/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/NewsFeedUserNotify.cpp * + * * + * Copyright (c) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "NewsFeedUserNotify.h" #include "gui/NewsFeed.h" diff --git a/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.h b/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.h index a60050380..081053593 100644 --- a/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.h +++ b/retroshare-gui/src/gui/feeds/NewsFeedUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/NewsFeedUserNotify.h * + * * + * Copyright (c) 2012, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef NEWSFEEDUSERNOTIFY_H #define NEWSFEEDUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/feeds/PeerItem.cpp b/retroshare-gui/src/gui/feeds/PeerItem.cpp index 3eddd5718..0c0c1d057 100644 --- a/retroshare-gui/src/gui/feeds/PeerItem.cpp +++ b/retroshare-gui/src/gui/feeds/PeerItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/PeerItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/PeerItem.h b/retroshare-gui/src/gui/feeds/PeerItem.h index 9bccaeb1c..d048ff8d5 100644 --- a/retroshare-gui/src/gui/feeds/PeerItem.h +++ b/retroshare-gui/src/gui/feeds/PeerItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/PeerItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _PEER_ITEM_DIALOG_H #define _PEER_ITEM_DIALOG_H diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index 6ad6b9e1e..97c97c195 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/PostedGroupItem.cpp * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PostedGroupItem.h" #include "ui_PostedGroupItem.h" diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.h b/retroshare-gui/src/gui/feeds/PostedGroupItem.h index a3d4f3ff3..3b66afbcb 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.h +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/PostedGroupItem.h * + * * + * Copyright (c) 2014, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _POSTEDGROUPITEM_H #define _POSTEDGROUPITEM_H diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp index be2d2cc19..969440a8c 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/SecurityIpItem.cpp * + * * + * Copyright (c) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.h b/retroshare-gui/src/gui/feeds/SecurityIpItem.h index 93f6a4c26..2dc9dc0ca 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.h +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/SecurityIpItem.h * + * * + * Copyright (c) 2015, Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _SECURITYIPITEM_H #define _SECURITYIPITEM_H diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index 22e17c827..6a3f169ec 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/SecurityItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.h b/retroshare-gui/src/gui/feeds/SecurityItem.h index 5dd6ecc58..2af4af4a1 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.h +++ b/retroshare-gui/src/gui/feeds/SecurityItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/SecurityItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _SECURITY_ITEM_DIALOG_H #define _SECURITY_ITEM_DIALOG_H diff --git a/retroshare-gui/src/gui/feeds/SubFileItem.cpp b/retroshare-gui/src/gui/feeds/SubFileItem.cpp index 3b6ec3896..0f542db21 100644 --- a/retroshare-gui/src/gui/feeds/SubFileItem.cpp +++ b/retroshare-gui/src/gui/feeds/SubFileItem.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/SubFileItem.cpp * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/feeds/SubFileItem.h b/retroshare-gui/src/gui/feeds/SubFileItem.h index 1228c9b88..23f8e0f67 100644 --- a/retroshare-gui/src/gui/feeds/SubFileItem.h +++ b/retroshare-gui/src/gui/feeds/SubFileItem.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * gui/feeds/SubFileItem.h * + * * + * Copyright (c) 2008, Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _SUB_FILE_ITEM_DIALOG_H #define _SUB_FILE_ITEM_DIALOG_H From 6d09493725b4689335b8e8f33085fe6101da59f6 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 14 Nov 2018 20:20:27 +0100 Subject: [PATCH 017/110] fixed overloading names for functions that are not supposed to be overloading in turtleClientService and ftServer --- libretroshare/src/ft/ftserver.cc | 2 +- libretroshare/src/ft/ftserver.h | 2 +- libretroshare/src/turtle/p3turtle.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 4ea44ab6f..906bae6f1 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1827,7 +1827,7 @@ int ftServer::handleIncoming() ********************************** *********************************/ -void ftServer::receiveSearchResult(RsTurtleFTSearchResultItem *item) +void ftServer::ftReceiveSearchResult(RsTurtleFTSearchResultItem *item) { bool hasCallback = false; diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index d93341035..2094459a1 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -98,7 +98,7 @@ public: uint16_t serviceId() const { return RS_SERVICE_TYPE_FILE_TRANSFER ; } virtual bool handleTunnelRequest(const RsFileHash& hash,const RsPeerId& peer_id) ; virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; - virtual void receiveSearchResult(RsTurtleFTSearchResultItem *item); + virtual void ftReceiveSearchResult(RsTurtleFTSearchResultItem *item); // We dont use TurtleClientService::receiveSearchResult() because of backward compatibility. virtual RsItem *create_item(uint16_t service,uint8_t item_type) const ; virtual RsServiceSerializer *serializer() { return this ; } diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index 2e4b5a635..3e5cbb3db 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1220,7 +1220,7 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) } //RsServer::notify()->notifyTurtleSearchResult(ftsr->request_id,ftsr->result) ; - client->receiveSearchResult(ftsr); + client->ftReceiveSearchResult(ftsr); continue ; } From eb1909e8bcd2ce52cd23bc04936229cf0050fce8 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 14 Nov 2018 20:54:37 +0100 Subject: [PATCH 018/110] fixed licenses in FileTransfer --- .../src/gui/FileTransfer/DLListDelegate.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/DLListDelegate.h | 39 ++++++++-------- .../src/gui/FileTransfer/DetailsDialog.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/DetailsDialog.h | 39 ++++++++-------- .../FileTransfer/FileTransferInfoWidget.cpp | 43 +++++++++--------- .../gui/FileTransfer/FileTransferInfoWidget.h | 42 ++++++++--------- .../src/gui/FileTransfer/SearchDialog.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/SearchDialog.h | 39 ++++++++-------- .../gui/FileTransfer/SharedFilesDialog.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/SharedFilesDialog.h | 39 ++++++++-------- .../gui/FileTransfer/TransferUserNotify.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/TransferUserNotify.h | 39 ++++++++-------- .../src/gui/FileTransfer/TransfersDialog.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/TransfersDialog.h | 39 ++++++++-------- .../src/gui/FileTransfer/ULListDelegate.cpp | 39 ++++++++-------- .../src/gui/FileTransfer/ULListDelegate.h | 39 ++++++++-------- .../src/gui/FileTransfer/xprogressbar.cpp | 45 +++++++++---------- .../src/gui/FileTransfer/xprogressbar.h | 45 +++++++++---------- 18 files changed, 348 insertions(+), 373 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp index 66533a2c7..4385af476 100644 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp * + * * + * Copyright 2007 by Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h index 5321d6af2..3b67934fe 100644 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007,2008 crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/DLListDelegate.h * + * * + * Copyright 2007 by Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef DLLISTDELEGATE_H #define DLLISTDELEGATE_H diff --git a/retroshare-gui/src/gui/FileTransfer/DetailsDialog.cpp b/retroshare-gui/src/gui/FileTransfer/DetailsDialog.cpp index 73a905b0e..64faa77af 100644 --- a/retroshare-gui/src/gui/FileTransfer/DetailsDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DetailsDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006-2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/DetailsDialog.cpp * + * * + * Copyright 2010 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/DetailsDialog.h b/retroshare-gui/src/gui/FileTransfer/DetailsDialog.h index 8d1999102..392fe35cc 100644 --- a/retroshare-gui/src/gui/FileTransfer/DetailsDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/DetailsDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006-2010, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/DetailsDialog.h * + * * + * Copyright 2010 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _DETAILSDIALOG_H #define _DETAILSDIALOG_H diff --git a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp index a2889d2a0..e7aef654b 100644 --- a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp +++ b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp @@ -1,25 +1,24 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2010, csoler - * Copyright (c) 2009, defnax - * Copyright (c) 2009, lsn752 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp * + * * + * Copyright (c) 2009, defnax * + * Copyright (c) 2009, lsn752 * + * Copyright (c) 2010, csoler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h index 8d3338439..04e7a9856 100644 --- a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h +++ b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h @@ -1,25 +1,25 @@ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h * + * * + * Copyright (c) 2009, defnax * + * Copyright (c) 2009, lsn752 * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2009, defnax - * Copyright (c) 2009, lsn752 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index 20e5157da..b94dc2b6e 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp * + * * + * Copyright (c) 2006, Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.h b/retroshare-gui/src/gui/FileTransfer/SearchDialog.h index 001ae3903..c911b8084 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** -* RShare is distributed under the following license: -* -* Copyright (C) 2006, crypton -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, -* Boston, MA 02110-1301, USA. -****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/SearchDialog.h * + * * + * Copyright (c) 2006, Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _SEARCHDIALOG_H #define _SEARCHDIALOG_H diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 58effb773..a1a2f23a9 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp * + * * + * Copyright (c) 2009 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "SharedFilesDialog.h" diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.h b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.h index ae231ee93..5206e1d06 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006-2009, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.h * + * * + * Copyright (c) 2009 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _SHAREDFILESDIALOG_H #define _SHAREDFILESDIALOG_H diff --git a/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp b/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp index 2c0fc867d..e1bba6261 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/TransferUserNotify.cpp * + * * + * Copyright (c) 2012 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "TransferUserNotify.h" #include "gui/notifyqt.h" diff --git a/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.h b/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.h index 0ddaf1d50..527326a5a 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.h +++ b/retroshare-gui/src/gui/FileTransfer/TransferUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/TransferUserNotify.h * + * * + * Copyright (c) 2012 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef TRANSFERUSERNOTIFY_H #define TRANSFERUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index d2953cb22..7ec394e17 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp * + * * + * Copyright (c) 2007 Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h index 1e7b27814..b1e6b4faf 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/TransfersDialog.h * + * * + * Copyright (c) 2007 Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _TRANSFERSDIALOG_H #define _TRANSFERSDIALOG_H diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp index 7581761ac..c4c9bb90d 100644 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp * + * * + * Copyright (c) 2007 Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h index aed85ef68..24a7d66d1 100644 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/ULListDelegate.h * + * * + * Copyright (c) 2007 Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef ULLISTDELEGATE_H #define ULLISTDELEGATE_H diff --git a/retroshare-gui/src/gui/FileTransfer/xprogressbar.cpp b/retroshare-gui/src/gui/FileTransfer/xprogressbar.cpp index df100d0f9..9c603b4d8 100644 --- a/retroshare-gui/src/gui/FileTransfer/xprogressbar.cpp +++ b/retroshare-gui/src/gui/FileTransfer/xprogressbar.cpp @@ -1,28 +1,23 @@ -/* - * xProgressBar: A custom progress bar for Qt 4. - * Author: xEsk (Xesc & Technology 2008) - * - * Changelog: - * - * v1.0: - * ----- - * - First release - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/xprogressbar.cpp * + * * + * Copyright (c) xEsk (Xesc & Technology 2008) * + * Copyright (c) 2010 Retroshare Tram * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/FileTransfer/xprogressbar.h b/retroshare-gui/src/gui/FileTransfer/xprogressbar.h index 1f072f52a..a7f949101 100644 --- a/retroshare-gui/src/gui/FileTransfer/xprogressbar.h +++ b/retroshare-gui/src/gui/FileTransfer/xprogressbar.h @@ -1,28 +1,23 @@ -/* - * xProgressBar: A custom progress bar for Qt 4. - * Author: xEsk (Xesc & Technology 2008) - * - * Changelog: - * - * v1.0: - * ----- - * - First release - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/FileTransfer/xprogressbar.h * + * * + * Copyright (c) xEsk (Xesc & Technology 2008) * + * Copyright (c) 2010 Retroshare Tram * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef XPROGRESSBAR_H #define XPROGRESSBAR_H From 05bb002c70ec9899a3f36b0954b491e2b8f89c1f Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 14 Nov 2018 21:14:40 +0100 Subject: [PATCH 019/110] fixed licenses in gxs/ --- retroshare-gui/src/gui/groups/CreateGroup.cpp | 39 +++++++++-------- retroshare-gui/src/gui/groups/CreateGroup.h | 39 +++++++++-------- .../src/gui/gxs/GxsCircleChooser.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsCircleChooser.h | 42 +++++++++---------- retroshare-gui/src/gui/gxs/GxsCircleLabel.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsCircleLabel.h | 42 +++++++++---------- .../src/gui/gxs/GxsCommentContainer.cpp | 41 +++++++++--------- .../src/gui/gxs/GxsCommentContainer.h | 41 +++++++++--------- .../src/gui/gxs/GxsCommentDialog.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsCommentDialog.h | 41 +++++++++--------- .../src/gui/gxs/GxsCommentTreeWidget.cpp | 41 +++++++++--------- .../src/gui/gxs/GxsCommentTreeWidget.h | 41 +++++++++--------- .../src/gui/gxs/GxsCreateCommentDialog.cpp | 42 +++++++++---------- .../src/gui/gxs/GxsCreateCommentDialog.h | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsFeedItem.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsFeedItem.h | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsFeedWidget.cpp | 39 +++++++++-------- retroshare-gui/src/gui/gxs/GxsFeedWidget.h | 39 +++++++++-------- retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsGroupDialog.h | 41 +++++++++--------- .../src/gui/gxs/GxsGroupFeedItem.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h | 41 +++++++++--------- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 39 +++++++++-------- .../src/gui/gxs/GxsGroupFrameDialog.h | 39 +++++++++-------- .../src/gui/gxs/GxsGroupShareKey.cpp | 39 +++++++++-------- retroshare-gui/src/gui/gxs/GxsGroupShareKey.h | 20 +++++++++ retroshare-gui/src/gui/gxs/GxsIdChooser.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsIdChooser.h | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsIdDetails.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsIdDetails.h | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsIdLabel.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/GxsIdLabel.h | 41 +++++++++--------- .../src/gui/gxs/GxsIdTreeWidgetItem.cpp | 41 +++++++++--------- .../src/gui/gxs/GxsIdTreeWidgetItem.h | 41 +++++++++--------- .../src/gui/gxs/GxsMessageFramePostWidget.cpp | 39 +++++++++-------- .../src/gui/gxs/GxsMessageFramePostWidget.h | 39 +++++++++-------- .../src/gui/gxs/GxsMessageFrameWidget.cpp | 39 +++++++++-------- .../src/gui/gxs/GxsMessageFrameWidget.h | 39 +++++++++-------- retroshare-gui/src/gui/gxs/GxsUserNotify.cpp | 39 +++++++++-------- retroshare-gui/src/gui/gxs/GxsUserNotify.h | 39 +++++++++-------- .../src/gui/gxs/RsGxsUpdateBroadcastBase.cpp | 20 +++++++++ .../src/gui/gxs/RsGxsUpdateBroadcastBase.h | 20 +++++++++ .../src/gui/gxs/RsGxsUpdateBroadcastPage.cpp | 20 +++++++++ .../src/gui/gxs/RsGxsUpdateBroadcastPage.h | 20 +++++++++ .../gui/gxs/RsGxsUpdateBroadcastWidget.cpp | 20 +++++++++ .../src/gui/gxs/RsGxsUpdateBroadcastWidget.h | 20 +++++++++ .../src/gui/gxs/WikiGroupDialog.cpp | 41 +++++++++--------- retroshare-gui/src/gui/gxs/WikiGroupDialog.h | 42 +++++++++---------- 48 files changed, 919 insertions(+), 880 deletions(-) diff --git a/retroshare-gui/src/gui/groups/CreateGroup.cpp b/retroshare-gui/src/gui/groups/CreateGroup.cpp index 5756e7946..b7c01564d 100644 --- a/retroshare-gui/src/gui/groups/CreateGroup.cpp +++ b/retroshare-gui/src/gui/groups/CreateGroup.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2010 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/Groups/CreateGroup.cpp * + * * + * Copyright 2006-2010 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/groups/CreateGroup.h b/retroshare-gui/src/gui/groups/CreateGroup.h index 59d75dc42..99d63fd69 100644 --- a/retroshare-gui/src/gui/groups/CreateGroup.h +++ b/retroshare-gui/src/gui/groups/CreateGroup.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2010 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/Groups/CreateGroup.h * + * * + * Copyright 2006-2010 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _CREATEGROUP_H #define _CREATEGROUP_H diff --git a/retroshare-gui/src/gui/gxs/GxsCircleChooser.cpp b/retroshare-gui/src/gui/gxs/GxsCircleChooser.cpp index 2b9927dc8..bff6be150 100644 --- a/retroshare-gui/src/gui/gxs/GxsCircleChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCircleChooser.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCircleChooser.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsCircleChooser.h" diff --git a/retroshare-gui/src/gui/gxs/GxsCircleChooser.h b/retroshare-gui/src/gui/gxs/GxsCircleChooser.h index 474fbbc22..f78b350b8 100644 --- a/retroshare-gui/src/gui/gxs/GxsCircleChooser.h +++ b/retroshare-gui/src/gui/gxs/GxsCircleChooser.h @@ -1,26 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCircleChooser.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_CIRCLES_CHOOSER_H #define _GXS_CIRCLES_CHOOSER_H diff --git a/retroshare-gui/src/gui/gxs/GxsCircleLabel.cpp b/retroshare-gui/src/gui/gxs/GxsCircleLabel.cpp index ed1bfbb27..af0fe2ddc 100644 --- a/retroshare-gui/src/gui/gxs/GxsCircleLabel.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCircleLabel.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCircleLabel.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsCircleLabel.h" diff --git a/retroshare-gui/src/gui/gxs/GxsCircleLabel.h b/retroshare-gui/src/gui/gxs/GxsCircleLabel.h index 2ba4abe2f..1a0041fa6 100644 --- a/retroshare-gui/src/gui/gxs/GxsCircleLabel.h +++ b/retroshare-gui/src/gui/gxs/GxsCircleLabel.h @@ -1,26 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCircleLabel.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_CIRCLE_LABEL_H #define _GXS_CIRCLE_LABEL_H diff --git a/retroshare-gui/src/gui/gxs/GxsCommentContainer.cpp b/retroshare-gui/src/gui/gxs/GxsCommentContainer.cpp index 9f62a0359..c1590fba4 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentContainer.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentContainer.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Comment Container - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCommentContainer.cpp * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gui/gxs/GxsCommentContainer.h" #include "gui/gxs/GxsCommentDialog.h" diff --git a/retroshare-gui/src/gui/gxs/GxsCommentContainer.h b/retroshare-gui/src/gui/gxs/GxsCommentContainer.h index 6388891df..2c8c4fcfd 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentContainer.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentContainer.h @@ -1,25 +1,22 @@ -/* - * Retroshare Comment Container Dialog - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCommentContainer.h * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_COMMENT_CONTAINER_DIALOG_H #define MRK_COMMENT_CONTAINER_DIALOG_H diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index f846abc97..99f363f8d 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Comment Dialog - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gui/gxs/GxsCommentDialog.h" #include "ui_GxsCommentDialog.h" diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h index 7874168a3..1a6999880 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Comment Dialog - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCommentDialog.h * + * * + * Copyright 2012-2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_GXS_COMMENT_DIALOG_H #define MRK_GXS_COMMENT_DIALOG_H diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index 23a5327ed..40f007ba0 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h index e0cedc2f4..736a65092 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_COMMENT_TREE_WIDGET_H #define _GXS_COMMENT_TREE_WIDGET_H diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp index 500693df0..8895a4976 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp @@ -1,26 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsCreateCommentDialog.h" #include "ui_GxsCreateCommentDialog.h" diff --git a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h index 2c0100f50..d363156ed 100644 --- a/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsCreateCommentDialog.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _MRK_GXS_CREATE_COMMENT_DIALOG_H #define _MRK_GXS_CREATE_COMMENT_DIALOG_H diff --git a/retroshare-gui/src/gui/gxs/GxsFeedItem.cpp b/retroshare-gui/src/gui/gxs/GxsFeedItem.cpp index 2f036f900..98873445a 100644 --- a/retroshare-gui/src/gui/gxs/GxsFeedItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsFeedItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsFeedItem.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gui/gxs/GxsFeedItem.h" #include "gui/feeds/FeedHolder.h" diff --git a/retroshare-gui/src/gui/gxs/GxsFeedItem.h b/retroshare-gui/src/gui/gxs/GxsFeedItem.h index e2b4e5b1a..9b0fa9474 100644 --- a/retroshare-gui/src/gui/gxs/GxsFeedItem.h +++ b/retroshare-gui/src/gui/gxs/GxsFeedItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsFeedItem.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_GENERIC_FEED_ITEM_H #define _GXS_GENERIC_FEED_ITEM_H diff --git a/retroshare-gui/src/gui/gxs/GxsFeedWidget.cpp b/retroshare-gui/src/gui/gxs/GxsFeedWidget.cpp index 29a4d5f83..9ccaa55fa 100644 --- a/retroshare-gui/src/gui/gxs/GxsFeedWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsFeedWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsFeedItem.cpp * + * * + * Copyright 2015 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsFeedWidget.h" #include "gui/gxs/GxsFeedItem.h" diff --git a/retroshare-gui/src/gui/gxs/GxsFeedWidget.h b/retroshare-gui/src/gui/gxs/GxsFeedWidget.h index 983fa0587..4955144c6 100644 --- a/retroshare-gui/src/gui/gxs/GxsFeedWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsFeedWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2015, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsFeedItem.h * + * * + * Copyright 2015 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSFEEDTREEWIDGET_H #define _GXSFEEDTREEWIDGET_H diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index 062de1814..1bb448d60 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h index e5a5d5efe..09c96616a 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupDialog.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_GROUP_DIALOG_H #define _GXS_GROUP_DIALOG_H diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp index 1b3d0990e..59ff10056 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h index 9217c20a7..ac851a97d 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Feed Item - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_GROUPFEEDITEM_H #define _GXS_GROUPFEEDITEM_H diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 473b26e7d..3e5f5f76f 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h index 46ff05ec3..9fb1f38cc 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSGROUPFRAMEDIALOG_H #define _GXSGROUPFRAMEDIALOG_H diff --git a/retroshare-gui/src/gui/gxs/GxsGroupShareKey.cpp b/retroshare-gui/src/gui/gxs/GxsGroupShareKey.cpp index 4dc2c44e8..7b3ac7fee 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupShareKey.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupShareKey.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2010 Christopher Evi-Parker - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupShareKey.cpp * + * * + * Copyright 2010 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsGroupShareKey.h" diff --git a/retroshare-gui/src/gui/gxs/GxsGroupShareKey.h b/retroshare-gui/src/gui/gxs/GxsGroupShareKey.h index b37f88863..ed8df360a 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupShareKey.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupShareKey.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsGroupShareKey.h * + * * + * Copyright 2010 by Christopher Evi-Parker * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef SHAREKEY_H #define SHAREKEY_H diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp index 77d2b3621..0a49e7ede 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdChooser.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsIdChooser.h" #include "GxsIdDetails.h" diff --git a/retroshare-gui/src/gui/gxs/GxsIdChooser.h b/retroshare-gui/src/gui/gxs/GxsIdChooser.h index 8e339508d..a5a946e8d 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdChooser.h +++ b/retroshare-gui/src/gui/gxs/GxsIdChooser.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdChooser.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_ID_CHOOSER_H #define _GXS_ID_CHOOSER_H diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 52eabdae3..939b81708 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdDetails.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.h b/retroshare-gui/src/gui/gxs/GxsIdDetails.h index 39a6ad29d..6a48d73c5 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.h +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdDetails.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_ID_DETAILS_H #define _GXS_ID_DETAILS_H diff --git a/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp b/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp index 8cae5bce0..7cfd5565d 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdLabel.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdLabel.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsIdLabel.h" #include "GxsIdDetails.h" diff --git a/retroshare-gui/src/gui/gxs/GxsIdLabel.h b/retroshare-gui/src/gui/gxs/GxsIdLabel.h index 12a0376c9..03d68f6e7 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdLabel.h +++ b/retroshare-gui/src/gui/gxs/GxsIdLabel.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdLabel.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_ID_LABEL_H #define _GXS_ID_LABEL_H diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp index 660cd47e6..d01135577 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "rshare.h" #include "GxsIdTreeWidgetItem.h" diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h index e5c4002fd..edb8515e4 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_ID_TREEWIDGETITEM_H #define _GXS_ID_TREEWIDGETITEM_H diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp index f23dc83f2..bff646b01 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h index bebdae7cc..231134d13 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsMessageFramePostWidget.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSMESSAGEFRAMEPOSTWIDGET_H #define GXSMESSAGEFRAMEPOSTWIDGET_H diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp index 18db60fa2..4e8780435 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsMessageFrameWidget.h" #include "gui/common/UIStateHelper.h" diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h index a99aada3c..b99ad23d5 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h +++ b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSMESSAGEFRAMEWIDGET_H #define GXSMESSAGEFRAMEWIDGET_H diff --git a/retroshare-gui/src/gui/gxs/GxsUserNotify.cpp b/retroshare-gui/src/gui/gxs/GxsUserNotify.cpp index b01bae296..ec2e0b09a 100644 --- a/retroshare-gui/src/gui/gxs/GxsUserNotify.cpp +++ b/retroshare-gui/src/gui/gxs/GxsUserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsUserNotify.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsUserNotify.h" #include "gui/gxs/RsGxsUpdateBroadcastBase.h" diff --git a/retroshare-gui/src/gui/gxs/GxsUserNotify.h b/retroshare-gui/src/gui/gxs/GxsUserNotify.h index 52c36b923..174017803 100644 --- a/retroshare-gui/src/gui/gxs/GxsUserNotify.h +++ b/retroshare-gui/src/gui/gxs/GxsUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/GxsUserNotify.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSUSERNOTIFY_H #define GXSUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp index 76274b27a..633f3efd1 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include "RsGxsUpdateBroadcastBase.h" diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h index 704ff2157..afc62d686 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastBase.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once #include diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp index c0d19c56f..70a9a6fe5 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "RsGxsUpdateBroadcastPage.h" #include "RsGxsUpdateBroadcastBase.h" diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h index e3e9a4563..9efc5a8db 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once #include "mainpage.h" diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp index d3d1c5ec9..98c6354e1 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "RsGxsUpdateBroadcastWidget.h" #include "RsGxsUpdateBroadcastBase.h" diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h index f99a34d04..bb72a8205 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #pragma once #include diff --git a/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp b/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp index 1fe525500..fab246dd6 100644 --- a/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/WikiGroupDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.cpp * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "WikiGroupDialog.h" diff --git a/retroshare-gui/src/gui/gxs/WikiGroupDialog.h b/retroshare-gui/src/gui/gxs/WikiGroupDialog.h index 584ea6d0c..7d2687eb0 100644 --- a/retroshare-gui/src/gui/gxs/WikiGroupDialog.h +++ b/retroshare-gui/src/gui/gxs/WikiGroupDialog.h @@ -1,26 +1,22 @@ -/* - * Retroshare Gxs Support - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - +/******************************************************************************* + * retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h * + * * + * Copyright 2012-2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _WIKI_GROUP_DIALOG_H #define _WIKI_GROUP_DIALOG_H From ac2dacf51544b443f6eef58dcb8bb44f8620f568 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 15 Nov 2018 21:49:12 +0100 Subject: [PATCH 020/110] fixed licenses in gxsforums, gxschannels, im_history, msgs --- .../src/gui/Identity/IdDetailsDialog.cpp | 39 ++++++++------- .../src/gui/Identity/IdDetailsDialog.h | 39 ++++++++------- retroshare-gui/src/gui/Identity/IdDialog.cpp | 41 ++++++++-------- retroshare-gui/src/gui/Identity/IdDialog.h | 41 ++++++++-------- .../src/gui/Identity/IdEditDialog.cpp | 41 ++++++++-------- .../src/gui/Identity/IdEditDialog.h | 41 ++++++++-------- .../gui/gxschannels/CreateGxsChannelMsg.cpp | 39 ++++++++------- .../src/gui/gxschannels/CreateGxsChannelMsg.h | 39 ++++++++------- .../src/gui/gxschannels/GxsChannelDialog.cpp | 39 ++++++++------- .../src/gui/gxschannels/GxsChannelDialog.h | 39 ++++++++------- .../GxsChannelFilesStatusWidget.cpp | 39 ++++++++------- .../gxschannels/GxsChannelFilesStatusWidget.h | 39 ++++++++------- .../gui/gxschannels/GxsChannelFilesWidget.cpp | 39 ++++++++------- .../gui/gxschannels/GxsChannelFilesWidget.h | 39 ++++++++------- .../gui/gxschannels/GxsChannelGroupDialog.cpp | 39 ++++++++------- .../gui/gxschannels/GxsChannelGroupDialog.h | 39 ++++++++------- .../gui/gxschannels/GxsChannelPostsWidget.cpp | 39 ++++++++------- .../gui/gxschannels/GxsChannelPostsWidget.h | 39 ++++++++------- .../gui/gxschannels/GxsChannelUserNotify.cpp | 39 ++++++++------- .../gui/gxschannels/GxsChannelUserNotify.h | 39 ++++++++------- .../src/gui/gxsforums/CreateGxsForumMsg.cpp | 39 ++++++++------- .../src/gui/gxsforums/CreateGxsForumMsg.h | 39 ++++++++------- .../src/gui/gxsforums/GxsForumGroupDialog.cpp | 39 ++++++++------- .../src/gui/gxsforums/GxsForumGroupDialog.h | 39 ++++++++------- .../gui/gxsforums/GxsForumThreadWidget.cpp | 39 ++++++++------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 20 ++++++++ .../src/gui/gxsforums/GxsForumUserNotify.cpp | 39 ++++++++------- .../src/gui/gxsforums/GxsForumUserNotify.h | 39 ++++++++------- .../src/gui/gxsforums/GxsForumsDialog.cpp | 39 ++++++++------- .../src/gui/gxsforums/GxsForumsDialog.h | 39 ++++++++------- .../src/gui/gxsforums/GxsForumsFillThread.cpp | 39 ++++++++------- .../src/gui/gxsforums/GxsForumsFillThread.h | 20 ++++++++ .../src/gui/help/browser/helpbrowser.cpp | 41 ++++++++-------- .../src/gui/help/browser/helpbrowser.h | 41 ++++++++-------- .../src/gui/help/browser/helptextbrowser.cpp | 41 ++++++++-------- .../src/gui/help/browser/helptextbrowser.h | 41 ++++++++-------- .../gui/im_history/IMHistoryItemDelegate.cpp | 39 ++++++++------- .../gui/im_history/IMHistoryItemDelegate.h | 39 ++++++++------- .../gui/im_history/IMHistoryItemPainter.cpp | 39 ++++++++------- .../src/gui/im_history/IMHistoryItemPainter.h | 39 ++++++++------- .../src/gui/im_history/ImHistoryBrowser.cpp | 39 ++++++++------- .../src/gui/im_history/ImHistoryBrowser.h | 40 ++++++++-------- .../src/gui/images/retroshare_win.rc.h | 41 ++++++++-------- .../src/gui/msgs/MessageComposer.cpp | 39 ++++++++------- retroshare-gui/src/gui/msgs/MessageComposer.h | 39 ++++++++------- .../src/gui/msgs/MessageInterface.h | 20 ++++++++ .../src/gui/msgs/MessageUserNotify.cpp | 39 ++++++++------- .../src/gui/msgs/MessageUserNotify.h | 39 ++++++++------- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 39 ++++++++------- retroshare-gui/src/gui/msgs/MessageWidget.h | 39 ++++++++------- retroshare-gui/src/gui/msgs/MessageWindow.cpp | 39 ++++++++------- retroshare-gui/src/gui/msgs/MessageWindow.h | 39 ++++++++------- retroshare-gui/src/gui/msgs/TagsMenu.cpp | 39 ++++++++------- retroshare-gui/src/gui/msgs/TagsMenu.h | 39 ++++++++------- retroshare-gui/src/gui/msgs/textformat.h | 47 +++++++++---------- 55 files changed, 1055 insertions(+), 1060 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp index afc60ed09..98b8a0d91 100644 --- a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2015 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp * + * * + * Copyright (C) 2014 - 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "IdDetailsDialog.h" #include "ui_IdDetailsDialog.h" diff --git a/retroshare-gui/src/gui/Identity/IdDetailsDialog.h b/retroshare-gui/src/gui/Identity/IdDetailsDialog.h index 524275454..672cb764f 100644 --- a/retroshare-gui/src/gui/Identity/IdDetailsDialog.h +++ b/retroshare-gui/src/gui/Identity/IdDetailsDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 - 2010 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/Identity/IdDetailsDialog.h * + * * + * Copyright (C) 2014 - 2010 RetroShare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _IDDETAILSDIALOG_H #define _IDDETAILSDIALOG_H diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 563a1e1ab..30848f5bc 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Identity. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Identity/IdDialog.cpp * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/Identity/IdDialog.h b/retroshare-gui/src/gui/Identity/IdDialog.h index 1037510f1..dad6d7b1a 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.h +++ b/retroshare-gui/src/gui/Identity/IdDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Identity. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Identity/IdDialog.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef IDENTITYDIALOG_H #define IDENTITYDIALOG_H diff --git a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp index 8bddb1be6..d0b0d72ee 100644 --- a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Identity - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Identity/IdEditDialog.cpp * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/Identity/IdEditDialog.h b/retroshare-gui/src/gui/Identity/IdEditDialog.h index d97aee090..2bed1091b 100644 --- a/retroshare-gui/src/gui/Identity/IdEditDialog.h +++ b/retroshare-gui/src/gui/Identity/IdEditDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Identity. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Identity/IdEditDialog.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef IDEDITDIALOG_H #define IDEDITDIALOG_H diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp index 6d8105531..6ca6a4613 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.cpp * + * * + * Copyright 2008 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h index 3e9f6ccc6..bb8f15518 100644 --- a/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h +++ b/retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/CreateGxsChannelMsg.h * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _CREATE_GXSCHANNEL_MSG_H #define _CREATE_GXSCHANNEL_MSG_H diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 8090dc353..9e6bc6f88 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h index 43a81aca5..3f45a9df4 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelDialog.h * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_CHANNEL_DIALOG_H #define _GXS_CHANNEL_DIALOG_H diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp index b3170efa4..6dfe8a673 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.cpp * + * * + * Copyright 2014 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h index 6fd8b7607..1fc24437f 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelFilesStatusWidget.h * + * * + * Copyright 2014 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSCHANNELFILESSTATUSWIDGET_H #define GXSCHANNELFILESSTATUSWIDGET_H diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.cpp index c556a400e..fdb472e6d 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.cpp * + * * + * Copyright 2014 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.h b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.h index f9d5b25a2..044661b7d 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelFilesWidget.h * + * * + * Copyright 2014 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSCHANNELFILESWIDGET_H #define GXSCHANNELFILESWIDGET_H diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.cpp index c20c95c4d..b33c49b60 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.cpp * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.h b/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.h index dc9af67fb..c500912df 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2013 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelGroupDialog.h * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSCHANNEL_GROUP_DIALOG_H #define _GXSCHANNEL_GROUP_DIALOG_H diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index d238c7007..f51d1cc5f 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h index cfd442973..40160146c 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h * + * * + * Copyright 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXS_CHANNELPOSTSWIDGET_H #define _GXS_CHANNELPOSTSWIDGET_H diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.cpp index c20b54b08..63dde30f4 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelPostsUserNotify.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsChannelUserNotify.h" #include "gui/MainWindow.h" diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.h b/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.h index 516d56fd1..d36b92bd7 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxschannels/GxsChannelPostsUserNotify.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSCHANNELUSERNOTIFY_H #define GXSCHANNELUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp index 56d34659b..481797a34 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp * + * * + * Copyright 2013 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "CreateGxsForumMsg.h" diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h index fdf01deb8..3b551bda0 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.h * + * * + * Copyright 2013 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _CREATE_GXSFORUM_MSG_DIALOG_H #define _CREATE_GXSFORUM_MSG_DIALOG_H diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.cpp index fcc7b463b..168cfe463 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/CreateGxsForumGroupDialog.cpp * + * * + * Copyright 2013 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsForumGroupDialog.h" diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.h b/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.h index fcc2a2455..51ca29082 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumGroupDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/CreateGxsForumGroupDialog.h * + * * + * Copyright 2013 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSFORUM_GROUP_DIALOG_H #define _GXSFORUM_GROUP_DIALOG_H diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index e050c7ce2..d04d982c3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumsThreadWidget.cpp * + * * + * Copyright 2012 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 87b6ec445..40aa469cb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumsThreadWidget.h * + * * + * Copyright 2012 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef GXSFORUMTHREADWIDGET_H #define GXSFORUMTHREADWIDGET_H diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.cpp index 983c62f66..8a910659a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.cpp * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsForumUserNotify.h" #include "gui/MainWindow.h" diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.h b/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.h index 2bb2d3a7f..190f177e7 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumUserNotify.h * + * * + * Copyright 2014 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef GXSFORUMUSERNOTIFY_H #define GXSFORUMUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp index 38a57742f..3e868ee50 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumsDialog.cpp * + * * + * Copyright 2013 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "GxsForumsDialog.h" #include "GxsForumGroupDialog.h" diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.h b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.h index 2183a9000..39e182c88 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsDialog.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2008 Robert Fernie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumsDialog.h * + * * + * Copyright 2013 Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _GXSFORUMSDIALOG_H #define _GXSFORUMSDIALOG_H diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp index dca70d165..7545e4f07 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp * + * * + * Copyright 2012 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h index 2b5974855..76428f382 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h * + * * + * Copyright 2012 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef GXSFORUMSFILLTHREAD_H #define GXSFORUMSFILLTHREAD_H diff --git a/retroshare-gui/src/gui/help/browser/helpbrowser.cpp b/retroshare-gui/src/gui/help/browser/helpbrowser.cpp index 46f88da3c..b21ba2cc5 100644 --- a/retroshare-gui/src/gui/help/browser/helpbrowser.cpp +++ b/retroshare-gui/src/gui/help/browser/helpbrowser.cpp @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/help/browser/helpbrowser.cpp * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file helpbrowser.cpp diff --git a/retroshare-gui/src/gui/help/browser/helpbrowser.h b/retroshare-gui/src/gui/help/browser/helpbrowser.h index 589a37d0c..acd3947a1 100644 --- a/retroshare-gui/src/gui/help/browser/helpbrowser.h +++ b/retroshare-gui/src/gui/help/browser/helpbrowser.h @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/help/browser/helpbrowser.h * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file helpbrowser.h diff --git a/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp b/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp index f6b445e1c..a4b70058f 100644 --- a/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp +++ b/retroshare-gui/src/gui/help/browser/helptextbrowser.cpp @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/help/browser/helptextbrowser.cpp * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file helptextbrowser.cpp diff --git a/retroshare-gui/src/gui/help/browser/helptextbrowser.h b/retroshare-gui/src/gui/help/browser/helptextbrowser.h index 320297ba9..71c785157 100644 --- a/retroshare-gui/src/gui/help/browser/helptextbrowser.h +++ b/retroshare-gui/src/gui/help/browser/helptextbrowser.h @@ -1,24 +1,23 @@ -/**************************************************************** - * This file is distributed under the following license: - * - * Copyright (c) 2008, defnax - * Copyright (c) 2008, Matt Edman, Justin Hipple - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/help/browser/helptextbrowser.h * + * * + * Copyright (c) 2008, defnax * + * Copyright (c) 2008, Matt Edman, Justin Hipple * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ /* ** \file helptextbrowser.h diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp b/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp index 1150088e7..5cd54fa67 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2009 The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/im_history/ImHistoryItemDelegate.cpp * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.h b/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.h index 13ec08c3d..93bf567ce 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.h +++ b/retroshare-gui/src/gui/im_history/IMHistoryItemDelegate.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2009 The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/im_history/ImHistoryItemDelegate.h * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _IMHISTORYITEMDELEGATE_H_ #define _IMHISTORYITEMDELEGATE_H_ diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp b/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp index 9fb4b0245..b75af79d0 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2009 The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/im_history/ImHistoryItemPainter.cpp * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.h b/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.h index 561e3c5b9..1a9a18b47 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.h +++ b/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2009 The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/im_history/ImHistoryItemPainter.h * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _IMHISTORYITEMPAINTER_H_ #define _IMHISTORYITEMPAINTER_H_ diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index 17b74a127..4615c06e4 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2010 The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h index f8c7eb1d0..0cfeb9a45 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.h @@ -1,24 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2010 The RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - +/******************************************************************************* + * retroshare-gui/src/gui/im_history/ImHistoryBrowser.h * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _IMHISTORYBROWSER_H #define _IMHISTORYBROWSER_H diff --git a/retroshare-gui/src/gui/images/retroshare_win.rc.h b/retroshare-gui/src/gui/images/retroshare_win.rc.h index 2c189044e..ea07e3ed5 100644 --- a/retroshare-gui/src/gui/images/retroshare_win.rc.h +++ b/retroshare-gui/src/gui/images/retroshare_win.rc.h @@ -1,25 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006, crypton - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ - - +/******************************************************************************* + * retroshare-gui/src/gui/images/retroshare_win.rc.h * + * * + * Copyright (C) 2006 by Crypton * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #define IDI_ICON1 101 diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index e461d63e3..d2de8250f 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageComposer.cpp * + * * + * Copyright (C) 2007 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.h b/retroshare-gui/src/gui/msgs/MessageComposer.h index 1891c0312..2666da86d 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.h +++ b/retroshare-gui/src/gui/msgs/MessageComposer.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2007, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageComposer.h * + * * + * Copyright (C) 2007 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _MESSAGECOMPOSER_H #define _MESSAGECOMPOSER_H diff --git a/retroshare-gui/src/gui/msgs/MessageInterface.h b/retroshare-gui/src/gui/msgs/MessageInterface.h index f559931bd..77cf4b534 100644 --- a/retroshare-gui/src/gui/msgs/MessageInterface.h +++ b/retroshare-gui/src/gui/msgs/MessageInterface.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageInterface.h * + * * + * Copyright (C) 2007 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef MRK_MESSAGE_INTERFACE_H #define MRK_MESSAGE_INTERFACE_H diff --git a/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp b/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp index a5d53b5e2..fa586f1c8 100644 --- a/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp +++ b/retroshare-gui/src/gui/msgs/MessageUserNotify.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageUserNotify.cpp * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "MessageUserNotify.h" #include "gui/notifyqt.h" diff --git a/retroshare-gui/src/gui/msgs/MessageUserNotify.h b/retroshare-gui/src/gui/msgs/MessageUserNotify.h index 9c383566b..b032123a0 100644 --- a/retroshare-gui/src/gui/msgs/MessageUserNotify.h +++ b/retroshare-gui/src/gui/msgs/MessageUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageUserNotify.h * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MESSAGEUSERNOTIFY_H #define MESSAGEUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index cf359199e..02d74b5da 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2011 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageWidget.cpp * + * * + * Copyright (C) 2011 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.h b/retroshare-gui/src/gui/msgs/MessageWidget.h index b7255143f..a56a75d73 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.h +++ b/retroshare-gui/src/gui/msgs/MessageWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2011, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageWidget.h * + * * + * Copyright (C) 2011 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _MESSAGEWIDGET_H #define _MESSAGEWIDGET_H diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.cpp b/retroshare-gui/src/gui/msgs/MessageWindow.cpp index a4ff106e6..0dc9e8ef4 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWindow.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2011 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageWindow.cpp * + * * + * Copyright (C) 2011 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "MessageWindow.h" #include "MessageWidget.h" diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.h b/retroshare-gui/src/gui/msgs/MessageWindow.h index 25ee06cc9..c12b8ca3d 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.h +++ b/retroshare-gui/src/gui/msgs/MessageWindow.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2011, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/MessageWindow.h * + * * + * Copyright (C) 2011 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _MESSAGEWINDOW_H #define _MESSAGEWINDOW_H diff --git a/retroshare-gui/src/gui/msgs/TagsMenu.cpp b/retroshare-gui/src/gui/msgs/TagsMenu.cpp index 8cc49cdea..357c37325 100644 --- a/retroshare-gui/src/gui/msgs/TagsMenu.cpp +++ b/retroshare-gui/src/gui/msgs/TagsMenu.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006,2007 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/TagsMenu.cpp * + * * + * Copyright (C) 2007 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/msgs/TagsMenu.h b/retroshare-gui/src/gui/msgs/TagsMenu.h index 80a56cbdd..279638aae 100644 --- a/retroshare-gui/src/gui/msgs/TagsMenu.h +++ b/retroshare-gui/src/gui/msgs/TagsMenu.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2007, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/TagsMenu.h * + * * + * Copyright (C) 2007 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _TAGSMENU_H #define _TAGSMENU_H diff --git a/retroshare-gui/src/gui/msgs/textformat.h b/retroshare-gui/src/gui/msgs/textformat.h index dcc55035b..2f9785129 100644 --- a/retroshare-gui/src/gui/msgs/textformat.h +++ b/retroshare-gui/src/gui/msgs/textformat.h @@ -1,28 +1,25 @@ -/*************************************************************************** - * This file is distributed under the following license: * - * Copyright (c) 2006-2010 RetroShare Team * - * Copyright (C) 2008-2009 Mehrdad Momeny * - * Copyright (C) 2008-2009 Golnaz Nilieh * - * * - * It is a modified version of "bilbotextformat.h", which was part * - * of the Bilbo Blogger. It has been customized for * - * use in RetroShare, at January 2010. * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/msgs/TagsMenu.h * + * * + * Copyright (C) 2006-2010 by Retroshare Team * + * Copyright (C) 2008-2009 Mehrdad Momeny * + * Copyright (C) 2008-2009 Golnaz Nilieh * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef TEXTFORMAT_H #define TEXTFORMAT_H From ba58eba34e7d8549b9df8df6edf85789f04dc9e6 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 16 Nov 2018 17:03:25 +0100 Subject: [PATCH 021/110] Complete API for forums Add new blocking methods Deprecate old unsafe methods --- libretroshare/src/retroshare/rsgxsforums.h | 70 ++++++++++++++------ libretroshare/src/services/p3gxsforums.cc | 70 ++++++++++++++++++++ libretroshare/src/services/p3gxsforums.h | 76 +++++++++++----------- 3 files changed, 158 insertions(+), 58 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index f5121b64c..4c6b6e483 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -111,34 +111,66 @@ public: */ virtual bool createMessage(RsGxsForumMsg& message) = 0; + /** + * @brief Edit forum details. + * @jsonapi{development} + * @param[in] forum Forum data (name, description...) with modifications + * @return false on error, true otherwise + */ + virtual bool editForum(RsGxsForumGroup& forum) = 0; + + /** + * @brief Get forums summaries list. Blocking API. + * @jsonapi{development} + * @param[out] forums list where to store the forums summaries + * @return false if something failed, true otherwhise + */ + virtual bool getForumsSummaries(std::list& forums) = 0; + + /** + * @brief Get forums information (description, thumbnail...). + * Blocking API. + * @jsonapi{development} + * @param[in] forumIds ids of the forums of which to get the informations + * @param[out] forumsInfo storage for the forums informations + * @return false if something failed, true otherwhise + */ + virtual bool getForumsInfo( + const std::list& forumIds, + std::vector& forumsInfo ) = 0; + + /** + * @brief Get content of specified forums. Blocking API + * @jsonapi{development} + * @param[in] forumIds id of the channels of which the content is requested + * @param[out] messages storage for the forum messages + * @return false if something failed, true otherwhise + */ + virtual bool getForumsContent( + const std::list& forumIds, + std::vector& messages ) = 0; + + /** + * @brief Toggle message read status. Blocking API. + * @jsonapi{development} + * @param[in] messageId post identifier + * @param[in] read true to mark as read, false to mark as unread + * @return false on error, true otherwise + */ + virtual bool markRead(const RsGxsGrpMsgIdPair& messageId, bool read) = 0; /* Specific Service Data */ + RS_DEPRECATED_FOR("getForumsSummaries, getForumsInfo") virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; + RS_DEPRECATED_FOR(getForumsContent) virtual bool getMsgData(const uint32_t &token, std::vector &msgs) = 0; - //Not currently used - //virtual bool getRelatedMessages(const uint32_t &token, std::vector &msgs) = 0; - - ////////////////////////////////////////////////////////////////////////////// + RS_DEPRECATED_FOR(markRead) virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0; - - //virtual bool setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask); - //virtual bool setGroupSubscribeFlags(const std::string &groupId, uint32_t subscribeFlags, uint32_t subscribeMask); - - //virtual bool groupRestoreKeys(const std::string &groupId); - //virtual bool groupShareKeys(const std::string &groupId, std::list& peers); - RS_DEPRECATED_FOR(createForum) virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group) = 0; - RS_DEPRECATED_FOR(createMessage) virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg) = 0; - - /*! - * To update forum group with new information - * @param token the token used to check completion status of update - * @param group group to be updated, groupId element must be set or will be rejected - * @return false groupId not set, true if set and accepted (still check token for completion) - */ + RS_DEPRECATED_FOR(editForum) virtual bool updateGroup(uint32_t &token, RsGxsForumGroup &group) = 0; }; diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index f913b5e1f..09680f196 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -406,6 +406,76 @@ bool p3GxsForums::createForum(RsGxsForumGroup& forum) return true; } +bool p3GxsForums::editForum(RsGxsForumGroup& forum) +{ + uint32_t token; + if(!updateGroup(token, forum)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed updating group." + << std::endl; + return false; + } + + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." + << std::endl; + return false; + } + + if(!RsGenExchange::getPublishedGroupMeta(token, forum.mMeta)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failure getting updated " + << " group data." << std::endl; + return false; + } + + return true; +} + +bool p3GxsForums::getForumsSummaries( + std::list& forums ) +{ + uint32_t token; + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_GROUP_META; + if( !requestGroupInfo(token, opts) + || waitToken(token) != RsTokenService::COMPLETE ) return false; + return getGroupSummary(token, forums); +} + +bool p3GxsForums::getForumsInfo( + const std::list& forumIds, + std::vector& forumsInfo ) +{ + uint32_t token; + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; + if( !requestGroupInfo(token, opts, forumIds) + || waitToken(token) != RsTokenService::COMPLETE ) return false; + return getGroupData(token, forumsInfo); +} + +bool p3GxsForums::getForumsContent( + const std::list& forumIds, + std::vector& messages ) +{ + uint32_t token; + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; + if( !requestMsgInfo(token, opts, forumIds) + || waitToken(token) != RsTokenService::COMPLETE ) return false; + return getMsgData(token, messages); +} + +bool p3GxsForums::markRead(const RsGxsGrpMsgIdPair& msgId, bool read) +{ + uint32_t token; + setMessageReadStatus(token, msgId, read); + if(waitToken(token) != RsTokenService::COMPLETE ) return false; + return true; +} + bool p3GxsForums::createGroup(uint32_t &token, RsGxsForumGroup &group) { std::cerr << "p3GxsForums::createGroup()" << std::endl; diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index 3e88d0cb3..36b40a972 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -38,58 +38,56 @@ class p3GxsForums: public RsGenExchange, public RsGxsForums, public p3Config, public RsTickEvent /* only needed for testing - remove after */ { - public: +public: + p3GxsForums( + RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs); - p3GxsForums(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs* gixs); + virtual RsServiceInfo getServiceInfo(); + virtual void service_tick(); -virtual RsServiceInfo getServiceInfo(); - -virtual void service_tick(); - - protected: - - -virtual void notifyChanges(std::vector& changes); - - // Overloaded from RsTickEvent. -virtual void handle_event(uint32_t event_type, const std::string &elabel); +protected: + virtual void notifyChanges(std::vector& changes); + /// Overloaded from RsTickEvent. + virtual void handle_event(uint32_t event_type, const std::string &elabel); virtual RsSerialiser* setupSerialiser(); // @see p3Config::setupSerialiser() virtual bool saveList(bool &cleanup, std::list&saveList); // @see p3Config::saveList(bool &cleanup, std::list&) virtual bool loadList(std::list& loadList); // @see p3Config::loadList(std::list&) - public: - -virtual bool getGroupData(const uint32_t &token, std::vector &groups); -virtual bool getMsgData(const uint32_t &token, std::vector &msgs); -//Not currently used -//virtual bool getRelatedMessages(const uint32_t &token, std::vector &msgs); - - ////////////////////////////////////////////////////////////////////////////// -virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read); - -//virtual bool setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask); -//virtual bool setGroupSubscribeFlags(const std::string &groupId, uint32_t subscribeFlags, uint32_t subscribeMask); - -//virtual bool groupRestoreKeys(const std::string &groupId); -//virtual bool groupShareKeys(const std::string &groupId, std::list& peers); - +public: + /// @see RsGxsForums::createForum virtual bool createForum(RsGxsForumGroup& forum); + + /// @see RsGxsForums::createMessage virtual bool createMessage(RsGxsForumMsg& message); -virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group); -virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg); + /// @see RsGxsForums::editForum + virtual bool editForum(RsGxsForumGroup& forum); -/*! - * To update forum group with new information - * @param token the token used to check completion status of update - * @param group group to be updated, groupId element must be set or will be rejected - * @return false groupId not set, true if set and accepted (still check token for completion) - */ -virtual bool updateGroup(uint32_t &token, RsGxsForumGroup &group); + /// @see RsGxsForums::getForumsSummaries + virtual bool getForumsSummaries(std::list& forums); + /// @see RsGxsForums::getForumsInfo + virtual bool getForumsInfo( + const std::list& forumIds, + std::vector& forumsInfo ); - private: + /// @see RsGxsForums::getForumsContent + virtual bool getForumsContent( + const std::list& forumIds, + std::vector& messages ); + + /// @see RsGxsForums::markRead + virtual bool markRead(const RsGxsGrpMsgIdPair& messageId, bool read); + + virtual bool getGroupData(const uint32_t &token, std::vector &groups); + virtual bool getMsgData(const uint32_t &token, std::vector &msgs); + virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read); + virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group); + virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg); + virtual bool updateGroup(uint32_t &token, RsGxsForumGroup &group); + +private: static uint32_t forumsAuthenPolicy(); From e311b2887010ae2b130c68ea97ded78d27b42621 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 16 Nov 2018 17:50:34 +0100 Subject: [PATCH 022/110] Complete channel API with comment and vote creation --- libretroshare/src/retroshare/rsgxschannels.h | 16 ++++++ libretroshare/src/services/p3gxschannels.cc | 54 ++++++++++++++++++++ libretroshare/src/services/p3gxschannels.h | 6 +++ 3 files changed, 76 insertions(+) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 6aa4a6081..aa89b9341 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -107,6 +107,14 @@ public: */ virtual bool createChannel(RsGxsChannelGroup& channel) = 0; + /** + * @brief Add a comment on a post or on another comment + * @jsonapi{development} + * @param[inout] comment + * @return false on error, true otherwise + */ + virtual bool createComment(RsGxsComment& comment) = 0; + /** * @brief Create channel post. Blocking API. * @jsonapi{development} @@ -115,6 +123,14 @@ public: */ virtual bool createPost(RsGxsChannelPost& post) = 0; + /** + * @brief createVote + * @jsonapi{development} + * @param[inout] vote + * @return false on error, true otherwise + */ + virtual bool createVote(RsGxsVote& vote) = 0; + /** * @brief Edit channel details. * @jsonapi{development} diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 380f1d378..84610b107 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1059,6 +1059,60 @@ bool p3GxsChannels::createChannel(RsGxsChannelGroup& channel) return true; } +bool p3GxsChannels::createComment(RsGxsComment& comment) +{ + uint32_t token; + if(!createComment(token, comment)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed creating comment." + << std::endl; + return false; + } + + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." + << std::endl; + return false; + } + + if(!RsGenExchange::getPublishedMsgMeta(token, comment.mMeta)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failure getting generated " + << " comment data." << std::endl; + return false; + } + + return true; +} + +bool p3GxsChannels::createVote(RsGxsVote& vote) +{ + uint32_t token; + if(!createVote(token, vote)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failed creating vote." + << std::endl; + return false; + } + + if(waitToken(token) != RsTokenService::COMPLETE) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." + << std::endl; + return false; + } + + if(!RsGenExchange::getPublishedMsgMeta(token, vote.mMeta)) + { + std::cerr << __PRETTY_FUNCTION__ << "Error! Failure getting generated " + << " vote data." << std::endl; + return false; + } + + return true; +} + bool p3GxsChannels::editChannel(RsGxsChannelGroup& channel) { uint32_t token; diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 3caf31c59..e5d49772b 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -189,12 +189,18 @@ virtual bool ExtraFileRemove(const RsFileHash &hash); /// Implementation of @see RsGxsChannels::createChannel virtual bool createChannel(RsGxsChannelGroup& channel); + /// Implementation of @see RsGxsChannels::createComment + virtual bool createComment(RsGxsComment& comment); + /// Implementation of @see RsGxsChannels::editChannel virtual bool editChannel(RsGxsChannelGroup& channel); /// Implementation of @see RsGxsChannels::createPost virtual bool createPost(RsGxsChannelPost& post); + /// Implementation of @see RsGxsChannels::createVote + virtual bool createVote(RsGxsVote& vote); + /// Implementation of @see RsGxsChannels::subscribeToChannel virtual bool subscribeToChannel( const RsGxsGroupId &groupId, bool subscribe ); From f670a18b13aa0cdef984923e914d1621fb352caf Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 16 Nov 2018 19:09:37 +0100 Subject: [PATCH 023/110] Break too long line in retroshare.pri --- retroshare.pri | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retroshare.pri b/retroshare.pri index a8025dc79..dd0032b54 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -111,8 +111,9 @@ rs_onlyhiddennode:CONFIG -= no_rs_onlyhiddennode CONFIG *= rs_gxs no_rs_gxs:CONFIG -= rs_gxs -# To disable GXS distrubuting all available posts independed of the "sync" settings append the following -# assignation to qmake command line "CONFIG+=no_rs_gxs_send_all" +# To disable GXS distrubuting all available posts independed of the "sync" +# settings append the following assignation to qmake command line +# "CONFIG+=no_rs_gxs_send_all" CONFIG *= rs_gxs_send_all no_rs_gxs_send_all:CONFIG -= rs_gxs_send_all From 8075eec288ec422a3d11301e8ddfa922c91277e8 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 17 Nov 2018 14:10:08 +0100 Subject: [PATCH 024/110] fixed licenses in PhotoShare, Posted, profile, people and Network --- .../gui/NetworkDialog/pgpid_item_model.cpp | 20 +++++++++ .../src/gui/NetworkDialog/pgpid_item_model.h | 20 +++++++++ .../gui/NetworkDialog/pgpid_item_proxy.cpp | 20 +++++++++ .../src/gui/NetworkDialog/pgpid_item_proxy.h | 20 +++++++++ .../src/gui/People/CircleWidget.cpp | 20 +++++++++ retroshare-gui/src/gui/People/CircleWidget.h | 20 +++++++++ .../src/gui/People/IdentityWidget.cpp | 20 +++++++++ .../src/gui/People/IdentityWidget.h | 20 +++++++++ .../src/gui/People/PeopleDialog.cpp | 42 ++++++++---------- retroshare-gui/src/gui/People/PeopleDialog.h | 41 ++++++++--------- .../src/gui/PhotoShare/AddCommentDialog.cpp | 20 +++++++++ .../src/gui/PhotoShare/AddCommentDialog.h | 20 +++++++++ .../src/gui/PhotoShare/AlbumCreateDialog.cpp | 20 +++++++++ .../src/gui/PhotoShare/AlbumCreateDialog.h | 20 +++++++++ .../src/gui/PhotoShare/AlbumDialog.cpp | 20 +++++++++ .../src/gui/PhotoShare/AlbumDialog.h | 20 +++++++++ .../src/gui/PhotoShare/AlbumItem.cpp | 20 +++++++++ retroshare-gui/src/gui/PhotoShare/AlbumItem.h | 20 +++++++++ .../src/gui/PhotoShare/PhotoCommentItem.cpp | 20 +++++++++ .../src/gui/PhotoShare/PhotoCommentItem.h | 20 +++++++++ .../src/gui/PhotoShare/PhotoDialog.cpp | 20 +++++++++ .../src/gui/PhotoShare/PhotoDialog.h | 20 +++++++++ .../src/gui/PhotoShare/PhotoDrop.cpp | 41 ++++++++--------- retroshare-gui/src/gui/PhotoShare/PhotoDrop.h | 41 ++++++++--------- .../src/gui/PhotoShare/PhotoItem.cpp | 44 ++++++++++++++----- retroshare-gui/src/gui/PhotoShare/PhotoItem.h | 20 +++++++++ .../src/gui/PhotoShare/PhotoShare.cpp | 42 ++++++++---------- .../src/gui/PhotoShare/PhotoShare.h | 20 +++++++++ .../gui/PhotoShare/PhotoShareItemHolder.cpp | 20 +++++++++ .../src/gui/PhotoShare/PhotoShareItemHolder.h | 20 +++++++++ .../src/gui/PhotoShare/PhotoSlideShow.cpp | 41 ++++++++--------- .../src/gui/PhotoShare/PhotoSlideShow.h | 41 ++++++++--------- .../src/gui/Posted/PostedCreatePostDialog.cpp | 41 ++++++++--------- .../src/gui/Posted/PostedCreatePostDialog.h | 41 ++++++++--------- .../src/gui/Posted/PostedDialog.cpp | 41 ++++++++--------- retroshare-gui/src/gui/Posted/PostedDialog.h | 42 +++++++++--------- .../src/gui/Posted/PostedGroupDialog.cpp | 41 ++++++++--------- .../src/gui/Posted/PostedGroupDialog.h | 42 +++++++++--------- retroshare-gui/src/gui/Posted/PostedItem.cpp | 41 ++++++++--------- retroshare-gui/src/gui/Posted/PostedItem.h | 41 ++++++++--------- .../src/gui/Posted/PostedListWidget.cpp | 41 ++++++++--------- .../src/gui/Posted/PostedListWidget.h | 41 ++++++++--------- .../src/gui/Posted/PostedUserNotify.h | 39 ++++++++-------- .../src/gui/plugins/PluginInterface.h | 20 +++++++++ .../src/gui/profile/ProfileManager.cpp | 40 ++++++++--------- .../src/gui/profile/ProfileManager.h | 39 ++++++++-------- .../src/gui/profile/ProfileWidget.cpp | 40 ++++++++--------- .../src/gui/profile/ProfileWidget.h | 39 ++++++++-------- .../src/gui/profile/StatusMessage.cpp | 39 ++++++++-------- .../src/gui/profile/StatusMessage.h | 39 ++++++++-------- 50 files changed, 992 insertions(+), 528 deletions(-) diff --git a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.cpp b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.cpp index a4599414d..d3048358b 100644 --- a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.cpp +++ b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "pgpid_item_model.h" #include #include diff --git a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.h b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.h index f42ae5e83..1e38e0461 100644 --- a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.h +++ b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/NetworkDialog/pgpid_item_model.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef KEY_ITEM_MODEL_H #define KEY_ITEM_MODEL_H diff --git a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp index 6fb62dd78..29acee273 100644 --- a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp +++ b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "pgpid_item_proxy.h" //TODO: include only required headers here diff --git a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.h b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.h index e442bded9..567425480 100644 --- a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.h +++ b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef PGPID_ITEM_PROXY_H #define PGPID_ITEM_PROXY_H diff --git a/retroshare-gui/src/gui/People/CircleWidget.cpp b/retroshare-gui/src/gui/People/CircleWidget.cpp index b36a3fa56..03979aee0 100644 --- a/retroshare-gui/src/gui/People/CircleWidget.cpp +++ b/retroshare-gui/src/gui/People/CircleWidget.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/People/CircleWidget.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "gui/gxs/GxsIdDetails.h" #include "gui/People/CircleWidget.h" #include "ui_CircleWidget.h" diff --git a/retroshare-gui/src/gui/People/CircleWidget.h b/retroshare-gui/src/gui/People/CircleWidget.h index 75d6899ba..40534897a 100644 --- a/retroshare-gui/src/gui/People/CircleWidget.h +++ b/retroshare-gui/src/gui/People/CircleWidget.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/People/CircleWidget.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef CIRCLEWIDGET_H #define CIRCLEWIDGET_H diff --git a/retroshare-gui/src/gui/People/IdentityWidget.cpp b/retroshare-gui/src/gui/People/IdentityWidget.cpp index 0fcfbc127..77d08c038 100644 --- a/retroshare-gui/src/gui/People/IdentityWidget.cpp +++ b/retroshare-gui/src/gui/People/IdentityWidget.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/People/IdentityWidget.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "gui/People/IdentityWidget.h" #include "ui_IdentityWidget.h" diff --git a/retroshare-gui/src/gui/People/IdentityWidget.h b/retroshare-gui/src/gui/People/IdentityWidget.h index 7f5dcd97f..a5e7b7771 100644 --- a/retroshare-gui/src/gui/People/IdentityWidget.h +++ b/retroshare-gui/src/gui/People/IdentityWidget.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/People/IdentityWidget.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef IDENTITYWIDGET_H #define IDENTITYWIDGET_H diff --git a/retroshare-gui/src/gui/People/PeopleDialog.cpp b/retroshare-gui/src/gui/People/PeopleDialog.cpp index bdf247a4f..5944d5c34 100644 --- a/retroshare-gui/src/gui/People/PeopleDialog.cpp +++ b/retroshare-gui/src/gui/People/PeopleDialog.cpp @@ -1,26 +1,22 @@ -/* - * Retroshare Identity. - * - * Copyright 2014-2014 by Cyril Soler - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare.project@gmail.com". - * - */ - +/******************************************************************************* + * retroshare-gui/src/gui/People/IdentityWidget.h * + * * + * Copyright (C) 2014 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PeopleDialog.h" #include "gui/Circles/CreateCircleDialog.h" diff --git a/retroshare-gui/src/gui/People/PeopleDialog.h b/retroshare-gui/src/gui/People/PeopleDialog.h index 14cc98c4f..0a29dec6d 100644 --- a/retroshare-gui/src/gui/People/PeopleDialog.h +++ b/retroshare-gui/src/gui/People/PeopleDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Identity. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/People/IdentityWidget.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #pragma once diff --git a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp index d77cd20b6..7481d4a47 100644 --- a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AddCommentDialog.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "AddCommentDialog.h" #include "ui_AddCommentDialog.h" diff --git a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h index f08aa65ca..f2003c132 100644 --- a/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h +++ b/retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AddCommentDialog.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef ADDCOMMENTDIALOG_H #define ADDCOMMENTDIALOG_H diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp index ce1e68453..5d5461d79 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include "AlbumCreateDialog.h" diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.h b/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.h index 79af02c2d..41b0896ba 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.h +++ b/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef ALBUMCREATEDIALOG_H #define ALBUMCREATEDIALOG_H diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp index 8897d9f5f..1a5e00ae9 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include "AlbumDialog.h" diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.h b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.h index a33ea2ded..9949b7408 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.h +++ b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AlbumDialog.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef ALBUMDIALOG_H #define ALBUMDIALOG_H diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumItem.cpp b/retroshare-gui/src/gui/PhotoShare/AlbumItem.cpp index ad74bdabb..4637a673a 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumItem.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AlbumItem.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AlbumItem.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "AlbumItem.h" #include "ui_AlbumItem.h" #include diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumItem.h b/retroshare-gui/src/gui/PhotoShare/AlbumItem.h index b7e7cd0ce..9ce864de7 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumItem.h +++ b/retroshare-gui/src/gui/PhotoShare/AlbumItem.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/AlbumItem.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef ALBUMITEM_H #define ALBUMITEM_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp index 8d757122e..42f50c4f0 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include "PhotoCommentItem.h" diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h index 85fd2887d..eaf95fae7 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef PHOTOCOMMENTITEM_H #define PHOTOCOMMENTITEM_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp index cb338091a..a3e0e8c69 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include "PhotoDialog.h" diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h index 15cf6bf5f..abbd0bd7d 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDialog.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoDialog.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef PHOTODIALOG_H #define PHOTODIALOG_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDrop.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoDrop.cpp index 7282756a9..f092d2e02 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDrop.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDrop.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Photo Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoDialog.cpp * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoDrop.h b/retroshare-gui/src/gui/PhotoShare/PhotoDrop.h index 7bba5979b..4b862eaf6 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoDrop.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoDrop.h @@ -1,25 +1,22 @@ -/* - * Retroshare Photo Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoDialog.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_PHOTO_DROP_H #define MRK_PHOTO_DROP_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoItem.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoItem.cpp index 4d1fd34bb..f0cfaa895 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoItem.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoItem.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoItem.cpp * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include @@ -107,20 +127,20 @@ const RsPhotoPhoto& PhotoItem::getPhotoDetails() { - if (ui->idChooser->isVisible()) { + if (ui->idChooser->isVisible()) { RsGxsId id; - switch (ui->idChooser->getChosenId(id)) { - case GxsIdChooser::KnowId: - case GxsIdChooser::NoId: - case GxsIdChooser::UnKnowId: + switch (ui->idChooser->getChosenId(id)) { + case GxsIdChooser::KnowId: + case GxsIdChooser::NoId: + case GxsIdChooser::UnKnowId: mPhotoDetails.mMeta.mAuthorId = id; - - break; - case GxsIdChooser::None: - default: - break; - }//switch (ui->idChooser->getChosenId(id)) - }//if (ui->idChooser->isVisible()) + + break; + case GxsIdChooser::None: + default: + break; + }//switch (ui->idChooser->getChosenId(id)) + }//if (ui->idChooser->isVisible()) return mPhotoDetails; } diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoItem.h b/retroshare-gui/src/gui/PhotoShare/PhotoItem.h index 7ceb58840..ee7b4e578 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoItem.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoItem.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoItem.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef PHOTOITEM_H #define PHOTOITEM_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp index e8e9f4ae2..5c00bcb7a 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp @@ -1,26 +1,22 @@ - -/* - * Retroshare Photo Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PhotoShare.h" #include "ui_PhotoShare.h" diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoShare.h b/retroshare-gui/src/gui/PhotoShare/PhotoShare.h index 0fdc344f0..9bebcd1c5 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoShare.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoShare.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoShare.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef PHOTOSHARE_H #define PHOTOSHARE_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.cpp index e5d3bae28..44d1f562f 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.cpp * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "PhotoShareItemHolder.h" PhotoShareItemHolder::PhotoShareItemHolder() diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.h b/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.h index 91df3642a..dc2ca1492 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoShareItemHolder.h * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef PHOTOSHAREITEMHOLDER_H #define PHOTOSHAREITEMHOLDER_H diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.cpp index fa21d07bc..8b1df126f 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Photo Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.h * + * * + * Copyright (C) 2012 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "gui/PhotoShare/PhotoSlideShow.h" #include "gui/PhotoShare/PhotoDrop.h" diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.h b/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.h index 5b0bf4452..0ebb004bc 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.h @@ -1,25 +1,22 @@ -/* - * Retroshare Photo Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/PhotoShare/PhotoSlideShow.h * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_PHOTO_SLIDE_SHOW_H #define MRK_PHOTO_SLIDE_SHOW_H diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp index 6a47ecc77..ba622ed17 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Posted - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedCreatePostDialog.cpp * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include "PostedCreatePostDialog.h" diff --git a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h index d4a7bc49c..f4b6c96a3 100644 --- a/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h @@ -1,25 +1,22 @@ -/* - * Retroshare Posted - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedCreatePostDialog.h * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef POSTEDCREATEPOSTDIALOG_H #define POSTEDCREATEPOSTDIALOG_H diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.cpp b/retroshare-gui/src/gui/Posted/PostedDialog.cpp index d60387227..3d2ba7ac5 100644 --- a/retroshare-gui/src/gui/Posted/PostedDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Posted Dialog - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedDialog.cpp * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PostedDialog.h" #include "PostedItem.h" diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.h b/retroshare-gui/src/gui/Posted/PostedDialog.h index 396144cdb..e3f681aa8 100644 --- a/retroshare-gui/src/gui/Posted/PostedDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedDialog.h @@ -1,25 +1,23 @@ -/* - * Retroshare Posted Dialog - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedDialog.h * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef MRK_POSTED_DIALOG_H #define MRK_POSTED_DIALOG_H diff --git a/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp b/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp index 3ee165af5..031ce7da0 100644 --- a/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Posted - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedGroupDialog.cpp * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "PostedGroupDialog.h" diff --git a/retroshare-gui/src/gui/Posted/PostedGroupDialog.h b/retroshare-gui/src/gui/Posted/PostedGroupDialog.h index 35eb88089..c96da3ebf 100644 --- a/retroshare-gui/src/gui/Posted/PostedGroupDialog.h +++ b/retroshare-gui/src/gui/Posted/PostedGroupDialog.h @@ -1,25 +1,23 @@ -/* - * Retroshare Posted - * - * Copyright 2012-2013 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedGroupDialog.h * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef _POSTED_GROUP_DIALOG_H #define _POSTED_GROUP_DIALOG_H diff --git a/retroshare-gui/src/gui/Posted/PostedItem.cpp b/retroshare-gui/src/gui/Posted/PostedItem.cpp index 8fc1cc686..4304561d7 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.cpp +++ b/retroshare-gui/src/gui/Posted/PostedItem.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Posted Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedItem.cpp * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include #include diff --git a/retroshare-gui/src/gui/Posted/PostedItem.h b/retroshare-gui/src/gui/Posted/PostedItem.h index 2d2297a01..50a200679 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.h +++ b/retroshare-gui/src/gui/Posted/PostedItem.h @@ -1,25 +1,22 @@ -/* - * Retroshare Posted Plugin. - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedItem.h * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef MRK_POSTED_POSTED_ITEM_H #define MRK_POSTED_POSTED_ITEM_H diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp index f7e47863f..e51bc51b8 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.cpp @@ -1,25 +1,22 @@ -/* - * Retroshare Posted List - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedListWidget.cpp * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include diff --git a/retroshare-gui/src/gui/Posted/PostedListWidget.h b/retroshare-gui/src/gui/Posted/PostedListWidget.h index b9102cabb..426c4f742 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidget.h +++ b/retroshare-gui/src/gui/Posted/PostedListWidget.h @@ -1,25 +1,22 @@ -/* - * Retroshare Posted List - * - * Copyright 2012-2012 by Robert Fernie. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedListWidget.h * + * * + * Copyright (C) 2013 by Robert Fernie * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef POSTED_LIST_WIDGET_H #define POSTED_LIST_WIDGET_H diff --git a/retroshare-gui/src/gui/Posted/PostedUserNotify.h b/retroshare-gui/src/gui/Posted/PostedUserNotify.h index 4892e99d4..11552669a 100644 --- a/retroshare-gui/src/gui/Posted/PostedUserNotify.h +++ b/retroshare-gui/src/gui/Posted/PostedUserNotify.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2014 RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/Posted/PostedListWidget.h * + * * + * Copyright (C) 2014 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef POSTEDUSERNOTIFY_H #define POSTEDUSERNOTIFY_H diff --git a/retroshare-gui/src/gui/plugins/PluginInterface.h b/retroshare-gui/src/gui/plugins/PluginInterface.h index 5d64df426..03b0265eb 100644 --- a/retroshare-gui/src/gui/plugins/PluginInterface.h +++ b/retroshare-gui/src/gui/plugins/PluginInterface.h @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/plugins/PluginInterface.h * + * * + * Copyright (C) 2018 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #ifndef _PLUGIN_INTERFACE_H_ #define _PLUGIN_INTERFACE_H_ diff --git a/retroshare-gui/src/gui/profile/ProfileManager.cpp b/retroshare-gui/src/gui/profile/ProfileManager.cpp index e57602300..eca3c6c55 100644 --- a/retroshare-gui/src/gui/profile/ProfileManager.cpp +++ b/retroshare-gui/src/gui/profile/ProfileManager.cpp @@ -1,23 +1,23 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/profile/ProfileManager.cpp * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include diff --git a/retroshare-gui/src/gui/profile/ProfileManager.h b/retroshare-gui/src/gui/profile/ProfileManager.h index 879b62e7e..d62973e04 100644 --- a/retroshare-gui/src/gui/profile/ProfileManager.h +++ b/retroshare-gui/src/gui/profile/ProfileManager.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2012, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/profile/ProfileManager.h * + * * + * Copyright (C) 2012 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _PROFILEMANAGER_H diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.cpp b/retroshare-gui/src/gui/profile/ProfileWidget.cpp index 9151f90d3..80d2f9696 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.cpp +++ b/retroshare-gui/src/gui/profile/ProfileWidget.cpp @@ -1,23 +1,23 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2009, RetroShre Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/profile/ProfileManager.cpp * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "ProfileWidget.h" #include diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.h b/retroshare-gui/src/gui/profile/ProfileWidget.h index c1aa3d6fb..9c97fdbec 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.h +++ b/retroshare-gui/src/gui/profile/ProfileWidget.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2009, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/profile/ProfileManager.h * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _PROFILEWIDGET_H diff --git a/retroshare-gui/src/gui/profile/StatusMessage.cpp b/retroshare-gui/src/gui/profile/StatusMessage.cpp index ea94152fd..723fe77ce 100644 --- a/retroshare-gui/src/gui/profile/StatusMessage.cpp +++ b/retroshare-gui/src/gui/profile/StatusMessage.cpp @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2009, RetroShre Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/profile/StatusMessage.cpp * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #include "StatusMessage.h" diff --git a/retroshare-gui/src/gui/profile/StatusMessage.h b/retroshare-gui/src/gui/profile/StatusMessage.h index 3014f51a4..8c732d111 100644 --- a/retroshare-gui/src/gui/profile/StatusMessage.h +++ b/retroshare-gui/src/gui/profile/StatusMessage.h @@ -1,23 +1,22 @@ -/**************************************************************** - * RetroShare is distributed under the following license: - * - * Copyright (C) 2006 - 2009, RetroShare Team - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - ****************************************************************/ +/******************************************************************************* + * retroshare-gui/src/gui/profile/StatusMessage.h * + * * + * Copyright (C) 2009 by Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ #ifndef _STATUSMESSAGE_H #define _STATUSMESSAGE_H From 2b58e3f461989843d9e57ab8ef1f70a1c052bdd6 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sat, 17 Nov 2018 17:19:13 +0100 Subject: [PATCH 025/110] RsGxsChannels local search support --- libretroshare/src/gxs/rsgenexchange.cc | 6 +++++ libretroshare/src/gxs/rsgenexchange.h | 9 +++++++ libretroshare/src/retroshare/rsgxschannels.h | 13 +++++++++ libretroshare/src/services/p3gxschannels.cc | 28 +++++++++++++++++++- libretroshare/src/services/p3gxschannels.h | 5 ++++ 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 183751356..27c8c260a 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -3429,3 +3429,9 @@ void RsGenExchange::turtleSearchRequest(const std::string& match_string) { mNetService->turtleSearchRequest(match_string) ; } + +bool RsGenExchange::localSearch( const std::string& matchString, + std::list& results ) +{ + return mNetService->search(matchString, results); +} diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index a180c7741..ea3a43d7c 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -313,6 +313,15 @@ public: void turtleGroupRequest(const RsGxsGroupId& group_id); void turtleSearchRequest(const std::string& match_string); + /** + * @brief Search local groups. Blocking API. + * @param matchString string to look for in the search + * @param results storage for results + * @return false on error, true otherwise + */ + bool localSearch( const std::string& matchString, + std::list& results ); + protected: bool messagePublicationTest(const RsGxsMsgMetaData&) ; diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index aa89b9341..f1aef6e7f 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -287,6 +287,19 @@ public: const std::function& multiCallback, rstime_t maxWait = 300 ) = 0; + /** + * @brief Search local channels + * @jsonapi{development} + * @param[in] matchString string to look for in the search + * @param multiCallback function that will be called for each result + * @param[in] maxWait maximum wait time in seconds for search results + * @return false on error, true otherwise + */ + virtual bool localSearchRequest( + const std::string& matchString, + const std::function& multiCallback, + rstime_t maxWait = 30 ) = 0; + /* Following functions are deprecated as they expose internal functioning * semantic, instead of a safe to use API */ diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 84610b107..847395686 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -36,6 +36,7 @@ #include "retroshare/rsnotify.h" #include +#include // For Dummy Msgs. #include "util/rsrandom.h" @@ -50,7 +51,7 @@ * #define GXSCHANNEL_DEBUG 1 ****/ -/*extern*/ RsGxsChannels *rsGxsChannels = nullptr; +/*extern*/ RsGxsChannels* rsGxsChannels = nullptr; #define GXSCHANNEL_STOREPERIOD (3600 * 24 * 30) @@ -1969,6 +1970,31 @@ bool p3GxsChannels::turtleChannelRequest( return true; } +/// @see RsGxsChannels::localSearchRequest +bool p3GxsChannels::localSearchRequest( + const std::string& matchString, + const std::function& multiCallback, + rstime_t maxWait ) +{ + if(matchString.empty()) + { + std::cerr << __PRETTY_FUNCTION__ << " match string can't be empty!" + << std::endl; + return false; + } + + auto timeout = std::chrono::steady_clock::now() + std::chrono::seconds(maxWait); + RsThread::async([=]() + { + std::list results; + RsGenExchange::localSearch(matchString, results); + if(std::chrono::steady_clock::now() < timeout) + for(const RsGxsGroupSummary& result : results) multiCallback(result); + }); + + return true; +} + void p3GxsChannels::receiveDistantSearchResults( TurtleRequestId id, const RsGxsGroupId& grpId ) { diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index e5d49772b..20be70aec 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -118,6 +118,11 @@ virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::strin const std::function& multiCallback, rstime_t maxWait = 300 ); + /// @see RsGxsChannels::localSearchRequest + virtual bool localSearchRequest(const std::string& matchString, + const std::function& multiCallback, + rstime_t maxWait = 30 ) override; + /** * Receive results from turtle search @see RsGenExchange @see RsNxsObserver * @see RsGxsNetService::receiveTurtleSearchResults From f8c25fd9678e43d519d61e2082d425a095463738 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 19 Nov 2018 22:13:55 +0100 Subject: [PATCH 026/110] fixed bug in TransfersDialog model got sizeHintRole() --- .../src/gui/FileTransfer/TransfersDialog.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index 7ec394e17..c0a50dd51 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -352,19 +352,19 @@ public: switch(col) { default: - case COLUMN_NAME: return QVariant( factor * 170 ); - case COLUMN_SIZE: return QVariant( factor * 70 ); - case COLUMN_COMPLETED: return QVariant( factor * 75 ); - case COLUMN_DLSPEED: return QVariant( factor * 75 ); - case COLUMN_PROGRESS: return QVariant( factor * 170 ); - case COLUMN_SOURCES: return QVariant( factor * 90 ); - case COLUMN_STATUS: return QVariant( factor * 100 ); - case COLUMN_PRIORITY: return QVariant( factor * 100 ); - case COLUMN_REMAINING: return QVariant( factor * 100 ); - case COLUMN_DOWNLOADTIME: return QVariant( factor * 100 ); - case COLUMN_ID: return QVariant( factor * 100 ); - case COLUMN_LASTDL: return QVariant( factor * 100 ); - case COLUMN_PATH: return QVariant( factor * 100 ); + case COLUMN_NAME: return QVariant( QSize(factor * 170, factor*14.0f )); + case COLUMN_SIZE: return QVariant( QSize(factor * 70 , factor*14.0f )); + case COLUMN_COMPLETED: return QVariant( QSize(factor * 75 , factor*14.0f )); + case COLUMN_DLSPEED: return QVariant( QSize(factor * 75 , factor*14.0f )); + case COLUMN_PROGRESS: return QVariant( QSize(factor * 170, factor*14.0f )); + case COLUMN_SOURCES: return QVariant( QSize(factor * 90 , factor*14.0f )); + case COLUMN_STATUS: return QVariant( QSize(factor * 100, factor*14.0f )); + case COLUMN_PRIORITY: return QVariant( QSize(factor * 100, factor*14.0f )); + case COLUMN_REMAINING: return QVariant( QSize(factor * 100, factor*14.0f )); + case COLUMN_DOWNLOADTIME: return QVariant( QSize(factor * 100, factor*14.0f )); + case COLUMN_ID: return QVariant( QSize(factor * 100, factor*14.0f )); + case COLUMN_LASTDL: return QVariant( QSize(factor * 100, factor*14.0f )); + case COLUMN_PATH: return QVariant( QSize(factor * 100, factor*14.0f )); } } From 9d49ca0e4c83463a0bc27bcda9f76a73c6643f2a Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 17 Nov 2018 22:36:07 +0100 Subject: [PATCH 027/110] initial attempt at creating an ItemModel for forums --- .../src/gui/gxsforums/GxsForumModel.cpp | 409 ++++++++++++++++++ .../src/gui/gxsforums/GxsForumModel.h | 53 +++ retroshare-gui/src/retroshare-gui.pro | 2 + 3 files changed, 464 insertions(+) create mode 100644 retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp create mode 100644 retroshare-gui/src/gui/gxsforums/GxsForumModel.h diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp new file mode 100644 index 000000000..b2e6241b9 --- /dev/null +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -0,0 +1,409 @@ +#include +#include +#include + +#include "GxsForumModel.h" + +#define DEBUG_FORUMMODEL + +#define COLUMN_TITLE 0 +#define COLUMN_READ_STATUS 1 +#define COLUMN_DATE 2 +#define COLUMN_AUTHOR 3 +#define COLUMN_COUNT 4 + +Q_DECLARE_METATYPE(RsMsgMetaData); + +std::ostream& operator<<(std::ostream& o, const QModelIndex& i) +{ + return o << i.row() << "," << i.column() << "," << i.internalPointer() ; +} + +RsGxsForumModel::RsGxsForumModel(QObject *parent) + : QAbstractItemModel(parent) +{ + mPosts.resize(1); // adds a sentinel item +} + +int RsGxsForumModel::rowCount(const QModelIndex& parent) const +{ + void *ref = (parent.isValid())?parent.internalPointer():NULL ; + + if(mPosts.empty()) // security. Should never happen. + return 0; + + uint32_t entry = 0 ; + int source_id ; + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "rowCount-2(" << parent << ") : " << 0 << std::endl; +#endif + return 0 ; + } + +#ifdef DEBUG_FORUMMODEL + std::cerr << "rowCount-3(" << parent << ") : " << mPosts[entry].children.size() << std::endl; +#endif + return mPosts[entry].children.size(); +} + +int RsGxsForumModel::columnCount(const QModelIndex &parent) const +{ + return COLUMN_COUNT ; +} + +bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const +{ + void *ref = (parent.isValid())?parent.internalPointer():NULL ; + uint32_t entry = 0; + + if(!ref) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "hasChildren-1(" << parent << ") : " << true << std::endl; +#endif + return true ; + } + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "hasChildren-2(" << parent << ") : " << false << std::endl; +#endif + return false ; + } + +#ifdef DEBUG_DOWNLOADLIST + std::cerr << "hasChildren-3(" << parent << ") : " << !mDownloads[entry].peers.empty() << std::endl; +#endif + return !mPosts[entry].children.empty(); +} + +bool RsGxsForumModel::convertTabEntryToRefPointer(uint32_t entry,void *& ref) +{ + // the pointer is formed the following way: + // + // [ 32 bits ] + // + // This means that the whole software has the following build-in limitation: + // * 4 B simultaenous posts. Should be enough ! + + ref = reinterpret_cast( (intptr_t)entry ); + + return true; +} + +bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) +{ + intptr_t val = (intptr_t)ref; + + if(val > (intptr_t)(~(uint32_t(0)))) // make sure the pointer is an int that fits in 32bits + { + std::cerr << "(EE) trying to make a ForumModelIndex out of a number that is larger than 2^32 !" << std::endl; + return false ; + } + entry = uint32_t(val); + + return true; +} + +QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & parent) const +{ + if(row < 0 || column < 0 || column >= COLUMN_COUNT) + return QModelIndex(); + + void *parent_ref = (parent.isValid())?parent.internalPointer():NULL ; + uint32_t entry = 0; + int source_id=0 ; + + if(!parent_ref) // top level. The entry is that of a transfer + { + void *ref = NULL ; + + if(row >= (int)mPosts.size() || !convertTabEntryToRefPointer(row,ref)) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "index-1(" << row << "," << column << " parent=" << parent << ") : " << "NULL" << std::endl; +#endif + return QModelIndex() ; + } + +#ifdef DEBUG_FORUMMODEL + std::cerr << "index-2(" << row << "," << column << " parent=" << parent << ") : " << createIndex(row,column,ref) << std::endl; +#endif + return createIndex(row,column,ref) ; + } + + if(!convertRefPointerToTabEntry(parent_ref,entry) || entry >= mPosts.size()) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "index-5(" << row << "," << column << " parent=" << parent << ") : " << "NULL"<< std::endl ; +#endif + return QModelIndex() ; + } + + void *ref = NULL ; + + if(row >= mPosts[entry].children.size() || !convertTabEntryToRefPointer(mPosts[entry].children[row],ref)) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "index-4(" << row << "," << column << " parent=" << parent << ") : " << "NULL" << std::endl; +#endif + return QModelIndex() ; + } + +#ifdef DEBUG_FORUMMODEL + std::cerr << "index-3(" << row << "," << column << " parent=" << parent << ") : " << createIndex(row,column,ref) << std::endl; +#endif + return createIndex(row,column,ref) ; +} + +QModelIndex RsGxsForumModel::parent(const QModelIndex& child) const +{ + void *child_ref = (child.isValid())?child.internalPointer():NULL ; + uint32_t entry = 0; + int source_id=0 ; + + if(!child_ref) + return QModelIndex() ; + + if(!convertRefPointerToTabEntry(child_ref,entry) || entry >= mPosts.size()) + return QModelIndex() ; + + void *parent_ref =NULL; + + if(!convertTabEntryToRefPointer(mPosts[entry].parent,parent_ref)) + return QModelIndex() ; + + return createIndex(entry,child.column(),parent_ref) ; // I'm not sure about the .column() here ! +} + +QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if(role != Qt::DisplayRole) + return QVariant(); + + switch(section) + { + default: + case COLUMN_TITLE: return tr("Title"); + case COLUMN_READ_STATUS: return tr("Read Status"); + case COLUMN_DATE: return tr("Date"); + case COLUMN_AUTHOR: return tr("Author"); + } +} + +QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const +{ + if(!index.isValid()) + return QVariant(); + + int coln = index.column() ; + + switch(role) + { + case Qt::SizeHintRole: return sizeHintRole(index.column()) ; + case Qt::TextAlignmentRole: + case Qt::TextColorRole: + case Qt::WhatsThisRole: + case Qt::EditRole: + case Qt::ToolTipRole: + case Qt::StatusTipRole: + return QVariant(); + } + + void *ref = (index.isValid())?index.internalPointer():NULL ; + uint32_t entry = 0; + +#ifdef DEBUG_FORUMMODEL + std::cerr << "data(" << index << ")" ; +#endif + + if(!ref) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << " [empty]" << std::endl; +#endif + return QVariant() ; + } + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + { +#ifdef DEBUG_FORUMMODEL + std::cerr << "Bad pointer: " << (void*)ref << std::endl; +#endif + return QVariant() ; + } + + const RsMsgMetaData& meta(mPosts[entry].meta_versions[0]) ; + +#ifdef DEBUG_DOWNLOADLIST + std::cerr << " [ok]" << std::endl; +#endif + + switch(role) + { + case Qt::DisplayRole: return displayRole (meta,index.column()) ; + case Qt::DecorationRole: return decorationRole(meta,index.column()) ; + case Qt::UserRole: return userRole (meta,index.column()) ; + default: + return QVariant(); + } +} + +QVariant RsGxsForumModel::sizeHintRole(int col) const +{ + float factor = QFontMetricsF(QApplication::font()).height()/14.0f ; + + switch(col) + { + default: + case COLUMN_TITLE: return QVariant( factor * 170 ); + case COLUMN_READ_STATUS: return QVariant( factor * 10 ); + case COLUMN_DATE: return QVariant( factor * 75 ); + case COLUMN_AUTHOR: return QVariant( factor * 75 ); + } +} + +QVariant RsGxsForumModel::displayRole(const RsMsgMetaData& meta,int col) const +{ + switch(col) + { + case COLUMN_TITLE: return QVariant(QString::fromUtf8(meta.mMsgName.c_str())); + case COLUMN_READ_STATUS: return QVariant(meta.mMsgStatus); + case COLUMN_DATE: return QVariant(qulonglong(meta.mPublishTs)); + case COLUMN_AUTHOR: return QVariant(QString::fromStdString(meta.mAuthorId.toStdString())); + + default: + return QVariant("[ TODO ]"); + } + + + return QVariant("[ERROR]"); +} + +QVariant RsGxsForumModel::userRole(const RsMsgMetaData &meta, int col) const +{ +#ifdef TODO + switch(col) + { + case COLUMN_PROGRESS: + { + FileChunksInfo fcinfo; + if (!rsFiles->FileDownloadChunksDetails(fileInfo.hash, fcinfo)) + return QVariant(); + + FileProgressInfo pinfo; + pinfo.cmap = fcinfo.chunks; + pinfo.type = FileProgressInfo::DOWNLOAD_LINE; + pinfo.progress = (fileInfo.size == 0) ? 0 : (fileInfo.transfered * 100.0 / fileInfo.size); + pinfo.nb_chunks = pinfo.cmap._map.empty() ? 0 : fcinfo.chunks.size(); + + for (uint32_t i = 0; i < fcinfo.chunks.size(); ++i) + switch(fcinfo.chunks[i]) + { + case FileChunksInfo::CHUNK_CHECKING: pinfo.chunks_in_checking.push_back(i); + break ; + case FileChunksInfo::CHUNK_ACTIVE: pinfo.chunks_in_progress.push_back(i); + break ; + case FileChunksInfo::CHUNK_DONE: + case FileChunksInfo::CHUNK_OUTSTANDING: + break ; + } + + return QVariant::fromValue(pinfo); + } + + case COLUMN_ID: return QVariant(QString::fromStdString(fileInfo.hash.toStdString())); + + + default: + return QVariant(); + } + } +#endif + return QVariant(); + +} + +QVariant RsGxsForumModel::decorationRole(const RsMsgMetaData& meta,int col) const +{ + return QVariant(); +} + +void RsGxsForumModel::update_posts() +{ +#ifdef TODO + std::list downHashes; + rsFiles->FileDownloads(downHashes); + + size_t old_size = mDownloads.size(); + + mDownloads.resize(downHashes.size()) ; + + if(old_size < mDownloads.size()) + { + beginInsertRows(QModelIndex(), old_size, mDownloads.size()-1); + insertRows(old_size, mDownloads.size() - old_size); + endInsertRows(); + } + else if(mDownloads.size() < old_size) + { + beginRemoveRows(QModelIndex(), mDownloads.size(), old_size-1); + removeRows(mDownloads.size(), old_size - mDownloads.size()); + endRemoveRows(); + } + + uint32_t i=0; + + for(auto it(downHashes.begin());it!=downHashes.end();++it,++i) + { + FileInfo fileInfo(mDownloads[i]); // we dont update the data itself but only a copy of it.... + int old_size = fileInfo.peers.size() ; + + rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, fileInfo); + + int new_size = fileInfo.peers.size() ; + + if(old_size < new_size) + { + beginInsertRows(index(i,0), old_size, new_size-1); + insertRows(old_size, new_size - old_size,index(i,0)); +#ifdef DEBUG_DOWNLOADLIST + std::cerr << "called insert rows ( " << old_size << ", " << new_size - old_size << ",index(" << index(i,0)<< "))" << std::endl; +#endif + endInsertRows(); + } + else if(new_size < old_size) + { + beginRemoveRows(index(i,0), new_size, old_size-1); + removeRows(new_size, old_size - new_size,index(i,0)); +#ifdef DEBUG_DOWNLOADLIST + std::cerr << "called remove rows ( " << old_size << ", " << old_size - new_size << ",index(" << index(i,0)<< "))" << std::endl; +#endif + endRemoveRows(); + } + + uint32_t old_status = mDownloads[i].downloadStatus ; + + mDownloads[i] = fileInfo ; // ... because insertRows() calls rowCount() which needs to be consistent with the *old* number of rows. + + if(fileInfo.downloadStatus == FT_STATE_DOWNLOADING || old_status != fileInfo.downloadStatus) + { + QModelIndex topLeft = createIndex(i,0), bottomRight = createIndex(i, COLUMN_COUNT-1); + emit dataChanged(topLeft, bottomRight); + } + + // This is apparently not needed. + // + // if(!mDownloads.empty()) + // { + // QModelIndex topLeft = createIndex(0,0), bottomRight = createIndex(mDownloads.size()-1, COLUMN_COUNT-1); + // emit dataChanged(topLeft, bottomRight); + // mDownloads[i] = fileInfo ; + // } + } +#endif +} diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h new file mode 100644 index 000000000..7b8845f80 --- /dev/null +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -0,0 +1,53 @@ +#include "retroshare/rsgxsifacetypes.h" + +// This class holds the actual hierarchy of posts, represented by identifiers +// It is responsible for auto-updating when necessary and holds a mutex to allow the Model to +// safely access the data. + +// The model contains a post in place 0 that is the parent of all posts. + +typedef uint32_t ForumModelIndex; + +struct ForumPostEntry +{ + std::vector meta_versions; // maybe we don't need all this. Could be too large. + + std::vector children; + ForumModelIndex parent; +}; + +// This class is the item model used by Qt to display the information + +class RsGxsForumModel : public QAbstractItemModel +{ + // Q_OBJECT + +public: + explicit RsGxsForumModel(QObject *parent = NULL); + ~RsGxsForumModel(){} + + enum Roles{ SortRole = Qt::UserRole+1 }; + + int rowCount(const QModelIndex& parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + bool hasChildren(const QModelIndex &parent = QModelIndex()) const; + + QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex& child) const; + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + + QVariant sizeHintRole(int col) const; + QVariant displayRole(const RsMsgMetaData& meta, int col) const; + QVariant userRole(const RsMsgMetaData& meta, int col) const; + QVariant decorationRole(const RsMsgMetaData &meta, int col) const; + + void update_posts(); + +private: + static bool convertTabEntryToRefPointer(uint32_t entry,void *& ref); + static bool convertRefPointerToTabEntry(void *ref,uint32_t& entry); + + std::vector mPosts ; // store the list of posts updated from rsForums. +}; diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 61baf713e..8a9ae04ce 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1231,6 +1231,7 @@ gxsforums { gui/gxsforums/CreateGxsForumMsg.h \ gui/gxsforums/GxsForumThreadWidget.h \ gui/gxsforums/GxsForumsFillThread.h \ + gui/gxsforums/GxsForumModel.h \ gui/gxsforums/GxsForumUserNotify.h \ gui/feeds/GxsForumGroupItem.h \ gui/feeds/GxsForumMsgItem.h @@ -1244,6 +1245,7 @@ gxsforums { gui/gxsforums/GxsForumGroupDialog.cpp \ gui/gxsforums/CreateGxsForumMsg.cpp \ gui/gxsforums/GxsForumThreadWidget.cpp \ + gui/gxsforums/GxsForumModel.cpp \ gui/gxsforums/GxsForumsFillThread.cpp \ gui/gxsforums/GxsForumUserNotify.cpp \ gui/feeds/GxsForumGroupItem.cpp \ From a532b68b8e0de81d76967ab3276c3eeeb01458c8 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 18 Nov 2018 21:36:13 +0100 Subject: [PATCH 028/110] improvements of the Forum Model --- .../src/gui/gxsforums/GxsForumModel.cpp | 84 ++++++++++--------- .../src/gui/gxsforums/GxsForumModel.h | 1 + .../gui/gxsforums/GxsForumThreadWidget.cpp | 55 +++++++++++- .../src/gui/gxsforums/GxsForumThreadWidget.ui | 43 +--------- 4 files changed, 98 insertions(+), 85 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index b2e6241b9..33dcc2efb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -14,15 +14,34 @@ Q_DECLARE_METATYPE(RsMsgMetaData); -std::ostream& operator<<(std::ostream& o, const QModelIndex& i) -{ - return o << i.row() << "," << i.column() << "," << i.internalPointer() ; -} +std::ostream& operator<<(std::ostream& o, const QModelIndex& i);// defined elsewhere RsGxsForumModel::RsGxsForumModel(QObject *parent) : QAbstractItemModel(parent) { mPosts.resize(1); // adds a sentinel item + + // adds some fake posts to debug + + int N=5 ; + mPosts.resize(N+1); + + for(int i=1;i<=N;++i) + { + mPosts[0].children.push_back(ForumModelIndex(i)); + mPosts[i].parent = ForumModelIndex(0); + mPosts[i].prow = i-1; + + RsMsgMetaData meta; + meta.mMsgName = "message " + (QString::number(i).toStdString()) ; + mPosts[i].meta_versions.push_back(meta); + } + + // add one child to last post + mPosts.resize(N+2); + mPosts[N].children.push_back(ForumModelIndex(N+1)); + mPosts[N+1].parent = ForumModelIndex(N); + mPosts[N+1].prow = 0; } int RsGxsForumModel::rowCount(const QModelIndex& parent) const @@ -59,14 +78,6 @@ bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const void *ref = (parent.isValid())?parent.internalPointer():NULL ; uint32_t entry = 0; - if(!ref) - { -#ifdef DEBUG_FORUMMODEL - std::cerr << "hasChildren-1(" << parent << ") : " << true << std::endl; -#endif - return true ; - } - if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) { #ifdef DEBUG_FORUMMODEL @@ -115,28 +126,12 @@ QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & pare return QModelIndex(); void *parent_ref = (parent.isValid())?parent.internalPointer():NULL ; - uint32_t entry = 0; + uint32_t parent_entry = 0; int source_id=0 ; - if(!parent_ref) // top level. The entry is that of a transfer - { - void *ref = NULL ; + // We dont need to handle parent==NULL because the conversion will return entry=0 which is what we need. - if(row >= (int)mPosts.size() || !convertTabEntryToRefPointer(row,ref)) - { -#ifdef DEBUG_FORUMMODEL - std::cerr << "index-1(" << row << "," << column << " parent=" << parent << ") : " << "NULL" << std::endl; -#endif - return QModelIndex() ; - } - -#ifdef DEBUG_FORUMMODEL - std::cerr << "index-2(" << row << "," << column << " parent=" << parent << ") : " << createIndex(row,column,ref) << std::endl; -#endif - return createIndex(row,column,ref) ; - } - - if(!convertRefPointerToTabEntry(parent_ref,entry) || entry >= mPosts.size()) + if(!convertRefPointerToTabEntry(parent_ref,parent_entry) || parent_entry >= mPosts.size()) { #ifdef DEBUG_FORUMMODEL std::cerr << "index-5(" << row << "," << column << " parent=" << parent << ") : " << "NULL"<< std::endl ; @@ -146,7 +141,7 @@ QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & pare void *ref = NULL ; - if(row >= mPosts[entry].children.size() || !convertTabEntryToRefPointer(mPosts[entry].children[row],ref)) + if(row >= mPosts[parent_entry].children.size() || !convertTabEntryToRefPointer(mPosts[parent_entry].children[row],ref)) { #ifdef DEBUG_FORUMMODEL std::cerr << "index-4(" << row << "," << column << " parent=" << parent << ") : " << "NULL" << std::endl; @@ -163,21 +158,32 @@ QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & pare QModelIndex RsGxsForumModel::parent(const QModelIndex& child) const { void *child_ref = (child.isValid())?child.internalPointer():NULL ; - uint32_t entry = 0; - int source_id=0 ; if(!child_ref) return QModelIndex() ; - if(!convertRefPointerToTabEntry(child_ref,entry) || entry >= mPosts.size()) + ForumModelIndex child_entry ; + + if(!convertRefPointerToTabEntry(child_ref,child_entry) || child_entry >= mPosts.size()) return QModelIndex() ; void *parent_ref =NULL; + ForumModelIndex parent_entry = mPosts[child_entry].parent; + QModelIndex indx; - if(!convertTabEntryToRefPointer(mPosts[entry].parent,parent_ref)) - return QModelIndex() ; + if(parent_entry == 0) // top level index + indx = QModelIndex() ; + else + { + if(!convertTabEntryToRefPointer(parent_entry,parent_ref)) + return QModelIndex() ; - return createIndex(entry,child.column(),parent_ref) ; // I'm not sure about the .column() here ! + indx = createIndex(mPosts[parent_entry].prow,child.column(),parent_ref) ; + } +#ifdef DEBUG_FORUMMODEL + std::cerr << "parent-1(" << child << ") : " << indx << std::endl; +#endif + return indx; } QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -239,7 +245,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const const RsMsgMetaData& meta(mPosts[entry].meta_versions[0]) ; -#ifdef DEBUG_DOWNLOADLIST +#ifdef DEBUG_FORUMMODEL std::cerr << " [ok]" << std::endl; #endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 7b8845f80..e5fdbf976 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -14,6 +14,7 @@ struct ForumPostEntry std::vector children; ForumModelIndex parent; + int prow ; // parent row }; // This class is the item model used by Qt to display the information diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d04d982c3..d33aab4eb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -27,6 +27,7 @@ #include "GxsForumThreadWidget.h" #include "ui_GxsForumThreadWidget.h" #include "GxsForumsFillThread.h" +#include "GxsForumModel.h" #include "GxsForumsDialog.h" #include "gui/RetroShareLink.h" #include "gui/common/RSTreeWidgetItem.h" @@ -179,8 +180,9 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mStateHelper->addWidget(mTokenTypeInsertThreads, ui->nextUnreadButton); mStateHelper->addWidget(mTokenTypeInsertThreads, ui->previousButton); mStateHelper->addWidget(mTokenTypeInsertThreads, ui->nextButton); - +#ifdef SUSPENDED_CODE mStateHelper->addClear(mTokenTypeInsertThreads, ui->threadTreeWidget); +#endif mStateHelper->addWidget(mTokenTypeMessageData, ui->newmessageButton); // mStateHelper->addWidget(mTokenTypeMessageData, ui->postText); @@ -200,6 +202,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadCompareRole = new RSTreeWidgetItemCompareRole; mThreadCompareRole->setRole(COLUMN_THREAD_DATE, ROLE_THREAD_SORT); + ui->threadTreeWidget->setModel(new RsGxsForumModel(this)); ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); @@ -247,12 +250,14 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ttheader->resizeSection (COLUMN_THREAD_DISTRIBUTION, 24*f); ttheader->resizeSection (COLUMN_THREAD_AUTHOR, 150*f); +#ifdef SUSPENDED_CODE /* Set text of column "Read" to empty - without this the column has a number as header text */ QTreeWidgetItem *headerItem = ui->threadTreeWidget->headerItem(); headerItem->setText(COLUMN_THREAD_READ, "") ; headerItem->setText(COLUMN_THREAD_DISTRIBUTION, ""); headerItem->setData(COLUMN_THREAD_READ,Qt::UserRole, tr("Read status")) ; // this is used to display drop menus. headerItem->setData(COLUMN_THREAD_DISTRIBUTION,Qt::UserRole, tr("Distribution")); +#endif /* add filter actions */ ui->filterLineEdit->addFilter(QIcon(), tr("Title"), COLUMN_THREAD_TITLE, tr("Search Title")); @@ -294,9 +299,11 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->subscribeToolButton->setToolTip(tr( "

Subscribing to the forum will gather \ available posts from your subscribed friends, and make the \ forum visible to all other friends.

Afterwards you can unsubscribe from the context menu of the forum list at left.

")); - ui->threadTreeWidget->enableColumnCustomize(true); +#ifdef SUSPENDED_CODE + ui->threadTreeWidget->enableColumnCustomize(true); ui->threadTreeWidget->sortItems(COLUMN_THREAD_DATE, Qt::DescendingOrder); +#endif } void GxsForumThreadWidget::blank() @@ -312,7 +319,9 @@ void GxsForumThreadWidget::blank() ui->by_label->hide(); ui->postText->setImageBlockWidget(ui->imageBlockWidget) ; ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()); +#ifdef SUSPENDED_CODE ui->threadTreeWidget->clear(); +#endif ui->forumName->setText(""); mStateHelper->setWidgetEnabled(ui->newthreadButton, false); @@ -509,7 +518,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) if (mFillThread) { return; } - +#ifdef TODO QMenu contextMnu(this); QList selectedItems = ui->threadTreeWidget->selectedItems(); @@ -690,6 +699,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) } contextMnu.exec(QCursor::pos()); +#endif } void GxsForumThreadWidget::contextMenuTextBrowser(QPoint point) @@ -713,6 +723,7 @@ void GxsForumThreadWidget::contextMenuTextBrowser(QPoint point) bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event) { +#ifdef TODO if (obj == ui->threadTreeWidget) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); @@ -726,6 +737,8 @@ bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event) } // pass the event on to the parent class return RsGxsUpdateBroadcastWidget::eventFilter(obj, event); +#endif + return true; } void GxsForumThreadWidget::togglethreadview() @@ -762,6 +775,7 @@ void GxsForumThreadWidget::changedVersion() void GxsForumThreadWidget::changedThread() { +#ifdef TODO /* just grab the ids of the current item */ QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); @@ -779,6 +793,7 @@ void GxsForumThreadWidget::changedThread() ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); +#endif } void GxsForumThreadWidget::clickedThread(QTreeWidgetItem *item, int column) @@ -883,6 +898,7 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h void GxsForumThreadWidget::calculateUnreadCount() { +#ifdef TODO unsigned int unreadCount = 0; unsigned int newCount = 0; @@ -913,10 +929,12 @@ void GxsForumThreadWidget::calculateUnreadCount() if (changed) { emit groupChanged(this); } +#endif } void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item /*= NULL*/) { +#ifdef TODO bool dummy1 = false; bool dummy2 = false; @@ -933,6 +951,7 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item /*= NULL dummy2 = false; calculateIconsAndFonts(ui->threadTreeWidget->topLevelItem(index), dummy1, dummy2); } +#endif } static void cleanupItems (QList &items) @@ -1086,6 +1105,7 @@ static QString getDurationString(uint32_t days) void GxsForumThreadWidget::fillThreadFinished() { +#ifdef TODO #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreadFinished" << std::endl; #endif @@ -1204,6 +1224,7 @@ void GxsForumThreadWidget::fillThreadFinished() #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreadFinished done" << std::endl; #endif +#endif } void GxsForumThreadWidget::fillThreadProgress(int current, int count) @@ -1526,6 +1547,7 @@ static void copyItem(QTreeWidgetItem *item, const QTreeWidgetItem *newItem) void GxsForumThreadWidget::fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand) { +#ifdef TODO #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreads()" << std::endl; #endif @@ -1597,6 +1619,7 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreads() done" << std::endl; #endif +#endif } void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand) @@ -1665,6 +1688,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget void GxsForumThreadWidget::insertMessage() { +#ifdef TODO if (groupId().isNull()) { mStateHelper->setActive(mTokenTypeMessageData, false); @@ -1764,10 +1788,12 @@ void GxsForumThreadWidget::insertMessage() /* request Post */ RsGxsGrpMsgIdPair msgId = std::make_pair(groupId(), mThreadId); requestMessageData(msgId); +#endif } void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) { +#ifdef TODO /* As some time has elapsed since request - check that this is still the current msg. * otherwise, another request will fill the data */ @@ -1842,10 +1868,12 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) ui->postText->setHtml(extraTxt); } // ui->threadTitle->setText(QString::fromUtf8(msg.mMeta.mMsgName.c_str())); +#endif } void GxsForumThreadWidget::previousMessage() { +#ifdef TODO QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); if (item == NULL) { return; @@ -1859,10 +1887,12 @@ void GxsForumThreadWidget::previousMessage() ui->threadTreeWidget->setCurrentItem(previousItem); } } +#endif } void GxsForumThreadWidget::nextMessage() { +#ifdef TODO QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); if (item == NULL) { return; @@ -1877,6 +1907,7 @@ void GxsForumThreadWidget::nextMessage() ui->threadTreeWidget->setCurrentItem(nextItem); } } +#endif } void GxsForumThreadWidget::downloadAllFiles() @@ -1895,6 +1926,7 @@ void GxsForumThreadWidget::downloadAllFiles() void GxsForumThreadWidget::nextUnreadMessage() { +#ifdef TODO QTreeWidgetItem *currentItem = ui->threadTreeWidget->currentItem(); while (true) { @@ -1923,12 +1955,14 @@ void GxsForumThreadWidget::nextUnreadMessage() /* start from top */ currentItem = NULL; } +#endif } /* get selected messages the messages tree is single selected, but who knows ... */ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QList *rowsRead, QList *rowsUnread) { +#ifdef TODO if (rowsRead) rowsRead->clear(); if (rowsUnread) rowsUnread->clear(); @@ -1946,6 +1980,8 @@ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QLi } return selectedItems.size(); +#endif + return 0; } void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool read) @@ -2035,6 +2071,7 @@ void GxsForumThreadWidget::showInPeopleTab() void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum) { +#ifdef TODO if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { return; } @@ -2081,6 +2118,7 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f } setMsgReadStatus(rows, read); +#endif } void GxsForumThreadWidget::markMsgAsRead() @@ -2110,6 +2148,7 @@ void GxsForumThreadWidget::setAllMessagesReadDo(bool read, uint32_t &/*token*/) bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) { +#ifdef TODO if (mStateHelper->isLoading(mTokenTypeInsertThreads)) { mNavigatePendingMsgId = msgId; @@ -2131,6 +2170,7 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) return true; } } +#endif return false; } @@ -2149,7 +2189,7 @@ void GxsForumThreadWidget::copyMessageLink() if (groupId().isNull() || mThreadId.isNull()) { return; } - +#ifdef TODO QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); QString thread_title = (item != NULL)?item->text(COLUMN_THREAD_TITLE):QString() ; @@ -2161,6 +2201,7 @@ void GxsForumThreadWidget::copyMessageLink() urls.push_back(link); RSLinkClipboard::copyLinks(urls); } +#endif } void GxsForumThreadWidget::subscribeGroup(bool subscribe) @@ -2188,6 +2229,7 @@ void GxsForumThreadWidget::createmessage() void GxsForumThreadWidget::togglePinUpPost() { +#ifdef TODO if (groupId().isNull() || mThreadId.isNull()) return; @@ -2215,6 +2257,7 @@ void GxsForumThreadWidget::togglePinUpPost() ui->threadTreeWidget->takeTopLevelItem(ui->threadTreeWidget->indexOfTopLevelItem(item)); // forces the re-creation of all posts widgets. A bit extreme. We should rather only delete item above updateDisplay(true) ; +#endif } void GxsForumThreadWidget::createthread() @@ -2434,6 +2477,7 @@ void GxsForumThreadWidget::saveImage() void GxsForumThreadWidget::changedViewBox() { +#ifdef TODO if (mInProcessSettings) { return; } @@ -2444,6 +2488,7 @@ void GxsForumThreadWidget::changedViewBox() ui->threadTreeWidget->clear(); insertThreads(); +#endif } void GxsForumThreadWidget::filterColumnChanged(int column) @@ -2465,12 +2510,14 @@ void GxsForumThreadWidget::filterColumnChanged(int column) void GxsForumThreadWidget::filterItems(const QString& text) { +#ifdef TODO int filterColumn = ui->filterLineEdit->currentFilter(); int count = ui->threadTreeWidget->topLevelItemCount(); for (int index = 0; index < count; ++index) { filterItem(ui->threadTreeWidget->topLevelItem(index), text, filterColumn); } +#endif } bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index 56d08267f..fa372b940 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -215,7 +215,7 @@ - + Qt::CustomContextMenu @@ -225,42 +225,6 @@ true - - - Title - - - - - - - - - :/images/message-state-header.png:/images/message-state-header.png - - - - - Date - - - - - - - - Distribution - - - - :/icons/flag-green.png:/icons/flag-green.png - - - - - Author - - @@ -558,11 +522,6 @@ QTextBrowser
gui/common/RSTextBrowser.h
- - RSTreeWidget - QTreeWidget -
gui/common/RSTreeWidget.h
-
ElidedLabel QLabel From dbeb97c0e907956dd2b358a731feea654a837f80 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 19 Nov 2018 21:45:42 +0100 Subject: [PATCH 029/110] fixed bug in sizeHintRole() --- .../src/gui/gxsforums/GxsForumModel.cpp | 189 +++++++++++------- .../src/gui/gxsforums/GxsForumModel.h | 40 +++- 2 files changed, 148 insertions(+), 81 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 33dcc2efb..210d4f27f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -42,32 +42,25 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) mPosts[N].children.push_back(ForumModelIndex(N+1)); mPosts[N+1].parent = ForumModelIndex(N); mPosts[N+1].prow = 0; + + RsMsgMetaData meta; + meta.mMsgName = "message " + (QString::number(N+1).toStdString()) ; + mPosts[N+1].meta_versions.push_back(meta); } int RsGxsForumModel::rowCount(const QModelIndex& parent) const { - void *ref = (parent.isValid())?parent.internalPointer():NULL ; + if(parent.column() > 0) + return 0; if(mPosts.empty()) // security. Should never happen. return 0; - uint32_t entry = 0 ; - int source_id ; - - if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) - { -#ifdef DEBUG_FORUMMODEL - std::cerr << "rowCount-2(" << parent << ") : " << 0 << std::endl; -#endif - return 0 ; - } - -#ifdef DEBUG_FORUMMODEL - std::cerr << "rowCount-3(" << parent << ") : " << mPosts[entry].children.size() << std::endl; -#endif - return mPosts[entry].children.size(); + if(!parent.isValid()) + return getChildrenCount(NULL); + else + return getChildrenCount(parent.internalPointer()); } - int RsGxsForumModel::columnCount(const QModelIndex &parent) const { return COLUMN_COUNT ; @@ -75,7 +68,10 @@ int RsGxsForumModel::columnCount(const QModelIndex &parent) const bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const { - void *ref = (parent.isValid())?parent.internalPointer():NULL ; + if(!parent.isValid()) + return true; + + void *ref = parent.internalPointer(); uint32_t entry = 0; if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) @@ -86,8 +82,8 @@ bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const return false ; } -#ifdef DEBUG_DOWNLOADLIST - std::cerr << "hasChildren-3(" << parent << ") : " << !mDownloads[entry].peers.empty() << std::endl; +#ifdef DEBUG_FORUMMODEL + std::cerr << "hasChildren-3(" << parent << ") : " << !mPosts[entry].children.empty() << std::endl; #endif return !mPosts[entry].children.empty(); } @@ -112,7 +108,7 @@ bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) if(val > (intptr_t)(~(uint32_t(0)))) // make sure the pointer is an int that fits in 32bits { - std::cerr << "(EE) trying to make a ForumModelIndex out of a number that is larger than 2^32 !" << std::endl; + std::cerr << "(EE) trying to make a ForumModelIndex out of a number that is larger than 2^32-1 !" << std::endl; return false ; } entry = uint32_t(val); @@ -122,70 +118,117 @@ bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & parent) const { - if(row < 0 || column < 0 || column >= COLUMN_COUNT) +// if(!hasIndex(row,column,parent)) + if(row < 0 || column < 0 || column >= COLUMN_COUNT) return QModelIndex(); - void *parent_ref = (parent.isValid())?parent.internalPointer():NULL ; - uint32_t parent_entry = 0; - int source_id=0 ; - - // We dont need to handle parent==NULL because the conversion will return entry=0 which is what we need. - - if(!convertRefPointerToTabEntry(parent_ref,parent_entry) || parent_entry >= mPosts.size()) - { -#ifdef DEBUG_FORUMMODEL - std::cerr << "index-5(" << row << "," << column << " parent=" << parent << ") : " << "NULL"<< std::endl ; -#endif - return QModelIndex() ; - } - - void *ref = NULL ; - - if(row >= mPosts[parent_entry].children.size() || !convertTabEntryToRefPointer(mPosts[parent_entry].children[row],ref)) - { -#ifdef DEBUG_FORUMMODEL - std::cerr << "index-4(" << row << "," << column << " parent=" << parent << ") : " << "NULL" << std::endl; -#endif - return QModelIndex() ; - } - + void *ref = getChildRef(parent.internalPointer(),row); #ifdef DEBUG_FORUMMODEL std::cerr << "index-3(" << row << "," << column << " parent=" << parent << ") : " << createIndex(row,column,ref) << std::endl; #endif return createIndex(row,column,ref) ; } -QModelIndex RsGxsForumModel::parent(const QModelIndex& child) const +QModelIndex RsGxsForumModel::parent(const QModelIndex& index) const { - void *child_ref = (child.isValid())?child.internalPointer():NULL ; + if(!index.isValid()) + return QModelIndex(); - if(!child_ref) - return QModelIndex() ; + void *child_ref = index.internalPointer(); + int row=0; - ForumModelIndex child_entry ; + void *parent_ref = getParentRef(child_ref,row) ; - if(!convertRefPointerToTabEntry(child_ref,child_entry) || child_entry >= mPosts.size()) - return QModelIndex() ; + if(parent_ref == NULL) // root + return QModelIndex() ; - void *parent_ref =NULL; - ForumModelIndex parent_entry = mPosts[child_entry].parent; - QModelIndex indx; + return createIndex(row,0,parent_ref); +} + +Qt::ItemFlags RsGxsForumModel::flags(const QModelIndex& index) const +{ + if (!index.isValid()) + return 0; + + return QAbstractItemModel::flags(index); +} + +void *RsGxsForumModel::getChildRef(void *ref,int row) const +{ + ForumModelIndex entry ; + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + return NULL ; + + void *new_ref; + if(row >= mPosts[entry].children.size()) + return NULL; + + convertTabEntryToRefPointer(mPosts[entry].children[row],new_ref); + + return new_ref; +} + +void *RsGxsForumModel::getParentRef(void *ref,int& row) const +{ + ForumModelIndex ref_entry; + + if(!convertRefPointerToTabEntry(ref,ref_entry) || ref_entry >= mPosts.size()) + return NULL ; + + ForumModelIndex parent_entry = mPosts[ref_entry].parent; if(parent_entry == 0) // top level index - indx = QModelIndex() ; + { + row = 0; + return NULL ; + } else { - if(!convertTabEntryToRefPointer(parent_entry,parent_ref)) - return QModelIndex() ; + void *parent_ref; + convertTabEntryToRefPointer(parent_entry,parent_ref); + row = mPosts[parent_entry].prow; - indx = createIndex(mPosts[parent_entry].prow,child.column(),parent_ref) ; + return parent_ref; } -#ifdef DEBUG_FORUMMODEL - std::cerr << "parent-1(" << child << ") : " << indx << std::endl; -#endif - return indx; } +int RsGxsForumModel::getChildrenCount(void *ref) const +{ + uint32_t entry = 0 ; + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + return 0 ; + + return mPosts[entry].children.size(); +} + + + +//bool RsGxsForumModel::hasIndex(int row,int column,const QModelIndex& parent) const +//{ +// if(row < 0 || column < 0 || column >= COLUMN_COUNT) +// return false; +// +// if(!parent.isValid()) +// return false; +// +// ForumModelIndex entry; +// +// convertRefPointerToTabEntry(parent.internalPointer(),entry); +// +// if(entry >= mPosts.size()) +// return false; +// +// if(row >= mPosts[entry].children.size()) +// return false; +// +// if(mPosts[entry].children[row] >= mPosts.size()) +// return false; +// +// return true; +//} + QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, int role) const { if(role != Qt::DisplayRole) @@ -203,11 +246,13 @@ QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, i QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const { +#ifdef DEBUG_FORUMMODEL + std::cerr << "calling data(" << index << ") role=" << role << std::endl; +#endif + if(!index.isValid()) return QVariant(); - int coln = index.column() ; - switch(role) { case Qt::SizeHintRole: return sizeHintRole(index.column()) ; @@ -216,8 +261,8 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::WhatsThisRole: case Qt::EditRole: case Qt::ToolTipRole: - case Qt::StatusTipRole: - return QVariant(); + case Qt::StatusTipRole: return QVariant(); + default: break; } void *ref = (index.isValid())?index.internalPointer():NULL ; @@ -266,10 +311,10 @@ QVariant RsGxsForumModel::sizeHintRole(int col) const switch(col) { default: - case COLUMN_TITLE: return QVariant( factor * 170 ); - case COLUMN_READ_STATUS: return QVariant( factor * 10 ); - case COLUMN_DATE: return QVariant( factor * 75 ); - case COLUMN_AUTHOR: return QVariant( factor * 75 ); + case COLUMN_TITLE: return QVariant( QSize(factor * 170, factor*14 )); + case COLUMN_READ_STATUS: return QVariant( QSize(factor * 10 , factor*14 )); + case COLUMN_DATE: return QVariant( QSize(factor * 75 , factor*14 )); + case COLUMN_AUTHOR: return QVariant( QSize(factor * 75 , factor*14 )); } } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index e5fdbf976..a951116a8 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -1,4 +1,20 @@ +#ifdef SUSPENDED_CODE #include "retroshare/rsgxsifacetypes.h" +#else +#include +#include + +struct RsMsgMetaData +{ + std::string mMsgName ; + time_t mPublishTs; + uint32_t mMsgStatus; + QString mAuthorId; +}; + +#endif + +#include // This class holds the actual hierarchy of posts, represented by identifiers // It is responsible for auto-updating when necessary and holds a mutex to allow the Model to @@ -29,17 +45,18 @@ public: enum Roles{ SortRole = Qt::UserRole+1 }; - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - bool hasChildren(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; - QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; - QModelIndex parent(const QModelIndex& child) const; + QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex& child) const override; + Qt::ItemFlags flags(const QModelIndex& index) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QVariant sizeHintRole(int col) const; + QVariant sizeHintRole(int col) const; QVariant displayRole(const RsMsgMetaData& meta, int col) const; QVariant userRole(const RsMsgMetaData& meta, int col) const; QVariant decorationRole(const RsMsgMetaData &meta, int col) const; @@ -47,7 +64,12 @@ public: void update_posts(); private: - static bool convertTabEntryToRefPointer(uint32_t entry,void *& ref); + void *getParentRef(void *ref,int& row) const; + void *getChildRef(void *ref,int row) const; + //bool hasIndex(int row,int column,const QModelIndex& parent)const; + int getChildrenCount(void *ref) const; + + static bool convertTabEntryToRefPointer(uint32_t entry,void *& ref); static bool convertRefPointerToTabEntry(void *ref,uint32_t& entry); std::vector mPosts ; // store the list of posts updated from rsForums. From d8f9559b0e207e333c7b2b1bd761344c17d35c75 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 19 Nov 2018 23:33:19 +0100 Subject: [PATCH 030/110] fixed memory corruption bug in GxsForumModel --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 4 ++-- retroshare-gui/src/gui/gxsforums/GxsForumModel.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 210d4f27f..a3a228374 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -33,7 +33,7 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) mPosts[i].prow = i-1; RsMsgMetaData meta; - meta.mMsgName = "message " + (QString::number(i).toStdString()) ; + meta.mMsgName = std::string("message ") + QString::number(i).toStdString() ; mPosts[i].meta_versions.push_back(meta); } @@ -44,7 +44,7 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) mPosts[N+1].prow = 0; RsMsgMetaData meta; - meta.mMsgName = "message " + (QString::number(N+1).toStdString()) ; + meta.mMsgName = std::string("message ") + QString::number(N+1).toStdString() ; mPosts[N+1].meta_versions.push_back(meta); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index a951116a8..556aff4f9 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -1,4 +1,4 @@ -#ifdef SUSPENDED_CODE +#ifndef SUSPENDED_CODE #include "retroshare/rsgxsifacetypes.h" #else #include From 2066248b3b44747460c244fb9e3dcc344e10e100 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 20 Nov 2018 23:28:07 +0100 Subject: [PATCH 031/110] started updating ForumFillThread to new model --- .../src/gui/gxsforums/GxsForumModel.cpp | 101 ++++++++++++++++-- .../src/gui/gxsforums/GxsForumModel.h | 27 ++++- .../gui/gxsforums/GxsForumThreadWidget.cpp | 1 + .../src/gui/gxsforums/GxsForumsFillThread.cpp | 74 ++++++++++++- 4 files changed, 191 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index a3a228374..91836723f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -260,7 +260,6 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::TextColorRole: case Qt::WhatsThisRole: case Qt::EditRole: - case Qt::ToolTipRole: case Qt::StatusTipRole: return QVariant(); default: break; } @@ -299,11 +298,63 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::DisplayRole: return displayRole (meta,index.column()) ; case Qt::DecorationRole: return decorationRole(meta,index.column()) ; case Qt::UserRole: return userRole (meta,index.column()) ; + case Qt::ToolTipRole: return toolTipRole (meta,index.column()) + + case ThreadPinnedRole: return pinnedRole(index.column()) ; + case MissingRole: return missingRole(index.column()) ; + case StatusRole: return statusRole(index.column()) ; default: return QVariant(); } } +QVariant RsGxsForumModel::statusRole(int column,const ForumModelPostEntry& fmpe) +{ + if(column != COLUMN_THREAD_DATA) + return QVariant(); + + return QVariant(fmpe.mMsgStatus); +} + +QVariant RsGxsForumModel::missingRole(int column,const ForumModelPostEntry& fmpe) +{ + if(column != COLUMN_THREAD_DATA) + return QVariant(); + + if(fmpe.mPostFlags & FLAG_POST_IS_MISSING) + return QVariant(true); + else + return QVariant(false); +} + +QVariant RsGxsForumModel::toolTipRole(int column,const ForumModelPostEntry& fmpe) +{ + if(column != COLUMN_THREAD_DISTRIBUTION) + return QVariant(); + + switch(fmpe.mReputationWaningLevel) + { + case 3: return QVariant(tr("Information for this identity is currently missing.")) ; + case 2: return QVariant(tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.")) ; + case 1: return QVariant(tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.")) ; + case 0: return QVariant(tr("Message will be forwarded to your friends.") ; + default: + return QVariant("[ERROR: missing reputation level information - contact the developers]"); + } +} + +QVariant RsGxsForumModel::pinnedRole(int column,const ForumModelPostEntry& fmpe) +{ + if(column != COLUMN_THREAD_DATE) + return QVariant(); + + if(fmpe.mFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) + return QVariant(true); + else + return QVariant(false); +} + + QVariant RsGxsForumModel::sizeHintRole(int col) const { float factor = QFontMetricsF(QApplication::font()).height()/14.0f ; @@ -318,15 +369,50 @@ QVariant RsGxsForumModel::sizeHintRole(int col) const } } +QVariant RsGxsForumModel::authorRole(int column,const ForumModelPostEntry& fmpe) +{ + if(column == COLUMN_THREAD_DATA) + return QVariant(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())); + + return QVariant(); +} + +QVariant RsGxsForumModel::sortRole(int column,const ForumModelPostEntry& fmpe) +{ + if(column == COLUMN_THREAD_DATA) + return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here + +} + QVariant RsGxsForumModel::displayRole(const RsMsgMetaData& meta,int col) const { switch(col) { - case COLUMN_TITLE: return QVariant(QString::fromUtf8(meta.mMsgName.c_str())); - case COLUMN_READ_STATUS: return QVariant(meta.mMsgStatus); - case COLUMN_DATE: return QVariant(qulonglong(meta.mPublishTs)); - case COLUMN_AUTHOR: return QVariant(QString::fromStdString(meta.mAuthorId.toStdString())); + case COLUMN_TITLE: if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_REDACTED) + return QVariant(tr("[ ... Redacted message ... ]")); + else if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) + return QVariant(tr("[PINNED] ") + QString::fromUtf8(msg.mMeta.mMsgName.c_str())); + else + return QVariant(QString::fromUtf8(msg.mMeta.mMsgName.c_str())); + case COLUMN_READ_STATUS:return QVariant(meta.mMsgStatus); + case COLUMN_DATE: { + QDateTime qtime; + qtime.setTime_t(msg.mMeta.mPublishTs); + + return QVariant(DateTime::formatDateTime(qtime)); + } + + case COLUMN_AUTHOR: return QVariant(QString::fromStdString(meta.mAuthorId.toStdString())); + case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(meta.mMsgId.toStdString())); +#ifdef TODO + if (filterColumn == COLUMN_THREAD_CONTENT) { + // need content for filter + QTextDocument doc; + doc.setHtml(QString::fromUtf8(msg.mMsg.c_str())); + item->setText(COLUMN_THREAD_CONTENT, doc.toPlainText().replace(QString("\n"), QString(" "))); + } +#endif default: return QVariant("[ TODO ]"); } @@ -381,7 +467,10 @@ QVariant RsGxsForumModel::userRole(const RsMsgMetaData &meta, int col) const QVariant RsGxsForumModel::decorationRole(const RsMsgMetaData& meta,int col) const { - return QVariant(); + if(col == COLUMN_THREAD_DISTRIBUTION) + return QVariant(fmpe.mReputationWarningLevel); + else + return QVariant(); } void RsGxsForumModel::update_posts() diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 556aff4f9..384367097 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -24,12 +24,25 @@ struct RsMsgMetaData typedef uint32_t ForumModelIndex; -struct ForumPostEntry +struct ForumModelPostEntry { + typedef enum { // flags for display of posts + FLAG_POST_IS_PINNED = 0x0001, + FLAG_POST_IS_MISSING = 0x0002, + FLAG_POST_IS_REDACTED = 0x0004, + }; + + std::string mTitle ; + RsGxsId mAuthorId ; + RsGxsMessageId mMsgId; + uint32_t mPublishTs; + uint32_t mPostFlags; + int mReputationWarningLevel; + std::vector meta_versions; // maybe we don't need all this. Could be too large. - std::vector children; - ForumModelIndex parent; + std::vector mChildren; + ForumModelIndex mParent; int prow ; // parent row }; @@ -43,7 +56,11 @@ public: explicit RsGxsForumModel(QObject *parent = NULL); ~RsGxsForumModel(){} - enum Roles{ SortRole = Qt::UserRole+1 }; + enum Roles{ SortRole = Qt::UserRole+1, + ThreadPinnedRole = Qt::UserRole+2, + MissingRole = Qt::UserRole+3, + StatusRole = Qt::UserRole+4, + }; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; @@ -72,5 +89,5 @@ private: static bool convertTabEntryToRefPointer(uint32_t entry,void *& ref); static bool convertRefPointerToTabEntry(void *ref,uint32_t& entry); - std::vector mPosts ; // store the list of posts updated from rsForums. + std::vector mPosts ; // store the list of posts updated from rsForums. }; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d33aab4eb..48609a9c0 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1427,6 +1427,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum return item; } + QTreeWidgetItem *GxsForumThreadWidget::generateMissingItem(const RsGxsMessageId &msgId) { GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp index 7545e4f07..f0c61d877 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp @@ -23,9 +23,10 @@ #include "GxsForumsFillThread.h" #include "GxsForumThreadWidget.h" +#include "GxsForumModel.h" #include "retroshare/rsgxsflags.h" -#include +#include "retroshare/rsgxsforums.h" #include #include @@ -553,4 +554,75 @@ void GxsForumsFillThread::run() deleteLater(); } +QTreeWidgetItem *GxsForumsFillThread::convertMsgToThreadWidget(const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn, ForumModelIndex parent) +{ + ForumModelPostEntry fentry; + fentry.mMsgId = msg.mMeta.mMsgId; + fentry.mPublishTs = msg.mMeta.mPublishTs; + fentry.mParent = parent; + + if(mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) + fentry.mFlags |= ForumModelPostEntry::FLAG_POST_IS_PINNED; + + // Early check for a message that should be hidden because its author + // is flagged with a bad reputation + + uint32_t idflags =0; + RsReputations::ReputationLevel reputation_level = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId,&idflags) ; + bool redacted = false; + + if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) + fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_REDACTED; + + // We use a specific item model for forums in order to handle the post pinning. + + if(reputation_level == RsReputations::REPUTATION_UNKNOWN) + fentry.mReputationWarningLevel = 3 ; + else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) + fentry.mReputationWarningLevel = 2 ; + else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(mForumGroup.mMeta.mSignFlags,idflags)) + fentry.mReputationWarningLevel = 1 ; + else + fentry.mReputationWarningLevel = 0 ; + +#ifdef TODO + // This is an attempt to put pinned posts on the top. We should rather use a QSortFilterProxyModel here. + QString itemSort = QString::number(msg.mMeta.mPublishTs);//Don't need to format it as for sort. + + if (useChildTS) + { + for(QTreeWidgetItem *grandParent = parent; grandParent!=NULL; grandParent = grandParent->parent()) + { + //Update Parent Child TimeStamp + QString oldTSSort = grandParent->data(COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); + + QString oldCTSSort = oldTSSort.split("|").at(0); + QString oldPTSSort = oldTSSort.contains("|") ? oldTSSort.split(" | ").at(1) : oldCTSSort; +#ifdef SHOW_COMBINED_DATES + QString oldTSText = grandParent->text(COLUMN_THREAD_DATE); + QString oldCTSText = oldTSText.split("|").at(0); + QString oldPTSText = oldTSText.contains("|") ? oldTSText.split(" | ").at(1) : oldCTSText;//If first time parent get only its mPublishTs + #endif + if (oldCTSSort.toDouble() < itemSort.toDouble()) + { +#ifdef SHOW_COMBINED_DATES + grandParent->setText(COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); +#endif + grandParent->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); + } + } + } +#endif +//#TODO +#if 0 + if (IS_GROUP_SUBSCRIBED(subscribeFlags) && !(msginfo.mMsgFlags & RS_DISTRIB_MISSING_MSG)) { + rsGxsForums->getMessageStatus(msginfo.forumId, msginfo.msgId, status); + } else { + // show message as read + status = RSGXS_MSG_STATUS_READ; + } +#endif + if (parent) parent->addChild(item); + return item; +} From d3565c2ee4436526fb2c7a8ec73dcfd0de8b6f19 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 21 Nov 2018 23:18:08 +0100 Subject: [PATCH 032/110] implemented update of posts for new model. Unfinished yet. --- .../src/gui/gxsforums/GxsForumModel.cpp | 703 +++++++++++++----- .../src/gui/gxsforums/GxsForumModel.h | 35 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 13 - .../src/gui/gxsforums/GxsForumsFillThread.cpp | 71 -- 4 files changed, 545 insertions(+), 277 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 91836723f..08eb676d8 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -2,15 +2,24 @@ #include #include +#include "util/qtthreadsutils.h" #include "GxsForumModel.h" +#include "retroshare/rsgxsforums.h" #define DEBUG_FORUMMODEL -#define COLUMN_TITLE 0 -#define COLUMN_READ_STATUS 1 -#define COLUMN_DATE 2 -#define COLUMN_AUTHOR 3 -#define COLUMN_COUNT 4 +#define COLUMN_THREAD_TITLE 0 +#define COLUMN_THREAD_READ 1 +#define COLUMN_THREAD_DATE 2 +#define COLUMN_THREAD_DISTRIBUTION 3 +#define COLUMN_THREAD_AUTHOR 4 +#define COLUMN_THREAD_SIGNED 5 +#define COLUMN_THREAD_CONTENT 6 +#define COLUMN_THREAD_COUNT 7 +#define COLUMN_THREAD_MSGID 8 +#define COLUMN_THREAD_NB_COLUMNS 9 + +#define COLUMN_THREAD_DATA 0 // column for storing the userdata like parentid Q_DECLARE_METATYPE(RsMsgMetaData); @@ -21,31 +30,29 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) { mPosts.resize(1); // adds a sentinel item - // adds some fake posts to debug - - int N=5 ; - mPosts.resize(N+1); - - for(int i=1;i<=N;++i) - { - mPosts[0].children.push_back(ForumModelIndex(i)); - mPosts[i].parent = ForumModelIndex(0); - mPosts[i].prow = i-1; - - RsMsgMetaData meta; - meta.mMsgName = std::string("message ") + QString::number(i).toStdString() ; - mPosts[i].meta_versions.push_back(meta); - } - - // add one child to last post - mPosts.resize(N+2); - mPosts[N].children.push_back(ForumModelIndex(N+1)); - mPosts[N+1].parent = ForumModelIndex(N); - mPosts[N+1].prow = 0; - - RsMsgMetaData meta; - meta.mMsgName = std::string("message ") + QString::number(N+1).toStdString() ; - mPosts[N+1].meta_versions.push_back(meta); +// // adds some fake posts to debug +// +// int N=5 ; +// mPosts.resize(N+1); +// +// for(int i=1;i<=N;++i) +// { +// mPosts[0].mChildren.push_back(ForumModelIndex(i)); +// mPosts[i].mParent = ForumModelIndex(0); +// mPosts[i].prow = i-1; +// +// RsMsgMetaData meta; +// meta.mMsgName = std::string("message ") + QString::number(i).toStdString() ; +// } +// +// // add one child to last post +// mPosts.resize(N+2); +// mPosts[N].mChildren.push_back(ForumModelIndex(N+1)); +// mPosts[N+1].mParent = ForumModelIndex(N); +// mPosts[N+1].prow = 0; +// +// RsMsgMetaData meta; +// meta.mMsgName = std::string("message ") + QString::number(N+1).toStdString() ; } int RsGxsForumModel::rowCount(const QModelIndex& parent) const @@ -63,7 +70,7 @@ int RsGxsForumModel::rowCount(const QModelIndex& parent) const } int RsGxsForumModel::columnCount(const QModelIndex &parent) const { - return COLUMN_COUNT ; + return COLUMN_THREAD_COUNT ; } bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const @@ -83,9 +90,9 @@ bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const } #ifdef DEBUG_FORUMMODEL - std::cerr << "hasChildren-3(" << parent << ") : " << !mPosts[entry].children.empty() << std::endl; + std::cerr << "hasChildren-3(" << parent << ") : " << !mPosts[entry].mChildren.empty() << std::endl; #endif - return !mPosts[entry].children.empty(); + return !mPosts[entry].mChildren.empty(); } bool RsGxsForumModel::convertTabEntryToRefPointer(uint32_t entry,void *& ref) @@ -119,7 +126,7 @@ bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & parent) const { // if(!hasIndex(row,column,parent)) - if(row < 0 || column < 0 || column >= COLUMN_COUNT) + if(row < 0 || column < 0 || column >= COLUMN_THREAD_COUNT) return QModelIndex(); void *ref = getChildRef(parent.internalPointer(),row); @@ -161,10 +168,10 @@ void *RsGxsForumModel::getChildRef(void *ref,int row) const return NULL ; void *new_ref; - if(row >= mPosts[entry].children.size()) + if(row >= mPosts[entry].mChildren.size()) return NULL; - convertTabEntryToRefPointer(mPosts[entry].children[row],new_ref); + convertTabEntryToRefPointer(mPosts[entry].mChildren[row],new_ref); return new_ref; } @@ -176,7 +183,7 @@ void *RsGxsForumModel::getParentRef(void *ref,int& row) const if(!convertRefPointerToTabEntry(ref,ref_entry) || ref_entry >= mPosts.size()) return NULL ; - ForumModelIndex parent_entry = mPosts[ref_entry].parent; + ForumModelIndex parent_entry = mPosts[ref_entry].mParent; if(parent_entry == 0) // top level index { @@ -200,7 +207,7 @@ int RsGxsForumModel::getChildrenCount(void *ref) const if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) return 0 ; - return mPosts[entry].children.size(); + return mPosts[entry].mChildren.size(); } @@ -237,10 +244,9 @@ QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, i switch(section) { default: - case COLUMN_TITLE: return tr("Title"); - case COLUMN_READ_STATUS: return tr("Read Status"); - case COLUMN_DATE: return tr("Date"); - case COLUMN_AUTHOR: return tr("Author"); + case COLUMN_THREAD_TITLE: return tr("Title"); + case COLUMN_THREAD_DATE: return tr("Date"); + case COLUMN_THREAD_AUTHOR: return tr("Author"); } } @@ -287,7 +293,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const return QVariant() ; } - const RsMsgMetaData& meta(mPosts[entry].meta_versions[0]) ; + const ForumModelPostEntry& fmpe(mPosts[entry]); #ifdef DEBUG_FORUMMODEL std::cerr << " [ok]" << std::endl; @@ -295,60 +301,60 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const switch(role) { - case Qt::DisplayRole: return displayRole (meta,index.column()) ; - case Qt::DecorationRole: return decorationRole(meta,index.column()) ; - case Qt::UserRole: return userRole (meta,index.column()) ; - case Qt::ToolTipRole: return toolTipRole (meta,index.column()) + case Qt::DisplayRole: return displayRole (fmpe,index.column()) ; + case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ; + case Qt::UserRole: return userRole (fmpe,index.column()) ; + case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; - case ThreadPinnedRole: return pinnedRole(index.column()) ; - case MissingRole: return missingRole(index.column()) ; - case StatusRole: return statusRole(index.column()) ; + case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; + case MissingRole: return missingRole (fmpe,index.column()) ; + case StatusRole: return statusRole (fmpe,index.column()) ; default: return QVariant(); } } -QVariant RsGxsForumModel::statusRole(int column,const ForumModelPostEntry& fmpe) +QVariant RsGxsForumModel::statusRole(const ForumModelPostEntry& fmpe,int column) const { if(column != COLUMN_THREAD_DATA) return QVariant(); - return QVariant(fmpe.mMsgStatus); + return QVariant(fmpe.mStatus); } -QVariant RsGxsForumModel::missingRole(int column,const ForumModelPostEntry& fmpe) +QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column) const { if(column != COLUMN_THREAD_DATA) return QVariant(); - if(fmpe.mPostFlags & FLAG_POST_IS_MISSING) + if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING) return QVariant(true); else return QVariant(false); } -QVariant RsGxsForumModel::toolTipRole(int column,const ForumModelPostEntry& fmpe) +QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column) const { if(column != COLUMN_THREAD_DISTRIBUTION) return QVariant(); - switch(fmpe.mReputationWaningLevel) + switch(fmpe.mReputationWarningLevel) { case 3: return QVariant(tr("Information for this identity is currently missing.")) ; case 2: return QVariant(tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.")) ; case 1: return QVariant(tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.")) ; - case 0: return QVariant(tr("Message will be forwarded to your friends.") ; + case 0: return QVariant(tr("Message will be forwarded to your friends.")) ; default: return QVariant("[ERROR: missing reputation level information - contact the developers]"); } } -QVariant RsGxsForumModel::pinnedRole(int column,const ForumModelPostEntry& fmpe) +QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) const { if(column != COLUMN_THREAD_DATE) return QVariant(); - if(fmpe.mFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) + if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) return QVariant(true); else return QVariant(false); @@ -362,14 +368,13 @@ QVariant RsGxsForumModel::sizeHintRole(int col) const switch(col) { default: - case COLUMN_TITLE: return QVariant( QSize(factor * 170, factor*14 )); - case COLUMN_READ_STATUS: return QVariant( QSize(factor * 10 , factor*14 )); - case COLUMN_DATE: return QVariant( QSize(factor * 75 , factor*14 )); - case COLUMN_AUTHOR: return QVariant( QSize(factor * 75 , factor*14 )); + case COLUMN_THREAD_TITLE: return QVariant( QSize(factor * 170, factor*14 )); + case COLUMN_THREAD_DATE: return QVariant( QSize(factor * 75 , factor*14 )); + case COLUMN_THREAD_AUTHOR: return QVariant( QSize(factor * 75 , factor*14 )); } } -QVariant RsGxsForumModel::authorRole(int column,const ForumModelPostEntry& fmpe) +QVariant RsGxsForumModel::authorRole(const ForumModelPostEntry& fmpe,int column) const { if(column == COLUMN_THREAD_DATA) return QVariant(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())); @@ -377,34 +382,34 @@ QVariant RsGxsForumModel::authorRole(int column,const ForumModelPostEntry& fmpe) return QVariant(); } -QVariant RsGxsForumModel::sortRole(int column,const ForumModelPostEntry& fmpe) +QVariant RsGxsForumModel::sortRole(const ForumModelPostEntry& fmpe,int column) const { if(column == COLUMN_THREAD_DATA) return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here } -QVariant RsGxsForumModel::displayRole(const RsMsgMetaData& meta,int col) const +QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) const { switch(col) { - case COLUMN_TITLE: if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_REDACTED) + case COLUMN_THREAD_TITLE: if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_REDACTED) return QVariant(tr("[ ... Redacted message ... ]")); else if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) - return QVariant(tr("[PINNED] ") + QString::fromUtf8(msg.mMeta.mMsgName.c_str())); + return QVariant(tr("[PINNED] ") + QString::fromUtf8(fmpe.mTitle.c_str())); else - return QVariant(QString::fromUtf8(msg.mMeta.mMsgName.c_str())); + return QVariant(QString::fromUtf8(fmpe.mTitle.c_str())); - case COLUMN_READ_STATUS:return QVariant(meta.mMsgStatus); - case COLUMN_DATE: { + //case COLUMN_THREAD_READ_STATUS:return QVariant(fmpe.mMsgStatus); + case COLUMN_THREAD_DATE: { QDateTime qtime; - qtime.setTime_t(msg.mMeta.mPublishTs); + qtime.setTime_t(fmpe.mPublishTs); - return QVariant(DateTime::formatDateTime(qtime)); + return QVariant(QDateTime::formatDateTime(qtime)); } - case COLUMN_AUTHOR: return QVariant(QString::fromStdString(meta.mAuthorId.toStdString())); - case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(meta.mMsgId.toStdString())); + case COLUMN_THREAD_AUTHOR: return QVariant(QString::fromStdString(fmpe.mAuthorId.toStdString())); + case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(fmpe.mMsgId.toStdString())); #ifdef TODO if (filterColumn == COLUMN_THREAD_CONTENT) { // need content for filter @@ -421,51 +426,7 @@ QVariant RsGxsForumModel::displayRole(const RsMsgMetaData& meta,int col) const return QVariant("[ERROR]"); } -QVariant RsGxsForumModel::userRole(const RsMsgMetaData &meta, int col) const -{ -#ifdef TODO - switch(col) - { - case COLUMN_PROGRESS: - { - FileChunksInfo fcinfo; - if (!rsFiles->FileDownloadChunksDetails(fileInfo.hash, fcinfo)) - return QVariant(); - - FileProgressInfo pinfo; - pinfo.cmap = fcinfo.chunks; - pinfo.type = FileProgressInfo::DOWNLOAD_LINE; - pinfo.progress = (fileInfo.size == 0) ? 0 : (fileInfo.transfered * 100.0 / fileInfo.size); - pinfo.nb_chunks = pinfo.cmap._map.empty() ? 0 : fcinfo.chunks.size(); - - for (uint32_t i = 0; i < fcinfo.chunks.size(); ++i) - switch(fcinfo.chunks[i]) - { - case FileChunksInfo::CHUNK_CHECKING: pinfo.chunks_in_checking.push_back(i); - break ; - case FileChunksInfo::CHUNK_ACTIVE: pinfo.chunks_in_progress.push_back(i); - break ; - case FileChunksInfo::CHUNK_DONE: - case FileChunksInfo::CHUNK_OUTSTANDING: - break ; - } - - return QVariant::fromValue(pinfo); - } - - case COLUMN_ID: return QVariant(QString::fromStdString(fileInfo.hash.toStdString())); - - - default: - return QVariant(); - } - } -#endif - return QVariant(); - -} - -QVariant RsGxsForumModel::decorationRole(const RsMsgMetaData& meta,int col) const +QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col) const { if(col == COLUMN_THREAD_DISTRIBUTION) return QVariant(fmpe.mReputationWarningLevel); @@ -473,77 +434,451 @@ QVariant RsGxsForumModel::decorationRole(const RsMsgMetaData& meta,int col) cons return QVariant(); } -void RsGxsForumModel::update_posts() +void RsGxsForumModel::setForum(const RsGxsGroupId& forumGroup) { + if(mForumGroupId == forumGroup) + return ; + + mPosts.clear(); + mForumGroupId = forumGroup; + + update_posts(); +} + +void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) +{ + RsThread::async([this, group_id]() + { + // 1 - get message data from p3GxsForums + + std::list forumIds; + std::vector messages; + std::vector groups; + + forumIds.push_back(group_id); + + if(!rsGxsForums->getForumsInfo(forumIds,groups)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum group info for forum " << group_id << std::endl; + return; + } + + if(!rsGxsForums->getForumsContent(forumIds,messages)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum message info for forum " << group_id << std::endl; + return; + } + + // 2 - sort the messages into a proper hierarchy + + std::vector *vect = new std::vector(); + + computeMessagesHierarchy(groups[0],messages,*vect); + + // 3 - update the model in the UI thread. + + RsQThreadUtils::postToObject( [vect,this]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + + setPosts(*vect) ; + delete vect; + + + }, this ); + + }); +} + +ForumModelIndex RsGxsForumModel::addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent) +{ + uint32_t N = posts.size(); + posts.push_back(entry); + + posts[N].mParent = parent; + posts[parent].mChildren.push_back(N); + + return ForumModelIndex(N); +} + +void RsGxsForumModel::generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry) +{ + entry.mPostFlags = ForumModelPostEntry::FLAG_POST_IS_MISSING ; + entry.mTitle = std::string(tr("[ ... Missing Message ... ]").toUtf8()); + entry.mMsgId = msgId; + entry.mAuthorId.clear(); + entry.mPublishTs=0; + entry.mReputationWarningLevel = 3; +} + +void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn,ForumModelPostEntry& fentry) +{ + fentry.mMsgId = msg.mMeta.mMsgId; + fentry.mPublishTs = msg.mMeta.mPublishTs; + fentry.mStatus = msg.mMeta.mMsgStatus; + + if(mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) + fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_PINNED; + + // Early check for a message that should be hidden because its author + // is flagged with a bad reputation + + uint32_t idflags =0; + RsReputations::ReputationLevel reputation_level = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId,&idflags) ; + bool redacted = false; + + if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) + fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_REDACTED; + + // We use a specific item model for forums in order to handle the post pinning. + + if(reputation_level == RsReputations::REPUTATION_UNKNOWN) + fentry.mReputationWarningLevel = 3 ; + else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) + fentry.mReputationWarningLevel = 2 ; + else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(mForumGroup.mMeta.mSignFlags,idflags)) + fentry.mReputationWarningLevel = 1 ; + else + fentry.mReputationWarningLevel = 0 ; + #ifdef TODO - std::list downHashes; - rsFiles->FileDownloads(downHashes); + // This is an attempt to put pinned posts on the top. We should rather use a QSortFilterProxyModel here. + QString itemSort = QString::number(msg.mMeta.mPublishTs);//Don't need to format it as for sort. - size_t old_size = mDownloads.size(); - - mDownloads.resize(downHashes.size()) ; - - if(old_size < mDownloads.size()) + if (useChildTS) { - beginInsertRows(QModelIndex(), old_size, mDownloads.size()-1); - insertRows(old_size, mDownloads.size() - old_size); - endInsertRows(); - } - else if(mDownloads.size() < old_size) - { - beginRemoveRows(QModelIndex(), mDownloads.size(), old_size-1); - removeRows(mDownloads.size(), old_size - mDownloads.size()); - endRemoveRows(); - } - - uint32_t i=0; - - for(auto it(downHashes.begin());it!=downHashes.end();++it,++i) - { - FileInfo fileInfo(mDownloads[i]); // we dont update the data itself but only a copy of it.... - int old_size = fileInfo.peers.size() ; - - rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, fileInfo); - - int new_size = fileInfo.peers.size() ; - - if(old_size < new_size) + for(QTreeWidgetItem *grandParent = parent; grandParent!=NULL; grandParent = grandParent->parent()) { - beginInsertRows(index(i,0), old_size, new_size-1); - insertRows(old_size, new_size - old_size,index(i,0)); -#ifdef DEBUG_DOWNLOADLIST - std::cerr << "called insert rows ( " << old_size << ", " << new_size - old_size << ",index(" << index(i,0)<< "))" << std::endl; + //Update Parent Child TimeStamp + QString oldTSSort = grandParent->data(COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); + + QString oldCTSSort = oldTSSort.split("|").at(0); + QString oldPTSSort = oldTSSort.contains("|") ? oldTSSort.split(" | ").at(1) : oldCTSSort; +#ifdef SHOW_COMBINED_DATES + QString oldTSText = grandParent->text(COLUMN_THREAD_DATE); + QString oldCTSText = oldTSText.split("|").at(0); + QString oldPTSText = oldTSText.contains("|") ? oldTSText.split(" | ").at(1) : oldCTSText;//If first time parent get only its mPublishTs + #endif + if (oldCTSSort.toDouble() < itemSort.toDouble()) + { +#ifdef SHOW_COMBINED_DATES + grandParent->setText(COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); #endif - endInsertRows(); + grandParent->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); + } } - else if(new_size < old_size) - { - beginRemoveRows(index(i,0), new_size, old_size-1); - removeRows(new_size, old_size - new_size,index(i,0)); -#ifdef DEBUG_DOWNLOADLIST - std::cerr << "called remove rows ( " << old_size << ", " << old_size - new_size << ",index(" << index(i,0)<< "))" << std::endl; -#endif - endRemoveRows(); - } - - uint32_t old_status = mDownloads[i].downloadStatus ; - - mDownloads[i] = fileInfo ; // ... because insertRows() calls rowCount() which needs to be consistent with the *old* number of rows. - - if(fileInfo.downloadStatus == FT_STATE_DOWNLOADING || old_status != fileInfo.downloadStatus) - { - QModelIndex topLeft = createIndex(i,0), bottomRight = createIndex(i, COLUMN_COUNT-1); - emit dataChanged(topLeft, bottomRight); - } - - // This is apparently not needed. - // - // if(!mDownloads.empty()) - // { - // QModelIndex topLeft = createIndex(0,0), bottomRight = createIndex(mDownloads.size()-1, COLUMN_COUNT-1); - // emit dataChanged(topLeft, bottomRight); - // mDownloads[i] = fileInfo ; - // } } #endif } + +static bool decreasing_time_comp(const QPair& e1,const QPair& e2) { return e2.first < e1.first ; } + +void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_group,const std::vector& msgs_array,std::vector& posts) +{ + std::cerr << "updating messages data with " << msgs_array.size() << " messages" << std::endl; + +//#ifdef DEBUG_FORUMS + std::cerr << "Retrieved group data: " << std::endl; + std::cerr << " Group ID: " << forum_group.mMeta.mGroupId << std::endl; + std::cerr << " Admin lst: " << forum_group.mAdminList.ids.size() << " elements." << std::endl; + for(auto it(forum_group.mAdminList.ids.begin());it!=forum_group.mAdminList.ids.end();++it) + std::cerr << " " << *it << std::endl; + std::cerr << " Pinned Post: " << forum_group.mPinnedPosts.ids.size() << " messages." << std::endl; + for(auto it(forum_group.mPinnedPosts.ids.begin());it!=forum_group.mPinnedPosts.ids.end();++it) + std::cerr << " " << *it << std::endl; +//#endif + + /* get messages */ + std::map msgs; + + for(uint32_t i=0;i > > mPostVersions ; + + // ThreadList contains the list of parent threads. The algorithm below iterates through all messages + // and tries to establish parenthood relationships between them, given that we only know the + // immediate parent of a message and now its children. Some messages have a missing parent and for them + // a fake top level parent is generated. + + // In order to be efficient, we first create a structure that lists the children of every mesage ID in the list. + // Then the hierarchy of message is build by attaching the kids to every message until all of them have been processed. + // The messages with missing parents will be the last ones remaining in the list. + + std::list > threadStack; + std::map > kids_array ; + std::set missing_parents; + + // First of all, remove all older versions of posts. This is done by first adding all posts into a hierarchy structure + // and then removing all posts which have a new versions available. The older versions are kept appart. + +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() Collecting post versions" << std::endl; +#endif + mPostVersions.clear(); + std::list msg_stack ; + + for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) + { + if(!msgIt->second.mMeta.mOrigMsgId.isNull() && msgIt->second.mMeta.mOrigMsgId != msgIt->second.mMeta.mMsgId) + { +#ifdef DEBUG_FORUMS + std::cerr << " Post " << msgIt->second.mMeta.mMsgId << " is a new version of " << msgIt->second.mMeta.mOrigMsgId << std::endl; +#endif + std::map::iterator msgIt2 = msgs.find(msgIt->second.mMeta.mOrigMsgId); + + // Ensuring that the post exists allows to only collect the existing data. + + if(msgIt2 == msgs.end()) + continue ; + + // Make sure that the author is the same than the original message, or is a moderator. This should always happen when messages are constructed using + // the UI but nothing can prevent a nasty user to craft a new version of a message with his own signature. + + if(msgIt2->second.mMeta.mAuthorId != msgIt->second.mMeta.mAuthorId) + { + if( !IS_FORUM_MSG_MODERATION(msgIt->second.mMeta.mMsgFlags) ) // if authors are different the moderation flag needs to be set on the editing msg + continue ; + + if( forum_group.mAdminList.ids.find(msgIt->second.mMeta.mAuthorId)==forum_group.mAdminList.ids.end()) // if author is not a moderator, continue + continue ; + } + + // always add the post a self version + + if(mPostVersions[msgIt->second.mMeta.mOrigMsgId].empty()) + mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(QPair(msgIt2->second.mMeta.mPublishTs,msgIt2->second.mMeta.mMsgId)) ; + + mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(QPair(msgIt->second.mMeta.mPublishTs,msgIt->second.mMeta.mMsgId)) ; + } + } + + // The following code assembles all new versions of a given post into the same array, indexed by the oldest version of the post. + + for(QMap > >::iterator it(mPostVersions.begin());it!=mPostVersions.end();++it) + { + QVector >& v(*it) ; + + for(int32_t i=0;i > >::iterator it2 = mPostVersions.find(sub_msg_id); + + if(it2 != mPostVersions.end()) + { + for(int32_t j=0;j<(*it2).size();++j) + if((*it2)[j].second != sub_msg_id) // dont copy it, since it is already present at slot i + v.append((*it2)[j]) ; + + mPostVersions.erase(it2) ; // it2 is never equal to it + } + } + } + } + + + // Now remove from msg ids, all posts except the most recent one. And make the mPostVersion be indexed by the most recent version of the post, + // which corresponds to the item in the tree widget. + +#ifdef DEBUG_FORUMS + std::cerr << "Final post versions: " << std::endl; +#endif + QMap > > mTmp; + std::map most_recent_versions ; + + for(QMap > >::iterator it(mPostVersions.begin());it!=mPostVersions.end();++it) + { +#ifdef DEBUG_FORUMS + std::cerr << "Original post: " << it.key() << std::endl; +#endif + // Finally, sort the posts from newer to older + + qSort((*it).begin(),(*it).end(),decreasing_time_comp) ; + +#ifdef DEBUG_FORUMS + std::cerr << " most recent version " << (*it)[0].first << " " << (*it)[0].second << std::endl; +#endif + for(int32_t i=1;i<(*it).size();++i) + { + msgs.erase((*it)[i].second) ; + +#ifdef DEBUG_FORUMS + std::cerr << " older version " << (*it)[i].first << " " << (*it)[i].second << std::endl; +#endif + } + + mTmp[(*it)[0].second] = *it ; // index the versions map by the ID of the most recent post. + + // Now make sure that message parents are consistent. Indeed, an old post may have the old version of a post as parent. So we need to change that parent + // to the newest version. So we create a map of which is the most recent version of each message, so that parent messages can be searched in it. + + for(int i=1;i<(*it).size();++i) + most_recent_versions[(*it)[i].second] = (*it)[0].second ; + } + mPostVersions = mTmp ; + + // The next step is to find the top level thread messages. These are defined as the messages without + // any parent message ID. + + // this trick is needed because while we remove messages, the parents a given msg may already have been removed + // and wrongly understand as a missing parent. + + std::map kept_msgs; + + for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) + { + + if(mFlatView || msgIt->second.mMeta.mParentId.isNull()) + { + + /* add all threads */ + const RsGxsForumMsg& msg = msgIt->second; + +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() Adding TopLevel Thread: mId: " << msg.mMeta.mMsgId << std::endl; +#endif + + ForumModelPostEntry entry; + convertMsgToThreadWidget(msg, mUseChildTS, mFilterColumn,NULL,entry); + + ForumModelIndex entry_index = addEntry(posts,entry,0); + + if (!mFlatView) + threadStack.push_back(std::make_pair(msg.mMeta.mMsgId,entry_index)) ; + + //calculateExpand(msg, item); + //mItems.append(entry_index); + } + else + { +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() Storing kid " << msgIt->first << " of message " << msgIt->second.mMeta.mParentId << std::endl; +#endif + // The same missing parent may appear multiple times, so we first store them into a unique container. + + RsGxsMessageId parent_msg = msgIt->second.mMeta.mParentId; + + if(msgs.find(parent_msg) == msgs.end()) + { + // also check that the message is not versionned + + std::map::const_iterator mrit = most_recent_versions.find(parent_msg) ; + + if(mrit != most_recent_versions.end()) + parent_msg = mrit->second ; + else + missing_parents.insert(parent_msg); + } + + kids_array[parent_msg].push_back(msgIt->first) ; + kept_msgs.insert(*msgIt) ; + } + } + + msgs = kept_msgs; + + // Also create a list of posts by time, when they are new versions of existing posts. Only the last one will have an item created. + + // Add a fake toplevel item for the parent IDs that we dont actually have. + + for(std::set::const_iterator it(missing_parents.begin());it!=missing_parents.end();++it) + { + // add dummy parent item + ForumModelPostEntry e ; + generateMissingItem(RsGxsMessageId,e); + + ForumModelIndex e_index = addEntry(posts,e,0); // no parent -> parent is level 0 + //mItems.append( e_index ); + + threadStack.push_back(std::make_pair(*it,e_index)) ; + } +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() Processing stack:" << std::endl; +#endif + // Now use a stack to go down the hierarchy + + while (!threadStack.empty()) + { + std::pair threadPair = threadStack.front(); + threadStack.pop_front(); + + std::map >::iterator it = kids_array.find(threadPair.first) ; + +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() Node: " << threadPair.first << std::endl; +#endif + if(it == kids_array.end()) + continue ; + + + for(std::list::const_iterator it2(it->second.begin());it2!=it->second.end();++it2) + { + // We iterate through the top level thread items, and look for which message has the current item as parent. + // When found, the item is put in the thread list itself, as a potential new parent. + + std::map::iterator mit = msgs.find(*it2) ; + + if(mit == msgs.end()) + { + std::cerr << "GxsForumsFillThread::run() Cannot find submessage " << *it2 << " !!!" << std::endl; + continue ; + } + + const RsGxsForumMsg& msg(mit->second) ; +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() adding sub_item " << msg.mMeta.mMsgId << std::endl; +#endif + + + ForumModelPostEntry e ; + convertMsgToPostEntry(forum_group,msg,mUseChildTS,mFilterColumn,e) ; + ForumModelIndex e_index = addEntry(posts,e, threadPair.second); + + //calculateExpand(msg, item); + + /* add item to process list */ + threadStack.push_back(std::make_pair(msg.mMeta.mMsgId, e_index)); + + msgs.erase(mit); + } + +#ifdef DEBUG_FORUMS + std::cerr << "GxsForumsFillThread::run() Erasing entry " << it->first << " from kids tab." << std::endl; +#endif + kids_array.erase(it) ; // This is not strictly needed, but it improves performance by reducing the search space. + } + +#ifdef DEBUG_FORUMS + std::cerr << "Kids array now has " << kids_array.size() << " elements" << std::endl; + for(std::map >::const_iterator it(kids_array.begin());it!=kids_array.end();++it) + { + std::cerr << "Node " << it->first << std::endl; + for(std::list::const_iterator it2(it->second.begin());it2!=it->second.end();++it2) + std::cerr << " " << *it2 << std::endl; + } + + std::cerr << "GxsForumsFillThread::run() stopped: " << (wasStopped() ? "yes" : "no") << std::endl; +#endif +} + + + + diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 384367097..2de026f1f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -1,5 +1,4 @@ #ifndef SUSPENDED_CODE -#include "retroshare/rsgxsifacetypes.h" #else #include #include @@ -14,6 +13,8 @@ struct RsMsgMetaData #endif +#include "retroshare/rsgxsforums.h" +#include "retroshare/rsgxsifacetypes.h" #include // This class holds the actual hierarchy of posts, represented by identifiers @@ -38,8 +39,7 @@ struct ForumModelPostEntry uint32_t mPublishTs; uint32_t mPostFlags; int mReputationWarningLevel; - - std::vector meta_versions; // maybe we don't need all this. Could be too large. + int mStatus; std::vector mChildren; ForumModelIndex mParent; @@ -62,6 +62,9 @@ public: StatusRole = Qt::UserRole+4, }; + // This method will asynchroneously update the data + void setForum(const RsGxsGroupId& forumGroup); + int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; @@ -73,12 +76,16 @@ public: QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QVariant sizeHintRole(int col) const; - QVariant displayRole(const RsMsgMetaData& meta, int col) const; - QVariant userRole(const RsMsgMetaData& meta, int col) const; - QVariant decorationRole(const RsMsgMetaData &meta, int col) const; - - void update_posts(); + QVariant sizeHintRole (int col) const; + QVariant displayRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant userRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant decorationRole(const ForumModelPostEntry& fmpe, int col) const; + QVariant toolTipRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant pinnedRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant missingRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant statusRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant authorRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant sortRole (const ForumModelPostEntry& fmpe, int col) const; private: void *getParentRef(void *ref,int& row) const; @@ -89,5 +96,15 @@ private: static bool convertTabEntryToRefPointer(uint32_t entry,void *& ref); static bool convertRefPointerToTabEntry(void *ref,uint32_t& entry); + void update_posts(const RsGxsGroupId &group_id); + void setForumMessageSummary(const std::vector& messages); + + static void computeMessagesHierarchy(const RsGxsForumGroup& forum_group,const std::vector& msgs_array,std::vector& posts); + static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); + static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); + static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn, ForumModelPostEntry& fentry); + + void setPosts(const std::vector& posts); + std::vector mPosts ; // store the list of posts updated from rsForums. }; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 48609a9c0..34f74cb2c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1428,19 +1428,6 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum } -QTreeWidgetItem *GxsForumThreadWidget::generateMissingItem(const RsGxsMessageId &msgId) -{ - GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR); - - item->setText(COLUMN_THREAD_TITLE, tr("[ ... Missing Message ... ]")); - item->setData(COLUMN_THREAD_MSGID,Qt::DisplayRole, QString::fromStdString(msgId.toStdString())); - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_MISSING, true); - - item->setId(RsGxsId(), COLUMN_THREAD_AUTHOR, false); // fixed up columnId() - - return item; -} - void GxsForumThreadWidget::insertThreads() { #ifdef DEBUG_FORUMS diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp index f0c61d877..d0bd5ea26 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp @@ -554,75 +554,4 @@ void GxsForumsFillThread::run() deleteLater(); } -QTreeWidgetItem *GxsForumsFillThread::convertMsgToThreadWidget(const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn, ForumModelIndex parent) -{ - ForumModelPostEntry fentry; - fentry.mMsgId = msg.mMeta.mMsgId; - fentry.mPublishTs = msg.mMeta.mPublishTs; - fentry.mParent = parent; - - if(mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) - fentry.mFlags |= ForumModelPostEntry::FLAG_POST_IS_PINNED; - - // Early check for a message that should be hidden because its author - // is flagged with a bad reputation - - uint32_t idflags =0; - RsReputations::ReputationLevel reputation_level = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId,&idflags) ; - bool redacted = false; - - if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) - fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_REDACTED; - - // We use a specific item model for forums in order to handle the post pinning. - - if(reputation_level == RsReputations::REPUTATION_UNKNOWN) - fentry.mReputationWarningLevel = 3 ; - else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) - fentry.mReputationWarningLevel = 2 ; - else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(mForumGroup.mMeta.mSignFlags,idflags)) - fentry.mReputationWarningLevel = 1 ; - else - fentry.mReputationWarningLevel = 0 ; - -#ifdef TODO - // This is an attempt to put pinned posts on the top. We should rather use a QSortFilterProxyModel here. - QString itemSort = QString::number(msg.mMeta.mPublishTs);//Don't need to format it as for sort. - - if (useChildTS) - { - for(QTreeWidgetItem *grandParent = parent; grandParent!=NULL; grandParent = grandParent->parent()) - { - //Update Parent Child TimeStamp - QString oldTSSort = grandParent->data(COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); - - QString oldCTSSort = oldTSSort.split("|").at(0); - QString oldPTSSort = oldTSSort.contains("|") ? oldTSSort.split(" | ").at(1) : oldCTSSort; -#ifdef SHOW_COMBINED_DATES - QString oldTSText = grandParent->text(COLUMN_THREAD_DATE); - QString oldCTSText = oldTSText.split("|").at(0); - QString oldPTSText = oldTSText.contains("|") ? oldTSText.split(" | ").at(1) : oldCTSText;//If first time parent get only its mPublishTs - #endif - if (oldCTSSort.toDouble() < itemSort.toDouble()) - { -#ifdef SHOW_COMBINED_DATES - grandParent->setText(COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); -#endif - grandParent->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); - } - } - } -#endif -//#TODO -#if 0 - if (IS_GROUP_SUBSCRIBED(subscribeFlags) && !(msginfo.mMsgFlags & RS_DISTRIB_MISSING_MSG)) { - rsGxsForums->getMessageStatus(msginfo.forumId, msginfo.msgId, status); - } else { - // show message as read - status = RSGXS_MSG_STATUS_READ; - } -#endif - if (parent) parent->addChild(item); - return item; -} From e01de33e1a1aabda3f32f98283deb254368ad822 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Nov 2018 09:28:07 +0100 Subject: [PATCH 033/110] fixed compilation in new ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 43 +++++++++++++------ .../src/gui/gxsforums/GxsForumModel.h | 13 ++++-- .../gui/gxsforums/GxsForumThreadWidget.cpp | 5 +++ .../src/gui/gxsforums/GxsForumsFillThread.cpp | 1 - 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 08eb676d8..796d80d6f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -3,6 +3,7 @@ #include #include "util/qtthreadsutils.h" +#include "util/DateTime.h" #include "GxsForumModel.h" #include "retroshare/rsgxsforums.h" @@ -30,6 +31,10 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) { mPosts.resize(1); // adds a sentinel item + mFilterColumn=0; + mUseChildTS=false; + mFlatView=false; + // // adds some fake posts to debug // // int N=5 ; @@ -303,7 +308,6 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const { case Qt::DisplayRole: return displayRole (fmpe,index.column()) ; case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ; - case Qt::UserRole: return userRole (fmpe,index.column()) ; case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; @@ -377,7 +381,7 @@ QVariant RsGxsForumModel::sizeHintRole(int col) const QVariant RsGxsForumModel::authorRole(const ForumModelPostEntry& fmpe,int column) const { if(column == COLUMN_THREAD_DATA) - return QVariant(QString::fromStdString(msg.mMeta.mAuthorId.toStdString())); + return QVariant(QString::fromStdString(fmpe.mAuthorId.toStdString())); return QVariant(); } @@ -387,6 +391,7 @@ QVariant RsGxsForumModel::sortRole(const ForumModelPostEntry& fmpe,int column) c if(column == COLUMN_THREAD_DATA) return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here + return QVariant(); } QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) const @@ -405,7 +410,7 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c QDateTime qtime; qtime.setTime_t(fmpe.mPublishTs); - return QVariant(QDateTime::formatDateTime(qtime)); + return QVariant(DateTime::formatDateTime(qtime)); } case COLUMN_THREAD_AUTHOR: return QVariant(QString::fromStdString(fmpe.mAuthorId.toStdString())); @@ -434,15 +439,22 @@ QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col return QVariant(); } -void RsGxsForumModel::setForum(const RsGxsGroupId& forumGroup) +void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) { - if(mForumGroupId == forumGroup) + if(mForumGroup.mMeta.mGroupId == forum_group_id) return ; - mPosts.clear(); - mForumGroupId = forumGroup; + // we do not set mForumGroupId yet. We'll do it when the forum data is updated. - update_posts(); + update_posts(forum_group_id); +} + +void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts) +{ + mForumGroup = group; + mPosts = posts; + + emit layoutChanged(); } void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) @@ -472,12 +484,13 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) // 2 - sort the messages into a proper hierarchy std::vector *vect = new std::vector(); + RsGxsForumGroup group = groups[0]; - computeMessagesHierarchy(groups[0],messages,*vect); + computeMessagesHierarchy(group,messages,*vect); // 3 - update the model in the UI thread. - RsQThreadUtils::postToObject( [vect,this]() + RsQThreadUtils::postToObject( [group,vect,this]() { /* Here it goes any code you want to be executed on the Qt Gui * thread, for example to update the data model with new information @@ -485,7 +498,7 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) * Qt::QueuedConnection is important! */ - setPosts(*vect) ; + setPosts(group,*vect) ; delete vect; @@ -577,7 +590,9 @@ void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,c static bool decreasing_time_comp(const QPair& e1,const QPair& e2) { return e2.first < e1.first ; } -void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_group,const std::vector& msgs_array,std::vector& posts) +void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_group, + const std::vector& msgs_array, + std::vector& posts) { std::cerr << "updating messages data with " << msgs_array.size() << " messages" << std::endl; @@ -757,7 +772,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou #endif ForumModelPostEntry entry; - convertMsgToThreadWidget(msg, mUseChildTS, mFilterColumn,NULL,entry); + convertMsgToPostEntry(forum_group,msg, mUseChildTS, mFilterColumn,entry); ForumModelIndex entry_index = addEntry(posts,entry,0); @@ -803,7 +818,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou { // add dummy parent item ForumModelPostEntry e ; - generateMissingItem(RsGxsMessageId,e); + generateMissingItem(*it,e); ForumModelIndex e_index = addEntry(posts,e,0); // no parent -> parent is level 0 //mItems.append( e_index ); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 2de026f1f..cd45158d9 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -27,7 +27,7 @@ typedef uint32_t ForumModelIndex; struct ForumModelPostEntry { - typedef enum { // flags for display of posts + enum { // flags for display of posts FLAG_POST_IS_PINNED = 0x0001, FLAG_POST_IS_MISSING = 0x0002, FLAG_POST_IS_REDACTED = 0x0004, @@ -78,7 +78,6 @@ public: QVariant sizeHintRole (int col) const; QVariant displayRole (const ForumModelPostEntry& fmpe, int col) const; - QVariant userRole (const ForumModelPostEntry& fmpe, int col) const; QVariant decorationRole(const ForumModelPostEntry& fmpe, int col) const; QVariant toolTipRole (const ForumModelPostEntry& fmpe, int col) const; QVariant pinnedRole (const ForumModelPostEntry& fmpe, int col) const; @@ -88,6 +87,12 @@ public: QVariant sortRole (const ForumModelPostEntry& fmpe, int col) const; private: + RsGxsForumGroup mForumGroup; + + bool mUseChildTS; + bool mFlatView; + int mFilterColumn; + void *getParentRef(void *ref,int& row) const; void *getChildRef(void *ref,int row) const; //bool hasIndex(int row,int column,const QModelIndex& parent)const; @@ -99,12 +104,12 @@ private: void update_posts(const RsGxsGroupId &group_id); void setForumMessageSummary(const std::vector& messages); - static void computeMessagesHierarchy(const RsGxsForumGroup& forum_group,const std::vector& msgs_array,std::vector& posts); static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn, ForumModelPostEntry& fentry); - void setPosts(const std::vector& posts); + void computeMessagesHierarchy(const RsGxsForumGroup& forum_group,const std::vector& msgs_array,std::vector& posts); + void setPosts(const RsGxsForumGroup &group, const std::vector& posts); // this method *must* be called from UI thread. std::vector mPosts ; // store the list of posts updated from rsForums. }; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 34f74cb2c..024054cf5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -2942,3 +2942,8 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque GxsMessageFrameWidget::loadRequest(queue, req); } + +QTreeWidgetItem *GxsForumThreadWidget::generateMissingItem(const RsGxsMessageId& mid) +{ +return NULL; +} diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp index d0bd5ea26..faff45f74 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp @@ -554,4 +554,3 @@ void GxsForumsFillThread::run() deleteLater(); } - From b28a76e35b71ccc6c0651eca00ab5749e9e1c98f Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Nov 2018 09:47:58 +0100 Subject: [PATCH 034/110] fixed update of posts list in new ForumModel --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 27 ++++++++++--------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 9 ++++--- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 024054cf5..ec022979b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -202,7 +202,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadCompareRole = new RSTreeWidgetItemCompareRole; mThreadCompareRole->setRole(COLUMN_THREAD_DATE, ROLE_THREAD_SORT); - ui->threadTreeWidget->setModel(new RsGxsForumModel(this)); + mThreadModel = new RsGxsForumModel(this); + ui->threadTreeWidget->setModel(mThreadModel); ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); @@ -395,7 +396,8 @@ void GxsForumThreadWidget::groupIdChanged() emit groupChanged(this); - fillComplete(); + mThreadModel->setForum(groupId()); + //fillComplete(); } QString GxsForumThreadWidget::groupName(bool withUnreadCount) @@ -474,7 +476,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (complete) { /* Fill complete */ requestGroupData(); - insertThreads(); + //insertThreads(); insertMessage(); mIgnoredMsgId.clear(); @@ -492,7 +494,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (grpIds.find(groupId())!=grpIds.end()){ updateGroup = true; /* Update threads */ - insertThreads(); + //insertThreads(); } else { std::map > msgIds; getAllMsgIds(msgIds); @@ -504,7 +506,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (msgIds.find(groupId()) != msgIds.end()) { /* Update threads */ - insertThreads(); + //insertThreads(); } } @@ -1427,7 +1429,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum return item; } - +#ifdef TO_REMOVE void GxsForumThreadWidget::insertThreads() { #ifdef DEBUG_FORUMS @@ -1502,9 +1504,9 @@ void GxsForumThreadWidget::insertThreads() ui->threadTreeWidget->setRootIsDecorated(!mFillThread->mFlatView); // connect thread - connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection); - connect(mFillThread, SIGNAL(status(QString)), this, SLOT(fillThreadStatus(QString))); - connect(mFillThread, SIGNAL(progress(int,int)), this, SLOT(fillThreadProgress(int,int))); + // connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection); + // connect(mFillThread, SIGNAL(status(QString)), this, SLOT(fillThreadStatus(QString))); + // connect(mFillThread, SIGNAL(progress(int,int)), this, SLOT(fillThreadProgress(int,int))); #ifdef DEBUG_FORUMS std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl; @@ -1535,7 +1537,6 @@ static void copyItem(QTreeWidgetItem *item, const QTreeWidgetItem *newItem) void GxsForumThreadWidget::fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand) { -#ifdef TODO #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreads()" << std::endl; #endif @@ -1607,9 +1608,10 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreads() done" << std::endl; #endif -#endif } +#endif +#ifdef TO_REMOVE void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand) { int index = 0; @@ -1673,6 +1675,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget } } } +#endif void GxsForumThreadWidget::insertMessage() { @@ -2487,7 +2490,7 @@ void GxsForumThreadWidget::filterColumnChanged(int column) if (column == COLUMN_THREAD_CONTENT) { // need content ... refill - insertThreads(); + //insertThreads(); } else { filterItems(ui->filterLineEdit->text()); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 40aa469cb..a3d227431 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -32,6 +32,7 @@ class RSTreeWidgetItemCompareRole; class RsGxsForumMsg; class GxsForumsFillThread; class RsGxsForumGroup; +class RsGxsForumModel; namespace Ui { class GxsForumThreadWidget; @@ -149,11 +150,11 @@ private slots: private: void insertMessageData(const RsGxsForumMsg &msg); - void insertThreads(); void insertMessage(); - void fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand); - void fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand); + //void insertThreads(); + //void fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand); + //void fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand); int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); void setMsgReadStatus(QList &rows, bool read); @@ -225,6 +226,8 @@ private: QMap > > mPostVersions ; // holds older versions of posts + RsGxsForumModel *mThreadModel; + Ui::GxsForumThreadWidget *ui; }; From 59220b5c856066e7a1acda144f95216f207cd1e4 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Nov 2018 10:44:06 +0100 Subject: [PATCH 035/110] fixed layout of internal data in ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 65 ++++++++++++++++++- .../src/gui/gxsforums/GxsForumModel.h | 8 +++ 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 796d80d6f..c077bea6c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -7,7 +7,7 @@ #include "GxsForumModel.h" #include "retroshare/rsgxsforums.h" -#define DEBUG_FORUMMODEL +//#define DEBUG_FORUMMODEL #define COLUMN_THREAD_TITLE 0 #define COLUMN_THREAD_READ 1 @@ -29,7 +29,8 @@ std::ostream& operator<<(std::ostream& o, const QModelIndex& i);// defined elsew RsGxsForumModel::RsGxsForumModel(QObject *parent) : QAbstractItemModel(parent) { - mPosts.resize(1); // adds a sentinel item + initEmptyHierarchy(mPosts); + mFilterColumn=0; mUseChildTS=false; @@ -60,6 +61,13 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) // meta.mMsgName = std::string("message ") + QString::number(N+1).toStdString() ; } +void RsGxsForumModel::initEmptyHierarchy(std::vector& posts) +{ + posts.resize(1); // adds a sentinel item + posts[0].mTitle = "Root sentinel post" ; + posts[0].mParent = 0; +} + int RsGxsForumModel::rowCount(const QModelIndex& parent) const { if(parent.column() > 0) @@ -454,6 +462,16 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& post posts[N].mParent = parent; posts[parent].mChildren.push_back(N); + std::cerr << "Added new entry " << N << " children of " << parent << std::endl; + + if(N == parent) + std::cerr << "(EE) trying to add a post as its own parent!" << std::endl; return ForumModelIndex(N); } @@ -530,8 +552,11 @@ void RsGxsForumModel::generateMissingItem(const RsGxsMessageId &msgId,ForumModel void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn,ForumModelPostEntry& fentry) { + fentry.mTitle = msg.mMeta.mMsgName; + fentry.mAuthorId = msg.mMeta.mAuthorId; fentry.mMsgId = msg.mMeta.mMsgId; fentry.mPublishTs = msg.mMeta.mPublishTs; + fentry.mPostFlags = 0; fentry.mStatus = msg.mMeta.mMsgStatus; if(mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) @@ -623,7 +648,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou // int steps = count / PROGRESSBAR_MAX; int step = 0; - posts.clear(); + initEmptyHierarchy(posts); QMap > > mPostVersions ; // ThreadList contains the list of parent threads. The algorithm below iterates through all messages @@ -894,6 +919,40 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou #endif } +static void recursPrintModel(const std::vector& entries,ForumModelIndex index,int depth) +{ + const ForumModelPostEntry& e(entries[index]); + + std::cerr << std::string(depth*2,' ') << e.mAuthorId.toStdString() << " " << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() + << " " << QDateTime::fromSecsSinceEpoch(e.mPublishTs).toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; + + for(uint32_t i=0;i& msgs_array,std::vector& posts); void setPosts(const RsGxsForumGroup &group, const std::vector& posts); // this method *must* be called from UI thread. + void initEmptyHierarchy(std::vector& posts); std::vector mPosts ; // store the list of posts updated from rsForums. }; From 3edd1dd0ddce2550360092f56007a1c3eaf13ca6 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Nov 2018 11:24:05 +0100 Subject: [PATCH 036/110] fixed missing case entries in ForumModel --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index c077bea6c..bb2bffe44 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -256,10 +256,13 @@ QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, i switch(section) { - default: case COLUMN_THREAD_TITLE: return tr("Title"); case COLUMN_THREAD_DATE: return tr("Date"); case COLUMN_THREAD_AUTHOR: return tr("Author"); + case COLUMN_THREAD_DISTRIBUTION: return QString("[icon missing]") ; + case COLUMN_THREAD_READ: return QString("[icon missing]") ; + default: + return QString("[unused]"); } } From abec811d31c81599c045247bec8a09e0035d3852 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 22 Nov 2018 16:41:19 +0100 Subject: [PATCH 037/110] Forum API add missing subscribe method --- libretroshare/src/retroshare/rsgxschannels.h | 2 +- libretroshare/src/retroshare/rsgxsforums.h | 10 ++++++++++ libretroshare/src/services/p3gxsforums.cc | 9 +++++++++ libretroshare/src/services/p3gxsforums.h | 4 ++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index f1aef6e7f..8c7d29766 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -256,7 +256,7 @@ public: * @param[in] subscribe true to subscribe, false to unsubscribe * @return false on error, true otherwise */ - virtual bool subscribeToChannel( const RsGxsGroupId &channelId, + virtual bool subscribeToChannel( const RsGxsGroupId& channelId, bool subscribe ) = 0; /** diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index 4c6b6e483..e98020e3c 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -159,6 +159,16 @@ public: */ virtual bool markRead(const RsGxsGrpMsgIdPair& messageId, bool read) = 0; + /** + * @brief Subscrbe to a forum. Blocking API + * @jsonapi{development} + * @param[in] forumId Forum id + * @param[in] subscribe true to subscribe, false to unsubscribe + * @return false on error, true otherwise + */ + virtual bool subscribeToForum( const RsGxsGroupId& forumId, + bool subscribe ) = 0; + /* Specific Service Data */ RS_DEPRECATED_FOR("getForumsSummaries, getForumsInfo") virtual bool getGroupData(const uint32_t &token, std::vector &groups) = 0; diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 09680f196..c8819662f 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -476,6 +476,15 @@ bool p3GxsForums::markRead(const RsGxsGrpMsgIdPair& msgId, bool read) return true; } +bool p3GxsForums::subscribeToForum( + const RsGxsGroupId& groupId, bool subscribe ) +{ + uint32_t token; + if( !RsGenExchange::subscribeToGroup(token, groupId, subscribe) + || waitToken(token) != RsTokenService::COMPLETE ) return false; + return true; +} + bool p3GxsForums::createGroup(uint32_t &token, RsGxsForumGroup &group) { std::cerr << "p3GxsForums::createGroup()" << std::endl; diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index 36b40a972..5e40cb3e7 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -80,6 +80,10 @@ public: /// @see RsGxsForums::markRead virtual bool markRead(const RsGxsGrpMsgIdPair& messageId, bool read); + /// @see RsGxsForums::subscribeToForum + virtual bool subscribeToForum( const RsGxsGroupId& forumId, + bool subscribe ); + virtual bool getGroupData(const uint32_t &token, std::vector &groups); virtual bool getMsgData(const uint32_t &token, std::vector &msgs); virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read); From 81d23fa607e797327b68d2a0d805cdf969b032b2 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 22 Nov 2018 21:56:55 +0100 Subject: [PATCH 038/110] JSON API to collect extra entropy --- libretroshare/src/retroshare/rsinit.h | 8 ++++++++ libretroshare/src/rsserver/rsinit.cc | 3 +++ 2 files changed, 11 insertions(+) diff --git a/libretroshare/src/retroshare/rsinit.h b/libretroshare/src/retroshare/rsinit.h index 031423819..2e8009b3c 100644 --- a/libretroshare/src/retroshare/rsinit.h +++ b/libretroshare/src/retroshare/rsinit.h @@ -288,6 +288,14 @@ struct RsLoginHelper RsInit::LoadCertificateStatus attemptLogin( const RsPeerId& account, const std::string& password ); + /** + * @brief Feed extra entropy to the crypto libraries + * @jsonapi{development,unauthenticated} + * @param[in] bytes number to feed to the entropy pool + * @return false if error occurred, true otherwise + */ + static bool collectEntropy(uint32_t bytes); + struct Location : RsSerializable { RsPeerId mLocationId; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index e3f1f141e..86e26c55b 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1934,6 +1934,9 @@ RsInit::LoadCertificateStatus RsLoginHelper::attemptLogin( return RsInit::ERR_UNKOWN; } +/*static*/ bool RsLoginHelper::collectEntropy(uint32_t bytes) +{ return RsInit::collectEntropy(bytes); } + void RsLoginHelper::getLocations(std::vector& store) { std::list locIds; From 20b8bca8014e3bd1249e836956e15c8d4668be56 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Nov 2018 22:07:58 +0100 Subject: [PATCH 039/110] worked on display of posts and selection in new forum model --- libretroshare/src/retroshare/rsgxsforums.h | 13 ++ libretroshare/src/services/p3gxsforums.cc | 14 ++ libretroshare/src/services/p3gxsforums.h | 3 + .../src/gui/gxsforums/GxsForumModel.cpp | 26 --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 153 +++++++++++++++--- .../src/gui/gxsforums/GxsForumThreadWidget.h | 10 +- 6 files changed, 166 insertions(+), 53 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index 4c6b6e483..ad73a92c2 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -150,6 +150,19 @@ public: const std::list& forumIds, std::vector& messages ) = 0; + /** + * @brief Get specific list of messages from a single forums. Blocking API + * @jsonapi{development} + * @param[in] forumId id of the forum of which the content is requested + * @param[in] msgs_to_request list of message ids to request + * @param[out] msgs storage for the forum messages + * @return false if something failed, true otherwhise + */ + virtual bool getForumsContent( + const RsGxsGroupId& forumId, + std::set& msgs_to_request, + std::vector& msgs) =0; + /** * @brief Toggle message read status. Blocking API. * @jsonapi{development} diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 09680f196..4541f00b7 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -456,6 +456,20 @@ bool p3GxsForums::getForumsInfo( return getGroupData(token, forumsInfo); } +bool p3GxsForums::getForumsContent( const RsGxsGroupId& forumId, std::set& msgs_to_request,std::vector& msgs) +{ + uint32_t token; + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; + + GxsMsgReq msgIds; + msgIds[forumId] = msgs_to_request; + + if( !requestMsgInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE ) return false; + + return getMsgData(token, msgs) ; +} + bool p3GxsForums::getForumsContent( const std::list& forumIds, std::vector& messages ) diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index 36b40a972..29260c8cf 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -77,6 +77,9 @@ public: const std::list& forumIds, std::vector& messages ); + /// @see RsGxsForums::getForumsContent + virtual bool getForumsContent( const RsGxsGroupId& forumId, std::set& msgs_to_request,std::vector& msgs) ; + /// @see RsGxsForums::markRead virtual bool markRead(const RsGxsGrpMsgIdPair& messageId, bool read); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index bb2bffe44..13d9fc2a3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -223,32 +223,6 @@ int RsGxsForumModel::getChildrenCount(void *ref) const return mPosts[entry].mChildren.size(); } - - -//bool RsGxsForumModel::hasIndex(int row,int column,const QModelIndex& parent) const -//{ -// if(row < 0 || column < 0 || column >= COLUMN_COUNT) -// return false; -// -// if(!parent.isValid()) -// return false; -// -// ForumModelIndex entry; -// -// convertRefPointerToTabEntry(parent.internalPointer(),entry); -// -// if(entry >= mPosts.size()) -// return false; -// -// if(row >= mPosts[entry].children.size()) -// return false; -// -// if(mPosts[entry].children[row] >= mPosts.size()) -// return false; -// -// return true; -//} - QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, int role) const { if(role != Qt::DisplayRole) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index ec022979b..fed5854d5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -24,6 +24,7 @@ #include #include +#include "util/qtthreadsutils.h" #include "GxsForumThreadWidget.h" #include "ui_GxsForumThreadWidget.h" #include "GxsForumsFillThread.h" @@ -475,7 +476,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) { if (complete) { /* Fill complete */ - requestGroupData(); + updateGroupData(); //insertThreads(); insertMessage(); @@ -511,7 +512,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) } if (updateGroup) { - requestGroupData(); + updateGroupData(); } } @@ -777,25 +778,25 @@ void GxsForumThreadWidget::changedVersion() void GxsForumThreadWidget::changedThread() { -#ifdef TODO /* just grab the ids of the current item */ - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); + QModelIndexList selected_indexes = ui->threadTreeWidget->selectionModel()->selectedIndexes(); - if (!item || !item->isSelected()) { + if(selected_indexes.size() != 1) + { mThreadId.clear(); mOrigThreadId.clear(); - } else { + return; + } - mThreadId = mOrigThreadId = RsGxsMessageId(item->data(COLUMN_THREAD_MSGID, Qt::DisplayRole).toString().toStdString()); - } + QModelIndex index = *selected_indexes.begin(); - if (mFillThread) { - return; - } - ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; + mThreadId = mOrigThreadId = RsGxsMessageId(index.sibling(index.row(),COLUMN_THREAD_MSGID).data(Qt::DisplayRole).toString().toStdString()); + + std::cerr << "Switched to new thread ID " << mThreadId << std::endl; + + //ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); -#endif } void GxsForumThreadWidget::clickedThread(QTreeWidgetItem *item, int column) @@ -1679,7 +1680,6 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget void GxsForumThreadWidget::insertMessage() { -#ifdef TODO if (groupId().isNull()) { mStateHelper->setActive(mTokenTypeMessageData, false); @@ -1689,7 +1689,6 @@ void GxsForumThreadWidget::insertMessage() ui->time_label->show(); ui->postText->clear(); - //ui->threadTitle->clear(); return; } @@ -1701,14 +1700,15 @@ void GxsForumThreadWidget::insertMessage() ui->versions_CB->hide(); ui->time_label->show(); - //ui->threadTitle->setText(tr("Forum Description")); ui->postText->setText(mForumDescription); return; } mStateHelper->setActive(mTokenTypeMessageData, true); +#ifdef TODO QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); + if (item) { QTreeWidgetItem *parentItem = item->parent(); int index = parentItem ? parentItem->indexOfChild(item) : ui->threadTreeWidget->indexOfTopLevelItem(item); @@ -1723,6 +1723,7 @@ void GxsForumThreadWidget::insertMessage() ui->time_label->show(); return; } +#endif mStateHelper->setWidgetEnabled(ui->newmessageButton, (IS_GROUP_SUBSCRIBED(mSubscribeFlags) && mThreadId.isNull() == false)); @@ -1738,7 +1739,7 @@ void GxsForumThreadWidget::insertMessage() // add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox. std::cerr << "Looking into existing versions for post " << mThreadId << ", thread history: " << mPostVersions.size() << std::endl; - +#ifdef TODO QMap > >::const_iterator it = mPostVersions.find(mOrigThreadId) ; ui->versions_CB->blockSignals(true) ; @@ -1773,13 +1774,13 @@ void GxsForumThreadWidget::insertMessage() ui->versions_CB->hide(); ui->time_label->show(); } +#endif ui->versions_CB->blockSignals(false) ; /* request Post */ - RsGxsGrpMsgIdPair msgId = std::make_pair(groupId(), mThreadId); - requestMessageData(msgId); -#endif + //RsGxsGrpMsgIdPair msgId = std::make_pair(groupId(), mThreadId); + updateMessageData(mThreadId); } void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) @@ -2542,6 +2543,111 @@ bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text /** Request / Response of Data ********************************/ /*********************** **** **** **** ***********************/ +void GxsForumThreadWidget::updateGroupData() +{ + mSubscribeFlags = 0; + mSignFlags = 0; + mForumDescription.clear(); + + emit groupChanged(this); + + RsThread::async([this]() + { + // 1 - get message data from p3GxsForums + + std::list forumIds; + std::vector groups; + + forumIds.push_back(groupId()); + + if(!rsGxsForums->getForumsInfo(forumIds,groups)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum group info for forum " << groupId() << std::endl; + return; + } + + if(groups.size() != 1) + { + mStateHelper->setActive(mTokenTypeGroupData, false); + mStateHelper->clear(mTokenTypeGroupData); + return; + } + + // 2 - sort the messages into a proper hierarchy + + RsGxsForumGroup group = groups[0]; + + // 3 - update the model in the UI thread. + + RsQThreadUtils::postToObject( [group,this]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + + mForumGroup = group; + insertGroupData(); + + ui->threadTreeWidget->setColumnHidden(COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); + ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; + + }, this ); + + }); +} + +void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) +{ + RsThread::async([msgId,this]() + { + // 1 - get message data from p3GxsForums + + std::set msgs_to_request ; + std::vector msgs; + + msgs_to_request.insert(msgId); + + if(!rsGxsForums->getForumsContent(groupId(),msgs_to_request,msgs)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum group info for forum " << groupId() << std::endl; + return; + } + + if(msgs.size() != 1) + { + mStateHelper->setActive(mTokenTypeGroupData, false); + mStateHelper->clear(mTokenTypeGroupData); + return; + } + + // 2 - sort the messages into a proper hierarchy + + RsGxsForumMsg msg = msgs[0]; + + // 3 - update the model in the UI thread. + + RsQThreadUtils::postToObject( [msg,this]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + + insertMessageData(msg); + + ui->threadTreeWidget->setColumnHidden(COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); + ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; + + }, this ); + + }); + +} + +#ifdef TO_REMOVE void GxsForumThreadWidget::requestGroupData() { mSubscribeFlags = 0; @@ -2549,19 +2655,17 @@ void GxsForumThreadWidget::requestGroupData() mForumDescription.clear(); mTokenQueue->cancelActiveRequestTokens(mTokenTypeGroupData); + emit groupChanged(this); if (groupId().isNull()) { mStateHelper->setActive(mTokenTypeGroupData, false); mStateHelper->setLoading(mTokenTypeGroupData, false); mStateHelper->clear(mTokenTypeGroupData); - emit groupChanged(this); - return; } mStateHelper->setLoading(mTokenTypeGroupData, true); - emit groupChanged(this); RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; @@ -2666,6 +2770,7 @@ void GxsForumThreadWidget::loadMessageData(const uint32_t &token) mStateHelper->clear(mTokenTypeMessageData); } } +#endif /*********************** **** **** **** ***********************/ /*********************** **** **** **** ***********************/ @@ -2897,6 +3002,7 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque if (queue == mTokenQueue) { +#ifdef TO_REMOVE /* now switch on req */ if (req.mUserType == mTokenTypeGroupData) { loadGroupData(req.mToken); @@ -2907,6 +3013,7 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque loadMessageData(req.mToken); return; } +#endif if (req.mUserType == mTokenTypeReplyMessage) { loadMsgData_ReplyMessage(req.mToken); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index a3d227431..f2bec6933 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -151,6 +151,7 @@ private: void insertMessageData(const RsGxsForumMsg &msg); void insertMessage(); + void insertGroupData(); //void insertThreads(); //void fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand); @@ -169,18 +170,19 @@ private: void processSettings(bool bLoad); - void requestGroupData(); - void loadGroupData(const uint32_t &token); - void insertGroupData(); + void updateGroupData(); static void loadAuthorIdCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &/*data*/); - void requestMessageData(const RsGxsGrpMsgIdPair &msgId); + void updateMessageData(const RsGxsMessageId& msgId); + void requestMsgData_ReplyWithPrivateMessage(const RsGxsGrpMsgIdPair &msgId); void requestMsgData_ShowAuthorInPeople(const RsGxsGrpMsgIdPair &msgId); void requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId); void requestMsgData_EditForumMessage(const RsGxsGrpMsgIdPair &msgId); +#ifdef TO_REMOVE void loadMessageData(const uint32_t &token); +#endif void loadMsgData_ReplyMessage(const uint32_t &token); void loadMsgData_ReplyForumMessage(const uint32_t &token); void loadMsgData_EditForumMessage(const uint32_t &token); From 543a7f280d2a3dd988c7a30fba42a1e358d2883c Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 22 Nov 2018 22:52:27 +0100 Subject: [PATCH 040/110] fixed display of current post in new Forum Model --- .../src/gui/gxsforums/GxsForumModel.cpp | 6 ++--- .../gui/gxsforums/GxsForumThreadWidget.cpp | 24 +++++++++---------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 +- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 13d9fc2a3..c5d300816 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -83,7 +83,7 @@ int RsGxsForumModel::rowCount(const QModelIndex& parent) const } int RsGxsForumModel::columnCount(const QModelIndex &parent) const { - return COLUMN_THREAD_COUNT ; + return COLUMN_THREAD_NB_COLUMNS ; } bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const @@ -139,7 +139,7 @@ bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & parent) const { // if(!hasIndex(row,column,parent)) - if(row < 0 || column < 0 || column >= COLUMN_THREAD_COUNT) + if(row < 0 || column < 0 || column >= COLUMN_THREAD_NB_COLUMNS) return QModelIndex(); void *ref = getChildRef(parent.internalPointer(),row); @@ -918,7 +918,7 @@ void RsGxsForumModel::debug_dump() { const ForumModelPostEntry& e(mPosts[i]); - std::cerr << " " << i << " : " << e.mAuthorId.toStdString() << " " << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString(); + std::cerr << " " << i << " : " << e.mMsgId << " (from " << e.mAuthorId.toStdString() << ") " << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString(); for(uint32_t i=0;inewmessageButton->setText(tr("Reply")); ui->newthreadButton->setText(tr("New thread")); - connect(ui->threadTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(changedThread())); + connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(changedThread(QModelIndex))); connect(ui->threadTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(clickedThread(QTreeWidgetItem*,int))); connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox())); @@ -776,21 +776,16 @@ void GxsForumThreadWidget::changedVersion() insertMessage(); } -void GxsForumThreadWidget::changedThread() +void GxsForumThreadWidget::changedThread(QModelIndex index) { - /* just grab the ids of the current item */ - QModelIndexList selected_indexes = ui->threadTreeWidget->selectionModel()->selectedIndexes(); - - if(selected_indexes.size() != 1) + if(!index.isValid()) { mThreadId.clear(); mOrigThreadId.clear(); return; } - QModelIndex index = *selected_indexes.begin(); - - mThreadId = mOrigThreadId = RsGxsMessageId(index.sibling(index.row(),COLUMN_THREAD_MSGID).data(Qt::DisplayRole).toString().toStdString()); + mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); std::cerr << "Switched to new thread ID " << mThreadId << std::endl; @@ -1785,7 +1780,6 @@ void GxsForumThreadWidget::insertMessage() void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) { -#ifdef TODO /* As some time has elapsed since request - check that this is still the current msg. * otherwise, another request will fill the data */ @@ -1811,11 +1805,13 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) mStateHelper->setActive(mTokenTypeMessageData, true); - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); + //mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); + //QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); - uint32_t status = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = msg.mMeta.mMsgStatus ;//item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); +#ifdef TODO QList row; row.append(item); @@ -1833,6 +1829,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) setMsgReadStatus(row, true); } } +#endif ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs)); ui->by_label->setId(msg.mMeta.mAuthorId); @@ -1860,7 +1857,6 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) ui->postText->setHtml(extraTxt); } // ui->threadTitle->setText(QString::fromUtf8(msg.mMeta.mMsgName.c_str())); -#endif } void GxsForumThreadWidget::previousMessage() @@ -2604,6 +2600,8 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) { // 1 - get message data from p3GxsForums + std::cerr << "Retrieving post data for post " << msgId << std::endl; + std::set msgs_to_request ; std::vector msgs; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index f2bec6933..89ec7b9d9 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -96,7 +96,7 @@ private slots: void threadListCustomPopupMenu(QPoint point); void contextMenuTextBrowser(QPoint point); - void changedThread(); + void changedThread(QModelIndex index); void changedVersion(); void clickedThread (QTreeWidgetItem *item, int column); From 52a5aeb1f8c448f7ba4bd39be9134fae836fe214 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 23 Nov 2018 23:17:12 +0100 Subject: [PATCH 041/110] added item delegate for author in new model --- retroshare-gui/src/gui/gxs/GxsIdDetails.cpp | 4 +- retroshare-gui/src/gui/gxs/GxsIdDetails.h | 2 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 44 +++++++++++++++++++ 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 939b81708..16399aed1 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -897,7 +897,7 @@ QIcon GxsIdDetails::getLoadingIcon(const RsGxsId &/*id*/) return QIcon(IMAGE_LOADING); } -bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QList &icons, QString& comment) +bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QList &icons, QString& comment,uint32_t icon_types) { RsIdentityDetails details; @@ -921,7 +921,7 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QLi comment += getComment(details); if (doIcons) - getIcons(details, icons); + getIcons(details, icons,icon_types); // Cyril: I disabled these three which I believe to have been put for testing purposes. // diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.h b/retroshare-gui/src/gui/gxs/GxsIdDetails.h index 6a48d73c5..30edffd7e 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.h +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.h @@ -76,7 +76,7 @@ public: static void cleanup(); /* Information */ - static bool MakeIdDesc(const RsGxsId &id, bool doIcons, QString &desc, QList &icons, QString& comment); + static bool MakeIdDesc(const RsGxsId &id, bool doIcons, QString &desc, QList &icons, QString& comment, uint32_t icon_types=ICON_TYPE_ALL); static QString getName(const RsIdentityDetails &details); static QString getComment(const RsIdentityDetails &details); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 7c51e06e4..778804102 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -149,6 +149,49 @@ public: } }; +class AuthorItemDelegate: public QStyledItemDelegate +{ +public: + AuthorItemDelegate() {} + + virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const + { + if(!index.isValid()) + { + std::cerr << "(EE) attempt to draw an invalid index." << std::endl; + return ; + } + + QStyleOptionViewItemV4 opt = option; + initStyleOption(&opt, index); + + // disable default icon + opt.icon = QIcon(); + // draw default item + QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, 0); + + const QRect r = option.rect; + + RsGxsId id(index.data(Qt::DisplayRole).toString().toStdString()); + QString str; + QList icons; + QString comment; + + QIcon icon ; + + if(!GxsIdDetails::MakeIdDesc(id, true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) + icon = GxsIdDetails::getLoadingIcon(id); + else + icon = *icons.begin(); + + QPixmap pix = icon.pixmap(r.size()); + + // draw pixmap at center of item + const QPoint p = QPoint((r.width() - pix.width())/2, (r.height() - pix.height())/2); + painter->drawPixmap(r.topLeft() + p, pix); + } +}; + GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget *parent) : GxsMessageFrameWidget(rsGxsForums, parent), ui(new Ui::GxsForumThreadWidget) @@ -206,6 +249,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadModel = new RsGxsForumModel(this); ui->threadTreeWidget->setModel(mThreadModel); ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; + ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); From c2686d1a9477da81cf074be5f4766aab7d786c7f Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Nov 2018 16:11:40 +0100 Subject: [PATCH 042/110] fixed display of author in new ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 41 +++++++++--- .../src/gui/gxsforums/GxsForumModel.h | 6 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 67 +++++++++++++++---- 3 files changed, 89 insertions(+), 25 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index c5d300816..dc098a09f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -5,6 +5,7 @@ #include "util/qtthreadsutils.h" #include "util/DateTime.h" #include "GxsForumModel.h" +#include "retroshare/rsgxsflags.h" #include "retroshare/rsgxsforums.h" //#define DEBUG_FORUMMODEL @@ -14,11 +15,9 @@ #define COLUMN_THREAD_DATE 2 #define COLUMN_THREAD_DISTRIBUTION 3 #define COLUMN_THREAD_AUTHOR 4 -#define COLUMN_THREAD_SIGNED 5 -#define COLUMN_THREAD_CONTENT 6 -#define COLUMN_THREAD_COUNT 7 -#define COLUMN_THREAD_MSGID 8 -#define COLUMN_THREAD_NB_COLUMNS 9 +#define COLUMN_THREAD_CONTENT 5 +#define COLUMN_THREAD_MSGID 6 +#define COLUMN_THREAD_NB_COLUMNS 7 #define COLUMN_THREAD_DATA 0 // column for storing the userdata like parentid @@ -252,6 +251,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const switch(role) { case Qt::SizeHintRole: return sizeHintRole(index.column()) ; + case Qt::FontRole: case Qt::TextAlignmentRole: case Qt::TextColorRole: case Qt::WhatsThisRole: @@ -285,6 +285,14 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const const ForumModelPostEntry& fmpe(mPosts[entry]); + if(role == Qt::FontRole) + { + QFont font ; + + font.setBold(IS_MSG_UNREAD(fmpe.mMsgStatus)); + + return QVariant(font); + } #ifdef DEBUG_FORUMMODEL std::cerr << " [ok]" << std::endl; #endif @@ -294,6 +302,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::DisplayRole: return displayRole (fmpe,index.column()) ; case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ; case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; + case Qt::UserRole: return userRole (fmpe,index.column()) ; case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; case MissingRole: return missingRole (fmpe,index.column()) ; @@ -308,7 +317,7 @@ QVariant RsGxsForumModel::statusRole(const ForumModelPostEntry& fmpe,int column) if(column != COLUMN_THREAD_DATA) return QVariant(); - return QVariant(fmpe.mStatus); + return QVariant(fmpe.mMsgStatus); } QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column) const @@ -390,7 +399,7 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c else return QVariant(QString::fromUtf8(fmpe.mTitle.c_str())); - //case COLUMN_THREAD_READ_STATUS:return QVariant(fmpe.mMsgStatus); + case COLUMN_THREAD_READ:return QVariant(); case COLUMN_THREAD_DATE: { QDateTime qtime; qtime.setTime_t(fmpe.mPublishTs); @@ -398,8 +407,9 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c return QVariant(DateTime::formatDateTime(qtime)); } - case COLUMN_THREAD_AUTHOR: return QVariant(QString::fromStdString(fmpe.mAuthorId.toStdString())); - case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(fmpe.mMsgId.toStdString())); + case COLUMN_THREAD_DISTRIBUTION: + case COLUMN_THREAD_AUTHOR: return QVariant(); + case COLUMN_THREAD_MSGID: return QVariant(); #ifdef TODO if (filterColumn == COLUMN_THREAD_CONTENT) { // need content for filter @@ -416,6 +426,17 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c return QVariant("[ERROR]"); } +QVariant RsGxsForumModel::userRole(const ForumModelPostEntry& fmpe,int col) const +{ + switch(col) + { + case COLUMN_THREAD_AUTHOR: return QVariant(QString::fromStdString(fmpe.mAuthorId.toStdString())); + case COLUMN_THREAD_MSGID: return QVariant(QString::fromStdString(fmpe.mMsgId.toStdString())); + default: + return QVariant(); + } +} + QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col) const { if(col == COLUMN_THREAD_DISTRIBUTION) @@ -534,7 +555,7 @@ void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,c fentry.mMsgId = msg.mMeta.mMsgId; fentry.mPublishTs = msg.mMeta.mPublishTs; fentry.mPostFlags = 0; - fentry.mStatus = msg.mMeta.mMsgStatus; + fentry.mMsgStatus = msg.mMeta.mMsgStatus; if(mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_PINNED; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index a0726b3fe..aef4602d8 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -27,7 +27,7 @@ typedef uint32_t ForumModelIndex; struct ForumModelPostEntry { - ForumModelPostEntry() : mPublishTs(0),mPostFlags(0),mReputationWarningLevel(0),mStatus(0),prow(0) {} + ForumModelPostEntry() : mPublishTs(0),mPostFlags(0),mReputationWarningLevel(0),mMsgStatus(0),prow(0) {} enum { // flags for display of posts FLAG_POST_IS_PINNED = 0x0001, @@ -41,7 +41,7 @@ struct ForumModelPostEntry uint32_t mPublishTs; uint32_t mPostFlags; int mReputationWarningLevel; - int mStatus; + int mMsgStatus; std::vector mChildren; ForumModelIndex mParent; @@ -82,11 +82,13 @@ public: QVariant displayRole (const ForumModelPostEntry& fmpe, int col) const; QVariant decorationRole(const ForumModelPostEntry& fmpe, int col) const; QVariant toolTipRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant userRole (const ForumModelPostEntry& fmpe, int col) const; QVariant pinnedRole (const ForumModelPostEntry& fmpe, int col) const; QVariant missingRole (const ForumModelPostEntry& fmpe, int col) const; QVariant statusRole (const ForumModelPostEntry& fmpe, int col) const; QVariant authorRole (const ForumModelPostEntry& fmpe, int col) const; QVariant sortRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant fontRole (const ForumModelPostEntry& fmpe, int col) const; /*! * \brief debug_dump diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 778804102..55353fca2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -80,16 +80,16 @@ #define VIEW_FLAT 2 /* Thread constants */ + +// We need consts for that!! Defined in multiple places. #define COLUMN_THREAD_TITLE 0 #define COLUMN_THREAD_READ 1 #define COLUMN_THREAD_DATE 2 #define COLUMN_THREAD_DISTRIBUTION 3 #define COLUMN_THREAD_AUTHOR 4 -#define COLUMN_THREAD_SIGNED 5 -#define COLUMN_THREAD_CONTENT 6 -#define COLUMN_THREAD_COUNT 7 -#define COLUMN_THREAD_MSGID 8 -#define COLUMN_THREAD_NB_COLUMNS 9 +#define COLUMN_THREAD_CONTENT 5 +#define COLUMN_THREAD_MSGID 6 +#define COLUMN_THREAD_NB_COLUMNS 7 #define COLUMN_THREAD_DATA 0 // column for storing the userdata like parentid @@ -154,7 +154,36 @@ class AuthorItemDelegate: public QStyledItemDelegate public: AuthorItemDelegate() {} - virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override + { + QStyleOptionViewItemV4 opt = option; + initStyleOption(&opt, index); + + // disable default icon + opt.icon = QIcon(); + const QRect r = option.rect; + + RsGxsId id(index.data(Qt::UserRole).toString().toStdString()); + QString str; + QList icons; + QString comment; + + QFontMetricsF fm(option.font); + float f = fm.height(); + + QIcon icon ; + + if(!GxsIdDetails::MakeIdDesc(id, true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) + icon = GxsIdDetails::getLoadingIcon(id); + else + icon = *icons.begin(); + + QPixmap pix = icon.pixmap(r.size()); + + return QSize(pix.width() + fm.width(str),fm.height()); + } + + virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override { if(!index.isValid()) { @@ -172,11 +201,14 @@ public: const QRect r = option.rect; - RsGxsId id(index.data(Qt::DisplayRole).toString().toStdString()); + RsGxsId id(index.data(Qt::UserRole).toString().toStdString()); QString str; QList icons; QString comment; + QFontMetricsF fm(painter->font()); + float f = fm.height(); + QIcon icon ; if(!GxsIdDetails::MakeIdDesc(id, true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) @@ -189,6 +221,7 @@ public: // draw pixmap at center of item const QPoint p = QPoint((r.width() - pix.width())/2, (r.height() - pix.height())/2); painter->drawPixmap(r.topLeft() + p, pix); + painter->drawText(r.topLeft() + p + QPoint(pix.width()+f/2.0,f*0.8), str); } }; @@ -565,10 +598,18 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) if (mFillThread) { return; } -#ifdef TODO QMenu contextMnu(this); - QList selectedItems = ui->threadTreeWidget->selectedItems(); + QModelIndexList selectedIndexes = ui->threadTreeWidget->selectionModel()->selectedIndexes(); + if(selectedIndexes.size() != 1) + return; + + QModelIndex index = *selectedIndexes.begin(); + + RsGxsMessageId mid(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::UserRole).toString().toStdString()); + + std::cerr << "Clicked on msg " << mid << std::endl; +#ifdef TODO QAction *editAct = new QAction(QIcon(IMAGE_MESSAGEEDIT), tr("Edit"), &contextMnu); connect(editAct, SIGNAL(triggered()), this, SLOT(editforummessage())); @@ -829,7 +870,7 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) return; } - mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); + mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::UserRole).toString().toStdString()); std::cerr << "Switched to new thread ID " << mThreadId << std::endl; @@ -867,7 +908,7 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h bool isNew = IS_MSG_NEW(status); bool unread = IS_MSG_UNREAD(status); bool missing = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool(); - RsGxsMessageId msgId(item->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString()); + RsGxsMessageId msgId(item->data(COLUMN_THREAD_MSGID,Qt::UserRole).toString().toStdString()); // set icon if (missing) { @@ -899,7 +940,7 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h bool is_pinned = mForumGroup.mPinnedPosts.ids.find(msgId) != mForumGroup.mPinnedPosts.ids.end(); // set font - for (int i = 0; i < COLUMN_THREAD_COUNT; ++i) { + for (int i = 0; i < COLUMN_THREAD_NB_COLUMNS; ++i) { QFont qf = item->font(i); if (!IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { @@ -1452,7 +1493,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum item->setText(COLUMN_THREAD_CONTENT, doc.toPlainText().replace(QString("\n"), QString(" "))); } - item->setData(COLUMN_THREAD_MSGID,Qt::DisplayRole, QString::fromStdString(msg.mMeta.mMsgId.toStdString())); + item->setData(COLUMN_THREAD_MSGID,Qt::UserRole, QString::fromStdString(msg.mMeta.mMsgId.toStdString())); //#TODO #if 0 if (IS_GROUP_SUBSCRIBED(subscribeFlags) && !(msginfo.mMsgFlags & RS_DISTRIB_MISSING_MSG)) { From 9cec56f1ecd7abfa25be24289cb266b462d99dde Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Nov 2018 17:57:19 +0100 Subject: [PATCH 043/110] added info for read/unread status and resurrected context menu in new forum model --- .../src/gui/gxsforums/GxsForumModel.cpp | 59 ++- .../src/gui/gxsforums/GxsForumModel.h | 24 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 362 +++++++++--------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 + 4 files changed, 247 insertions(+), 200 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index dc098a09f..3a1d4f507 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -10,15 +10,6 @@ //#define DEBUG_FORUMMODEL -#define COLUMN_THREAD_TITLE 0 -#define COLUMN_THREAD_READ 1 -#define COLUMN_THREAD_DATE 2 -#define COLUMN_THREAD_DISTRIBUTION 3 -#define COLUMN_THREAD_AUTHOR 4 -#define COLUMN_THREAD_CONTENT 5 -#define COLUMN_THREAD_MSGID 6 -#define COLUMN_THREAD_NB_COLUMNS 7 - #define COLUMN_THREAD_DATA 0 // column for storing the userdata like parentid Q_DECLARE_METATYPE(RsMsgMetaData); @@ -85,6 +76,23 @@ int RsGxsForumModel::columnCount(const QModelIndex &parent) const return COLUMN_THREAD_NB_COLUMNS ; } +bool RsGxsForumModel::getPostData(const QModelIndex& i,ForumModelPostEntry& fmpe) const +{ + if(!i.isValid()) + return true; + + void *ref = i.internalPointer(); + uint32_t entry = 0; + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + return false ; + + fmpe = mPosts[entry]; + + return true; + +} + bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const { if(!parent.isValid()) @@ -915,6 +923,39 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou std::cerr << "GxsForumsFillThread::run() stopped: " << (wasStopped() ? "yes" : "no") << std::endl; #endif + + bool has_unread_below,has_read_below ; + + recursUpdateReadStatus(0,has_unread_below,has_read_below) ; +} + +void RsGxsForumModel::recursUpdateReadStatus(ForumModelIndex i,bool& has_unread_below,bool& has_read_below) +{ + has_unread_below = IS_MSG_UNREAD(mPosts[i].mMsgStatus); + has_read_below = !IS_MSG_UNREAD(mPosts[i].mMsgStatus); + + for(uint32_t j=0;j& entries,ForumModelIndex index,int depth) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index aef4602d8..eac629b59 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -29,10 +29,12 @@ struct ForumModelPostEntry { ForumModelPostEntry() : mPublishTs(0),mPostFlags(0),mReputationWarningLevel(0),mMsgStatus(0),prow(0) {} - enum { // flags for display of posts - FLAG_POST_IS_PINNED = 0x0001, - FLAG_POST_IS_MISSING = 0x0002, - FLAG_POST_IS_REDACTED = 0x0004, + enum { // flags for display of posts. To be used in mPostFlags + FLAG_POST_IS_PINNED = 0x0001, + FLAG_POST_IS_MISSING = 0x0002, + FLAG_POST_IS_REDACTED = 0x0004, + FLAG_POST_HAS_UNREAD_CHILDREN = 0x0008, + FLAG_POST_HAS_READ_CHILDREN = 0x0010, }; std::string mTitle ; @@ -58,6 +60,17 @@ public: explicit RsGxsForumModel(QObject *parent = NULL); ~RsGxsForumModel(){} + enum Columns { + COLUMN_THREAD_TITLE =0x00, + COLUMN_THREAD_READ =0x01, + COLUMN_THREAD_DATE =0x02, + COLUMN_THREAD_DISTRIBUTION =0x03, + COLUMN_THREAD_AUTHOR =0x04, + COLUMN_THREAD_CONTENT =0x05, + COLUMN_THREAD_MSGID =0x06, + COLUMN_THREAD_NB_COLUMNS =0x07, + }; + enum Roles{ SortRole = Qt::UserRole+1, ThreadPinnedRole = Qt::UserRole+2, MissingRole = Qt::UserRole+3, @@ -71,6 +84,8 @@ public: int columnCount(const QModelIndex &parent = QModelIndex()) const override; bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; + bool getPostData(const QModelIndex& i,ForumModelPostEntry& fmpe) const ; + QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex& child) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; @@ -112,6 +127,7 @@ private: void update_posts(const RsGxsGroupId &group_id); void setForumMessageSummary(const std::vector& messages); + void recursUpdateReadStatus(ForumModelIndex i,bool& has_unread_below,bool& has_read_below); static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 55353fca2..3d62a2982 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -82,16 +82,6 @@ /* Thread constants */ // We need consts for that!! Defined in multiple places. -#define COLUMN_THREAD_TITLE 0 -#define COLUMN_THREAD_READ 1 -#define COLUMN_THREAD_DATE 2 -#define COLUMN_THREAD_DISTRIBUTION 3 -#define COLUMN_THREAD_AUTHOR 4 -#define COLUMN_THREAD_CONTENT 5 -#define COLUMN_THREAD_MSGID 6 -#define COLUMN_THREAD_NB_COLUMNS 7 - -#define COLUMN_THREAD_DATA 0 // column for storing the userdata like parentid #define ROLE_THREAD_MSGID Qt::UserRole #define ROLE_THREAD_STATUS Qt::UserRole + 1 @@ -277,12 +267,12 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mInMsgAsReadUnread = false; mThreadCompareRole = new RSTreeWidgetItemCompareRole; - mThreadCompareRole->setRole(COLUMN_THREAD_DATE, ROLE_THREAD_SORT); + mThreadCompareRole->setRole(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT); mThreadModel = new RsGxsForumModel(this); ui->threadTreeWidget->setModel(mThreadModel); - ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; - ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; + ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; + ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); @@ -319,15 +309,15 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget /* Set header resize modes and initial section sizes */ QHeaderView * ttheader = ui->threadTreeWidget->header () ; - QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_TITLE, QHeaderView::Interactive); - QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_TITLE, QHeaderView::Interactive); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents); float f = QFontMetricsF(font()).height()/14.0f ; - ttheader->resizeSection (COLUMN_THREAD_DATE, 140*f); - ttheader->resizeSection (COLUMN_THREAD_TITLE, 440*f); - ttheader->resizeSection (COLUMN_THREAD_DISTRIBUTION, 24*f); - ttheader->resizeSection (COLUMN_THREAD_AUTHOR, 150*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DATE, 140*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_TITLE, 440*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, 24*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_AUTHOR, 150*f); #ifdef SUSPENDED_CODE /* Set text of column "Read" to empty - without this the column has a number as header text */ @@ -339,10 +329,10 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget #endif /* add filter actions */ - ui->filterLineEdit->addFilter(QIcon(), tr("Title"), COLUMN_THREAD_TITLE, tr("Search Title")); - ui->filterLineEdit->addFilter(QIcon(), tr("Date"), COLUMN_THREAD_DATE, tr("Search Date")); - ui->filterLineEdit->addFilter(QIcon(), tr("Author"), COLUMN_THREAD_AUTHOR, tr("Search Author")); - ui->filterLineEdit->addFilter(QIcon(), tr("Content"), COLUMN_THREAD_CONTENT, tr("Search Content")); + ui->filterLineEdit->addFilter(QIcon(), tr("Title"), RsGxsForumModel::COLUMN_THREAD_TITLE, tr("Search Title")); + ui->filterLineEdit->addFilter(QIcon(), tr("Date"), RsGxsForumModel::COLUMN_THREAD_DATE, tr("Search Date")); + ui->filterLineEdit->addFilter(QIcon(), tr("Author"), RsGxsForumModel::COLUMN_THREAD_AUTHOR, tr("Search Author")); + ui->filterLineEdit->addFilter(QIcon(), tr("Content"), RsGxsForumModel::COLUMN_THREAD_CONTENT, tr("Search Content")); // see processSettings //ui->filterLineEdit->setCurrentFilter(COLUMN_THREAD_TITLE); @@ -352,9 +342,9 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget processSettings(true); /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ - ttheader->resizeSection (COLUMN_THREAD_READ, 24*f); - QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_READ, QHeaderView::Fixed); - ttheader->hideSection (COLUMN_THREAD_CONTENT); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_READ, 24*f); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); + ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_CONTENT); ui->progressBar->hide(); ui->progressText->hide(); @@ -381,7 +371,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget #ifdef SUSPENDED_CODE ui->threadTreeWidget->enableColumnCustomize(true); - ui->threadTreeWidget->sortItems(COLUMN_THREAD_DATE, Qt::DescendingOrder); + ui->threadTreeWidget->sortItems(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); #endif } @@ -442,7 +432,7 @@ void GxsForumThreadWidget::processSettings(bool load) togglethreadview_internal(); // filterColumn - ui->filterLineEdit->setCurrentFilter(Settings->value("filterColumn", COLUMN_THREAD_TITLE).toInt()); + ui->filterLineEdit->setCurrentFilter(Settings->value("filterColumn", RsGxsForumModel::COLUMN_THREAD_TITLE).toInt()); // index of viewBox ui->viewBox->setCurrentIndex(Settings->value("viewBox", VIEW_THREADED).toInt()); @@ -593,23 +583,26 @@ void GxsForumThreadWidget::updateDisplay(bool complete) } } -void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) +bool GxsForumThreadWidget::getCurrentPost(ForumModelPostEntry& fmpe) const { - if (mFillThread) { - return; - } - QMenu contextMnu(this); QModelIndexList selectedIndexes = ui->threadTreeWidget->selectionModel()->selectedIndexes(); - if(selectedIndexes.size() != 1) - return; + if(selectedIndexes.size() != RsGxsForumModel::COLUMN_THREAD_NB_COLUMNS) // check that a single row is selected + return false; QModelIndex index = *selectedIndexes.begin(); - RsGxsMessageId mid(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::UserRole).toString().toStdString()); + return mThreadModel->getPostData(index,fmpe); +} - std::cerr << "Clicked on msg " << mid << std::endl; -#ifdef TODO +void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) +{ + QMenu contextMnu(this); + + ForumModelPostEntry current_post ; + bool has_current_post = getCurrentPost(current_post); + + std::cerr << "Clicked on msg " << current_post.mMsgId << std::endl; QAction *editAct = new QAction(QIcon(IMAGE_MESSAGEEDIT), tr("Edit"), &contextMnu); connect(editAct, SIGNAL(triggered()), this, SLOT(editforummessage())); @@ -664,40 +657,39 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) connect(showinpeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab())); if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { - QList rows; - QList rowsRead; - QList rowsUnread; - int nCount = getSelectedMsgCount(&rows, &rowsRead, &rowsUnread); + //QList rows; + //QList rowsRead; + //QList rowsUnread; + //int nCount = getSelectedMsgCount(&rows, &rowsRead, &rowsUnread); - if (rowsUnread.isEmpty()) { - markMsgAsRead->setDisabled(true); - } - if (rowsRead.isEmpty()) { - markMsgAsUnread->setDisabled(true); - } + //if (rowsUnread.isEmpty()) { + // markMsgAsRead->setDisabled(true); + //} + //if (rowsRead.isEmpty()) { + // markMsgAsUnread->setDisabled(true); + //} - bool hasUnreadChildren = false; - bool hasReadChildren = false; - int rowCount = rows.count(); - for (int i = 0; i < rowCount; ++i) { - if (hasUnreadChildren || rows[i]->data(COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN).toBool()) { - hasUnreadChildren = true; - } - if (hasReadChildren || rows[i]->data(COLUMN_THREAD_DATA, ROLE_THREAD_READCHILDREN).toBool()) { - hasReadChildren = true; - } - } - markMsgAsReadChildren->setEnabled(hasUnreadChildren); - markMsgAsUnreadChildren->setEnabled(hasReadChildren); + //bool hasUnreadChildren = false; + //bool hasReadChildren = false; - if (nCount == 1) { - replyAct->setEnabled (true); - replyauthorAct->setEnabled (true); - } else { - replyAct->setDisabled (true); - replyauthorAct->setDisabled (true); - } - } else { + //int rowCount = rows.count(); + + //for (int i = 0; i < rowCount; ++i) { + // if (hasUnreadChildren || rows[i]->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN).toBool()) { + // hasUnreadChildren = true; + // } + // if (hasReadChildren || rows[i]->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_READCHILDREN).toBool()) { + // hasReadChildren = true; + // } + //} + markMsgAsReadChildren->setEnabled(current_post.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN); + markMsgAsUnreadChildren->setEnabled(current_post.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_READ_CHILDREN); + + replyAct->setEnabled (true); + replyauthorAct->setEnabled (true); + } + else + { markMsgAsRead->setDisabled(true); markMsgAsReadChildren->setDisabled(true); markMsgAsUnread->setDisabled(true); @@ -706,17 +698,14 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) replyauthorAct->setDisabled (true); } - if(selectedItems.size() == 1) + if(has_current_post) { - QTreeWidgetItem *item = *selectedItems.begin(); - GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast(item); - - bool is_pinned = mForumGroup.mPinnedPosts.ids.find( RsGxsMessageId(item->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString()) ) != mForumGroup.mPinnedPosts.ids.end(); + bool is_pinned = mForumGroup.mPinnedPosts.ids.find( current_post.mMsgId ) != mForumGroup.mPinnedPosts.ids.end(); if(!is_pinned) { RsGxsId author_id; - if(gxsIdItem && gxsIdItem->getId(author_id) && rsIdentity->isOwnId(author_id)) + if(rsIdentity->isOwnId(current_post.mAuthorId)) contextMnu.addAction(editAct); else { @@ -735,7 +724,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) } } - if(IS_GROUP_ADMIN(mSubscribeFlags) && (*selectedItems.begin())->parent() == NULL) + if(IS_GROUP_ADMIN(mSubscribeFlags) && (current_post.mParent == 0)) contextMnu.addAction(pinUpPostAct); } @@ -752,42 +741,33 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) contextMnu.addAction(expandAll); contextMnu.addAction(collapseAll); - if(selectedItems.size() == 1) + if(has_current_post) { - QTreeWidgetItem *item = *selectedItems.begin(); - GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast(item); + std::cerr << "Author is: " << current_post.mAuthorId << std::endl; - RsGxsId author_id; - if(gxsIdItem && gxsIdItem->getId(author_id)) + contextMnu.addSeparator(); + + RsReputations::Opinion op ; + + if(!rsIdentity->isOwnId(current_post.mAuthorId) && rsReputations->getOwnOpinion(current_post.mAuthorId,op)) { - std::cerr << "Author is: " << author_id << std::endl; + QMenu *submenu1 = contextMnu.addMenu(tr("Author's reputation")) ; - contextMnu.addSeparator(); + if(op != RsReputations::OPINION_POSITIVE) + submenu1->addAction(flagaspositiveAct); - RsReputations::Opinion op ; + if(op != RsReputations::OPINION_NEUTRAL) + submenu1->addAction(flagasneutralAct); - if(!rsIdentity->isOwnId(author_id) && rsReputations->getOwnOpinion(author_id,op)) - { - QMenu *submenu1 = contextMnu.addMenu(tr("Author's reputation")) ; - - if(op != RsReputations::OPINION_POSITIVE) - submenu1->addAction(flagaspositiveAct); - - if(op != RsReputations::OPINION_NEUTRAL) - submenu1->addAction(flagasneutralAct); - - if(op != RsReputations::OPINION_NEGATIVE) - submenu1->addAction(flagasnegativeAct); - } - - contextMnu.addAction(showinpeopleAct); - contextMnu.addAction(replyauthorAct); + if(op != RsReputations::OPINION_NEGATIVE) + submenu1->addAction(flagasnegativeAct); } + contextMnu.addAction(showinpeopleAct); + contextMnu.addAction(replyauthorAct); } contextMnu.exec(QCursor::pos()); -#endif } void GxsForumThreadWidget::contextMenuTextBrowser(QPoint point) @@ -818,7 +798,7 @@ bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event) if (keyEvent && keyEvent->key() == Qt::Key_Space) { // Space pressed QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); - clickedThread (item, COLUMN_THREAD_READ); + clickedThread (item, RsGxsForumModel::COLUMN_THREAD_READ); return true; // eat event } } @@ -870,7 +850,7 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) return; } - mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::UserRole).toString().toStdString()); + mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID),Qt::UserRole).toString().toStdString()); std::cerr << "Switched to new thread ID " << mThreadId << std::endl; @@ -893,37 +873,40 @@ void GxsForumThreadWidget::clickedThread(QTreeWidgetItem *item, int column) return; } - if (column == COLUMN_THREAD_READ) { + if (column == RsGxsForumModel::COLUMN_THREAD_READ) { QList rows; rows.append(item); - uint32_t status = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); +#ifdef TODO + uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); setMsgReadStatus(rows, IS_MSG_UNREAD(status)); +#endif } } void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren) { - uint32_t status = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); +#ifdef TODO + uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); bool isNew = IS_MSG_NEW(status); bool unread = IS_MSG_UNREAD(status); - bool missing = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool(); - RsGxsMessageId msgId(item->data(COLUMN_THREAD_MSGID,Qt::UserRole).toString().toStdString()); + bool missing = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool(); + RsGxsMessageId msgId(item->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::UserRole).toString().toStdString()); // set icon if (missing) { - item->setIcon(COLUMN_THREAD_READ, QIcon()); - item->setIcon(COLUMN_THREAD_TITLE, QIcon()); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_READ, QIcon()); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_TITLE, QIcon()); } else { if (unread) { - item->setIcon(COLUMN_THREAD_READ, QIcon(":/images/message-state-unread.png")); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_READ, QIcon(":/images/message-state-unread.png")); } else { - item->setIcon(COLUMN_THREAD_READ, QIcon(":/images/message-state-read.png")); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_READ, QIcon(":/images/message-state-read.png")); } if (isNew) { - item->setIcon(COLUMN_THREAD_TITLE, QIcon(":/images/message-state-new.png")); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_TITLE, QIcon(":/images/message-state-new.png")); } else { - item->setIcon(COLUMN_THREAD_TITLE, QIcon()); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_TITLE, QIcon()); } } @@ -940,7 +923,7 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h bool is_pinned = mForumGroup.mPinnedPosts.ids.find(msgId) != mForumGroup.mPinnedPosts.ids.end(); // set font - for (int i = 0; i < COLUMN_THREAD_NB_COLUMNS; ++i) { + for (int i = 0; i < RsGxsForumModel::COLUMN_THREAD_NB_COLUMNS; ++i) { QFont qf = item->font(i); if (!IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { @@ -972,11 +955,12 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h item->setFont(i, qf); } - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_READCHILDREN, hasReadChilddren || myReadChilddren); - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN, hasUnreadChilddren || myUnreadChilddren); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_READCHILDREN, hasReadChilddren || myReadChilddren); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN, hasUnreadChilddren || myUnreadChilddren); hasReadChilddren = hasReadChilddren || myReadChilddren || !unread; hasUnreadChilddren = hasUnreadChilddren || myUnreadChilddren || unread; +#endif } void GxsForumThreadWidget::calculateUnreadCount() @@ -990,7 +974,7 @@ void GxsForumThreadWidget::calculateUnreadCount() while ((item = *itemIterator) != NULL) { ++itemIterator; - uint32_t status = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); if (IS_MSG_UNREAD(status)) { ++unreadCount; } @@ -1243,16 +1227,16 @@ void GxsForumThreadWidget::fillThreadFinished() while ((item = *itemIterator) != NULL) { ++itemIterator; - QString gxsId = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR).toString(); + QString gxsId = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR).toString(); if (gxsId.isEmpty()) { continue; } - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QVariant()); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QVariant()); GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast(item); if (gxsIdItem) { - gxsIdItem->setId(RsGxsId(gxsId.toStdString()), COLUMN_THREAD_AUTHOR, false); + gxsIdItem->setId(RsGxsId(gxsId.toStdString()), RsGxsForumModel::COLUMN_THREAD_AUTHOR, false); } } @@ -1267,7 +1251,7 @@ void GxsForumThreadWidget::fillThreadFinished() while ((item = *itemIterator) != NULL) { ++itemIterator; - if (item->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString() == thread->mFocusMsgId) { + if (item->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString() == thread->mFocusMsgId) { ui->threadTreeWidget->setCurrentItem(item); ui->threadTreeWidget->setFocus(); break; @@ -1334,13 +1318,13 @@ public: bool operator<(const QTreeWidgetItem& other) const { - bool left_is_not_pinned = ! data(COLUMN_THREAD_DATE,ROLE_THREAD_PINNED).toBool(); - bool right_is_not_pinned = !other.data(COLUMN_THREAD_DATE,ROLE_THREAD_PINNED).toBool(); + bool left_is_not_pinned = ! data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED).toBool(); + bool right_is_not_pinned = !other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED).toBool(); #ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Comparing item date \"" << data(COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" - << data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \"" - << other.data(COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" - << other.data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << other.data(COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << right_is_not_pinned << ") "; + std::cerr << "Comparing item date \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" + << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \"" + << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" + << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << right_is_not_pinned << ") "; #endif if(left_is_not_pinned ^ right_is_not_pinned) @@ -1380,11 +1364,11 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum item->moveToThread(ui->threadTreeWidget->thread()); if(redacted) - item->setText(COLUMN_THREAD_TITLE, tr("[ ... Redacted message ... ]")); + item->setText(RsGxsForumModel::COLUMN_THREAD_TITLE, tr("[ ... Redacted message ... ]")); else if(is_pinned) - item->setText(COLUMN_THREAD_TITLE, tr("[PINNED] ") + QString::fromUtf8(msg.mMeta.mMsgName.c_str())); + item->setText(RsGxsForumModel::COLUMN_THREAD_TITLE, tr("[PINNED] ") + QString::fromUtf8(msg.mMeta.mMsgName.c_str())); else - item->setText(COLUMN_THREAD_TITLE, QString::fromUtf8(msg.mMeta.mMsgName.c_str())); + item->setText(RsGxsForumModel::COLUMN_THREAD_TITLE, QString::fromUtf8(msg.mMeta.mMsgName.c_str())); QString rep_tooltip_str ; uint32_t rep_warning_level ; @@ -1410,8 +1394,8 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum rep_tooltip_str = tr("Message will be forwarded to your friends.") ; } - item->setData(COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole,rep_tooltip_str) ; - item->setData(COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,rep_warning_level) ; + item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole,rep_tooltip_str) ; + item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,rep_warning_level) ; //msg.mMeta.mChildTs Was not updated when received new child // so do it here. @@ -1429,35 +1413,37 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum for(QTreeWidgetItem *grandParent = parent; grandParent!=NULL; grandParent = grandParent->parent()) { //Update Parent Child TimeStamp - QString oldTSSort = grandParent->data(COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); + QString oldTSSort = grandParent->data(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); QString oldCTSSort = oldTSSort.split("|").at(0); QString oldPTSSort = oldTSSort.contains("|") ? oldTSSort.split(" | ").at(1) : oldCTSSort; #ifdef SHOW_COMBINED_DATES - QString oldTSText = grandParent->text(COLUMN_THREAD_DATE); + QString oldTSText = grandParent->text(RsGxsForumModel::COLUMN_THREAD_DATE); QString oldCTSText = oldTSText.split("|").at(0); QString oldPTSText = oldTSText.contains("|") ? oldTSText.split(" | ").at(1) : oldCTSText;//If first time parent get only its mPublishTs #endif if (oldCTSSort.toDouble() < itemSort.toDouble()) { #ifdef SHOW_COMBINED_DATES - grandParent->setText(COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); + grandParent->setText(RsGxsForumModel::COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); #endif - grandParent->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); + grandParent->setData(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); } } } - item->setText(COLUMN_THREAD_DATE, itemText); - item->setData(COLUMN_THREAD_DATE,ROLE_THREAD_SORT, itemSort); + item->setText(RsGxsForumModel::COLUMN_THREAD_DATE, itemText); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT, itemSort); if(is_pinned) - item->setData(COLUMN_THREAD_DATE,ROLE_THREAD_PINNED, QVariant(true)); // this is used by the sorting model to put all posts on top + item->setData(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED, QVariant(true)); // this is used by the sorting model to put all posts on top else - item->setData(COLUMN_THREAD_DATE,ROLE_THREAD_PINNED, QVariant(false)); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED, QVariant(false)); // Set later with GxsIdRSTreeWidgetItem::setId - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QString::fromStdString(msg.mMeta.mAuthorId.toStdString())); +#ifdef TODO + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QString::fromStdString(msg.mMeta.mAuthorId.toStdString())); +#endif //#TODO #if 0 @@ -1465,35 +1451,35 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum if (text.isEmpty()) { - item->setText(COLUMN_THREAD_AUTHOR, tr("Anonymous")); + item->setText(RsGxsForumModel::COLUMN_THREAD_AUTHOR, tr("Anonymous")); } else { - item->setText(COLUMN_THREAD_AUTHOR, text); + item->setText(RsGxsForumModel::COLUMN_THREAD_AUTHOR, text); } #endif //#TODO #ifdef TOGXS if (msgInfo.mMeta.mMsgFlags & RS_DISTRIB_AUTHEN_REQ) { - item->setText(COLUMN_THREAD_SIGNED, tr("signed")); - item->setIcon(COLUMN_THREAD_SIGNED, QIcon(":/images/mail-signed.png")); + item->setText(RsGxsForumModel::COLUMN_THREAD_SIGNED, tr("signed")); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_SIGNED, QIcon(":/images/mail-signed.png")); } else { - item->setText(COLUMN_THREAD_SIGNED, tr("none")); - item->setIcon(COLUMN_THREAD_SIGNED, QIcon(":/images/mail-signature-unknown.png")); + item->setText(RsGxsForumModel::COLUMN_THREAD_SIGNED, tr("none")); + item->setIcon(RsGxsForumModel::COLUMN_THREAD_SIGNED, QIcon(":/images/mail-signature-unknown.png")); } #endif - if (filterColumn == COLUMN_THREAD_CONTENT) { + if (filterColumn == RsGxsForumModel::COLUMN_THREAD_CONTENT) { // need content for filter QTextDocument doc; doc.setHtml(QString::fromUtf8(msg.mMsg.c_str())); - item->setText(COLUMN_THREAD_CONTENT, doc.toPlainText().replace(QString("\n"), QString(" "))); + item->setText(RsGxsForumModel::COLUMN_THREAD_CONTENT, doc.toPlainText().replace(QString("\n"), QString(" "))); } - item->setData(COLUMN_THREAD_MSGID,Qt::UserRole, QString::fromStdString(msg.mMeta.mMsgId.toStdString())); + item->setData(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::UserRole, QString::fromStdString(msg.mMeta.mMsgId.toStdString())); //#TODO #if 0 if (IS_GROUP_SUBSCRIBED(subscribeFlags) && !(msginfo.mMsgFlags & RS_DISTRIB_MISSING_MSG)) { @@ -1502,9 +1488,9 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum // show message as read status = RSGXS_MSG_STATUS_READ; } + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS, msg.mMeta.mMsgStatus); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_MISSING, false); #endif - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS, msg.mMeta.mMsgStatus); - item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_MISSING, false); if (parent) parent->addChild(item); return item; @@ -1601,19 +1587,19 @@ void GxsForumThreadWidget::insertThreads() static void copyItem(QTreeWidgetItem *item, const QTreeWidgetItem *newItem) { int i; - for (i = 0; i < COLUMN_THREAD_COUNT; ++i) { - if (i != COLUMN_THREAD_AUTHOR) { + for (i = 0; i < RsGxsForumModel::COLUMN_THREAD_COUNT; ++i) { + if (i != RsGxsForumModel::COLUMN_THREAD_AUTHOR) { /* Copy text */ item->setText(i, newItem->text(i)); } } for (i = 0; i < ROLE_THREAD_COUNT; ++i) { - item->setData(COLUMN_THREAD_DATA, Qt::UserRole + i, newItem->data(COLUMN_THREAD_DATA, Qt::UserRole + i)); + item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, Qt::UserRole + i, newItem->data(RsGxsForumModel::COLUMN_THREAD_DATA, Qt::UserRole + i)); } - item->setData(COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,newItem->data(COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole)); - item->setData(COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole, newItem->data(COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole )); - item->setData(COLUMN_THREAD_MSGID, Qt::DisplayRole, newItem->data(COLUMN_THREAD_MSGID, Qt::DisplayRole )); + item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,newItem->data(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole)); + item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole, newItem->data(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole )); + item->setData(RsGxsForumModel::COLUMN_THREAD_MSGID, Qt::DisplayRole, newItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID, Qt::DisplayRole )); } void GxsForumThreadWidget::fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand) @@ -1630,14 +1616,14 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo std::map newThreadMap ; for(QList::iterator newThread = threadList.begin (); newThread != threadList.end (); ++newThread) - newThreadMap[(*newThread)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = *newThread ; + newThreadMap[(*newThread)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = *newThread ; // delete not existing while (index < ui->threadTreeWidget->topLevelItemCount()) { threadItem = ui->threadTreeWidget->topLevelItem(index); - if(newThreadMap.find(threadItem->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) == newThreadMap.end()) + if(newThreadMap.find(threadItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) == newThreadMap.end()) delete(ui->threadTreeWidget->takeTopLevelItem(index)); else ++index; @@ -1646,16 +1632,16 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo //(csoler) QTreeWidget::findItems apparently does not always work so I need to make the search manually, which I do using a map for efficiency reasons. std::map oldThreadMap; for(int i=0; ithreadTreeWidget->topLevelItemCount(); ++i) - oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(COLUMN_THREAD_MSGID, Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i); + oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(RsGxsForumModel::COLUMN_THREAD_MSGID, Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i); // iterate all new threads for (QList::iterator newThread = threadList.begin (); newThread != threadList.end (); ++newThread) { // search existing thread #ifdef DEBUG_FORUMS - std::cerr << "Makign a search for string \"" << (*newThread)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString() << "\"" << std::endl; + std::cerr << "Makign a search for string \"" << (*newThread)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString() << "\"" << std::endl; #endif - std::map::const_iterator it = oldThreadMap.find((*newThread)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) ; + std::map::const_iterator it = oldThreadMap.find((*newThread)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) ; if(it != oldThreadMap.end()) { @@ -1675,7 +1661,7 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo *newThread = NULL; } - uint32_t status = threadItem->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = threadItem->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); if (expandNewMessages && IS_MSG_UNREAD(status)) { QTreeWidgetItem *parentItem = threadItem; while ((parentItem = parentItem->parent()) != NULL) { @@ -1704,15 +1690,15 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget std::map newParentItemMap, parentItemMap ; - for(index = 0; index < newParentItem->childCount(); ++index) newParentItemMap[newParentItem->child(index)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = newParentItem->child(index); - for(index = 0; index < parentItem->childCount(); ++index) parentItemMap[ parentItem->child(index)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = parentItem->child(index); + for(index = 0; index < newParentItem->childCount(); ++index) newParentItemMap[newParentItem->child(index)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = newParentItem->child(index); + for(index = 0; index < parentItem->childCount(); ++index) parentItemMap[ parentItem->child(index)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = parentItem->child(index); // delete not existing while (index < parentItem->childCount()) { childItem = parentItem->child(index); - if(newParentItemMap.find(childItem->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) == newParentItemMap.end()) + if(newParentItemMap.find(childItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) == newParentItemMap.end()) delete(parentItem->takeChild (index)); else ++index; @@ -1725,7 +1711,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget // search existing child - std::map::const_iterator it = parentItemMap.find(newChildItem->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) ; + std::map::const_iterator it = parentItemMap.find(newChildItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) ; if(it != parentItemMap.end()) { @@ -1745,7 +1731,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget newCount--; } - uint32_t status = childItem->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = childItem->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); if (expandNewMessages && IS_MSG_UNREAD(status)) { QTreeWidgetItem *parentItem = childItem; while ((parentItem = parentItem->parent()) != NULL) { @@ -1890,11 +1876,11 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) mStateHelper->setActive(mTokenTypeMessageData, true); - //mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); + //mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); //QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); - uint32_t status = msg.mMeta.mMsgStatus ;//item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = msg.mMeta.mMsgStatus ;//item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); #ifdef TODO QList row; @@ -2013,7 +1999,7 @@ void GxsForumThreadWidget::nextUnreadMessage() continue; } - uint32_t status = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); if (IS_MSG_UNREAD(status)) { ui->threadTreeWidget->setCurrentItem(item); ui->threadTreeWidget->scrollToItem(item, QAbstractItemView::EnsureVisible); @@ -2043,7 +2029,7 @@ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QLi for(QList::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it) { if (rows) rows->append(*it); if (rowsRead || rowsUnread) { - uint32_t status = (*it)->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = (*it)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); if (IS_MSG_UNREAD(status)) { if (rowsUnread) rowsUnread->append(*it); } else { @@ -2059,18 +2045,19 @@ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QLi void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool read) { +#ifdef TODO QList::iterator row; std::list changedItems; mInMsgAsReadUnread = true; for (row = rows.begin(); row != rows.end(); ++row) { - if ((*row)->data(COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool()) { + if ((*row)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool()) { /* Missing message */ continue; } - uint32_t status = (*row)->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = (*row)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); uint32_t statusNew = (status & ~(GXS_SERV::GXS_MSG_STATUS_GUI_NEW | GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD)); // orig status, without NEW AND UNREAD if (!read) { @@ -2079,11 +2066,11 @@ void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool if (status != statusNew) // is it different? { - std::string msgId = (*row)->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString(); + std::string msgId = (*row)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString(); // NB: MUST BE PART OF ACTIVE THREAD--- OR ELSE WE MUST STORE GROUPID SOMEWHERE!. // LIKE THIS BELOW... - //std::string grpId = (*Row)->data(COLUMN_THREAD_DATA, ROLE_THREAD_GROUPID).toString().toStdString(); + //std::string grpId = (*Row)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_GROUPID).toString().toStdString(); RsGxsGrpMsgIdPair msgPair = std::make_pair( groupId(), RsGxsMessageId(msgId) ); @@ -2109,7 +2096,7 @@ void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool /* Add message id to ignore list for the next updateDisplay */ mIgnoredMsgId.push_back(RsGxsMessageId(msgId)); - (*row)->setData(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS, statusNew); + (*row)->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS, statusNew); QTreeWidgetItem *parentItem = *row; while (parentItem->parent()) { @@ -2129,6 +2116,7 @@ void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool } calculateUnreadCount(); } +#endif } void GxsForumThreadWidget::showInPeopleTab() @@ -2168,7 +2156,7 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f QTreeWidgetItem *row = rows.takeFirst(); /* add only items with the right state or with not RSGXS_MSG_STATUS_READ */ - uint32_t status = row->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); + uint32_t status = row->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); bool isUnread = IS_MSG_UNREAD(status); if (isUnread == read || IS_MSG_NEW(status)) { allRows.append(row); @@ -2237,7 +2225,7 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) while ((item = *itemIterator) != NULL) { ++itemIterator; - if (item->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString() == msgIdString) { + if (item->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString() == msgIdString) { ui->threadTreeWidget->setCurrentItem(item); ui->threadTreeWidget->setFocus(); return true; @@ -2265,7 +2253,7 @@ void GxsForumThreadWidget::copyMessageLink() #ifdef TODO QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); - QString thread_title = (item != NULL)?item->text(COLUMN_THREAD_TITLE):QString() ; + QString thread_title = (item != NULL)?item->text(RsGxsForumModel::COLUMN_THREAD_TITLE):QString() ; RetroShareLink link = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, groupId(), mThreadId, thread_title); @@ -2316,7 +2304,7 @@ void GxsForumThreadWidget::togglePinUpPost() return ; } - QString thread_title = (item != NULL)?item->text(COLUMN_THREAD_TITLE):QString() ; + QString thread_title = (item != NULL)?item->text(RsGxsForumModel::COLUMN_THREAD_TITLE):QString() ; std::cerr << "Toggling Pin-up state of post " << mThreadId.toStdString() << ": \"" << thread_title.toStdString() << "\"" << std::endl; @@ -2570,7 +2558,7 @@ void GxsForumThreadWidget::filterColumnChanged(int column) return; } - if (column == COLUMN_THREAD_CONTENT) { + if (column == RsGxsForumModel::COLUMN_THREAD_CONTENT) { // need content ... refill //insertThreads(); } else { @@ -2671,7 +2659,7 @@ void GxsForumThreadWidget::updateGroupData() mForumGroup = group; insertGroupData(); - ui->threadTreeWidget->setColumnHidden(COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); + ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; }, this ); @@ -2721,7 +2709,7 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) insertMessageData(msg); - ui->threadTreeWidget->setColumnHidden(COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); + ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; }, this ); @@ -2785,7 +2773,7 @@ void GxsForumThreadWidget::loadGroupData(const uint32_t &token) mStateHelper->setActive(mTokenTypeGroupData, true); // Don't show the distribution column if the forum has no anti-spam - ui->threadTreeWidget->setColumnHidden(COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); + ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; } else diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 89ec7b9d9..3f5a5c92f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -33,6 +33,7 @@ class RsGxsForumMsg; class GxsForumsFillThread; class RsGxsForumGroup; class RsGxsForumModel; +class ForumModelPostEntry; namespace Ui { class GxsForumThreadWidget; @@ -149,6 +150,7 @@ private slots: private: void insertMessageData(const RsGxsForumMsg &msg); + bool getCurrentPost(ForumModelPostEntry& fmpe) const ; void insertMessage(); void insertGroupData(); From 6f83bb520e44c36a4f705a7b0f06c5bb4cf92d59 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Nov 2018 20:50:09 +0100 Subject: [PATCH 044/110] fixed mark as read/unread and display of read status in forum model --- .../src/gui/gxsforums/GxsForumModel.cpp | 76 ++++++++++++++----- .../src/gui/gxsforums/GxsForumModel.h | 19 +++++ .../gui/gxsforums/GxsForumThreadWidget.cpp | 51 ++++++++++--- .../src/gui/gxsforums/GxsForumThreadWidget.h | 11 +-- 4 files changed, 122 insertions(+), 35 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 3a1d4f507..ce28e9191 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -258,13 +258,8 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const switch(role) { - case Qt::SizeHintRole: return sizeHintRole(index.column()) ; - case Qt::FontRole: - case Qt::TextAlignmentRole: - case Qt::TextColorRole: - case Qt::WhatsThisRole: - case Qt::EditRole: - case Qt::StatusTipRole: return QVariant(); + case Qt::SizeHintRole: return sizeHintRole(index.column()) ; + case Qt::StatusTipRole:return QVariant(); default: break; } @@ -297,7 +292,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const { QFont font ; - font.setBold(IS_MSG_UNREAD(fmpe.mMsgStatus)); + font.setBold(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN); return QVariant(font); } @@ -311,6 +306,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ; case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; case Qt::UserRole: return userRole (fmpe,index.column()) ; + case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ; case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; case MissingRole: return missingRole (fmpe,index.column()) ; @@ -320,6 +316,14 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const } } +QVariant RsGxsForumModel::textColorRole(const ForumModelPostEntry& fmpe,int column) const +{ + if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN) && !IS_MSG_UNREAD(fmpe.mMsgStatus)) + return QVariant(mTextColorUnreadChildren); + + return QVariant(); +} + QVariant RsGxsForumModel::statusRole(const ForumModelPostEntry& fmpe,int column) const { if(column != COLUMN_THREAD_DATA) @@ -476,6 +480,9 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector= mPosts.size()) + return ; + + bool has_unread_below,has_read_below; + recursSetMsgReadStatus(entry,read_status,with_children) ; + recursUpdateReadStatus(0,has_unread_below,has_read_below); +} + +void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children) +{ + if(read_status) + mPosts[i].mMsgStatus = 0; + else + mPosts[i].mMsgStatus = GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; + + uint32_t token; + rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read); + + if(!with_children) + return; + + for(uint32_t j=0;j& entries,For { const ForumModelPostEntry& e(entries[index]); - std::cerr << std::string(depth*2,' ') << e.mAuthorId.toStdString() << " " << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() - << " " << QDateTime::fromSecsSinceEpoch(e.mPublishTs).toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; + std::cerr << std::string(depth*2,' ') << e.mAuthorId.toStdString() << " " + << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() << " " + << QString("%1").arg((uint32_t)e.mMsgStatus,8,16,QChar('0')).toStdString() << " " + << QDateTime::fromSecsSinceEpoch(e.mPublishTs).toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; for(uint32_t i=0;i +#include // This class holds the actual hierarchy of posts, represented by identifiers // It is responsible for auto-updating when necessary and holds a mutex to allow the Model to @@ -77,9 +78,19 @@ public: StatusRole = Qt::UserRole+4, }; + QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} + // This method will asynchroneously update the data void setForum(const RsGxsGroupId& forumGroup); + void setTextColorRead (QColor color) { mTextColorRead = color;} + void setTextColorUnread (QColor color) { mTextColorUnread = color;} + void setTextColorUnreadChildren(QColor color) { mTextColorUnreadChildren = color;} + void setTextColorNotSubscribed (QColor color) { mTextColorNotSubscribed = color;} + void setTextColorMissing (QColor color) { mTextColorMissing = color;} + + void setMsgReadStatus(const QModelIndex &i, bool read_status, bool with_children); + int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; @@ -104,6 +115,7 @@ public: QVariant authorRole (const ForumModelPostEntry& fmpe, int col) const; QVariant sortRole (const ForumModelPostEntry& fmpe, int col) const; QVariant fontRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant textColorRole(const ForumModelPostEntry& fmpe, int col) const; /*! * \brief debug_dump @@ -128,6 +140,7 @@ private: void update_posts(const RsGxsGroupId &group_id); void setForumMessageSummary(const std::vector& messages); void recursUpdateReadStatus(ForumModelIndex i,bool& has_unread_below,bool& has_read_below); + void recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children); static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); @@ -138,4 +151,10 @@ private: void initEmptyHierarchy(std::vector& posts); std::vector mPosts ; // store the list of posts updated from rsForums. + + QColor mTextColorRead ; + QColor mTextColorUnread ; + QColor mTextColorUnreadChildren; + QColor mTextColorNotSubscribed ; + QColor mTextColorMissing ; }; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 3d62a2982..44c530ed6 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -170,7 +170,7 @@ public: QPixmap pix = icon.pixmap(r.size()); - return QSize(pix.width() + fm.width(str),fm.height()); + return QSize(pix.width() + fm.width(str),1.2*fm.height()); } virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override @@ -215,6 +215,12 @@ public: } }; +void GxsForumThreadWidget::setTextColorRead (QColor color) { mTextColorRead = color; mThreadModel->setTextColorRead (color);} +void GxsForumThreadWidget::setTextColorUnread (QColor color) { mTextColorUnread = color; mThreadModel->setTextColorUnread (color);} +void GxsForumThreadWidget::setTextColorUnreadChildren(QColor color) { mTextColorUnreadChildren = color; mThreadModel->setTextColorUnreadChildren(color);} +void GxsForumThreadWidget::setTextColorNotSubscribed (QColor color) { mTextColorNotSubscribed = color; mThreadModel->setTextColorNotSubscribed (color);} +void GxsForumThreadWidget::setTextColorMissing (QColor color) { mTextColorMissing = color; mThreadModel->setTextColorMissing (color);} + GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget *parent) : GxsMessageFrameWidget(rsGxsForums, parent), ui(new Ui::GxsForumThreadWidget) @@ -234,6 +240,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget setUpdateWhenInvisible(true); +#ifdef TODO /* Setup UI helper */ mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton); mStateHelper->addWidget(mTokenTypeGroupData, ui->newthreadButton); @@ -257,6 +264,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mStateHelper->addLoadPlaceholder(mTokenTypeMessageData, ui->postText); //mStateHelper->addLoadPlaceholder(mTokenTypeMessageData, ui->threadTitle); +#endif mSubscribeFlags = 0; mSignFlags = 0; @@ -583,14 +591,21 @@ void GxsForumThreadWidget::updateDisplay(bool complete) } } -bool GxsForumThreadWidget::getCurrentPost(ForumModelPostEntry& fmpe) const +QModelIndex GxsForumThreadWidget::GxsForumThreadWidget::getCurrentIndex() const { QModelIndexList selectedIndexes = ui->threadTreeWidget->selectionModel()->selectedIndexes(); if(selectedIndexes.size() != RsGxsForumModel::COLUMN_THREAD_NB_COLUMNS) // check that a single row is selected - return false; + return QModelIndex(); - QModelIndex index = *selectedIndexes.begin(); + return *selectedIndexes.begin(); +} +bool GxsForumThreadWidget::getCurrentPost(ForumModelPostEntry& fmpe) const +{ + QModelIndex index = getCurrentIndex() ; + + if(!index.isValid()) + return false ; return mThreadModel->getPostData(index,fmpe); } @@ -1882,25 +1897,22 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); uint32_t status = msg.mMeta.mMsgStatus ;//item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); -#ifdef TODO - QList row; - row.append(item); + QModelIndex index = getCurrentIndex(); if (IS_MSG_NEW(status)) { if (setToReadOnActive) { /* set to read */ - setMsgReadStatus(row, true); + mThreadModel->setMsgReadStatus(index,true,false); } else { /* set to unread by user */ - setMsgReadStatus(row, false); + mThreadModel->setMsgReadStatus(index,false,false); } } else { if (setToReadOnActive && IS_MSG_UNREAD(status)) { /* set to read */ - setMsgReadStatus(row, true); + mThreadModel->setMsgReadStatus(index, true,false); } } -#endif ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs)); ui->by_label->setId(msg.mMeta.mAuthorId); @@ -2045,6 +2057,7 @@ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QLi void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool read) { + #ifdef TODO QList::iterator row; std::list changedItems; @@ -2132,11 +2145,25 @@ void GxsForumThreadWidget::showInPeopleTab() void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum) { -#ifdef TODO if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { return; } + if(forum) + mThreadModel->setMsgReadStatus(mThreadModel->root(),read,children); + else + { + QModelIndexList selectedIndexes = ui->threadTreeWidget->selectionModel()->selectedIndexes(); + + if(selectedIndexes.size() != RsGxsForumModel::COLUMN_THREAD_NB_COLUMNS) // check that a single row is selected + return ; + + QModelIndex index = *selectedIndexes.begin(); + + mThreadModel->setMsgReadStatus(index,read,children); + } + +#ifdef TODO /* get selected messages */ QList rows; if (forum) { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 3f5a5c92f..b32296d65 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -59,11 +59,11 @@ public: QColor textColorNotSubscribed() const { return mTextColorNotSubscribed; } QColor textColorMissing() const { return mTextColorMissing; } - void setTextColorRead(QColor color) { mTextColorRead = color; } - void setTextColorUnread(QColor color) { mTextColorUnread = color; } - void setTextColorUnreadChildren(QColor color) { mTextColorUnreadChildren = color; } - void setTextColorNotSubscribed(QColor color) { mTextColorNotSubscribed = color; } - void setTextColorMissing(QColor color) { mTextColorMissing = color; } + void setTextColorRead (QColor color) ; + void setTextColorUnread (QColor color) ; + void setTextColorUnreadChildren(QColor color) ; + void setTextColorNotSubscribed (QColor color) ; + void setTextColorMissing (QColor color) ; /* GxsMessageFrameWidget */ virtual void groupIdChanged(); @@ -151,6 +151,7 @@ private slots: private: void insertMessageData(const RsGxsForumMsg &msg); bool getCurrentPost(ForumModelPostEntry& fmpe) const ; + QModelIndex getCurrentIndex() const; void insertMessage(); void insertGroupData(); From 73840158504dd6714fc683565ee0775f54421879 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Nov 2018 22:06:34 +0100 Subject: [PATCH 045/110] fixed update of QTreeView when something changes in Forum model using dataChanged() signal --- .../src/gui/gxsforums/GxsForumModel.cpp | 64 +++++------ .../src/gui/gxsforums/GxsForumModel.h | 5 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 105 +++++++++++------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 +- 4 files changed, 92 insertions(+), 84 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index ce28e9191..da5c1c281 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "util/qtthreadsutils.h" #include "util/DateTime.h" @@ -10,8 +11,6 @@ //#define DEBUG_FORUMMODEL -#define COLUMN_THREAD_DATA 0 // column for storing the userdata like parentid - Q_DECLARE_METATYPE(RsMsgMetaData); std::ostream& operator<<(std::ostream& o, const QModelIndex& i);// defined elsewhere @@ -25,30 +24,6 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) mFilterColumn=0; mUseChildTS=false; mFlatView=false; - -// // adds some fake posts to debug -// -// int N=5 ; -// mPosts.resize(N+1); -// -// for(int i=1;i<=N;++i) -// { -// mPosts[0].mChildren.push_back(ForumModelIndex(i)); -// mPosts[i].mParent = ForumModelIndex(0); -// mPosts[i].prow = i-1; -// -// RsMsgMetaData meta; -// meta.mMsgName = std::string("message ") + QString::number(i).toStdString() ; -// } -// -// // add one child to last post -// mPosts.resize(N+2); -// mPosts[N].mChildren.push_back(ForumModelIndex(N+1)); -// mPosts[N+1].mParent = ForumModelIndex(N); -// mPosts[N+1].prow = 0; -// -// RsMsgMetaData meta; -// meta.mMsgName = std::string("message ") + QString::number(N+1).toStdString() ; } void RsGxsForumModel::initEmptyHierarchy(std::vector& posts) @@ -232,19 +207,27 @@ int RsGxsForumModel::getChildrenCount(void *ref) const QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, int role) const { - if(role != Qt::DisplayRole) - return QVariant(); + if(role == Qt::DisplayRole) + switch(section) + { + case COLUMN_THREAD_TITLE: return tr("Title"); + case COLUMN_THREAD_DATE: return tr("Date"); + case COLUMN_THREAD_AUTHOR: return tr("Author"); + case COLUMN_THREAD_DISTRIBUTION: return tr("Distribution"); + default: + return QVariant(); + } - switch(section) - { - case COLUMN_THREAD_TITLE: return tr("Title"); - case COLUMN_THREAD_DATE: return tr("Date"); - case COLUMN_THREAD_AUTHOR: return tr("Author"); - case COLUMN_THREAD_DISTRIBUTION: return QString("[icon missing]") ; - case COLUMN_THREAD_READ: return QString("[icon missing]") ; - default: - return QString("[unused]"); - } + if(role == Qt::DecorationRole) + switch(section) + { + case COLUMN_THREAD_DISTRIBUTION: return QIcon(":/icons/flag_green.png"); + case COLUMN_THREAD_READ: return QIcon(":/images/message-state-read.png"); + default: + return QVariant(); + } + + return QVariant(); } QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const @@ -453,6 +436,8 @@ QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col { if(col == COLUMN_THREAD_DISTRIBUTION) return QVariant(fmpe.mReputationWarningLevel); + else if(col == COLUMN_THREAD_READ) + return QVariant(fmpe.mMsgStatus); else return QVariant(); } @@ -486,6 +471,7 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vectordrawControl(QStyle::CE_ItemViewItem, &opt, painter, 0); + + const QRect r = option.rect; + + QIcon icon ; + + // get pixmap + unsigned int read_status = qvariant_cast(index.data(Qt::DecorationRole)); + + bool unread = IS_MSG_UNREAD(read_status); + bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(ROLE_THREAD_MISSING).toBool(); + + // set icon + if (missing) + icon = QIcon(); + else + { + if (unread) + icon = QIcon(":/images/message-state-unread.png"); + else + icon = QIcon(":/images/message-state-read.png"); + } + + QPixmap pix = icon.pixmap(r.size()); + + // draw pixmap at center of item + const QPoint p = QPoint((r.width() - pix.width())/2, (r.height() - pix.height())/2); + painter->drawPixmap(r.topLeft() + p, pix); + } +}; + class AuthorItemDelegate: public QStyledItemDelegate { public: @@ -281,6 +330,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->setModel(mThreadModel); ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; + ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ,new ReadStatusItemDelegate()) ; connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); @@ -295,7 +345,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->newthreadButton->setText(tr("New thread")); connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(changedThread(QModelIndex))); - connect(ui->threadTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(clickedThread(QTreeWidgetItem*,int))); + connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedThread(QModelIndex))); connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox())); connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview())); @@ -671,32 +721,8 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) QAction *showinpeopleAct = new QAction(QIcon(":/images/info16.png"), tr("Show author in people tab"), &contextMnu); connect(showinpeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab())); - if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { - //QList rows; - //QList rowsRead; - //QList rowsUnread; - //int nCount = getSelectedMsgCount(&rows, &rowsRead, &rowsUnread); - - //if (rowsUnread.isEmpty()) { - // markMsgAsRead->setDisabled(true); - //} - //if (rowsRead.isEmpty()) { - // markMsgAsUnread->setDisabled(true); - //} - - //bool hasUnreadChildren = false; - //bool hasReadChildren = false; - - //int rowCount = rows.count(); - - //for (int i = 0; i < rowCount; ++i) { - // if (hasUnreadChildren || rows[i]->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN).toBool()) { - // hasUnreadChildren = true; - // } - // if (hasReadChildren || rows[i]->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_READCHILDREN).toBool()) { - // hasReadChildren = true; - // } - //} + if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) + { markMsgAsReadChildren->setEnabled(current_post.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN); markMsgAsUnreadChildren->setEnabled(current_post.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_READ_CHILDREN); @@ -874,27 +900,19 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) insertMessage(); } -void GxsForumThreadWidget::clickedThread(QTreeWidgetItem *item, int column) +void GxsForumThreadWidget::clickedThread(QModelIndex index) { - if (item == NULL) { + if(!index.isValid()) return; - } - if (mFillThread) { + if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) return; - } - if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { - return; - } - - if (column == RsGxsForumModel::COLUMN_THREAD_READ) { - QList rows; - rows.append(item); -#ifdef TODO - uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - setMsgReadStatus(rows, IS_MSG_UNREAD(status)); -#endif + if (index.column() == RsGxsForumModel::COLUMN_THREAD_READ) + { + ForumModelPostEntry fmpe; + mThreadModel->getPostData(index,fmpe); + mThreadModel->setMsgReadStatus(index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); } } @@ -2685,6 +2703,7 @@ void GxsForumThreadWidget::updateGroupData() mForumGroup = group; insertGroupData(); + mSubscribeFlags = group.mMeta.mSubscribeFlags; ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index b32296d65..416bd0aaf 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -99,7 +99,7 @@ private slots: void changedThread(QModelIndex index); void changedVersion(); - void clickedThread (QTreeWidgetItem *item, int column); + void clickedThread (QModelIndex index); void reply_with_private_message(); void replytoforummessage(); From 0b0e58bd3ded0543745a9f83a53f178ba1954d21 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 24 Nov 2018 22:25:23 +0100 Subject: [PATCH 046/110] fixed bug in coloring of read/unread property --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 9 +++++++-- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index da5c1c281..0b7d6becf 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -301,8 +301,13 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const QVariant RsGxsForumModel::textColorRole(const ForumModelPostEntry& fmpe,int column) const { - if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN) && !IS_MSG_UNREAD(fmpe.mMsgStatus)) - return QVariant(mTextColorUnreadChildren); + if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING)) + return QVariant(mTextColorMissing); + + if(IS_MSG_UNREAD(fmpe.mMsgStatus)) + return QVariant(mTextColorUnread); + else + return QVariant(mTextColorRead); return QVariant(); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index ad6d6bcb1..d9aa36817 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -219,7 +219,7 @@ public: QPixmap pix = icon.pixmap(r.size()); - return QSize(pix.width() + fm.width(str),1.2*fm.height()); + return QSize(pix.width() + fm.width(str),std::max(1.1*pix.height(),1.4*fm.height())); } virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override From 419bd2157a3aed70c7eccfb997e2392f97692cd8 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 25 Nov 2018 17:11:08 +0100 Subject: [PATCH 047/110] factored all methods that apply to msg data using pointer to member function trick --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 174 +++++++++--------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 10 +- 2 files changed, 94 insertions(+), 90 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d9aa36817..31b55093a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -683,17 +683,17 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) QAction *flagaspositiveAct = new QAction(QIcon(IMAGE_POSITIVE_OPINION), tr("Give positive opinion"), &contextMnu); flagaspositiveAct->setToolTip(tr("This will block/hide messages from this person, and notify friend nodes.")) ; - flagaspositiveAct->setData(mTokenTypePositiveAuthor) ; + flagaspositiveAct->setData(RsReputations::OPINION_POSITIVE) ; connect(flagaspositiveAct, SIGNAL(triggered()), this, SLOT(flagperson())); QAction *flagasneutralAct = new QAction(QIcon(IMAGE_NEUTRAL_OPINION), tr("Give neutral opinion"), &contextMnu); flagasneutralAct->setToolTip(tr("Doing this, you trust your friends to decide to forward this message or not.")) ; - flagasneutralAct->setData(mTokenTypeNeutralAuthor) ; + flagasneutralAct->setData(RsReputations::OPINION_NEUTRAL) ; connect(flagasneutralAct, SIGNAL(triggered()), this, SLOT(flagperson())); QAction *flagasnegativeAct = new QAction(QIcon(IMAGE_NEGATIVE_OPINION), tr("Give negative opinion"), &contextMnu); flagasnegativeAct->setToolTip(tr("This will block/hide messages from this person, and notify friend nodes.")) ; - flagasnegativeAct->setData(mTokenTypeNegativeAuthor) ; + flagasnegativeAct->setData(RsReputations::OPINION_NEGATIVE) ; connect(flagasnegativeAct, SIGNAL(triggered()), this, SLOT(flagperson())); QAction *newthreadAct = new QAction(QIcon(IMAGE_MESSAGE), tr("Start New Thread"), &contextMnu); @@ -898,6 +898,7 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) //ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); + mThreadModel->setMsgReadStatus(index, true,false); } void GxsForumThreadWidget::clickedThread(QModelIndex index) @@ -905,8 +906,14 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) if(!index.isValid()) return; - if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) - return; + RsGxsMessageId tmp(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); + + if( tmp.isNull()) + return; + + mThreadId = tmp; + + std::cerr << "Clicked on message ID " << mThreadId << std::endl; if (index.column() == RsGxsForumModel::COLUMN_THREAD_READ) { @@ -1880,6 +1887,8 @@ void GxsForumThreadWidget::insertMessage() /* request Post */ //RsGxsGrpMsgIdPair msgId = std::make_pair(groupId(), mThreadId); updateMessageData(mThreadId); + + markMsgAsRead(); } void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) @@ -2150,17 +2159,6 @@ void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool #endif } -void GxsForumThreadWidget::showInPeopleTab() -{ - if (groupId().isNull() || mThreadId.isNull()) { - QMessageBox::information(this, tr("RetroShare"),tr("You cant act on the author to a non-existant Message")); - return; - } - - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - requestMsgData_ShowAuthorInPeople(postId) ; -} - void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum) { if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { @@ -2405,8 +2403,17 @@ void GxsForumThreadWidget::flagperson() return; } - uint32_t token_type = qobject_cast(sender())->data().toUInt(); + RsReputations::Opinion opinion = static_cast(qobject_cast(sender())->data().toUInt()); + ForumModelPostEntry fmpe ; + getCurrentPost(fmpe); + RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); + + std::cerr << "Setting own opinion for author " << fmpe.mAuthorId << " to " << opinion << std::endl; + + rsReputations->setOwnOpinion(fmpe.mAuthorId,opinion) ; + +#ifdef TO_REMOVE // Get Message ... then complete replyMessageData(). RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); @@ -2424,40 +2431,60 @@ void GxsForumThreadWidget::flagperson() uint32_t token; mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, token_type); +#endif } -void GxsForumThreadWidget::reply_with_private_message() +void GxsForumThreadWidget::replytoforummessage() { async_msg_action( &GxsForumThreadWidget::replyForumMessageData ); } +void GxsForumThreadWidget::editforummessage() { async_msg_action( &GxsForumThreadWidget::editForumMessageData ); } +void GxsForumThreadWidget::reply_with_private_message() { async_msg_action( &GxsForumThreadWidget::replyMessageData ); } +void GxsForumThreadWidget::showInPeopleTab() { async_msg_action( &GxsForumThreadWidget::showAuthorInPeople ); } + +void GxsForumThreadWidget::async_msg_action(const MsgMethod &action) { if (groupId().isNull() || mThreadId.isNull()) { QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message")); return; } - // Get Message ... then complete replyMessageData(). - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - requestMsgData_ReplyWithPrivateMessage(postId); -} -void GxsForumThreadWidget::editforummessage() -{ - if (groupId().isNull() || mThreadId.isNull()) { - QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message")); - return; - } + RsThread::async([this,action]() + { + // 1 - get message data from p3GxsForums - // Get Message ... then complete replyMessageData(). - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - requestMsgData_EditForumMessage(postId); -} -void GxsForumThreadWidget::replytoforummessage() -{ - if (groupId().isNull() || mThreadId.isNull()) { - QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message")); - return; - } + std::cerr << "Retrieving post data for post " << mThreadId << std::endl; - // Get Message ... then complete replyMessageData(). - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - requestMsgData_ReplyForumMessage(postId); + std::set msgs_to_request ; + std::vector msgs; + + msgs_to_request.insert(mThreadId); + + if(!rsGxsForums->getForumsContent(groupId(),msgs_to_request,msgs)) + { + std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum group info for forum " << groupId() << std::endl; + return; + } + + if(msgs.size() != 1) + return; + + // 2 - sort the messages into a proper hierarchy + + RsGxsForumMsg msg = msgs[0]; + + // 3 - update the model in the UI thread. + + RsQThreadUtils::postToObject( [msg,action,this]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete, note that + * Qt::QueuedConnection is important! + */ + + (this->*action)(msg); + + }, this ); + + }); } void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg) @@ -2488,18 +2515,6 @@ void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg) } } -void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) -{ - if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId)) - { - std::cerr << "GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!"; - std::cerr << std::endl; - return; - } - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - requestMsgData_ShowAuthorInPeople(postId); -} - void GxsForumThreadWidget::editForumMessageData(const RsGxsForumMsg& msg) { if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId)) @@ -2887,7 +2902,6 @@ void GxsForumThreadWidget::loadMessageData(const uint32_t &token) mStateHelper->clear(mTokenTypeMessageData); } } -#endif /*********************** **** **** **** ***********************/ /*********************** **** **** **** ***********************/ @@ -3038,43 +3052,27 @@ void GxsForumThreadWidget::loadMsgData_ReplyForumMessage(const uint32_t &token) std::cerr << std::endl; } } - -void GxsForumThreadWidget::loadMsgData_ShowAuthorInPeople(const uint32_t &token) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()"; - std::cerr << std::endl; #endif - std::vector msgs; - if (rsGxsForums->getMsgData(token, msgs)) +void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) +{ + if(msg.mMeta.mAuthorId.isNull()) { - if (msgs.size() != 1) - { - std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Wrong number of answers"; - std::cerr << std::endl; - return; - } - - if(msgs[0].mMeta.mAuthorId.isNull()) - { - std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data..."; - std::cerr << std::endl; - } - - /* window will destroy itself! */ - IdDialog *idDialog = dynamic_cast(MainWindow::getPage(MainWindow::People)); - - if (!idDialog) - return ; - - MainWindow::showWindow(MainWindow::People); - idDialog->navigate(RsGxsId(msgs[0].mMeta.mAuthorId)); - } - else std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data..."; + std::cerr << std::endl; + } + + /* window will destroy itself! */ + IdDialog *idDialog = dynamic_cast(MainWindow::getPage(MainWindow::People)); + + if (!idDialog) + return ; + + MainWindow::showWindow(MainWindow::People); + idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId)); } +#ifdef TO_REMOVE void GxsForumThreadWidget::loadMsgData_SetAuthorOpinion(const uint32_t &token,RsReputations::Opinion opinion) { #ifdef DEBUG_FORUMS @@ -3107,6 +3105,7 @@ void GxsForumThreadWidget::loadMsgData_SetAuthorOpinion(const uint32_t &token,Rs std::cerr << __PRETTY_FUNCTION__ << ": need to implement the update of GxsTreeWidgetItems icons too." << std::endl; } +#endif /*********************** **** **** **** ***********************/ /*********************** **** **** **** ***********************/ @@ -3130,7 +3129,6 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque loadMessageData(req.mToken); return; } -#endif if (req.mUserType == mTokenTypeReplyMessage) { loadMsgData_ReplyMessage(req.mToken); @@ -3141,7 +3139,7 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque loadMsgData_ReplyForumMessage(req.mToken); return; } - + if (req.mUserType == mTokenTypeEditForumMessage) { loadMsgData_EditForumMessage(req.mToken); return; @@ -3150,7 +3148,6 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque loadMsgData_ShowAuthorInPeople(req.mToken); return; } - if (req.mUserType == mTokenTypePositiveAuthor) { loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_POSITIVE); return; @@ -3165,6 +3162,7 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEUTRAL); return; } +#endif } GxsMessageFrameWidget::loadRequest(queue, req); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 416bd0aaf..fc085e4d1 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -33,6 +33,7 @@ class RsGxsForumMsg; class GxsForumsFillThread; class RsGxsForumGroup; class RsGxsForumModel; +class RsGxsForumMsg; class ForumModelPostEntry; namespace Ui { @@ -43,6 +44,8 @@ class GxsForumThreadWidget : public GxsMessageFrameWidget { Q_OBJECT + typedef void (GxsForumThreadWidget::*MsgMethod)(const RsGxsForumMsg&) ; + Q_PROPERTY(QColor textColorRead READ textColorRead WRITE setTextColorRead) Q_PROPERTY(QColor textColorUnread READ textColorUnread WRITE setTextColorUnread) Q_PROPERTY(QColor textColorUnreadChildren READ textColorUnreadChildren WRITE setTextColorUnreadChildren) @@ -110,6 +113,9 @@ private slots: void replyForumMessageData(const RsGxsForumMsg &msg); void showAuthorInPeople(const RsGxsForumMsg& msg); + // This method is used to perform an asynchroneous action on the message data. Any of the methods above can be used as parameter. + void async_msg_action(const MsgMethod& method); + void saveImage(); @@ -178,19 +184,19 @@ private: void updateMessageData(const RsGxsMessageId& msgId); +#ifdef TO_REMOVE void requestMsgData_ReplyWithPrivateMessage(const RsGxsGrpMsgIdPair &msgId); void requestMsgData_ShowAuthorInPeople(const RsGxsGrpMsgIdPair &msgId); void requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId); void requestMsgData_EditForumMessage(const RsGxsGrpMsgIdPair &msgId); -#ifdef TO_REMOVE void loadMessageData(const uint32_t &token); -#endif void loadMsgData_ReplyMessage(const uint32_t &token); void loadMsgData_ReplyForumMessage(const uint32_t &token); void loadMsgData_EditForumMessage(const uint32_t &token); void loadMsgData_ShowAuthorInPeople(const uint32_t &token); void loadMsgData_SetAuthorOpinion(const uint32_t &token, RsReputations::Opinion opinion); +#endif private: RsGxsGroupId mLastForumID; From dc913e37c977979e0e96365255311651486795cb Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 25 Nov 2018 17:40:48 +0100 Subject: [PATCH 048/110] fixed update of threads in new model --- .../src/gui/gxsforums/GxsForumModel.cpp | 3 ++- .../gui/gxsforums/GxsForumThreadWidget.cpp | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 0b7d6becf..9f766788f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -459,6 +459,8 @@ void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts) { + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + mForumGroup = group; mPosts = posts; @@ -476,7 +478,6 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vectorthreadTreeWidget->header () ; - QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_TITLE, QHeaderView::Interactive); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_TITLE, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents); float f = QFontMetricsF(font()).height()/14.0f ; @@ -451,9 +451,11 @@ void GxsForumThreadWidget::blank() #endif ui->forumName->setText(""); +#ifdef SUSPENDED_CODE mStateHelper->setWidgetEnabled(ui->newthreadButton, false); mStateHelper->setWidgetEnabled(ui->previousButton, false); mStateHelper->setWidgetEnabled(ui->nextButton, false); +#endif ui->versions_CB->hide(); } @@ -520,10 +522,8 @@ void GxsForumThreadWidget::groupIdChanged() mNewCount = 0; mUnreadCount = 0; - emit groupChanged(this); - mThreadModel->setForum(groupId()); - //fillComplete(); + updateDisplay(true); } QString GxsForumThreadWidget::groupName(bool withUnreadCount) @@ -1077,7 +1077,7 @@ void GxsForumThreadWidget::insertGroupData() #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::insertGroupData" << std::endl; #endif - GxsIdDetails::process(mForumGroup.mMeta.mAuthorId, &loadAuthorIdCallback, this); + //GxsIdDetails::process(mForumGroup.mMeta.mAuthorId, &loadAuthorIdCallback, this); calculateIconsAndFonts(); } @@ -1788,9 +1788,10 @@ void GxsForumThreadWidget::insertMessage() { if (groupId().isNull()) { +#ifdef SUSPENDED_CODE mStateHelper->setActive(mTokenTypeMessageData, false); mStateHelper->clear(mTokenTypeMessageData); - +#endif ui->versions_CB->hide(); ui->time_label->show(); @@ -1800,8 +1801,10 @@ void GxsForumThreadWidget::insertMessage() if (mThreadId.isNull()) { +#ifdef SUSPENDED_CODE mStateHelper->setActive(mTokenTypeMessageData, false); mStateHelper->clear(mTokenTypeMessageData); +#endif ui->versions_CB->hide(); ui->time_label->show(); @@ -1810,7 +1813,9 @@ void GxsForumThreadWidget::insertMessage() return; } +#ifdef SUSPENDED_CODE mStateHelper->setActive(mTokenTypeMessageData, true); +#endif #ifdef TODO QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); @@ -2717,7 +2722,7 @@ void GxsForumThreadWidget::updateGroupData() */ mForumGroup = group; - insertGroupData(); + //insertGroupData(); mSubscribeFlags = group.mMeta.mSubscribeFlags; ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); From 114a11af75a1b5f6d452008dd56056cfe9e1faaf Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 25 Nov 2018 17:44:56 +0100 Subject: [PATCH 049/110] fixed bug in read status update in new ForumModel --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 9f766788f..62413404f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -950,7 +950,7 @@ void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status, mPosts[i].mMsgStatus = GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; uint32_t token; - rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read); + rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read_status); if(!with_children) return; From 65f2d26651d2e45b1f040f42256079d55b786689 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 25 Nov 2018 21:12:26 +0100 Subject: [PATCH 050/110] fixed author tooltip in ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 45 ++++++++++++++----- .../gui/gxsforums/GxsForumThreadWidget.cpp | 3 ++ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 62413404f..f79ecddf3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -4,7 +4,9 @@ #include #include "util/qtthreadsutils.h" +#include "util/HandleRichText.h" #include "util/DateTime.h" +#include "gui/gxs/GxsIdDetails.h" #include "GxsForumModel.h" #include "retroshare/rsgxsflags.h" #include "retroshare/rsgxsforums.h" @@ -333,18 +335,36 @@ QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column) const { - if(column != COLUMN_THREAD_DISTRIBUTION) - return QVariant(); + if(column == COLUMN_THREAD_DISTRIBUTION) + switch(fmpe.mReputationWarningLevel) + { + case 3: return QVariant(tr("Information for this identity is currently missing.")) ; + case 2: return QVariant(tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.")) ; + case 1: return QVariant(tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.")) ; + case 0: return QVariant(tr("Message will be forwarded to your friends.")) ; + default: + return QVariant("[ERROR: missing reputation level information - contact the developers]"); + } - switch(fmpe.mReputationWarningLevel) - { - case 3: return QVariant(tr("Information for this identity is currently missing.")) ; - case 2: return QVariant(tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.")) ; - case 1: return QVariant(tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.")) ; - case 0: return QVariant(tr("Message will be forwarded to your friends.")) ; - default: - return QVariant("[ERROR: missing reputation level information - contact the developers]"); - } + if(column == COLUMN_THREAD_AUTHOR) + { + QString str,comment ; + QList icons; + + if(!GxsIdDetails::MakeIdDesc(fmpe.mAuthorId, true, str, icons, comment,GxsIdDetails::ICON_TYPE_AVATAR)) + return QVariant(); + + int S = QFontMetricsF(QApplication::font()).height(); + QImage pix( (*icons.begin()).pixmap(QSize(4*S,4*S)).toImage()); + + QString embeddedImage; + if(RsHtml::makeEmbeddedImage(pix.scaled(QSize(4*S,4*S), Qt::KeepAspectRatio, Qt::SmoothTransformation), embeddedImage, 8*S * 8*S)) + comment = "
" + embeddedImage + "" + comment + "
"; + + return comment; + } + + return QVariant(); } QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) const @@ -474,8 +494,9 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector Date: Sun, 25 Nov 2018 22:07:59 +0100 Subject: [PATCH 051/110] saving work for next unread msg in forum model --- .../src/gui/gxsforums/GxsForumModel.cpp | 36 ++++++++ .../src/gui/gxsforums/GxsForumModel.h | 2 + .../gui/gxsforums/GxsForumThreadWidget.cpp | 84 +++++-------------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index f79ecddf3..9a8a0005f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1022,6 +1022,42 @@ static void recursPrintModel(const std::vector& entries,For recursPrintModel(entries,e.mChildren[i],depth+1); } +QModelIndex RsGxsForumModel::getIndexOfMessage(const RsGxsMessageId& mid) const +{ + // brutal search. This is not so nice, so dont call that in a loop! + + for(uint32_t i=0;i parent_stack ; + + for(ForumModelIndex tmp(fmi);tmp!=0;tmp=mPosts[tmp].mParent) + parent_stack.push_front(tmp); + + // now get to next unread item + + if(!mPosts[fmi].mChildren.empty()) +#endif + return QModelIndex(); +} + void RsGxsForumModel::debug_dump() { std::cerr << "Model data dump:" << std::endl; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 1b6348221..9f3468e7f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -80,6 +80,8 @@ public: }; QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} + QModelIndex getIndexOfMessage(const RsGxsMessageId& mid) const; + QModelIndex getNextIndex(const QModelIndex& i,bool unread_only) const; // This method will asynchroneously update the data void setForum(const RsGxsGroupId& forumGroup); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d7bbaf13a..ed678afff 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -100,6 +100,12 @@ class DistributionItemDelegate: public QStyledItemDelegate public: DistributionItemDelegate() {} + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override + { + const QRect r = option.rect; + return QSize(r.height(),r.height()); + } + virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if(!index.isValid()) @@ -518,7 +524,9 @@ void GxsForumThreadWidget::processSettings(bool load) void GxsForumThreadWidget::groupIdChanged() { +#ifdef TO_REMOVE ui->forumName->setText(groupId().isNull () ? "" : tr("Loading")); +#endif mNewCount = 0; mUnreadCount = 0; @@ -2029,43 +2037,17 @@ void GxsForumThreadWidget::downloadAllFiles() void GxsForumThreadWidget::nextUnreadMessage() { -#ifdef TODO - QTreeWidgetItem *currentItem = ui->threadTreeWidget->currentItem(); + QModelIndex index = mThreadModel->getNextIndex(getCurrentIndex(),true); - while (true) { - QTreeWidgetItemIterator itemIterator = currentItem ? QTreeWidgetItemIterator(currentItem, QTreeWidgetItemIterator::NotHidden) : QTreeWidgetItemIterator(ui->threadTreeWidget, QTreeWidgetItemIterator::NotHidden); - - QTreeWidgetItem *item; - while ((item = *itemIterator) != NULL) { - ++itemIterator; - - if (item == currentItem) { - continue; - } - - uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - if (IS_MSG_UNREAD(status)) { - ui->threadTreeWidget->setCurrentItem(item); - ui->threadTreeWidget->scrollToItem(item, QAbstractItemView::EnsureVisible); - return; - } - } - - if (currentItem == NULL) { - break; - } - - /* start from top */ - currentItem = NULL; - } -#endif + ui->threadTreeWidget->setCurrentIndex(index); + ui->threadTreeWidget->setFocus(); } +#ifdef TO_REMOVE /* get selected messages the messages tree is single selected, but who knows ... */ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QList *rowsRead, QList *rowsUnread) { -#ifdef TODO if (rowsRead) rowsRead->clear(); if (rowsUnread) rowsUnread->clear(); @@ -2083,14 +2065,11 @@ int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QLi } return selectedItems.size(); -#endif return 0; } void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool read) { - -#ifdef TODO QList::iterator row; std::list changedItems; @@ -2161,8 +2140,8 @@ void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool } calculateUnreadCount(); } -#endif } +#endif void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum) { @@ -2257,31 +2236,14 @@ void GxsForumThreadWidget::setAllMessagesReadDo(bool read, uint32_t &/*token*/) bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) { -#ifdef TODO - if (mStateHelper->isLoading(mTokenTypeInsertThreads)) { - mNavigatePendingMsgId = msgId; + QModelIndex index = mThreadModel->getIndexOfMessage(msgId); - /* No information if message is available */ - return true; - } + if(!index.isValid()) + return false; - QString msgIdString = QString::fromStdString(msgId.toStdString()); - - /* Search exisiting item */ - QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget); - QTreeWidgetItem *item = NULL; - while ((item = *itemIterator) != NULL) { - ++itemIterator; - - if (item->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString() == msgIdString) { - ui->threadTreeWidget->setCurrentItem(item); - ui->threadTreeWidget->setFocus(); - return true; - } - } -#endif - - return false; + ui->threadTreeWidget->setCurrentIndex(index); + ui->threadTreeWidget->setFocus(); + return true; } bool GxsForumThreadWidget::isLoading() @@ -2298,10 +2260,11 @@ void GxsForumThreadWidget::copyMessageLink() if (groupId().isNull() || mThreadId.isNull()) { return; } -#ifdef TODO - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); - QString thread_title = (item != NULL)?item->text(RsGxsForumModel::COLUMN_THREAD_TITLE):QString() ; + ForumModelPostEntry fmpe ; + getCurrentPost(fmpe); + + QString thread_title = QString::fromUtf8(fmpe.mTitle.c_str()); RetroShareLink link = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, groupId(), mThreadId, thread_title); @@ -2310,7 +2273,6 @@ void GxsForumThreadWidget::copyMessageLink() urls.push_back(link); RSLinkClipboard::copyLinks(urls); } -#endif } void GxsForumThreadWidget::subscribeGroup(bool subscribe) From 581e892d94a7bd59c0b0ffa85da38e6f4f0f2cc0 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 26 Nov 2018 21:18:28 +0100 Subject: [PATCH 052/110] create an index iterator in ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 88 +++++++++++++++++-- .../src/gui/gxsforums/GxsForumModel.h | 19 ++++ 2 files changed, 99 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 9a8a0005f..a8729f480 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1040,22 +1040,94 @@ QModelIndex RsGxsForumModel::getIndexOfMessage(const RsGxsMessageId& mid) const QModelIndex RsGxsForumModel::getNextIndex(const QModelIndex& i,bool unread_only) const { -#ifdef TODO ForumModelIndex fmi ; convertRefPointerToTabEntry(i.internalPointer(),fmi); // Algorithm is simple: visit children recursively. When none available, go to parent. We need of course a stack of parents to the current index. - std::list parent_stack ; + const_iterator it(*this,fmi); - for(ForumModelIndex tmp(fmi);tmp!=0;tmp=mPosts[tmp].mParent) - parent_stack.push_front(tmp); + do {++it;} while(bool(it) && (!unread_only || IS_MSG_UNREAD(mPosts[*it].mMsgStatus))); - // now get to next unread item + if(!it) + return QModelIndex(); - if(!mPosts[fmi].mChildren.empty()) -#endif - return QModelIndex(); + void *ref ; + convertTabEntryToRefPointer(*it,ref); + + return createIndex(mPosts[*it].prow,0,ref); +} + + +RsGxsForumModel::const_iterator::const_iterator(const RsGxsForumModel &Model, ForumModelIndex i) + : model(Model) +{ + if(i >= model.mPosts.size()) + { + std::cerr << "(EE) constructed a RsGxsForumModel::const_iterator from invalid index " << i << std::endl; + kid = -1; + return; + } + // create a stack or parents + parent_stack.clear(); + + if(i==0) + { + current_parent = 0; + kid =0; + return; + } + current_parent = model.mPosts[i].mParent; + ForumModelIndex j(i); + kid = model.mPosts[i].prow; + + while(j != 0) + { + parent_stack.push_front(model.mPosts[j].prow); + j = model.mPosts[i].mParent; + } +} + +ForumModelIndex RsGxsForumModel::const_iterator::operator*() const +{ + if(current_parent >= model.mPosts.size() || kid < 0 || kid >= (int)model.mPosts[current_parent].mChildren.size()) + { + std::cerr << "(EE) operator* on an invalid RsGxsForumModel::const_iterator"<< std::endl; + return 0; + } + + return model.mPosts[current_parent].mChildren[kid]; +} + +void RsGxsForumModel::const_iterator::operator++() +{ + kid++; + while(kid >= (int)model.mPosts[current_parent].mChildren.size()) + { + current_parent = model.mPosts[current_parent].mParent; + kid = parent_stack.back()+1; + + parent_stack.pop_back(); + + } + + if(current_parent == 0 && kid >= (int)model.mPosts[current_parent].mChildren.size()) + { + kid = -1; + return; + } + + while(!model.mPosts[model.mPosts[current_parent].mChildren[kid]].mChildren.empty()) + { + parent_stack.push_back(kid); + current_parent = model.mPosts[current_parent].mChildren[kid]; + kid = 0; + } +} + +RsGxsForumModel::const_iterator::operator bool() const +{ + return kid >= 0; } void RsGxsForumModel::debug_dump() diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 9f3468e7f..71218c8e8 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -83,6 +83,23 @@ public: QModelIndex getIndexOfMessage(const RsGxsMessageId& mid) const; QModelIndex getNextIndex(const QModelIndex& i,bool unread_only) const; + class const_iterator + { + public: + const_iterator(const RsGxsForumModel& Model,ForumModelIndex = 0) ; + + ForumModelIndex operator*() const ; + void operator++(); + + inline operator bool() const ; + + private: + std::list parent_stack; + int kid; + ForumModelIndex current_parent; + const RsGxsForumModel& model; + }; + // This method will asynchroneously update the data void setForum(const RsGxsGroupId& forumGroup); @@ -160,4 +177,6 @@ private: QColor mTextColorUnreadChildren; QColor mTextColorNotSubscribed ; QColor mTextColorMissing ; + + friend class const_iterator; }; From 3a76f2515252c77244c86a325bb7ad060353271a Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 26 Nov 2018 22:07:10 +0100 Subject: [PATCH 053/110] resurrected prev/next buttons --- .../src/gui/gxsforums/GxsForumModel.cpp | 42 ++++++---- .../src/gui/gxsforums/GxsForumModel.h | 1 + .../gui/gxsforums/GxsForumThreadWidget.cpp | 84 +++++++++++-------- 3 files changed, 77 insertions(+), 50 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index a8729f480..435cef0c2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -494,7 +494,7 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& entries,ForumModelIndex index,int depth) -{ - const ForumModelPostEntry& e(entries[index]); - - std::cerr << std::string(depth*2,' ') << e.mAuthorId.toStdString() << " " - << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() << " " - << QString("%1").arg((uint32_t)e.mMsgStatus,8,16,QChar('0')).toStdString() << " " - << QDateTime::fromSecsSinceEpoch(e.mPublishTs).toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; - - for(uint32_t i=0;i= 0; } +static void recursPrintModel(const std::vector& entries,ForumModelIndex index,int depth) +{ + const ForumModelPostEntry& e(entries[index]); + + std::cerr << std::string(depth*2,' ') << index << " : " << e.mAuthorId.toStdString() << " " + << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() << " " + << QString("%1").arg((uint32_t)e.mMsgStatus,8,16,QChar('0')).toStdString() << " " + << QDateTime::fromSecsSinceEpoch(e.mPublishTs).toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; + + for(uint32_t i=0;isetActive(mTokenTypeMessageData, true); #endif -#ifdef TODO - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); + QModelIndex index = getCurrentIndex(); - if (item) { - QTreeWidgetItem *parentItem = item->parent(); - int index = parentItem ? parentItem->indexOfChild(item) : ui->threadTreeWidget->indexOfTopLevelItem(item); - int count = parentItem ? parentItem->childCount() : ui->threadTreeWidget->topLevelItemCount(); - mStateHelper->setWidgetEnabled(ui->previousButton, (index > 0)); - mStateHelper->setWidgetEnabled(ui->nextButton, (index < count - 1)); + if (index.isValid()) + { + QModelIndex parentIndex = index.parent(); + int curr_index = index.row(); + int count = mThreadModel->rowCount(parentIndex); + + ui->previousButton->setEnabled(curr_index > 0); + ui->nextButton->setEnabled(curr_index < count - 1); } else { // there is something wrong - mStateHelper->setWidgetEnabled(ui->previousButton, false); - mStateHelper->setWidgetEnabled(ui->nextButton, false); + ui->previousButton->setEnabled(false); + ui->nextButton->setEnabled(false); ui->versions_CB->hide(); ui->time_label->show(); return; } -#endif mStateHelper->setWidgetEnabled(ui->newmessageButton, (IS_GROUP_SUBSCRIBED(mSubscribeFlags) && mThreadId.isNull() == false)); @@ -1984,41 +1984,53 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) void GxsForumThreadWidget::previousMessage() { -#ifdef TODO - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); - if (item == NULL) { - return; - } + QModelIndex current_index = getCurrentIndex(); - QTreeWidgetItem *parentItem = item->parent(); - int index = parentItem ? parentItem->indexOfChild(item) : ui->threadTreeWidget->indexOfTopLevelItem(item); - if (index > 0) { - QTreeWidgetItem *previousItem = parentItem ? parentItem->child(index - 1) : ui->threadTreeWidget->topLevelItem(index - 1); - if (previousItem) { - ui->threadTreeWidget->setCurrentItem(previousItem); + if (!current_index.isValid()) + return; + + QModelIndex parentIndex = current_index.parent(); + + int index = current_index.row(); + int count = mThreadModel->rowCount(parentIndex) ; + + if (index > 0) + { + QModelIndex prevItem = mThreadModel->index(index - 1,0,parentIndex) ; + + if (prevItem.isValid()) { + ui->threadTreeWidget->setCurrentIndex(prevItem); + ui->threadTreeWidget->setFocus(); } } -#endif + ui->previousButton->setEnabled(index-1 > 0); + ui->nextButton->setEnabled(true); + } void GxsForumThreadWidget::nextMessage() { -#ifdef TODO - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); - if (item == NULL) { - return; - } + QModelIndex current_index = getCurrentIndex(); - QTreeWidgetItem *parentItem = item->parent(); - int index = parentItem ? parentItem->indexOfChild(item) : ui->threadTreeWidget->indexOfTopLevelItem(item); - int count = parentItem ? parentItem->childCount() : ui->threadTreeWidget->topLevelItemCount(); - if (index < count - 1) { - QTreeWidgetItem *nextItem = parentItem ? parentItem->child(index + 1) : ui->threadTreeWidget->topLevelItem(index + 1); - if (nextItem) { - ui->threadTreeWidget->setCurrentItem(nextItem); + if (!current_index.isValid()) + return; + + QModelIndex parentIndex = current_index.parent(); + + int index = current_index.row(); + int count = mThreadModel->rowCount(parentIndex) ; + + if (index < count - 1) + { + QModelIndex nextItem = mThreadModel->index(index + 1,0,parentIndex) ; + + if (nextItem.isValid()) { + ui->threadTreeWidget->setCurrentIndex(nextItem); + ui->threadTreeWidget->setFocus(); } } -#endif + ui->previousButton->setEnabled(true); + ui->nextButton->setEnabled(index+1 < count - 1); } void GxsForumThreadWidget::downloadAllFiles() From b179cb57965e7936b251267880e6fd9a8eae1dcc Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 26 Nov 2018 22:48:47 +0100 Subject: [PATCH 054/110] fixed next/prev item and next unread selection --- .../src/gui/gxsforums/GxsForumModel.cpp | 4 ++++ retroshare-gui/src/gui/gxsforums/GxsForumModel.h | 9 +++++---- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 435cef0c2..62542e799 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -281,6 +281,10 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const return QVariant(font); } + + if(role == UnreadChildrenRole) + return bool(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN); + #ifdef DEBUG_FORUMMODEL std::cerr << " [ok]" << std::endl; #endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 9779263f7..c42ba9e1d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -73,10 +73,11 @@ public: COLUMN_THREAD_NB_COLUMNS =0x08, }; - enum Roles{ SortRole = Qt::UserRole+1, - ThreadPinnedRole = Qt::UserRole+2, - MissingRole = Qt::UserRole+3, - StatusRole = Qt::UserRole+4, + enum Roles{ SortRole = Qt::UserRole+1, + ThreadPinnedRole = Qt::UserRole+2, + MissingRole = Qt::UserRole+3, + StatusRole = Qt::UserRole+4, + UnreadChildrenRole = Qt::UserRole+5, }; QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 2c95ff8e3..8760f9b00 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -2001,6 +2001,7 @@ void GxsForumThreadWidget::previousMessage() if (prevItem.isValid()) { ui->threadTreeWidget->setCurrentIndex(prevItem); ui->threadTreeWidget->setFocus(); + changedThread(prevItem); } } ui->previousButton->setEnabled(index-1 > 0); @@ -2027,6 +2028,7 @@ void GxsForumThreadWidget::nextMessage() if (nextItem.isValid()) { ui->threadTreeWidget->setCurrentIndex(nextItem); ui->threadTreeWidget->setFocus(); + changedThread(nextItem); } } ui->previousButton->setEnabled(true); @@ -2049,10 +2051,20 @@ void GxsForumThreadWidget::downloadAllFiles() void GxsForumThreadWidget::nextUnreadMessage() { - QModelIndex index = mThreadModel->getNextIndex(getCurrentIndex(),true); + QModelIndex index = getCurrentIndex(); + + do + { + if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool()) + ui->threadTreeWidget->expand(index); + + index = ui->threadTreeWidget->indexBelow(index); + } + while(index.isValid() && !IS_MSG_UNREAD(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::StatusRole).toUInt())); ui->threadTreeWidget->setCurrentIndex(index); ui->threadTreeWidget->setFocus(); + changedThread(index); } #ifdef TO_REMOVE @@ -2255,6 +2267,7 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) ui->threadTreeWidget->setCurrentIndex(index); ui->threadTreeWidget->setFocus(); + changedThread(index); return true; } From 73e285805e9ca9009983b79344aff30d60cc0aed Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 26 Nov 2018 23:07:05 +0100 Subject: [PATCH 055/110] simplified comment in GxsIdDetails and hid columns in new ForumModel --- retroshare-gui/src/gui/gxs/GxsIdDetails.cpp | 6 +++--- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 2 ++ retroshare-gui/src/gui/gxsforums/GxsForumModel.h | 3 +++ retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 6 +++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 16399aed1..fac557122 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -973,7 +973,7 @@ QString nickname ; if (details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED) { - comment += QString("
%1:%2 ").arg(QApplication::translate("GxsIdDetails", "Authentication"), QApplication::translate("GxsIdDetails", "Signed by")); + comment += QString("
%1: ").arg(QApplication::translate("GxsIdDetails", "Node")); if (details.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN) { @@ -985,8 +985,8 @@ QString nickname ; else comment += QApplication::translate("GxsIdDetails", "unknown Key"); } - else - comment += QString("
%1: %2").arg(QApplication::translate("GxsIdDetails", "Authentication"), QApplication::translate("GxsIdDetails", "anonymous")); + //else + // comment += QString("
%1: %2").arg(QApplication::translate("GxsIdDetails", "Node:"), QApplication::translate("GxsIdDetails", "anonymous")); if(details.mReputation.mFriendsPositiveVotes || details.mReputation.mFriendsNegativeVotes) { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 62542e799..c52e89797 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1029,6 +1029,7 @@ QModelIndex RsGxsForumModel::getIndexOfMessage(const RsGxsMessageId& mid) const return QModelIndex(); } +#ifdef TO_REMVOVE void RsGxsForumModel::test_iterator() const { const_iterator it(*this); @@ -1133,6 +1134,7 @@ RsGxsForumModel::const_iterator::operator bool() const { return kid >= 0; } +#endif static void recursPrintModel(const std::vector& entries,ForumModelIndex index,int depth) { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index c42ba9e1d..12661c14c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -82,6 +82,8 @@ public: QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} QModelIndex getIndexOfMessage(const RsGxsMessageId& mid) const; + +#ifdef TO_REMOVE QModelIndex getNextIndex(const QModelIndex& i,bool unread_only) const; class const_iterator @@ -101,6 +103,7 @@ public: const RsGxsForumModel& model; }; void test_iterator() const; +#endif // This method will asynchroneously update the data void setForum(const RsGxsGroupId& forumGroup); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 8760f9b00..6bda288c7 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -350,7 +350,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->newmessageButton->setText(tr("Reply")); ui->newthreadButton->setText(tr("New thread")); - connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(changedThread(QModelIndex))); + //connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(changedThread(QModelIndex))); connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedThread(QModelIndex))); connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox())); @@ -409,6 +409,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_READ, 24*f); QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_CONTENT); + ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_MSGID); + ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_DATA); ui->progressBar->hide(); ui->progressText->hide(); @@ -929,6 +931,8 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) mThreadModel->getPostData(index,fmpe); mThreadModel->setMsgReadStatus(index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); } + else + changedThread(index); } void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren) From c0e87dbb3ba943b3fe6891b31e7cc3f5a4d50ceb Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 27 Nov 2018 09:37:34 +0100 Subject: [PATCH 056/110] attempt at fixing column resize --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 17 ++++++++++------- .../src/gui/gxsforums/GxsForumThreadWidget.ui | 3 +++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 6bda288c7..c406e6032 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -264,7 +264,7 @@ public: QPixmap pix = icon.pixmap(r.size()); // draw pixmap at center of item - const QPoint p = QPoint((r.width() - pix.width())/2, (r.height() - pix.height())/2); + const QPoint p = QPoint(pix.width()/2.0, (r.height() - pix.height())/2); painter->drawPixmap(r.topLeft() + p, pix); painter->drawText(r.topLeft() + p + QPoint(pix.width()+f/2.0,f*0.8), str); } @@ -371,13 +371,9 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget itemDelegate->setOnlyPlainText(true); ui->threadTreeWidget->setItemDelegate(itemDelegate); - /* Set header resize modes and initial section sizes */ - QHeaderView * ttheader = ui->threadTreeWidget->header () ; - QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_TITLE, QHeaderView::Interactive); - QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents); - float f = QFontMetricsF(font()).height()/14.0f ; + QHeaderView * ttheader = ui->threadTreeWidget->header () ; ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DATE, 140*f); ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_TITLE, 440*f); ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, 24*f); @@ -405,9 +401,16 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget // load settings processSettings(true); + /* Set header resize modes and initial section sizes */ + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_TITLE, QHeaderView::Interactive); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DATE, QHeaderView::Interactive); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_AUTHOR, QHeaderView::Interactive); + ui->threadTreeWidget->header()->setCascadingSectionResizes(true); + /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_READ, 24*f); - QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_CONTENT); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_MSGID); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_DATA); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index fa372b940..ae79bd607 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -225,6 +225,9 @@ true + + true +
From 02c6a92f4844d59c05e446b9998778157ec2acdf Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 27 Nov 2018 10:13:03 +0100 Subject: [PATCH 057/110] fixed resizing+CPU bug due to inconsistent return in eventFilter() --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 1 + retroshare-gui/src/gui/gxsforums/GxsForumModel.h | 6 +++++- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 13 +++++++++---- .../src/gui/gxsforums/GxsForumThreadWidget.h | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index c52e89797..0546ca43b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -503,6 +503,7 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vectornewmessageButton, SIGNAL(clicked()), this, SLOT(replytoforummessage())); connect(ui->newthreadButton, SIGNAL(clicked()), this, SLOT(createthread())); + connect(mThreadModel,SIGNAL(forumLoaded()),this,SLOT(updateGroupName())); + ui->newmessageButton->setText(tr("Reply")); ui->newthreadButton->setText(tr("New thread")); @@ -529,9 +531,8 @@ void GxsForumThreadWidget::processSettings(bool load) void GxsForumThreadWidget::groupIdChanged() { -#ifdef TO_REMOVE - ui->forumName->setText(groupId().isNull () ? "" : tr("Loading")); -#endif + ui->forumName->setText(groupId().isNull () ? "" : tr("Loading...")); + mNewCount = 0; mUnreadCount = 0; @@ -860,7 +861,7 @@ bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event) // pass the event on to the parent class return RsGxsUpdateBroadcastWidget::eventFilter(obj, event); #endif - return true; + return RsGxsUpdateBroadcastWidget::eventFilter(obj, event); } void GxsForumThreadWidget::togglethreadview() @@ -2674,6 +2675,10 @@ bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text /** Request / Response of Data ********************************/ /*********************** **** **** **** ***********************/ +void GxsForumThreadWidget::updateGroupName() +{ + ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); +} void GxsForumThreadWidget::updateGroupData() { mSubscribeFlags = 0; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index fc085e4d1..48df15759 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -103,6 +103,7 @@ private slots: void changedThread(QModelIndex index); void changedVersion(); void clickedThread (QModelIndex index); + void updateGroupName(); void reply_with_private_message(); void replytoforummessage(); From 561db00255d528ef266918ca3e64c21ce03f0d95 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 27 Nov 2018 15:15:54 +0100 Subject: [PATCH 058/110] resurrected sorting for pinned posts using a proxy model --- .../src/gui/gxsforums/GxsForumModel.cpp | 15 +++- .../src/gui/gxsforums/GxsForumModel.h | 1 + .../gui/gxsforums/GxsForumThreadWidget.cpp | 78 +++++++++++++++---- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 + 4 files changed, 76 insertions(+), 20 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 0546ca43b..04fbcb67e 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -276,9 +276,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const if(role == Qt::FontRole) { QFont font ; - - font.setBold(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN); - + font.setBold( (fmpe.mPostFlags & (ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN | ForumModelPostEntry::FLAG_POST_IS_PINNED))); return QVariant(font); } @@ -296,6 +294,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; case Qt::UserRole: return userRole (fmpe,index.column()) ; case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ; + case Qt::BackgroundRole: return backgroundRole(fmpe,index.column()) ; case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; case MissingRole: return missingRole (fmpe,index.column()) ; @@ -310,7 +309,7 @@ QVariant RsGxsForumModel::textColorRole(const ForumModelPostEntry& fmpe,int colu if( (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING)) return QVariant(mTextColorMissing); - if(IS_MSG_UNREAD(fmpe.mMsgStatus)) + if(IS_MSG_UNREAD(fmpe.mMsgStatus) || (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED)) return QVariant(mTextColorUnread); else return QVariant(mTextColorRead); @@ -382,6 +381,13 @@ QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) return QVariant(false); } +QVariant RsGxsForumModel::backgroundRole(const ForumModelPostEntry& fmpe,int column) const +{ + if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) + return QVariant(QBrush(QColor(255,200,180))); + + return QVariant(); +} QVariant RsGxsForumModel::sizeHintRole(int col) const { @@ -393,6 +399,7 @@ QVariant RsGxsForumModel::sizeHintRole(int col) const case COLUMN_THREAD_TITLE: return QVariant( QSize(factor * 170, factor*14 )); case COLUMN_THREAD_DATE: return QVariant( QSize(factor * 75 , factor*14 )); case COLUMN_THREAD_AUTHOR: return QVariant( QSize(factor * 75 , factor*14 )); + case COLUMN_THREAD_DISTRIBUTION: return QVariant( QSize(factor * 15 , factor*14 )); } } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 83d81aca5..c5ada2d88 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -141,6 +141,7 @@ public: QVariant sortRole (const ForumModelPostEntry& fmpe, int col) const; QVariant fontRole (const ForumModelPostEntry& fmpe, int col) const; QVariant textColorRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant backgroundRole(const ForumModelPostEntry& fmpe, int col) const; /*! * \brief debug_dump diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 18511383d..b7df1cd07 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -270,6 +270,41 @@ public: } }; +class ForumPostSortFilterProxyModel: public QSortFilterProxyModel +{ +public: + ForumPostSortFilterProxyModel(const QHeaderView *header,QObject *parent = NULL): QSortFilterProxyModel(parent),m_header(header) {} + + bool lessThan(const QModelIndex& left, const QModelIndex& right) const override + { + bool left_is_not_pinned = ! left.data(ROLE_THREAD_PINNED).toBool(); + bool right_is_not_pinned = !right.data(ROLE_THREAD_PINNED).toBool(); +#ifdef DEBUG_PINNED_POST_SORTING + std::cerr << "Comparing item date \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" + << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \"" + << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" + << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << right_is_not_pinned << ") "; +#endif + + if(left_is_not_pinned ^ right_is_not_pinned) + { +#ifdef DEBUG_PINNED_POST_SORTING + std::cerr << "Local: " << ((m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned) << std::endl; +#endif + return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top + } + +#ifdef DEBUG_PINNED_POST_SORTING + std::cerr << "Remote: " << GxsIdRSTreeWidgetItem::operator<(other) << std::endl; +#endif + return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ; + } + +private: + const QHeaderView *m_header ; +}; + + void GxsForumThreadWidget::setTextColorRead (QColor color) { mTextColorRead = color; mThreadModel->setTextColorRead (color);} void GxsForumThreadWidget::setTextColorUnread (QColor color) { mTextColorUnread = color; mThreadModel->setTextColorUnread (color);} void GxsForumThreadWidget::setTextColorUnreadChildren(QColor color) { mTextColorUnreadChildren = color; mThreadModel->setTextColorUnreadChildren(color);} @@ -329,11 +364,17 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mInMsgAsReadUnread = false; - mThreadCompareRole = new RSTreeWidgetItemCompareRole; - mThreadCompareRole->setRole(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT); + //mThreadCompareRole = new RSTreeWidgetItemCompareRole; + //mThreadCompareRole->setRole(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT); + + ui->threadTreeWidget->setSortingEnabled(true); mThreadModel = new RsGxsForumModel(this); - ui->threadTreeWidget->setModel(mThreadModel); + mThreadProxyModel = new ForumPostSortFilterProxyModel(ui->threadTreeWidget->header(),this); + mThreadProxyModel->setSourceModel(mThreadModel); + ui->threadTreeWidget->setModel(mThreadProxyModel); + + ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ,new ReadStatusItemDelegate()) ; @@ -442,8 +483,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget #ifdef SUSPENDED_CODE ui->threadTreeWidget->enableColumnCustomize(true); - ui->threadTreeWidget->sortItems(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); #endif + ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); } void GxsForumThreadWidget::blank() @@ -671,7 +712,7 @@ bool GxsForumThreadWidget::getCurrentPost(ForumModelPostEntry& fmpe) const if(!index.isValid()) return false ; - return mThreadModel->getPostData(index,fmpe); + return mThreadModel->getPostData(mThreadProxyModel->mapToSource(index),fmpe); } void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) @@ -905,14 +946,16 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) return; } - mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID),Qt::UserRole).toString().toStdString()); + mThreadId = mOrigThreadId = RsGxsMessageId(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); std::cerr << "Switched to new thread ID " << mThreadId << std::endl; //ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); - mThreadModel->setMsgReadStatus(index, true,false); + + QModelIndex src_index = mThreadProxyModel->mapToSource(index); + mThreadModel->setMsgReadStatus(src_index, true,false); } void GxsForumThreadWidget::clickedThread(QModelIndex index) @@ -932,8 +975,11 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) if (index.column() == RsGxsForumModel::COLUMN_THREAD_READ) { ForumModelPostEntry fmpe; - mThreadModel->getPostData(index,fmpe); - mThreadModel->setMsgReadStatus(index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); + + QModelIndex src_index = mThreadProxyModel->mapToSource(index); + + mThreadModel->getPostData(src_index,fmpe); + mThreadModel->setMsgReadStatus(src_index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); } else changedThread(index); @@ -1837,7 +1883,7 @@ void GxsForumThreadWidget::insertMessage() if (index.isValid()) { - QModelIndex parentIndex = index.parent(); + QModelIndex parentIndex = mThreadProxyModel->mapToSource(index).parent(); int curr_index = index.row(); int count = mThreadModel->rowCount(parentIndex); @@ -1950,15 +1996,15 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) if (IS_MSG_NEW(status)) { if (setToReadOnActive) { /* set to read */ - mThreadModel->setMsgReadStatus(index,true,false); + mThreadModel->setMsgReadStatus(mThreadProxyModel->mapToSource(index),true,false); } else { /* set to unread by user */ - mThreadModel->setMsgReadStatus(index,false,false); + mThreadModel->setMsgReadStatus(mThreadProxyModel->mapToSource(index),false,false); } } else { if (setToReadOnActive && IS_MSG_UNREAD(status)) { /* set to read */ - mThreadModel->setMsgReadStatus(index, true,false); + mThreadModel->setMsgReadStatus(mThreadProxyModel->mapToSource(index), true,false); } } @@ -2004,7 +2050,7 @@ void GxsForumThreadWidget::previousMessage() if (index > 0) { - QModelIndex prevItem = mThreadModel->index(index - 1,0,parentIndex) ; + QModelIndex prevItem = mThreadProxyModel->index(index - 1,0,parentIndex) ; if (prevItem.isValid()) { ui->threadTreeWidget->setCurrentIndex(prevItem); @@ -2027,11 +2073,11 @@ void GxsForumThreadWidget::nextMessage() QModelIndex parentIndex = current_index.parent(); int index = current_index.row(); - int count = mThreadModel->rowCount(parentIndex) ; + int count = mThreadProxyModel->rowCount(parentIndex); if (index < count - 1) { - QModelIndex nextItem = mThreadModel->index(index + 1,0,parentIndex) ; + QModelIndex nextItem = mThreadProxyModel->index(index + 1,0,parentIndex) ; if (nextItem.isValid()) { ui->threadTreeWidget->setCurrentIndex(nextItem); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 48df15759..426b56456 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -27,6 +27,7 @@ #include #include "gui/gxs/GxsIdDetails.h" +class QSortFilterProxyModel; class QTreeWidgetItem; class RSTreeWidgetItemCompareRole; class RsGxsForumMsg; @@ -239,6 +240,7 @@ private: QMap > > mPostVersions ; // holds older versions of posts RsGxsForumModel *mThreadModel; + QSortFilterProxyModel *mThreadProxyModel; Ui::GxsForumThreadWidget *ui; }; From 23302ea469d1ca8f728408243047bbf8d9aad1cb Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 27 Nov 2018 19:21:49 +0100 Subject: [PATCH 059/110] partly resurrected post versions --- .../src/gui/gxsforums/GxsForumModel.cpp | 64 ++++++++++++------- .../src/gui/gxsforums/GxsForumModel.h | 7 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 35 +++++----- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 - 4 files changed, 65 insertions(+), 43 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 04fbcb67e..2e960df90 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -48,11 +48,22 @@ int RsGxsForumModel::rowCount(const QModelIndex& parent) const else return getChildrenCount(parent.internalPointer()); } + int RsGxsForumModel::columnCount(const QModelIndex &parent) const { return COLUMN_THREAD_NB_COLUMNS ; } +std::vector > RsGxsForumModel::getPostVersions(const RsGxsMessageId& mid) const +{ + auto it = mPostVersions.find(mid); + + if(it != mPostVersions.end()) + return it->second; + else + return std::vector >(); +} + bool RsGxsForumModel::getPostData(const QModelIndex& i,ForumModelPostEntry& fmpe) const { if(!i.isValid()) @@ -488,12 +499,13 @@ void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) update_posts(forum_group_id); } -void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts) +void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions) { emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); mForumGroup = group; mPosts = posts; + mPostVersions = post_versions; // now update prow for all posts @@ -539,14 +551,15 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) // 2 - sort the messages into a proper hierarchy + auto post_versions = new std::map > >() ; std::vector *vect = new std::vector(); RsGxsForumGroup group = groups[0]; - computeMessagesHierarchy(group,messages,*vect); + computeMessagesHierarchy(group,messages,*vect,*post_versions); // 3 - update the model in the UI thread. - RsQThreadUtils::postToObject( [group,vect,this]() + RsQThreadUtils::postToObject( [group,vect,post_versions,this]() { /* Here it goes any code you want to be executed on the Qt Gui * thread, for example to update the data model with new information @@ -554,8 +567,10 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) * Qt::QueuedConnection is important! */ - setPosts(group,*vect) ; + setPosts(group,*vect,*post_versions) ; + delete vect; + delete post_versions; }, this ); @@ -651,11 +666,13 @@ void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,c #endif } -static bool decreasing_time_comp(const QPair& e1,const QPair& e2) { return e2.first < e1.first ; } +static bool decreasing_time_comp(const std::pair& e1,const std::pair& e2) { return e2.first < e1.first ; } void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector& msgs_array, - std::vector& posts) + std::vector& posts, + std::map > >& mPostVersions + ) { std::cerr << "updating messages data with " << msgs_array.size() << " messages" << std::endl; @@ -687,7 +704,6 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou int step = 0; initEmptyHierarchy(posts); - QMap > > mPostVersions ; // ThreadList contains the list of parent threads. The algorithm below iterates through all messages // and tries to establish parenthood relationships between them, given that we only know the @@ -740,31 +756,31 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou // always add the post a self version if(mPostVersions[msgIt->second.mMeta.mOrigMsgId].empty()) - mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(QPair(msgIt2->second.mMeta.mPublishTs,msgIt2->second.mMeta.mMsgId)) ; + mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(std::make_pair(msgIt2->second.mMeta.mPublishTs,msgIt2->second.mMeta.mMsgId)) ; - mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(QPair(msgIt->second.mMeta.mPublishTs,msgIt->second.mMeta.mMsgId)) ; + mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(std::make_pair(msgIt->second.mMeta.mPublishTs,msgIt->second.mMeta.mMsgId)) ; } } // The following code assembles all new versions of a given post into the same array, indexed by the oldest version of the post. - for(QMap > >::iterator it(mPostVersions.begin());it!=mPostVersions.end();++it) + for(auto it(mPostVersions.begin());it!=mPostVersions.end();++it) { - QVector >& v(*it) ; + auto& v(it->second) ; for(int32_t i=0;ifirst) { RsGxsMessageId sub_msg_id = v[i].second ; - QMap > >::iterator it2 = mPostVersions.find(sub_msg_id); + auto it2 = mPostVersions.find(sub_msg_id); if(it2 != mPostVersions.end()) { - for(int32_t j=0;j<(*it2).size();++j) - if((*it2)[j].second != sub_msg_id) // dont copy it, since it is already present at slot i - v.append((*it2)[j]) ; + for(int32_t j=0;jsecond.size();++j) + if(it2->second[j].second != sub_msg_id) // dont copy it, since it is already present at slot i + v.push_back(it2->second[j]) ; mPostVersions.erase(it2) ; // it2 is never equal to it } @@ -779,37 +795,37 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou #ifdef DEBUG_FORUMS std::cerr << "Final post versions: " << std::endl; #endif - QMap > > mTmp; + std::map > > mTmp; std::map most_recent_versions ; - for(QMap > >::iterator it(mPostVersions.begin());it!=mPostVersions.end();++it) + for(auto it(mPostVersions.begin());it!=mPostVersions.end();++it) { #ifdef DEBUG_FORUMS std::cerr << "Original post: " << it.key() << std::endl; #endif // Finally, sort the posts from newer to older - qSort((*it).begin(),(*it).end(),decreasing_time_comp) ; + std::sort(it->second.begin(),it->second.end(),decreasing_time_comp) ; #ifdef DEBUG_FORUMS std::cerr << " most recent version " << (*it)[0].first << " " << (*it)[0].second << std::endl; #endif - for(int32_t i=1;i<(*it).size();++i) + for(int32_t i=1;isecond.size();++i) { - msgs.erase((*it)[i].second) ; + msgs.erase(it->second[i].second) ; #ifdef DEBUG_FORUMS std::cerr << " older version " << (*it)[i].first << " " << (*it)[i].second << std::endl; #endif } - mTmp[(*it)[0].second] = *it ; // index the versions map by the ID of the most recent post. + mTmp[it->second[0].second] = it->second ; // index the versions map by the ID of the most recent post. // Now make sure that message parents are consistent. Indeed, an old post may have the old version of a post as parent. So we need to change that parent // to the newest version. So we create a map of which is the most recent version of each message, so that parent messages can be searched in it. - for(int i=1;i<(*it).size();++i) - most_recent_versions[(*it)[i].second] = (*it)[0].second ; + for(int i=1;isecond.size();++i) + most_recent_versions[it->second[i].second] = it->second[0].second ; } mPostVersions = mTmp ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index c5ada2d88..78fd9f6e3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -83,6 +83,8 @@ public: QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} QModelIndex getIndexOfMessage(const RsGxsMessageId& mid) const; + std::vector > getPostVersions(const RsGxsMessageId& mid) const; + #ifdef TO_REMOVE QModelIndex getNextIndex(const QModelIndex& i,bool unread_only) const; @@ -176,11 +178,12 @@ private: static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn, ForumModelPostEntry& fentry); - void computeMessagesHierarchy(const RsGxsForumGroup& forum_group,const std::vector& msgs_array,std::vector& posts); - void setPosts(const RsGxsForumGroup &group, const std::vector& posts); // this method *must* be called from UI thread. + void computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector& msgs_array, std::vector& posts, std::map > > &mPostVersions); + void setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions); void initEmptyHierarchy(std::vector& posts); std::vector mPosts ; // store the list of posts updated from rsForums. + std::map > > mPostVersions; QColor mTextColorRead ; QColor mTextColorUnread ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index b7df1cd07..a5c5c4ce7 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -484,7 +484,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->enableColumnCustomize(true); #endif - ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); } void GxsForumThreadWidget::blank() @@ -1883,9 +1882,9 @@ void GxsForumThreadWidget::insertMessage() if (index.isValid()) { - QModelIndex parentIndex = mThreadProxyModel->mapToSource(index).parent(); + QModelIndex parentIndex = index.parent(); int curr_index = index.row(); - int count = mThreadModel->rowCount(parentIndex); + int count = mThreadProxyModel->rowCount(parentIndex); ui->previousButton->setEnabled(curr_index > 0); ui->nextButton->setEnabled(curr_index < count - 1); @@ -1911,32 +1910,31 @@ void GxsForumThreadWidget::insertMessage() // add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox. - std::cerr << "Looking into existing versions for post " << mThreadId << ", thread history: " << mPostVersions.size() << std::endl; -#ifdef TODO - QMap > >::const_iterator it = mPostVersions.find(mOrigThreadId) ; + std::vector > post_versions = mThreadModel->getPostVersions(mThreadId); + std::cerr << "Looking into existing versions for post " << mThreadId << ", thread history: " << post_versions.size() << std::endl; ui->versions_CB->blockSignals(true) ; while(ui->versions_CB->count() > 0) ui->versions_CB->removeItem(0); - if(it != mPostVersions.end()) + if(!post_versions.empty()) { - std::cerr << (*it).size() << " versions found " << std::endl; + std::cerr << post_versions.size() << " versions found " << std::endl; ui->versions_CB->setVisible(true) ; ui->time_label->hide(); int current_index = 0 ; - for(int i=0;i<(*it).size();++i) + for(int i=0;iversions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( (*it)[i].first)); - ui->versions_CB->setItemData(i,QString::fromStdString((*it)[i].second.toStdString())); + ui->versions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( post_versions[i].first)); + ui->versions_CB->setItemData(i,QString::fromStdString(post_versions[i].second.toStdString())); - std::cerr << " added new post version " << (*it)[i].first << " " << (*it)[i].second << std::endl; + std::cerr << " added new post version " << post_versions[i].first << " " << post_versions[i].second << std::endl; - if(mThreadId == (*it)[i].second) + if(mThreadId == post_versions[i].second) current_index = i ; } @@ -1947,7 +1945,6 @@ void GxsForumThreadWidget::insertMessage() ui->versions_CB->hide(); ui->time_label->show(); } -#endif ui->versions_CB->blockSignals(false) ; @@ -2238,7 +2235,7 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f QModelIndex index = *selectedIndexes.begin(); - mThreadModel->setMsgReadStatus(index,read,children); + mThreadModel->setMsgReadStatus(mThreadProxyModel->mapToSource(index),read,children); } #ifdef TODO @@ -2723,13 +2720,21 @@ bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text void GxsForumThreadWidget::updateGroupName() { + ui->threadTreeWidget->selectionModel()->clear(); + ui->threadTreeWidget->selectionModel()->reset(); + mThreadId.clear(); ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); + ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); + ui->threadTreeWidget->update(); } void GxsForumThreadWidget::updateGroupData() { mSubscribeFlags = 0; mSignFlags = 0; + mThreadId.clear(); mForumDescription.clear(); + ui->threadTreeWidget->selectionModel()->clear(); + ui->threadTreeWidget->selectionModel()->reset(); emit groupChanged(this); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 426b56456..44ef20f75 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -237,8 +237,6 @@ private: RsGxsMessageId mNavigatePendingMsgId; QList mIgnoredMsgId; - QMap > > mPostVersions ; // holds older versions of posts - RsGxsForumModel *mThreadModel; QSortFilterProxyModel *mThreadProxyModel; From ed68d720aa3724637e0656ed2b59d3a6d071ed71 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 27 Nov 2018 20:43:09 +0100 Subject: [PATCH 060/110] fixed post versionning --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index a5c5c4ce7..9d8fa6824 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -968,6 +968,7 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) return; mThreadId = tmp; + mOrigThreadId = tmp; std::cerr << "Clicked on message ID " << mThreadId << std::endl; @@ -1910,7 +1911,7 @@ void GxsForumThreadWidget::insertMessage() // add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox. - std::vector > post_versions = mThreadModel->getPostVersions(mThreadId); + std::vector > post_versions = mThreadModel->getPostVersions(mOrigThreadId); std::cerr << "Looking into existing versions for post " << mThreadId << ", thread history: " << post_versions.size() << std::endl; ui->versions_CB->blockSignals(true) ; From ccdfc3cbf3998b2d4ee29f2231147efc61b7f647 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 27 Nov 2018 22:24:18 +0100 Subject: [PATCH 061/110] cleaned up removed code in Forum Model --- .../src/gui/gxsforums/GxsForumModel.cpp | 4 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 59 ++++++++++--------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 11 ++-- .../src/gui/gxsforums/GxsForumsFillThread.cpp | 2 + .../src/gui/gxsforums/GxsForumsFillThread.h | 2 + 5 files changed, 43 insertions(+), 35 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 2e960df90..b819e1970 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -491,8 +491,8 @@ QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) { - if(mForumGroup.mMeta.mGroupId == forum_group_id) - return ; + //if(mForumGroup.mMeta.mGroupId == forum_group_id) + // return ; // we do not set mForumGroupId yet. We'll do it when the forum data is updated. diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 9d8fa6824..d9162ce56 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -367,18 +367,19 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget //mThreadCompareRole = new RSTreeWidgetItemCompareRole; //mThreadCompareRole->setRole(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT); - ui->threadTreeWidget->setSortingEnabled(true); - mThreadModel = new RsGxsForumModel(this); mThreadProxyModel = new ForumPostSortFilterProxyModel(ui->threadTreeWidget->header(),this); mThreadProxyModel->setSourceModel(mThreadModel); ui->threadTreeWidget->setModel(mThreadProxyModel); + ui->threadTreeWidget->setSortingEnabled(true); ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ,new ReadStatusItemDelegate()) ; + connect(ui->threadTreeWidget->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),this,SLOT(sortColumn(int,Qt::SortOrder))); + connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); connect(ui->postText, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint))); @@ -486,6 +487,11 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget #endif } +void GxsForumThreadWidget::sortColumn(int col,Qt::SortOrder o) +{ + ui->threadTreeWidget->sortByColumn(col,o); +} + void GxsForumThreadWidget::blank() { ui->progressBar->hide(); @@ -514,18 +520,19 @@ void GxsForumThreadWidget::blank() GxsForumThreadWidget::~GxsForumThreadWidget() { +#ifdef TO_REMOVE if (mFillThread) { mFillThread->stop(); delete(mFillThread); mFillThread = NULL; } + delete(mThreadCompareRole); +#endif // save settings processSettings(false); delete ui; - - delete(mThreadCompareRole); } void GxsForumThreadWidget::processSettings(bool load) @@ -609,7 +616,7 @@ void GxsForumThreadWidget::changeEvent(QEvent *e) RsGxsUpdateBroadcastWidget::changeEvent(e); switch (e->type()) { case QEvent::StyleChange: - calculateIconsAndFonts(); + //calculateIconsAndFonts(); break; default: // remove compiler warnings @@ -929,9 +936,11 @@ void GxsForumThreadWidget::changedVersion() { mThreadId = RsGxsMessageId(ui->versions_CB->itemData(ui->versions_CB->currentIndex()).toString().toStdString()) ; +#ifdef TO_REMOVE if (mFillThread) { return; } +#endif ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); } @@ -985,9 +994,9 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) changedThread(index); } +#ifdef TO_REMOVE void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren) { -#ifdef TODO uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); bool isNew = IS_MSG_NEW(status); @@ -1062,12 +1071,10 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &h hasReadChilddren = hasReadChilddren || myReadChilddren || !unread; hasUnreadChilddren = hasUnreadChilddren || myUnreadChilddren || unread; -#endif } void GxsForumThreadWidget::calculateUnreadCount() { -#ifdef TODO unsigned int unreadCount = 0; unsigned int newCount = 0; @@ -1098,12 +1105,10 @@ void GxsForumThreadWidget::calculateUnreadCount() if (changed) { emit groupChanged(this); } -#endif } void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item /*= NULL*/) { -#ifdef TODO bool dummy1 = false; bool dummy2 = false; @@ -1120,8 +1125,8 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item /*= NULL dummy2 = false; calculateIconsAndFonts(ui->threadTreeWidget->topLevelItem(index), dummy1, dummy2); } -#endif } +#endif static void cleanupItems (QList &items) { @@ -1134,6 +1139,7 @@ static void cleanupItems (QList &items) items.clear(); } +#ifdef TO_REMOVE void GxsForumThreadWidget::insertGroupData() { #ifdef DEBUG_FORUMS @@ -1142,6 +1148,7 @@ void GxsForumThreadWidget::insertGroupData() //GxsIdDetails::process(mForumGroup.mMeta.mAuthorId, &loadAuthorIdCallback, this); calculateIconsAndFonts(); } +#endif static QString getDurationString(uint32_t days) { @@ -1159,6 +1166,7 @@ static QString getDurationString(uint32_t days) } } +#ifdef TO_REMOVE /*static*/ void GxsForumThreadWidget::loadAuthorIdCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &) { GxsForumThreadWidget *tw = dynamic_cast(object); @@ -1274,7 +1282,6 @@ static QString getDurationString(uint32_t days) void GxsForumThreadWidget::fillThreadFinished() { -#ifdef TODO #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreadFinished" << std::endl; #endif @@ -1393,7 +1400,6 @@ void GxsForumThreadWidget::fillThreadFinished() #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreadFinished done" << std::endl; #endif -#endif } void GxsForumThreadWidget::fillThreadProgress(int current, int count) @@ -1598,7 +1604,6 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum return item; } -#ifdef TO_REMOVE void GxsForumThreadWidget::insertThreads() { #ifdef DEBUG_FORUMS @@ -1913,7 +1918,7 @@ void GxsForumThreadWidget::insertMessage() std::vector > post_versions = mThreadModel->getPostVersions(mOrigThreadId); - std::cerr << "Looking into existing versions for post " << mThreadId << ", thread history: " << post_versions.size() << std::endl; + std::cerr << "Looking into existing versions for post " << mOrigThreadId << ", thread history: " << post_versions.size() << std::endl; ui->versions_CB->blockSignals(true) ; while(ui->versions_CB->count() > 0) @@ -1950,7 +1955,6 @@ void GxsForumThreadWidget::insertMessage() ui->versions_CB->blockSignals(false) ; /* request Post */ - //RsGxsGrpMsgIdPair msgId = std::make_pair(groupId(), mThreadId); updateMessageData(mThreadId); markMsgAsRead(); @@ -1971,9 +1975,10 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) std::cerr << "\t or CurrThdId: " << mThreadId << " != msg.MsgId: " << msg.mMeta.mMsgId; std::cerr << std::endl; std::cerr << std::endl; - +#ifdef TO_REMOVE mStateHelper->setActive(mTokenTypeMessageData, false); mStateHelper->clear(mTokenTypeMessageData); +#endif return; } @@ -1981,10 +1986,12 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) uint32_t overall_reputation = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId) ; bool redacted = (overall_reputation == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ; +#ifdef TO_REMOVE mStateHelper->setActive(mTokenTypeMessageData, true); //mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); //QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); +#endif bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); uint32_t status = msg.mMeta.mMsgStatus ;//item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); @@ -2360,7 +2367,6 @@ void GxsForumThreadWidget::subscribeGroup(bool subscribe) uint32_t token; rsGxsForums->subscribeToGroup(token, groupId(), subscribe); -// mTokenQueue->queueRequest(token, 0, RS_TOKREQ_ANSTYPE_ACK, TOKEN_TYPE_SUBSCRIBE_CHANGE); } void GxsForumThreadWidget::createmessage() @@ -2377,21 +2383,20 @@ void GxsForumThreadWidget::createmessage() void GxsForumThreadWidget::togglePinUpPost() { -#ifdef TODO - if (groupId().isNull() || mThreadId.isNull()) + if (groupId().isNull() || mOrigThreadId.isNull()) return; - QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); + QModelIndex index = getCurrentIndex(); // normally this method is only called on top level items. We still check it just in case... - if(item->parent() != NULL) + if(mThreadProxyModel->mapToSource(index).parent() != mThreadModel->root()) { std::cerr << "(EE) togglePinUpPost() called on non top level post. This is inconsistent." << std::endl; return ; } - QString thread_title = (item != NULL)?item->text(RsGxsForumModel::COLUMN_THREAD_TITLE):QString() ; + QString thread_title = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_TITLE).data(Qt::DisplayRole).toString(); std::cerr << "Toggling Pin-up state of post " << mThreadId.toStdString() << ": \"" << thread_title.toStdString() << "\"" << std::endl; @@ -2403,9 +2408,8 @@ void GxsForumThreadWidget::togglePinUpPost() uint32_t token; rsGxsForums->updateGroup(token,mForumGroup); - ui->threadTreeWidget->takeTopLevelItem(ui->threadTreeWidget->indexOfTopLevelItem(item)); // forces the re-creation of all posts widgets. A bit extreme. We should rather only delete item above + groupIdChanged(); // reloads all posts. We could also update the model directly, but the cost is so small now ;-) updateDisplay(true) ; -#endif } void GxsForumThreadWidget::createthread() @@ -2736,6 +2740,7 @@ void GxsForumThreadWidget::updateGroupData() mForumDescription.clear(); ui->threadTreeWidget->selectionModel()->clear(); ui->threadTreeWidget->selectionModel()->reset(); + mThreadProxyModel->clear(); emit groupChanged(this); @@ -3164,7 +3169,6 @@ void GxsForumThreadWidget::loadMsgData_SetAuthorOpinion(const uint32_t &token,Rs std::cerr << __PRETTY_FUNCTION__ << ": need to implement the update of GxsTreeWidgetItems icons too." << std::endl; } -#endif /*********************** **** **** **** ***********************/ /*********************** **** **** **** ***********************/ @@ -3177,7 +3181,6 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque if (queue == mTokenQueue) { -#ifdef TO_REMOVE /* now switch on req */ if (req.mUserType == mTokenTypeGroupData) { loadGroupData(req.mToken); @@ -3221,7 +3224,6 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEUTRAL); return; } -#endif } GxsMessageFrameWidget::loadRequest(queue, req); @@ -3231,3 +3233,4 @@ QTreeWidgetItem *GxsForumThreadWidget::generateMissingItem(const RsGxsMessageId& { return NULL; } +#endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 44ef20f75..547be9435 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -79,11 +79,10 @@ public: unsigned int newCount() { return mNewCount; } unsigned int unreadCount() { return mUnreadCount; } - QTreeWidgetItem *convertMsgToThreadWidget(const RsGxsForumMsg &msg, bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *parent); QTreeWidgetItem *generateMissingItem(const RsGxsMessageId &msgId); // Callback for all Loads. - virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); + //virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); virtual void blank(); protected: @@ -100,6 +99,7 @@ private slots: /** Create the context popup menu and it's submenus */ void threadListCustomPopupMenu(QPoint point); void contextMenuTextBrowser(QPoint point); + void sortColumn(int col,Qt::SortOrder o); void changedThread(QModelIndex index); void changedVersion(); @@ -151,10 +151,11 @@ private slots: void filterColumnChanged(int column); void filterItems(const QString &text); - +#ifdef TO_REMOVE void fillThreadFinished(); void fillThreadProgress(int current, int count); void fillThreadStatus(QString text); +#endif private: void insertMessageData(const RsGxsForumMsg &msg); @@ -171,8 +172,8 @@ private: int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); void setMsgReadStatus(QList &rows, bool read); void markMsgAsReadUnread(bool read, bool children, bool forum); - void calculateIconsAndFonts(QTreeWidgetItem *item = NULL); - void calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren); + //void calculateIconsAndFonts(QTreeWidgetItem *item = NULL); + //void calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren); void calculateUnreadCount(); void togglethreadview_internal(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp index faff45f74..abaad4848 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp @@ -33,6 +33,7 @@ //#define DEBUG_FORUMS +#ifdef TO_REMOVE #define PROGRESSBAR_MAX 100 GxsForumsFillThread::GxsForumsFillThread(GxsForumThreadWidget *parent) @@ -553,4 +554,5 @@ void GxsForumsFillThread::run() if(wasStopped()) deleteLater(); } +#endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h index 76428f382..cf4f17ea2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h @@ -31,6 +31,7 @@ class RsGxsForumMsg; class RSTreeWidgetItemCompareRole; class QTreeWidgetItem; +#ifdef TO_REMOVE class GxsForumsFillThread : public QThread { Q_OBJECT @@ -70,3 +71,4 @@ private: }; #endif // GXSFORUMSFILLTHREAD_H +#endif // GXSFORUMSFILLTHREAD_H From 9c840baf2ed7fdc27ac811b9133ebfa81d5e03ed Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 28 Nov 2018 23:50:38 +0100 Subject: [PATCH 062/110] added missing signal causing crach in new model when changing forums --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index b819e1970..e38ae759d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -501,7 +501,7 @@ void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions) { - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutAboutToBeChanged(); mForumGroup = group; mPosts = posts; @@ -523,6 +523,7 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector Date: Thu, 29 Nov 2018 00:01:35 +0100 Subject: [PATCH 063/110] removed some more old code from forum thread widget --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 15 ++++++++++++++- .../src/gui/gxsforums/GxsForumThreadWidget.h | 4 +++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d9162ce56..7e28d7480 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -317,6 +317,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget { ui->setupUi(this); +#ifdef TO_REMOVE mTokenTypeGroupData = nextTokenType(); mTokenTypeInsertThreads = nextTokenType(); mTokenTypeMessageData = nextTokenType(); @@ -327,10 +328,11 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mTokenTypeNeutralAuthor = nextTokenType(); mTokenTypePositiveAuthor = nextTokenType(); mTokenTypeEditForumMessage = nextTokenType(); +#endif setUpdateWhenInvisible(true); -#ifdef TODO +#ifdef TO_REMOVE /* Setup UI helper */ mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton); mStateHelper->addWidget(mTokenTypeGroupData, ui->newthreadButton); @@ -373,6 +375,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->setModel(mThreadProxyModel); ui->threadTreeWidget->setSortingEnabled(true); + ui->threadTreeWidget->setDynamicSortFilter(true); ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; @@ -600,9 +603,11 @@ QString GxsForumThreadWidget::groupName(bool withUnreadCount) QIcon GxsForumThreadWidget::groupIcon() { +#ifdef TO_REMOVE if (mStateHelper->isLoading(mTokenTypeGroupData) || mFillThread) { return QIcon(":/images/kalarm.png"); } +#endif if (mNewCount) { return QIcon(":/images/message-state-new.png"); @@ -2330,6 +2335,7 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) return true; } +#ifdef TO_REMOVE bool GxsForumThreadWidget::isLoading() { if (mStateHelper->isLoading(mTokenTypeGroupData) || mFillThread) { @@ -2338,6 +2344,7 @@ bool GxsForumThreadWidget::isLoading() return GxsMessageFrameWidget::isLoading(); } +#endif void GxsForumThreadWidget::copyMessageLink() { @@ -2761,8 +2768,11 @@ void GxsForumThreadWidget::updateGroupData() if(groups.size() != 1) { + std::cerr << __PRETTY_FUNCTION__ << " obtained more than one group info for forum " << groupId() << std::endl; +#ifdef TO_REMOVE mStateHelper->setActive(mTokenTypeGroupData, false); mStateHelper->clear(mTokenTypeGroupData); +#endif return; } @@ -2813,8 +2823,11 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) if(msgs.size() != 1) { + std::cerr << __PRETTY_FUNCTION__ << " obtained more than one msg info for msgId " << msgId << std::endl; +#ifdef TO_REMOVE mStateHelper->setActive(mTokenTypeGroupData, false); mStateHelper->clear(mTokenTypeGroupData); +#endif return; } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 547be9435..b387a7d70 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -74,7 +74,7 @@ public: virtual QString groupName(bool withUnreadCount); virtual QIcon groupIcon(); virtual bool navigate(const RsGxsMessageId& msgId); - virtual bool isLoading(); + //virtual bool isLoading(); unsigned int newCount() { return mNewCount; } unsigned int unreadCount() { return mUnreadCount; } @@ -217,6 +217,7 @@ private: unsigned int mUnreadCount; unsigned int mNewCount; +#ifdef TO_REMOVE uint32_t mTokenTypeGroupData; uint32_t mTokenTypeInsertThreads; uint32_t mTokenTypeMessageData; @@ -227,6 +228,7 @@ private: uint32_t mTokenTypeNegativeAuthor; uint32_t mTokenTypePositiveAuthor; uint32_t mTokenTypeNeutralAuthor; +#endif /* Color definitions (for standard see qss.default) */ QColor mTextColorRead; From 66ad7b650bb9c50beeae66d04fa365ab64732f6e Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 29 Nov 2018 18:33:25 +0100 Subject: [PATCH 064/110] added missing virtual destructor in RsGrpMetaData and RsMsgMetaData --- libretroshare/src/retroshare/rsgxsifacetypes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/retroshare/rsgxsifacetypes.h b/libretroshare/src/retroshare/rsgxsifacetypes.h index 72f290c2f..c80ce3afa 100644 --- a/libretroshare/src/retroshare/rsgxsifacetypes.h +++ b/libretroshare/src/retroshare/rsgxsifacetypes.h @@ -61,6 +61,8 @@ struct RsGroupMetaData : RsSerializable mCircleType(0x0001), mAuthenFlags(0), mSubscribeFlags(0), mPop(0), mVisibleMsgCount(0), mLastPost(0), mGroupStatus(0) {} + virtual ~RsGroupMetaData() {} + void operator =(const RsGxsGrpMetaData& rGxsMeta); RsGxsGroupId mGroupId; @@ -124,9 +126,9 @@ struct RsMsgMetaData : RsSerializable { RsMsgMetaData() : mPublishTs(0), mMsgFlags(0), mMsgStatus(0), mChildTs(0) {} + virtual ~RsMsgMetaData() {} void operator =(const RsGxsMsgMetaData& rGxsMeta); - RsGxsGroupId mGroupId; RsGxsMessageId mMsgId; From c078510909031e0805a3886937d9fd890d7ed89a Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 29 Nov 2018 18:34:47 +0100 Subject: [PATCH 065/110] removed line that breaks compilation --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 7e28d7480..0f53abf47 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -375,7 +375,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->setModel(mThreadProxyModel); ui->threadTreeWidget->setSortingEnabled(true); - ui->threadTreeWidget->setDynamicSortFilter(true); + //ui->threadTreeWidget->setDynamicSortFilter(true);// is that useful?? ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; From dce660357aceab527c289b432f3add5480450ec1 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 29 Nov 2018 22:15:12 +0100 Subject: [PATCH 066/110] fixed Travis compilation --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index e38ae759d..6f9b0fa75 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1165,10 +1165,13 @@ static void recursPrintModel(const std::vector& entries,For { const ForumModelPostEntry& e(entries[index]); + QDateTime qtime; + qtime.setTime_t(e.mPublishTs); + std::cerr << std::string(depth*2,' ') << index << " : " << e.mAuthorId.toStdString() << " " << QString("%1").arg((uint32_t)e.mPostFlags,8,16,QChar('0')).toStdString() << " " << QString("%1").arg((uint32_t)e.mMsgStatus,8,16,QChar('0')).toStdString() << " " - << QDateTime::fromSecsSinceEpoch(e.mPublishTs).toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; + << qtime.toString().toStdString() << " \"" << e.mTitle << "\"" << std::endl; for(uint32_t i=0;i Date: Fri, 30 Nov 2018 17:24:43 +0100 Subject: [PATCH 067/110] fixed sorting problem in new model due to missing call to sortRole() --- retroshare-gui/src/gui/gxs/GxsIdDetails.h | 1 + .../src/gui/gxsforums/GxsForumModel.cpp | 19 ++++++++++++++++--- .../gui/gxsforums/GxsForumThreadWidget.cpp | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.h b/retroshare-gui/src/gui/gxs/GxsIdDetails.h index 30edffd7e..8c6c8edac 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.h +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.h @@ -63,6 +63,7 @@ class GxsIdDetails : public QObject Q_OBJECT public: + static const int ICON_TYPE_NONE = 0x0000 ; static const int ICON_TYPE_AVATAR = 0x0001 ; static const int ICON_TYPE_PGP = 0x0002 ; static const int ICON_TYPE_RECOGN = 0x0004 ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 6f9b0fa75..825cc02d4 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -310,6 +310,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; case MissingRole: return missingRole (fmpe,index.column()) ; case StatusRole: return statusRole (fmpe,index.column()) ; + case SortRole: return sortRole (fmpe,index.column()) ; default: return QVariant(); } @@ -424,10 +425,22 @@ QVariant RsGxsForumModel::authorRole(const ForumModelPostEntry& fmpe,int column) QVariant RsGxsForumModel::sortRole(const ForumModelPostEntry& fmpe,int column) const { - if(column == COLUMN_THREAD_DATA) - return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here + switch(column) + { + case COLUMN_THREAD_DATE: return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here + case COLUMN_THREAD_READ: return QVariant((bool)IS_MSG_UNREAD(fmpe.mMsgStatus)); + case COLUMN_THREAD_DISTRIBUTION: return decorationRole(fmpe,column); + case COLUMN_THREAD_AUTHOR: + { + QString str,comment ; + QList icons; + GxsIdDetails::MakeIdDesc(fmpe.mAuthorId, false, str, icons, comment,GxsIdDetails::ICON_TYPE_NONE); - return QVariant(); + return QVariant(str); + } + default: + return displayRole(fmpe,column); + } } QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) const diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 0f53abf47..a5a16caed 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -372,6 +372,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadModel = new RsGxsForumModel(this); mThreadProxyModel = new ForumPostSortFilterProxyModel(ui->threadTreeWidget->header(),this); mThreadProxyModel->setSourceModel(mThreadModel); + mThreadProxyModel->setSortRole(RsGxsForumModel::SortRole); ui->threadTreeWidget->setModel(mThreadProxyModel); ui->threadTreeWidget->setSortingEnabled(true); @@ -381,6 +382,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ,new ReadStatusItemDelegate()) ; + ui->threadTreeWidget->header()->setSortIndicatorShown(true); connect(ui->threadTreeWidget->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),this,SLOT(sortColumn(int,Qt::SortOrder))); connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); From b7b9f335f95b782843497aaaa51d49970cf07c1d Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 30 Nov 2018 18:01:51 +0100 Subject: [PATCH 068/110] fixed fonts for unread msgs in Forum Model --- .../src/gui/gxsforums/GxsForumModel.cpp | 2 +- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 6 ------ .../src/gui/gxsforums/GxsForumThreadWidget.h | 15 --------------- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 825cc02d4..d3609c197 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -287,7 +287,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const if(role == Qt::FontRole) { QFont font ; - font.setBold( (fmpe.mPostFlags & (ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN | ForumModelPostEntry::FLAG_POST_IS_PINNED))); + font.setBold( (fmpe.mPostFlags & (ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN | ForumModelPostEntry::FLAG_POST_IS_PINNED)) || IS_MSG_UNREAD(fmpe.mMsgStatus)); return QVariant(font); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index a5a16caed..c2a12b426 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -383,7 +383,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ,new ReadStatusItemDelegate()) ; ui->threadTreeWidget->header()->setSortIndicatorShown(true); - connect(ui->threadTreeWidget->header(),SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)),this,SLOT(sortColumn(int,Qt::SortOrder))); connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint))); @@ -492,11 +491,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget #endif } -void GxsForumThreadWidget::sortColumn(int col,Qt::SortOrder o) -{ - ui->threadTreeWidget->sortByColumn(col,o); -} - void GxsForumThreadWidget::blank() { ui->progressBar->hide(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index b387a7d70..29c59099d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -74,15 +74,12 @@ public: virtual QString groupName(bool withUnreadCount); virtual QIcon groupIcon(); virtual bool navigate(const RsGxsMessageId& msgId); - //virtual bool isLoading(); unsigned int newCount() { return mNewCount; } unsigned int unreadCount() { return mUnreadCount; } QTreeWidgetItem *generateMissingItem(const RsGxsMessageId &msgId); - // Callback for all Loads. - //virtual void loadRequest(const TokenQueue *queue, const TokenRequest &req); virtual void blank(); protected: @@ -99,7 +96,6 @@ private slots: /** Create the context popup menu and it's submenus */ void threadListCustomPopupMenu(QPoint point); void contextMenuTextBrowser(QPoint point); - void sortColumn(int col,Qt::SortOrder o); void changedThread(QModelIndex index); void changedVersion(); @@ -120,11 +116,6 @@ private slots: void saveImage(); - - //void print(); - //void printpreview(); - - //void removemessage(); void markMsgAsRead(); void markMsgAsReadChildren(); void markMsgAsUnread(); @@ -165,15 +156,9 @@ private: void insertMessage(); void insertGroupData(); - //void insertThreads(); - //void fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand); - //void fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand); - int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); void setMsgReadStatus(QList &rows, bool read); void markMsgAsReadUnread(bool read, bool children, bool forum); - //void calculateIconsAndFonts(QTreeWidgetItem *item = NULL); - //void calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren); void calculateUnreadCount(); void togglethreadview_internal(); From a51eba1db2be0e77728ee5d1375b4b79472460c4 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 1 Dec 2018 16:09:35 +0100 Subject: [PATCH 069/110] added filtering mechanism in ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 44 ++++++++++- .../src/gui/gxsforums/GxsForumModel.h | 6 ++ .../gui/gxsforums/GxsForumThreadWidget.cpp | 75 +++++++++++-------- 3 files changed, 91 insertions(+), 34 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index d3609c197..37d7ead53 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -10,6 +10,7 @@ #include "GxsForumModel.h" #include "retroshare/rsgxsflags.h" #include "retroshare/rsgxsforums.h" +#include "retroshare/rsexpr.h" //#define DEBUG_FORUMMODEL @@ -17,6 +18,8 @@ Q_DECLARE_METATYPE(RsMsgMetaData); std::ostream& operator<<(std::ostream& o, const QModelIndex& i);// defined elsewhere +const QString RsGxsForumModel::FilterString("filtered"); + RsGxsForumModel::RsGxsForumModel(QObject *parent) : QAbstractItemModel(parent) { @@ -307,6 +310,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ; case Qt::BackgroundRole: return backgroundRole(fmpe,index.column()) ; + case FilterRole: return filterRole (fmpe,index.column()) ; case ThreadPinnedRole: return pinnedRole (fmpe,index.column()) ; case MissingRole: return missingRole (fmpe,index.column()) ; case StatusRole: return statusRole (fmpe,index.column()) ; @@ -337,10 +341,41 @@ QVariant RsGxsForumModel::statusRole(const ForumModelPostEntry& fmpe,int column) return QVariant(fmpe.mMsgStatus); } +QVariant RsGxsForumModel::filterRole(const ForumModelPostEntry& fmpe,int column) const +{ + if(mFilterColumn < 0) + return QVariant(QString()); + + switch(mFilterColumn) + { + case COLUMN_THREAD_TITLE: + { + for(auto iter(mFilterStrings.begin()); iter != mFilterStrings.end(); ++iter) + if(fmpe.mTitle.end() != std::search( fmpe.mTitle.begin(), fmpe.mTitle.end(), (*iter).begin(), (*iter).end(), RsRegularExpression::CompareCharIC() )) + return QVariant(FilterString); + + return QVariant(QString()); + } + + default: + return QVariant(FilterString); + } +} + +void RsGxsForumModel::setFilter(int column,const std::list& strings) +{ + mFilterColumn = column; + mFilterStrings = strings; + + emit layoutAboutToBeChanged(); + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutChanged(); +} + QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column) const { - if(column != COLUMN_THREAD_DATA) - return QVariant(); +// if(column != COLUMN_THREAD_DATA) +// return QVariant(); if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING) return QVariant(true); @@ -455,7 +490,10 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c return QVariant(QString::fromUtf8(fmpe.mTitle.c_str())); case COLUMN_THREAD_READ:return QVariant(); - case COLUMN_THREAD_DATE: { + case COLUMN_THREAD_DATE:{ + if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING) + return QVariant(QString()); + QDateTime qtime; qtime.setTime_t(fmpe.mPublishTs); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 78fd9f6e3..4637b1be1 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -78,11 +78,14 @@ public: MissingRole = Qt::UserRole+3, StatusRole = Qt::UserRole+4, UnreadChildrenRole = Qt::UserRole+5, + FilterRole = Qt::UserRole+6, }; QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} QModelIndex getIndexOfMessage(const RsGxsMessageId& mid) const; + static const QString FilterString ; + std::vector > getPostVersions(const RsGxsMessageId& mid) const; #ifdef TO_REMOVE @@ -117,6 +120,7 @@ public: void setTextColorMissing (QColor color) { mTextColorMissing = color;} void setMsgReadStatus(const QModelIndex &i, bool read_status, bool with_children); + void setFilter(int column,const std::list& strings) ; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; @@ -142,6 +146,7 @@ public: QVariant authorRole (const ForumModelPostEntry& fmpe, int col) const; QVariant sortRole (const ForumModelPostEntry& fmpe, int col) const; QVariant fontRole (const ForumModelPostEntry& fmpe, int col) const; + QVariant filterRole (const ForumModelPostEntry& fmpe, int col) const; QVariant textColorRole (const ForumModelPostEntry& fmpe, int col) const; QVariant backgroundRole(const ForumModelPostEntry& fmpe, int col) const; @@ -160,6 +165,7 @@ private: bool mUseChildTS; bool mFlatView; int mFilterColumn; + std::list mFilterStrings; void *getParentRef(void *ref,int& row) const; void *getChildRef(void *ref,int row) const; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index c2a12b426..329839131 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -100,12 +100,6 @@ class DistributionItemDelegate: public QStyledItemDelegate public: DistributionItemDelegate() {} - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override - { - const QRect r = option.rect; - return QSize(r.height(),r.height()); - } - virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if(!index.isValid()) @@ -130,11 +124,11 @@ public: switch(warning_level) { + default: + case 3: case 0: icon = QIcon(IMAGE_VOID); break; case 1: icon = QIcon(IMAGE_WARNING_YELLOW); break; case 2: icon = QIcon(IMAGE_WARNING_RED); break; - default: - case 3: icon = QIcon(IMAGE_WARNING_UNKNOWN); break; } QPixmap pix = icon.pixmap(r.size()); @@ -225,7 +219,7 @@ public: QPixmap pix = icon.pixmap(r.size()); - return QSize(pix.width() + fm.width(str),std::max(1.1*pix.height(),1.4*fm.height())); + return QSize(1.2*(pix.width() + fm.width(str)),std::max(1.1*pix.height(),1.4*fm.height())); } virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex& index) const override @@ -261,12 +255,17 @@ public: else icon = *icons.begin(); - QPixmap pix = icon.pixmap(r.size()); + if(index.data(RsGxsForumModel::MissingRole).toBool()) + painter->drawText(r.topLeft() + QPoint(f/2.0,f*1.0), tr("[None]")); + else + { + QPixmap pix = icon.pixmap(r.size()); + const QPoint p = QPoint(pix.width()/2.0, (r.height() - pix.height())/2); - // draw pixmap at center of item - const QPoint p = QPoint(pix.width()/2.0, (r.height() - pix.height())/2); - painter->drawPixmap(r.topLeft() + p, pix); - painter->drawText(r.topLeft() + p + QPoint(pix.width()+f/2.0,f*0.8), str); + // draw pixmap at center of item + painter->drawPixmap(r.topLeft() + p, pix); + painter->drawText(r.topLeft() + p + QPoint(pix.width()+f/2.0,f*1.0), str); + } } }; @@ -375,6 +374,9 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadProxyModel->setSortRole(RsGxsForumModel::SortRole); ui->threadTreeWidget->setModel(mThreadProxyModel); + mThreadProxyModel->setFilterRole(RsGxsForumModel::FilterRole); + mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ; + ui->threadTreeWidget->setSortingEnabled(true); //ui->threadTreeWidget->setDynamicSortFilter(true);// is that useful?? @@ -419,14 +421,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget itemDelegate->setOnlyPlainText(true); ui->threadTreeWidget->setItemDelegate(itemDelegate); - float f = QFontMetricsF(font()).height()/14.0f ; - - QHeaderView * ttheader = ui->threadTreeWidget->header () ; - ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DATE, 140*f); - ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_TITLE, 440*f); - ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, 24*f); - ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_AUTHOR, 150*f); - #ifdef SUSPENDED_CODE /* Set text of column "Read" to empty - without this the column has a number as header text */ QTreeWidgetItem *headerItem = ui->threadTreeWidget->headerItem(); @@ -449,16 +443,25 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget // load settings processSettings(true); + float f = QFontMetricsF(font()).height()/14.0f ; + /* Set header resize modes and initial section sizes */ + + QHeaderView * ttheader = ui->threadTreeWidget->header () ; + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DATE, 140*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_TITLE, 440*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, 24*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_AUTHOR, 150*f); + ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_READ, 24*f); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_TITLE, QHeaderView::Interactive); - QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DATE, QHeaderView::Interactive); - QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents); QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_AUTHOR, QHeaderView::Interactive); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); + QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::Fixed); ui->threadTreeWidget->header()->setCascadingSectionResizes(true); /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ - ttheader->resizeSection (RsGxsForumModel::COLUMN_THREAD_READ, 24*f); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_CONTENT); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_MSGID); ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_DATA); @@ -2685,14 +2688,24 @@ void GxsForumThreadWidget::filterColumnChanged(int column) void GxsForumThreadWidget::filterItems(const QString& text) { -#ifdef TODO + //FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL; + QStringList lst = text.split(" ",QString::SkipEmptyParts) ; + std::list keywords ; + + for(auto it(lst.begin());it!=lst.end();++it) + keywords.push_back((*it).toStdString()); + int filterColumn = ui->filterLineEdit->currentFilter(); - int count = ui->threadTreeWidget->topLevelItemCount(); - for (int index = 0; index < count; ++index) { - filterItem(ui->threadTreeWidget->topLevelItem(index), text, filterColumn); - } -#endif + mThreadModel->setFilter(filterColumn,keywords) ; + + //if(found > 0) + // expandAll(); + + //if(found == 0) + // ui.filterLineEdit->setToolTip(tr("No result.")) ; + //else + // ui.filterLineEdit->setToolTip(tr("Found %1 results.").arg(found)) ; } bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn) From 917695e83268872b93ebd987d8dcd89e8837a53c Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 1 Dec 2018 23:14:08 +0100 Subject: [PATCH 070/110] fixed filtering of messages in new forum Model --- .../src/gui/gxsforums/GxsForumModel.cpp | 105 +++++++++++++----- .../src/gui/gxsforums/GxsForumModel.h | 20 ++-- .../gui/gxsforums/GxsForumThreadWidget.cpp | 38 +++---- 3 files changed, 103 insertions(+), 60 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 37d7ead53..3e72f3659 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -25,10 +25,9 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) { initEmptyHierarchy(mPosts); - - mFilterColumn=0; mUseChildTS=false; mFlatView=false; + mFilteringEnabled=false; } void RsGxsForumModel::initEmptyHierarchy(std::vector& posts) @@ -343,38 +342,84 @@ QVariant RsGxsForumModel::statusRole(const ForumModelPostEntry& fmpe,int column) QVariant RsGxsForumModel::filterRole(const ForumModelPostEntry& fmpe,int column) const { - if(mFilterColumn < 0) - return QVariant(QString()); - - switch(mFilterColumn) - { - case COLUMN_THREAD_TITLE: - { - for(auto iter(mFilterStrings.begin()); iter != mFilterStrings.end(); ++iter) - if(fmpe.mTitle.end() != std::search( fmpe.mTitle.begin(), fmpe.mTitle.end(), (*iter).begin(), (*iter).end(), RsRegularExpression::CompareCharIC() )) - return QVariant(FilterString); - - return QVariant(QString()); - } - - default: + if(!mFilteringEnabled || (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_CHILDREN_PASSES_FILTER)) return QVariant(FilterString); - } + + return QVariant(QString()); } -void RsGxsForumModel::setFilter(int column,const std::list& strings) +uint32_t RsGxsForumModel::recursUpdateFilterStatus(ForumModelIndex i,int column,const QStringList& strings) { - mFilterColumn = column; - mFilterStrings = strings; + QString s ; + uint32_t count = 0; - emit layoutAboutToBeChanged(); - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - emit layoutChanged(); + switch(column) + { + default: + case COLUMN_THREAD_DATE: + case COLUMN_THREAD_TITLE: s = displayRole(mPosts[i],column).toString(); + break; + case COLUMN_THREAD_AUTHOR: + { + QString comment ; + QList icons; + + GxsIdDetails::MakeIdDesc(mPosts[i].mAuthorId, false,s, icons, comment,GxsIdDetails::ICON_TYPE_NONE); + } + break; + } + + if(!strings.empty()) + { + mPosts[i].mPostFlags &= ~(ForumModelPostEntry::FLAG_POST_PASSES_FILTER | ForumModelPostEntry::FLAG_POST_CHILDREN_PASSES_FILTER); + + for(auto iter(strings.begin()); iter != strings.end(); ++iter) + if(s.contains(*iter,Qt::CaseInsensitive)) + { + mPosts[i].mPostFlags |= ForumModelPostEntry::FLAG_POST_PASSES_FILTER | ForumModelPostEntry::FLAG_POST_CHILDREN_PASSES_FILTER; + + count++; + break; + } + } + else + { + mPosts[i].mPostFlags |= ForumModelPostEntry::FLAG_POST_PASSES_FILTER |ForumModelPostEntry::FLAG_POST_CHILDREN_PASSES_FILTER; + count++; + } + + for(uint32_t j=0;j 0) + mPosts[i].mPostFlags |= ForumModelPostEntry::FLAG_POST_CHILDREN_PASSES_FILTER; + } + + return count; +} + + +void RsGxsForumModel::setFilter(int column,const QStringList& strings,uint32_t& count) +{ + emit layoutAboutToBeChanged(); + + if(!strings.empty()) + { + count = recursUpdateFilterStatus(ForumModelIndex(0),column,strings); + mFilteringEnabled = true; + } + else + mFilteringEnabled = false; + + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutChanged(); } QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column) const { -// if(column != COLUMN_THREAD_DATA) + // if(column != COLUMN_THREAD_DATA) // return QVariant(); if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING) @@ -433,6 +478,9 @@ QVariant RsGxsForumModel::backgroundRole(const ForumModelPostEntry& fmpe,int col if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) return QVariant(QBrush(QColor(255,200,180))); + if(mFilteringEnabled && (fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_PASSES_FILTER)) + return QVariant(QBrush(QColor(255,240,210))); + return QVariant(); } @@ -568,6 +616,7 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& strings) ; + void setFilter(int column, const QStringList &strings, uint32_t &count) ; int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; @@ -164,8 +166,7 @@ private: bool mUseChildTS; bool mFlatView; - int mFilterColumn; - std::list mFilterStrings; + bool mFilteringEnabled; void *getParentRef(void *ref,int& row) const; void *getChildRef(void *ref,int row) const; @@ -179,10 +180,11 @@ private: void setForumMessageSummary(const std::vector& messages); void recursUpdateReadStatus(ForumModelIndex i,bool& has_unread_below,bool& has_read_below); void recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children); + uint32_t recursUpdateFilterStatus(ForumModelIndex i,int column,const QStringList& strings); static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); - static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsGxsForumMsg& msg, bool useChildTS, uint32_t filterColumn, ForumModelPostEntry& fentry); + static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsGxsForumMsg& msg, bool useChildTS, ForumModelPostEntry& fentry); void computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector& msgs_array, std::vector& posts, std::map > > &mPostVersions); void setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 329839131..60d0e7c15 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -25,6 +25,7 @@ #include #include "util/qtthreadsutils.h" +#include "util/misc.h" #include "GxsForumThreadWidget.h" #include "ui_GxsForumThreadWidget.h" #include "GxsForumsFillThread.h" @@ -359,7 +360,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mSubscribeFlags = 0; mSignFlags = 0; - mInProcessSettings = false; mUnreadCount = 0; mNewCount = 0; @@ -434,7 +434,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->filterLineEdit->addFilter(QIcon(), tr("Title"), RsGxsForumModel::COLUMN_THREAD_TITLE, tr("Search Title")); ui->filterLineEdit->addFilter(QIcon(), tr("Date"), RsGxsForumModel::COLUMN_THREAD_DATE, tr("Search Date")); ui->filterLineEdit->addFilter(QIcon(), tr("Author"), RsGxsForumModel::COLUMN_THREAD_AUTHOR, tr("Search Author")); - ui->filterLineEdit->addFilter(QIcon(), tr("Content"), RsGxsForumModel::COLUMN_THREAD_CONTENT, tr("Search Content")); + //ui->filterLineEdit->addFilter(QIcon(), tr("Content"), RsGxsForumModel::COLUMN_THREAD_CONTENT, tr("Search Content")); // see processSettings //ui->filterLineEdit->setCurrentFilter(COLUMN_THREAD_TITLE); @@ -539,8 +539,6 @@ GxsForumThreadWidget::~GxsForumThreadWidget() void GxsForumThreadWidget::processSettings(bool load) { - mInProcessSettings = true; - QHeaderView *header = ui->threadTreeWidget->header(); Settings->beginGroup(QString("ForumThreadWidget")); @@ -575,7 +573,6 @@ void GxsForumThreadWidget::processSettings(bool load) } Settings->endGroup(); - mInProcessSettings = false; } void GxsForumThreadWidget::groupIdChanged() @@ -2671,16 +2668,13 @@ void GxsForumThreadWidget::changedViewBox() void GxsForumThreadWidget::filterColumnChanged(int column) { - if (mInProcessSettings) { - return; - } - +#ifdef TO_REMOVE if (column == RsGxsForumModel::COLUMN_THREAD_CONTENT) { // need content ... refill //insertThreads(); } else { - filterItems(ui->filterLineEdit->text()); - } +#endif + filterItems(ui->filterLineEdit->text()); // save index Settings->setValueToGroup("ForumThreadWidget", "filterColumn", column); @@ -2688,24 +2682,22 @@ void GxsForumThreadWidget::filterColumnChanged(int column) void GxsForumThreadWidget::filterItems(const QString& text) { - //FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL; QStringList lst = text.split(" ",QString::SkipEmptyParts) ; - std::list keywords ; - - for(auto it(lst.begin());it!=lst.end();++it) - keywords.push_back((*it).toStdString()); int filterColumn = ui->filterLineEdit->currentFilter(); - mThreadModel->setFilter(filterColumn,keywords) ; + uint32_t count; + mThreadModel->setFilter(filterColumn,lst,count) ; - //if(found > 0) - // expandAll(); + if(!lst.empty()) + ui->threadTreeWidget->expandAll(); + else + ui->threadTreeWidget->collapseAll(); - //if(found == 0) - // ui.filterLineEdit->setToolTip(tr("No result.")) ; - //else - // ui.filterLineEdit->setToolTip(tr("Found %1 results.").arg(found)) ; + if(count > 0) + ui->filterLineEdit->setToolTip(tr("No result.")) ; + else + ui->filterLineEdit->setToolTip(tr("Found %1 results.").arg(count)) ; } bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn) From 1fced4a1c3450bfb021a366ba20a520dcae756a0 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 12:02:25 +0100 Subject: [PATCH 071/110] added flat mode to ForumModel --- .../src/gui/gxsforums/GxsForumModel.cpp | 50 +++++++++++++++++-- .../src/gui/gxsforums/GxsForumModel.h | 7 ++- .../gui/gxsforums/GxsForumThreadWidget.cpp | 21 ++++---- 3 files changed, 61 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 3e72f3659..abf2a15f2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -26,15 +26,32 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) initEmptyHierarchy(mPosts); mUseChildTS=false; - mFlatView=false; mFilteringEnabled=false; } +void RsGxsForumModel::setTreeMode(TreeMode mode) +{ + if(mode == mTreeMode) + return; + + emit layoutAboutToBeChanged(); + + mTreeMode = mode; + + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutChanged(); +} + void RsGxsForumModel::initEmptyHierarchy(std::vector& posts) { + emit layoutAboutToBeChanged(); + posts.resize(1); // adds a sentinel item posts[0].mTitle = "Root sentinel post" ; posts[0].mParent = 0; + + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutChanged(); } int RsGxsForumModel::rowCount(const QModelIndex& parent) const @@ -88,6 +105,9 @@ bool RsGxsForumModel::hasChildren(const QModelIndex &parent) const if(!parent.isValid()) return true; + if(mTreeMode == TREE_MODE_FLAT) + return false; + void *ref = parent.internalPointer(); uint32_t entry = 0; @@ -151,6 +171,9 @@ QModelIndex RsGxsForumModel::parent(const QModelIndex& index) const if(!index.isValid()) return QModelIndex(); + if(mTreeMode == TREE_MODE_FLAT) + return QModelIndex(); + void *child_ref = index.internalPointer(); int row=0; @@ -178,6 +201,16 @@ void *RsGxsForumModel::getChildRef(void *ref,int row) const return NULL ; void *new_ref; + + if(mTreeMode == TREE_MODE_FLAT) + if(entry == 0) + { + convertTabEntryToRefPointer(row+1,new_ref); + return new_ref; + } + else + return NULL ; + if(row >= mPosts[entry].mChildren.size()) return NULL; @@ -190,6 +223,9 @@ void *RsGxsForumModel::getParentRef(void *ref,int& row) const { ForumModelIndex ref_entry; + if(mTreeMode == TREE_MODE_FLAT) + return NULL; + if(!convertRefPointerToTabEntry(ref,ref_entry) || ref_entry >= mPosts.size()) return NULL ; @@ -217,7 +253,13 @@ int RsGxsForumModel::getChildrenCount(void *ref) const if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) return 0 ; - return mPosts[entry].mChildren.size(); + if(mTreeMode == TREE_MODE_FLAT) + if(entry == 0) + return ((int)mPosts.size())-1; + else + return 0; + else + return mPosts[entry].mChildren.size(); } QVariant RsGxsForumModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -941,7 +983,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) { - if(mFlatView || msgIt->second.mMeta.mParentId.isNull()) + if(msgIt->second.mMeta.mParentId.isNull()) { /* add all threads */ @@ -956,7 +998,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou ForumModelIndex entry_index = addEntry(posts,entry,0); - if (!mFlatView) + //if (!mFlatView) threadStack.push_back(std::make_pair(msg.mMeta.mMsgId,entry_index)) ; //calculateExpand(msg, item); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 539f1a400..60e38fa9b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -83,6 +83,10 @@ public: FilterRole = Qt::UserRole+6, }; + enum TreeMode{ TREE_MODE_FLAT = 0x00, + TREE_MODE_TREE = 0x01, + }; + QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;} QModelIndex getIndexOfMessage(const RsGxsMessageId& mid) const; @@ -114,6 +118,7 @@ public: // This method will asynchroneously update the data void setForum(const RsGxsGroupId& forumGroup); + void setTreeMode(TreeMode mode) ; void setTextColorRead (QColor color) { mTextColorRead = color;} void setTextColorUnread (QColor color) { mTextColorUnread = color;} @@ -165,8 +170,8 @@ private: RsGxsForumGroup mForumGroup; bool mUseChildTS; - bool mFlatView; bool mFilteringEnabled; + TreeMode mTreeMode; void *getParentRef(void *ref,int& row) const; void *getChildRef(void *ref,int row) const; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 60d0e7c15..0258cf29b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -365,9 +365,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mInMsgAsReadUnread = false; - //mThreadCompareRole = new RSTreeWidgetItemCompareRole; - //mThreadCompareRole->setRole(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT); - mThreadModel = new RsGxsForumModel(this); mThreadProxyModel = new ForumPostSortFilterProxyModel(ui->threadTreeWidget->header(),this); mThreadProxyModel->setSourceModel(mThreadModel); @@ -400,7 +397,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->newmessageButton->setText(tr("Reply")); ui->newthreadButton->setText(tr("New thread")); - //connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(changedThread(QModelIndex))); connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedThread(QModelIndex))); connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox())); @@ -2652,18 +2648,19 @@ void GxsForumThreadWidget::saveImage() void GxsForumThreadWidget::changedViewBox() { -#ifdef TODO - if (mInProcessSettings) { - return; - } - // save index Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex()); - ui->threadTreeWidget->clear(); + switch(ui->viewBox->currentIndex()) + { + default: + case VIEW_THREADED: + case VIEW_LAST_POST: mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE); + break; - insertThreads(); -#endif + case VIEW_FLAT: mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT); + break; + } } void GxsForumThreadWidget::filterColumnChanged(int column) From 37f721f305ffe1356ddf0497c08e785729f8be10 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 16:07:28 +0100 Subject: [PATCH 072/110] added reset to avoid crash when switching from flat to tree views --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 0258cf29b..817dccdf7 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -2648,6 +2648,10 @@ void GxsForumThreadWidget::saveImage() void GxsForumThreadWidget::changedViewBox() { + ui->threadTreeWidget->selectionModel()->clear(); + ui->threadTreeWidget->selectionModel()->reset(); + mThreadId.clear(); + // save index Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex()); From 91321725e666d2bb4cbb4fc6e631713cda6b0550 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 16:34:43 +0100 Subject: [PATCH 073/110] added sorting based on most recent TS from children --- .../src/gui/gxsforums/GxsForumModel.cpp | 31 ++++++++++++++++--- .../src/gui/gxsforums/GxsForumModel.h | 13 ++++++-- .../gui/gxsforums/GxsForumThreadWidget.cpp | 17 +++++----- 3 files changed, 44 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index abf2a15f2..adadbf5bf 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -42,6 +42,16 @@ void RsGxsForumModel::setTreeMode(TreeMode mode) emit layoutChanged(); } +void RsGxsForumModel::setSortMode(SortMode mode) +{ + emit layoutAboutToBeChanged(); + + mSortMode = mode; + + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutChanged(); +} + void RsGxsForumModel::initEmptyHierarchy(std::vector& posts) { emit layoutAboutToBeChanged(); @@ -552,7 +562,11 @@ QVariant RsGxsForumModel::sortRole(const ForumModelPostEntry& fmpe,int column) c { switch(column) { - case COLUMN_THREAD_DATE: return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here + case COLUMN_THREAD_DATE: if(mSortMode == SORT_MODE_PUBLISH_TS) + return QVariant(QString::number(fmpe.mPublishTs)); // we should probably have leading zeroes here + else + return QVariant(QString::number(fmpe.mMostRecentTsInThread)); // we should probably have leading zeroes here + case COLUMN_THREAD_READ: return QVariant((bool)IS_MSG_UNREAD(fmpe.mMsgStatus)); case COLUMN_THREAD_DISTRIBUTION: return decorationRole(fmpe,column); case COLUMN_THREAD_AUTHOR: @@ -657,8 +671,10 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& messages); - void recursUpdateReadStatus(ForumModelIndex i,bool& has_unread_below,bool& has_read_below); - void recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children); + void recursUpdateReadStatusAndTimes(ForumModelIndex i,bool& has_unread_below,bool& has_read_below); uint32_t recursUpdateFilterStatus(ForumModelIndex i,int column,const QStringList& strings); + void recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children); static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 817dccdf7..dae56098f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -2655,16 +2655,15 @@ void GxsForumThreadWidget::changedViewBox() // save index Settings->setValueToGroup("ForumThreadWidget", "viewBox", ui->viewBox->currentIndex()); - switch(ui->viewBox->currentIndex()) - { - default: - case VIEW_THREADED: - case VIEW_LAST_POST: mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE); - break; + if(ui->viewBox->currentIndex() == VIEW_FLAT) + mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT); + else + mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_TREE); - case VIEW_FLAT: mThreadModel->setTreeMode(RsGxsForumModel::TREE_MODE_FLAT); - break; - } + if(ui->viewBox->currentIndex() == VIEW_LAST_POST) + mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_CHILDREN_PUBLISH_TS); + else + mThreadModel->setSortMode(RsGxsForumModel::SORT_MODE_PUBLISH_TS); } void GxsForumThreadWidget::filterColumnChanged(int column) From 73c06006dae4979f74ef2a66b43a5c0eed8df348 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 16:39:33 +0100 Subject: [PATCH 074/110] removed old code --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 1477 ----------------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 33 - .../src/gui/gxsforums/GxsForumsFillThread.cpp | 558 ------- .../src/gui/gxsforums/GxsForumsFillThread.h | 74 - retroshare-gui/src/retroshare-gui.pro | 2 - 5 files changed, 2144 deletions(-) delete mode 100644 retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp delete mode 100644 retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index dae56098f..a83d3d590 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -317,47 +317,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget { ui->setupUi(this); -#ifdef TO_REMOVE - mTokenTypeGroupData = nextTokenType(); - mTokenTypeInsertThreads = nextTokenType(); - mTokenTypeMessageData = nextTokenType(); - mTokenTypeReplyMessage = nextTokenType(); - mTokenTypeReplyForumMessage = nextTokenType(); - mTokenTypeShowAuthorInPeople = nextTokenType(); - mTokenTypeNegativeAuthor = nextTokenType(); - mTokenTypeNeutralAuthor = nextTokenType(); - mTokenTypePositiveAuthor = nextTokenType(); - mTokenTypeEditForumMessage = nextTokenType(); -#endif - setUpdateWhenInvisible(true); -#ifdef TO_REMOVE - /* Setup UI helper */ - mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton); - mStateHelper->addWidget(mTokenTypeGroupData, ui->newthreadButton); - - mStateHelper->addClear(mTokenTypeGroupData, ui->forumName); - - mStateHelper->addWidget(mTokenTypeInsertThreads, ui->progressBar, UISTATE_LOADING_VISIBLE); - mStateHelper->addWidget(mTokenTypeInsertThreads, ui->progressText, UISTATE_LOADING_VISIBLE); - mStateHelper->addWidget(mTokenTypeInsertThreads, ui->threadTreeWidget, UISTATE_ACTIVE_ENABLED); - mStateHelper->addLoadPlaceholder(mTokenTypeInsertThreads, ui->progressText); - mStateHelper->addWidget(mTokenTypeInsertThreads, ui->nextUnreadButton); - mStateHelper->addWidget(mTokenTypeInsertThreads, ui->previousButton); - mStateHelper->addWidget(mTokenTypeInsertThreads, ui->nextButton); -#ifdef SUSPENDED_CODE - mStateHelper->addClear(mTokenTypeInsertThreads, ui->threadTreeWidget); -#endif - - mStateHelper->addWidget(mTokenTypeMessageData, ui->newmessageButton); -// mStateHelper->addWidget(mTokenTypeMessageData, ui->postText); - mStateHelper->addWidget(mTokenTypeMessageData, ui->downloadButton); - - mStateHelper->addLoadPlaceholder(mTokenTypeMessageData, ui->postText); - //mStateHelper->addLoadPlaceholder(mTokenTypeMessageData, ui->threadTitle); -#endif - mSubscribeFlags = 0; mSignFlags = 0; mUnreadCount = 0; @@ -518,15 +479,6 @@ void GxsForumThreadWidget::blank() GxsForumThreadWidget::~GxsForumThreadWidget() { -#ifdef TO_REMOVE - if (mFillThread) { - mFillThread->stop(); - delete(mFillThread); - mFillThread = NULL; - } - delete(mThreadCompareRole); -#endif - // save settings processSettings(false); @@ -595,12 +547,6 @@ QString GxsForumThreadWidget::groupName(bool withUnreadCount) QIcon GxsForumThreadWidget::groupIcon() { -#ifdef TO_REMOVE - if (mStateHelper->isLoading(mTokenTypeGroupData) || mFillThread) { - return QIcon(":/images/kalarm.png"); - } -#endif - if (mNewCount) { return QIcon(":/images/message-state-new.png"); } @@ -933,11 +879,6 @@ void GxsForumThreadWidget::changedVersion() { mThreadId = RsGxsMessageId(ui->versions_CB->itemData(ui->versions_CB->currentIndex()).toString().toStdString()) ; -#ifdef TO_REMOVE - if (mFillThread) { - return; - } -#endif ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); } @@ -991,140 +932,6 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) changedThread(index); } -#ifdef TO_REMOVE -void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item, bool &hasReadChilddren, bool &hasUnreadChilddren) -{ - uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - - bool isNew = IS_MSG_NEW(status); - bool unread = IS_MSG_UNREAD(status); - bool missing = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool(); - RsGxsMessageId msgId(item->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::UserRole).toString().toStdString()); - - // set icon - if (missing) { - item->setIcon(RsGxsForumModel::COLUMN_THREAD_READ, QIcon()); - item->setIcon(RsGxsForumModel::COLUMN_THREAD_TITLE, QIcon()); - } else { - if (unread) { - item->setIcon(RsGxsForumModel::COLUMN_THREAD_READ, QIcon(":/images/message-state-unread.png")); - } else { - item->setIcon(RsGxsForumModel::COLUMN_THREAD_READ, QIcon(":/images/message-state-read.png")); - } - if (isNew) { - item->setIcon(RsGxsForumModel::COLUMN_THREAD_TITLE, QIcon(":/images/message-state-new.png")); - } else { - item->setIcon(RsGxsForumModel::COLUMN_THREAD_TITLE, QIcon()); - } - } - - int index; - int itemCount = item->childCount(); - - bool myReadChilddren = false; - bool myUnreadChilddren = false; - - for (index = 0; index < itemCount; ++index) { - calculateIconsAndFonts(item->child(index), myReadChilddren, myUnreadChilddren); - } - - bool is_pinned = mForumGroup.mPinnedPosts.ids.find(msgId) != mForumGroup.mPinnedPosts.ids.end(); - - // set font - for (int i = 0; i < RsGxsForumModel::COLUMN_THREAD_NB_COLUMNS; ++i) { - QFont qf = item->font(i); - - if (!IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { - qf.setBold(false); - item->setForeground(i, textColorNotSubscribed()); - } else if (unread || isNew) { - qf.setBold(true); - item->setForeground(i, textColorUnread()); - } else if (myUnreadChilddren) { - qf.setBold(true); - item->setForeground(i, textColorUnreadChildren()); - } else { - qf.setBold(false); - item->setForeground(i, textColorRead()); - } - if (missing) { - /* Missing message */ - item->setForeground(i, textColorMissing()); - } - if(is_pinned) - { - qf.setBold(true); - item->setForeground(i, textColorUnread()); - item->setData(i,Qt::BackgroundRole, QBrush(QColor(255,200,180))) ; - } - else - item->setData(i,Qt::BackgroundRole, QBrush()); - - item->setFont(i, qf); - } - - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_READCHILDREN, hasReadChilddren || myReadChilddren); - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN, hasUnreadChilddren || myUnreadChilddren); - - hasReadChilddren = hasReadChilddren || myReadChilddren || !unread; - hasUnreadChilddren = hasUnreadChilddren || myUnreadChilddren || unread; -} - -void GxsForumThreadWidget::calculateUnreadCount() -{ - unsigned int unreadCount = 0; - unsigned int newCount = 0; - - QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget); - QTreeWidgetItem *item = NULL; - while ((item = *itemIterator) != NULL) { - ++itemIterator; - - uint32_t status = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - if (IS_MSG_UNREAD(status)) { - ++unreadCount; - } - if (IS_MSG_NEW(status)) { - ++newCount; - } - } - - bool changed = false; - if (mUnreadCount != unreadCount) { - mUnreadCount = unreadCount; - changed = true; - } - if (mNewCount != newCount) { - mNewCount = newCount; - changed = true; - } - - if (changed) { - emit groupChanged(this); - } -} - -void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item /*= NULL*/) -{ - bool dummy1 = false; - bool dummy2 = false; - - if (item) { - calculateIconsAndFonts(item, dummy1, dummy2); - return; - } - - int index; - int itemCount = ui->threadTreeWidget->topLevelItemCount(); - - for (index = 0; index < itemCount; ++index) { - dummy1 = false; - dummy2 = false; - calculateIconsAndFonts(ui->threadTreeWidget->topLevelItem(index), dummy1, dummy2); - } -} -#endif - static void cleanupItems (QList &items) { QList::iterator item; @@ -1136,17 +943,6 @@ static void cleanupItems (QList &items) items.clear(); } -#ifdef TO_REMOVE -void GxsForumThreadWidget::insertGroupData() -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::insertGroupData" << std::endl; -#endif - //GxsIdDetails::process(mForumGroup.mMeta.mAuthorId, &loadAuthorIdCallback, this); - calculateIconsAndFonts(); -} -#endif - static QString getDurationString(uint32_t days) { switch(days) @@ -1163,699 +959,10 @@ static QString getDurationString(uint32_t days) } } -#ifdef TO_REMOVE -/*static*/ void GxsForumThreadWidget::loadAuthorIdCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &) -{ - GxsForumThreadWidget *tw = dynamic_cast(object); - if(!tw) - return; - - QString author; - switch (type) { - case GXS_ID_DETAILS_TYPE_EMPTY: - author = GxsIdDetails::getEmptyIdText(); - break; - case GXS_ID_DETAILS_TYPE_FAILED: - author = GxsIdDetails::getFailedText(details.mId); - break; - case GXS_ID_DETAILS_TYPE_LOADING: - author = GxsIdDetails::getLoadingText(details.mId); - break; - case GXS_ID_DETAILS_TYPE_BANNED: - author = tr("[Banned]") ; - break ; - case GXS_ID_DETAILS_TYPE_DONE: - author = GxsIdDetails::getName(details); - break; - } - - const RsGxsForumGroup& group = tw->mForumGroup; - - tw->mSubscribeFlags = group.mMeta.mSubscribeFlags; - tw->mSignFlags = group.mMeta.mSignFlags; - tw->ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str())); - - QString anti_spam_features1 ; - if(IS_GROUP_PGP_KNOWN_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous/unknown posts forwarded if reputation is positive"); - else if(IS_GROUP_PGP_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous posts forwarded if reputation is positive"); - - tw->mForumDescription = QString("%1: \t%2
").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str())); - tw->mForumDescription += QString("%1: %2
").arg(tr("Description"), - group.mDescription.empty()? - tr("[None]
") - :(QString::fromUtf8(group.mDescription.c_str())+"
")); - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Subscribers")).arg(group.mMeta.mPop); - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount); - if(group.mMeta.mLastPost==0) - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Last post")).arg(tr("Never")); - else - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Last post")).arg(DateTime::formatLongDateTime(group.mMeta.mLastPost)); - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Synchronization")).arg(getDurationString( rsGxsForums->getSyncPeriod(group.mMeta.mGroupId)/86400 )) ; - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Storage")).arg(getDurationString( rsGxsForums->getStoragePeriod(group.mMeta.mGroupId)/86400)); - - QString distrib_string = tr("[unknown]"); - switch(group.mMeta.mCircleType) - { - case GXS_CIRCLE_TYPE_PUBLIC: distrib_string = tr("Public") ; - break ; - case GXS_CIRCLE_TYPE_EXTERNAL: - { - RsGxsCircleDetails det ; - - // !! What we need here is some sort of CircleLabel, which loads the circle and updates the label when done. - - if(rsGxsCircles->getCircleDetails(group.mMeta.mCircleId,det)) - distrib_string = tr("Restricted to members of circle \"")+QString::fromUtf8(det.mCircleName.c_str()) +"\""; - else - distrib_string = tr("Restricted to members of circle ")+QString::fromStdString(group.mMeta.mCircleId.toStdString()) ; - } - break ; - case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY: - { - distrib_string = tr("Only friends nodes in group ") ; - - RsGroupInfo ginfo ; - rsPeers->getGroupInfo(RsNodeGroupId(group.mMeta.mInternalCircle),ginfo) ; - - QString desc; - GroupChooser::makeNodeGroupDesc(ginfo, desc); - distrib_string += desc ; - } - break ; - - case GXS_CIRCLE_TYPE_LOCAL: distrib_string = tr("Your eyes only"); // this is not yet supported. If you see this, it is a bug! - break ; - default: - std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl; - } - - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Distribution"), distrib_string); - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Contact"), author); - - if(!anti_spam_features1.isNull()) - tw->mForumDescription += QString("%1: \t%2
").arg(tr("Anti-spam")).arg(anti_spam_features1); - - tw->ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(tw->mSubscribeFlags)); - tw->mStateHelper->setWidgetEnabled(tw->ui->newthreadButton, (IS_GROUP_SUBSCRIBED(tw->mSubscribeFlags))); - - if(!group.mAdminList.ids.empty()) - { - QString admin_list_str ; - - for(auto it(group.mAdminList.ids.begin());it!=group.mAdminList.ids.end();++it) - { - RsIdentityDetails det ; - - rsIdentity->getIdDetails(*it,det); - admin_list_str += (admin_list_str.isNull()?"":", ") + QString::fromUtf8(det.mNickname.c_str()) ; - } - - tw->mForumDescription += QString("%1: %2").arg(tr("Moderators"), admin_list_str); - } - - if (tw->mThreadId.isNull() && !tw->mStateHelper->isLoading(tw->mTokenTypeMessageData)) - tw->ui->postText->setText(tw->mForumDescription); -} - -void GxsForumThreadWidget::fillThreadFinished() -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreadFinished" << std::endl; -#endif - - // thread has finished - GxsForumsFillThread *thread = dynamic_cast(sender()); - if (thread) { - if (thread == mFillThread) { - // current thread has finished, hide progressbar and release thread - mFillThread = NULL; - - mStateHelper->setLoading(mTokenTypeInsertThreads, false); - emit groupChanged(this); - } - - if (thread->wasStopped()) { - // thread was stopped -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreadFinished Thread was stopped" << std::endl; -#endif - } else { -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreadFinished Add messages" << std::endl; -#endif - - mStateHelper->setActive(mTokenTypeInsertThreads, true); - ui->threadTreeWidget->setSortingEnabled(false); - - GxsIdDetails::enableProcess(false); - - /* add all messages in! */ - if (mLastViewType != thread->mViewType || mLastForumID != groupId()) { - ui->threadTreeWidget->clear(); - mLastViewType = thread->mViewType; - mLastForumID = groupId(); - ui->threadTreeWidget->insertTopLevelItems(0, thread->mItems); - mPostVersions = thread->mPostVersions; - - // clear list - thread->mItems.clear(); - } else { - mPostVersions = thread->mPostVersions; - fillThreads(thread->mItems, thread->mExpandNewMessages, thread->mItemToExpand); - - // cleanup list - cleanupItems(thread->mItems); - } - - /* Move value from ROLE_THREAD_AUTHOR to GxsIdRSTreeWidgetItem::setId */ - QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget); - QTreeWidgetItem *item = NULL; - while ((item = *itemIterator) != NULL) { - ++itemIterator; - - QString gxsId = item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR).toString(); - if (gxsId.isEmpty()) { - continue; - } - - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QVariant()); - - GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast(item); - if (gxsIdItem) { - gxsIdItem->setId(RsGxsId(gxsId.toStdString()), RsGxsForumModel::COLUMN_THREAD_AUTHOR, false); - } - } - - GxsIdDetails::enableProcess(true); - - ui->threadTreeWidget->setSortingEnabled(true); - - if (thread->mFocusMsgId.empty() == false) { - /* Search exisiting item */ - QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget); - QTreeWidgetItem *item = NULL; - while ((item = *itemIterator) != NULL) { - ++itemIterator; - - if (item->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString() == thread->mFocusMsgId) { - ui->threadTreeWidget->setCurrentItem(item); - ui->threadTreeWidget->setFocus(); - break; - } - } - } - - QList::iterator itemIt; - for (itemIt = thread->mItemToExpand.begin(); itemIt != thread->mItemToExpand.end(); ++itemIt) { - if ((*itemIt)->isHidden() == false) { - (*itemIt)->setExpanded(true); - } - } - thread->mItemToExpand.clear(); - - if (ui->filterLineEdit->text().isEmpty() == false) { - filterItems(ui->filterLineEdit->text()); - } - calculateIconsAndFonts(); - calculateUnreadCount(); - emit groupChanged(this); - - if (!mNavigatePendingMsgId.isNull()) { - navigate(mNavigatePendingMsgId); - mNavigatePendingMsgId.clear(); - } - } - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreadFinished Delete thread" << std::endl; -#endif - - thread->deleteLater(); - thread = NULL; - } - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreadFinished done" << std::endl; -#endif -} - -void GxsForumThreadWidget::fillThreadProgress(int current, int count) -{ - // show fill progress - if (count) { - int max = ui->progressBar->maximum(); - ui->progressBar->setValue(current * max / count); - } -} - -void GxsForumThreadWidget::fillThreadStatus(QString text) -{ - ui->progressText->setText(text); -} - -//#define DEBUG_PINNED_POST_SORTING 1 - -class ForumThreadItem: public GxsIdRSTreeWidgetItem -{ -public: - ForumThreadItem(QHeaderView *header,const RSTreeWidgetItemCompareRole *compareRole, uint32_t icon_mask,QTreeWidget *parent = NULL) - : GxsIdRSTreeWidgetItem(compareRole,icon_mask,parent), m_header(header) {} - - bool operator<(const QTreeWidgetItem& other) const - { - bool left_is_not_pinned = ! data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED).toBool(); - bool right_is_not_pinned = !other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED).toBool(); -#ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Comparing item date \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" - << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \"" - << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" - << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << right_is_not_pinned << ") "; -#endif - - if(left_is_not_pinned ^ right_is_not_pinned) - { -#ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Local: " << ((m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned) << std::endl; -#endif - return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top - } - -#ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Remote: " << GxsIdRSTreeWidgetItem::operator<(other) << std::endl; -#endif - return GxsIdRSTreeWidgetItem::operator<(other); - } - -private: - QHeaderView *m_header ; -}; - -QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForumMsg &msg, bool useChildTS, uint32_t filterColumn, QTreeWidgetItem *parent) -{ - // Early check for a message that should be hidden because its author - // is flagged with a bad reputation - - bool is_pinned = mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end(); - - uint32_t idflags =0; - RsReputations::ReputationLevel reputation_level = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId,&idflags) ; - bool redacted = false; - - redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE); - - // We use a specific item model for forums in order to handle the post pinning. - - GxsIdRSTreeWidgetItem *item = new ForumThreadItem(ui->threadTreeWidget->header(),mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR ); - item->moveToThread(ui->threadTreeWidget->thread()); - - if(redacted) - item->setText(RsGxsForumModel::COLUMN_THREAD_TITLE, tr("[ ... Redacted message ... ]")); - else if(is_pinned) - item->setText(RsGxsForumModel::COLUMN_THREAD_TITLE, tr("[PINNED] ") + QString::fromUtf8(msg.mMeta.mMsgName.c_str())); - else - item->setText(RsGxsForumModel::COLUMN_THREAD_TITLE, QString::fromUtf8(msg.mMeta.mMsgName.c_str())); - - QString rep_tooltip_str ; - uint32_t rep_warning_level ; - - if(reputation_level == RsReputations::REPUTATION_UNKNOWN) - { - rep_warning_level = 3 ; - rep_tooltip_str = tr("Information for this identity is currently missing.") ; - } - else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) - { - rep_warning_level = 2 ; - rep_tooltip_str = tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.") ; - } - else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(mForumGroup.mMeta.mSignFlags,idflags)) - { - rep_warning_level = 1 ; - rep_tooltip_str = tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.") ; - } - else - { - rep_warning_level = 0 ; - rep_tooltip_str = tr("Message will be forwarded to your friends.") ; - } - - item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole,rep_tooltip_str) ; - item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,rep_warning_level) ; - - //msg.mMeta.mChildTs Was not updated when received new child - // so do it here. - QDateTime qtime; - qtime.setTime_t(msg.mMeta.mPublishTs); - - QString itemText = DateTime::formatDateTime(qtime); - // This is an attempt to put pinned posts on the top. We should rather use a QSortFilterProxyModel here. - QString itemSort = QString::number(msg.mMeta.mPublishTs);//Don't need to format it as for sort. - -//#define SHOW_COMBINED_DATES 1 - - if (useChildTS) - { - for(QTreeWidgetItem *grandParent = parent; grandParent!=NULL; grandParent = grandParent->parent()) - { - //Update Parent Child TimeStamp - QString oldTSSort = grandParent->data(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); - - QString oldCTSSort = oldTSSort.split("|").at(0); - QString oldPTSSort = oldTSSort.contains("|") ? oldTSSort.split(" | ").at(1) : oldCTSSort; -#ifdef SHOW_COMBINED_DATES - QString oldTSText = grandParent->text(RsGxsForumModel::COLUMN_THREAD_DATE); - QString oldCTSText = oldTSText.split("|").at(0); - QString oldPTSText = oldTSText.contains("|") ? oldTSText.split(" | ").at(1) : oldCTSText;//If first time parent get only its mPublishTs - #endif - if (oldCTSSort.toDouble() < itemSort.toDouble()) - { -#ifdef SHOW_COMBINED_DATES - grandParent->setText(RsGxsForumModel::COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); -#endif - grandParent->setData(RsGxsForumModel::COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); - } - } - } - - item->setText(RsGxsForumModel::COLUMN_THREAD_DATE, itemText); - item->setData(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT, itemSort); - - if(is_pinned) - item->setData(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED, QVariant(true)); // this is used by the sorting model to put all posts on top - else - item->setData(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_PINNED, QVariant(false)); - - // Set later with GxsIdRSTreeWidgetItem::setId -#ifdef TODO - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QString::fromStdString(msg.mMeta.mAuthorId.toStdString())); -#endif - -//#TODO -#if 0 - text = QString::fromUtf8(authorName.c_str()); - - if (text.isEmpty()) - { - item->setText(RsGxsForumModel::COLUMN_THREAD_AUTHOR, tr("Anonymous")); - } - else - { - item->setText(RsGxsForumModel::COLUMN_THREAD_AUTHOR, text); - } -#endif -//#TODO -#ifdef TOGXS - if (msgInfo.mMeta.mMsgFlags & RS_DISTRIB_AUTHEN_REQ) - { - item->setText(RsGxsForumModel::COLUMN_THREAD_SIGNED, tr("signed")); - item->setIcon(RsGxsForumModel::COLUMN_THREAD_SIGNED, QIcon(":/images/mail-signed.png")); - } - else - { - item->setText(RsGxsForumModel::COLUMN_THREAD_SIGNED, tr("none")); - item->setIcon(RsGxsForumModel::COLUMN_THREAD_SIGNED, QIcon(":/images/mail-signature-unknown.png")); - } -#endif - - if (filterColumn == RsGxsForumModel::COLUMN_THREAD_CONTENT) { - // need content for filter - QTextDocument doc; - doc.setHtml(QString::fromUtf8(msg.mMsg.c_str())); - item->setText(RsGxsForumModel::COLUMN_THREAD_CONTENT, doc.toPlainText().replace(QString("\n"), QString(" "))); - } - - item->setData(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::UserRole, QString::fromStdString(msg.mMeta.mMsgId.toStdString())); -//#TODO -#if 0 - if (IS_GROUP_SUBSCRIBED(subscribeFlags) && !(msginfo.mMsgFlags & RS_DISTRIB_MISSING_MSG)) { - rsGxsForums->getMessageStatus(msginfo.forumId, msginfo.msgId, status); - } else { - // show message as read - status = RSGXS_MSG_STATUS_READ; - } - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS, msg.mMeta.mMsgStatus); - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_MISSING, false); -#endif - - if (parent) parent->addChild(item); - return item; -} - -void GxsForumThreadWidget::insertThreads() -{ -#ifdef DEBUG_FORUMS - /* get the current Forum */ - std::cerr << "GxsForumThreadWidget::insertThreads()" << std::endl; -#endif - - mNavigatePendingMsgId.clear(); - ui->progressBar->reset(); - - if (mFillThread) { -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::insertThreads() stop current fill thread" << std::endl; -#endif - // stop current fill thread - GxsForumsFillThread *thread = mFillThread; - mFillThread = NULL; - thread->stop(); - - mStateHelper->setLoading(mTokenTypeInsertThreads, false); - } - - if (groupId().isNull()) - { - /* not an actual forum - clear */ - mStateHelper->setActive(mTokenTypeInsertThreads, false); - mStateHelper->clear(mTokenTypeInsertThreads); - - /* clear last stored forumID */ - mLastForumID.clear(); - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::insertThreads() Current Thread Invalid" << std::endl; -#endif - - return; - } - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::insertThreads() Start filling Forum threads" << std::endl; -#endif - - mStateHelper->setLoading(mTokenTypeInsertThreads, true); - - // create fill thread - mFillThread = new GxsForumsFillThread(this); - - // set data - mFillThread->mCompareRole = mThreadCompareRole; - mFillThread->mForumId = groupId(); - mFillThread->mFilterColumn = ui->filterLineEdit->currentFilter(); - mFillThread->mExpandNewMessages = Settings->getForumExpandNewMessages(); - mFillThread->mViewType = ui->viewBox->currentIndex(); - if (mLastViewType != mFillThread->mViewType || mLastForumID != groupId()) { - mFillThread->mFillComplete = true; - } - - mFillThread->mFlatView = false; - mFillThread->mUseChildTS = false; - - switch (mFillThread->mViewType) { - case VIEW_LAST_POST: - mFillThread->mUseChildTS = true; - break; - case VIEW_FLAT: - mFillThread->mFlatView = true; - break; - case VIEW_THREADED: - break; - } - - ui->threadTreeWidget->setRootIsDecorated(!mFillThread->mFlatView); - - // connect thread - // connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection); - // connect(mFillThread, SIGNAL(status(QString)), this, SLOT(fillThreadStatus(QString))); - // connect(mFillThread, SIGNAL(progress(int,int)), this, SLOT(fillThreadProgress(int,int))); - -#ifdef DEBUG_FORUMS - std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl; -#endif - - // start thread - mFillThread->start(); - emit groupChanged(this); -} - -static void copyItem(QTreeWidgetItem *item, const QTreeWidgetItem *newItem) -{ - int i; - for (i = 0; i < RsGxsForumModel::COLUMN_THREAD_COUNT; ++i) { - if (i != RsGxsForumModel::COLUMN_THREAD_AUTHOR) { - /* Copy text */ - item->setText(i, newItem->text(i)); - } - } - for (i = 0; i < ROLE_THREAD_COUNT; ++i) { - item->setData(RsGxsForumModel::COLUMN_THREAD_DATA, Qt::UserRole + i, newItem->data(RsGxsForumModel::COLUMN_THREAD_DATA, Qt::UserRole + i)); - } - - item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,newItem->data(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole)); - item->setData(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole, newItem->data(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole )); - item->setData(RsGxsForumModel::COLUMN_THREAD_MSGID, Qt::DisplayRole, newItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID, Qt::DisplayRole )); -} - -void GxsForumThreadWidget::fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreads()" << std::endl; -#endif - - int index = 0; - QTreeWidgetItem *threadItem; - - // store new items in a map, so as to allow a fast search - - std::map newThreadMap ; - - for(QList::iterator newThread = threadList.begin (); newThread != threadList.end (); ++newThread) - newThreadMap[(*newThread)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = *newThread ; - - // delete not existing - while (index < ui->threadTreeWidget->topLevelItemCount()) - { - threadItem = ui->threadTreeWidget->topLevelItem(index); - - if(newThreadMap.find(threadItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) == newThreadMap.end()) - delete(ui->threadTreeWidget->takeTopLevelItem(index)); - else - ++index; - } - - //(csoler) QTreeWidget::findItems apparently does not always work so I need to make the search manually, which I do using a map for efficiency reasons. - std::map oldThreadMap; - for(int i=0; ithreadTreeWidget->topLevelItemCount(); ++i) - oldThreadMap[ui->threadTreeWidget->topLevelItem(i)->data(RsGxsForumModel::COLUMN_THREAD_MSGID, Qt::DisplayRole).toString()] = ui->threadTreeWidget->topLevelItem(i); - - // iterate all new threads - for (QList::iterator newThread = threadList.begin (); newThread != threadList.end (); ++newThread) { - // search existing thread -#ifdef DEBUG_FORUMS - std::cerr << "Makign a search for string \"" << (*newThread)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString() << "\"" << std::endl; -#endif - - std::map::const_iterator it = oldThreadMap.find((*newThread)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) ; - - if(it != oldThreadMap.end()) - { - threadItem = it->second ; - - // set child data - copyItem(threadItem, *newThread); - - // fill recursive - fillChildren(threadItem, *newThread, expandNewMessages, itemToExpand); - } - else - { - // add new thread - ui->threadTreeWidget->addTopLevelItem (*newThread); - threadItem = *newThread; - *newThread = NULL; - } - - uint32_t status = threadItem->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - if (expandNewMessages && IS_MSG_UNREAD(status)) { - QTreeWidgetItem *parentItem = threadItem; - while ((parentItem = parentItem->parent()) != NULL) { - if (std::find(itemToExpand.begin(), itemToExpand.end(), parentItem) == itemToExpand.end()) { - itemToExpand.push_back(parentItem); - } - } - } - } - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::fillThreads() done" << std::endl; -#endif -} -#endif - -#ifdef TO_REMOVE -void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand) -{ - int index = 0; - int newIndex; - int newCount = newParentItem->childCount(); - - QTreeWidgetItem *childItem; - QTreeWidgetItem *newChildItem; - - std::map newParentItemMap, parentItemMap ; - - for(index = 0; index < newParentItem->childCount(); ++index) newParentItemMap[newParentItem->child(index)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = newParentItem->child(index); - for(index = 0; index < parentItem->childCount(); ++index) parentItemMap[ parentItem->child(index)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()] = parentItem->child(index); - - // delete not existing - while (index < parentItem->childCount()) - { - childItem = parentItem->child(index); - - if(newParentItemMap.find(childItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) == newParentItemMap.end()) - delete(parentItem->takeChild (index)); - else - ++index; - } - - // iterate all new children - for (newIndex = 0; newIndex < newParentItem->childCount(); ++newIndex) - { - newChildItem = newParentItem->child(newIndex); - - // search existing child - - std::map::const_iterator it = parentItemMap.find(newChildItem->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString()) ; - - if(it != parentItemMap.end()) - { - // set child data - copyItem(it->second, newChildItem); - - // fill recursive - fillChildren(it->second, newChildItem, expandNewMessages, itemToExpand); - childItem = it->second; - } - else - { - // add new child - childItem = newParentItem->takeChild(newIndex); - parentItem->addChild(childItem); - newIndex--; - newCount--; - } - - uint32_t status = childItem->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - if (expandNewMessages && IS_MSG_UNREAD(status)) { - QTreeWidgetItem *parentItem = childItem; - while ((parentItem = parentItem->parent()) != NULL) { - if (std::find(itemToExpand.begin(), itemToExpand.end(), parentItem) == itemToExpand.end()) { - itemToExpand.push_back(parentItem); - } - } - } - } -} -#endif - void GxsForumThreadWidget::insertMessage() { if (groupId().isNull()) { -#ifdef SUSPENDED_CODE - mStateHelper->setActive(mTokenTypeMessageData, false); - mStateHelper->clear(mTokenTypeMessageData); -#endif ui->versions_CB->hide(); ui->time_label->show(); @@ -1865,11 +972,6 @@ void GxsForumThreadWidget::insertMessage() if (mThreadId.isNull()) { -#ifdef SUSPENDED_CODE - mStateHelper->setActive(mTokenTypeMessageData, false); - mStateHelper->clear(mTokenTypeMessageData); -#endif - ui->versions_CB->hide(); ui->time_label->show(); @@ -1877,10 +979,6 @@ void GxsForumThreadWidget::insertMessage() return; } -#ifdef SUSPENDED_CODE - mStateHelper->setActive(mTokenTypeMessageData, true); -#endif - QModelIndex index = getCurrentIndex(); if (index.isValid()) @@ -1972,10 +1070,6 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) std::cerr << "\t or CurrThdId: " << mThreadId << " != msg.MsgId: " << msg.mMeta.mMsgId; std::cerr << std::endl; std::cerr << std::endl; -#ifdef TO_REMOVE - mStateHelper->setActive(mTokenTypeMessageData, false); - mStateHelper->clear(mTokenTypeMessageData); -#endif return; } @@ -1983,13 +1077,6 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) uint32_t overall_reputation = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId) ; bool redacted = (overall_reputation == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ; -#ifdef TO_REMOVE - mStateHelper->setActive(mTokenTypeMessageData, true); - - //mThreadId = mOrigThreadId = RsGxsMessageId(mThreadModel->data(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID),Qt::DisplayRole).toString().toStdString()); - //QTreeWidgetItem *item = ui->threadTreeWidget->currentItem(); -#endif - bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); uint32_t status = msg.mMeta.mMsgStatus ;//item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); @@ -2123,106 +1210,6 @@ void GxsForumThreadWidget::nextUnreadMessage() changedThread(index); } -#ifdef TO_REMOVE -/* get selected messages - the messages tree is single selected, but who knows ... */ -int GxsForumThreadWidget::getSelectedMsgCount(QList *rows, QList *rowsRead, QList *rowsUnread) -{ - if (rowsRead) rowsRead->clear(); - if (rowsUnread) rowsUnread->clear(); - - QList selectedItems = ui->threadTreeWidget->selectedItems(); - for(QList::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it) { - if (rows) rows->append(*it); - if (rowsRead || rowsUnread) { - uint32_t status = (*it)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - if (IS_MSG_UNREAD(status)) { - if (rowsUnread) rowsUnread->append(*it); - } else { - if (rowsRead) rowsRead->append(*it); - } - } - } - - return selectedItems.size(); - return 0; -} - -void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool read) -{ - QList::iterator row; - std::list changedItems; - - mInMsgAsReadUnread = true; - - for (row = rows.begin(); row != rows.end(); ++row) { - if ((*row)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_MISSING).toBool()) { - /* Missing message */ - continue; - } - - uint32_t status = (*row)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - - uint32_t statusNew = (status & ~(GXS_SERV::GXS_MSG_STATUS_GUI_NEW | GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD)); // orig status, without NEW AND UNREAD - if (!read) { - statusNew |= GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; - } - - if (status != statusNew) // is it different? - { - std::string msgId = (*row)->data(RsGxsForumModel::COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString(); - - // NB: MUST BE PART OF ACTIVE THREAD--- OR ELSE WE MUST STORE GROUPID SOMEWHERE!. - // LIKE THIS BELOW... - //std::string grpId = (*Row)->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_GROUPID).toString().toStdString(); - - RsGxsGrpMsgIdPair msgPair = std::make_pair( groupId(), RsGxsMessageId(msgId) ); - - uint32_t token; - rsGxsForums->setMessageReadStatus(token, msgPair, read); - - // Look if older version exist to mark them too - QMap > >::const_iterator it = mPostVersions.find(RsGxsMessageId(msgId)) ; - if(it != mPostVersions.end()) - { - std::cerr << (*it).size() << " versions found " << std::endl; - for(int i=0;i<(*it).size();++i) - { - RsGxsMessageId found = (*it)[i].second; - if(found != RsGxsMessageId(msgId)) - { - msgPair = std::make_pair( groupId(), found ); - rsGxsForums->setMessageReadStatus(token, msgPair, read); - } - } - } - - /* Add message id to ignore list for the next updateDisplay */ - mIgnoredMsgId.push_back(RsGxsMessageId(msgId)); - - (*row)->setData(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS, statusNew); - - QTreeWidgetItem *parentItem = *row; - while (parentItem->parent()) { - parentItem = parentItem->parent(); - } - if (std::find(changedItems.begin(), changedItems.end(), parentItem) == changedItems.end()) { - changedItems.push_back(parentItem); - } - } - } - - mInMsgAsReadUnread = false; - - if (changedItems.size()) { - for (std::list::iterator it = changedItems.begin(); it != changedItems.end(); ++it) { - calculateIconsAndFonts(*it); - } - calculateUnreadCount(); - } -} -#endif - void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum) { if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { @@ -2242,51 +1229,6 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f mThreadModel->setMsgReadStatus(mThreadProxyModel->mapToSource(index),read,children); } - -#ifdef TODO - /* get selected messages */ - QList rows; - if (forum) { - int itemCount = ui->threadTreeWidget->topLevelItemCount(); - for (int item = 0; item < itemCount; ++item) { - rows.push_back(ui->threadTreeWidget->topLevelItem(item)); - } - } else { - getSelectedMsgCount (&rows, NULL, NULL); - } - - if (children) { - /* add children */ - QList allRows; - - while (rows.isEmpty() == false) { - QTreeWidgetItem *row = rows.takeFirst(); - - /* add only items with the right state or with not RSGXS_MSG_STATUS_READ */ - uint32_t status = row->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - bool isUnread = IS_MSG_UNREAD(status); - if (isUnread == read || IS_MSG_NEW(status)) { - allRows.append(row); - } - - for (int i = 0; i < row->childCount(); ++i) { - /* add child to main list and let the main loop do the work */ - rows.append(row->child(i)); - } - } - - if (allRows.isEmpty()) { - /* nothing to do */ - return; - } - - setMsgReadStatus(allRows, read); - - return; - } - - setMsgReadStatus(rows, read); -#endif } void GxsForumThreadWidget::markMsgAsRead() @@ -2327,17 +1269,6 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) return true; } -#ifdef TO_REMOVE -bool GxsForumThreadWidget::isLoading() -{ - if (mStateHelper->isLoading(mTokenTypeGroupData) || mFillThread) { - return true; - } - - return GxsMessageFrameWidget::isLoading(); -} -#endif - void GxsForumThreadWidget::copyMessageLink() { if (groupId().isNull() || mThreadId.isNull()) { @@ -2459,26 +1390,6 @@ void GxsForumThreadWidget::flagperson() std::cerr << "Setting own opinion for author " << fmpe.mAuthorId << " to " << opinion << std::endl; rsReputations->setOwnOpinion(fmpe.mAuthorId,opinion) ; - -#ifdef TO_REMOVE - // Get Message ... then complete replyMessageData(). - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestMsgData_BanAuthor(" << postId.first << "," << postId.second << ")"; - std::cerr << std::endl; -#endif - - GxsMsgReq msgIds; - std::set &vect = msgIds[postId.first]; - vect.insert(postId.second); - - uint32_t token; - mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, token_type); -#endif } void GxsForumThreadWidget::replytoforummessage() { async_msg_action( &GxsForumThreadWidget::replyForumMessageData ); } @@ -2668,12 +1579,6 @@ void GxsForumThreadWidget::changedViewBox() void GxsForumThreadWidget::filterColumnChanged(int column) { -#ifdef TO_REMOVE - if (column == RsGxsForumModel::COLUMN_THREAD_CONTENT) { - // need content ... refill - //insertThreads(); - } else { -#endif filterItems(ui->filterLineEdit->text()); // save index @@ -2770,10 +1675,6 @@ void GxsForumThreadWidget::updateGroupData() if(groups.size() != 1) { std::cerr << __PRETTY_FUNCTION__ << " obtained more than one group info for forum " << groupId() << std::endl; -#ifdef TO_REMOVE - mStateHelper->setActive(mTokenTypeGroupData, false); - mStateHelper->clear(mTokenTypeGroupData); -#endif return; } @@ -2825,10 +1726,6 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) if(msgs.size() != 1) { std::cerr << __PRETTY_FUNCTION__ << " obtained more than one msg info for msgId " << msgId << std::endl; -#ifdef TO_REMOVE - mStateHelper->setActive(mTokenTypeGroupData, false); - mStateHelper->clear(mTokenTypeGroupData); -#endif return; } @@ -2857,281 +1754,6 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) } -#ifdef TO_REMOVE -void GxsForumThreadWidget::requestGroupData() -{ - mSubscribeFlags = 0; - mSignFlags = 0; - mForumDescription.clear(); - - mTokenQueue->cancelActiveRequestTokens(mTokenTypeGroupData); - emit groupChanged(this); - - if (groupId().isNull()) { - mStateHelper->setActive(mTokenTypeGroupData, false); - mStateHelper->setLoading(mTokenTypeGroupData, false); - mStateHelper->clear(mTokenTypeGroupData); - - return; - } - - mStateHelper->setLoading(mTokenTypeGroupData, true); - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - - std::list grpIds; - grpIds.push_back(groupId()); - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestGroupData(" << groupId() << ")"; - std::cerr << std::endl; -#endif - - uint32_t token; - mTokenQueue->requestGroupInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds, mTokenTypeGroupData); -} - -void GxsForumThreadWidget::loadGroupData(const uint32_t &token) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadGroup_CurrentForum()"; - std::cerr << std::endl; -#endif - - std::vector groups; - rsGxsForums->getGroupData(token, groups); - - mStateHelper->setLoading(mTokenTypeGroupData, false); - - if (groups.size() == 1) - { - mForumGroup = groups[0]; - insertGroupData(); - - mStateHelper->setActive(mTokenTypeGroupData, true); - - // Don't show the distribution column if the forum has no anti-spam - ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); - ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; - } - else - { - std::cerr << "GxsForumThreadWidget::loadGroupSummary_CurrentForum() ERROR Invalid Number of Groups..."; - std::cerr << std::endl; - - mStateHelper->setActive(mTokenTypeGroupData, false); - mStateHelper->clear(mTokenTypeGroupData); - } - - emit groupChanged(this); -} - -/*********************** **** **** **** ***********************/ -/*********************** **** **** **** ***********************/ - -void GxsForumThreadWidget::requestMessageData(const RsGxsGrpMsgIdPair &msgId) -{ - mStateHelper->setLoading(mTokenTypeMessageData, true); - - mTokenQueue->cancelActiveRequestTokens(mTokenTypeMessageData); - - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestMessage(" << msgId.first << "," << msgId.second << ")"; - std::cerr << std::endl; -#endif - - GxsMsgReq msgIds; - std::set &vect = msgIds[msgId.first]; - vect.insert(msgId.second); - - uint32_t token; - mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeMessageData); -} - -void GxsForumThreadWidget::loadMessageData(const uint32_t &token) -{ - mStateHelper->setLoading(mTokenTypeMessageData, false); - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadMessage()"; - std::cerr << std::endl; -#endif - - std::vector msgs; - if (rsGxsForums->getMsgData(token, msgs)) { - if (msgs.size() != 1) { - std::cerr << "GxsForumThreadWidget::loadMessage() ERROR Wrong number of answers"; - std::cerr << std::endl; - - mStateHelper->setActive(mTokenTypeMessageData, false); - mStateHelper->clear(mTokenTypeMessageData); - return; - } - insertMessageData(msgs[0]); - } else { - std::cerr << "GxsForumThreadWidget::loadMessage() ERROR Missing Message Data..."; - std::cerr << std::endl; - - mStateHelper->setActive(mTokenTypeMessageData, false); - mStateHelper->clear(mTokenTypeMessageData); - } -} - -/*********************** **** **** **** ***********************/ -/*********************** **** **** **** ***********************/ - - -void GxsForumThreadWidget::requestMsgData_ReplyWithPrivateMessage(const RsGxsGrpMsgIdPair &msgId) -{ - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; - std::cerr << std::endl; -#endif - - GxsMsgReq msgIds; - std::set &vect = msgIds[msgId.first]; - vect.insert(msgId.second); - - uint32_t token; - mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeReplyMessage); -} - -void GxsForumThreadWidget::requestMsgData_ShowAuthorInPeople(const RsGxsGrpMsgIdPair& msgId) -{ - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; - std::cerr << std::endl; -#endif - - GxsMsgReq msgIds; - std::set &vect = msgIds[msgId.first]; - vect.insert(msgId.second); - - uint32_t token; - mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeShowAuthorInPeople); -} -void GxsForumThreadWidget::requestMsgData_EditForumMessage(const RsGxsGrpMsgIdPair &msgId) -{ - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; - std::cerr << std::endl; -#endif - - GxsMsgReq msgIds; - std::set &vect = msgIds[msgId.first]; - vect.insert(msgId.second); - - uint32_t token; - mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeEditForumMessage); -} -void GxsForumThreadWidget::requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId) -{ - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")"; - std::cerr << std::endl; -#endif - - GxsMsgReq msgIds; - std::set &vect = msgIds[msgId.first]; - vect.insert(msgId.second); - - uint32_t token; - mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeReplyForumMessage); -} - -void GxsForumThreadWidget::loadMsgData_ReplyMessage(const uint32_t &token) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()"; - std::cerr << std::endl; -#endif - - std::vector msgs; - if (rsGxsForums->getMsgData(token, msgs)) - { - if (msgs.size() != 1) - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Wrong number of answers"; - std::cerr << std::endl; - return; - } - replyMessageData(msgs[0]); - } - else - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Missing Message Data..."; - std::cerr << std::endl; - } -} - -void GxsForumThreadWidget::loadMsgData_EditForumMessage(const uint32_t &token) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadMsgData_EditMessage()"; - std::cerr << std::endl; -#endif - - std::vector msgs; - if (rsGxsForums->getMsgData(token, msgs)) - { - if (msgs.size() != 1) - { - std::cerr << "GxsForumThreadWidget::loadMsgData_EditMessage() ERROR Wrong number of answers"; - std::cerr << std::endl; - return; - } - - editForumMessageData(msgs[0]); - } - else - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Missing Message Data..."; - std::cerr << std::endl; - } -} -void GxsForumThreadWidget::loadMsgData_ReplyForumMessage(const uint32_t &token) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()"; - std::cerr << std::endl; -#endif - - std::vector msgs; - if (rsGxsForums->getMsgData(token, msgs)) - { - if (msgs.size() != 1) - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Wrong number of answers"; - std::cerr << std::endl; - return; - } - - replyForumMessageData(msgs[0]); - } - else - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Missing Message Data..."; - std::cerr << std::endl; - } -} -#endif - void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) { if(msg.mMeta.mAuthorId.isNull()) @@ -3149,102 +1771,3 @@ void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) MainWindow::showWindow(MainWindow::People); idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId)); } - -#ifdef TO_REMOVE -void GxsForumThreadWidget::loadMsgData_SetAuthorOpinion(const uint32_t &token,RsReputations::Opinion opinion) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadMsgData_BanAuthor()"; - std::cerr << std::endl; -#endif - - std::vector msgs; - if (rsGxsForums->getMsgData(token, msgs)) - { - if (msgs.size() != 1) - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Wrong number of answers"; - std::cerr << std::endl; - return; - } - - std::cerr << " banning author id " << msgs[0].mMeta.mAuthorId << std::endl; - - rsReputations->setOwnOpinion(msgs[0].mMeta.mAuthorId,opinion) ; - } - else - { - std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage() ERROR Missing Message Data..."; - std::cerr << std::endl; - } - updateDisplay(true) ; - - // we should also update the icons so that they changed to the icon for banned peers. - - std::cerr << __PRETTY_FUNCTION__ << ": need to implement the update of GxsTreeWidgetItems icons too." << std::endl; -} -/*********************** **** **** **** ***********************/ -/*********************** **** **** **** ***********************/ - -void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenRequest &req) -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumThreadWidget::loadRequest() UserType: " << req.mUserType; - std::cerr << std::endl; -#endif - - if (queue == mTokenQueue) - { - /* now switch on req */ - if (req.mUserType == mTokenTypeGroupData) { - loadGroupData(req.mToken); - return; - } - - if (req.mUserType == mTokenTypeMessageData) { - loadMessageData(req.mToken); - return; - } - - if (req.mUserType == mTokenTypeReplyMessage) { - loadMsgData_ReplyMessage(req.mToken); - return; - } - - if (req.mUserType == mTokenTypeReplyForumMessage) { - loadMsgData_ReplyForumMessage(req.mToken); - return; - } - - if (req.mUserType == mTokenTypeEditForumMessage) { - loadMsgData_EditForumMessage(req.mToken); - return; - } - if (req.mUserType == mTokenTypeShowAuthorInPeople) { - loadMsgData_ShowAuthorInPeople(req.mToken); - return; - } - if (req.mUserType == mTokenTypePositiveAuthor) { - loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_POSITIVE); - return; - } - - if (req.mUserType == mTokenTypeNegativeAuthor) { - loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEGATIVE); - return; - } - - if (req.mUserType == mTokenTypeNeutralAuthor) { - loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEUTRAL); - return; - } - } - - GxsMessageFrameWidget::loadRequest(queue, req); -} - -QTreeWidgetItem *GxsForumThreadWidget::generateMissingItem(const RsGxsMessageId& mid) -{ -return NULL; -} -#endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 29c59099d..07c62e76d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -142,12 +142,6 @@ private slots: void filterColumnChanged(int column); void filterItems(const QString &text); -#ifdef TO_REMOVE - void fillThreadFinished(); - void fillThreadProgress(int current, int count); - void fillThreadStatus(QString text); -#endif - private: void insertMessageData(const RsGxsForumMsg &msg); bool getCurrentPost(ForumModelPostEntry& fmpe) const ; @@ -172,20 +166,6 @@ private: void updateMessageData(const RsGxsMessageId& msgId); -#ifdef TO_REMOVE - void requestMsgData_ReplyWithPrivateMessage(const RsGxsGrpMsgIdPair &msgId); - void requestMsgData_ShowAuthorInPeople(const RsGxsGrpMsgIdPair &msgId); - void requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId); - void requestMsgData_EditForumMessage(const RsGxsGrpMsgIdPair &msgId); - - void loadMessageData(const uint32_t &token); - void loadMsgData_ReplyMessage(const uint32_t &token); - void loadMsgData_ReplyForumMessage(const uint32_t &token); - void loadMsgData_EditForumMessage(const uint32_t &token); - void loadMsgData_ShowAuthorInPeople(const uint32_t &token); - void loadMsgData_SetAuthorOpinion(const uint32_t &token, RsReputations::Opinion opinion); -#endif - private: RsGxsGroupId mLastForumID; RsGxsMessageId mThreadId; @@ -202,19 +182,6 @@ private: unsigned int mUnreadCount; unsigned int mNewCount; -#ifdef TO_REMOVE - uint32_t mTokenTypeGroupData; - uint32_t mTokenTypeInsertThreads; - uint32_t mTokenTypeMessageData; - uint32_t mTokenTypeReplyMessage; - uint32_t mTokenTypeReplyForumMessage; - uint32_t mTokenTypeEditForumMessage; - uint32_t mTokenTypeShowAuthorInPeople; - uint32_t mTokenTypeNegativeAuthor; - uint32_t mTokenTypePositiveAuthor; - uint32_t mTokenTypeNeutralAuthor; -#endif - /* Color definitions (for standard see qss.default) */ QColor mTextColorRead; QColor mTextColorUnread; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp deleted file mode 100644 index abaad4848..000000000 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ /dev/null @@ -1,558 +0,0 @@ -/******************************************************************************* - * retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp * - * * - * Copyright 2012 Retroshare Team * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#include -#include - -#include "GxsForumsFillThread.h" -#include "GxsForumThreadWidget.h" -#include "GxsForumModel.h" - -#include "retroshare/rsgxsflags.h" -#include "retroshare/rsgxsforums.h" - -#include -#include - -//#define DEBUG_FORUMS - -#ifdef TO_REMOVE -#define PROGRESSBAR_MAX 100 - -GxsForumsFillThread::GxsForumsFillThread(GxsForumThreadWidget *parent) - : QThread(parent), mParent(parent) -{ - mStopped = false; - mCompareRole = NULL; - - mExpandNewMessages = true; - mFillComplete = false; - - mFilterColumn = 0; - - mViewType = 0; - mFlatView = false; - mUseChildTS = false; -} - -GxsForumsFillThread::~GxsForumsFillThread() -{ -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::~GxsForumsFillThread" << std::endl; -#endif - - // remove all items (when items are available, the thread was terminated) - QList::iterator item; - for (item = mItems.begin (); item != mItems.end (); ++item) { - if (*item) { - delete (*item); - } - } - mItems.clear(); - - mItemToExpand.clear(); -} - -void GxsForumsFillThread::stop() -{ - disconnect(); - mStopped = true; - QApplication::processEvents(); -} - -void GxsForumsFillThread::calculateExpand(const RsGxsForumMsg &msg, QTreeWidgetItem *item) -{ - if (mFillComplete && mExpandNewMessages && IS_MSG_UNREAD(msg.mMeta.mMsgStatus)) { - QTreeWidgetItem *parentItem = item; - while ((parentItem = parentItem->parent()) != NULL) { - if (std::find(mItemToExpand.begin(), mItemToExpand.end(), parentItem) == mItemToExpand.end()) { - mItemToExpand.push_back(parentItem); - } - } - } -} - -static bool decreasing_time_comp(const QPair& e1,const QPair& e2) { return e2.first < e1.first ; } - -void GxsForumsFillThread::run() -{ - RsTokenService *service = rsGxsForums->getTokenService(); - uint32_t msg_token; - uint32_t grp_token; - - emit status(tr("Waiting")); - - { - /* get all messages of the forum */ - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - - std::list grpIds; - grpIds.push_back(mForumId); - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() forum id " << mForumId << std::endl; -#endif - - service->requestMsgInfo(msg_token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds); - - /* wait for the answer */ - uint32_t requestStatus = RsTokenService::PENDING; - while (!wasStopped()) { - requestStatus = service->requestStatus(msg_token); - if (requestStatus == RsTokenService::FAILED || - requestStatus == RsTokenService::COMPLETE) { - break; - } - msleep(200); - } - - if (requestStatus == RsTokenService::FAILED) - { - deleteLater(); - return; - } - } - - // also get the forum meta data. - { - RsTokReqOptions opts; - opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; - - std::list grpIds; - grpIds.push_back(mForumId); - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() forum id " << mForumId << std::endl; -#endif - - service->requestGroupInfo(grp_token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds); - - /* wait for the answer */ - uint32_t requestStatus = RsTokenService::PENDING; - while (!wasStopped()) { - requestStatus = service->requestStatus(grp_token); - if (requestStatus == RsTokenService::FAILED || - requestStatus == RsTokenService::COMPLETE) { - break; - } - msleep(200); - } - - if (requestStatus == RsTokenService::FAILED) - { - deleteLater(); - return; - } - } - - if (wasStopped()) - { -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() thread stopped, cancel request" << std::endl; -#endif - - /* cancel request */ - service->cancelRequest(msg_token); - service->cancelRequest(grp_token); - deleteLater(); - return; - } - - emit status(tr("Retrieving")); - - std::vector forum_groups; - - if (!rsGxsForums->getGroupData(grp_token, forum_groups) || forum_groups.size() != 1) - { - deleteLater(); - return; - } - - RsGxsForumGroup forum_group = *forum_groups.begin(); - -//#ifdef DEBUG_FORUMS - std::cerr << "Retrieved group data: " << std::endl; - std::cerr << " Group ID: " << forum_group.mMeta.mGroupId << std::endl; - std::cerr << " Admin lst: " << forum_group.mAdminList.ids.size() << " elements." << std::endl; - for(auto it(forum_group.mAdminList.ids.begin());it!=forum_group.mAdminList.ids.end();++it) - std::cerr << " " << *it << std::endl; - std::cerr << " Pinned Post: " << forum_group.mPinnedPosts.ids.size() << " messages." << std::endl; - for(auto it(forum_group.mPinnedPosts.ids.begin());it!=forum_group.mPinnedPosts.ids.end();++it) - std::cerr << " " << *it << std::endl; -//#endif - - /* get messages */ - std::map msgs; - - { // This forces to delete msgs_array after the conversion to std::map. - - std::vector msgs_array; - - if (!rsGxsForums->getMsgData(msg_token, msgs_array)) - { - deleteLater(); - return; - } - - // now put everything into a map in order to make search log(n) - - for(uint32_t i=0;i > threadStack; - std::map > kids_array ; - std::set missing_parents; - - // First of all, remove all older versions of posts. This is done by first adding all posts into a hierarchy structure - // and then removing all posts which have a new versions available. The older versions are kept appart. - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Collecting post versions" << std::endl; -#endif - mPostVersions.clear(); - std::list msg_stack ; - - for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) - { - if(wasStopped()) - { - deleteLater(); - return; - } - if(!msgIt->second.mMeta.mOrigMsgId.isNull() && msgIt->second.mMeta.mOrigMsgId != msgIt->second.mMeta.mMsgId) - { -#ifdef DEBUG_FORUMS - std::cerr << " Post " << msgIt->second.mMeta.mMsgId << " is a new version of " << msgIt->second.mMeta.mOrigMsgId << std::endl; -#endif - std::map::iterator msgIt2 = msgs.find(msgIt->second.mMeta.mOrigMsgId); - - // Ensuring that the post exists allows to only collect the existing data. - - if(msgIt2 == msgs.end()) - continue ; - - // Make sure that the author is the same than the original message, or is a moderator. This should always happen when messages are constructed using - // the UI but nothing can prevent a nasty user to craft a new version of a message with his own signature. - - if(msgIt2->second.mMeta.mAuthorId != msgIt->second.mMeta.mAuthorId) - { - if( !IS_FORUM_MSG_MODERATION(msgIt->second.mMeta.mMsgFlags) ) // if authors are different the moderation flag needs to be set on the editing msg - continue ; - - if( forum_group.mAdminList.ids.find(msgIt->second.mMeta.mAuthorId)==forum_group.mAdminList.ids.end()) // if author is not a moderator, continue - continue ; - } - - // always add the post a self version - - if(mPostVersions[msgIt->second.mMeta.mOrigMsgId].empty()) - mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(QPair(msgIt2->second.mMeta.mPublishTs,msgIt2->second.mMeta.mMsgId)) ; - - mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(QPair(msgIt->second.mMeta.mPublishTs,msgIt->second.mMeta.mMsgId)) ; - } - } - - // The following code assembles all new versions of a given post into the same array, indexed by the oldest version of the post. - - for(QMap > >::iterator it(mPostVersions.begin());it!=mPostVersions.end();++it) - { - if(wasStopped()) - { - deleteLater(); - return; - } - QVector >& v(*it) ; - - for(int32_t i=0;i > >::iterator it2 = mPostVersions.find(sub_msg_id); - - if(it2 != mPostVersions.end()) - { - for(int32_t j=0;j<(*it2).size();++j) - if((*it2)[j].second != sub_msg_id) // dont copy it, since it is already present at slot i - v.append((*it2)[j]) ; - - mPostVersions.erase(it2) ; // it2 is never equal to it - } - } - } - } - - - // Now remove from msg ids, all posts except the most recent one. And make the mPostVersion be indexed by the most recent version of the post, - // which corresponds to the item in the tree widget. - -#ifdef DEBUG_FORUMS - std::cerr << "Final post versions: " << std::endl; -#endif - QMap > > mTmp; - std::map most_recent_versions ; - - for(QMap > >::iterator it(mPostVersions.begin());it!=mPostVersions.end();++it) - { -#ifdef DEBUG_FORUMS - std::cerr << "Original post: " << it.key() << std::endl; -#endif - if(wasStopped()) - { - deleteLater(); - return; - } - // Finally, sort the posts from newer to older - - qSort((*it).begin(),(*it).end(),decreasing_time_comp) ; - -#ifdef DEBUG_FORUMS - std::cerr << " most recent version " << (*it)[0].first << " " << (*it)[0].second << std::endl; -#endif - for(int32_t i=1;i<(*it).size();++i) - { - if(wasStopped()) - { - deleteLater(); - return; - } - msgs.erase((*it)[i].second) ; - -#ifdef DEBUG_FORUMS - std::cerr << " older version " << (*it)[i].first << " " << (*it)[i].second << std::endl; -#endif - } - - mTmp[(*it)[0].second] = *it ; // index the versions map by the ID of the most recent post. - - // Now make sure that message parents are consistent. Indeed, an old post may have the old version of a post as parent. So we need to change that parent - // to the newest version. So we create a map of which is the most recent version of each message, so that parent messages can be searched in it. - - for(int i=1;i<(*it).size();++i) - { - if(wasStopped()) - { - deleteLater(); - return; - } - most_recent_versions[(*it)[i].second] = (*it)[0].second ; - } - } - mPostVersions = mTmp ; - - // The next step is to find the top level thread messages. These are defined as the messages without - // any parent message ID. - - // this trick is needed because while we remove messages, the parents a given msg may already have been removed - // and wrongly understand as a missing parent. - - std::map kept_msgs; - - for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) - { - - if (wasStopped()) - { - deleteLater(); - return; - } - if(mFlatView || msgIt->second.mMeta.mParentId.isNull()) - { - - /* add all threads */ - if (wasStopped()) - { - deleteLater(); - return; - } - - const RsGxsForumMsg& msg = msgIt->second; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Adding TopLevel Thread: mId: " << msg.mMeta.mMsgId << std::endl; -#endif - - QTreeWidgetItem *item = mParent->convertMsgToThreadWidget(msg, mUseChildTS, mFilterColumn,NULL); - - if (!mFlatView) - threadStack.push_back(std::make_pair(msg.mMeta.mMsgId,item)) ; - - calculateExpand(msg, item); - - mItems.append(item); - - if (++step >= steps) { - step = 0; - emit progress(++pos, PROGRESSBAR_MAX); - } - } - else - { -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Storing kid " << msgIt->first << " of message " << msgIt->second.mMeta.mParentId << std::endl; -#endif - // The same missing parent may appear multiple times, so we first store them into a unique container. - - RsGxsMessageId parent_msg = msgIt->second.mMeta.mParentId; - - if(msgs.find(parent_msg) == msgs.end()) - { - // also check that the message is not versionned - - std::map::const_iterator mrit = most_recent_versions.find(parent_msg) ; - - if(mrit != most_recent_versions.end()) - parent_msg = mrit->second ; - else - missing_parents.insert(parent_msg); - } - - kids_array[parent_msg].push_back(msgIt->first) ; - kept_msgs.insert(*msgIt) ; - } - } - - msgs = kept_msgs; - - // Also create a list of posts by time, when they are new versions of existing posts. Only the last one will have an item created. - - // Add a fake toplevel item for the parent IDs that we dont actually have. - - for(std::set::const_iterator it(missing_parents.begin());it!=missing_parents.end();++it) - { - // add dummy parent item - QTreeWidgetItem *parent = mParent->generateMissingItem(*it); - mItems.append( parent ); - - threadStack.push_back(std::make_pair(*it,parent)) ; - } -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Processing stack:" << std::endl; -#endif - // Now use a stack to go down the hierarchy - - while (!threadStack.empty()) - { - if (wasStopped()) - { - deleteLater(); - return; - } - - std::pair threadPair = threadStack.front(); - threadStack.pop_front(); - - std::map >::iterator it = kids_array.find(threadPair.first) ; - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Node: " << threadPair.first << std::endl; -#endif - if(it == kids_array.end()) - continue ; - - - for(std::list::const_iterator it2(it->second.begin());it2!=it->second.end();++it2) - { - if(wasStopped()) - { - deleteLater(); - return; - } - // We iterate through the top level thread items, and look for which message has the current item as parent. - // When found, the item is put in the thread list itself, as a potential new parent. - - std::map::iterator mit = msgs.find(*it2) ; - - if(mit == msgs.end()) - { - std::cerr << "GxsForumsFillThread::run() Cannot find submessage " << *it2 << " !!!" << std::endl; - continue ; - } - - const RsGxsForumMsg& msg(mit->second) ; -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() adding sub_item " << msg.mMeta.mMsgId << std::endl; -#endif - - QTreeWidgetItem *item = mParent->convertMsgToThreadWidget(msg, mUseChildTS, mFilterColumn, threadPair.second); - calculateExpand(msg, item); - - /* add item to process list */ - threadStack.push_back(std::make_pair(msg.mMeta.mMsgId, item)); - - if (++step >= steps) { - step = 0; - emit progress(++pos, PROGRESSBAR_MAX); - } - - msgs.erase(mit); - } - -#ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Erasing entry " << it->first << " from kids tab." << std::endl; -#endif - kids_array.erase(it) ; // This is not strictly needed, but it improves performance by reducing the search space. - } - -#ifdef DEBUG_FORUMS - std::cerr << "Kids array now has " << kids_array.size() << " elements" << std::endl; - for(std::map >::const_iterator it(kids_array.begin());it!=kids_array.end();++it) - { - std::cerr << "Node " << it->first << std::endl; - for(std::list::const_iterator it2(it->second.begin());it2!=it->second.end();++it2) - std::cerr << " " << *it2 << std::endl; - } - - std::cerr << "GxsForumsFillThread::run() stopped: " << (wasStopped() ? "yes" : "no") << std::endl; -#endif - if(wasStopped()) - deleteLater(); -} -#endif - diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h deleted file mode 100644 index cf4f17ea2..000000000 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.h * - * * - * Copyright 2012 Retroshare Team * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Affero General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Affero General Public License for more details. * - * * - * You should have received a copy of the GNU Affero General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -#ifndef GXSFORUMSFILLTHREAD_H -#define GXSFORUMSFILLTHREAD_H - -#include -#include -#include -#include "retroshare/rsgxsifacetypes.h" - -class GxsForumThreadWidget; -class RsGxsForumMsg; -class RSTreeWidgetItemCompareRole; -class QTreeWidgetItem; - -#ifdef TO_REMOVE -class GxsForumsFillThread : public QThread -{ - Q_OBJECT - -public: - GxsForumsFillThread(GxsForumThreadWidget *parent); - ~GxsForumsFillThread(); - - void run(); - void stop(); - bool wasStopped() { return mStopped; } - -signals: - void progress(int current, int count); - void status(QString text); - -public: - RsGxsGroupId mForumId; - int mFilterColumn; - bool mFillComplete; - int mViewType; - bool mFlatView; - bool mUseChildTS; - bool mExpandNewMessages; - std::string mFocusMsgId; - RSTreeWidgetItemCompareRole *mCompareRole; - - QList mItems; - QList mItemToExpand; - - QMap > > mPostVersions ; -private: - void calculateExpand(const RsGxsForumMsg &msg, QTreeWidgetItem *item); - - GxsForumThreadWidget *mParent; - volatile bool mStopped; -}; - -#endif // GXSFORUMSFILLTHREAD_H -#endif // GXSFORUMSFILLTHREAD_H diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 8a9ae04ce..86171a916 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -1230,7 +1230,6 @@ gxsforums { gui/gxsforums/GxsForumGroupDialog.h \ gui/gxsforums/CreateGxsForumMsg.h \ gui/gxsforums/GxsForumThreadWidget.h \ - gui/gxsforums/GxsForumsFillThread.h \ gui/gxsforums/GxsForumModel.h \ gui/gxsforums/GxsForumUserNotify.h \ gui/feeds/GxsForumGroupItem.h \ @@ -1246,7 +1245,6 @@ gxsforums { gui/gxsforums/CreateGxsForumMsg.cpp \ gui/gxsforums/GxsForumThreadWidget.cpp \ gui/gxsforums/GxsForumModel.cpp \ - gui/gxsforums/GxsForumsFillThread.cpp \ gui/gxsforums/GxsForumUserNotify.cpp \ gui/feeds/GxsForumGroupItem.cpp \ gui/feeds/GxsForumMsgItem.cpp From 8736380bfe15d39679e0ec3a9440eee8f5a476ab Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 16:45:16 +0100 Subject: [PATCH 075/110] added license, removed debug info --- .../src/gui/gxsforums/GxsForumModel.cpp | 133 +++--------------- .../src/gui/gxsforums/GxsForumModel.h | 37 ----- .../gui/gxsforums/GxsForumThreadWidget.cpp | 1 - 3 files changed, 23 insertions(+), 148 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index adadbf5bf..8ba1b9639 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1,3 +1,23 @@ +/******************************************************************************* + * retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp * + * * + * Copyright 2018 by Cyril Soler * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include #include #include @@ -675,7 +695,7 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector= model.mPosts.size()) - { - std::cerr << "(EE) constructed a RsGxsForumModel::const_iterator from invalid index " << i << std::endl; - kid = -1; - return; - } - // create a stack or parents - parent_stack.clear(); - - if(i==0) - { - current_parent = 0; - kid =0; - return; - } - current_parent = model.mPosts[i].mParent; - ForumModelIndex j(i); - kid = model.mPosts[i].prow; - - while(j != 0) - { - parent_stack.push_front(model.mPosts[j].prow); - j = model.mPosts[i].mParent; - } -} - -ForumModelIndex RsGxsForumModel::const_iterator::operator*() const -{ - if(current_parent >= model.mPosts.size() || kid < 0 || kid >= (int)model.mPosts[current_parent].mChildren.size()) - { - std::cerr << "(EE) operator* on an invalid RsGxsForumModel::const_iterator"<< std::endl; - return 0; - } - - return model.mPosts[current_parent].mChildren[kid]; -} - -void RsGxsForumModel::const_iterator::operator++() -{ - kid++; - while(kid >= (int)model.mPosts[current_parent].mChildren.size()) - { - current_parent = model.mPosts[current_parent].mParent; - kid = parent_stack.back()+1; - - parent_stack.pop_back(); - - } - - if(current_parent == 0 && kid >= (int)model.mPosts[current_parent].mChildren.size()) - { - kid = -1; - return; - } - - while(!model.mPosts[model.mPosts[current_parent].mChildren[kid]].mChildren.empty()) - { - parent_stack.push_back(kid); - current_parent = model.mPosts[current_parent].mChildren[kid]; - kid = 0; - } -} - -RsGxsForumModel::const_iterator::operator bool() const -{ - return kid >= 0; -} -#endif - static void recursPrintModel(const std::vector& entries,ForumModelIndex index,int depth) { const ForumModelPostEntry& e(entries[index]); @@ -1340,7 +1253,7 @@ static void recursPrintModel(const std::vector& entries,For recursPrintModel(entries,e.mChildren[i],depth+1); } - +#ifdef DEBUG_FORUMMODEL void RsGxsForumModel::debug_dump() { std::cerr << "Model data dump:" << std::endl; @@ -1369,6 +1282,6 @@ void RsGxsForumModel::debug_dump() // recursive print recursPrintModel(mPosts,ForumModelIndex(0),0); } - +#endif diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 8c258a826..dec3bad51 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -1,18 +1,3 @@ -#ifndef SUSPENDED_CODE -#else -#include -#include - -struct RsMsgMetaData -{ - std::string mMsgName ; - time_t mPublishTs; - uint32_t mMsgStatus; - QString mAuthorId; -}; - -#endif - #include "retroshare/rsgxsforums.h" #include "retroshare/rsgxsifacetypes.h" #include @@ -99,28 +84,6 @@ public: std::vector > getPostVersions(const RsGxsMessageId& mid) const; -#ifdef TO_REMOVE - QModelIndex getNextIndex(const QModelIndex& i,bool unread_only) const; - - class const_iterator - { - public: - const_iterator(const RsGxsForumModel& Model,ForumModelIndex = 0) ; - - ForumModelIndex operator*() const ; - void operator++(); - - inline operator bool() const ; - - private: - std::list parent_stack; - int kid; - ForumModelIndex current_parent; - const RsGxsForumModel& model; - }; - void test_iterator() const; -#endif - // This method will asynchroneously update the data void setForum(const RsGxsGroupId& forumGroup); void setTreeMode(TreeMode mode) ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index a83d3d590..8de231439 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -28,7 +28,6 @@ #include "util/misc.h" #include "GxsForumThreadWidget.h" #include "ui_GxsForumThreadWidget.h" -#include "GxsForumsFillThread.h" #include "GxsForumModel.h" #include "GxsForumsDialog.h" #include "gui/RetroShareLink.h" From 24896bc596f1e588f45dfe08ea45e01dba449809 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 16:49:14 +0100 Subject: [PATCH 076/110] further cleaning of ForumModel code --- .../src/gui/gxsforums/GxsForumModel.cpp | 41 ++----------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 8ba1b9639..9f40caa47 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -185,7 +185,6 @@ bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) QModelIndex RsGxsForumModel::index(int row, int column, const QModelIndex & parent) const { -// if(!hasIndex(row,column,parent)) if(row < 0 || column < 0 || column >= COLUMN_THREAD_NB_COLUMNS) return QModelIndex(); @@ -491,9 +490,6 @@ void RsGxsForumModel::setFilter(int column,const QStringList& strings,uint32_t& QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column) const { - // if(column != COLUMN_THREAD_DATA) -// return QVariant(); - if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING) return QVariant(true); else @@ -764,9 +760,9 @@ ForumModelIndex RsGxsForumModel::addEntry(std::vector& post posts[N].mParent = parent; posts[parent].mChildren.push_back(N); - +#ifdef DEBUG_FORUMMODEL std::cerr << "Added new entry " << N << " children of " << parent << std::endl; - +#endif if(N == parent) std::cerr << "(EE) trying to add a post as its own parent!" << std::endl; return ForumModelIndex(N); @@ -814,35 +810,6 @@ void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,c fentry.mReputationWarningLevel = 1 ; else fentry.mReputationWarningLevel = 0 ; - -#ifdef TODO - // This is an attempt to put pinned posts on the top. We should rather use a QSortFilterProxyModel here. - QString itemSort = QString::number(msg.mMeta.mPublishTs);//Don't need to format it as for sort. - - if (useChildTS) - { - for(QTreeWidgetItem *grandParent = parent; grandParent!=NULL; grandParent = grandParent->parent()) - { - //Update Parent Child TimeStamp - QString oldTSSort = grandParent->data(COLUMN_THREAD_DATE, ROLE_THREAD_SORT).toString(); - - QString oldCTSSort = oldTSSort.split("|").at(0); - QString oldPTSSort = oldTSSort.contains("|") ? oldTSSort.split(" | ").at(1) : oldCTSSort; -#ifdef SHOW_COMBINED_DATES - QString oldTSText = grandParent->text(COLUMN_THREAD_DATE); - QString oldCTSText = oldTSText.split("|").at(0); - QString oldPTSText = oldTSText.contains("|") ? oldTSText.split(" | ").at(1) : oldCTSText;//If first time parent get only its mPublishTs - #endif - if (oldCTSSort.toDouble() < itemSort.toDouble()) - { -#ifdef SHOW_COMBINED_DATES - grandParent->setText(COLUMN_THREAD_DATE, DateTime::formatDateTime(qtime) + " | " + oldPTSText); -#endif - grandParent->setData(COLUMN_THREAD_DATE, ROLE_THREAD_SORT, itemSort + " | " + oldPTSSort); - } - } - } -#endif } static bool decreasing_time_comp(const std::pair& e1,const std::pair& e2) { return e2.first < e1.first ; } @@ -855,7 +822,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou { std::cerr << "updating messages data with " << msgs_array.size() << " messages" << std::endl; -//#ifdef DEBUG_FORUMS +#ifdef DEBUG_FORUMS std::cerr << "Retrieved group data: " << std::endl; std::cerr << " Group ID: " << forum_group.mMeta.mGroupId << std::endl; std::cerr << " Admin lst: " << forum_group.mAdminList.ids.size() << " elements." << std::endl; @@ -864,7 +831,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou std::cerr << " Pinned Post: " << forum_group.mPinnedPosts.ids.size() << " messages." << std::endl; for(auto it(forum_group.mPinnedPosts.ids.begin());it!=forum_group.mPinnedPosts.ids.end();++it) std::cerr << " " << *it << std::endl; -//#endif +#endif /* get messages */ std::map msgs; From 60e559561897eff83f64265cdcac6e3cdc96b884 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 22:41:48 +0100 Subject: [PATCH 077/110] fixed bug in post pinning --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 3 --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 9f40caa47..9db4226c4 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -532,9 +532,6 @@ QVariant RsGxsForumModel::toolTipRole(const ForumModelPostEntry& fmpe,int column QVariant RsGxsForumModel::pinnedRole(const ForumModelPostEntry& fmpe,int column) const { - if(column != COLUMN_THREAD_DATE) - return QVariant(); - if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_PINNED) return QVariant(true); else diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 8de231439..c1a55f90b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -276,8 +276,8 @@ public: bool lessThan(const QModelIndex& left, const QModelIndex& right) const override { - bool left_is_not_pinned = ! left.data(ROLE_THREAD_PINNED).toBool(); - bool right_is_not_pinned = !right.data(ROLE_THREAD_PINNED).toBool(); + bool left_is_not_pinned = ! left.data(RsGxsForumModel::ThreadPinnedRole).toBool(); + bool right_is_not_pinned = !right.data(RsGxsForumModel::ThreadPinnedRole).toBool(); #ifdef DEBUG_PINNED_POST_SORTING std::cerr << "Comparing item date \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \"" From 49dc9bcae279d69d11f1b6c35b55f2a908a7d762 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Dec 2018 22:49:16 +0100 Subject: [PATCH 078/110] increated timeout limit for retrieving forums --- libretroshare/src/services/p3gxsforums.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 4541f00b7..0534128e5 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -478,7 +478,7 @@ bool p3GxsForums::getForumsContent( RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; if( !requestMsgInfo(token, opts, forumIds) - || waitToken(token) != RsTokenService::COMPLETE ) return false; + || waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false; return getMsgData(token, messages); } From 55022432ef1d360230c0372566916cd5bdf72393 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 3 Dec 2018 17:30:46 +0100 Subject: [PATCH 079/110] added proper update of threads when new msg is poste or received --- .../src/gui/gxsforums/GxsForumModel.cpp | 15 ++++++ .../src/gui/gxsforums/GxsForumModel.h | 22 +++++++++ .../gui/gxsforums/GxsForumThreadWidget.cpp | 47 +++++-------------- 3 files changed, 48 insertions(+), 36 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 9db4226c4..cdb8d5dcf 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -667,6 +667,18 @@ void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) update_posts(forum_group_id); } +void RsGxsForumModel::clear() +{ + emit layoutAboutToBeChanged(); + + mPosts.clear(); + mPostVersions.clear(); + + emit layoutChanged(); + emit forumLoaded(); + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); +} + void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions) { emit layoutAboutToBeChanged(); @@ -699,6 +711,9 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + #include "retroshare/rsgxsforums.h" #include "retroshare/rsgxsifacetypes.h" #include @@ -108,6 +128,8 @@ public: QModelIndex parent(const QModelIndex& child) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; + void clear() ; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index c1a55f90b..73be7595c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -278,24 +278,10 @@ public: { bool left_is_not_pinned = ! left.data(RsGxsForumModel::ThreadPinnedRole).toBool(); bool right_is_not_pinned = !right.data(RsGxsForumModel::ThreadPinnedRole).toBool(); -#ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Comparing item date \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" - << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << left_is_not_pinned << ") to \"" - << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,Qt::DisplayRole).toString().toStdString() << "\" (" - << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toUInt() << ", \"" << other.data(RsGxsForumModel::COLUMN_THREAD_DATE,ROLE_THREAD_SORT).toString().toStdString() << "\" --> " << right_is_not_pinned << ") "; -#endif if(left_is_not_pinned ^ right_is_not_pinned) - { -#ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Local: " << ((m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned) << std::endl; -#endif return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top - } -#ifdef DEBUG_PINNED_POST_SORTING - std::cerr << "Remote: " << GxsIdRSTreeWidgetItem::operator<(other) << std::endl; -#endif return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ; } @@ -335,7 +321,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ; ui->threadTreeWidget->setSortingEnabled(true); - //ui->threadTreeWidget->setDynamicSortFilter(true);// is that useful?? ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; ui->threadTreeWidget->setItemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR,new AuthorItemDelegate()) ; @@ -377,22 +362,10 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget itemDelegate->setOnlyPlainText(true); ui->threadTreeWidget->setItemDelegate(itemDelegate); -#ifdef SUSPENDED_CODE - /* Set text of column "Read" to empty - without this the column has a number as header text */ - QTreeWidgetItem *headerItem = ui->threadTreeWidget->headerItem(); - headerItem->setText(COLUMN_THREAD_READ, "") ; - headerItem->setText(COLUMN_THREAD_DISTRIBUTION, ""); - headerItem->setData(COLUMN_THREAD_READ,Qt::UserRole, tr("Read status")) ; // this is used to display drop menus. - headerItem->setData(COLUMN_THREAD_DISTRIBUTION,Qt::UserRole, tr("Distribution")); -#endif - /* add filter actions */ ui->filterLineEdit->addFilter(QIcon(), tr("Title"), RsGxsForumModel::COLUMN_THREAD_TITLE, tr("Search Title")); ui->filterLineEdit->addFilter(QIcon(), tr("Date"), RsGxsForumModel::COLUMN_THREAD_DATE, tr("Search Date")); ui->filterLineEdit->addFilter(QIcon(), tr("Author"), RsGxsForumModel::COLUMN_THREAD_AUTHOR, tr("Search Author")); - //ui->filterLineEdit->addFilter(QIcon(), tr("Content"), RsGxsForumModel::COLUMN_THREAD_CONTENT, tr("Search Content")); - // see processSettings - //ui->filterLineEdit->setCurrentFilter(COLUMN_THREAD_TITLE); mLastViewType = -1; @@ -415,7 +388,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_AUTHOR, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_READ, QHeaderView::Fixed); QHeaderView_setSectionResizeModeColumn(ttheader, RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, QHeaderView::Fixed); - ui->threadTreeWidget->header()->setCascadingSectionResizes(true); + + ttheader->setCascadingSectionResizes(true); /* Set header sizes for the fixed columns and resize modes, must be set after processSettings */ ttheader->hideSection (RsGxsForumModel::COLUMN_THREAD_CONTENT); @@ -446,7 +420,6 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget forum visible to all other friends.

Afterwards you can unsubscribe from the context menu of the forum list at left.

")); #ifdef SUSPENDED_CODE ui->threadTreeWidget->enableColumnCustomize(true); - #endif } @@ -468,6 +441,8 @@ void GxsForumThreadWidget::blank() #endif ui->forumName->setText(""); + mThreadModel->clear(); + #ifdef SUSPENDED_CODE mStateHelper->setWidgetEnabled(ui->newthreadButton, false); mStateHelper->setWidgetEnabled(ui->previousButton, false); @@ -605,7 +580,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (complete) { /* Fill complete */ updateGroupData(); - //insertThreads(); + mThreadModel->setForum(groupId()); insertMessage(); mIgnoredMsgId.clear(); @@ -623,7 +598,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (grpIds.find(groupId())!=grpIds.end()){ updateGroup = true; /* Update threads */ - //insertThreads(); + mThreadModel->setForum(groupId()); } else { std::map > msgIds; getAllMsgIds(msgIds); @@ -633,10 +608,8 @@ void GxsForumThreadWidget::updateDisplay(bool complete) removeMessages(msgIds, mIgnoredMsgId); } - if (msgIds.find(groupId()) != msgIds.end()) { - /* Update threads */ - //insertThreads(); - } + if (msgIds.find(groupId()) != msgIds.end()) + mThreadModel->setForum(groupId()); /* Update threads */ } if (updateGroup) { @@ -1646,6 +1619,9 @@ void GxsForumThreadWidget::updateGroupName() } void GxsForumThreadWidget::updateGroupData() { + if(groupId().isNull()) + return; + mSubscribeFlags = 0; mSignFlags = 0; mThreadId.clear(); @@ -1692,7 +1668,6 @@ void GxsForumThreadWidget::updateGroupData() */ mForumGroup = group; - //insertGroupData(); mSubscribeFlags = group.mMeta.mSubscribeFlags; ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); From 44236000734f357258657e23bf43ddfc5a40feb5 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 3 Dec 2018 21:28:00 +0100 Subject: [PATCH 080/110] update posts when navigating with arrows --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 12 +++++++++--- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 73be7595c..070a56488 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -343,6 +343,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->newthreadButton->setText(tr("New thread")); connect(ui->threadTreeWidget, SIGNAL(clicked(QModelIndex)), this, SLOT(clickedThread(QModelIndex))); + connect(ui->threadTreeWidget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), this, SLOT(changedSelection(const QModelIndex&,const QModelIndex&))); connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox())); connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview())); @@ -497,6 +498,11 @@ void GxsForumThreadWidget::processSettings(bool load) Settings->endGroup(); } +void GxsForumThreadWidget::changedSelection(const QModelIndex& current,const QModelIndex&) +{ + changedThread(current); +} + void GxsForumThreadWidget::groupIdChanged() { ui->forumName->setText(groupId().isNull () ? "" : tr("Loading...")); @@ -628,12 +634,12 @@ QModelIndex GxsForumThreadWidget::GxsForumThreadWidget::getCurrentIndex() const } bool GxsForumThreadWidget::getCurrentPost(ForumModelPostEntry& fmpe) const { - QModelIndex index = getCurrentIndex() ; + QModelIndex indx = getCurrentIndex() ; - if(!index.isValid()) + if(!indx.isValid()) return false ; - return mThreadModel->getPostData(mThreadProxyModel->mapToSource(index),fmpe); + return mThreadModel->getPostData(mThreadProxyModel->mapToSource(indx),fmpe); } void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 07c62e76d..e4d4c8d7a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -32,6 +32,7 @@ class QTreeWidgetItem; class RSTreeWidgetItemCompareRole; class RsGxsForumMsg; class GxsForumsFillThread; +class QItemSelection; class RsGxsForumGroup; class RsGxsForumModel; class RsGxsForumMsg; @@ -97,6 +98,7 @@ private slots: void threadListCustomPopupMenu(QPoint point); void contextMenuTextBrowser(QPoint point); + void changedSelection(const QModelIndex &, const QModelIndex &); void changedThread(QModelIndex index); void changedVersion(); void clickedThread (QModelIndex index); From ec0bb5347e17419349af588fb69098691372530c Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 3 Dec 2018 21:56:11 +0100 Subject: [PATCH 081/110] added missing emit of layoutAboutToBeChanged() in forum model --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index cdb8d5dcf..d4ca2b085 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -664,6 +664,9 @@ void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) // we do not set mForumGroupId yet. We'll do it when the forum data is updated. + if(forum_group_id.isNull()) + return; + update_posts(forum_group_id); } @@ -1136,6 +1139,8 @@ void RsGxsForumModel::setMsgReadStatus(const QModelIndex& i,bool read_status,boo if(!i.isValid()) return ; + emit layoutAboutToBeChanged(); + void *ref = i.internalPointer(); uint32_t entry = 0; @@ -1146,6 +1151,7 @@ void RsGxsForumModel::setMsgReadStatus(const QModelIndex& i,bool read_status,boo recursSetMsgReadStatus(entry,read_status,with_children) ; recursUpdateReadStatusAndTimes(0,has_unread_below,has_read_below); + emit layoutChanged(); emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); } From fb962c4b5bc05b365c45962c44861f72634afa49 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 4 Dec 2018 09:36:06 +0100 Subject: [PATCH 082/110] attempt to fix crash when threads collide in forum model --- .../src/gui/gxsforums/GxsForumModel.cpp | 49 ++++++++++--------- .../src/gui/gxsforums/GxsForumModel.h | 3 ++ .../gui/gxsforums/GxsForumThreadWidget.cpp | 20 ++++++++ .../src/gui/gxsforums/GxsForumThreadWidget.h | 1 + 4 files changed, 50 insertions(+), 23 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index d4ca2b085..e5c49caa3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -49,39 +49,46 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) mFilteringEnabled=false; } +void RsGxsForumModel::preMods() +{ + emit layoutAboutToBeChanged(); + beginResetModel(); +} +void RsGxsForumModel::postMods() +{ + endResetModel(); + emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); + emit layoutChanged(); +} + void RsGxsForumModel::setTreeMode(TreeMode mode) { if(mode == mTreeMode) return; - emit layoutAboutToBeChanged(); - + preMods(); mTreeMode = mode; - - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - emit layoutChanged(); + postMods(); } void RsGxsForumModel::setSortMode(SortMode mode) { - emit layoutAboutToBeChanged(); + preMods(); mSortMode = mode; - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - emit layoutChanged(); + postMods(); } void RsGxsForumModel::initEmptyHierarchy(std::vector& posts) { - emit layoutAboutToBeChanged(); + preMods(); posts.resize(1); // adds a sentinel item posts[0].mTitle = "Root sentinel post" ; posts[0].mParent = 0; - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - emit layoutChanged(); + postMods(); } int RsGxsForumModel::rowCount(const QModelIndex& parent) const @@ -474,7 +481,7 @@ uint32_t RsGxsForumModel::recursUpdateFilterStatus(ForumModelIndex i,int column, void RsGxsForumModel::setFilter(int column,const QStringList& strings,uint32_t& count) { - emit layoutAboutToBeChanged(); + preMods(); if(!strings.empty()) { @@ -484,8 +491,7 @@ void RsGxsForumModel::setFilter(int column,const QStringList& strings,uint32_t& else mFilteringEnabled = false; - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - emit layoutChanged(); + postMods(); } QVariant RsGxsForumModel::missingRole(const ForumModelPostEntry& fmpe,int column) const @@ -672,19 +678,18 @@ void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) void RsGxsForumModel::clear() { - emit layoutAboutToBeChanged(); + preMods(); mPosts.clear(); mPostVersions.clear(); - emit layoutChanged(); + postMods(); emit forumLoaded(); - emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); } void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions) { - emit layoutAboutToBeChanged(); + preMods(); mForumGroup = group; mPosts = posts; @@ -707,9 +712,8 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector > &ms void GxsForumThreadWidget::updateDisplay(bool complete) { + if(mUpdating) + return; + if (complete) { /* Fill complete */ + mUpdating=true; updateGroupData(); mThreadModel->setForum(groupId()); insertMessage(); @@ -604,6 +609,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (grpIds.find(groupId())!=grpIds.end()){ updateGroup = true; /* Update threads */ + mUpdating=true; mThreadModel->setForum(groupId()); } else { std::map > msgIds; @@ -615,7 +621,10 @@ void GxsForumThreadWidget::updateDisplay(bool complete) } if (msgIds.find(groupId()) != msgIds.end()) + { + mUpdating=true; mThreadModel->setForum(groupId()); /* Update threads */ + } } if (updateGroup) { @@ -855,6 +864,9 @@ void GxsForumThreadWidget::togglethreadview_internal() void GxsForumThreadWidget::changedVersion() { + if(mUpdating) + return; + mThreadId = RsGxsMessageId(ui->versions_CB->itemData(ui->versions_CB->currentIndex()).toString().toStdString()) ; ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; @@ -863,6 +875,9 @@ void GxsForumThreadWidget::changedVersion() void GxsForumThreadWidget::changedThread(QModelIndex index) { + if(mUpdating) + return; + if(!index.isValid()) { mThreadId.clear(); @@ -884,6 +899,9 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) void GxsForumThreadWidget::clickedThread(QModelIndex index) { + if(mUpdating) + return; + if(!index.isValid()) return; @@ -1622,6 +1640,8 @@ void GxsForumThreadWidget::updateGroupName() ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); ui->threadTreeWidget->update(); + + mUpdating = false; } void GxsForumThreadWidget::updateGroupData() { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index e4d4c8d7a..46e80aa33 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -176,6 +176,7 @@ private: QString mForumDescription; int mSubscribeFlags; int mSignFlags; + bool mUpdating; bool mInProcessSettings; bool mInMsgAsReadUnread; int mLastViewType; From b63544e85648b3a32faad4a72073dcac69f6ce8c Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 4 Dec 2018 22:14:54 +0100 Subject: [PATCH 083/110] suppressed 2 uninitialized memory read in ForumModel --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index e5c49caa3..c16a8752b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -47,6 +47,7 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) mUseChildTS=false; mFilteringEnabled=false; + mTreeMode = TREE_MODE_TREE; } void RsGxsForumModel::preMods() @@ -489,7 +490,10 @@ void RsGxsForumModel::setFilter(int column,const QStringList& strings,uint32_t& mFilteringEnabled = true; } else + { + count=0; mFilteringEnabled = false; + } postMods(); } From 6fae40d417fafcb2c0573a7755a1cb57d44b0338 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 4 Dec 2018 23:10:24 +0100 Subject: [PATCH 084/110] trying new notification system using begin/end remove/insert rows to avoid crash --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index c16a8752b..6fe7f2ee2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -53,13 +53,12 @@ RsGxsForumModel::RsGxsForumModel(QObject *parent) void RsGxsForumModel::preMods() { emit layoutAboutToBeChanged(); - beginResetModel(); } void RsGxsForumModel::postMods() { - endResetModel(); + //emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount(QModelIndex())-1,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - emit layoutChanged(); + //emit layoutChanged(); } void RsGxsForumModel::setTreeMode(TreeMode mode) @@ -695,6 +694,9 @@ void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector Date: Tue, 4 Dec 2018 23:36:07 +0100 Subject: [PATCH 085/110] keep current selection when updating a forum. Still need to keep the expand/collapse property --- .../src/gui/gxsforums/GxsForumModel.cpp | 2 -- .../gui/gxsforums/GxsForumThreadWidget.cpp | 27 ++++++++++++++----- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 +- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 6fe7f2ee2..d3336abe5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -56,9 +56,7 @@ void RsGxsForumModel::preMods() } void RsGxsForumModel::postMods() { - //emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount(QModelIndex())-1,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(0,COLUMN_THREAD_NB_COLUMNS-1,(void*)NULL)); - //emit layoutChanged(); } void RsGxsForumModel::setTreeMode(TreeMode mode) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 1edfe9e34..b6011a67c 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -338,7 +338,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget connect(ui->newmessageButton, SIGNAL(clicked()), this, SLOT(replytoforummessage())); connect(ui->newthreadButton, SIGNAL(clicked()), this, SLOT(createthread())); - connect(mThreadModel,SIGNAL(forumLoaded()),this,SLOT(updateGroupName())); + connect(mThreadModel,SIGNAL(forumLoaded()),this,SLOT(postForumLoading())); ui->newmessageButton->setText(tr("Reply")); ui->newthreadButton->setText(tr("New thread")); @@ -589,6 +589,8 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (complete) { /* Fill complete */ + + mUpdating=true; updateGroupData(); mThreadModel->setForum(groupId()); @@ -1601,6 +1603,7 @@ void GxsForumThreadWidget::filterItems(const QString& text) ui->filterLineEdit->setToolTip(tr("Found %1 results.").arg(count)) ; } +#ifdef TO_REMOVE bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn) { bool visible = true; @@ -1627,16 +1630,28 @@ bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text return (visible || visibleChildCount); } +#endif /*********************** **** **** **** ***********************/ /** Request / Response of Data ********************************/ /*********************** **** **** **** ***********************/ -void GxsForumThreadWidget::updateGroupName() +void GxsForumThreadWidget::postForumLoading() { - ui->threadTreeWidget->selectionModel()->clear(); - ui->threadTreeWidget->selectionModel()->reset(); - mThreadId.clear(); + QModelIndex indx = mThreadModel->getIndexOfMessage(mThreadId); + + if(indx.isValid()) + { + QModelIndex index = mThreadProxyModel->mapFromSource(indx); + ui->threadTreeWidget->selectionModel()->select(index,QItemSelectionModel::ClearAndSelect); + } + else + { + ui->threadTreeWidget->selectionModel()->clear(); + ui->threadTreeWidget->selectionModel()->reset(); + mThreadId.clear(); + } + ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); ui->threadTreeWidget->update(); @@ -1650,7 +1665,7 @@ void GxsForumThreadWidget::updateGroupData() mSubscribeFlags = 0; mSignFlags = 0; - mThreadId.clear(); + //mThreadId.clear(); mForumDescription.clear(); ui->threadTreeWidget->selectionModel()->clear(); ui->threadTreeWidget->selectionModel()->reset(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 46e80aa33..4a01628a1 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -102,7 +102,7 @@ private slots: void changedThread(QModelIndex index); void changedVersion(); void clickedThread (QModelIndex index); - void updateGroupName(); + void postForumLoading(); void reply_with_private_message(); void replytoforummessage(); From 600a3d8e169c0bce0d7e9f1f3353f3e3082d4764 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 5 Dec 2018 20:28:58 +0100 Subject: [PATCH 086/110] fixed saving/restoring of expanded items in forum model --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 100 ++++++++++++------ .../src/gui/gxsforums/GxsForumThreadWidget.h | 7 +- 2 files changed, 74 insertions(+), 33 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index b6011a67c..f664842ce 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -582,16 +582,47 @@ static void removeMessages(std::map > &ms } } +void GxsForumThreadWidget::saveExpandedItems(QList& expanded_items) const +{ + expanded_items.clear(); + + for(int row = 0; row < mThreadProxyModel->rowCount(); ++row) + { + std::string path = mThreadProxyModel->index(row,0).data(Qt::DisplayRole).toString().toStdString(); + + recursSaveExpandedItems(mThreadProxyModel->index(row,0),expanded_items); + } +} + +void GxsForumThreadWidget::recursSaveExpandedItems(const QModelIndex& index, QList& expanded_items) const +{ + if(ui->threadTreeWidget->isExpanded(index)) + { + for(int row=0;rowrowCount(index);++row) + recursSaveExpandedItems(index.child(row,0),expanded_items) ; + + RsGxsMessageId message_id(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); + expanded_items.push_back(message_id); + } +} + +void GxsForumThreadWidget::recursRestoreExpandedItems(const QModelIndex& index, const QList& expanded_items) +{ + for(auto it(expanded_items.begin());it!=expanded_items.end();++it) + ui->threadTreeWidget->setExpanded( mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(*it)) ,true) ; +} + void GxsForumThreadWidget::updateDisplay(bool complete) { - if(mUpdating) - return; + if(mUpdating) + return; if (complete) { /* Fill complete */ + saveExpandedItems(mSavedExpandedMessages); - mUpdating=true; + mUpdating=true; updateGroupData(); mThreadModel->setForum(groupId()); insertMessage(); @@ -600,37 +631,44 @@ void GxsForumThreadWidget::updateDisplay(bool complete) return; } + else + { - bool updateGroup = false; - const std::set &grpIdsMeta = getGrpIdsMeta(); + bool updateGroup = false; + const std::set &grpIdsMeta = getGrpIdsMeta(); - if(grpIdsMeta.find(groupId())!=grpIdsMeta.end()) - updateGroup = true; + if(grpIdsMeta.find(groupId())!=grpIdsMeta.end()) + updateGroup = true; - const std::set &grpIds = getGrpIds(); - if (grpIds.find(groupId())!=grpIds.end()){ - updateGroup = true; - /* Update threads */ - mUpdating=true; - mThreadModel->setForum(groupId()); - } else { - std::map > msgIds; - getAllMsgIds(msgIds); + const std::set &grpIds = getGrpIds(); - if (!mIgnoredMsgId.empty()) { - /* Filter ignored messages */ - removeMessages(msgIds, mIgnoredMsgId); + if (grpIds.find(groupId())!=grpIds.end()){ + updateGroup = true; + /* Update threads */ + mUpdating=true; + mThreadModel->setForum(groupId()); + } + else + { + std::map > msgIds; + getAllMsgIds(msgIds); + + if (!mIgnoredMsgId.empty()) /* Filter ignored messages */ + removeMessages(msgIds, mIgnoredMsgId); + + if (msgIds.find(groupId()) != msgIds.end()) + { + mUpdating=true; + + saveExpandedItems(mSavedExpandedMessages); + + mThreadModel->setForum(groupId()); /* Update threads */ + } } - if (msgIds.find(groupId()) != msgIds.end()) - { - mUpdating=true; - mThreadModel->setForum(groupId()); /* Update threads */ - } - } + if (updateGroup) + updateGroupData(); - if (updateGroup) { - updateGroupData(); } } @@ -1531,10 +1569,6 @@ void GxsForumThreadWidget::replyForumMessageData(const RsGxsForumMsg &msg) { CreateGxsForumMsg *cfm = new CreateGxsForumMsg(groupId(), mThreadId,RsGxsMessageId()); -// QTextDocument doc ; -// doc.setHtml(QString::fromUtf8(msg.mMsg.c_str()) ); -// std::string cited_text(doc.toPlainText().toStdString()) ; - RsHtml::makeQuotedText(ui->postText); cfm->insertPastedText(RsHtml::makeQuotedText(ui->postText)) ; @@ -1651,11 +1685,14 @@ void GxsForumThreadWidget::postForumLoading() ui->threadTreeWidget->selectionModel()->reset(); mThreadId.clear(); } + // we also need to restore expanded threads ui->forumName->setText(QString::fromUtf8(mForumGroup.mMeta.mGroupName.c_str())); ui->threadTreeWidget->sortByColumn(RsGxsForumModel::COLUMN_THREAD_DATE, Qt::DescendingOrder); ui->threadTreeWidget->update(); + recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages); + mUpdating = false; } void GxsForumThreadWidget::updateGroupData() @@ -1665,7 +1702,6 @@ void GxsForumThreadWidget::updateGroupData() mSubscribeFlags = 0; mSignFlags = 0; - //mThreadId.clear(); mForumDescription.clear(); ui->threadTreeWidget->selectionModel()->clear(); ui->threadTreeWidget->selectionModel()->reset(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 4a01628a1..9dba7efb5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -152,6 +152,10 @@ private: void insertMessage(); void insertGroupData(); + void recursRestoreExpandedItems(const QModelIndex& index, const QList& expanded_items); + void recursSaveExpandedItems(const QModelIndex& index, QList& expanded_items) const; + void saveExpandedItems(QList& expanded_items) const; + int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); void setMsgReadStatus(QList &rows, bool read); void markMsgAsReadUnread(bool read, bool children, bool forum); @@ -159,7 +163,7 @@ private: void togglethreadview_internal(); - bool filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn); + //bool filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn); void processSettings(bool bLoad); @@ -197,6 +201,7 @@ private: RsGxsForumModel *mThreadModel; QSortFilterProxyModel *mThreadProxyModel; + QList mSavedExpandedMessages; Ui::GxsForumThreadWidget *ui; }; From db0a22a226249c09a4d79c7d8e41ac6b17c24892 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 6 Dec 2018 20:46:44 +0100 Subject: [PATCH 087/110] JSON API for /rsFiles/FileClearCompleted --- libretroshare/src/ft/ftcontroller.cc | 12 ++++++------ libretroshare/src/retroshare/rsfiles.h | 15 +++++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/libretroshare/src/ft/ftcontroller.cc b/libretroshare/src/ft/ftcontroller.cc index 06e8a0e9c..18dec7686 100644 --- a/libretroshare/src/ft/ftcontroller.cc +++ b/libretroshare/src/ft/ftcontroller.cc @@ -1396,25 +1396,25 @@ bool ftController::FileControl(const RsFileHash& hash, uint32_t flags) return true; } -bool ftController::FileClearCompleted() +bool ftController::FileClearCompleted() { #ifdef CONTROL_DEBUG std::cerr << "ftController::FileClearCompleted()" <::iterator it(mCompleted.begin());it!=mCompleted.end();++it) - delete it->second ; + for(auto it(mCompleted.begin()); it != mCompleted.end(); ++it) + delete it->second; mCompleted.clear(); IndicateConfigChanged(); - } /******* UNLOCKED ********/ + } RsServer::notify()->notifyDownloadCompleteCount(0); - return false; + return true; } /* get Details of File Transfers */ diff --git a/libretroshare/src/retroshare/rsfiles.h b/libretroshare/src/retroshare/rsfiles.h index 811c172d5..2a66f6405 100644 --- a/libretroshare/src/retroshare/rsfiles.h +++ b/libretroshare/src/retroshare/rsfiles.h @@ -318,7 +318,7 @@ public: /** * @brief Get free disk space limit * @jsonapi{development} - * @return current current minimum free space on disk in MB + * @return current minimum free space on disk in MB */ virtual uint32_t freeDiskSpaceLimit() const = 0; @@ -329,8 +329,15 @@ public: */ virtual void setFreeDiskSpaceLimit(uint32_t minimumFreeMB) = 0; - virtual bool FileControl(const RsFileHash& hash, uint32_t flags) = 0; - virtual bool FileClearCompleted() = 0; + virtual bool FileControl(const RsFileHash& hash, uint32_t flags) = 0; + + /** + * @brief Clear completed downloaded files list + * @jsonapi{development} + * @return false on error, true otherwise + */ + virtual bool FileClearCompleted() = 0; + virtual void setDefaultEncryptionPolicy(uint32_t policy)=0; // RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT/PERMISSIVE virtual uint32_t defaultEncryptionPolicy()=0; virtual void setMaxUploadSlotsPerFriend(uint32_t n)=0; @@ -390,7 +397,7 @@ public: * @return true if file found, false otherwise */ virtual bool FileDetails( - const RsFileHash &hash, FileSearchFlags hintflags, FileInfo& info ) = 0; + const RsFileHash& hash, FileSearchFlags hintflags, FileInfo& info ) = 0; virtual bool isEncryptedSource(const RsPeerId& virtual_peer_id) =0; From bdf9bd5c5660291b2f4430d946b11757f2535e15 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Thu, 6 Dec 2018 20:49:51 +0100 Subject: [PATCH 088/110] JSON API fix OPTION method handling for authenticated methods --- libretroshare/src/jsonapi/jsonapi.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/jsonapi/jsonapi.cpp b/libretroshare/src/jsonapi/jsonapi.cpp index 091d25d8c..a6293d00f 100644 --- a/libretroshare/src/jsonapi/jsonapi.cpp +++ b/libretroshare/src/jsonapi/jsonapi.cpp @@ -49,7 +49,7 @@ JsonApiServer::corsHeaders = { { "Access-Control-Allow-Origin", "*" }, { "Access-Control-Allow-Methods", "GET, POST, OPTIONS"}, - { "Access-Control-Allow-Headers", "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" }, + { "Access-Control-Allow-Headers", "Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" }, { "Access-Control-Expose-Headers", "Content-Length,Content-Range" } }; @@ -58,7 +58,7 @@ JsonApiServer::corsOptionsHeaders = { { "Access-Control-Allow-Origin", "*" }, { "Access-Control-Allow-Methods", "GET, POST, OPTIONS"}, - { "Access-Control-Allow-Headers", "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" }, + { "Access-Control-Allow-Headers", "Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range" }, { "Access-Control-Max-Age", "1728000" }, // 20 days { "Content-Type", "text/plain; charset=utf-8" }, { "Content-Length", "0" } @@ -322,6 +322,12 @@ void JsonApiServer::registerHandler( const std::shared_ptr session, const std::function)>& callback ) { + if(session->get_request()->get_method() == "OPTIONS") + { + callback(session); + return; + } + if(!rsLoginHelper->isLoggedIn()) { session->close(rb::CONFLICT); From 5b8a64b6777c833642e5ca3ea7e067ab9c501b34 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 6 Dec 2018 23:04:53 +0100 Subject: [PATCH 089/110] fixed a number of bugs in the update/display of forum model --- libretroshare/src/gxs/rsgxsdataaccess.cc | 5 +- retroshare-gui/src/gui/gxs/GxsIdDetails.cpp | 2 +- .../src/gui/gxsforums/GxsForumModel.cpp | 46 ++++- .../src/gui/gxsforums/GxsForumModel.h | 4 +- .../gui/gxsforums/GxsForumThreadWidget.cpp | 186 +++++++++--------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 7 +- 6 files changed, 140 insertions(+), 110 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index f9049d9f0..1206696f7 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -1714,10 +1714,11 @@ void RsGxsDataAccess::filterMsgList( MsgMetaFilter::const_iterator cit = msgMetas.find(groupId); if(cit == msgMetas.end()) continue; - +#ifdef DATA_DEBUG std::cerr << __PRETTY_FUNCTION__ << " " << msgsIdSet.size() << " for group: " << groupId << " before filtering" << std::endl; +#endif for( std::set::iterator msgIdIt = msgsIdSet.begin(); msgIdIt != msgsIdSet.end(); ) @@ -1738,9 +1739,11 @@ void RsGxsDataAccess::filterMsgList( else msgIdIt = msgsIdSet.erase(msgIdIt); } +#ifdef DATA_DEBUG std::cerr << __PRETTY_FUNCTION__ << " " << msgsIdSet.size() << " for group: " << groupId << " after filtering" << std::endl; +#endif } } diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index fac557122..6168090eb 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -37,7 +37,7 @@ #define IMAGE_PGPKNOWN ":/images/contact.png" #define IMAGE_PGPUNKNOWN ":/images/tags/pgp-unknown.png" #define IMAGE_ANON ":/images/tags/anon.png" -#define IMAGE_BANNED ":/icons/yellow_biohazard64.png" +#define IMAGE_BANNED ":/icons/biohazard_red.png" #define IMAGE_DEV_AMBASSADOR ":/images/tags/dev-ambassador.png" #define IMAGE_DEV_CONTRIBUTOR ":/images/tags/vote_down.png" diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index d3336abe5..444b8e7ee 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -664,13 +664,8 @@ QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col return QVariant(); } -void RsGxsForumModel::setForum(const RsGxsGroupId& forum_group_id) +void RsGxsForumModel::updateForum(const RsGxsGroupId& forum_group_id) { - //if(mForumGroup.mMeta.mGroupId == forum_group_id) - // return ; - - // we do not set mForumGroupId yet. We'll do it when the forum data is updated. - if(forum_group_id.isNull()) return; @@ -818,12 +813,19 @@ void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,c // Early check for a message that should be hidden because its author // is flagged with a bad reputation + computeReputationLevel(mForumGroup.mMeta.mSignFlags,fentry); +} + +void RsGxsForumModel::computeReputationLevel(uint32_t forum_sign_flags,ForumModelPostEntry& fentry) +{ uint32_t idflags =0; - RsReputations::ReputationLevel reputation_level = rsReputations->overallReputationLevel(msg.mMeta.mAuthorId,&idflags) ; + RsReputations::ReputationLevel reputation_level = rsReputations->overallReputationLevel(fentry.mAuthorId,&idflags) ; bool redacted = false; if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) - fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_REDACTED; + fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_REDACTED; + else + fentry.mPostFlags &= ~ForumModelPostEntry::FLAG_POST_IS_REDACTED; // We use a specific item model for forums in order to handle the post pinning. @@ -831,7 +833,7 @@ void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,c fentry.mReputationWarningLevel = 3 ; else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) fentry.mReputationWarningLevel = 2 ; - else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(mForumGroup.mMeta.mSignFlags,idflags)) + else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(forum_sign_flags,idflags)) fentry.mReputationWarningLevel = 1 ; else fentry.mReputationWarningLevel = 0 ; @@ -1278,4 +1280,30 @@ void RsGxsForumModel::debug_dump() } #endif +void RsGxsForumModel::setAuthorOpinion(const QModelIndex& indx,RsReputations::Opinion op) +{ + if(!indx.isValid()) + return ; + void *ref = indx.internalPointer(); + uint32_t entry = 0; + + if(!convertRefPointerToTabEntry(ref,entry) || entry >= mPosts.size()) + return ; + + std::cerr << "Setting own opinion for author " << mPosts[entry].mAuthorId << " to " << op << std::endl; + RsGxsId author_id = mPosts[entry].mAuthorId; + + rsReputations->setOwnOpinion(author_id,op) ; + + // update opinions and distribution flags. No need to re-load all posts. + + for(uint32_t i=0;i > getPostVersions(const RsGxsMessageId& mid) const; // This method will asynchroneously update the data - void setForum(const RsGxsGroupId& forumGroup); + void updateForum(const RsGxsGroupId& forumGroup); void setTreeMode(TreeMode mode) ; void setSortMode(SortMode mode) ; @@ -117,6 +117,7 @@ public: void setMsgReadStatus(const QModelIndex &i, bool read_status, bool with_children); void setFilter(int column, const QStringList &strings, uint32_t &count) ; + void setAuthorOpinion(const QModelIndex& indx,RsReputations::Opinion op); int rowCount(const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; @@ -175,6 +176,7 @@ private: static bool convertTabEntryToRefPointer(uint32_t entry,void *& ref); static bool convertRefPointerToTabEntry(void *ref,uint32_t& entry); + static void computeReputationLevel(uint32_t forum_sign_flags, ForumModelPostEntry& entry); void update_posts(const RsGxsGroupId &group_id); void setForumMessageSummary(const std::vector& messages); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index f664842ce..5fcdf948d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -304,9 +304,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget setUpdateWhenInvisible(true); - mSubscribeFlags = 0; mUpdating = false; - mSignFlags = 0; mUnreadCount = 0; mNewCount = 0; @@ -405,7 +403,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget setGroupId(forumId); - ui->threadTreeWidget->installEventFilter(this) ; + //ui->threadTreeWidget->installEventFilter(this) ; ui->postText->clear() ; ui->by_label->setId(RsGxsId()) ; @@ -511,7 +509,7 @@ void GxsForumThreadWidget::groupIdChanged() mNewCount = 0; mUnreadCount = 0; - mThreadModel->setForum(groupId()); + //mThreadModel->updateForum(groupId()); updateDisplay(true); } @@ -535,6 +533,7 @@ QIcon GxsForumThreadWidget::groupIcon() return QIcon(); } +#ifdef TO_REMOVE void GxsForumThreadWidget::changeEvent(QEvent *e) { RsGxsUpdateBroadcastWidget::changeEvent(e); @@ -581,6 +580,7 @@ static void removeMessages(std::map > &ms } } } +#endif void GxsForumThreadWidget::saveExpandedItems(QList& expanded_items) const { @@ -614,62 +614,74 @@ void GxsForumThreadWidget::recursRestoreExpandedItems(const QModelIndex& index, void GxsForumThreadWidget::updateDisplay(bool complete) { + std::cerr << "udateDisplay: groupId()=" << groupId()<< std::endl; + if(mUpdating) + { + std::cerr << " Already updating. Return!"<< std::endl; return; + } - if (complete) { - /* Fill complete */ + if(groupId().isNull()) + { + std::cerr << " group_id=0. Return!"<< std::endl; + return; + } + if(mForumGroup.mMeta.mGroupId.isNull() && !groupId().isNull()) + { + std::cerr << " inconsistent group data. Reloading!"<< std::endl; + complete = true; + } + + if(!complete) + { + std::cerr << " checking changed group data and msgs"<< std::endl; + + const std::set &grpIdsMeta = getGrpIdsMeta(); + + if(grpIdsMeta.find(groupId())!=grpIdsMeta.end()) + { + std::cerr << " grpMeta change. reloading!" << std::endl; + complete = true; + } + + const std::set &grpIds = getGrpIds(); + + if (grpIds.find(groupId())!=grpIds.end()) + { + std::cerr << " grp data change. reloading!" << std::endl; + complete = true; + } + else + { + // retrieve the list of modified msg ids + // if current group is listed in the map, reload the whole hierarchy + + std::map > msgIds; + getAllMsgIds(msgIds); + + // if (!mIgnoredMsgId.empty()) /* Filter ignored messages */ + // removeMessages(msgIds, mIgnoredMsgId); + + if (msgIds.find(groupId()) != msgIds.end()) + { + std::cerr << " msg data change. reloading!" << std::endl; + complete=true; + } + } + } + + if(complete) // need to update the group data, reload the messages etc. + { saveExpandedItems(mSavedExpandedMessages); mUpdating=true; updateGroupData(); - mThreadModel->setForum(groupId()); - insertMessage(); - - mIgnoredMsgId.clear(); + mThreadModel->updateForum(groupId()); return; } - else - { - - bool updateGroup = false; - const std::set &grpIdsMeta = getGrpIdsMeta(); - - if(grpIdsMeta.find(groupId())!=grpIdsMeta.end()) - updateGroup = true; - - const std::set &grpIds = getGrpIds(); - - if (grpIds.find(groupId())!=grpIds.end()){ - updateGroup = true; - /* Update threads */ - mUpdating=true; - mThreadModel->setForum(groupId()); - } - else - { - std::map > msgIds; - getAllMsgIds(msgIds); - - if (!mIgnoredMsgId.empty()) /* Filter ignored messages */ - removeMessages(msgIds, mIgnoredMsgId); - - if (msgIds.find(groupId()) != msgIds.end()) - { - mUpdating=true; - - saveExpandedItems(mSavedExpandedMessages); - - mThreadModel->setForum(groupId()); /* Update threads */ - } - } - - if (updateGroup) - updateGroupData(); - - } } QModelIndex GxsForumThreadWidget::GxsForumThreadWidget::getCurrentIndex() const @@ -728,7 +740,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) connect(flagasnegativeAct, SIGNAL(triggered()), this, SLOT(flagperson())); QAction *newthreadAct = new QAction(QIcon(IMAGE_MESSAGE), tr("Start New Thread"), &contextMnu); - newthreadAct->setEnabled (IS_GROUP_SUBSCRIBED(mSubscribeFlags)); + newthreadAct->setEnabled (IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)); connect(newthreadAct , SIGNAL(triggered()), this, SLOT(createthread())); QAction* expandAll = new QAction(tr("Expand all"), &contextMnu); @@ -752,7 +764,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) QAction *showinpeopleAct = new QAction(QIcon(":/images/info16.png"), tr("Show author in people tab"), &contextMnu); connect(showinpeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab())); - if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) + if (IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) { markMsgAsReadChildren->setEnabled(current_post.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_UNREAD_CHILDREN); markMsgAsUnreadChildren->setEnabled(current_post.mPostFlags & ForumModelPostEntry::FLAG_POST_HAS_READ_CHILDREN); @@ -796,7 +808,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) } } - if(IS_GROUP_ADMIN(mSubscribeFlags) && (current_post.mParent == 0)) + if(IS_GROUP_ADMIN(mForumGroup.mMeta.mSubscribeFlags) && (current_post.mParent == 0)) contextMnu.addAction(pinUpPostAct); } @@ -861,9 +873,9 @@ void GxsForumThreadWidget::contextMenuTextBrowser(QPoint point) delete(contextMnu); } +#ifdef TODO bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event) { -#ifdef TODO if (obj == ui->threadTreeWidget) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast(event); @@ -877,9 +889,9 @@ bool GxsForumThreadWidget::eventFilter(QObject *obj, QEvent *event) } // pass the event on to the parent class return RsGxsUpdateBroadcastWidget::eventFilter(obj, event); -#endif return RsGxsUpdateBroadcastWidget::eventFilter(obj, event); } +#endif void GxsForumThreadWidget::togglethreadview() { @@ -945,18 +957,11 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) if(!index.isValid()) return; - RsGxsMessageId tmp(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); - - if( tmp.isNull()) - return; - - mThreadId = tmp; - mOrigThreadId = tmp; - std::cerr << "Clicked on message ID " << mThreadId << std::endl; if (index.column() == RsGxsForumModel::COLUMN_THREAD_READ) { + std::cerr << " changing read status" << std::endl; ForumModelPostEntry fmpe; QModelIndex src_index = mThreadProxyModel->mapToSource(index); @@ -965,7 +970,7 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) mThreadModel->setMsgReadStatus(src_index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); } else - changedThread(index); + std::cerr << " doing nothing" << std::endl; } static void cleanupItems (QList &items) @@ -1011,7 +1016,7 @@ void GxsForumThreadWidget::insertMessage() ui->versions_CB->hide(); ui->time_label->show(); - ui->postText->setText(mForumDescription); + ui->postText->setText(QString::fromUtf8(mForumGroup.mDescription.c_str())); return; } @@ -1034,7 +1039,7 @@ void GxsForumThreadWidget::insertMessage() return; } - mStateHelper->setWidgetEnabled(ui->newmessageButton, (IS_GROUP_SUBSCRIBED(mSubscribeFlags) && mThreadId.isNull() == false)); + mStateHelper->setWidgetEnabled(ui->newmessageButton, (IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags) && mThreadId.isNull() == false)); /* blank text, incase we get nothing */ ui->postText->clear(); @@ -1139,6 +1144,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) ui->lineLeft->show(); ui->by_text_label->show(); ui->by_label->show(); + ui->threadTreeWidget->setFocus(); if(redacted) { @@ -1248,7 +1254,7 @@ void GxsForumThreadWidget::nextUnreadMessage() void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum) { - if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { + if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) { return; } @@ -1337,7 +1343,7 @@ void GxsForumThreadWidget::subscribeGroup(bool subscribe) void GxsForumThreadWidget::createmessage() { - if (groupId().isNull () || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) { + if (groupId().isNull () || !IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) { return; } @@ -1418,14 +1424,8 @@ void GxsForumThreadWidget::flagperson() } RsReputations::Opinion opinion = static_cast(qobject_cast(sender())->data().toUInt()); - ForumModelPostEntry fmpe ; - getCurrentPost(fmpe); - RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId); - - std::cerr << "Setting own opinion for author " << fmpe.mAuthorId << " to " << opinion << std::endl; - - rsReputations->setOwnOpinion(fmpe.mAuthorId,opinion) ; + mThreadModel->setAuthorOpinion(mThreadProxyModel->mapToSource(getCurrentIndex()),opinion); } void GxsForumThreadWidget::replytoforummessage() { async_msg_action( &GxsForumThreadWidget::replyForumMessageData ); } @@ -1672,15 +1672,21 @@ bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text void GxsForumThreadWidget::postForumLoading() { + std::cerr << "Post forum loading..." << std::endl; + QModelIndex indx = mThreadModel->getIndexOfMessage(mThreadId); - if(indx.isValid()) + if(!mThreadId.isNull() && indx.isValid()) { QModelIndex index = mThreadProxyModel->mapFromSource(indx); - ui->threadTreeWidget->selectionModel()->select(index,QItemSelectionModel::ClearAndSelect); + ui->threadTreeWidget->selectionModel()->select(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + + std::cerr << " re-selecting index of message " << mThreadId << " to " << indx.row() << "," << indx.column() << " " << (void*)indx.internalPointer() << std::endl; } else { + std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl; + ui->threadTreeWidget->selectionModel()->clear(); ui->threadTreeWidget->selectionModel()->reset(); mThreadId.clear(); @@ -1692,7 +1698,6 @@ void GxsForumThreadWidget::postForumLoading() ui->threadTreeWidget->update(); recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages); - mUpdating = false; } void GxsForumThreadWidget::updateGroupData() @@ -1700,14 +1705,9 @@ void GxsForumThreadWidget::updateGroupData() if(groupId().isNull()) return; - mSubscribeFlags = 0; - mSignFlags = 0; - mForumDescription.clear(); - ui->threadTreeWidget->selectionModel()->clear(); - ui->threadTreeWidget->selectionModel()->reset(); - mThreadProxyModel->clear(); - - emit groupChanged(this); + // ui->threadTreeWidget->selectionModel()->clear(); + // ui->threadTreeWidget->selectionModel()->reset(); + // mThreadProxyModel->clear(); RsThread::async([this]() { @@ -1732,7 +1732,7 @@ void GxsForumThreadWidget::updateGroupData() // 2 - sort the messages into a proper hierarchy - RsGxsForumGroup group = groups[0]; + RsGxsForumGroup *group = new RsGxsForumGroup(groups[0]); // we use a pointer in order to avoid group deletion while we're in the thread. // 3 - update the model in the UI thread. @@ -1744,12 +1744,11 @@ void GxsForumThreadWidget::updateGroupData() * Qt::QueuedConnection is important! */ - mForumGroup = group; - mSubscribeFlags = group.mMeta.mSubscribeFlags; + mForumGroup = *group; + delete group; ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); - ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; - + ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ; }, this ); }); @@ -1782,7 +1781,7 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) // 2 - sort the messages into a proper hierarchy - RsGxsForumMsg msg = msgs[0]; + RsGxsForumMsg *msg = new RsGxsForumMsg(msgs[0]); // 3 - update the model in the UI thread. @@ -1794,10 +1793,11 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) * Qt::QueuedConnection is important! */ - insertMessageData(msg); + insertMessageData(*msg); + delete msg; ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); - ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ; + ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ; }, this ); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 9dba7efb5..cfc790324 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -84,8 +84,8 @@ public: virtual void blank(); protected: - bool eventFilter(QObject *obj, QEvent *ev); - void changeEvent(QEvent *e); + //bool eventFilter(QObject *obj, QEvent *ev); + //void changeEvent(QEvent *e); /* RsGxsUpdateBroadcastWidget */ virtual void updateDisplay(bool complete); @@ -177,9 +177,6 @@ private: RsGxsMessageId mThreadId; RsGxsMessageId mOrigThreadId; RsGxsForumGroup mForumGroup; - QString mForumDescription; - int mSubscribeFlags; - int mSignFlags; bool mUpdating; bool mInProcessSettings; bool mInMsgAsReadUnread; From 49ea15449059811f14173627e3c842262b43ef01 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 6 Dec 2018 23:18:56 +0100 Subject: [PATCH 090/110] fixed restoring of current item --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 5fcdf948d..70991ba83 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1679,7 +1679,7 @@ void GxsForumThreadWidget::postForumLoading() if(!mThreadId.isNull() && indx.isValid()) { QModelIndex index = mThreadProxyModel->mapFromSource(indx); - ui->threadTreeWidget->selectionModel()->select(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); std::cerr << " re-selecting index of message " << mThreadId << " to " << indx.row() << "," << indx.column() << " " << (void*)indx.internalPointer() << std::endl; } From 1163d00ae9ab276f4978b3edc4a4f5fbecf0ea47 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 6 Dec 2018 23:49:14 +0100 Subject: [PATCH 091/110] small check to avoid re-loading already loaded msg --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 70991ba83..82118ddae 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -937,7 +937,12 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) return; } - mThreadId = mOrigThreadId = RsGxsMessageId(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); + RsGxsMessageId new_id(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); + + if(new_id == mThreadId) + return; + + mThreadId = mOrigThreadId = new_id; std::cerr << "Switched to new thread ID " << mThreadId << std::endl; @@ -1164,7 +1169,6 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) QString extraTxt = RsHtml().formatText(ui->postText->document(), QString::fromUtf8(msg.mMsg.c_str()),flags); ui->postText->setHtml(extraTxt); } - // ui->threadTitle->setText(QString::fromUtf8(msg.mMeta.mMsgName.c_str())); } void GxsForumThreadWidget::previousMessage() From 42aab55961130f66abfd4454e5a6f5d19a8ed4bb Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 7 Dec 2018 21:45:15 +0100 Subject: [PATCH 092/110] fixed changing of read status using button in forum model --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 95 +++++++++++-------- 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 82118ddae..129b9b5a5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -56,7 +56,7 @@ #include #include -//#define DEBUG_FORUMS +#define DEBUG_FORUMS /* Images for context menu icons */ #define IMAGE_MESSAGE ":/images/mail_new.png" @@ -614,35 +614,46 @@ void GxsForumThreadWidget::recursRestoreExpandedItems(const QModelIndex& index, void GxsForumThreadWidget::updateDisplay(bool complete) { +#ifdef DEBUG_FORUMS std::cerr << "udateDisplay: groupId()=" << groupId()<< std::endl; - +#endif if(mUpdating) { +#ifdef DEBUG_FORUMS std::cerr << " Already updating. Return!"<< std::endl; +#endif return; } if(groupId().isNull()) { +#ifdef DEBUG_FORUMS std::cerr << " group_id=0. Return!"<< std::endl; +#endif return; } if(mForumGroup.mMeta.mGroupId.isNull() && !groupId().isNull()) { +#ifdef DEBUG_FORUMS std::cerr << " inconsistent group data. Reloading!"<< std::endl; +#endif complete = true; } if(!complete) { +#ifdef DEBUG_FORUMS std::cerr << " checking changed group data and msgs"<< std::endl; +#endif const std::set &grpIdsMeta = getGrpIdsMeta(); if(grpIdsMeta.find(groupId())!=grpIdsMeta.end()) { +#ifdef DEBUG_FORUMS std::cerr << " grpMeta change. reloading!" << std::endl; +#endif complete = true; } @@ -650,7 +661,9 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (grpIds.find(groupId())!=grpIds.end()) { +#ifdef DEBUG_FORUMS std::cerr << " grp data change. reloading!" << std::endl; +#endif complete = true; } else @@ -666,7 +679,9 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (msgIds.find(groupId()) != msgIds.end()) { +#ifdef DEBUG_FORUMS std::cerr << " msg data change. reloading!" << std::endl; +#endif complete=true; } } @@ -709,8 +724,9 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) ForumModelPostEntry current_post ; bool has_current_post = getCurrentPost(current_post); - +#ifdef DEBUG_FORUMS std::cerr << "Clicked on msg " << current_post.mMsgId << std::endl; +#endif QAction *editAct = new QAction(QIcon(IMAGE_MESSAGEEDIT), tr("Edit"), &contextMnu); connect(editAct, SIGNAL(triggered()), this, SLOT(editforummessage())); @@ -827,8 +843,9 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/) if(has_current_post) { +#ifdef DEBUG_FORUMS std::cerr << "Author is: " << current_post.mAuthorId << std::endl; - +#endif contextMnu.addSeparator(); RsReputations::Opinion op ; @@ -944,13 +961,17 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) mThreadId = mOrigThreadId = new_id; +#ifdef DEBUG_FORUMS std::cerr << "Switched to new thread ID " << mThreadId << std::endl; - +#endif //ui->postText->resetImagesStatus(Settings->getForumLoadEmbeddedImages()) ; insertMessage(); QModelIndex src_index = mThreadProxyModel->mapToSource(index); +#ifdef DEBUG_FORUMS + std::cerr << "Setting message read status to true" << std::endl; +#endif mThreadModel->setMsgReadStatus(src_index, true,false); } @@ -962,20 +983,26 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) if(!index.isValid()) return; +#ifdef DEBUG_FORUMS std::cerr << "Clicked on message ID " << mThreadId << std::endl; +#endif if (index.column() == RsGxsForumModel::COLUMN_THREAD_READ) { - std::cerr << " changing read status" << std::endl; ForumModelPostEntry fmpe; QModelIndex src_index = mThreadProxyModel->mapToSource(index); mThreadModel->getPostData(src_index,fmpe); +#ifdef DEBUG_FORUMS + std::cerr << "Setting message read status to false" << std::endl; +#endif mThreadModel->setMsgReadStatus(src_index, IS_MSG_UNREAD(fmpe.mMsgStatus),false); } +#ifdef DEBUG_FORUMS else std::cerr << " doing nothing" << std::endl; +#endif } static void cleanupItems (QList &items) @@ -1059,7 +1086,9 @@ void GxsForumThreadWidget::insertMessage() std::vector > post_versions = mThreadModel->getPostVersions(mOrigThreadId); +#ifdef DEBUG_FORUMS std::cerr << "Looking into existing versions for post " << mOrigThreadId << ", thread history: " << post_versions.size() << std::endl; +#endif ui->versions_CB->blockSignals(true) ; while(ui->versions_CB->count() > 0) @@ -1067,7 +1096,9 @@ void GxsForumThreadWidget::insertMessage() if(!post_versions.empty()) { +#ifdef DEBUG_FORUMS std::cerr << post_versions.size() << " versions found " << std::endl; +#endif ui->versions_CB->setVisible(true) ; ui->time_label->hide(); @@ -1079,7 +1110,9 @@ void GxsForumThreadWidget::insertMessage() ui->versions_CB->insertItem(i, ((i==0)?tr("(Latest) "):tr("(Old) "))+" "+DateTime::formatLongDateTime( post_versions[i].first)); ui->versions_CB->setItemData(i,QString::fromStdString(post_versions[i].second.toStdString())); +#ifdef DEBUG_FORUMS std::cerr << " added new post version " << post_versions[i].first << " " << post_versions[i].second << std::endl; +#endif if(mThreadId == post_versions[i].second) current_index = i ; @@ -1098,7 +1131,7 @@ void GxsForumThreadWidget::insertMessage() /* request Post */ updateMessageData(mThreadId); - markMsgAsRead(); +// markMsgAsRead(); } void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) @@ -1127,7 +1160,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) uint32_t status = msg.mMeta.mMsgStatus ;//item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); QModelIndex index = getCurrentIndex(); - +#ifdef TO_REMOVE if (IS_MSG_NEW(status)) { if (setToReadOnActive) { /* set to read */ @@ -1142,6 +1175,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) mThreadModel->setMsgReadStatus(mThreadProxyModel->mapToSource(index), true,false); } } +#endif ui->time_label->setText(DateTime::formatLongDateTime(msg.mMeta.mPublishTs)); ui->by_label->setId(msg.mMeta.mAuthorId); @@ -1252,6 +1286,7 @@ void GxsForumThreadWidget::nextUnreadMessage() while(index.isValid() && !IS_MSG_UNREAD(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::StatusRole).toUInt())); ui->threadTreeWidget->setCurrentIndex(index); + ui->threadTreeWidget->scrollTo(index); ui->threadTreeWidget->setFocus(); changedThread(index); } @@ -1310,6 +1345,7 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) return false; ui->threadTreeWidget->setCurrentIndex(index); + ui->threadTreeWidget->scrollTo(index); ui->threadTreeWidget->setFocus(); changedThread(index); return true; @@ -1374,7 +1410,9 @@ void GxsForumThreadWidget::togglePinUpPost() QString thread_title = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_TITLE).data(Qt::DisplayRole).toString(); +#ifdef DEBUG_FORUMS std::cerr << "Toggling Pin-up state of post " << mThreadId.toStdString() << ": \"" << thread_title.toStdString() << "\"" << std::endl; +#endif if(mForumGroup.mPinnedPosts.ids.find(mThreadId) == mForumGroup.mPinnedPosts.ids.end()) mForumGroup.mPinnedPosts.ids.insert(mThreadId) ; @@ -1448,7 +1486,9 @@ void GxsForumThreadWidget::async_msg_action(const MsgMethod &action) { // 1 - get message data from p3GxsForums +#ifdef DEBUG_FORUMS std::cerr << "Retrieving post data for post " << mThreadId << std::endl; +#endif std::set msgs_to_request ; std::vector msgs; @@ -1641,56 +1681,31 @@ void GxsForumThreadWidget::filterItems(const QString& text) ui->filterLineEdit->setToolTip(tr("Found %1 results.").arg(count)) ; } -#ifdef TO_REMOVE -bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text, int filterColumn) -{ - bool visible = true; - - if (text.isEmpty() == false) { - if (item->text(filterColumn).contains(text, Qt::CaseInsensitive) == false) { - visible = false; - } - } - - int visibleChildCount = 0; - int count = item->childCount(); - for (int nIndex = 0; nIndex < count; ++nIndex) { - if (filterItem(item->child(nIndex), text, filterColumn)) { - ++visibleChildCount; - } - } - - if (visible || visibleChildCount) { - item->setHidden(false); - } else { - item->setHidden(true); - } - - return (visible || visibleChildCount); -} -#endif - /*********************** **** **** **** ***********************/ /** Request / Response of Data ********************************/ /*********************** **** **** **** ***********************/ void GxsForumThreadWidget::postForumLoading() { +#ifdef DEBUG_FORUMS std::cerr << "Post forum loading..." << std::endl; - +#endif QModelIndex indx = mThreadModel->getIndexOfMessage(mThreadId); if(!mThreadId.isNull() && indx.isValid()) { QModelIndex index = mThreadProxyModel->mapFromSource(indx); ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); - + ui->threadTreeWidget->scrollTo(index); +#ifdef DEBUG_FORUMS std::cerr << " re-selecting index of message " << mThreadId << " to " << indx.row() << "," << indx.column() << " " << (void*)indx.internalPointer() << std::endl; +#endif } else { +#ifdef DEBUG_FORUMS std::cerr << " previously message " << mThreadId << " not visible anymore -> de-selecting" << std::endl; - +#endif ui->threadTreeWidget->selectionModel()->clear(); ui->threadTreeWidget->selectionModel()->reset(); mThreadId.clear(); From a0b6962beca92916695535c0759bc8e374fb99c3 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 7 Dec 2018 22:09:55 +0100 Subject: [PATCH 093/110] fixed bug in read/unread with children menu items --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 3 --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 444b8e7ee..9a34c908e 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1201,9 +1201,6 @@ void RsGxsForumModel::recursUpdateReadStatusAndTimes(ForumModelIndex i,bool& has if(mPosts[i].mMostRecentTsInThread < mPosts[mPosts[i].mChildren[j]].mMostRecentTsInThread) mPosts[i].mMostRecentTsInThread = mPosts[mPosts[i].mChildren[j]].mMostRecentTsInThread; - - if(ub && rb) // optimization - break; } if(has_unread_below) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 129b9b5a5..cec369390 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -56,7 +56,7 @@ #include #include -#define DEBUG_FORUMS +//#define DEBUG_FORUMS /* Images for context menu icons */ #define IMAGE_MESSAGE ":/images/mail_new.png" From 7c248dc035b3f4b6a8e5983e3b62640555920008 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 8 Dec 2018 21:43:14 +0100 Subject: [PATCH 094/110] attempt to fix pb on 32bits systems --- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 9a34c908e..dceb91ecb 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -178,7 +178,7 @@ bool RsGxsForumModel::convertRefPointerToTabEntry(void *ref,uint32_t& entry) { intptr_t val = (intptr_t)ref; - if(val > (intptr_t)(~(uint32_t(0)))) // make sure the pointer is an int that fits in 32bits + if(val > (1<<30)) // make sure the pointer is an int that fits in 32bits and not too big which would look suspicious { std::cerr << "(EE) trying to make a ForumModelIndex out of a number that is larger than 2^32-1 !" << std::endl; return false ; From 459c04a23e52311d3f3237b09a799932ca9951e2 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 8 Dec 2018 22:01:05 +0100 Subject: [PATCH 095/110] re-enabled debug output --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index cec369390..129b9b5a5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -56,7 +56,7 @@ #include #include -//#define DEBUG_FORUMS +#define DEBUG_FORUMS /* Images for context menu icons */ #define IMAGE_MESSAGE ":/images/mail_new.png" From d5928ca84eee953d33fc491d0bc17c0f1daea916 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 8 Dec 2018 22:19:39 +0100 Subject: [PATCH 096/110] fixed message loading bug due to currentIndex() not being ready when insertMessage() is called --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 129b9b5a5..4603695c1 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1034,8 +1034,14 @@ static QString getDurationString(uint32_t days) void GxsForumThreadWidget::insertMessage() { +#ifdef DEBUG_FORUMS + std::cerr << "Inserting message, threadId=" << mThreadId <versions_CB->hide(); ui->time_label->show(); @@ -1045,6 +1051,9 @@ void GxsForumThreadWidget::insertMessage() if (mThreadId.isNull()) { +#ifdef DEBUG_FORUMS + std::cerr << " mThreadId=NULL !! That's a bug." << std::endl; +#endif ui->versions_CB->hide(); ui->time_label->show(); @@ -1052,7 +1061,9 @@ void GxsForumThreadWidget::insertMessage() return; } - QModelIndex index = getCurrentIndex(); + // We use this instead of getCurrentIndex() because right here the currentIndex() is not set yet. + + QModelIndex index = mThreadProxyModel->mapFromSource(mThreadModel->getIndexOfMessage(mOrigThreadId)); if (index.isValid()) { @@ -1063,6 +1074,9 @@ void GxsForumThreadWidget::insertMessage() ui->previousButton->setEnabled(curr_index > 0); ui->nextButton->setEnabled(curr_index < count - 1); } else { +#ifdef DEBUG_FORUMS + std::cerr << " current index invalid! That's a bug." << std::endl; +#endif // there is something wrong ui->previousButton->setEnabled(false); ui->nextButton->setEnabled(false); @@ -1159,8 +1173,8 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) bool setToReadOnActive = Settings->getForumMsgSetToReadOnActivate(); uint32_t status = msg.mMeta.mMsgStatus ;//item->data(RsGxsForumModel::COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt(); - QModelIndex index = getCurrentIndex(); #ifdef TO_REMOVE + QModelIndex index = getCurrentIndex(); if (IS_MSG_NEW(status)) { if (setToReadOnActive) { /* set to read */ From d7b5c9766c8270241276a4cac6eae0373142f9b5 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Dec 2018 13:54:30 +0100 Subject: [PATCH 097/110] fixed missing filterAcceptsRow() in forum proxy model --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 4603695c1..10ed08a07 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -285,6 +285,14 @@ public: return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ; } + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override + { + //std::cerr << "FilterAcceptsRow(): source_row=" << source_row << " parent=" << (void*)source_parent.internalPointer() << " role=\"" << + // sourceModel()->index(source_row,0,source_parent).data(RsGxsForumModel::FilterRole).toString().toStdString() << std::endl; + + return sourceModel()->index(source_row,0,source_parent).data(RsGxsForumModel::FilterRole).toString() == RsGxsForumModel::FilterString ; + } + private: const QHeaderView *m_header ; }; @@ -1684,6 +1692,9 @@ void GxsForumThreadWidget::filterItems(const QString& text) uint32_t count; mThreadModel->setFilter(filterColumn,lst,count) ; + // We do this in order to trigger a new filtering action in the proxy model. + mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ; + if(!lst.empty()) ui->threadTreeWidget->expandAll(); else From a6ed2b26ecefcff214c5aa9d142de31cdbdbdf65 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Dec 2018 16:34:43 +0100 Subject: [PATCH 098/110] fixed author name placement and icon size when loading ID data in forums --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 10ed08a07..ccbfd16a2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -66,7 +66,7 @@ #define IMAGE_DOWNLOAD ":/images/start.png" #define IMAGE_DOWNLOADALL ":/images/startall.png" #define IMAGE_COPYLINK ":/images/copyrslink.png" -#define IMAGE_BIOHAZARD ":/icons/yellow_biohazard64.png" +#define IMAGE_BIOHAZARD ":/icons/biohazard_red.png" #define IMAGE_WARNING_YELLOW ":/icons/warning_yellow_128.png" #define IMAGE_WARNING_RED ":/icons/warning_red_128.png" #define IMAGE_WARNING_UNKNOWN ":/icons/bullet_grey_128.png" @@ -255,16 +255,24 @@ public: else icon = *icons.begin(); + unsigned int warning_level = qvariant_cast(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION).data(Qt::DecorationRole)); + + if(warning_level == 2) + { + str = tr("[Banned]"); + icon = QIcon(IMAGE_BIOHAZARD); + } + if(index.data(RsGxsForumModel::MissingRole).toBool()) painter->drawText(r.topLeft() + QPoint(f/2.0,f*1.0), tr("[None]")); else { QPixmap pix = icon.pixmap(r.size()); - const QPoint p = QPoint(pix.width()/2.0, (r.height() - pix.height())/2); + const QPoint p = QPoint(r.height()/2.0, (r.height() - pix.height())/2); // draw pixmap at center of item painter->drawPixmap(r.topLeft() + p, pix); - painter->drawText(r.topLeft() + p + QPoint(pix.width()+f/2.0,f*1.0), str); + painter->drawText(r.topLeft() + QPoint(r.height()+ f/2.0 + f/2.0,f*1.0), str); } } }; @@ -287,9 +295,6 @@ public: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override { - //std::cerr << "FilterAcceptsRow(): source_row=" << source_row << " parent=" << (void*)source_parent.internalPointer() << " role=\"" << - // sourceModel()->index(source_row,0,source_parent).data(RsGxsForumModel::FilterRole).toString().toStdString() << std::endl; - return sourceModel()->index(source_row,0,source_parent).data(RsGxsForumModel::FilterRole).toString() == RsGxsForumModel::FilterString ; } From 27264cea0a65319331f3c6e67fef7e218a14bae2 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Dec 2018 17:35:31 +0100 Subject: [PATCH 099/110] fixed icons and buttons in forums --- .../src/gui/gxsforums/GxsForumModel.cpp | 13 ++++- .../gui/gxsforums/GxsForumThreadWidget.cpp | 50 +++++++++++++------ .../src/gui/gxsforums/GxsForumThreadWidget.ui | 47 ++++++++++------- 3 files changed, 75 insertions(+), 35 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index dceb91ecb..975944d2a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -1216,10 +1216,19 @@ void RsGxsForumModel::recursUpdateReadStatusAndTimes(ForumModelIndex i,bool& has QModelIndex RsGxsForumModel::getIndexOfMessage(const RsGxsMessageId& mid) const { - // brutal search. This is not so nice, so dont call that in a loop! + // Brutal search. This is not so nice, so dont call that in a loop! If too costly, we'll use a map. + + RsGxsMessageId postId = mid; + + // First look into msg versions, in case the msg is a version of an existing message + + for(auto it(mPostVersions.begin());it!=mPostVersions.end();++it) + for(uint32_t i=0;isecond.size();++i) + if(it->second[i].second == mid) + postId = it->first; for(uint32_t i=0;ithreadTreeWidget->setCurrentIndex(index); - ui->threadTreeWidget->scrollTo(index); - ui->threadTreeWidget->setFocus(); + ui->threadTreeWidget->scrollTo(index,QAbstractItemView::PositionAtCenter); + //ui->threadTreeWidget->setFocus(); changedThread(index); } @@ -1366,15 +1384,17 @@ void GxsForumThreadWidget::setAllMessagesReadDo(bool read, uint32_t &/*token*/) bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) { - QModelIndex index = mThreadModel->getIndexOfMessage(msgId); + QModelIndex source_index = mThreadModel->getIndexOfMessage(msgId); - if(!index.isValid()) + if(!source_index.isValid()) return false; - ui->threadTreeWidget->setCurrentIndex(index); - ui->threadTreeWidget->scrollTo(index); + QModelIndex indx = mThreadProxyModel->mapFromSource(source_index); + + ui->threadTreeWidget->setCurrentIndex(indx); + ui->threadTreeWidget->scrollTo(indx,QAbstractItemView::PositionAtCenter); ui->threadTreeWidget->setFocus(); - changedThread(index); + changedThread(indx); return true; } @@ -1720,15 +1740,15 @@ void GxsForumThreadWidget::postForumLoading() #ifdef DEBUG_FORUMS std::cerr << "Post forum loading..." << std::endl; #endif - QModelIndex indx = mThreadModel->getIndexOfMessage(mThreadId); + QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId); - if(!mThreadId.isNull() && indx.isValid()) + if(!mThreadId.isNull() && source_index.isValid()) { - QModelIndex index = mThreadProxyModel->mapFromSource(indx); + QModelIndex index = mThreadProxyModel->mapFromSource(source_index); ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); - ui->threadTreeWidget->scrollTo(index); + ui->threadTreeWidget->scrollTo(index,QAbstractItemView::PositionAtCenter); #ifdef DEBUG_FORUMS - std::cerr << " re-selecting index of message " << mThreadId << " to " << indx.row() << "," << indx.column() << " " << (void*)indx.internalPointer() << std::endl; + std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl; #endif } else diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index ae79bd607..122372207 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -253,28 +253,18 @@ Download all files + + Qt::LeftToRight + - - :/images/down.png:/images/down.png + + :/icons/global_switch_on_128.png:/icons/global_switch_on_128.png true
- - - - - 0 - 0 - - - - Next unread - - - @@ -290,14 +280,14 @@ Reply Message - Reply + - :/images/mail_reply.png:/images/mail_reply.png + :/images/replymailall24-hover.png:/images/replymailall24-hover.png - Qt::ToolButtonTextBesideIcon + Qt::ToolButtonIconOnly true @@ -460,6 +450,26 @@ + + + + + 0 + 0 + + + + Next unread message + + + + + + + :/images/arrow-right.png:/images/arrow-right.png + + + @@ -540,6 +550,7 @@ + From 983ac7dda91670db47ff766c4ddd4b2c2c830906 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Dec 2018 21:22:18 +0100 Subject: [PATCH 100/110] improved icons in forums and removed - button because it is not useful --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 16 ++++--- .../src/gui/gxsforums/GxsForumThreadWidget.ui | 43 +++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 9bc8fd487..f0c851b44 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -365,7 +365,9 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget connect(ui->threadTreeWidget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), this, SLOT(changedSelection(const QModelIndex&,const QModelIndex&))); connect(ui->viewBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changedViewBox())); - connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview())); + //connect(ui->expandButton, SIGNAL(clicked()), this, SLOT(togglethreadview())); + ui->expandButton->hide(); + connect(ui->previousButton, SIGNAL(clicked()), this, SLOT(previousMessage())); connect(ui->nextButton, SIGNAL(clicked()), this, SLOT(nextMessage())); connect(ui->nextUnreadButton, SIGNAL(clicked()), this, SLOT(nextUnreadMessage())); @@ -940,15 +942,15 @@ void GxsForumThreadWidget::togglethreadview() void GxsForumThreadWidget::togglethreadview_internal() { - if (ui->expandButton->isChecked()) { +// if (ui->expandButton->isChecked()) { ui->postText->setVisible(true); ui->expandButton->setIcon(QIcon(QString(":/images/edit_remove24.png"))); ui->expandButton->setToolTip(tr("Hide")); - } else { - ui->postText->setVisible(false); - ui->expandButton->setIcon(QIcon(QString(":/images/edit_add24.png"))); - ui->expandButton->setToolTip(tr("Expand")); - } +// } else { +// ui->postText->setVisible(false); +// ui->expandButton->setIcon(QIcon(QString(":/images/edit_add24.png"))); +// ui->expandButton->setToolTip(tr("Expand")); +// } } void GxsForumThreadWidget::changedVersion() diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index 122372207..f9d226c94 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -239,7 +239,7 @@ - + @@ -294,7 +294,7 @@ - + @@ -320,21 +320,14 @@ - - - - Qt::Vertical - - - - + Qt::Vertical - + Qt::Horizontal @@ -426,31 +419,38 @@ - + - - - - By + + + + Qt::Vertical - + - + - + + + + By + + + + @@ -465,8 +465,8 @@ - - :/images/arrow-right.png:/images/arrow-right.png + + :/images/start.png:/images/start.png @@ -550,7 +550,6 @@ - From 34f51fff9c04b818e20a34b9f9ed54067c3d37df Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Dec 2018 23:18:50 +0100 Subject: [PATCH 101/110] made next unread post arrow also work when no post is selected --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index f0c851b44..d385e3a85 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1323,6 +1323,9 @@ void GxsForumThreadWidget::nextUnreadMessage() { QModelIndex index = getCurrentIndex(); + if(!index.isValid()) + index = mThreadProxyModel->index(0,0); + do { if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool()) From 1dda7c5b349d361c2646eaa46b93964387a67d3a Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 9 Dec 2018 23:25:59 +0100 Subject: [PATCH 102/110] removed mUpdating variable which was used for a safety test that is not relevant anymore and caused problems --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 30 ++++++++++--------- .../src/gui/gxsforums/GxsForumThreadWidget.h | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index d385e3a85..c769ffa96 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -324,7 +324,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget setUpdateWhenInvisible(true); - mUpdating = false; + //mUpdating = false; mUnreadCount = 0; mNewCount = 0; @@ -639,6 +639,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) #ifdef DEBUG_FORUMS std::cerr << "udateDisplay: groupId()=" << groupId()<< std::endl; #endif +#ifdef TO_REMOVE if(mUpdating) { #ifdef DEBUG_FORUMS @@ -646,6 +647,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) #endif return; } +#endif if(groupId().isNull()) { @@ -713,7 +715,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) { saveExpandedItems(mSavedExpandedMessages); - mUpdating=true; + //mUpdating=true; updateGroupData(); mThreadModel->updateForum(groupId()); @@ -955,8 +957,8 @@ void GxsForumThreadWidget::togglethreadview_internal() void GxsForumThreadWidget::changedVersion() { - if(mUpdating) - return; + //if(mUpdating) + // return; mThreadId = RsGxsMessageId(ui->versions_CB->itemData(ui->versions_CB->currentIndex()).toString().toStdString()) ; @@ -966,8 +968,8 @@ void GxsForumThreadWidget::changedVersion() void GxsForumThreadWidget::changedThread(QModelIndex index) { - if(mUpdating) - return; + //if(mUpdating) + // return; if(!index.isValid()) { @@ -1003,13 +1005,13 @@ void GxsForumThreadWidget::clickedThread(QModelIndex index) std::cerr << "Clicked on message ID " << mThreadId << ", index=" << index << std::endl; #endif - if(mUpdating) - { -#ifdef DEBUG_FORUMS - std::cerr << " early return because mUpdating=true" << std::endl; -#endif - return; - } +// if(mUpdating) +// { +//#ifdef DEBUG_FORUMS +// std::cerr << " early return because mUpdating=true" << std::endl; +//#endif +// return; +// } if(!index.isValid()) { @@ -1772,7 +1774,7 @@ void GxsForumThreadWidget::postForumLoading() ui->threadTreeWidget->update(); recursRestoreExpandedItems(mThreadProxyModel->mapFromSource(mThreadModel->root()),mSavedExpandedMessages); - mUpdating = false; + //mUpdating = false; } void GxsForumThreadWidget::updateGroupData() { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index cfc790324..495078ea8 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -177,7 +177,7 @@ private: RsGxsMessageId mThreadId; RsGxsMessageId mOrigThreadId; RsGxsForumGroup mForumGroup; - bool mUpdating; + //bool mUpdating; bool mInProcessSettings; bool mInMsgAsReadUnread; int mLastViewType; From b38c6356497b49fb1989f26e823a01d5ce62891a Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 10 Dec 2018 22:51:09 +0100 Subject: [PATCH 103/110] restored display of forum summary when browsing forums --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 104 +++++++++++++++++- .../src/gui/gxsforums/GxsForumThreadWidget.h | 1 + 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index c769ffa96..b6d2fae18 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -463,7 +463,7 @@ void GxsForumThreadWidget::blank() #endif ui->forumName->setText(""); - mThreadModel->clear(); + //mThreadModel->clear(); #ifdef SUSPENDED_CODE mStateHelper->setWidgetEnabled(ui->newthreadButton, false); @@ -530,6 +530,7 @@ void GxsForumThreadWidget::groupIdChanged() mNewCount = 0; mUnreadCount = 0; + mThreadId.clear(); //mThreadModel->updateForum(groupId()); updateDisplay(true); @@ -1067,6 +1068,103 @@ static QString getDurationString(uint32_t days) } } +void GxsForumThreadWidget::updateForumDescription() +{ + if (!mThreadId.isNull()) + return; + + RsIdentityDetails details; + + rsIdentity->getIdDetails(mForumGroup.mMeta.mAuthorId,details); + + QString author = GxsIdDetails::getName(details); + + const RsGxsForumGroup& group = mForumGroup; + + ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str())); + + QString anti_spam_features1 ; + QString forum_description; + + if(IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags)) anti_spam_features1 = tr("Anonymous/unknown posts forwarded if reputation is positive"); + else if(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags)) anti_spam_features1 = tr("Anonymous posts forwarded if reputation is positive"); + + forum_description = QString("%1: \t%2
").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str())); + forum_description += QString("%1: %2
").arg(tr("Description"), group.mDescription.empty()? tr("[None]
") :(QString::fromUtf8(group.mDescription.c_str())+"
")); + forum_description += QString("%1: \t%2
").arg(tr("Subscribers")).arg(group.mMeta.mPop); + forum_description += QString("%1: \t%2
").arg(tr("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount); + + if(group.mMeta.mLastPost==0) + forum_description += QString("%1: \t%2
").arg(tr("Last post")).arg(tr("Never")); + else + forum_description += QString("%1: \t%2
").arg(tr("Last post")).arg(DateTime::formatLongDateTime(group.mMeta.mLastPost)); + + forum_description += QString("%1: \t%2
").arg(tr("Synchronization")).arg(getDurationString( rsGxsForums->getSyncPeriod(group.mMeta.mGroupId)/86400 )) ; + forum_description += QString("%1: \t%2
").arg(tr("Storage")).arg(getDurationString( rsGxsForums->getStoragePeriod(group.mMeta.mGroupId)/86400)); + + QString distrib_string = tr("[unknown]"); + switch(group.mMeta.mCircleType) + { + case GXS_CIRCLE_TYPE_PUBLIC: distrib_string = tr("Public") ; + break ; + case GXS_CIRCLE_TYPE_EXTERNAL: + { + RsGxsCircleDetails det ; + + // !! What we need here is some sort of CircleLabel, which loads the circle and updates the label when done. + + if(rsGxsCircles->getCircleDetails(group.mMeta.mCircleId,det)) + distrib_string = tr("Restricted to members of circle \"")+QString::fromUtf8(det.mCircleName.c_str()) +"\""; + else + distrib_string = tr("Restricted to members of circle ")+QString::fromStdString(group.mMeta.mCircleId.toStdString()) ; + } + break ; + case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY: + { + distrib_string = tr("Only friends nodes in group ") ; + + RsGroupInfo ginfo ; + rsPeers->getGroupInfo(RsNodeGroupId(group.mMeta.mInternalCircle),ginfo) ; + + QString desc; + GroupChooser::makeNodeGroupDesc(ginfo, desc); + distrib_string += desc ; + } + break ; + + case GXS_CIRCLE_TYPE_LOCAL: distrib_string = tr("Your eyes only"); // this is not yet supported. If you see this, it is a bug! + break ; + default: + std::cerr << "(EE) badly initialised group distribution ID = " << group.mMeta.mCircleType << std::endl; + } + + forum_description += QString("%1: \t%2
").arg(tr("Distribution"), distrib_string); + forum_description += QString("%1: \t%2
").arg(tr("Contact"), author); + + if(!anti_spam_features1.isNull()) + forum_description += QString("%1: \t%2
").arg(tr("Anti-spam")).arg(anti_spam_features1); + + ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)); + mStateHelper->setWidgetEnabled(ui->newthreadButton, (IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags))); + + if(!group.mAdminList.ids.empty()) + { + QString admin_list_str ; + + for(auto it(group.mAdminList.ids.begin());it!=group.mAdminList.ids.end();++it) + { + RsIdentityDetails det ; + + rsIdentity->getIdDetails(*it,det); + admin_list_str += (admin_list_str.isNull()?"":", ") + QString::fromUtf8(det.mNickname.c_str()) ; + } + + forum_description += QString("%1: %2").arg(tr("Moderators"), admin_list_str); + } + + ui->postText->setText(forum_description); +} + void GxsForumThreadWidget::insertMessage() { #ifdef DEBUG_FORUMS @@ -1766,6 +1864,7 @@ void GxsForumThreadWidget::postForumLoading() ui->threadTreeWidget->selectionModel()->clear(); ui->threadTreeWidget->selectionModel()->reset(); mThreadId.clear(); + //blank(); } // we also need to restore expanded threads @@ -1825,6 +1924,9 @@ void GxsForumThreadWidget::updateGroupData() ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ; + + updateForumDescription(); + }, this ); }); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 495078ea8..705d080a3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -171,6 +171,7 @@ private: static void loadAuthorIdCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &/*data*/); void updateMessageData(const RsGxsMessageId& msgId); + void updateForumDescription(); private: RsGxsGroupId mLastForumID; From 8f9c9295b22a88c7e4fc7fa35f95012724303710 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 11 Dec 2018 22:06:45 +0100 Subject: [PATCH 104/110] added proper timeout of 5 secs to all forum async-ed interactions --- libretroshare/src/services/p3gxsforums.cc | 14 +++++++------- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 0534128e5..1760a2f2b 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -389,7 +389,7 @@ bool p3GxsForums::createForum(RsGxsForumGroup& forum) return false; } - if(waitToken(token) != RsTokenService::COMPLETE) + if(waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE) { std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." << std::endl; @@ -416,7 +416,7 @@ bool p3GxsForums::editForum(RsGxsForumGroup& forum) return false; } - if(waitToken(token) != RsTokenService::COMPLETE) + if(waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE) { std::cerr << __PRETTY_FUNCTION__ << "Error! GXS operation failed." << std::endl; @@ -440,7 +440,7 @@ bool p3GxsForums::getForumsSummaries( RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_GROUP_META; if( !requestGroupInfo(token, opts) - || waitToken(token) != RsTokenService::COMPLETE ) return false; + || waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false; return getGroupSummary(token, forums); } @@ -452,7 +452,7 @@ bool p3GxsForums::getForumsInfo( RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_GROUP_DATA; if( !requestGroupInfo(token, opts, forumIds) - || waitToken(token) != RsTokenService::COMPLETE ) return false; + || waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false; return getGroupData(token, forumsInfo); } @@ -465,7 +465,7 @@ bool p3GxsForums::getForumsContent( const RsGxsGroupId& forumId, std::set(index.data(Qt::DecorationRole)); bool unread = IS_MSG_UNREAD(read_status); - bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(ROLE_THREAD_MISSING).toBool(); + bool missing = index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::MissingRole).toBool(); // set icon if (missing) From a114856b77faa8a5ebd43d230665da8ee97eefe5 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 12 Dec 2018 11:33:38 +0100 Subject: [PATCH 105/110] changed code to create msg data map using MsgMeta instead of full Msg and added the handles to request MsgMeta data in forums --- libretroshare/src/retroshare/rsgxsforums.h | 13 +++- libretroshare/src/services/p3gxsforums.cc | 28 ++++++- libretroshare/src/services/p3gxsforums.h | 4 + .../src/gui/gxsforums/GxsForumModel.cpp | 74 +++++++++---------- .../src/gui/gxsforums/GxsForumModel.h | 4 +- 5 files changed, 81 insertions(+), 42 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index ad73a92c2..c56074e69 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -139,10 +139,11 @@ public: const std::list& forumIds, std::vector& forumsInfo ) = 0; + /** * @brief Get content of specified forums. Blocking API * @jsonapi{development} - * @param[in] forumIds id of the channels of which the content is requested + * @param[in] forumIds id of the forum of which the content is requested * @param[out] messages storage for the forum messages * @return false if something failed, true otherwhise */ @@ -150,6 +151,16 @@ public: const std::list& forumIds, std::vector& messages ) = 0; + /** + * @brief Get message metadatas for some messages of a specific forum. Blocking API + * @jsonapi{development} + * @param[in] forumIds id of the forum of which the content is requested + * @param[out] msg_metas storage for the forum messages meta data + * @return false if something failed, true otherwhise + */ + virtual bool getForumMsgMetaData( const RsGxsGroupId& forumId, + std::vector& msg_metas) =0; + /** * @brief Get specific list of messages from a single forums. Blocking API * @jsonapi{development} diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 1760a2f2b..aaf663d92 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -297,6 +297,11 @@ bool p3GxsForums::getGroupData(const uint32_t &token, std::vector& forums ) +bool p3GxsForums::getForumsSummaries( std::list& forums ) { uint32_t token; RsTokReqOptions opts; @@ -482,6 +486,26 @@ bool p3GxsForums::getForumsContent( return getMsgData(token, messages); } + +bool p3GxsForums::getForumMsgMetaData(const RsGxsGroupId& forumId, std::vector& msg_metas) +{ + uint32_t token; + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_MSG_META; + + GxsMsgMetaMap meta_map; + std::list forumIds; + forumIds.push_back(forumId); + + if( !requestMsgInfo(token, opts, forumIds) || waitToken(token,std::chrono::milliseconds(5000)) != RsTokenService::COMPLETE ) return false; + + bool res = getMsgMetaData(token, meta_map); + + msg_metas = meta_map[forumId]; + + return res; +} + bool p3GxsForums::markRead(const RsGxsGrpMsgIdPair& msgId, bool read) { uint32_t token; diff --git a/libretroshare/src/services/p3gxsforums.h b/libretroshare/src/services/p3gxsforums.h index 29260c8cf..051368175 100644 --- a/libretroshare/src/services/p3gxsforums.h +++ b/libretroshare/src/services/p3gxsforums.h @@ -77,6 +77,9 @@ public: const std::list& forumIds, std::vector& messages ); + /// @see RsGxsForums::getForumMsgMetaData + virtual bool getForumMsgMetaData(const RsGxsGroupId& forumId, std::vector& msg_metas) ; + /// @see RsGxsForums::getForumsContent virtual bool getForumsContent( const RsGxsGroupId& forumId, std::set& msgs_to_request,std::vector& msgs) ; @@ -85,6 +88,7 @@ public: virtual bool getGroupData(const uint32_t &token, std::vector &groups); virtual bool getMsgData(const uint32_t &token, std::vector &msgs); + virtual bool getMsgMetaData(const uint32_t &token, GxsMsgMetaMap& msg_metas); virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read); virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group); virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 975944d2a..d3713a1da 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -727,7 +727,7 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) // 1 - get message data from p3GxsForums std::list forumIds; - std::vector messages; + std::vector msg_metas; std::vector groups; forumIds.push_back(group_id); @@ -738,7 +738,7 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) return; } - if(!rsGxsForums->getForumsContent(forumIds,messages)) + if(!rsGxsForums->getForumMsgMetaData(group_id,msg_metas)) { std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve forum message info for forum " << group_id << std::endl; return; @@ -750,7 +750,7 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id) std::vector *vect = new std::vector(); RsGxsForumGroup group = groups[0]; - computeMessagesHierarchy(group,messages,*vect,*post_versions); + computeMessagesHierarchy(group,msg_metas,*vect,*post_versions); // 3 - update the model in the UI thread. @@ -798,16 +798,16 @@ void RsGxsForumModel::generateMissingItem(const RsGxsMessageId &msgId,ForumModel entry.mReputationWarningLevel = 3; } -void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,const RsGxsForumMsg& msg, bool useChildTS, ForumModelPostEntry& fentry) +void RsGxsForumModel::convertMsgToPostEntry(const RsGxsForumGroup& mForumGroup,const RsMsgMetaData& msg, bool useChildTS, ForumModelPostEntry& fentry) { - fentry.mTitle = msg.mMeta.mMsgName; - fentry.mAuthorId = msg.mMeta.mAuthorId; - fentry.mMsgId = msg.mMeta.mMsgId; - fentry.mPublishTs = msg.mMeta.mPublishTs; + fentry.mTitle = msg.mMsgName; + fentry.mAuthorId = msg.mAuthorId; + fentry.mMsgId = msg.mMsgId; + fentry.mPublishTs = msg.mPublishTs; fentry.mPostFlags = 0; - fentry.mMsgStatus = msg.mMeta.mMsgStatus; + fentry.mMsgStatus = msg.mMsgStatus; - if(mForumGroup.mPinnedPosts.ids.find(msg.mMeta.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) + if(mForumGroup.mPinnedPosts.ids.find(msg.mMsgId) != mForumGroup.mPinnedPosts.ids.end()) fentry.mPostFlags |= ForumModelPostEntry::FLAG_POST_IS_PINNED; // Early check for a message that should be hidden because its author @@ -842,12 +842,12 @@ void RsGxsForumModel::computeReputationLevel(uint32_t forum_sign_flags,ForumMode static bool decreasing_time_comp(const std::pair& e1,const std::pair& e2) { return e2.first < e1.first ; } void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_group, - const std::vector& msgs_array, + const std::vector& msgs_metas_array, std::vector& posts, std::map > >& mPostVersions ) { - std::cerr << "updating messages data with " << msgs_array.size() << " messages" << std::endl; + std::cerr << "updating messages data with " << msgs_metas_array.size() << " messages" << std::endl; #ifdef DEBUG_FORUMS std::cerr << "Retrieved group data: " << std::endl; @@ -861,14 +861,14 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou #endif /* get messages */ - std::map msgs; + std::map msgs; - for(uint32_t i=0;i msg_stack ; - for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) + for ( auto msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) { - if(!msgIt->second.mMeta.mOrigMsgId.isNull() && msgIt->second.mMeta.mOrigMsgId != msgIt->second.mMeta.mMsgId) + if(!msgIt->second.mOrigMsgId.isNull() && msgIt->second.mOrigMsgId != msgIt->second.mMsgId) { #ifdef DEBUG_FORUMS std::cerr << " Post " << msgIt->second.mMeta.mMsgId << " is a new version of " << msgIt->second.mMeta.mOrigMsgId << std::endl; #endif - std::map::iterator msgIt2 = msgs.find(msgIt->second.mMeta.mOrigMsgId); + auto msgIt2 = msgs.find(msgIt->second.mOrigMsgId); // Ensuring that the post exists allows to only collect the existing data. @@ -917,21 +917,21 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou // Make sure that the author is the same than the original message, or is a moderator. This should always happen when messages are constructed using // the UI but nothing can prevent a nasty user to craft a new version of a message with his own signature. - if(msgIt2->second.mMeta.mAuthorId != msgIt->second.mMeta.mAuthorId) + if(msgIt2->second.mAuthorId != msgIt->second.mAuthorId) { - if( !IS_FORUM_MSG_MODERATION(msgIt->second.mMeta.mMsgFlags) ) // if authors are different the moderation flag needs to be set on the editing msg + if( !IS_FORUM_MSG_MODERATION(msgIt->second.mMsgFlags) ) // if authors are different the moderation flag needs to be set on the editing msg continue ; - if( forum_group.mAdminList.ids.find(msgIt->second.mMeta.mAuthorId)==forum_group.mAdminList.ids.end()) // if author is not a moderator, continue + if( forum_group.mAdminList.ids.find(msgIt->second.mAuthorId)==forum_group.mAdminList.ids.end()) // if author is not a moderator, continue continue ; } // always add the post a self version - if(mPostVersions[msgIt->second.mMeta.mOrigMsgId].empty()) - mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(std::make_pair(msgIt2->second.mMeta.mPublishTs,msgIt2->second.mMeta.mMsgId)) ; + if(mPostVersions[msgIt->second.mOrigMsgId].empty()) + mPostVersions[msgIt->second.mOrigMsgId].push_back(std::make_pair(msgIt2->second.mPublishTs,msgIt2->second.mMsgId)) ; - mPostVersions[msgIt->second.mMeta.mOrigMsgId].push_back(std::make_pair(msgIt->second.mMeta.mPublishTs,msgIt->second.mMeta.mMsgId)) ; + mPostVersions[msgIt->second.mOrigMsgId].push_back(std::make_pair(msgIt->second.mPublishTs,msgIt->second.mMsgId)) ; } } @@ -1008,19 +1008,19 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou // this trick is needed because while we remove messages, the parents a given msg may already have been removed // and wrongly understand as a missing parent. - std::map kept_msgs; + std::map kept_msgs; - for ( std::map::iterator msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) + for ( auto msgIt = msgs.begin(); msgIt != msgs.end();++msgIt) { - if(msgIt->second.mMeta.mParentId.isNull()) + if(msgIt->second.mParentId.isNull()) { /* add all threads */ - const RsGxsForumMsg& msg = msgIt->second; + const RsMsgMetaData& msg = msgIt->second; #ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Adding TopLevel Thread: mId: " << msg.mMeta.mMsgId << std::endl; + std::cerr << "GxsForumsFillThread::run() Adding TopLevel Thread: mId: " << msg.mMsgId << std::endl; #endif ForumModelPostEntry entry; @@ -1029,7 +1029,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou ForumModelIndex entry_index = addEntry(posts,entry,0); //if (!mFlatView) - threadStack.push_back(std::make_pair(msg.mMeta.mMsgId,entry_index)) ; + threadStack.push_back(std::make_pair(msg.mMsgId,entry_index)) ; //calculateExpand(msg, item); //mItems.append(entry_index); @@ -1037,11 +1037,11 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou else { #ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() Storing kid " << msgIt->first << " of message " << msgIt->second.mMeta.mParentId << std::endl; + std::cerr << "GxsForumsFillThread::run() Storing kid " << msgIt->first << " of message " << msgIt->second.mParentId << std::endl; #endif // The same missing parent may appear multiple times, so we first store them into a unique container. - RsGxsMessageId parent_msg = msgIt->second.mMeta.mParentId; + RsGxsMessageId parent_msg = msgIt->second.mParentId; if(msgs.find(parent_msg) == msgs.end()) { @@ -1101,7 +1101,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou // We iterate through the top level thread items, and look for which message has the current item as parent. // When found, the item is put in the thread list itself, as a potential new parent. - std::map::iterator mit = msgs.find(*it2) ; + auto mit = msgs.find(*it2) ; if(mit == msgs.end()) { @@ -1109,9 +1109,9 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou continue ; } - const RsGxsForumMsg& msg(mit->second) ; + const RsMsgMetaData& msg(mit->second) ; #ifdef DEBUG_FORUMS - std::cerr << "GxsForumsFillThread::run() adding sub_item " << msg.mMeta.mMsgId << std::endl; + std::cerr << "GxsForumsFillThread::run() adding sub_item " << msg.mMsgId << std::endl; #endif @@ -1122,7 +1122,7 @@ void RsGxsForumModel::computeMessagesHierarchy(const RsGxsForumGroup& forum_grou //calculateExpand(msg, item); /* add item to process list */ - threadStack.push_back(std::make_pair(msg.mMeta.mMsgId, e_index)); + threadStack.push_back(std::make_pair(msg.mMsgId, e_index)); msgs.erase(mit); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 6a6b499b7..58953e263 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -186,9 +186,9 @@ private: static void generateMissingItem(const RsGxsMessageId &msgId,ForumModelPostEntry& entry); static ForumModelIndex addEntry(std::vector& posts,const ForumModelPostEntry& entry,ForumModelIndex parent); - static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsGxsForumMsg& msg, bool useChildTS, ForumModelPostEntry& fentry); + static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsMsgMetaData &msg, bool useChildTS, ForumModelPostEntry& fentry); - void computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector& msgs_array, std::vector& posts, std::map > > &mPostVersions); + void computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector &msgs_array, std::vector& posts, std::map > > &mPostVersions); void setPosts(const RsGxsForumGroup& group, const std::vector& posts,const std::map > >& post_versions); void initEmptyHierarchy(std::vector& posts); From 39b7bc818bde33ccba399bcc8ec95f8565a40e97 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 12 Dec 2018 21:31:54 +0100 Subject: [PATCH 106/110] added more debug info to figure out why some posts are not displayed --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index ac4adbe2e..fb7b3d1be 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1953,10 +1953,17 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) return; } - if(msgs.size() != 1) + if(msgs.empty()) { - std::cerr << __PRETTY_FUNCTION__ << " obtained more than one msg info for msgId " << msgId << std::endl; - return; + std::cerr << __PRETTY_FUNCTION__ << " no posts for msgId " << msgId << ". Database corruption?" << std::endl; + return; + } + if(msgs.size() > 1) + { + std::cerr << __PRETTY_FUNCTION__ << " obtained more than one msg info for msgId " << msgId << ". This could be a bug. Only showing the first msg in the list." << std::endl; + std::cerr << "Messages are:" << std::endl; + for(auto it(msgs.begin());it!=msgs.end();++it) + std::cerr << (*it).mMeta << std::endl; } // 2 - sort the messages into a proper hierarchy @@ -1978,11 +1985,8 @@ void GxsForumThreadWidget::updateMessageData(const RsGxsMessageId& msgId) delete msg; ui->threadTreeWidget->setColumnHidden(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags))); ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mForumGroup.mMeta.mSubscribeFlags)) ; - }, this ); - }); - } void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) From 7113eb7bfccb0cd6cb39e7705b4fb9520674c713 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Wed, 12 Dec 2018 21:35:31 +0100 Subject: [PATCH 107/110] GxsChannels optimizable API --- libretroshare/src/retroshare/rsgxschannels.h | 25 +++++++++---- libretroshare/src/services/p3gxschannels.cc | 38 ++++++++++++++++---- libretroshare/src/services/p3gxschannels.h | 12 ++++--- 3 files changed, 58 insertions(+), 17 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 8c7d29766..2f51f2652 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -197,17 +197,28 @@ public: std::vector& channelsInfo ) = 0; /** - * @brief Get content of specified channels. Blocking API + * @brief Get channel contents * @jsonapi{development} - * @param[in] chanIds id of the channels of which the content is requested - * @param[out] posts storage for the posts + * @param[in] channelId id of the channel of which the content is requested + * @param[in] contentsIds ids of requested contents + * @param[out] posts storage for posts * @param[out] comments storage for the comments * @return false if something failed, true otherwhise */ - virtual bool getChannelsContent( - const std::list& chanIds, - std::vector& posts, - std::vector& comments ) = 0; + virtual bool getChannelContent( const RsGxsGroupId& channelId, + const std::set& contentsIds, + std::vector& posts, + std::vector& comments ) = 0; + + /** + * @brief Get channel content summaries + * @jsonapi{development} + * @param[in] channelId id of the channel of which the content is requested + * @param[out] summaries storage for summaries + * @return false if something failed, true otherwhise + */ + virtual bool getContentSummaries( const RsGxsGroupId& channelId, + std::vector& summaries ) = 0; /** * @brief Toggle post read status. Blocking API. diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index 847395686..4289435b0 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -1016,16 +1016,42 @@ bool p3GxsChannels::getChannelsInfo( return getGroupData(token, channelsInfo); } -bool p3GxsChannels::getChannelsContent( - const std::list& chanIds, - std::vector& posts, - std::vector& comments ) +bool p3GxsChannels::getContentSummaries( + const RsGxsGroupId& channelId, std::vector& summaries ) +{ + uint32_t token; + RsTokReqOptions opts; + opts.mReqType = GXS_REQUEST_TYPE_MSG_META; + + std::list channelIds; + channelIds.push_back(channelId); + + if( !requestMsgInfo(token, opts, channelIds) || + waitToken(token, std::chrono::seconds(5)) != RsTokenService::COMPLETE ) + return false; + + GxsMsgMetaMap metaMap; + bool res = RsGenExchange::getMsgMeta(token, metaMap); + summaries = metaMap[channelId]; + + return res; +} + +bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId, + const std::set& contentsIds, + std::vector& posts, + std::vector& comments ) { uint32_t token; RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; - if( !requestMsgInfo(token, opts, chanIds) - || waitToken(token) != RsTokenService::COMPLETE ) return false; + + GxsMsgReq msgIds; + msgIds[channelId] = contentsIds; + + if( !requestMsgInfo(token, opts, msgIds) || + waitToken(token) != RsTokenService::COMPLETE ) return false; + return getPostData(token, posts, comments); } diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 20be70aec..27ab034f0 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -186,10 +186,14 @@ virtual bool ExtraFileRemove(const RsFileHash &hash); std::vector& channelsInfo ); /// Implementation of @see RsGxsChannels::getChannelContent - virtual bool getChannelsContent( - const std::list& chanIds, - std::vector& posts, - std::vector& comments ); + virtual bool getChannelContent( const RsGxsGroupId& channelId, + const std::set& contentsIds, + std::vector& posts, + std::vector& comments ); + + /// Implementation of @see RsGxsChannels::getContentSummaries + virtual bool getContentSummaries( const RsGxsGroupId& channelId, + std::vector& summaries ); /// Implementation of @see RsGxsChannels::createChannel virtual bool createChannel(RsGxsChannelGroup& channel); From 348f88b6ec5e13a6543dc6637a4b468170afa032 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 13 Dec 2018 21:02:32 +0100 Subject: [PATCH 108/110] partially fixed async navigate action in forums --- .../src/gui/gxsforums/GxsForumThreadWidget.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index fb7b3d1be..06e8e4d9d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1494,7 +1494,10 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) QModelIndex source_index = mThreadModel->getIndexOfMessage(msgId); if(!source_index.isValid()) - return false; + { + mNavigatePendingMsgId = msgId; // not found. That means the forum may not be loaded yet. So we keep that post in mind, for after loading. + return true; // we have to return true here, otherwise the caller will intepret the async loading as an error. + } QModelIndex indx = mThreadProxyModel->mapFromSource(source_index); @@ -1847,6 +1850,12 @@ void GxsForumThreadWidget::postForumLoading() #ifdef DEBUG_FORUMS std::cerr << "Post forum loading..." << std::endl; #endif + if(!mNavigatePendingMsgId.isNull() && mThreadModel->getIndexOfMessage(mNavigatePendingMsgId).isValid()) + { + mThreadId = mNavigatePendingMsgId; + mNavigatePendingMsgId.clear(); + } + QModelIndex source_index = mThreadModel->getIndexOfMessage(mThreadId); if(!mThreadId.isNull() && source_index.isValid()) From 117c19b104936c1e18e32a4380bad999cef3cf50 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 14 Dec 2018 22:09:02 +0100 Subject: [PATCH 109/110] fixed a few problems in jumping to next unread post --- .../src/gui/gxsforums/GxsForumModel.cpp | 5 ++++ .../src/gui/gxsforums/GxsForumModel.h | 2 ++ .../gui/gxsforums/GxsForumThreadWidget.cpp | 27 ++++++++++--------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index d3713a1da..35edee9ff 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -664,6 +664,11 @@ QVariant RsGxsForumModel::decorationRole(const ForumModelPostEntry& fmpe,int col return QVariant(); } +const RsGxsGroupId& RsGxsForumModel::currentGroupId() const +{ + return mForumGroup.mMeta.mGroupId; +} + void RsGxsForumModel::updateForum(const RsGxsGroupId& forum_group_id) { if(forum_group_id.isNull()) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h index 58953e263..85714ffa2 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.h @@ -106,6 +106,8 @@ public: // This method will asynchroneously update the data void updateForum(const RsGxsGroupId& forumGroup); + const RsGxsGroupId& currentGroupId() const; + void setTreeMode(TreeMode mode) ; void setSortMode(SortMode mode) ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 06e8e4d9d..f2627ca54 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -532,9 +532,7 @@ void GxsForumThreadWidget::groupIdChanged() mNewCount = 0; mUnreadCount = 0; - mThreadId.clear(); - //mThreadModel->updateForum(groupId()); updateDisplay(true); } @@ -718,7 +716,9 @@ void GxsForumThreadWidget::updateDisplay(bool complete) { saveExpandedItems(mSavedExpandedMessages); - //mUpdating=true; + if(groupId() != mThreadModel->currentGroupId()) + mThreadId.clear(); + updateGroupData(); mThreadModel->updateForum(groupId()); @@ -975,11 +975,7 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) // return; if(!index.isValid()) - { - mThreadId.clear(); - mOrigThreadId.clear(); return; - } RsGxsMessageId new_id(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); @@ -1427,19 +1423,24 @@ void GxsForumThreadWidget::nextUnreadMessage() if(!index.isValid()) index = mThreadProxyModel->index(0,0); + else + { + if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool()) + ui->threadTreeWidget->expand(index); - do + index = ui->threadTreeWidget->indexBelow(index); + } + + while(index.isValid() && !IS_MSG_UNREAD(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::StatusRole).toUInt())) { if(index.data(RsGxsForumModel::UnreadChildrenRole).toBool()) ui->threadTreeWidget->expand(index); index = ui->threadTreeWidget->indexBelow(index); } - while(index.isValid() && !IS_MSG_UNREAD(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_DATA).data(RsGxsForumModel::StatusRole).toUInt())); ui->threadTreeWidget->setCurrentIndex(index); - ui->threadTreeWidget->scrollTo(index,QAbstractItemView::PositionAtCenter); - //ui->threadTreeWidget->setFocus(); + ui->threadTreeWidget->scrollTo(index); changedThread(index); } @@ -1502,7 +1503,7 @@ bool GxsForumThreadWidget::navigate(const RsGxsMessageId &msgId) QModelIndex indx = mThreadProxyModel->mapFromSource(source_index); ui->threadTreeWidget->setCurrentIndex(indx); - ui->threadTreeWidget->scrollTo(indx,QAbstractItemView::PositionAtCenter); + ui->threadTreeWidget->scrollTo(indx); ui->threadTreeWidget->setFocus(); changedThread(indx); return true; @@ -1862,7 +1863,7 @@ void GxsForumThreadWidget::postForumLoading() { QModelIndex index = mThreadProxyModel->mapFromSource(source_index); ui->threadTreeWidget->selectionModel()->setCurrentIndex(index,QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); - ui->threadTreeWidget->scrollTo(index,QAbstractItemView::PositionAtCenter); + ui->threadTreeWidget->scrollTo(index); #ifdef DEBUG_FORUMS std::cerr << " re-selecting index of message " << mThreadId << " to " << source_index.row() << "," << source_index.column() << " " << (void*)source_index.internalPointer() << std::endl; #endif From 60112e8387957130e816649de9e0feaa5d30a81f Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 14 Dec 2018 22:14:59 +0100 Subject: [PATCH 110/110] added two missing virtual desctructors in GXS interface structures --- libretroshare/src/retroshare/rsgxsforums.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index c56074e69..6b8fc0457 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -54,6 +54,8 @@ static const uint32_t RS_GXS_FORUM_MSG_FLAGS_MODERATED = 0x00000001; struct RsGxsForumGroup : RsSerializable { + virtual ~RsGxsForumGroup() {} + RsGroupMetaData mMeta; std::string mDescription; @@ -76,6 +78,8 @@ struct RsGxsForumGroup : RsSerializable struct RsGxsForumMsg : RsSerializable { + virtual ~RsGxsForumMsg() {} + RsMsgMetaData mMeta; std::string mMsg;